Keep the legacy multiply-add zero product positive on AMD #308
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/TaynanGT--Vice-Tay!308
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@Fibrak on GitHub · 2026-11-27 15:22 UTC · original
Fibrak:fix/legacy-mad-signed-zero→main· +10 −2 · 2 files · 5 commits · merged 2026-11-27 16:38 UTCv_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
@TaynanGT on GitHub · 2026-11-27 15:32 UTC · original
@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.