Shaders: v_cmp_class_f32 (VOPC 0x088) has no synthetic hardware test #799
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 kss306 on 2026-11-24T11:10:00Z.
v_cmp_class_f32(VOPC opcode 0x088) is fully implemented incrates/victory-shader/src/emit/lower.rsbut has no synthetic hardware test incrates/victory-shader/src/emit/valu_tests.rs. Its siblingv_cmp_class_f16(VOPC 0x08f) has an exhaustive test added in #140.Implementation evidence
lower.rs,compare()at line 5097, handles both types in one branch:The f32 path uses distinct constants (
exp_sh=23,mant_mask=0x7F_FFFF,quiet_bit=0x40_0000) that differ from f16 and are only reachable whenty == "f32".Missing test
valu_tests.rscontainsfn v_cmp_class_f16_matches_rdna2()(line 868) which covers all 10 IEEE-754 binary16 classes usingvop3(0x08f, ...). Opcode0x088(v_cmp_class_f32) does not appear anywhere in the test file.Suggested test
Add
fn v_cmp_class_f32_matches_rdna2()tovalu_tests.rsmirroring the f16 test:The test skips gracefully when no SM 6.6 device is available and runs on WARP. No game data needed.
AI-assisted: found with Kiro (Claude) and independently confirmed by five separate analysis passes without cross-contamination; no hardware run, no game data.
Imported from Marvisak/VIctory. Originally posted by AndyLatimer on 2026-11-24T11:47:08Z.
Added
v_cmp_class_f32_matches_rdna2(all 10 binary32 classes plusabs/negmodifier cases) along with a fix forv_cmp_class_f32flushing denormals / quieting sNaNs underabs/negin #830 (github.com/AndyLatimer/VIctory@e08e6f4664, verified on native Windows 11 hardware GPU + WARP +dxil.dll).Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T11:58:48Z.
Added the requested synthetic hardware test
v_cmp_class_f32_matches_rdna2(VOPC0x088in VOP3) covering all 10 IEEE-754 binary32 classes (including signed sNaN/qNaN, subnormals, signed zeros, normals, infinities), individual bit masks, combined masks (0x1F8,0x060,0x003), zero mask, and ignored high bits (0xFFFF_FC00).External PRs are currently
collaborators_only, so the verified commit (combined with #800 and #802 incrates/victory-shader/src/emit/valu_tests.rs, based onmainffe310e) is ready on my fork:github.com/geiyiliyabumo/VIctory@9a173fcVerification (Windows 11 Pro 26100, AMD Radeon RX 9060 XT driver
32.0.32029.2010+ WARP, Rust1.98.1):rustfmt --edition 2024 --check crates/victory-shader/src/emit/valu_tests.rs: PASScargo xtask policy: PASS (154 files ok)cargo clippy --workspace --all-targets --locked -- -D warnings(default +--features diagnostics): PASScargo test -p victory-shader --locked -- valu_tests: 16/16 PASS (verified on both RX 9060 XT and WARP viarun_cases)cargo test --workspace --locked: PASS (0 failed)AI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by AscilCH on 2026-11-24T12:17:22Z.
Independently reproduced the
abs/negmodifier bug noted in #830 on NVIDIA hardware and prepared a clean standalone commit onmain(ffe310e):github.com/AscilCH/VIctory@8eb2e3fa4aSummary
crates/victory-shader/src/emit/lower.rs(compare): Unifiesf16andf32v_cmp_class_*/v_cmpx_class_*to read raw operand bits (self.src0/operand+sdwa_src) and applyabs(& 0x7FFF_FFFF) beforeneg(^ 0x8000_0000) bitwise rather than viaself.fsrc(), matching RDNA2 ISA semantics.crates/victory-shader/src/emit/valu_tests.rs(v_cmp_class_f32_matches_rdna2): Covers all 10 IEEE-754 binary32 classes plusneg,abs, and combinedabs+neg(-|x|) on normals, zeros,sNaNs, and denormals.Verification (Windows 11, NVIDIA GeForce RTX 3050 6GB Laptop driver
32.0.16.1742+ WARP +dxil.dll10.0.26100.0, Rust1.98.1)ffe310e):v_cmp_class_f32_matches_rdna2failed on RTX 3050 hardware withv_cmp_class_f32(-0x00000001, 0x010) = 0, want 1(negating+denormalthroughfsrc()flushed it to-0.0under DXIL FTZ).8eb2e3f):cargo test -p victory-shader --locked v_cmp_class: 2/2 PASS on RTX 3050 hardware, WARP, anddxil.dllvalidationcargo xtask policy: PASS (154 files ok)cargo clippy --workspace --all-targets --locked -- -D warnings(default +--all-features): PASS (0 warnings)cargo test --workspace --locked -- --skip v_med3_f32_matches_rdna2_with_nan: PASS (excluding only the known pre-existing NVIDIA#726failure)AI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by towiice on 2026-11-24T12:17:30Z.
Adding an NVIDIA Turing hardware verification data point (
GTX 1650 SUPER, 4 GB VRAM, wave32, driver610.88, Windows 11 26300,stable-x86_64-pc-windows-gnullvm):v_cmp_class_f32_matches_rdna2(all 10 IEEE-754 binary32 classes, complement masks, zero mask, and ignored high bits0xFFFF_FC00) on https://github.com/towiice/VIctory/tree/test/valu-f32-class-and-s-bfe-u32 (commitfb441bf).cargo +stable-x86_64-pc-windows-gnullvm test -p victory-shader --lib v_cmp_class_f32_matches_rdna2: 1 passed, 0 failed (2.43 s, both hardware GPU and WARP).Imported from Marvisak/VIctory. Originally posted by Altorru on 2026-11-24T12:17:49Z.
v_cmp_class_f32_matches_rdna2 adds all ten IEEE-754 binary32 classes (sNaN vs qNaN via the bit-22 quiet bit, both zeros, both denormals, both infinities). Implemented in fork PR Altorru/VIctory#1 (upstream PR creation is collaborator-only), commit
bb3a37b. Windows CI passed: cargo test --workspace on https://github.com/Altorru/VIctory/actions/runs/45391712656, where the new test ran on WARP. No game data.Imported from Marvisak/VIctory. Originally posted by studiostephe on 2026-11-24T12:21:27Z.
The suggested test, with the neg-modifier case the f32 path also needs.
compare()'s f32 branch (lower.rs,"f32" | "f16" if op == "class") takes src0 throughfsrc(), which applies thenegmodifier — so unlike the f16 branch (which handles it in-line), the f32 test needs its own neg probe.0x7F80_0001(+sNaN) negated is -sNaN: still class 0.Patch (on
mainffe310e)Verified
#[cfg(all(test, windows))](host GPU harness), so it cannot run on this machine. Cross-compiled it instead:cargo check -p victory-shader --profile test --target x86_64-pc-windows-msvcwith the repo's pinned1.98.1— clean, no warnings.rustfmt --edition 2024 --checkclean.compare()in Python over every case in the test (24 class cases + the neg probe): all match.vop3(0x088, ...)for VOPC 0x088 (opcodes.rs:539), samev_cndmaskextraction via 0x101.So: compiles for the Windows test profile, and the semantics are verified against the lowering line by line — but the GPU run itself (
hardwareandwarpbackends) happens in CI / on a Windows box.AI use: written and verified by qwen3.8_27b running locally on an M1 Mac. No game data used.
Imported from Marvisak/VIctory. Originally posted by Beeak on 2026-11-24T13:08:09Z.
Added a standalone synthetic test for
v_cmp_class_f32(VOPC0x088) incrates/victory-shader/tests/v_cmp_class_f32_test.rs(based onmainffe310e).Since external PRs are restricted on upstream, the verified branch and PR are on my fork:
github.com/Beeak/VIctory@420a3b002bSummary
build_v_cmp_class_f32_cs: builds a synthetic 1-thread GFX10 compute shader executingv_cmp_class_f32_e32 vcc_lo, v1, v2(VOPC0x088), convertingvcc_loviav_cndmask_b32_e64 v0, 0, 1, vcc_lo, and storing the result to a raw UAV; lowers throughir::build->structure::structure->resource::track->io::raise->emit::emitand validates DXIL viaemit::validator::Validatorwhendxil.dllis present.v_cmp_class_f32_lowers_and_validates: verifies lowering, DXIL emission, and validation.v_cmp_class_f32_matches_rdna2(#[cfg(windows)]): executes 47 synthetic(f32_bits, mask, expected)cases across all 10 IEEE-754 binary32 classes (+sNaN/-sNaN,+qNaN/-qNaN,-inf,-normal,-subnormal,-0.0,+0.0,+subnormal,+normal,+inf), covering exact bit masks (1 << cls), 10-bit complements (0x3FF & !(1 << cls)), combined masks (0x003NaN,0x204+/-inf,0x060+/-0.0), empty mask (0x000), and ignored upper bits (0xFFFF_FC00) on SM 6.6 hardware GPU and WARP (respectingVICTORY_D3D12_WARP/VICTORY_WARP=1).Verification (Windows,
rustc 1.98.1, SM 6.6 hardware GPU + WARP)cargo test -p victory-shader --test v_cmp_class_f32_test: 2 passed, 0 failed, 0 ignoredcargo clippy -p victory-shader --all-targets --locked -- -D warnings: cleancargo clippy -p victory-shader --all-targets --all-features --locked -- -D warnings: cleanrustfmt --edition 2024 --check crates/victory-shader/tests/v_cmp_class_f32_test.rs: cleancargo xtask policy:asset policy: 155 files okAll input data was synthetic. No game files were used. AI-assisted with Cline.
Imported from Marvisak/VIctory. Originally posted by jules47800 on 2026-11-25T01:25:16Z.
Covered on main since
328eec1(2026-11-24).class_compares_match_the_hardwareincrates/victory-shader/src/emit/semantics_tests.rsrunsv_cmp_class_f32(VOPC 0x88) over the f32 edge values. It uses each of the ten class bits plus the masks 0x3FF, 0x3 and 0x204, checked against aclass()model that does not flush denormals. It passes on an RX 6600 XT and on WARP at42363ab. The test request is met. Theabs/negmodifier bug is a separate issue, #830 (PR #1327).Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T03:53:44Z.
Automated triage for the maintainers.
Fixed in
main. Commit328eec1(2026-11-24) addedclass_compares_match_the_hardwareincrates/victory-shader/src/emit/semantics_tests.rs. It runsv_cmp_class_f32(VOPC 0x88) on the hardware and WARP over the f32 edge values, each class bit and combined masks. That is the test this issue asks for.The
abs/negmodifier bug found while writing the test is a separate defect, tracked in #830 with open PR #1327. Please send fork branches for it there or as PRs.This issue will be closed in 48 hours unless the reporter replies or a maintainer removes the
triage: proposed closelabel.Generated by Claude Code