Skip to content

test_mutations: re-anchor v_mul_legacy_f32 on the post-flush handler - #4674

Closed
Atomic258 wants to merge 1 commit into
ItsNotRexed:mainfrom
Atomic258:mutations-mul-legacy-anchor
Closed

Atomic258 wants to merge 1 commit into
ItsNotRexed:mainfrom
Atomic258:mutations-mul-legacy-anchor

Conversation

@Atomic258

Copy link
Copy Markdown
Contributor

The v_mul_legacy_f32 mutation's anchor still matched the pre-denormal-flush handler (self.src_f(a[1]), self.src_f(a[2]), OpSelect ... {m}). Main's translator rewrote the op — flush_f32 operands, clamp_mods, the omod -0 path — so test_anchors_match_crlf_translator_copies and test_each_mutation_is_caught both failed on a clean main (mutation anchor must occur exactly once).

Fix: re-anchor on the current emit block. The anchor now starts at the x, y = ... line instead of the elif + comment lines, so a future comment rewording can't silently unmatch it again (that is how this one broke). The mutation itself is unchanged in intent: OpSelect %float {either} %f0 {self.flush_f32(m)} becomes OpCopyObject %float {self.flush_f32(m)}, dropping the zero-times-anything guard while keeping the flush.

Verified on this branch: python -m unittest discover -s tests/semantic -p "test_mutations.py" -v — 3/3 pass (was 2 failures on d0835dd9), including test_each_mutation_is_caught, so test_ps_legacy_mul still catches the mutated translator.

AI-assisted (Devin).

The denormal-flush rewrite of v_mul_legacy_f32 left the mutation's
anchor pointing at the old src_f body, so both mutation tests failed
on main. Anchor on the emit block only, from the x, y line, so future
comment wording can't unmatch it again.

AI-assisted (Devin).
@shdann

shdann commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

AI-assisted. Current main already applies the same mutation. I compared f80f029 with main at 3eb4410. The old PR base d0835dd predates the fix in 06b47de.

I applied each version of the v_mul_legacy_f32 rule to the same copy of tools/rdna2spirv.py from 3eb4410. Each anchor matches exactly once. Both replacements produce identical translator source. Both rules select test_ps_legacy_mul to detect the change. Main uses a shorter anchor for the same two emitted instructions.

You can close this as covered by 06b47de. Resolving the merge conflict would add no new mutation coverage.

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran this at f80f02940 on Windows 11 with LLVM_MC set: tests/semantic/test_mutations.py -> 3 tests, OK (112 s) — the suite is green again with this anchor.

Duplicate: this is the third PR re-anchoring the same v_mul_legacy_f32 mutation; #3883 (earlier, narrow) and #4527 (broader, "semantic suite goes green") carry nearly identical anchor text, and all three conflict in tests/semantic/test_mutations.py. On main 7b7d73f89 the test still fails 2 of 3, so one of the three should land promptly; #3883 is the earliest claimant, this one has the freshest evidence that a rebased anchor passes. Flagged on the others previously.

@Atomic258

Copy link
Copy Markdown
Contributor Author

Covered on main by the round-43 merge (06b47de) — the anchor now targets the OpLogicalOr/OpSelect tail and test_mutations is green at 0db7fed. Closing as redundant.

@tupacfan04

Copy link
Copy Markdown
Contributor

Close as superseded: origin/main already carries this fix.

tests/semantic/test_mutations.py:70-76 now anchors at the OpLogicalOr/OpSelect lines with the OpCopyObject ... self.flush_f32(m) mutant, and the merge is CONFLICTING on exactly that hunk (the branch is 912 commits behind). Both suites pass - the branch (3 tests / 26 subtests, 270 s) and main (2 tests / 13 subtests, 147 s) - the PR's anchor matches main exactly once, and the old pre-flush anchor appears 0 times, so the original failure was real but is already resolved.

No code change needed. AI-assisted review, no game files, no GPU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants