Repository navigation
Conversation
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Same failure as #2229 (likely the same feature branch area). Needs a fix before merge. — Devin |
…)) wrong) amdxc64 on RDNA4 folds Bfrev(Countbits(K)) for a constant K to Bfrev(n) | n (0x80000001 for K = 2). Fold Countbits of constants in bit_count so the driver never sees that pattern. Fixes fuzz seed 1599 on the RX 9070 XT (xcl-dev#2115). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3cf8ef7 to
64eef49
Compare
|
Test report for 64eef49 ("Direct DXIL: fold Countbits of constants"). Tested
Not tested
AI use
|
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
|
@Diskuss a sibling of this fold, for NVIDIA: on an RTX 3070 (driver 616.56) a FirstbitLo / FirstbitHi of a constant ANDed with a product of odd values reads bit 0 as 0 on the direct path (found by fuzzing A change on top of RTX 3070 8 GB, driver 616.56, Windows 11, debug: the test fails 3/3 on AI-assisted (Claude Code, Claude Opus 5.5): found it by fuzzing, wrote the change and test, ran them, wrote this. |
|
Tested Tested
Still failing: seed 722, unchanged: Not tested
AI use: report drafted with Claude (Claude Opus 5.5) from my test runs. |
|
Tested
The one that still fails, deterministically (two runs), is the dynamic form of the shape this PR folds:
|
On the RX 9070 XT (RDNA4), the AMD driver (amdxc64) folds
Bfrev(Countbits(K))wrong whenKis a constant. It givesbfrev(n) | n(n = countbits(K)): for K = 2 that is 0x80000001 instead of 0x80000000. This is the cause of fuzz seed 1599 (62 mismatches) and offuzz_validate_and_gpu_3failing on this card.Shader::bit_countnow foldsCountbitsof a constant itself, so the driver never sees that pattern. The reduced HLSL repro and the analysis are in #2115 (comment).Part of #2115
What is in it
crates/xcl/src/gpu/dxil/module.rs:Module::int_const, which reads the value of an integer constant.crates/xcl/src/gpu/dxil/ops.rs:Shader::bit_countfoldsCountbitsof a constant, masked to the operand's width.crates/xcl/src/gpu/dxil/ops_tests.rs: new testbfrev_of_countbits_of_a_constant_matches_cpu, which compares the GPU result with the CPU.Tested
cargo test -p xcl --lib -- --test-threads=4:64eef49, onmain2898511): 1284 passed, 1 failed, 26 ignored.main2898511on the same machine: 1282 passed, 2 failed, 26 ignored.fuzz_validate_and_gpu_3now passes, and the new test is counted.mainand is not touched here:fuzz_validate_and_gpu_1, seed 722,res[30] = 0x1, CPU 0x7fffffff. Shaders: preserve first active lane reads across divergent switches #2192 covers it.bfrev_of_countbits_of_a_constant_matches_cpuandfuzz_validate_and_gpu_3alone (--test-threads=1): both pass.pso_measurement_compiles_an_exact_synthetic_record(Developer Mode is off).f16_programs_on_the_gpu/f32_programs_on_the_gpuper-lane cases (refused ops).Regression run
main:This PR:
The title is The Matrix Awakens. On
main(4d44186) and on this PR it dies the same way, about 1.5 to 3.5 s in: the title'sCreateCommandSignature(DispatchIndirectMesh) fails, then it reads a null pointer (0xc0000005). That is fixed only in #1887. So this run shows no new crash and no device removal, but it never reaches a shader that this change affects.Not tested
2898511(only-p xcl --libwas rerun; the change is in that crate).Countbits(zext((in & 0) | 2)). The translator does not see those as constants.AI use
🤖 Generated with Claude Code