Repository navigation
Shaders: cube-map face coordinates read denormals as zeros - #1766
Conversation
v_cubeid/sc/tc/ma_f32 pick a coordinate (or its negation) as the result, so a denormal coordinate came out as the host's: kept on AMD, flushed to -0 on WARP, where the console's float mode reads it as a zero of its sign. The coordinates now go through ftz first, as min and max's operands do (77053a0). A semantics probe runs the four over signed zeros, denormals, infinities and NaN in each coordinate (14,440 inputs) against the RDNA2 model. Without the change: 2,193 model mismatches on an RX 9070, 1,276 on WARP, and the two disagree on 917. Found by the cross-device fuzzer (Marvisak#1614). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
VIctory V2: community PRs, merged and testedOpen PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch. Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1). Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help: Unofficial community fork of Marvisak/VIctory, GPL-3.0. |
catminou4
left a comment
There was a problem hiding this comment.
Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (70564ae), cargo test -p victory-shader --locked → 118 passed, 0 failed. Hardware/valu/waterfall execution tests are #[cfg(all(test, windows))] and run only on Windows.
Cube-map face coordinates read denormals as zeros: cube()/cube_probes() + cube_faces_match_the_hardware pins face-coordinate denormal behavior against hardware. Small, precise fix with a hardware test.
|
Overlap for the reviewers: #1709 (Calvix2k, opened 21:03, rebased onto AI-assisted (Claude Code). |
|
@upipibi thanks. #1709 came first and makes the same input flush, so only one of the two should merge. The real difference is that #1709 also flushes the result. I will check on the RX 9070 and the gfx1036 whether the hardware flushes |
|
Follow-up on the #1709 overlap: the two PRs behave the same. #1709's extra
So either change is correct. #1709 was opened first. This PR adds a |
|
Automated triage for the maintainers. Merge candidate. The new head only merges Agreed with the reply: either change is correct, and the choice between this and #1709 is the maintainer's. CI: passing ( Generated by Claude Code |
|
Understood — whichever the maintainer picks, the other closes. #1709 is green and mergeable; if it lands first, moving your |
Apply complete, uniquely matching upstream hunks in dependency order, preserving fork-specific raw structured buffer lowering and configurable descriptor capacity. Defer incompatible shader ABI and cross-module changes until GPU reconciliation. 704d25e Shaders: v_mul_legacy_f32 treats denormal operands as zero (Marvisak#682) cc7ec2a Shaders: 64-bit integer compares on their dwords (AMD orders a shared-dword i64 compare wrong) (Marvisak#1599) 77fd819 Shaders: cube-map face coordinates read denormals as zeros (Marvisak#1766) 084d4ff Shaders: round full-width unsigned integer conversions once (Marvisak#2186) f3578e3 Shaders: decode f16 inline float constants in whole-wave v_add_f16 simulation (Marvisak#2493)
v_cubeid/sc/tc/ma_f32return one of the coordinates, or its negation. So a denormal coordinate comes out as the host chooses:v_cubesc_f32(0, NaN, 0x00000001)gives0x80000001on an RX 9070.0x80000000.mainmodels it since 77053a0 (32-bit denormals flushed on input and output), reads it as a zero of its sign.min/maxoperands already go throughftz(77053a0). The cube coordinates didn't.Change
The three coordinates go through
self.ftzbefore the major-axis compare and the pick (lower.rs, the cube arm).Test
semantics_tests::cube_faces_match_the_hardwareadds a probe family in the existing framework:triples(F32_EDGES, F32_EDGES, F32_THIRD), i.e. 14,440 inputs with signed zeros, denormals, infinities and NaN in each coordinate;cube(): the major-axis rule from the ISA, with coordinates read throughftz.main@70564aev_cubesc_f32alone)Checks
On Windows 11 with the RX 9070:
cargo test --workspace --lockedpasses 475 (main: 474, plus this probe);mainitself with the SDK's 1.7dxil.dll(rect::tests::rectangles_get_their_fourth_corner,tests::elements_sharing_a_row_keep_their_order; see Test report: RTX 5070 (Blackwell), Windows 11, 70564ae: 471 passed, 5 failed, 7 ignored (4 from the 1,000,000 view heap cap) #1744).Found by the cross-device fuzzer in #1614. It is the remaining denormal case after 77053a0 (FIND-4 in #1633).
🤖 Generated with Claude Code