Repository navigation
Conversation
# Conflicts: # crates/victory-shader/src/emit/mod.rs
|
Updated against latest Re-verified on Windows 11 ( |
|
Your tests only work on Intel hardware.... I don't have an Intel GPU Do a small test checking that |
|
Tested
|
|
AI-assisted. Thanks for the feedback @raffclar! Added a hardware-independent unit test (\emit::lower::tests::med3_f32_emits_dxil_isnan_instead_of_fcmp_uno) that lowers \�_med3_f32\ and inspects the emitted DXIL module directly to verify it emits \dx.op.isSpecialFloat.f32\ (opcode 8, \IsNaN) and does not emit \cmp uno\ (\pred::UNO). Verified \cargo xtask policy\ (151 files ok) and \cargo test -p victory-shader\ (69/69 passed). |
…old fcmp uno Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Cross-checked
|
Summary
Replaces
fcmp unoinLower::med3()(crates/victory-shader/src/emit/lower.rs) with DXIL's explicitdx.op.isSpecialFloat.f32(IsNaN, opcode 8).On Intel Iris Xe D3D12 (
8086:46a6, driver32.0.101.7088), the shader compiler foldsfcmp uno third, thirdtofalseunder default shader fast-math, causingv_med3_f32(1.0, 2.0, NaN)to returnmedian(2.0,0x40000000) instead ofleast(1.0,0x3f800000) as RDNA2 specifies. Discovered while running #37's synthetic GPU VALU tests on Intel Iris Xe.Using
dx.op.isSpecialFloat.f32(8, x)preserves NaN detection across Intel Xe and NVIDIA drivers without conflicting with #37'sfract()hunks.Verification
Tested on Windows 11 (
rustc 1.100.0,x86_64-pc-windows-gnullvm):main@35b054ec0lower.rson Intel Iris Xe8086:46a6, driver32.0.101.7088):cargo test -p victory-shader med3_uses_dxil_isnan_for_nan_operands-> FAILED:v_med3_f32(1.0, 2.0, NaN) got 0x40000000, want 1.cargo test -p victory-shader-> 58 passed, 0 failed (includingmed3_uses_dxil_isnan_for_nan_operands).valu_tests:8086:46a6): 7/7 passed (previously 6/7)10de:24e0, driver616.64): 7/7 passedcargo xtask policy: 150 files ok (synthetic GFX10 shader only; zero game data).cargo clippy -p victory-shader --all-targets: 0 new warnings.AI-assisted.