You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
codegen: computed_store_rooting tier assertions fail intermittently when runtime+codegen are tested together #8658
Three expr::computed_store_rooting_tests cases fail intermittently when perry-runtime and perry-codegen are tested in one cargo invocation under RUST_TEST_THREADS=1:
Machine load was 52-68 across both sets, so load alone does not separate them.
It is a combination trigger, not the tests themselves
-p perry-codegen --lib alone, withRUST_TEST_THREADS=1: passes on both trees.
-p perry-codegen --lib alone, unfiltered, no flag: passes, repeatedly.
Filtering to -- computed_store_rooting_testsalways passes — the filter changes the experiment, so a filtered re-run is not a valid reproduction attempt.
Only "both crates in one invocation + RUST_TEST_THREADS=1" reproduces it.
Why this is worth a look beyond test hygiene
These assertions are about which optimization tier codegen selected — e.g. inert.contains("masked_region.ta_i32.preheader"), !collecting.contains(...). They compile a snippet and inspect the emitted IR; no runtime code executes. A runtime-only change cannot affect them semantically.
So a tier choice that flips depending on what else is running on the machine implies codegen is not fully deterministic under load. That is the part worth understanding: a compiler whose optimization tier depends on ambient load will produce different binaries on a busy CI runner than on a quiet one, and any A/B measurement across such a boundary is unreliable.
Two possibilities worth separating:
a compile-time budget or timing-sensitive heuristic in the tier decision (would explain load sensitivity directly); or
shared mutable state between the two test binaries — though they are separate processes, so this needs a concrete mechanism.
Note
Reported at merge time of #8657 rather than silently: main was 0/12 and the stack 3/12, so I could not honestly call it pre-existing, and each constituent PR was clean alone. If it turns out to be (1), it predates all of them.
I filed this as "codegen tier choice is load-dependent" after seeing 3/12 intermittent failures while validating #8657. It is not nondeterminism. It is a deterministic breakage I introduced in the #8657 squash, and the intermittency I measured was masking it rather than describing it.
#8650 changed unary + on a non-numeric operand to emit js_dynamic_pos instead of js_number_coerce (expr/unary.rs, UnaryOp::Pos) and updated the three tests asserting on that helper. The squash kept the emission change and dropped the test edit.
Closing. If genuine tier nondeterminism exists it needs its own evidence; the numbers in this issue do not show it, and I should not have offered that explanation before bisecting the merge.
Activity
test(codegen): restore the unary-pos assertions lost in the #8657 squ…
proggeramlug commentedon Aug 23, 2026
Re-scoping this — my original premise was wrong.
I filed this as "codegen tier choice is load-dependent" after seeing 3/12 intermittent failures while validating #8657. It is not nondeterminism. It is a deterministic breakage I introduced in the #8657 squash, and the intermittency I measured was masking it rather than describing it.
#8650 changed unary
+on a non-numeric operand to emitjs_dynamic_posinstead ofjs_number_coerce(expr/unary.rs,UnaryOp::Pos) and updated the three tests asserting on that helper. The squash kept the emission change and dropped the test edit.Bisect:
c2da0343906e1ab349(#8657)2382a9f15Each of #8657's five PRs alone: 0/3. All five re-merged together: 0/3. Only the landed squash fails.
Fixed by #8669 — 0/3 after.
Closing. If genuine tier nondeterminism exists it needs its own evidence; the numbers in this issue do not show it, and I should not have offered that explanation before bisecting the merge.