shader: v_fmac/v_mac's accumulator takes its VOP3 abs/neg bits; a level query reads no array slice #2387
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2387
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2387"
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?
@FIocker on GitHub · 2026-11-29 12:36 UTC · original
FIocker:contrib/fmac-acc-mods-lod-slice→main· +16 −2 · 1 files · 1 commits · merged 2026-11-30 14:12 UTCTwo translator fixes in
emit/lower.rs:absandnegbits (bit 2 of each field) were dropped, so the sign is wrong wherever the title sets them. They are now applied to the accumulator. After SmokinDoinkV1 (GPL-3.0).Checked: workspace check clean;
victory-shaderlib tests 462 passed (release, together with the two other open translator/HLE fixes from this account). Also played in our local fork since 2026-11-28 with no regressions seen.🤖 Generated with Claude Code
@Dukestar69 on GitHub · 2026-11-29 12:49 UTC · original · approved these changes
Tested locally merged onto
main(829188e9).crates/victory-shader/src/emit/lower.rs.cargo test -p victory-shader --lib emit::tests::passed (26 passed; 0 failed; 1 ignored).cargo test -p victory-shader --lib emit::lower::tests::passed (25 passed; 0 failed; 1 ignored).Clean RDNA2 VOP3
abs/negaccumulator handling forv_fmac/v_macand level-query array-slice fix. LGTM.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@Lyrnc on GitHub · 2026-11-30 06:11 UTC · original
Checked the
v_fmac_f32half of this against a Radeon gfx1036 (RDNA 2) running the same kernel natively, and ran the translator's output for main and for this PR on an RTX 5080 and on that Radeon through D3D12. The level-query half (imageop == 81) is not covered here.Setup
mainat41adb551with this PR's head (1799baa) merged locally, no conflict. The victory-shader test binary was built from that merged tree (own tree and target directory).v_fmac_f32forms are raw encodings (opcode 0x12B, the src2 field 0,abs/negbit 2 set for the accumulator).super::emit(32-lane host),dxil.dllvalidation, dispatched on the 5080 and on the Radeon (VICTORY_ADAPTER=radeon).Case
fmac_src2_mods: a in {1, 2, -1, 0.5}, b in {3, -5, 0.25, 7.5, 1e-3, -2, 100, 0}, the accumulator c in {1, -1, 4, -4, 0, -0, 10, -0.125}, mixed over the 64 lanes. Outputs (vdst holds c before each):The hardware column matches that formula in all 512 values, signed zeros included: the accumulator does take the VOP3
abs/negbits 2.Results (values that differ from the gfx1036, out of 64 lanes x 8 outputs)
Main drops the accumulator's bits on both cards (the same values on each), every lane where they change the result: lane 0 (a = 1, b = 3, c = 1) gives v11 = 4.0 where the gfx1036 gives 2.0, v15 = -2.0 where it gives -4.0; lane 3 (a = 0.5, b = 3, c = -0.125) gives v12 = 1.375 where it gives 1.625. The bits on sources 0 and 1 were already applied.
Verdict: correct for
v_fmac_f32: all 512 values exact on both cards, signed zeros included (2 of the results are -0, 22 are +0). The other wave32 cases in the run give the same values as main.Not covered:
v_mac_f32(the same code path in this PR, no case here) and the level-query change.AI use: Claude Code (Claude Opus 5.5) ran the oracle and host cases and wrote this comment.