Symptom
cargo test -p perry-codegen --test typed_feedback fails 5 of 15 when the suite runs as one process, and every one of the 5 passes when run alone:
- typed_feedback_guards_direct_class_field_specialization ("class-field raw fallback must be coerced before the numeric merge", typed_feedback.rs:369)
- typed_feedback_guards_direct_class_method_specialization
- typed_feedback_instruments_property_and_method_boundaries
- typed_feedback_marks_numeric_array_literals
- typed_feedback_trace_dump_runs_before_entry_return
Deterministic under --test-threads=1 (so it is intra-process order dependence, not thread races); under default parallelism the failing set additionally wobbles (other tests like full_outline_ic_* join/leave the set run to run).
Verified identical on main @ c9e11ea, at c9e11ea~1, and on an unrelated runtime-only branch — long-standing, not introduced by any of this week's merges. Host: arm64 macOS, debug profile, coherent workspace target dir.
Why nobody sees it
Integration suites under crates/*/tests/*.rs do not run per-PR (nightly/tag only — the CLAUDE.md pitfall). And a plain cargo test -p perry-runtime -p perry-codegen without --no-fail-fast stops at the first failing target, so a log tail looks like a complete run with one unrelated failure.
Likely shape
Process-global codegen state (typed-feedback site registry / IC epoch / class-keys tables) leaks between in-process compiles, shifting emitted IR for whichever test compiles later. The fix is per-test isolation of that state (reset hook or unique-per-test module keying), not loosening the asserts.
Acceptance
cargo test -p perry-codegen --test typed_feedback green as a full suite, both default and --test-threads=1, ×3 consecutive runs.
Symptom
cargo test -p perry-codegen --test typed_feedbackfails 5 of 15 when the suite runs as one process, and every one of the 5 passes when run alone:Deterministic under
--test-threads=1(so it is intra-process order dependence, not thread races); under default parallelism the failing set additionally wobbles (other tests likefull_outline_ic_*join/leave the set run to run).Verified identical on
main@ c9e11ea, at c9e11ea~1, and on an unrelated runtime-only branch — long-standing, not introduced by any of this week's merges. Host: arm64 macOS, debug profile, coherent workspace target dir.Why nobody sees it
Integration suites under
crates/*/tests/*.rsdo not run per-PR (nightly/tag only — the CLAUDE.md pitfall). And a plaincargo test -p perry-runtime -p perry-codegenwithout--no-fail-faststops at the first failing target, so a log tail looks like a complete run with one unrelated failure.Likely shape
Process-global codegen state (typed-feedback site registry / IC epoch / class-keys tables) leaks between in-process compiles, shifting emitted IR for whichever test compiles later. The fix is per-test isolation of that state (reset hook or unique-per-test module keying), not loosening the asserts.
Acceptance
cargo test -p perry-codegen --test typed_feedbackgreen as a full suite, both default and--test-threads=1, ×3 consecutive runs.