Keep the legacy multiply-add zero product positive on AMD #308
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/308"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from TaynanGT/Vice-Tay. Originally posted by Fibrak on 2026-11-27T15:22:55Z.
v_mad_legacy_f32andv_mac_legacy_f32treat a zero factor's product as +0, so0 × -1 + (-0)must give +0. On an RX 6900 XT (RDNA2, driver 32.0.21045.29003) the hardware backend oflegacy_multiply_adds_fuse_their_product_and_flush_their_sourcesreturned -0 for case 4. WARP and CI pass, so this only shows on an AMD card.The zero-factor path formed the result as an
faddof +0 and the accumulator, and the AMD driver returned -0 for+0 + -0there. The lowering now selects the +0 bit pattern when the flushed accumulator is -0. NaN, infinity and subnormal flushing behave as before, and nonzero factors keep the fused path, so cases 0–3 are unchanged. The test expectations are unchanged.v_mul_legacy_f32passes its test on the same card and is left as it is.TRANSLATOR_VERSIONgoes to 9: with the fix at version 8,victory shaderstranslated the title's 25,790 cached shaders again and 162 came out different.Testing on the RX 6900 XT
cargo test --locked -p victory-shader --lib: 325 passed, 0 failed (was 324 passed, 1 failed).cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: clean.cargo test --workspace --locked --no-fail-fast: one failure invictory-gpu,shadow::loose_allocation_tests::exact_eviction_keeps_held_entries_and_uses_publish_time_tick. It passed 5 times alone and in 3 fullvictory-gpuruns, so it looks flaky and is unrelated to this change.VICTORY_RELAY=0(relay modes 1 and 2 reset this card, #138): 4.3 minutes in the world, median 8.6 rendered FPS at about 4,500 draws a frame, no errors, no warning kinds absent from amainrun on the same settings, clean exit. Checked by eye while playing, with no visible problems; not recorded.🤖 Generated with Claude Code
Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T15:32:03Z.
@Fibrak The hardware signed-zero test is the right regression for this change. The 162 changed translations also make the cache bump necessary. #300 fixes the shared-clock test that failed in your workspace run. Current main has moved past translator version 9, so the signed-zero build needs a new cache version on its updated base.