Direct DXIL: geometry mode, MSAA loads and directed f32 rounding #1679
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1679
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1679/head"
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?
@bmjask on GitHub · 2026-11-24 19:14 UTC · original
bmjask:shaders/direct-dxil-followup→main· +3779 −24 · 20 files · 12 commits · merged 2026-11-24 22:07 UTCFollow-up to #1426.
What is in it
lower_geom.rs,kernel::translate_geometry,cfg::Cfg::build_geometry): the recompiler'sMode::Geometrycompute pass as direct DXIL — the ES for the three vertices of 21 triangles per group,s_setpc_b64into the GS,s_sendmsgGS emit / cut building strip triangles per lane, the mesh record written after wave prefix sums. The split wave64 form runs the ES in both hardware waves, then a group barrier and the GS in the lower wave, as the HLSL kernel does.pso::console_geometrytries it underXCL_DIRECT_DXIL=1(logged HLSL fallback); coverage routesMode::Geometry. Sweep: 200/200 incl. all 3 GS programs.CfgBlock::pcis kept for irreducible-CFG split copies.image_msaa_loadreads samples fragment..fragment+3 — this ISA reading is not confirmed on hardware); runnerTexDim::D2Ms.MODEround toward +inf / -inf / zero,lower_round.rs): direct path only — the HLSL path lacks it.dxil/fuzz_tests.rs, left out of #1426 only for GitHub's diff-size limit) plusamd_reduced_seeds(ignored) reproducing seeds 722 / 1599 on AMD. Seed 722 is suspected to be the driver movingWaveReadLaneFirstinto a divergent switch. @HKEY-Funk-Machine / @emirduran707, could you runcargo test -p xcl --lib gpu::dxil::fuzz_tests::amd_reduced_seeds -- --ignored --nocaptureon your AMD GPUs and post the output?geometry_mode_validates,geometry_tests::{geometry_forms_validate, gpu_geometry_direct_records}(per-lane loops + cuts against a model), MSAA and rounding tests, the direct check ingpu_geometry_wave32_prefix_count_over_a_mask.TRANSLATOR_VERSION4 → 5.Tested
cargo test -p xcl --lib gpu::dxil: 100 passed, 0 failed, 3 ignored.XCL_DIRECT_DXIL=1and=allcargo test -p xcl --lib gpu::recomp: 261 passed, 0 failed, 18 ignored each.cargo build --workspace && cargo test --workspace -- --test-threads=4: 975 passed, 0 failed, 45 ignored (23 SKIPPED lines on this GPU: wave64-only GPU comparisons "no wave64", three f16/f32 forms the per-lane path refuses,ir_text_assembles_signs_and_runs: no dxil.dll,heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows). Clean run after merging main (incl. #1806, #1747 and theLw::newrefactor); TRANSLATOR_VERSION bumped to 7 (main's 6 + 1).xcl shaders D:\game\shaders.rpf --direct --sample 200 --seed 1 --max-bytes 0 --timeout 10 --validate --compare(release): 200/200 translated + validated (CS 21, GS 3, MS 67, PS 86, VS 23); translation time p50 136 ms, p95 1636 ms, max 4775 ms (measured while other builds were running, so on the high side); DXIL size direct 30.3 MB vs HLSL+DXC 24.2 MB (1.25×).Regression run
scripts/smoke.ps1 -Game D:\game -Seconds 60withXCL_PRESS_AT=2:B,4:B,6:B,8:B(B pressed at 2/4/6/8 s to skip splash screens) andXCL_PRESS_A_AT=10,15,20,25,30,40(A pressed to enter the intro), release builds on a quiet machine: PR 1478 frames vs 1511 on main (98 %), peak commit 20855 MB vs 20218 MB (103 %), no device removals or crashes. The PR ran right after the TRANSLATOR_VERSION bump (cold translation cache) and still reached 98 %, so no warm rerun was needed.main (
1d027e5):PR (
e9ac9f0):Not tested
image_msaa_loadsample-index reading is unconfirmed on hardware.amd_reduced_seedsrepro needs an AMD tester.s_setpc_b64as a fall-through into the GS code and the GS phase's entry pc gets no dispatcher case, so the ES phase runs the GS code and the GS phase does nothing → empty records on wave32 GPUs.gpu_geometry_direct_recordstherefore compares the HLSL path only in its native form.AI use
🤖 Generated with Claude Code
@HKEY-Funk-Machine on GitHub · 2026-11-24 19:33 UTC · original
@bmjask
amd_reduced_seedson the RX 9070 atee85bc2: 6 of 7 variants fail, 1 passes.switch+WaveReadLaneFirstform already fails on its own, with the same value as the full seed (res[30]1 against 0x7fffffff). That fits your guess that the driver moves the read into a divergent case.Countbits.i64(2)alone gives the right value. Both the constant and the dynamic operand go wrong once the count goes into the shift /Bfrev. So on this card, splitting theCountbits.i64per half doesn't cover it; the wrong bit comes in after the count. (@RockFellerX's RDNA2 probe on #1426 found the sameCountbits→Bfrev.i32pattern, with the constant case only.)The full output, with each variant's IR, is about 670 lines. I can post it if the IR on this card would help; it's only the test's own generated programs.
Tested: clean PR head
ee85bc2, debug build,XCL_REQUIRE_GPU=1 cargo test -p xcl --lib gpu::dxil::fuzz_tests::amd_reduced_seeds -- --ignored --nocapture(test result: FAILED. 0 passed; 1 failed,6 AMD repro variants failed). AMD Radeon RX 9070 (RDNA4), driver 32.0.32015.7029, Ryzen 9 7945HX3D, 32 GB, Windows 11 Pro 26300, Rust 1.100.0, DXC 1.9.2602.17.Not tested: the rest of the suite on this head, release build, and the retail title on this head.
AI use: Claude Code (Claude Opus 5.5) ran the test and wrote this comment.
@nnonno91 on GitHub · 2026-11-24 19:40 UTC · original
Independent Windows GPU test of
ee85bc2686e0df7a818cd5fa0f3889e632a274e7. Native wave64 geometry passed on the 9800X3D's Radeon iGPU. The iGPU reproduced one of the seven requested variants and had three output mismatches in the 500–999 seed batch.Tested
XCL_ADAPTER.cargo test --locked -p xcl --lib gpu::dxil::fuzz_tests::amd_reduced_seeds -- --exact --ignored --nocaptureon the iGPU twice: 6 of 7 variants matched on each run (test result 0 passed, 1 failed). Both full seeds, both reduced 722 cases, and both constant 1599 cases matched. Only1599 Countbits.i64(dynamic 2) -> shift / Bfrevfailed,res[1]GPU0x1vs CPU0x0. On the RTX 5090 the same filter with the same flags passed all 7 (1 test passed, 0 failed). No skips.0x80000001vs0x80000000in all 32 lanes, and the combined output differed in 31. This describes the observed outputs of that program.cargo test --locked -p xcl --lib gpu::dxil::geometry_tests::gpu_geometry_direct_records -- --exact --nocaptureon the iGPU: 1 passed, 0 failed, no skips. The CPU model matched the generated mesh records for both direct DXIL wave64 forms (native and split) and native HLSL. The targeted AMD commands above usedXCL_REQUIRE_GPU=wave64,mesh.cargo build --workspace --lockedpassed. The iGPU run ofcargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-outputreported 873 passed, 1 failed, 44 ignored, with one explicit skip counted as a pass (heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows). The failure wasfuzz_validate_and_gpu_1at seed 540,res[833]GPU0x7vs CPU0x6.cargo test --locked -p xcl --lib gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 -- --exact --nocapturereproduced that independently. The same command on the RTX 5090 stopped at seed 545 in both runs withCreateComputePipelineStatereturning0x8007000E(2932 bytes, 148 instructions).cargo test --locked -p xcl --lib gpu::dxil::fuzz_tests::pr1679_scan_batch -- --exact --nocapture). It validated 500, GPU-compared 313, and found these three mismatching programs. The temporary diagnostics were removed afterward.res[833]0x70x6res[64]0x951d10750x7fffffffres[320]0xfe53ffff0x4a43fdebNot tested
Retail titles, compile timing, the full workspace suite on NVIDIA, or the root cause of the output mismatches and pipeline creation error.
AI use
OpenAI Codex (GPT-6 family, exact variant unavailable) ran the tests, added temporary diagnostic output, and wrote this report.
@raylitebull on GitHub · 2026-11-24 19:44 UTC · original
Tested on Windows 11 with an AMD Radeon RX 9070 XT (16191 MiB VRAM, RDNA4, native wave64) on a local merge branch based on
c160d86.Setup & tested configuration
c160d86+#1693(b5d6322) +#1679(ee85bc2) +#751,#1288,#1005,#1053,#1195,#1529,#1584,#1661(release build).XCL_DIRECT_DXIL=1,XCL_HEAP_WINDOWS=1,XCL_NETWORK=0,XCL_SKIP_BINK=1,XCL_MUTE_TTS=1(300 s run on a newer retail title).Observed results
0x0after full300.00 s(0crashes,0device removals,0OOMs).1,914(PresentX 1914;651translated PSOs,19,207unique shaders).25,644 MBpeak commit (13,065 MBprocess VRAM /14,515 MBadapter VRAM,8,791 MBtarget pages).frame_1520,frame_1880,frame_1910) rendered cleanly with no corruption.#1679(ee85bc2) and#1693(b5d6322) share a small 2-line overlap incrates/xcl/src/gpu/dxil/kernel.rs(keeping both|| geo.is_some()and themem_windows(...)heap-window call resolves cleanly).Not tested
dxil_cachelogged1,288hits /0misses /0compilations on pre-warmed caches).gpu::dxil::fuzz_tests/cargo test --workspaceon this merged tree, standalone#1679, and in-world 3D geometry/MSAA/directed-rounding paths past the 300 s loading screen.@srcamarda on GitHub · 2026-11-24 19:47 UTC · original
ee85bc2on AMD RDNA3 (RX 7800 XT):amd_reduced_seedsfails here too, and so does the non-ignoredfuzz_validate_and_gpu_1(seed 722; seeds 783 and 817 mismatch as well); the native wave64 geometry form runs and passesSetup
ee85bc2as it is (it already containsmainc160d86).amd_reduced_seeds(cargo test -p xcl --lib gpu::dxil::fuzz_tests::amd_reduced_seeds -- --ignored --nocapture): the same output in two runs, so on RDNA3 as well, not only RDNA4:The full seed 1599 passes on this card; only its reduced "dynamic 2" variant fails.
The default suite fails on AMD.
fuzz_validate_and_gpu_1(seeds 500..1000) is not ignored and panics at seed 722 (res[30] = 0x1, CPU 0x7fffffff), socargo test --workspaceis red on this card. It stops at the first mismatch, so for one run I changed the panic into a log line, locally and not pushed, to see every seed:0..500: 299 GPU-compared, 0 mismatches500..1000: 313 GPU-compared; 722 (1 dword), 783 (32 dwords, firstres[64] = 0xfffffff0, CPU0x7fffffff), 817 (64 dwords, firstres[320] = 0xfe53ffff, CPU0x4a43fdeb)1000..1500: 314, 0 mismatches;1500..2000: 306, 0 mismatches (1599 passes here)783 and 817 are not in the description; the maintainer's RDNA4 batch would likely hit at least 722.
Tests
cargo test -p xcl --lib gpu::dxil: 95 passed, 1 failed (fuzz_validate_and_gpu_1), 3 ignored.cargo test -p xcl --lib gpu_geometry -- --nocapture: 3 passed (gpu::dxil::geometry_tests::gpu_geometry_direct_records,gpu_geometry_mode_es_gs_strip,gpu_geometry_wave32_prefix_count_over_a_mask). On this cardwave64_supported()is true, sogpu_geometry_direct_recordsruns both the split and the native form on the GPU, and the HLSL native form's records agree.XCL_DIRECT_DXIL=1and=allcargo test -p xcl --lib gpu::recomp: 194 passed, 0 failed, 18 ignored each. NoSKIPPED(gpu_wave32_program_in_wave64_hardwareruns here).cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 873 passed, 1 failed (fuzz_validate_and_gpu_1), 44 ignored.SKIPPED:heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).Retail title (1.0.2.1,
scripts/smoke.ps1 -Seconds 60, no input; it stays on the title screens):mainc160d86ee85bc2XCL_DIRECT_DXIL=1XCL_DIRECT_DXIL=allInterleaved
main/ PR /main/ PR, then the two direct runs. No device removal or crash in any of them.XCL_DIRECT_DXIL_STATS=1:CS direct 45 / HLSL fallback 0with=1;CS direct 46 / 0, PS direct 18 / 0, VS direct 18 / 0with=all.PR's block (round 2):
Not tested
--directsweep over a shader pack; MSAA loads and directed rounding on real frames.Claude Code (Claude Opus 5.5), from runs on the hardware above.
@thiagocalile on GitHub · 2026-11-24 20:27 UTC · original
Tested commit
ee85bc2686e0df7a818cd5fa0f3889e632a274e7on an AMD Radeon RX 6600 (RDNA2, native 64-lane waves). Hit 1 deterministic GPU test failure (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1,seed 540: res[833] = 0x7, CPU 0x6) in both the targetedgpu::dxilrun and the full workspace run.Tested
32.0.21045.29003;XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust1.100.0(stable-x86_64-pc-windows-msvc), DXC1.8.2502.11, debug build.XCL_ADAPTER=radeon cargo test -p xcl --lib gpu::dxil -- --test-threads=4: 95 passed, 1 failed, 3 ignored (43.4s).XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 870 passed, 4 failed, 44 ignored (78.46s).gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1panicked atcrates\xcl\src\gpu\dxil\fuzz_tests.rs:1171:21withseed 540: res[833] = 0x7, CPU 0x6(reproduced in both the targeted and workspace runs).mainon this RX 6600 (placed_title_textures_share_vram_and_preserve_pixels: 3D mip subresource mismatch, plus 2 mutex-poison cascadestransitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memory; tracked by #1028).SKIPPED(not counted as coverage):heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows(plus D3D12 debug-layer tests skip becaused3d12SDKLayers.dllis not installed).Not tested
scripts/smoke.ps1— no game executable here), D3D12 debug layer, NVIDIA / Intel GPUs, Linux / Wine.AI use
@eizispark on GitHub · 2026-11-24 20:44 UTC · original
Hardware test report — commit
758e341Checked
758e341f0cfe735d617c629bfd22eee09bf05f2b(clean merge withmain4178e88): regression ingpu::dxil::msaa_tests::gpu_direct_msaa_image_loadson AMD RDNA4 (0xc0000005STATUS_ACCESS_VIOLATION); geometry mode, directedf32rounding, thedx.opMSAA helpers, and the 60 s retail smoke run all pass.Tested
32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 x64,rustc 1.100.0 (0ef1bc386 2026-11-09), debug tests + release smokecargo test --workspace --no-fail-fast -- --test-threads=4:xcl --libaborts ingpu::dxil::msaa_tests::gpu_direct_msaa_image_loadswithexit code: 0xc0000005, STATUS_ACCESS_VIOLATION(reproduced solo with--test-threads=1; note this test skips on NVIDIA viawave64_programs_supported()). The other 3 tests inmsaa_tests(msaa_texture_ops_runon GPU,render_target_sample_ops_validate,direct_msaa_store_is_rejected) pass (3/3)xcl --lib -- --skip gpu_direct_msaa_image_loads --test-threads=4:855 passed, 2 failed, 24 ignored(1 skipped:shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is off)); the 2 failures are the pre-existing#1426AMD fuzz seeds (gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1seed722andfuzz_validate_and_gpu_3seed1599)16targets):49 passed, 0 failed, 20 ignored(1 skipped:heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows)gpu::dxil::core_tests::geometry_mode_validates,gpu::dxil::geometry_tests::geometry_forms_validate,gpu::dxil::geometry_tests::gpu_geometry_direct_records(wave64), andgpu::dxil::round_tests(4/4:direct_f32_round_mode_unsupported_op_rejected,directed_reference_basics,gpu_direct_f32_round_modes_dynamic_and_denormals,gpu_direct_f32_round_modes_static) all passed;gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware, andconsole_wave64_compute_through_the_pso_hook_dispatch_and_read_backalso passedcargo test -p xcl --lib gpu::dxil::fuzz_tests::amd_reduced_seeds -- --ignored --nocaptureresult on RX 9070 XT (32.0.32015.16001) —1variant passed,6reproduced:Regression run (
scripts/smoke.ps1, 60 s, default HLSL backend)main(85e38262ff94aecd75d6f83fa8156a8b7697bd13):PR (
758e341f0cfe735d617c629bfd22eee09bf05f2b):Not tested
XCL_SHADER_BACKEND=dxil, NVIDIA/Intel GPUs, Wine/vkd3d-proton, gameplay past the menusAI use
@thiagocalile on GitHub · 2026-11-24 20:50 UTC · original
Root-caused the RX 6600 (
32.0.21045.29003)seed 540: res[833] = 0x7, CPU 0x6failure from the emitted DXIL disassembly — the emitted DXIL is mathematically sound, so this looks like an AMD Windows DXIL driver miscompilation (similar toamd_reduced_seeds), not a bug in#1679's translator.Backward slice of
res[833](lane%5 = 1, slot832 + %5,%287 = trunc i64 %208 to i32):For
%24 = true:%25 = -1,%26 = 63,%27 = ashr(-1, 63) = -1,%96 = -1 - (-7) = 6(0x6).32.0.21045.29003): produced0x7(0 - (-7)), meaning%27evaluated to0(eithersext i1 true to i64miscompiled aszext+1soashr(1, 1) = 0, orashr i64 -1, 63miscompiled to0).AI use: Antigravity (Gemini 4 Neon) traced the backward slice from the
seed 540DXIL disassembly; I reviewed it before posting.@HKEY-Funk-Machine on GitHub · 2026-11-24 21:34 UTC · original
@bmjask @eizispark the
gpu_direct_msaa_image_loadsaccess violation reproduces on a second RDNA4 card and driver: RX 9070, driver 32.0.32015.7029 (eizispark's is an RX 9070 XT on.16001). Debug and release builds both crash the same way.Tested
758e341. AMD Radeon RX 9070 (RDNA4, native wave64), Ryzen 9 7945HX3D, 32 GB, Windows 11 Pro 26300, Rust 1.100.0, DXC 1.9.2602.17.XCL_REQUIRE_GPU=1 cargo test -p xcl --lib gpu::dxil::msaa_tests -- --test-threads=1 --nocapture:direct_msaa_store_is_rejected ... ok, thengpu_direct_msaa_image_loadsends the process withexit code: 0xc0000005, STATUS_ACCESS_VIOLATION, right after DXC loads.cargo test --release … gpu_direct_msaa_image_loads): same0xc0000005.Not tested: which module faults (no dump captured), the rest of the suite on this head, and the retail title on this head.
AI use: Claude Code (Claude Opus 5.5) ran the test and wrote this comment.
@DavidM1911 on GitHub · 2026-11-24 21:37 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@thehollowedone on GitHub · 2026-11-24 21:38 UTC · original
Tested
On
758e341f, I extended the stock ES+GS strip fixtures to draw the same geometry through direct DXIL and HLSL on the RTX 3080 Ti. Both versions of the shader, with and without branches, emitted strips for 25 primitives across a full group and a partial final group.Direct DXIL with one and four configured memory windows matched HLSL exactly in each case. Per comparison, all 858 live record words and all 1,024 pixels matched, including the 41 covered pixels. The fixture used the first memory window for its input.
Windows 11 build 26300, NVIDIA driver 621.35, Ryzen 7 9800X3D, Rust 1.99.1 MSVC debug, DXC 1.8.2502.11.
cargo test --offline --locked -p xcl --lib <filter> -- --nocapture --test-threads=1passed 2/2 for the stockgpu::dxil::geometry_tests::filter and 2/2 for the extendedgpu_geometry_mode_es_gs_stripfilter. Zero skips.Not tested
This is synthetic split-wave64 geometry and raster output coverage. Retail, native wave64 hardware, MSAA, and the reported AMD failures were outside this check.
AI-assisted. Codex (GPT-6 family, exact variant unavailable) extended and ran the fixture and drafted this report.
@bmjask on GitHub · 2026-11-24 22:05 UTC · original
Thanks everyone for the hardware runs. Where things stand:
MSAA access violation on RDNA4 (@eizispark, @HKEY-Funk-Machine): the likely cause is the out-of-range
Texture2DMS.Loadthat @Flyander found. The fix is @imnicho's patch: load sample 0 for indices past the count and zero the result as before. It's prepared asba3dc42and being handed to this branch. Once it's on the PR head, could you both re-runXCL_REQUIRE_GPU=1 cargo test -p xcl --lib gpu::dxil::msaa_tests -- --test-threads=1on the RX 9070 / 9070 XT? I can't verify it on AMD myself.AMD fuzz mismatches (@HKEY-Funk-Machine, @srcamarda, @thiagocalile, @nnonno91): not fixed, and I won't claim they are.
amd_reduced_seedsfails 6/7 on the RX 9070 and fails on the RX 7800 XT. The non-ignoredfuzz_validate_and_gpu_1also fails there: seeds 722/783/817 on the RX 7800 XT and seed 540 on the RX 6600. @thiagocalile, thanks for the backward slice of seed 540. The emittedsext i1 → ashr → subchain does look sound, which points at the AMD DXIL compiler. I haven't confirmed that independently, and a deterministic failure in a non-ignored test on three AMD generations needs either a translator-side workaround or an explicit AMD skip with a tracking issue before merge. It shouldn't just be left red. Still open. One check would help, if anyone with an AMD card has time: doesfuzz_validate_and_gpu_1fail on plainmaintoo, or only on this head?@nnonno91: thanks for the iGPU wave64 geometry check. @thehollowedone: thanks for the direct-vs-HLSL ES+GS strip comparison (858 record words and 1,024 pixels identical, one and four windows). @raylitebull: thanks for the 300 s RX 9070 XT run and the merge note on the
kernel.rsoverlap with #1693. @DavidM1911: thanks for the RTX 3060 Ti run.AI use: Claude Code (Claude Opus 5.5) wrote this comment for @bmjask.
@HKEY-Funk-Machine on GitHub · 2026-11-24 22:11 UTC · original
@bmjask on your
fuzz_validate_and_gpu_1question. #1679 was merged while I ran it, so here it is on the mergedmain689f2db, RX 9070 (RDNA4), driver 32.0.32015.7029, debug, clean tree:XCL_REQUIRE_GPU=1 cargo test -p xcl --lib gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_ -- --test-threads=1 --nocapture: 2 passed, 2 failed.fuzz_validate_and_gpu_1: FAILED,seed 722: res[30] = 0x1, CPU 0x7ffffffffuzz_validate_and_gpu_3: FAILED,seed 1599: res[193] = 0x1, CPU 0x0fuzz_validate_and_gpu_0and_2: passed (_2: validated 500, GPU-compared 314)mainbefore the merge (1d027e5) has nofuzz_tests.rs, so there's no older baseline for these tests. The two failures came intomainwith #1679, and on this card they are now red there.Two other notes:
e9ac9f0, withoutba3dc42, so I haven't rerunmsaa_tests. I'll run it once the fix is onmainor a PR.56c0cd3b82a00c6eis still open: since #1748 it builds in the title here (430 s with switch windows, 282 s with heap windows, 151.5 s with #1834). The program that still runs out of memory is95cc13288a27a96e: #1748 and #1834AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this comment.
@pablogonz12 on GitHub · 2026-11-24 22:41 UTC · original
RADV / Linux / Wine run on the merged
main689f2db(first Linux run of #1679 I can see in this thread). RX 9070 XT (RDNA4, gfx1201), RADV from Mesa 26.3.1, Wine from GE-Proton11-14,x86_64-pc-windows-msvcrelease build with+crt-static, DXC 1.9 fromxcl-bin/dxc.cargo xwin test --workspace --release --target x86_64-pc-windows-msvc --no-run, then the lib test exe under Wine with--test-threads=4:jumps_to_outer_loop_heads_are_structured(aborts the binary, #1246) and the two kernels withUAddc/USubb/UDiv(they abort the binary invkCreateComputePipelines, reported on #1807 and #1426). Unfiltered, the binary dies with exit 3 before the summary, so the counts need those three.Nine failures, four of them new since the last main I ran here (an older main with #890 gave 722/4/21 on this machine):
gpu::dxil::round_tests::directed_reference_basics—fma 0xba2d9ab4 0x8ad80f89 0x839c0157, in 0.00 s: this one never reaches the GPU. It isref_fmaagainst the host'sf32::mul_add, and under Wine the msvcrtfmafis not the correctly rounded one the reference assumes. Not a GPU finding; it needs a reference that does not call the host'sfmaf, or a Wine skip.gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu—lane 16 v10: got0, want0x80000000(−0.0).gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu—lane 1 v[20:21]: got0, want1.3877787807814506e-17(4354980839667269648).gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_2—seed 1003: res[713] = 0x1, CPU 0x0, program starting withLoad slot 0and aGsAtomic Or.All four fail the same way run alone (
--exact,--test-threads=1), so not cross-test interference.The other five are the ones we already know here and have PRs:
gpu_f64_roots/gpu_f64_math_random(#530),gpu_nonfused_mad_and_mac_prevent_fma_contraction(#472/#676),gpu_depth_buffer_created_for_unordered_access_is_placed(#1475 fixes it),hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime(#890 fixes it: on plainmaincurrent_buffer_contextcomes back 0 instead of0x3003).Test reports, not fixes: I have no Windows machine, and I am not writing code for this repo.
Written with Claude (Anthropic) assistance; tested by me on the hardware listed.
@PHeitor1 on GitHub · 2026-11-24 22:45 UTC · original
A console program does hit this, on both paths, and a compare-exchange loop for LDS
sub_u32fixes it here. @bmjask the patch is below for you (or anyone with a title for the smoke pair) to take; I can't make the regression run, so I'm not opening a PR.Tested (RTX 5060 Ti 8 GB, NVIDIA 621.24, Windows 11 Pro 26300, rustc 1.100.0 MSVC, DXC 1.9.2602.17, debug;
main689f2db, with and without the patch)maingpu_ds_sub_u32_of_a_register, HLSL path0x8007000E)XCL_DIRECT_DXIL=10x8007000E)fuzz_validate_and_gpu_0to_3direct_dxil_lds_atomics_and_barrier_parity(b20b957's file)split-w64,0x8007000E)ds_sub_u32/ds_sub_rtn_u32values (wrap, old value, one slot that all 64 lanes subtract from).cargo test --workspace --no-fail-fast -- --test-threads=4with the patch: 976 passed, 0 failed, 45 ignored;XCL_DIRECT_DXIL=1: 975 passed, 1 failed, 45 ignored, the one beingoffline_compute_pipeline_is_reused_by_a_second_process(#1674).direct_dxil_mimg_image_ops_and_atomics_parityfails with and without the patch here (wave32: lane 0 v7, 0 against 1.0), as on the RTX 5070 Ti with 32.0.16.2135. It is a separate thing.The fuzz tests pass with the patch because it stops generating
Sub(the pick stays,SubbecomesAdd, so the seeds keep their programs otherwise). That only makes sense once the translator does not emit the form.Cost: a loop instead of one atomic, for every GPU.
float_minmax_memhas a note that 168 CAS loops in one program were too much for a driver, so limiting this to Blackwell may be better; I did not look at how to detect it. I don't know how manyds_sub_u32a title has.Not tested: a title, release, AMD / Intel, other NVIDIA GPUs, compile time, image
atomic_sub(texels, unchanged by the patch), the wave64 hardware form.Patch against
689f2db(also bumpsTRANSLATOR_VERSION)Run and written with Claude Code (Claude Opus 5.5).
@PHeitor1 on GitHub · 2026-11-24 22:36 UTC · original · edited 2026-11-24 22:58 UTC
Credit and correction: @Kalmarv had already inferred this trigger on #1426 (a variable subtract, which newer drivers would fold back into the atomic sub). I had not seen it when I wrote this. The runs below confirm it at 621.24. It also depends on the driver: their RTX 5070 Ti on 610.74 runs seeds 70, 545, 1019 and 1507 with the
0 - xadd, while the same seeds are refused on a 5080 with 617.14, a 5060 with 617.42 (#1905) and here with 621.24. So "on this GPU" below should read "on this GPU and driver".Trigger found for the 56 refusals in my comment above: a groupshared 32-bit atomic add of a negated, non-constant value. The
addof0 - vthat55e9c3buses in place ofatomicrmw subis refused the same way, and it happens with plain DXC output too. Same machine (RTX 5060 Ti, 621.24).In the fuzz modules
GsAtomicSub; 35 of the 1176 passing ones do. In 30 of those 35 the operand is a constant. The other 5 (257, 540, 756, 924, 1584) have a non-constant one and still pass; I don't know why.GsAtomicSubemission changed (scratch patch):add (0 - v)(as onmain)atomicrmw sub vadd (v * -1)add ((v ^ -1) + 1)add ((lane & 64) - v)main, without thecmpxchgadd v(control, wrong value on purpose)atomicrmw xor (0 - v)(control)So it is not the
cmpxchgor the negation alone, and rewriting the negation does not hide it; my guess is that the driver turns all of these back into its own subtract.The other way round: HLSL of a few lines, DXC 1.9.2602.17,
cs_6_6,WaveSize(32), 32 threads,groupshared uint g[9],vloaded from a buffer. 3 runs each, the same at-O3and-Od:InterlockedAdd(g[i], 0u - v), also with the old value used, with a constant index, or withv=v & 1, the lane index orWaveReadLaneFirst(v)0x8007000EInterlockedAdd(g[i], v), with and without the old valueInterlockedAdd(g[i], 0u - 5u),InterlockedAdd(g[i], ~v)InterlockedXor/Max/Exchangeof0u - vongInterlockedAdd(buffer, 0u - v)(RWByteAddressBuffer)InterlockedCompareExchangeloop that storesc - vWhat it means for XCL, from reading the code (I have not run a console program with it): LDS
sub_u32emits this form on both paths,rmw32indxil/lower_mem.rs:1448andemit.rs:5001, so a compute program with one of a non-constant value should be refused on this GPU.rsub_u32next to it already goes throughself.cas; the same for LDSsub_u32would avoid the form.Not tested: a translator change, 64-bit LDS atomics, another driver or GPU. #1778's LDS test fails the same way on two RTX 5070 Ti, which fits, but I have not run it.
Run and written with Claude Code (Claude Opus 5.5).
@PHeitor1 on GitHub · 2026-11-24 22:28 UTC · original · edited 2026-11-24 22:58 UTC
Correction: this was not the first NVIDIA report. The same seeds were already reported refused on RTX 50 cards on #1426 and #1269 before #1679 was merged (for example RTX 5080, 621.24), and in the #1679 thread on an RTX 5090.
Update: trigger found, see #1679
NVIDIA result for the fuzz tests on the merged
main689f2db: on an RTX 5060 Ti the driver refuses 56 of the 1232 GPU-run seeds with0x8007000EinCreateComputePipelineState. No seed gives a wrong value, so this is not the AMD mismatch.Tested
XCL_*set.cargo test -p xcl --lib gpu::dxil::fuzz_tests -- --test-threads=1, 2 runs: 1 passed, 4 failed, 2 ignored.fuzz_validate_and_gpu_0to_3stop at seeds 70, 545, 1019 and 1507.debug_seedfor seeds 0 to 1999, each in its own process: 1176 ran with no mismatch, 56 refused, 768 not run (gpu_safefalse). The 56 refused and 56 of the passing seeds, 3 more times each: the same result every time.nvlddmkmevent.dx.op.barrier(855 of the 1176 passing ones do too), and 54 have anlshr i32(559 of 1176). That is a correlation only; I have not reduced a seed.Two RTX 5070 Ti get a
0x8007000Efrom the direct translator's LDS atomics test in #1778 (drivers 616.64 and 32.0.16.2135), and an RTX 3060 does not. That may be the same thing; I have not checked.Not tested: another driver on this GPU, another NVIDIA GPU, release.
Run and written with Claude Code (Claude Opus 5.5).
@bmjask on GitHub · 2026-11-24 22:59 UTC · original
imnicho's sample-clamp patch from this review is now in #1908 (on current main). @eizispark @HKEY-Funk-Machine, could you re-test on AMD with that build when you get a chance?
@PHeitor1 on GitHub · 2026-11-24 22:52 UTC · original · edited 2026-11-24 23:08 UTC
Update: the patch is now the draft #1919, so please test that branch instead of opening a PR.
@frenziedcoder thanks for checking this: your RTX 5080 (617.14) stopping at the same four seeds (70, 545, 1019, 1507) means it is not only 621.24.
If you have time, would you run the patch from my comment above on that card? It applies to
main689f2db. What would help most:cargo test -p xcl --lib -- gpu_ds_sub_u32_of_a_register gpu::dxil::fuzz_tests, once as it is and once withXCL_DIRECT_DXIL=1. To see the new test fail without the fix, apply only therecomp/tests.rspart.main/ patched), since it changes the translators and I can't run one.If it holds up and @bmjask doesn't want to take it, please feel free to open the PR yourself. No problem if not.
Written with Claude Code (Claude Opus 5.5).
@cindertheblue on GitHub · 2026-11-24 23:09 UTC · original
amd_reduced_seedson a second RDNA3 card (RX 7600 XT, older driver): seed 722 fails as on the RX 7800 XT, but all three 1599 variants pass –mainat689f2dbSetup: AMD Radeon RX 7600 XT 16 GB (RDNA3, Navi 33), driver 32.0.31041.1004 (AMD Software 26.8.1); Ryzen 5 9600X; Windows 11 Home 26200.9974; rustc 1.99.1; DXC 1.8.2502.11 (SDK 10.0.26100); debug build;
mainat689f2db, no local changes.cargo test -p xcl --lib amd_reduced_seeds -- --ignored --nocapture, the same output without and withXCL_DIRECT_DXIL=1:cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture): 974 passed, 1 failed (fuzz_validate_and_gpu_1, seed 722,res[30] = 0x1, CPU 0x7fffffff), 45 ignored.Not tested: another driver on this card; seeds after 722 in
fuzz_validate_and_gpu_1(it stops at the first mismatch).AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this comment from the real output; checked by me before posting.
@ -801,0 +857,4 @@let dims = lw.s.get_dimensions(tex.handle, None);let count = lw.s.m.extract(dims, 3);for (si, &sv) in samples.iter().enumerate() {let r = lw.s.texture_load_sample(tex, sv, &coords);@Flyander on GitHub · 2026-11-24 21:01 UTC · original
Could we make the sample index valid before this load? For
IMAGE_MSAA_LOAD,samplesisfragment..fragment+3; the new GPU regression deliberately reaches indices beyond the resource count (4x at fragment 3, 2x at fragment 1). This call still performsTexture2DMS.Loadfor those indices and only selects zero afterward. Microsoft documents out-of-rangeld2dmssample indices as undefined: ld2dms. That makes this a plausible cause of the reported RDNA4STATUS_ACCESS_VIOLATION; the post-load select cannot prevent the invalid fetch. Could the load use a safe in-range index (for example, sample 0 whensv >= count) while retaining the existing zero result mask? I rangpu_direct_msaa_image_loadson an RTX 5070 Ti and it passes there, which does not rule out the AMD-specific failure.@ -801,0 +857,4 @@let dims = lw.s.get_dimensions(tex.handle, None);let count = lw.s.m.extract(dims, 3);for (si, &sv) in samples.iter().enumerate() {let r = lw.s.texture_load_sample(tex, sv, &coords);@imnicho on GitHub · 2026-11-24 21:30 UTC · original
A patch for this, in case it saves a round trip (against
758e341; @bmjask, take it or leave it as you like):The range check moves in front of the load, and the load takes sample 0 where the index is past the resource's count. The zeroing of the result stays as it is, so what the test expects does not change. It covers
image_loadof one sample as well as the four ofimage_msaa_load(the same loop).Tested
758e341+ the patch.cargo test -p xcl --lib gpu::dxil::msaa_tests -- --test-threads=1: 4 passed, 0 failed.gpu_direct_msaa_image_loadsran on the GPU (split form), not skipped, and its values match, the past-the-count samples included.cargo test -p xcl --lib gpu::dxil -- --test-threads=4: 98 passed, 0 failed, 3 ignored (dump_dxc_lowering,amd_reduced_seeds,debug_seed).Not tested
758e341without the patch too (as on Flyander's RTX 5070 Ti), so this run does not show that the access violation on RDNA4 is gone - only that the patched form validates and gives the same values. @eizispark, could you rerungpu_direct_msaa_image_loadswith it on the RX 9070 XT?AI use
@ -801,0 +857,4 @@let dims = lw.s.get_dimensions(tex.handle, None);let count = lw.s.m.extract(dims, 3);for (si, &sv) in samples.iter().enumerate() {let r = lw.s.texture_load_sample(tex, sv, &coords);@bmjask on GitHub · 2026-11-24 22:05 UTC · original
Thanks @Flyander, agreed: the post-load select can't stop an out-of-range
ld2dmsfetch, and that fits the RDNA4 access violation. And thanks @imnicho for the patch. I took it as is: the range check now runs before the load, which uses sample 0 whensv >= count, and the zero mask stays the same. It coversimage_loadandimage_msaa_load. Commitba3dc42(withTRANSLATOR_VERSION7 → 8) is prepared and being handed to this branch.gpu::dxilpasses here (100 passed, 0 failed, 3 ignored), but that's on NVIDIA, where the test already passed, so it doesn't show the AMD fault is gone.AI use: Claude Code (Claude Opus 5.5) wrote this comment for @bmjask.
@ -801,0 +857,4 @@let dims = lw.s.get_dimensions(tex.handle, None);let count = lw.s.m.extract(dims, 3);for (si, &sv) in samples.iter().enumerate() {let r = lw.s.texture_load_sample(tex, sv, &coords);@imnicho on GitHub · 2026-11-24 22:08 UTC · original
@bmjask a heads-up so the fix is not lost: the merge at 22:07 UTC took
e9ac9f0, which does not haveba3dc42yet. Onmain689f2dbthe load still comes before the range check (gpu/dxil/lower_image.rs, line 860), sogpu_direct_msaa_image_loadswill still crash on the RDNA4 cards there.It is your commit, so the follow-up is yours to send if you want it (with the
TRANSLATOR_VERSIONbump you mention). If you would rather I open the small PR, say so and I will, with the test report from here and a request to @eizispark / @HKEY-Funk-Machine for the AMD run.AI use: Claude Code with Claude Fable 5.2 checked
mainand wrote this.@DavidM1911 on GitHub · 2026-11-26 06:07 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin