fix: match RDNA2 rounded f32-to-i32 conversions in VIctory #321
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!321
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-321"
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?
@mauroalvare on GitHub · 2026-11-26 02:50 UTC · original
mauroalvare:codex/victory-rounded-f32-i32→main· +122 −21 · 2 files · 1 commits · openChange
Neptune lowered
v_cvt_rpi_i32_f32as a binary32 add of 0.5 followed by floor. On the RTX 5070 Ti, the float immediately below 0.5 returned 1 where the RDNA 2 result is 0. The same shader also returned 0 for a positive NaN, which should saturate toINT32_MAXin the rounded forms.Use the in-tree HLSL recompiler's floor-and-fraction rule for RPI and apply the source modifiers at the bit level for the rounded conversions. RPI and FLR select the saturation endpoint from the resulting NaN sign. The fixtures also cover truncating conversions as a NaN-to-zero control.
The change is in the Rust DXIL emitter used by Neptune through
tools/lancer_victory.ps1.Verification
Base
c4c93bdc413191a9dc909998d2d53080a3f0c880. Fixc6385d8cb05f59f774b32076818899e9f57456cc.The synthetic shaders take f32 bits from root constants and store one converted dword to a UAV. The SDK DXIL validator accepted the shaders and the D3D12 pipelines ran on the RTX 5070 Ti (driver 621.40, 32-lane waves) and WARP (4-lane waves). The fix matched all 112 expected outputs per adapter. The cases include VOP1 and VOP3, halfway values, large odd integers, saturation limits, infinities, and quiet and signaling NaNs under the four VOP3 abs/neg combinations. The AnyXboxX interpreter independently agreed on the same 112 expected outputs.
From
third_party/victory:The shader suite also reports four console-compiler comparisons that skip locally and two adapter-specific skips in existing wave-sum tests.
From the repository root, with
ANYXBOXX_REQUIRE_RUNTIME=1, the SDK's DXC, and the C++/Rust/TomBox binaries already built in this worktree from the same base:Oracle and test data
All shader words and inputs are constructed in the tests. AMD's ISA defines the conversion rules, and Lyrnc's published gfx1036 measurements establish the exact RPI threshold and NaN saturation. The original Rust change here also verifies VOP3 source sign modifiers in Neptune on Windows. AMD RDNA 2 ISA, §12.8 · gfx1036 measurements · In-tree HLSL reference
AI assistance from OpenAI Codex for investigation, implementation and validation.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.