Factoring out recompute-outputs-dirty duplicate logic