Shaders: lower binary64 class comparisons #1468
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1469"
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 Marvisak/VIctory. Originally posted by Luizbc2 on 2026-11-24T18:16:49Z.
What changed
Translate
v_cmp_class_f64andv_cmpx_class_f64using the existing classification and lane-mask path. The two source words stay asi32, so the low payload participates in distinguishing infinities from NaNs and zero from subnormals, without requiring host driver FP64 support. Source abs/neg only update the sign bit. The FP64 arithmetic and ordered compares are covered separately by #1262.Reproduction and tests
ffe310e, the syntheticv_cmp_class_f64_preserves_all_binary64_classestest fails at shader lowering withUnsupported { offset: 44, what: "v_cmp_class_f64" }.cargo test -p victory-shader --lib --locked --offline v_cmp_class -- --nocapturepassed on Windows with the patch. The new test exercises all ten class bits, negative masks, low-word-only payloads, SGPR input, and abs/neg. The existing binary16 test also passed. The compute cases ran on hardware and WARP.git diff --checkpassed.AMD RDNA 2 ISA reference
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T18:42:13Z.
Review: APPROVED
Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (
ffe310e),cargo test -p victory-shader --locked→ 96 passed, 0 failed. Execution/valu tests are#[cfg(all(test, windows))]and were not run here; lowering/structure coverage only.v_cmp_class_f64/v_cmpx_class_f64keep both dwords as i32 and classify on the pair, with abs/neg applied to the sign dword only. The new valu test covers all ten binary64 classes (signaling/quiet NaN with low-word payloads, infinities, normals, denormals, ±0) plus an abs-then-neg SGPR-pair case — exactly the payload-sensitive cases. macOS 96 passed (execution test is Windows-only).Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T18:21:16Z.
Verified commit \
ed9f8c6\ on Windows 11 / AMD Radeon RX 9060 XT (RDNA4, SM 6.6) + WARP:eg\ sign-bit masking on the high dword; all look consistent with RDNA2 / GFX10.3 ISA.
AI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by AnoHunted on 2026-11-24T18:38:08Z.
Independent NVIDIA hardware run. No game files were used.
Machine: Windows 11, NVIDIA GeForce RTX 5080, Rust 1.98.1, DXC
dxil.dll1.9.2609 (SDK 10.0.26100) validating.cargo test -p victory-shader --features host -- --test-threads=1with this PR:v_cmp_class_f64_preserves_all_binary64_classesexecutes viarun_caseson the RTX 5080 (and WARP) and passes; every binary64 class (inf / NaN / zero / subnormal) checks out, so this adapter's FP64 path is exercised (not skipped).Not tested: the in-game effect; AMD.
Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-24T20:43:50Z.
Offline measurement on a retail dump, and the shader tests on Ada
Result: no count change against
main.Offline. I merged head
ed9f8c6ontomainffe310e(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 21,724 onmain, 21,724 with this PR.No program changes its failure reason either. That is the expected result for a fix whose instructions sit behind the earlier failures on
main. The count shows that the change rejects nothing. It does not show whether the output is right.Tests: with the same merge,
cargo test --locked -p victory-shader --libpassed 121, failed 0. The bitcode benchmark is ignored, as onmain, where 120 pass. The run was on an RTX 4070 SUPER (Ada, 32-lane waves, driver 32.0.16.1088), the default adapter, withVICTORY_WARPunset.No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:29:19Z.
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting:crates/victory-shader/src/emit/valu_tests.rs). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T11:00:26Z.
The conflict with
940d32fis between adjacent tests invalu_tests.rs. I rebased the existing loweringb277c15and the existing test412c14dwith your Git authorship intact. The test is inserted alongside the tests thatmainadded.I added a separate
c07eb2bto exercise thev_cmpx_class_f64EXEC update. Its WARP readback sees a write for the matching class and the untouched output for a non-matching class. All 30 VALU tests pass with DXIL validation and app-local WARP. Strict shader Clippy and the staged asset policy pass. If you fold the EXEC test into another commit, please retainCo-authored-by: andrewpozdnakov7-jpg <[email protected]>.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.