Repository navigation
Conversation
|
Tested
No game data used. |
AntoninMichelq
pushed a commit
to AntoninMichelq/VIctory
that referenced
this pull request
Nov 24, 2026
…and self float compares) into the integration Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
Contributor
|
Ran
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #110 (
med3): extendsLower::compare()incrates/victory-shader/src/emit/lower.rsto use DXIL'sdx.op.isSpecialFloat.f32(IsNaN, opcode 8) for floato(ORD),u(UNO), and same-operand NaN-sensitive comparisons (eq,le,ge,neq,nge,nle).On Intel Iris Xe D3D12 (
8086:46a6, driver32.0.101.7088), the driver's DXIL compiler assumes no NaNs for plain LLVMfcmp, causing all 10 of these cases to return the wrong result onmain@9aef3d9:v1 = NaN, v2 = 1.0):v_cmp_o_f32returns1(want0),v_cmp_u_f32returns0(want1).v1 = NaN, v1 = NaN— standard shaderisnan(x)/!isnan(x)idioms):v_cmp_eq_f32,v_cmp_le_f32,v_cmp_ge_f32,v_cmp_o_f32all return1(want0), andv_cmp_u_f32,v_cmp_nge_f32,v_cmp_nle_f32,v_cmp_neq_f32all return0(want1).Because
fsrc()may emit two separatebitcastinstructions for the same source register (which host CSE then merges intofcmp ... %f, %f),same_srcchecks both SSA equality and identical source operands/modifiers.Verification
Tested on Windows 11 (
rustc 1.100.0,x86_64-pc-windows-gnullvm, Intel Iris Xe8086:46a6driver32.0.101.7088+ WARP):main@9aef3d9lower.rswith the new test):cargo test -p victory-shader v_cmp_f32_nan_matches_rdna2-> FAILED:hardware: v_cmp_eq_f32(same reg, case 0) = 1, want 0(and all 9 other cases above fail on hardware while passing on WARP).cargo test -p victory-shader v_cmp_f32_nan_matches_rdna2-> ok on both Intel Iris Xe and WARP.cargo test -p victory-shader -- --skip v_med3_f32_matches_rdna2_with_nan-> 69 passed, 0 failed (skipping only the pre-existingmed3failure fixed in Shaders: use DXIL IsNaN in med3 so Intel Xe does not fold fcmp uno #110).cargo xtask policy: 151 files ok (synthetic GFX10 shader only; zero game data).AI-assisted.