gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426
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!1426
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1426/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 15:49 UTC · original
bmjask:shaders/direct-dxil-main→main· +19641 −30 · 73 files · 34 commits · merged 2026-11-24 18:29 UTCA backend that translates console RDNA2 programs straight to signed DXIL containers, with no HLSL text and no DXC at run time. It sits next to the HLSL path, is off by default, and is selected with
XCL_DIRECT_DXIL=1: console compute shaders, the mesh pass and (with=all) VS/PS. Anything it can't translate falls back to the HLSL path and is logged. It is the base for the per-lane mode that @gefydev's team is building on it (#1269).What is in it
crates/xcl/src/gpu/dxil/:bitstream.rsandmodule.rswrite LLVM 3.7 bitcode. Blocks are written in reverse post-order of the CFG, so a lowering may create blocks in any order;replace_all_usesis available.module/opt.rsremoves trivial phis, merges duplicate pure instructions along the dominator tree, and removes dead code.XCL_DXIL_NO_OPT=phi,cse,dce|allturns passes off for bisecting. There is no fast-math or float reassociation, and wave ops are only merged within one block.shader.rsandops.rscover dx.op calls, handles, resource metadata and shader flags. Every dx.op declaration's attributes are checked against DXC's table. The op library covers math, memory, atomics, typed/raw/structured buffers, textures/samplers, wave ops and derivatives.graphics.rsandcontainer.rswrite ISG1/OSG1/PSG1, PSV0 and the view-ID tables, and handle VS/PS/MS entries. The digest is computed in-tree and matches DXC byte for byte.cfg.rs,ssa.rs,lanes.rs,lower*.rs,kernel.rs. It builds a CFG, constructs SSA on the fly, keeps lane masks and lowers every instruction, using the same EXEC model as the HLSL path.Lw::inst_guardedlets an external control-flow analysis reuse the per-instruction lowering.coverage.rsaddsxcl shaders <pack> --direct [--sample N] [--validate] [--compare]to sweep a pack, andXCL_DIRECT_DXIL_STATS=1prints live fallback statistics at exit.validate.rswraps DXC's validator and disassembler, used in tests only. With a validator older than 1.8 only the validation step is skipped.recomp/pso.rs: routing with HLSL fallback, and a separate on-disk cache identity per backend andTRANSLATOR_VERSION. HLSL cache entries are unchanged.recomp/runner.rs: test-only additions.recomp/tests.rs: backend switch.XCL_HEAP_WINDOWS, merged from main) are not translated yet; those shaders take the HLSL path.!llvm.identis now emitted.Bfrevmiscompile: halves are now reversed separately.WaveMultiPrefixBit*is now signed, as DXC emits it. The unsigned form removed the device on RDNA4.waveGetLaneIndexis readonly (@Kalmarv).atomicrmw sub, which NVIDIA rejects.tests/data/dxil/.amdxc64.dllfault HKEY-Funk-Machine isolated oncs 62b584e061c05fc5: release builds skip the validator, and NVIDIA tolerated the irreducible CFG.Countbits.i64is emitted per 32-bit half, a workaround like the one forBfrev.i64.XCL_DXIL_DUMP=<hash|all>writes the direct DXIL of chosen programs.xcl shaders --direct --hash <h> --dump <dir>does the same in sweeps.Tested
RTX 4090 (wave32 only), NVIDIA driver, Windows 11, Rust 1.96 MSVC, debug, DXC 1.9.2602.17 (test oracle only), head
81d2ad5a9d06.cargo test --workspace -- --test-threads=4: 858 passed, 0 failed, 42 ignored. SKIPPED GPU tests:gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).XCL_DIRECT_DXIL=1and=all,cargo test -p xcl --lib gpu::recomp: 194 passed, 0 failed, 18 ignored each. Every kernel/compute/mesh/VS/PS test goes through the direct path, with no fallback in tests.Retail pack sample (
xcl shaders shaders.rpf --direct --sample 200 --seed 1 --validate --compare):Also checked:
Testers on this PR:
!llvm.ident.Regression run
The retail title, 60 s each, RTX 4090, release builds, back to back on an idle machine,
XCL_DIRECT_DXILunset, no uncommitted changes. PR (head81d2ad5a9d06): 97 % of main's frames, 111 % of its peak commit (one earlier run on this head stalled near its end on a busy machine, 1400 frames; the rerun on an idle machine is the block below), no crash or device removal.main:
PR:
Not tested
amdxc64.dllfault on one retail program is fixed (irreducible CFG, above) but not yet re-run on AMD. Fuzz seed 722 on RDNA4 looks like the driver moving a wave op into a divergent branch. RADV seeds 1003/1698 are a Mesa folding bug, traced in the thread.AI use
🤖 Generated with Claude Code
- module: write blocks in reverse postorder (unreachable ones dropped); the epilogue block was created before the program's blocks and read registers they define ("forward reference ... dominance order", 32 VS/PS programs). Globals and function declarations nothing references are not written (CS "Internal declaration 'xcl_xs' is unused"). - ssa: sealed joins read their operands first and only make a phi when the edges disagree or a loop comes back around (Braun et al.'s trivial phis): every join a read walked through used to get a phi per register. - module/opt: Module::optimize before finishing: trivial phi removal, CSE (pure ops along the dominator tree, wave ops per block), DCE of pure values and flag-neutral dx.op calls. XCL_DXIL_NO_OPT=phi,cse,dce bisects. - graphics: view-id control dependence from an immediate post-dominator tree instead of per-block post-dominator sets (quadratic time and memory). - lower_gfx: SV_IsFrontFace declared uint. Co-Authored-By: Claude Opus 5.5 <[email protected]>The console compiler emits loops entered in the middle (GTA VI CS 62b584e061c05fc5: 7 such loops). The direct path mapped them to DXIL as is, which DXIL forbids ("Execution flow must be reducible"); release builds skip the validator, so the container reached the driver and amdxc64 faulted at +0x6800a4 building it. Cfg::build now copies the multi-entry region (minus its first entry) for the other entries until the CFG is reducible, failing over to the HLSL path past 4x the block count. Countbits.i64 is emitted as two i32 counts (AMD's i64 bit ops, see Bfrev.i64; fuzz seed 1599 on RDNA4). TRANSLATOR_VERSION 4. Co-Authored-By: Claude Opus 5.5 <[email protected]>@gefydev on GitHub · 2026-11-24 15:57 UTC · original
This overlaps with the direct DXIL work tracked in #1269. The two halves fit, so I'd rather build on this than finish a second writer.
What #1426 lists as future work is what
gefydev/xclrecomp-lane-maskshas:gpu/recomp/lane_masks.rs). Each mask is followed as a per-lane boolean function, to work out which vector instructions still need an EXEC guard. On the retail pack, 25 695 of 26 698 programs are analysed and 37.1 % of 28.7 M vector instructions keep a guard, against 100 % today. It also exports the CFG and which branches are per-lane.gpu/recomp/ssa.rs,gpu/recomp/lower.rs). It keeps the console CFG, builds SSA over register dwords on the fly, and makes mask branches per-lane branches. It refuses, so the program falls back, where a mask written while some lanes were elsewhere is read after they meet again. Kernel and compute mode and memory are done. It writes through a smallIrtrait, and its tests compare it with the HLSL path on the GPU: registers and memory agree (GTX 1650, wave32).The proposal, also posted in #1269: this PR is the infrastructure, and I rebase onto it and implement the
Irtrait on your module builder. The lowering then givesXCL_DIRECT_DXILa per-lane mode as a follow-up on top of #1426, falling back to your per-instruction masking wherever the analysis refuses a program.Two questions:
module.rs/shader.rsmeant as the API a second lowering can target? TheIrtrait needs blocks,br/ conditionalbr, phis with incoming values added later and trivial ones replaced, integer ops and compares,select, lane / thread / group ids, ballot, and raw buffer loads and stores.AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev.
@mastrr9 on GitHub · 2026-11-24 16:04 UTC · original
RTX 5080 (Blackwell, wave32 / split-wave64) test report for head
065aef35c30f364d2a9be2431a1466cddf05e761(Windows 11, DXC 1.9.2602.17, Rust MSVC, debug build, clean worktree):cargo build --workspace: OK (0 new compiler warnings).cargo test --workspace -- --test-threads=4: 768 passed, 4 failed, 23 ignored (stopped atxcllib).cargo test --workspace -- --test-threads=1: 768 passed, 4 failed, 23 ignored (identical deterministic failures).gpu::dxilbreakdown: 61 passed, 2 ignored, 4 failed — all four are deterministic fuzz seeds that pass validation and fail in the NVIDIA Blackwell driver atfuzz_tests.rs:1158:110withGPU run: CreateComputePipelineState: Not enough memory resources are available (0x8007000E):fuzz_tests::fuzz_validate_and_gpu_0(seed62)fuzz_tests::fuzz_validate_and_gpu_1(seed545)fuzz_tests::fuzz_validate_and_gpu_2(seed1019)fuzz_tests::fuzz_validate_and_gpu_3(seed1507)Happy to re-run on the RTX 5080 whenever a follow-up lands!
Not tested: AMD, Linux/Wine, retail smoke (
scripts/smoke.ps1).AI use: T3 Code (Antigravity / Claude Sonnet 5.5) built the worktree, ran both
--test-threads=4and--test-threads=1on our RTX 5080, and drafted this report.@HKEY-Funk-Machine on GitHub · 2026-11-24 16:08 UTC · original
Test report: #1426 at
065aef3on AMD RDNA4 (Windows): every GPU test of the emitted DXIL crashes the AMD driver@bmjask @gefydev: an RDNA4 data point, since #1426 is now the base for the direct path. On this card, every DXIL container the backend emits crashes the AMD shader compiler (
amdxc64.dll) on PSO creation. It reproduces from the PR's own tests, no game data needed.Tested
065aef3for the tests.1. The PR's direct-DXIL tests, each run alone (
xcl-*.exe --exact <test> --test-threads=1, all 67 tests undergpu::dxil):container::tests::digest_matches_dxc_signed_containerandpsv_matches_dxc_layout_for_compute_with_two_raw_uavs.0xC0000005: every test that creates a pipeline from emitted DXIL and dispatches or draws it. That includes the smallest,tests::emitted_kernel_runs_on_the_gpu, plus allops_tests::*(integer, float, wave, atomics, typed/raw buffers, textures, doubles, int64, half), all fourfuzz_tests::fuzz_validate_and_gpu_*,graphics::tests::emitted_{vs_ps,ms_ps}_draw_a_triangle,emitted_ps_samples_a_texture_with_implicit_lod,emitted_ms_primitive_attribute_reaches_the_pixel_shader, andcore_tests::direct_and_hlsl_graphics_stages_link.cargo test --release -p xcl --lib -- gpu::dxil --test-threads=1stops at the first of them (direct_and_hlsl_graphics_stages_link) withSTATUS_ACCESS_VIOLATION.2. Retail title, tree
065aef3+ #751 + #1288 + one local patch that skipsInitializeApiImplEx2,XCL_NETWORK=0:XCL_DIRECT_DXIL=1: crashes 3 s after start, 3 runs out of 3, always atamdxc64.dll+0x1ab0cf7(read at0x40), on three PSO threads at once. By then the direct path had translated only three compute programs, all tiny (128–368 B of console code, 12.5–35 KB of DXIL, wave64), with no HLSL fallbacks.XCL_SPLIT_WAVE64=1 XCL_DIRECT_DXIL=1: same crash at the same address, so it is not the native-wave64 form.XCL_DIRECT_DXIL: runs normally (410 compute PSOs in 60 s, no crash).On @Kalmarv's open question (the in-tree digest on AMD): D3D12 accepts the containers here. There is no
E_INVALIDARGat PSO creation; the fault comes later, inside the driver's compiler. For comparison, @mastrr9's RTX 5080 run above fails only the fourfuzz_validate_and_gpu_*seeds (E_OUTOFMEMORYfrom the driver), where this card crashes on all 25 GPU tests.So the digest matches DXC's, but something in the module or container that NVIDIA's compiler accepts makes AMD's crash, independent of the program and the wave size. I can run a build with more logging, or check a candidate fix on this card.
Not tested
XCL_DIRECT_DXIL=all.AI use: Claude Code (Claude Opus 5.5) built the trees, ran the tests and the title, classified the per-test results, and drafted this report.
@gefydev on GitHub · 2026-11-24 16:10 UTC · original
@HKEY-Funk-Machine @bmjask a likely candidate for the AMD crash: #1426 never emits
!llvm.ident(no occurrence ingpu/dxil/;Shader::finishwritesdx.version,dx.valver,dx.shaderModel,dx.resourcesanddx.entryPointsonly).@Sr-0w measured exactly this on an RX 7800 XT (Windows driver) while testing the text path (#1269, https://github.com/ivall/xcl/issues/1269#issuecomment-7136155748). A module without
!llvm.identvalidates and signs, butCreateComputePipelineStatefaults inside the AMD driver with an access violation instead of returning an error. Any value works, e.g.!llvm.ident = !{!0}/!0 = !{!"xcl"}. That fits what you see: it hits every container, whatever the program or wave size, and NVIDIA and WARP don't mind.The fix to try is one named metadata node in
Shader::finish, next to the others. With the builder's API, roughly:I can't run it on AMD here (GTX 1650). @HKEY-Funk-Machine, could you check
tests::emitted_kernel_runs_on_the_gpuwith that change on your RX 9070? If it isn't the cause, the shader flags are the next suspect: Sr-0w also found that they must match what the validator computes.AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev.
@gefydev on GitHub · 2026-11-24 16:11 UTC · original
@Kalmarv thank you for the test report on
065aef3, and for asking the right question about the validator: thedx.valver1.8 failures on DXC 1.7, the four fuzz seeds that the NVIDIA driver refuses, the clean smoke pair and the title run withXCL_DIRECT_DXIL=1are all useful for what we build on top.The size gap you measured (39.4 MB direct against 6.8 MB for the HLSL path in total, largest 14.7 MB) is what the per-lane mode on #1269 targets: it drops most of the per-instruction EXEC guards. On the retail pack the lane-mask analysis leaves 37.1 % of the vector instructions guarded.
AI use: Claude Code (Claude Opus 5.5) wrote this reply for @gefydev.
@emirduran707 on GitHub · 2026-11-24 16:11 UTC · original
Root cause of the AMD crash above: the emitted module has no
!llvm.ident. With it, the direct path runs on RDNA4.@bmjask @gefydev, following @HKEY-Funk-Machine's report: same crash here (
amdxc64.dll32.0.31044.16,0xC0000005at offset0xf879d0, the same 25gpu::dxiltests). I narrowed it down ontests::emitted_kernel_runs_on_the_gpuagainst DXC's output for the same program (testdata/dxc_cs_raw_uav.hlsl, compiled withcs_6_6,[WaveSize(64)]):HASH, or withoutSTAT, signed withcontainer::hashHASHpartDXILpartDXILpartIDxcAssembler(#1373'sassemble)!llvm.ident = !{!11},!11 = !{!"xcl direct dxil"}So the in-tree digest, the other parts and the bitcode writer are fine on AMD (
SFI0/ISG1/OSG1/PSV0are byte-identical to DXC's); only the missing named metadatallvm.identcrashes the driver's compiler, whatever string it holds. The difference between the two module headers is otherwise the declaration order (no effect) anddx.valver1.8 / 1.9 (no effect).With these three lines before
m.named_md("dx.version", …)in bothshader.rsandgraphics.rs(local only, not pushed):XCL_DIRECT_DXIL=1 cargo test -p xcl --lib gpu::recomp::tests: 118 passed, 0 failed; the same withXCL_DIRECT_DXIL=all: 118 passed, 0 failedcargo test -p xcl --lib gpu::dxil(65 run, 2 ignored), the failing ones rerun alone: 59 pass; still failing on this card:ops_tests::wave_ops_match_cpu:CreateComputePipelineState→0x887A0005(device removed); run together, the other GPU tests after it fail the same wayops_tests::half_precision_overloads_run:got(0)(half max) 5.0, expected 10.5fuzz_tests::fuzz_validate_and_gpu_0..3: GPU against CPU at seeds 328 (res[257]0xe0000000 / 0x0), 662 (res[576]0xf9999999 / 0xcccccccc), 1206 (res[320]0xfffffffe / 0xfffffffc), 1599 (res[193]0x1 / 0x0)Tested
065aef35c30f364d2a9be2431a1466cddf05e761, clean except the three lines above for the second halfcargo test --workspace -- --skip gpu::dxil: 750 passed, 0 failed, 41 ignoredNot tested
XCL_DIRECT_DXIL=1and the fix, NVIDIA with the fix (llvm.identshould be harmless there; DXC always writes it)AI use: Claude Code (Claude Opus 5.5) ran the tests and the experiments and wrote this report.
@Kalmarv on GitHub · 2026-11-24 16:13 UTC · original
Review notes on
065aef3, each shown with a local probe test (uncommitted, printing the validator's verdict and DXC's listing) under DXC 1.9.2609 and the SDK's 1.7.2308; no GPU needed.kernel.rs:296creates theexitblock before the program's blocks,lower_gfx.rs:262-279(finish_gfx) emits the bitcasts andstoreOutputcalls into it, andmodule.rs:884-888asserts on a non-phi reference to a later value. With the VS and PS ofcore_tests::direct_and_hlsl_graphics_stages_linkplus one forwardS_CBRANCH_SCC1or oneGLOBAL_LOAD_DWORDbefore the exports:the direct DXIL translator panicked: forward reference to value 104 at instruction 70 (blocks must be in dominance order)(PS; VS: value 129 at 85).pso.rs:275-279then takes the HLSL path, so underXCL_DIRECT_DXIL=allit is lost coverage, not a crash. Kernel mode translates the same branch.dx.valveris 1.8 (shader.rs:471-472,graphics.rs:918-919), which the Windows SDK's DXC 1.7.2308 refuses (Validator version in metadata (1.8) is not supported; maximum: (1.7)), even for an empty compute shader.kernel.rs:349-353validates in test and debug builds, so with that DXC every direct translation returnsErrthere. The README still lists DXC 1.7 as usable.!llvm.ident(shader.rs:503-509,graphics.rs:1008): DXC's output has!llvm.ident = !{!0}. Both validators accept it without; @Sr-0w reports an RX 7800 XT faulting inCreateComputePipelineStatewithout it (not tried here, no AMD card).dx.op.waveGetLaneIndexisreadnone(shader.rs:335); DXC 1.9.2609 declares itreadonly(1.7.2308 declared itreadnone).dxil.dll1.7 and 1.9 accept either. The other 71dx.opdeclarations match DXC 1.9.2609's table in name and attribute.Builder API only (the translator doesn't reach these at
065aef3):5. Nine
raw_uavs: DXC 1.9 saysFlags must match usage. Flags declared=16, actual=32784; the "64 UAV slots" flag (bit 15) isn't inshader.rs:38-58.6.
Module::unreachable(module.rs:639-642):Instructions must be of an allowed type. at 'unreachable'.7.
shader.rs:15's data layout is used withFeature::NativeLowPrecisiontoo; DXC with-enable-16bit-typeswrites…i16:16…f16:16…. DXC 1.9 accepts it anyway.Not checked: AMD, mesh mode for point 1, DXC 1.8.
AI use: Claude Code (Claude Fable 5.2, Claude Opus 5.5)
@thehollowedone on GitHub · 2026-11-24 16:14 UTC · original
One size opportunity on 065aef3. The current SSA builder can hand the bitcode writer phi nodes whose incoming values are identical once self-references are ignored.
In a scratch prototype I redirected those uses before assigning serialized value IDs and omitted the redundant phi records. The GPU loop fixture
gpu_scalar_loop_and_sccdropped 65 phi nodes and still matched its expected results on an RTX 3080 Ti (621.35), Windows 11 build 26300, DXC 1.8.2502.11, Rust 1.99.1 MSVC. The prototype conservatively keeps cycles.XCL_DIRECT_DXIL=1 cargo test --offline --locked -p xcl --lib gpu_scalar_loop_and_scc -- --nocapture --test-threads=1passed 1/1. The broader DXIL test group did not pass on this setup. An isolated rerun offuzz_validate_and_gpu_2rejected seed 1495 withFlags must match usageon both the unchanged head and the prototype.AI-assisted. Codex (GPT-6 family, exact variant unavailable) wrote the scratch prototype, ran the tests and drafted this report.
@Kalmarv on GitHub · 2026-11-24 16:10 UTC · original · edited 2026-11-24 16:15 UTC
Test report for
065aef3on an RTX 5070 Ti (NVIDIA 610.74, 32-lane waves), AMD Ryzen 9 9950X, Windows 11 Pro 26200, as @gefydev asked on #1269. I'll edit this comment as more runs finish.Tests (debug, clean tree at
065aef3)XCL_DXC_DIR)cargo test -p xcl --lib gpu::dxilXCL_DIRECT_DXIL=1 cargo test -p xcl --lib gpu::recomp::testsSKIPPED in the second row, both DXCs:
gpu_wave32_program_in_wave64_hardware,gpu_geometry_wave32_prefix_count_over_a_mask(no wave64).dx.valver1.8 (gpu/dxil/shader.rs:471,gpu/dxil/graphics.rs:918), and the 1.7 validator refuses them:Validator version in metadata (1.8) is not supported; maximum: (1.7). None of them reaches the GPU.fuzz_tests::fuzz_validate_and_gpu_0..3, each stopping at its first bad seed (62, 545, 1019, 1507):CreateComputePipelineState: Not enough memory resources are available to complete this operation. (0x8007000E)(fuzz_tests.rs:1158). The modules pass DXC 1.9's validator; the NVIDIA driver refuses them, the same seeds every run, also one test at a time with 38 GB of commit free.atomicrmw subon group-shared memory, and none of the 1141 modules without one fails. It isn't the whole condition: 9 modules withatomicrmw subran and matched (5 of them subtract a constant 0).atomicrmw sub(lower_mem.rs:965-967writes anaddof the negated value;RmwOp::Subis used only byfuzz_tests.rs:510), and DXC never does either. So this is a driver limit the fuzzer hits, not a path a title takes. Generatingaddof the negation in the fuzzer too would keep the test on the forms drivers see.dxil.dll: 303 containers dumped from these tests (gpu::dxil: 187 CS, 12 PS, 9 VS, 4 MS; the direct recompiler tests: 89 CS, 1 PS, 1 VS).dxil.dll1.9'sIDxcValidatoraccepts every one meant to be valid; the 11 it refuses are the onesdouble_unary_legality_matches_dxil_tablesexpects to be refused.dxil.dll1.7 refuses all 303 for the validator version alone.--validate, with vkd3d-proton's compute options) and spirv-val (vulkan1.3): all 292 meant to be valid convert, and every SPIR-V passes spirv-val. VS / PS / MS (26 containers) pass everything. (One CS needs its typedRWBufferat u3 left out of the root-descriptor option, and five with raw 64-bit loads need those options; neither is a container fault.) Not run inside vkd3d-proton or on a Vulkan driver.Regression run (60 s each,
scripts/smoke.ps1, release builds, no uncommitted changes;mainat930e8b4, this PR's base, then this PR's head;XCL_DIRECT_DXILunset). 100 % ofmain's frames, 107 % of its peak commit.main930e8b4:this PR,
065aef3:Title run with
XCL_DIRECT_DXIL=1(the same head, title and 60 s; nomaincounterpart): 1269 frames, no crash or device removal, peak commit 26751 MB. The log has nodirect DXIL … HLSL pathline, and the DXIL sizes differ from the HLSL path's (the first two programs: 6600 and 6572 B without the switch, 12928 and 12900 B with it), so the 79 compute pipelines it built went through the direct path. Compared with the pair's run of the same head without the switch (102 compute pipelines, 13 of them from the driver's blobs of an earlier build):The sizes compare like for like. The times likely don't: the HLSL path's programs had been built by the driver in earlier runs on this machine (median 1 ms), while every direct one was new to it.
Not tested
XCL_DIRECT_DXIL=all.AI use: Claude Code (Claude Opus 5.5, Claude Fable 5.2)
@LucasHoepfner on GitHub · 2026-11-24 16:18 UTC · original
Test report for
065aef3with DXC 1.8, the case @Kalmarv's notes leave open: RTX 3060 Ti (Ampere, 32-lane waves), NVIDIA 621.01, Intel Core i7-14700KF, Windows 11 Pro 26200, rustc 1.99.1 MSVC, debug, clean tree. DXC is the Windows SDK 10.0.26100.0'sdxcompiler/dxil1.8.2502.11, XCL's default here.gpu::dxil::validate::tests::malformed_containers_are_errorskills the whole lib test process with DXC 1.8 (0xc0000005, 3 of 3 runs alone). Every test after it in the binary then doesn't run. Running each of its five inputs alone (2 runs each): onlyb"DXBC"crashes, insideIDxcValidator::Validate. The other four pass, andDisassemblesurvives all of them. CI's DXC 1.9.2602.17 passes the test, so it looks like an out-of-bounds read in 1.8's validator on a buffer shorter than a container header. Dropping that input, or havingvalidate()refuse anything shorter than the 32-byte header before it calls DXC, would keep 1.8 machines running the suite.With that one test skipped (
--skip malformed_containers_are_errors):cargo test -p xcl --lib gpu::dxil -- --test-threads=4cargo test -p xcl --lib gpu::recomp::tests -- --test-threads=4XCL_DIRECT_DXIL=1cargo test --workspace --no-fail-fast -- --test-threads=4SKIPPED:
gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64).dx.valver1.8, so none of 1.7's 129 failures happen here.atomicrmw subon group-shared memory. I checked the four first-failing seeds (62, 545, 1019, 1507) one by one with a local print inrun_seeds. So the0x8007000Erefusal on the 5070 Ti and the 5080 looks specific to those Blackwell cards or their drivers, not to the modules.XCL_DIRECT_DXIL=1over all ofgpu::recompfailed once in 26 runs, ingpu_sparse_vram_descriptors_buffers_and_xmem, withsubmit 1 lane 0 mismatch(0 vs 1077). That's the message of the order-dependent failure in #343, and it passes alone on both paths. The other 25 runs passed, as did 5 on the HLSL path, so I can't pin it on either path.Not tested: a title or smoke run (I have no title),
XCL_DIRECT_DXIL=all, release, AMD, native wave64.AI use: Claude Code (Claude Opus 5.5) ran the tests and the probes and drafted this; I checked it before posting.
@brainhay5 on GitHub · 2026-11-24 16:20 UTC · original
Adding the part @Kalmarv's 60 s run could not reach: same card, same head (this PR merged onto
930e8b4, merge53ae66b),XCL_DIRECT_DXIL=1, but 120 s with input (A every 3 s).[SHADER] direct DXIL: … – HLSL pathline in the run, so no fallbacks.Then the usual end:
Same fault, same point as the HLSL path on this title (100.6 s against ~98–103 s). So the switch is safe and does route compute away from DXC, but it does not move this title's stall.
@Kalmarv's sizes explain why, and are the part of his report I would put first: the direct path's DXIL is 73 KB median / 14.7 MB largest / 39.4 MB total, against 23 KB / 1.2 MB / 6.8 MB on the HLSL path. The driver was already the bottleneck; being handed 3× the DXIL for the same work makes that side worse, which is exactly what the per-lane mode on
recomp-lane-masksis meant to offset (37.1 % of vector instructions still guarded).One request that would make live runs auditable: a success line per routed program, or an end-of-run count ("N compute programs direct, M fell back"). With zero fallbacks and no success line, "the switch reached the PSO path" and "the switch never applied" are indistinguishable in the log — Kalmarv and I both had to infer it from DXIL sizes.
Not tested:
XCL_DIRECT_DXIL=all, AMD, wave64, cold driver cache.AI use: OpenCode, DeepSeek V4.1 Flash 1017.
@Sr-0w on GitHub · 2026-11-24 16:22 UTC · original
AMD Windows results for this PR: native wave64 tests and a retail title run. Tested on an RX 7800 XT (RDNA3, native wave64) with the AMD Windows driver, Windows 11 26300 and DXC 1.9.2602.17, at the PR head
065aef3. Counts and timings only.1. On AMD, every container without
!llvm.identcrashesCreateComputePipelineState.XCL_DIRECT_DXIL=1 cargo test -p xcl --lib gpu::exits withSTATUS_ACCESS_VIOLATIONin the first test that builds a pipeline (direct_and_hlsl_graphics_stages_link). The fault is inside the AMD driver, not an error code. The validator accepts these modules; DXC always writes the metadata, the writer here never does. I hit the same thing with modules assembled from IR text (#1373). Adding it fixes the crash:2. With that change, native wave64 and the in-tree digest work on AMD.
XCL_DIRECT_DXIL=1 cargo test -p xcl --lib gpu::recomp::tests: 118 passed, 0 failed, 17 ignored. Every kernel, compute, mesh, VS and PS test goes through the direct path on native 64-lane waves, the path the description lists as not run.digest_matches_dxc_signed_containerpasses, and so does every test above.3.
gpu::dxiltests that fail on AMD, with the!llvm.identchange and--test-threads=1:fuzz_validate_and_gpu_0to_3: the GPU differs from the CPU interpreter at seeds 328 (res[257]0xe0000000 vs 0x0), 662 (res[576]0xf9999999 vs 0xcccccccc), 1206 (res[320]0xfffffffe vs 0xfffffffc) and 1599 (res[193]0x1 vs 0x0). All of them use i64 / f64 / f16 constants and phis.ops_tests::half_precision_overloads_run: the f16WaveActiveMaxgives 5.0 where 10.5 (the max over the 32 lanes) is expected.ops_tests::wave_ops_match_cpu: on its own, it removes the device (0x887A0005at the nextCreateComputePipelineState).4. The translated-shader disk cache serves the HLSL path's DXIL under
XCL_DIRECT_DXIL=1.The cache identity (
identity_for(XCL_TRANSLATOR_SOURCE_ID, toolchain)) does not include the mode. My first title run withXCL_DIRECT_DXIL=1wrote 2 new entries and read the other compute programs from entries of earlier HLSL runs. The reverse happens too: turning the variable off keeps serving direct DXIL. Fix: put the mode in the identity. Workaround:XCL_TRANSLATED_CACHE=0.5. Retail title, world load.
Both runs use the same binary (this PR + item 1),
XCL_NETWORK=0,XCL_TRANSLATED_CACHE=0, and the same scripted input (A every 15 s, 300 s).XCL_DIRECT_DXIL=1+0x23cf683) at 143 sThe direct path removes DXC (about 24 s on this size of program at
-O1, not counted in the driver column). It also builds the largest program faster in the AMD driver than the HLSL path does, despite 10× the DXIL: 65 s against 98 s. But with per-instruction EXEC masking and no optimisation, the giant programs are 10× larger, and the run still stops at the same point: frames fall to ~9 fps, then the title's watchdog fires at about 145 s with a title thread waiting on a compute pipeline. That is the case for the per-lane lowering in #1269 (gefydev'srecomp-lane-masks), which drops about 63 % of the guards on the pack. I'll rerun this table when that lowering produces DXIL through this writer.AI use: Claude Code (Claude Opus 5.5) ran the tests and the title runs, and wrote this.
@bmjask on GitHub · 2026-11-24 16:37 UTC · original
Thanks for the reports, all of them were actionable. Head is now
bc93a3a6f1d5:!llvm.ident = !{!"xcl"}is now emitted by every finish path (thanks @gefydev for the pointer). @HKEY-Funk-Machine, could you re-runtests::emitted_kernel_runs_on_the_gpuand thegpu::dxilGPU tests on the RX 9070, and the title withXCL_DIRECT_DXIL=1if those pass?dx.valver1.8, because PSV0's entry-name record needs validator 1.8+. With an older validator, tests now skip only the validation step and printSKIPPED … validator X.Y < 1.8(checked with SDK DXC 1.6). The runtime never uses the validator.E_OUTOFMEMORY(@mastrr9, @Kalmarv): thanks for isolatingatomicrmw subacross all 2000 seeds. The fuzzer now emits add-of-negation, as DXC and the translator do. Seed numbering is unchanged.smoke.ps1block onbc93a3a6f1d5(and main) would let the check pass. Otherwise I'll post one.@gefydev, on your two questions:
module.rs/shader.rsare meant as a target for a second lowering, and the signatures you listed stay stable (phi/phi_at/add_incoming, blocks/br/cond_br, int ops/cmp/select, ids,wave_ballot,raw_uav/raw_load/raw_store,finish…). Anything that would change them gets a ping first. Trivial phi replacement isn't in the builder yet; tell me the shape you want and I'll add it additively.Lw::inst_guarded(d, guard, mask)(commit86ab4cd) lowers one non-branch instruction under an i1 guard you choose: it decides VGPR write selects and guarded memory, and a constanttruefolds away. The optionalmaskis the wave-wide mask cross-lane ops see (DPP, readfirstlane, ds_swizzle, bpermute); if omitted they read the SSA EXEC. EXEC-writing instructions still update the SSA EXEC (s126/s127).Lwis currently built insidekernel.rsper entry. If you want to own the block walk, I can split out a constructor/epilogue here or you can do it in your PR, whichever you prefer.AI use: Claude Code (Claude Opus 5.5) wrote this comment for @bmjask.
@gefydev on GitHub · 2026-11-24 16:39 UTC · original
@bmjask thanks for the answers and for the fixes.
inst_guarded(d, guard, mask)is exactly the reuse we wanted: the per-lane mode keeps the console CFG with per-lane branches and the lane-mask analysis, and lowers every non-branch instruction throughinst_guardedwith the analysis's guard (truewhere EXEC is proven, which folds away), instead of reimplementing the instruction semantics.Answers:
Module::replace_all_uses(old: Value, new: Value), rewriting every operand and every phi incoming that isold, and removingoldfrom its block when it is a phi. Our SSA construction calls it witholda phi it found trivial, andnewdominates every use. Additive is perfect.DxilIrwill then hold anLwbuilt by it.direct-on-1426ontobc93a3a6f1d5and drop our own!llvm.identcommit now that yours is in. The per-lane mode comes as a stacked follow-up once #1426 lands, as you said.AI use: Claude Code (Claude Opus 5.5) wrote this reply for @gefydev.
@Kalmarv on GitHub · 2026-11-24 16:42 UTC · original
@bmjask a pair on
bc93a3a6f1d5and itsmainbase is queued here (RTX 5070 Ti) behind one run now in progress. I'll post both blocks in this thread when it's done.@SlopTart on GitHub · 2026-11-24 16:43 UTC · original
Ran the XCL_DIRECT_DXIL backend on Linux/Wine with a native wave64 card. The backend itself lands well: the whole
gpu::dxil::graphicsfamily and nearly allgpu::dxil::ops_testspass here. Two failures, one of which is not this PR's fault.1. Hard kill in
gpu::dxil::ops_tests::integer_ops_match_cpu- the old vendored dxil-spirv, not the backend. The lib test binary dies with no panic (wine exit 3); Wine SEH showserr:vulkan:vkCreateComputePipelines Exception 0xc0000005 in Unix call, i.e. the access violation lands inside the Vulkan driver call while the pipeline is being created. Deterministic: 5/5 across runs, reproduces single-threaded, and still crashes underRADV_DEBUG=llvm, so it is not an ACO bug. A/B against the vendored pin: vkd3d-proton v3.1's dxil-spirv pin8b48f0e0crashes 5/5, master's pin7c048638passes 2/2 cold. This is the same crash family as #1246 on this rig; the fix commit named there (71967a38"Rewrite the structurizer from scratch.") sits between those pins, so the same vendored bump should clear it here too.2. Fuzz seeds disagree with the CPU interpreter on wave64.
gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_2andfuzz_validate_and_gpu_3fail atcrates/xcl/src/gpu/dxil/fuzz_tests.rs:1162: seed 1003 givesres[713] = 0x1, interpreter expects0x0; seed 1698 givesres[0] = 0x1, expects0x0. These fail identically with both the v3.1 and master vkd3d builds, so the dxil-spirv pin is not involved - it is a GPU-vs-CPU semantic mismatch of the emitted DXIL on this card (RDNA3, native wave64). Counts only, no game data; the seeds and disassembly are in the panic output. Worth a check on an NVIDIA row to see whether wave32 sees the same seeds.Method note: vkd3d-proton's pipeline cache
vkd3d-proton.cacheis written relative to the test cwd and silently skips compilation on later runs; every A/B above deleted it before each trial (see my cache note in #1246).Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1,
XCL_NETWORK=0, release profile. See my Linux rows in #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
@Icey-Glitch on GitHub · 2026-11-24 16:43 UTC · original
Some suggestions on output size (the ~3x / 13.6x vs DXC noted in the description), from reading the code. I haven't built this or measured where the size goes, so the order is a guess.
Cheap passes that would probably pay off
ssa.rsfollows Braun et al., but I don't see the paper'stryRemoveTrivialPhistep. Every read in an unsealed block (loop headers etc.) creates a phi, andsealonly fills in operands, so with ~400 tracked register dwords a lot of phis end up with a single distinct incoming value. Removing them (and re-checking the phi's users) is small and is likely a big share of the size. Counting phis on one large retail shader would confirm or rule this out.FnAttrs::ReadNone, and the module is in memory, so dropping unused side-effect-free instructions and calls before writing should be straightforward.ReadNonedx.op calls. Each access emits its owncreateHandleFromBinding/createHandleFromHeap+annotateHandle. Caching those per (binding, props), or doing a general value-number pass overReadNonecalls, removes repeats (cbuffer loads benefit too).fold_bin) already covers part of what SCCP would do.Things to keep out of any optimisation passes
ifs changes results.VAR_BUDGETcheck sits relative to the first iteration, allowing one iteration more than the cap. If loop passes are added, a test that the budget stays exact would catch this.@emirduran707 on GitHub · 2026-11-24 16:46 UTC · original
Rechecked on the same RX 9060 XT (RDNA4, driver 32.0.31044.16) at
bc93a3a, which hasac9328f(!llvm.ident): no crashes any more.XCL_DIRECT_DXIL=1 cargo test -p xcl --lib gpu::recomp::tests: 118 passed, 0 failed;XCL_DIRECT_DXIL=all: 118 passed, 0 failedcargo test --workspace -- --test-threads=4 --skip wave_ops_match_cpu: lib 776 passed, 5 failed, 23 ignored. The five are the ones from my report above:fuzz_validate_and_gpu_0..3(GPU against CPU) andhalf_precision_overloads_run(half max 5.0, expected 10.5)ops_tests::wave_ops_match_cpustill removes the device here (CreateComputePipelineState→0x887A0005), alone as well. In a full run every GPU test after it fails (93 failures, several printSKIPPED … no GPU), so the counts above skip it.AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this.
@Kalmarv on GitHub · 2026-11-24 16:47 UTC · original
@bmjask here is the pair on
bc93a3a6againstmain930e8b4(this PR's base), for the Regression run section. Both runs pass: no device removal, no crash, 101 % ofmain's frames, 96 % of its peak commit.Tested
scripts/smoke.ps1, the same retail title for 60 s each:mainfirst, then this PR's head, one after the other on the same machine.XCL_DIRECT_DXILunset on both, so this covers the default path.main930e8b4:this PR,
bc93a3a6:Not tested
XCL_DIRECT_DXIL=1on this head (the direct-path title run in my earlier comment was on065aef35).AI use: Claude Code (Claude Opus 5.5)
@gefydev on GitHub · 2026-11-24 16:49 UTC · original
@bmjask one more builder request, found by @upipibi while trying a second lowering (https://github.com/ivall/xcl/issues/1269#issuecomment-7138223440), and it affects the per-lane path generally. The writer emits blocks in creation order and needs that order to be a dominance order (forward references only through phis). The per-lane lowering creates every block up front (the SSA construction needs each block's predecessors before lowering) and then adds blocks in the middle: a guarded store's then/join blocks,
exchange_spin's loop. Creating blocks lazily does not fix it either: a loop's exit block is referenced from the head's branch before the body that dominates its uses exists.Request: at
finish/to_bitcode, emit the entry function's blocks in reverse post-order of its CFG (entry first), and number values in that order, so that a lowering may create blocks in any order. That also coversLw::guardedcalled from a driver that pre-creates blocks. It is additive for #1426's own path, which already creates blocks in an order that reverse post-order preserves. Together withreplace_all_uses, that is all the per-lane mode needs from the builder.AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev.
@Kalmarv on GitHub · 2026-11-24 16:52 UTC · original
@bmjask a second case for the block-order change @gefydev asked for, at
bc93a3a6: a VS or PS whose program branches before its exports is refused,VS: direct DXIL builder error: forward reference to value 128 at instruction 90 (blocks must be in dominance order), and the stage goes to HLSL.kernel.rs:303createsexitbefore the program's blocks, and the epilogue placed inexitreads their values.We have a local fix (5 lines: the epilogue goes into a block created after the program's blocks) with a test,
graphics_stages_with_a_branch_before_their_exports(a VS and a PS with ans_cbranch_scc1over onev_movbeforeexp). It fails onbc93a3a6; the run with the fix is going now. If the writer lays blocks out in reverse post-order atfinish, that covers this too and the fix isn't needed, but the test may still be useful. Say which you'd like.Separately, still at
bc93a3a6:shader.rs:338declareswaveGetLaneIndexReadNone; DXC declaresdx.op.waveGetLaneIndexreadonly. We have that as a one-line commit with a listing test too.AI use: Claude Code (Claude Opus 5.5)
@ArturoWolff on GitHub · 2026-11-24 16:10 UTC · original · edited 2026-11-24 16:55 UTC
RTX 4060 / Proton: direct compute dispatch passed on
065aef35c30f364d2a9be2431a1466cddf05e761, with fallback excluded. One synthetic wave32 group, 32 lanes, one memory window. Different EXEC masks controlled a register update (0xa5a5a5a5) and a global store (0xcccccccc). Each backend matched an independent CPU oracle on all 64 output words: 16 stores (eight updated values, eight preserved) and 48 untouched sentinels, including all 16 masked-off destinations.Tested: Windows-target release build on Linux, Ryzen 5 5600, RTX 4060, NVIDIA 620.73.04, GE-Proton11-14, vkd3d-proton
4522cc1a8b1347f+. Separate Wine processes ran the exactdirectandhlsltests with--exact --nocapture --test-threads=1; each had 1 passed, 0 failed, 0 ignored, 0 skipped, 1 filtered. The direct probe callsgpu::dxil::kernel::translate_compute, fails on refusal and submits its returned bytes directly toCreateComputePipelineState. DXC was disabled in that process;dxcompiler.dllwas not loaded before or after translation. The control usedrecomp::translatethendxc::compile. Both dispatched and read back the same buffer layout.One observation per backend, not a speed benchmark: direct conversion 1,297 µs, first PSO 5,446 µs; control 97 µs to HLSL + 15,676 µs in DXC, first PSO 5,584 µs. No supplied cached PSO; not proof of a fully cold driver. Not tested: live hook/fallback selection, native Windows or AMD, wave64, the separate per-lane lowering, full suite, retail loading. AI use: Hermes Agent (gpt-6.2-astra), probe, execution, output verification and report.
Paired timing follow-up on the same head and RTX 4060
Skipping DXC saved time even after the first
CreateComputePipelineStateon two synthetic, all-active wave32 arithmetic shaders. Each size had four direct/HLSL pairs (two direct-first, two HLSL-first), one fresh Wine process per arm. Median within-pair differences in milliseconds; the last column is the median of the paired sums, not a sum of column medians:Direct won the sum in all eight pairs. At 256 rounds its PSO was slower in every pair; its executable bitcode was 16,516 bytes vs 11,984 from DXC. The arithmetic survived both compilers (1,288 vs 1,287 LLVM binary-op records). All 16 dispatches matched a separate integer CPU oracle: 32 lane results and 32 untouched guard words per run; no refusal or skip. Both paths got identical ISA and runtime user data. The direct probe failed on refusal, with DXC disabled. Stock used
recomp::translate+dxc::compile(cs_6_6, no extra flags).Commands: private Windows-target release probe,
probe.exe direct --exact --nocapture --test-threads=1/probe.exe hlsl --exact --nocapture --test-threads=1, at each size. No supplied PSO blob; fresh per-arm cache directories and disk shader caches disabled, not a guarantee of a cold driver. These are conversion and PSO API timings, not GPU execution or retail startup timings. This compares this PR's per-instruction emitter to HLSL/DXC, not the coordinated per-lane emitter to this PR. AI use: Hermes Agent (gpt-6.2-astra), fixtures, measurements, verification and report.CPU-only regression fixture for the writer-order request. At
bc93a3a6f1d5ce2f5836135b231bd5e09e8d1658(the samemodule.rsandbitstream.rsasa7cf0784c0eeb2e372b9cce48b1cf7f03f083e4a), I compiled those two unmodified modules withrustc --edition=2021 order.rs -o probeon Linux x86-64. The graph, values, phi incoming edges and order of all instruction-building calls are fixed. Onlynew_block()order changes.abc(head, body, exit) serializes;acb,bac,bca,cab,cbaall report a non-phi forward reference. LLVMopt -passes=verify -disable-outputaccepted the independently reordered textual IR for all six, and rejected a negative control adding an entry→exit edge bypassing the definition. Reproducer function below; call once per order using a fresh module, and require all six to returnOkafter the writer fix. No adapter workaround proposed. Writer test only, not shader validation, dispatch or timing. Hermes Agent (gpt-6.2-astra) wrote and ran the fixture.Writer fixture (uses the existing module types)
@Kalmarv on GitHub · 2026-11-24 16:59 UTC · original
@bmjask the two fixes from my comment above, tested, on
bc93a3a6: Kalmarv/xcldxil-fixes-1426, three commits you can cherry-pick one at a time:1b537d45the epilogue goes into a block created after the program's blocks (kernel.rs+5), withgraphics_stages_with_a_branch_before_their_exports: a VS and a PS that branch ons0before their exports, drawn through the direct path and the HLSL path fors0= 0 and 1, with the same picture.43674985waveGetLaneIndexReadOnly(shader.rs:338), withwave_lane_index_is_declared_readonly(listing).40866943TRANSLATOR_VERSION1 → 2, on its own so you can bump once.If you make the writer lay blocks out in reverse post-order instead, skip
1b537d45; its test should still pass and may be worth keeping.Tested (RTX 5070 Ti, driver 610.74, Windows 11 Pro 26200, debug, DXC 1.9.2609.5)
bc93a3a6with only the two tests:gpu::dxil73 passed, 2 failed (the two new tests), 2 ignored.40866943:gpu::dxil75 passed, 0 failed, 2 ignored;gpu::recomp::testswithXCL_DIRECT_DXIL=1and with=all: 118 passed, 0 failed, 17 ignored each (2 SKIPPED, no wave64), the same as onbc93a3a6.Not tested
AI use: Claude Code (Claude Fable 5.2, Claude Opus 5.5)
@Tjabooo on GitHub · 2026-11-24 17:06 UTC · original
On the fuzz seeds 1003 and 1698 that give wrong values on RADV (@SlopTart above on RDNA2/3, @Sipentech on #1269 on RDNA4): the DXIL is right. RADV miscompiles it.
Reproduced on an RX 9070 XT (RDNA4), RADV / Mesa 26.2.6, Wine 11.21, vkd3d-proton v3.1 with dxil-spirv
7c048638,direct-on-1426ata7cf078(the current head). I shrank both seeds locally with a throwaway pass: keep one output and drop every instruction it doesn't depend on, then run on the GPU. The GPU still disagrees with the interpreter after shrinking:Seed 1698, 3 instructions, all constants, 32 of 32 lanes wrong:
GPU writes 1, interpreter 0.
Seed 1003, 9 values. A shared-memory atomic and a lane exchange feed the same shape:
ashr(shl(x, 26), 26), thenicmp ule %7, -2. Lanes where the sign-extended value is -1 get 1 (expected 0). Every intermediate value is right when output on its own; only the compare is wrong.Where it goes wrong, for seed 1003's reduced program:
%29 = ashr i32 %28, 26,%30 = icmp ule i32 %29, -2. Correct.VKD3D_SHADER_DUMP_PATH):OpShiftRightArithmetic %63 %uint_26,OpULessThanEqual %65 %uint_4294967294. Correct.RADV_DEBUG=shaders): the shared-memory reads, the shifts and the compare are gone, and the output is a stored constant1(v_dual_mov_b32 v5, 1→global_store_b32).So the common pattern is a 6-bit sign extension (
shl 26+ashr 26) compared unsigned against a constant nearUINT_MAX, and RADV folds the compare to true as if the value could not be that large. It looks like a NIR optimization or range-analysis bug in Mesa. I have not tested Mesa main yet and will before reporting it to Mesa. On the backend side nothing needs to change for these two seeds; on RADV they will keep failing until Mesa is fixed.No game data. AI-assisted (Claude Code, Claude Opus 5.5); everything above is from runs on this machine.
@mynzjerko on GitHub · 2026-11-24 17:06 UTC · original
@bmjask @gefydev Windows RDNA4 test report + root causes for the three AMD RDNA4 failures on
bc93a3a6f1d5ce2f5836135b231bd5e09e8d1658, plus a Windows RDNA4 check ofgefydev/xcl:direct-on-1426(a7cf078).Hardware / build
32.0.32029.2010; AMD Ryzen 5 7500F; Windows 11 Pro10.0.26300;rustc 1.100.0(stable-x86_64-pc-windows-msvc); DXC1.9.2602.17; debug build; clean worktree.Results on
#1426headbc93a3a6XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- gpu::recomp::tests --test-threads=4: 118 passed, 0 failed, 17 ignored (0 SKIPPED)XCL_DIRECT_DXIL=all cargo test -p xcl --lib -- gpu::recomp::tests --test-threads=4: 118 passed, 0 failed, 17 ignored (0 SKIPPED)cargo test -p xcl --lib -- gpu::dxil --skip wave_ops_match_cpu --test-threads=1: 67 passed, 5 failed, 2 ignored (0 SKIPPED) — same 5 as @emirduran707's RX 9060 XT report (half_precision_overloads_runandfuzz_validate_and_gpu_0..3).cargo test -p xcl --lib -- gpu::dxil::ops_tests::wave_ops_match_cpu --nocapture --test-threads=1:CreateComputePipelineState→0x887A0005(device removed).Root causes found (local isolated checks, reverted after)
wave_ops_match_cpu(0x887A0005) —soponWaveMultiPrefixBitXor: bisecting all wave ops in the test isolated the single failing call toops_tests.rs:768,wave_multi_prefix_op(u, mask, multi_prefix::XOR, true), which emitsdx.op.waveMultiPrefixOp.i32(..., i8 3, i8 1)(sop = Unsigned). DXC emitsi8 0(sop = Signed) forWaveMultiPrefixBitXor. Changingtrue→falseatops_tests.rs:768makes the fullwave_ops_match_cputest pass on RX 9070 (1 passed, 0 failedin 0.10 s, no device removal).Shader::wave_multi_prefix_opcould forcesop = 0for bitwiseAND/OR/XOR.half_precision_overloads_run(got(4) = 5.0, expected10.5) — AMD driver bug, not#1426: a minimal HLSL shader with[WaveSize(32)]andWaveActiveMax(abs((float16_t)b))compiled directly with DXC1.9.2602.17(-enable-16bit-types) produces the exact same5.0across all 32 lanes on RX 9070 (32.0.32029.2010), matching#1426's emitted DXIL.fuzz_validate_and_gpu_0..3(seeds328,662,1206,1599) — constantBfrev.i64inamdxc64.dll:dx.op.unary.i64(30, dynamic_i64)alone gives the right result (Bfrev(7)→hi=0xe0000000, lo=0x00000000, matching DXC), whereasdx.op.unary.i64(30, i64 7)giveshi=0xe0000000, lo=0xe0000000(duplicatingbfrev32(lo)into both halves). DXC always constant-foldsreversebits((uint64_t)7)even with-Od, soamdxc64.dllonly hits this on unfolded direct DXIL.328(Bfrev(7)→0xe0000000instead of0x0),662(0xe0000000e0000000 / 5→ low 32 bits0xf9999999instead of0xcccccccc), and1206(Bfrev(0x7fffffffffffffff)→0xffffffffffffffff, doubled →0xfffffffeinstead of0xfffffffc).FUZZ_SEED=1003andFUZZ_SEED=1698viadebug_seed): both pass with 0 mismatching results on Windowsamdxc64.dll, so those two appear specific to the vkd3d-proton/RADV path.Bonus:
gefydev/xcl:direct-on-1426ata7cf078(Windows RDNA4)cargo test -p xcl --lib -- gpu::recomp::lower --test-threads=1: 21 passed, 0 failed, 0 ignored (0 SKIPPED)cargo test -p xcl --lib -- lane_masks --test-threads=1: 7 passed, 0 failed, 0 ignored (0 SKIPPED)Not tested: retail title (
scripts/smoke.ps1), release build, NVIDIA/Intel, Linux.AI use: Google Antigravity (Gemini 4 Neon) ran the test suites and isolated diagnostics and drafted this report; results were checked against local logs.
@gefydev on GitHub · 2026-11-24 17:07 UTC · original
@bmjask a small addition to the
Lwconstructor / epilogue split, found while planning the next pieces on #1269. Please make the per-entry setup reachable from outsidekernel.rstoo:setup_lanes_computefor compute, andmesh_initfor the mesh pass. The per-lane form drives those entries with its own CFG, and two pieces depend on it: @Sr-0w's 2-D / 3-D groups (Ir::compute_ids, whose adapter half callssetup_lanes_compute) and @Kalmarv's mesh stage in the per-lane form. We will not changekernel.rsin our branch.AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev.
@Kalmarv on GitHub · 2026-11-24 16:57 UTC · original · edited 2026-11-24 17:07 UTC
Test report for
bc93a3a(bc93a3a6f1d5): the PR's own tests and the whole suite pass on an RTX 5070 Ti with both the Windows SDK's DXC 1.7 and DXC 1.9. The failures seen at065aef3are gone: the fourfuzz_validate_and_gpu_Nfailures (NVIDIA refusingatomicrmw sub, with DXC 1.9) and the 129 failures with the SDK's DXC (dx.valver1.8 refused by the 1.7 validator).Tested
NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74), AMD Ryzen 9 9950X, Windows 11 Pro 26200, rustc 1.99.0, debug build, clean tree at
bc93a3a6f1d5.With the Windows SDK's DXC (10.0.26100, dxcompiler 1.7.2308.16):
cargo test -p xcl --lib gpu::dxil: 73 passed, 0 failed, 2 ignored. 46 tests printSKIPPED <test>: validator 1.7 < 1.8 (validation step only); their GPU parts ran.XCL_DIRECT_DXIL=1 cargo test -p xcl --lib gpu::recomp::tests: 118 passed, 0 failed, 17 ignored.cargo build --workspace && cargo test --workspace -- --test-threads=4(XCL_DIRECT_DXILunset): 826 passed, 0 failed, 43 ignored. The same 46 validation-step SKIPPED lines.With DXC 1.9.2609.5 (
XCL_DXC_DIR):cargo test -p xcl --lib gpu::dxil: 73 passed, 0 failed, 2 ignored, nothing skipped.XCL_DIRECT_DXIL=1 cargo test -p xcl --lib gpu::recomp::tests: 118 passed, 0 failed, 17 ignored.cargo build --workspace && cargo test --workspace -- --test-threads=4(XCL_DIRECT_DXILunset): 826 passed, 0 failed, 43 ignored.SKIPPEDon this adapter in every run that includes them (no wave64):gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware,gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask.At
065aef3the same two filtered commands gave, with DXC 1.9: 61 passed, 4 failed, 2 ignored and 118 passed, 0 failed, 17 ignored; with the SDK's DXC: 14 passed, 51 failed, 2 ignored and 40 passed, 78 failed, 17 ignored.A 60 s title run with
XCL_DIRECT_DXIL=1(scripts/smoke.ps1, same machine): exit 0, 1251 frames, no device removal or crash. 80 compute pipelines went direct, 0 fell back to HLSL; DXIL mean 488 KB, largest 14.7 MB; PSO time 66 s in total, median 100 ms, largest 26.8 s. As at065aef3, so the size and PSO-time numbers in my earlier comment still hold.Not tested
XCL_DIRECT_DXIL=all, and the whole suite withXCL_DIRECT_DXILset.AI use: Claude Code (Claude Fable 5.2, Claude Opus 5.5) ran the tests and wrote this report.
@HKEY-Funk-Machine on GitHub · 2026-11-24 17:07 UTC · original
@bmjask a second AMD driver fault in the direct path, isolated to one program (moved here from #1269 at @gefydev's request). Counts, hashes and timings only; no DXIL or console container attached.
The fault:
0xC0000005inamdxc64.dll+0x6800a4(read at0x0), duringCreateComputePipelineStateof the direct path's DXIL for one compute program. It is not the!llvm.identfault (+0x1ab0cf7), which is fixed.amdxc64.dll+0xb2dcb5, +0x67f0e1, +0x68b755, +0x6cf141, +0x1b189f, +0xa1a3b2The program: console CS
[SHADER] cs 62b584e061c05fc5(8 540 B console container, retail 1.0.2.1;[SHADER]'s FNV-64 of the container, findable in your own copy).CreateComputePipelineStateon the RX 9070XCL_DIRECT_DXIL=1)XCL_DIRECT_DXILunset,XCL_TRANSLATED_CACHE=0,XCL_PSO_DISK_CACHE=0)S_OKThe HLSL build reported 1 ms, which is almost certainly the AMD driver's own shader cache (it isn't covered by XCL's switches), so I don't have a cold driver time for the HLSL form.
Tested on:
direct-on-14266e6796aanda7cf078(the latter on #1426bc93a3a), each + #751 + #1288 (so the title's stall check doesn't end the run first) + a local patch that skipsInitializeApiImplEx2;XCL_NETWORK=0. RX 9070 (RDNA4), AMD driver 32.0.32015.7029, Ryzen 9 7945HX3D, Windows 11 Pro 26300, release.How it was isolated (local, uncommitted debug code):
CreateComputePipelineState, with a hash of the DXIL and the console[SHADER]hash. A PSO with a "begin" and no "end" was in flight at the fault.XCL_PSO_PRELOAD=0. Three PSOs were in flight in both of the first two faults.cs 62b584e061c05fc5's build begun and never finished.Not tested: other AMD drivers or RDNA generations; a cold driver time for the HLSL form; a repro outside the title;
direct-on-142666980c0(pushed since; I expect the same per-instruction output). I can run a candidate fix or a debug build on this card.AI use: Claude Code (Claude Opus 5.5) wrote the local debug logging, ran the isolation runs, and drafted this report.
@Sr-0w on GitHub · 2026-11-24 17:09 UTC · original
@bmjask two things on
bc93a3a.1. The
Lwconstructor: I'll take it, as you offered ("or you can do it in your PR"). It goes ongefydev/xcldirect-on-1426, the stacked per-lane branch, as its own commit.translate_on_this_thread's setup becomes apub fn Lw::new(...): theShaderand UAVs, theLwliteral, the SSA entry, the LDS / exchange-slot scan,setup_storageand the split partner. A matchingfinish/ epilogue entry goes with it.translate_on_this_threadcalls both, so #1426's own path does not change. I'll check that by running the wholegpu::dxilsuite, with identical DXIL for the kernel tests. Ping me if you already started, and I'll drop mine. I won't touch the block-order change (writer emitting in reverse post-order); that one stays yours.2. Why the fuzz seeds still fail on AMD (RX 7800 XT) after
55e9c3b: the driver gets 64-bitbfrevwrong. This is not theatomicrmw subthat NVIDIA refused. Seed 328, isolated value by value against the CPU interpreter:v37: i64= 7 on every lane, GPU and CPU agree;v40 = DxUn(Rev, v37)(dx.op.bfrev.i64): CPU0xe0000000_00000000, GPU0xe0000000_e0000000.The AMD driver reverses the low 32 bits and writes that into both halves. The translator emits
bfrev.i64fors_brev_b64, so retail programs hit it too, not only the fuzzer. The fix is a workaround for every vendor:bfrev(lo)andbfrev(hi)in i32, then swap the halves. Do you want it in #1426 or as a commit from me? I'll check the other three seeds (662, 1206, 1599) andhalf_precision_overloads_runthe same way and post what they are.AI use: Claude Code (Claude Opus 5.5) found the value and wrote this comment.
@bmjask on GitHub · 2026-11-24 17:11 UTC · original
Pushed
7d24e97b4157:to_bitcode/finishnow write the entry's blocks in reverse post-order of its CFG (entry first) and number values in that order, so a lowering may create blocks in any order. Unreachable blocks are dropped, along with their phi edges.Module::replace_all_uses(old, new)is added; it rewrites instruction and metadata operands. Test:blocks_are_written_in_reverse_post_order(a block targeted before its dominator exists, an unreachable block feeding a phi, and a trivial phi replaced). It validates and runs on the GPU.waveGetLaneIndexreadonly; andTRANSLATOR_VERSION2. That one bump also covers the layout change. Thanks!!llvm.ident. The remaining wave64/RDNA failures (fuzz_validate_and_gpu_*vs the CPU interpreter, also seen by @SlopTart on RADV;half_precision_overloads_run;wave_ops_match_cpuremoving the device) are being looked at now. An audit of every dx.op declaration's attributes against DXC is part of that. @SlopTart, theinteger_ops_match_cpucrash with the old dxil-spirv pin is noted as outside this PR.replace_all_uses, DCE/CSE of pure dx.op calls, a per-pass disable switch, and the loop budget kept exact).The regression pair will be redone on the final head of this round; @Kalmarv, thanks for the pair on
bc93a3a6.AI use: Claude Code (Claude Opus 5.5) wrote this comment for @bmjask.
@gefydev on GitHub · 2026-11-24 17:13 UTC · original
@bmjask thank you for the reverse-post-order block layout and
Module::replace_all_uses(7d24e97). Our adapter now uses both, ondirect-on-1426rebased onto it. On theLwconstructor / epilogue split: @Sr-0w does it in the per-lane branch, as you offered, so you do not need to split it out on #1426. Hisbfrevfinding is for you here.AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev.
@Frtuchinno on GitHub · 2026-11-24 17:16 UTC · original
@bmjask on
half_precision_overloads_run, adding to @mynzjerko's finding (an AMD driver bug, reproduced with DXC on RDNA4): the same on RDNA3, with a wider pattern and a test change you can take.Pattern. The AMD Windows driver drops an
fabsorfnegthat feeds a wave reduction: the reduction runs on the unmodified value. It happens in f32 as well as f16, in wave32 and wave64, and with DXC's own HLSL. RX 7800 XT, driver 32.0.32029.2010,b = 5 - 0.5 * lane, value read from the last lane:WaveActiveMax(abs(b))WaveActiveMax(-b)WavePrefixSum(abs(b))WaveActiveMax(max(b, -b))WaveReadLaneAt(abs(b), last)WaveActiveMax(asfloat(asuint(b) & 0x7fffffff))Through this PR's writer it is the same: the f16
WaveActiveMin(abs(hb))gives −10.5 and the f16WaveActiveSum(abs(hb))gives −88 (the sum ofhb). With anfpextbetween thefabsand the f32 reduction, the result is right.Runtime impact: none found. Nothing outside the tests calls
wave_active_op/wave_prefix_op. The HLSL path's only wave reductions areWaveActiveSum/WavePrefixSumof uints (emit.rs:4537,4615).Test change, one commit on
7d24e97:Frtuchinno/xclamd-wave-reduction-modifier-testaa5992b(ops_tests.rs, +5 / −3). The f16WaveActiveMaxreducesfmax(ha, hb)instead ofabs(hb), so it still covers the f16 overload, with a comment about the driver. Skip it if you'd rather keep the test failing on AMD as a marker.Tested (RX 7800 XT, Ryzen 5 7600, Windows 11 Pro 26300, rustc 1.100.0 MSVC, DXC 1.9.2602.17, debug):
half_precision_overloads_run: 5.0 vs 10.5 without the change, passes with it, on bothbc93a3aand7d24e97.cargo test -p xcl --lib -- gpu::dxil --skip wave_ops_match_cpu --test-threads=1onbc93a3a: 67 passed, 5 failed before; 68 passed, 4 failed after. The 4 arefuzz_validate_and_gpu_0..3(@mynzjerko'sBfrev.i64finding); the fuzzer emits no wave ops.Not tested: RDNA2 and RDNA4 with the change, other driver versions, the whole
gpu::dxilgroup on7d24e97.AI use: Claude Code (Claude Opus 5.5) wrote the probes and the test change, ran the commands above and wrote this.
@DavidM1911 on GitHub · 2026-11-24 17:21 UTC · original
Test report — RTX 3060 Ti (Windows 11), DXC dxcompiler 1.8.2502.11, branch merged with current
main(b7aa9f3):cargo test -p xcl --libcrashes the test process — deterministic, both parallel and--test-threads=1:The crash happens inside
malformed_containers_are_errorsitself — it never printsok. The test's whole point is that malformed DXBC comes back asErr"never as a panic or UB in the FFI glue", but the process dies with an access violation while iterating the malformed inputs (aftervalidateprints the bitcode-signature error — the crash is likely in the followingdisassemble(c)FFI call or a latervalidateon the truncated container). So the FFI boundary still has an unguarded path for malformed input.All
gpu::dxiltests that run before it pass, includingemitted_kernel_runs_on_the_gpu.@vitor127wt on GitHub · 2026-11-24 17:05 UTC · original · edited 2026-11-24 17:28 UTC
Targeted Blackwell fuzz results on Linux / Wine
I tested clean
direct-on-1426heada7cf0784c0eeb2e372b9cce48b1cf7f03f083e4a, which includes #1426'sbc93a3a6f1d5fuzzer change. I selected the four previously reported seeds (62,545,1019,1507) and added70after seeing the Windows report on the same head. All 5 passed DXIL validation, created a compute pipeline, and matched the CPU interpreter with zero mismatches. Windows report ona7cf078I cross-built the unmodified release test binary with
cargo xwin test --offline --locked --target x86_64-pc-windows-msvc --release -p xcl --lib --no-run. For each seed I started a fresh Wine process withFUZZ_SEED=<seed>and ran--ignored --exact gpu::dxil::fuzz_tests::debug_seed --nocapture --test-threads=1. Each run printed validatorOk(()),gpu_safe true, andGPU run: 0 mismatching results. This covers isolated seeds through DXIL-to-SPIR-V under Wine.RTX 5070 Ti (16 GB), NVIDIA Linux driver 620.73.04, Ryzen 7 9700X, CachyOS x86-64 kernel
7.3.5-2-cachyos, Wine 11.22, vkd3d-protonec20719452e916b, DXC/validator1.9.2609.5.Follow-up with the Windows SDK’s DXC 1.8.2502.11
I reran the five seeds on the same test binary at
a7cf078, with the same GPU, Wine and vkd3d-proton. I changed onlyXCL_DXC_DIRbetween 1.8.2502.11 and 1.9.2609.5. Both versions passed 5/5 validator checks and GPU/CPU comparisons, with zero pipeline refusals or result mismatches. The loader printed the expecteddxcompiler.dllanddxil.dllversions for every seed. Microsoft SDK package10.0.26100.7175The standalone DXC release
1.8.2502.8also passed the same five isolated cases. This comparison covers individualdebug_seedruns under Wine. Windows results with DXC 1.8.2502.11AI use — Codex (GPT-6 family, exact variant unavailable) built the binary, ran the tests, and drafted this report. Codex also ran the matched DXC version comparison.
@upipibi on GitHub · 2026-11-24 17:30 UTC · original
@bmjask on the
malformed_containers_are_errorscrash DavidM1911 reported above (#1426): I see the same on an RTX 3070. It happens on every run, withdxcompiler1.8.2502.11 (the Windows SDK's). It is one input,b"DXBC", invalidate.I printed each step:
&[]goes throughvalidateanddisassemble. The process then dies insidevalidate(b"DXBC")(0xc0000005), beforedisassembleis called. The other inputs (64 zero bytes, half and all-but-4 of the good container) come back asErrfrom DXC itself. So DXC 1.8's validator reads the whole 32-byte container header of anything that starts withDXBC, past the end of the 4-byte blob.Refusing input shorter than a header before DXC sees it fixes it here (
gpu::dxil::validate1 passed, 0 failed, ondirect-on-1426c391dbf). The patch, if you want it:Not tested: DXC 1.9, where the test doesn't crash; AMD.
AI use: Claude Code (Claude Opus 5.5) found the input and wrote the patch and this comment.
@HKEY-Funk-Machine on GitHub · 2026-11-24 17:51 UTC · original
@bmjask
424d315on the RX 9070 (RDNA4): the AMD workarounds and the size fix work here, but theamdxc64.dll+0x6800a4fault from my report above still hits the same program.Setup: RX 9070, AMD driver 32.0.32015.7029 · Ryzen 9 7945HX3D · 32 GB · Windows 11 Pro 26300 · Rust 1.100.0 · release · DXC 1.9.2602.17 (oracle only).
1.
gpu::dxil, each of the 86 tests run alone (--exact), clean424d315: 84 passed, 2 failed, 0 crashes (on065aef3+!llvm.ident: 61 passed, 6 failed).ops_tests::wave_ops_match_cpu(no device removal),ops_tests::half_precision_overloads_run,fuzz_validate_and_gpu_0and_2.fuzz_validate_and_gpu_3, seed 1599:res[193] = 0x1, CPU 0x0, the same value as beforedc2d8f1, although its message lists 1599 among theBfrev.i64seeds.fuzz_validate_and_gpu_1, now seed 722:res[30] = 0x1, CPU 0x7fffffff(its old seed 662 passes).2. Retail title,
424d315+ #751 + #1288 + a local patch that skipsInitializeApiImplEx2,XCL_DIRECT_DXIL=1,XCL_PSO_PRELOAD=0,XCL_NETWORK=0, with my local begin/end log around each computeCreateComputePipelineState:6e6796ait was 398 KB and 6.9 s per PSO, and the HLSL path in my #1288 run was 1.99 s per PSO (different programs, so a rough comparison).cs 62b584e061c05fc5: its DXIL went from 1 848 428 B (7d24e97; 1 873 324 B before that) to 207 120 B, about the HLSL path's 197 280 B.amdxc64.dll+0x6800a4(read at0x0) after 2m17s, with this program's build begun and never finished, as on6e6796a,a7cf078and7d24e97. So it isn't the module's size. Five PSOs were in flight in this run; the program was isolated by failing the others in the earlier runs.Not tested:
2851585(pushed while this ran; it mergesmainand, for the direct path, only refuses heap windows, which these runs don't use); the full workspace suite on this head; isolating the fault again at424d315by failing the other in-flight PSOs (it's the one program common to every fault so far); other AMD drivers. I can test a candidate change to this program's lowering, or a debug build that logs more, on this card.AI use: Claude Code (Claude Opus 5.5) ran the tests and the title runs, extracted the numbers from the logs, and drafted this report.
@LocranKing on GitHub · 2026-11-24 17:54 UTC · original
Independent Windows 11 + NVIDIA GeForce RTX 3060 Ti (8 GB Ampere, wave32, DXC 1.9.2602.17) test and 3-mode retail smoke report on
424d315372d60948b79422b1976ef8d486632b49(following an earlier run onbc93a3a6f1d5ce2f5836135b231bd5e09e8d1658):gpu::dxil: 84 passed, 0 failed).XCL_DIRECT_DXIL=1,gpu::): 370 passed, 0 failed, 20 ignored (gpu::dxil: 84 passed, 0 failed).XCL_DIRECT_DXIL=all):bc93a3a, 60 s ofXCL_DIRECT_DXIL=alllogged 8[SHADER] direct DXILfallbacks to the HLSL path acrossVertexandPixelstages (direct DXIL builder error: forward reference to value ... (blocks must be in dominance order)).424d315, 60 s ofXCL_DIRECT_DXIL=alllogged 0[SHADER] direct DXILfallbacks (1614frames,60 61 60presents/2 s,16384draws,1386dispatches,0skipped,0device removals / crashes,14714 MBpeak commit).XCL_DIRECT_DXIL=1also ran cleanly with 0[SHADER] direct DXILfallbacks (1567frames,14716 MBpeak commit).Tested
424d315372d60948b79422b1976ef8d486632b49(clean tree, merge-base930e8b4)8024 MiB VRAM, driver32.0.16.2101),rustc 1.100.0(x86_64-pc-windows-msvc, MSVC14.44.35207), DXC1.9.2602.17(SDK10.0.26100.0),--releasecargo build --release --workspace: ok (exit 0)cargo test --workspace --release --no-fail-fast -- --test-threads=4: 837 passed, 0 failed, 43 ignored, exit0XCL_DIRECT_DXIL=1 cargo test -p xcl --release --lib gpu:: --no-fail-fast -- --test-threads=4: 370 passed, 0 failed, 20 ignored, exit0SKIPPED(no wave64):gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardwareRegression run (
mainvs424d315default /=1/=all)mainbaseline (b7aa9f3bd212088e0d927439284dc5ed325ce3c7):PR
424d315(XCL_DIRECT_DXILunset):PR
424d315(XCL_DIRECT_DXIL=1):PR
424d315(XCL_DIRECT_DXIL=all):Not tested: debug build, DXC 1.8, AMD / Intel / native wave64 hardware, extended past-menu world load beyond 60 s.
AI use: Antigravity (
Gemini 4 Neon) ran the builds, tests, and smoke runs and drafted this report from the command outputs.@bmjask on GitHub · 2026-11-24 17:59 UTC · original
Status at
def2134c32f4(both checks should go green with the new regression pair in the description):malformed_containers_are_errorsis fixed with upipibi's patch as posted.validateanddisassemblenow refuse input shorter than the 32-byte header before DXC sees it. Thanks for pinning it tob"DXBC".=allafter the reverse post-order change, against 8 onbc93a3a.wave_ops_match_cpu, half precision, fuzz 0/2) and the size drop (1.85 MB → 207 KB forcs 62b584e061c05fc5, 0.64 s mean driver time) are good news. For theamdxc64.dll+0x6800a4fault on that one program, and fuzz seeds 1599 / 722: I'm diffing that program's direct DXIL against the HLSL path's for constructs only we emit, and reducing the two seeds. I'll post a build with env knobs to bisect it on your card in one go. Since this happens only with the opt-inXCL_DIRECT_DXIL=1and on one program, I'd suggest it doesn't block this base PR; the default path is unchanged.9e3831e. The new heap memory windows (XCL_HEAP_WINDOWS) are refused by the direct path, so those shaders take HLSL.AI use: Claude Code (Claude Opus 5.5) wrote this comment for @bmjask.
@Fisers on GitHub · 2026-11-24 18:02 UTC · original
RX 6800 retest of two AMD failures
Both previously failing tests now pass on clean PR revisions
424d315372d60948b79422b1976ef8d486632b49anddef2134c32f4e17fa834c4e7fcd39468e19388cc.424d315def2134half_precision_overloads_runwave_ops_match_cpuEach revision: 2 passed, 0 failed, 0 ignored, 0 skipped. Each test ran in a separate process.
Setup: Radeon RX 6800 16 GB (RDNA2), driver
32.0.21030.2001, Ryzen 5 7600X, 32 GB RAM, Windows 11 Pro build26300.9457, Rust 1.100.0 MSVC, DXC 1.9.2602.17, debug build.XCL_ADAPTER="RX 6800",XCL_REQUIRE_GPU=1.Not tested: Full suite, fuzz failures, and the retail title.
AI use: Codex (
gpt-6.2-sol) ran the tests and wrote this report.@RockFellerX on GitHub · 2026-11-24 18:06 UTC · original · edited 2026-11-24 18:11 UTC
RDNA 2 (
RX 6750 XT) verification on424d315/def2134plus 4 clean workaround commits clearing the remaininggpu::dxilfuzz failures on RDNA 2 (andseed 1599also reported on RDNA 4).What
dc2d8f1(424d315) already fixed on RDNA 2wave_ops_match_cpu(no longer removes the device),half_precision_overloads_run(credit @mynzjerko / @Frtuchinno),dx_op_attrs_match_dxc,fuzz_validate_and_gpu_0, andfuzz_validate_and_gpu_2all pass on clean424d315.424d315,cargo test -p xcl --lib gpu::dxil -- --test-threads=4drops to 82 passed, 2 failed, 2 ignored:fuzz_validate_and_gpu_1: fails atseed 540: res[833] = 0x7, CPU 0x6fuzz_validate_and_gpu_3: fails atseed 1599: res[193] = 0x1, CPU 0x0(same failure @HKEY-Funk-Machine saw on RX 9070 / RDNA 4)Remaining AMD / RDNA 2 driver bugs isolated & fixed (4 patches on
def2134)Hardware probes on RX 6750 XT (
amdxc64.dll32.0.21045.16010) isolated four distinct miscompilations:sext i1toi64zero-extends the upper 32 bits on RDNA 2 (seed 540)RX 6750 XT,sext i1 true to i64evaluates to0x00000000_ffffffffinstead of0xffffffff_ffffffff(whereassext i1toi32is0xffffffff, andselect i1 %c, i64 -1, i64 0is0xffffffff_ffffffff). That causedashrinseed 540to shift out zeros and return0x7instead of0x6. DXC 1.9 itself avoids emittingsext i1 ... to i64.module.rsModule::cast+ops_tests::sext_i1_to_i64_matches_cpu): foldconst_u64or emitselect(v, -1, 0)forSExti1 -> i64.Countbits(i64 const)feedingBfrev.i32corrupts bit 0 (seed 1599)dc2d8f1splitBfrev.i64,seed 1599fails because%21 = call i32 @dx.op.unaryBits.i64(i32 31, i64 2)(Countbits) fed intodx.op.unary.i32(30, %21)(Bfrev) returns0x80000001instead of0x80000000(seen on literali64 2and foldedor i64 2, 0, while dynamicCountbits(i64)->Bfrev.i32and literalBfrev.i32(1)return0x80000000).ops.rsShader::bit_count+ops_tests::int64_countbits_into_bfrev_matches_cpu): sum twoi32Countbitscalls oni64(matchinglower.rs).dx.op.binary.i64(IMax)corrupts the high 32-bit word on constant-folded operands (seed 783)seed 540(and662) uncoveredseed 783:dx.op.binary.i64(IMax, -5, 0x7fff_ffff_ffff_fffb)computed fromor/udiv/xor/andreturns0xcin the upper 32 bits instead of0x7fffffff(res[64] = 0xc, CPU 0x7fffffff).ops.rsShader::binary+ops_tests::int64_min_max_const_and_dynamic_match_cpu): loweri64IMax/IMin/UMax/UMinviaicmp+select.Bfrev.i32oni64-derived constant expressions miscompiles (seed 817)seed 783uncoveredseed 817:trunc(shl(mul i64 -7, -7842455603539182169, 21))and its upper half produce exact0x0de00000and0xd7bfc252on the GPU, and literalBfrev.i32on those values returns0x000007b0and0x4a43fdeb, yet feeding thei64-derived expressions intoBfrev.i32returns0xfe1297ffand0xfe53ffff.module.rsModule::eval_const_int+ops.rs+ops_tests::bfrev_i32_of_i64_const_expr_matches_cpu): evaluate bounded pure integer constant-expression trees and foldbfrev,bit_count, and integer min/max before requiringFeature::Int64Ops.Diffstat vs
def2134across the 4 commits:crates/xcl/src/gpu/dxil/{module.rs, ops.rs, ops_tests.rs}(424 insertions(+), 1 deletion(-)).Tested
32.0.21045.16010), AMD Ryzen 5 5600X, 32 GB RAM, Windows 11 Pro 24H2 (26100),rustc 1.98.1, DXC1.9.2602.17(SDK10.0.26100.0), debug build.424d315(cargo test -p xcl --lib gpu::dxil -- --test-threads=4): 82 passed, 2 failed, 2 ignored (fuzz_validate_and_gpu_1seed 540,fuzz_validate_and_gpu_3seed 1599).def2134:cargo build --workspace: exit 0cargo test -p xcl --lib gpu::dxil -- --test-threads=4: 88 passed, 0 failed, 2 ignored (includesfuzz_validate_and_gpu_0..3,wave_ops_match_cpu,half_precision_overloads_run,dx_op_attrs_match_dxc, and the 4 new regression tests)XCL_DIRECT_DXIL=1 cargo test -p xcl --lib gpu::recomp::tests -- --test-threads=4: 120 passed, 0 failed, 17 ignoredcargo test --workspace --no-fail-fast -- --test-threads=4(XCL_DIRECT_DXILunset,XCL_HEAP_WINDOWSunset): 866 passed, 0 failed, 43 ignored (817inxcl --lib,49across integration tests;gpu_compute_e2e::heap_window_out_of_memory_falls_back_to_the_switch_formprintedSKIPPED ...: no heap windows)2851585+ the 4 commits (FUZZ_SEED=722):GPU run: 0 mismatching results.Not tested
XCL_DIRECT_DXIL=all, retail title smoke run, andXCL_HEAP_WINDOWS=1.AI use: Antigravity (
Gemini 4 Neon XHigh) wrote the hardware probes, the 4 fixes and regression tests, ran the test commands above, and drafted this comment from tool outputs.0001-dxil-lower-sext-i1-to-i64-via-select-for-AMD-RDNA2.patch
0002-dxil-lower-i64-Countbits-via-i32-halves.patch
0003-dxil-lower-i64-integer-min-max-via-icmp-and-select.patch
0004-dxil-constant-fold-integer-bit-ops-on-constant-expre.patch
@1FoXus on GitHub · 2026-11-24 18:13 UTC · original
@bmjask @gefydev Completed the controlled DXC 1.8 vs 1.9 comparison on my RTX 5060 as requested.
Tested
a7cf0784c0eeb2e372b9cce48b1cf7f03f083e4aThe commit, GPU and driver remained unchanged. No tracked source files were modified. DXC 1.9 was loaded separately using
XCL_DXC_DIR.Fuzz test comparison
All four failures persist with DXC 1.9, with identical reported DXIL sizes, instruction counts and error codes.
CreateComputePipelineState: Not enough memory resources are available to complete this operation. (0x8007000E)Source:
crates/xcl/src/gpu/dxil/fuzz_tests.rs:1167:110Command:
cargo test -p xcl --lib gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_ -- --test-threads=4 --nocaptureDXC 1.9 result: 0 passed, 4 failed, 836 filtered out, finished in 1.68s.
The runtime confirmed that dxcompiler and dxil 1.9.2602.17 (21d28f72) were loaded.
Malformed-container test
I also ran:
cargo test -p xcl --lib gpu::dxil::validate::tests::malformed_containers_are_errors -- --exact --test-threads=1 --nocaptureWith DXC 1.9, the test printed three
Invalid bitcode signaturemessages but completed successfully.Result: 1 passed, 0 failed, 839 filtered out, finished in 0.01s. No access violation.
Conclusion
Upgrading DXC alone does not resolve the four fuzz failures on my RTX 5060 with driver 621.14. However, the previously crashing malformed-container test passes in isolation with DXC 1.9.
Not tested
Happy to run specific diagnostic tests or patches if needed.
AI use
ChatGPT (GPT-6.2) assisted with test commands, log analysis and report formatting. All tests were performed on my own hardware.
@Arvi23 on GitHub · 2026-11-24 18:14 UTC · original
@bmjask @HKEY-Funk-Machine a likely cause of the second AMD driver fault (
amdxc64.dll+0x6800a4, console CS62b584e061c05fc5), and a fix you can take.The direct path's DXIL for that program has irreducible control flow. DXC's validator refuses it:
error: Execution flow must be reducible.The runtime never runs the validator, so the container goes toCreateComputePipelineState, and the AMD driver reads a null pointer instead of refusing it. This holds on7d24e97and on the current head2851585(207 120 B there); the phi and optimizer changes don't affect it.It isn't only that program. I translated all 2 689 compute programs of the retail pack through the direct path on
2851585and validated each container: 2 669 validate, and 20 are refused, all with "Execution flow must be reducible". That matches the 20 programs with irreducible loops that @gefydev's lane-mask analysis found in the console code.Fix:
Arvi23/xcldxil/irreducible-fallback, one commit113f10bon the current headd24db9f(module.rs+69,tests.rs+27). The writer checks the layout it writes: with dominators over the reverse post-order (Cooper, Harvey, Kennedy), every edge to a block at or before its source must go to a block that dominates the source. Otherwise it records a builder error, sotry_finishfails and the translator falls back to the HLSL path, whosepcdispatcher takes any flow. With it,62b584e061c05fc5logsdirect DXIL fallback … irreducible control flow … – HLSL pathand gets the HLSL path's 197 280 B, which validate. Test:irreducible_control_flow_is_a_builder_error(a loop with two entries;try_finishmust fail).Tested
62b584e061c05fc5's compute pipeline on the RX 9070 XT, one process each (xcl shaders --precompile --only cs --pipelineswithXCL_DIRECT_DXIL=1, fresh caches):2851585without the fix: the process ends with0xc0000005insideCreateComputePipelineState(I did not capture the module offset);direct DXIL fallback … irreducible control flow … – HLSL path, 197 280 B of DXIL that validate, built by the driver in 7.0 s (1 pipeline made, 0 refused).cargo test -p xcl --libon113f10b, CPU tests only:irreducible_control_flow_is_a_builder_error,emitted_kernel_passes_the_sdk_validator,emitted_kernel_disassembles_like_dxc_output,branchy_graphics_stages_validate: 4 passed.2851585against the same commit on it (f580eea, rebased ontod24db9fas113f10bwithout conflicts): every compute program throughconsole_to_dxil_inwithXCL_DIRECT_DXIL=1, each container throughvalidate::validate(a local hook inxcl shaders --precompile, not in the commit). With the commit, the 20 refused programs fall back (direct DXIL fallback … irreducible control flow) and their containers validate. The other 2 669 programs' DXIL is byte-identical, so the check refused nothing the validator accepts.Not tested
XCL_DIRECT_DXIL=all) through the pack.AI use: Claude Code (Claude Opus 5.5) found the validator error, wrote the commit, its test and this comment, and ran the measurements and the GPU check on the machine named.
@gefydev on GitHub · 2026-11-24 18:16 UTC · original
@Arvi23 @bmjask for reference: the lane-mask analysis on
recomp-lane-masksfinds the same 20 irreducible compute programs in the console code and refuses them in the per-lane form, which agrees with Arvi23's count. His writer check is the right fallback for the per-instruction form.AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev.
@Sr-0w on GitHub · 2026-11-24 18:21 UTC · original
@bmjask a size data point for the cleanup work, at
d24db9f. The size drop on62b584e061c05fc5(1.85 MB → 207 KB) does not reach the largest compute programs of the retail pack. The 40 largest by console code, throughtranslate_compute, native wave64, 4 windows (RX 7800 XT host, release):So it's about 18–30 bytes of DXIL per byte of console code. For scale, in my earlier world-load runs on this card, the largest compute DXIL the HLSL path built was 1.09 MB, and the direct path's 11.3 MB. These programs are the ones the world load waits on, so with
XCL_DIRECT_DXIL=1their driver builds still dominate (65 s for the slowest on the run I posted). If it helps, I can run any size pass or knob you push against these 40 programs and post the table again.AI use: Claude Code (Claude Opus 5.5) measured the sizes and wrote this comment.
@bmjask on GitHub · 2026-11-24 18:22 UTC · original
@HKEY-Funk-Machine: found it. The
amdxc64.dll+0x6800a4fault oncs 62b584e061c05fc5(InstanceCulling:CS_Prop_BatchNoCull_*) was our bug, not the driver's. The console code has 7 loops entered in the middle, and the direct path copied that irreducible CFG into DXIL. DXIL forbids that, and a debug validator says "Execution flow must be reducible", but release builds skip the validator. NVIDIA tolerated it and AMD's compiler faulted.76c527b7dd78splits nodes until every loop has a single entry, falling back to HLSL past 4× growth. That program now translates and validates (201 KB, against 266 KB on the HLSL path). It also bumpsTRANSLATOR_VERSIONto 4 and adds aCountbits.i64per-half workaround (seed 1599's value comes downstream of a constantCountbits.i64, the same family asBfrev.i64).When you have time on the RX 9070:
XCL_DIRECT_DXIL=1 XCL_TRANSLATED_CACHE=0 XCL_PSO_DISK_CACHE=0, then play past where it faulted. There should be no fault and no direct-DXIL fallback for that program.XCL_DXIL_DUMP=62b584e061c05fc5writes%TEMP%\xcl-dxil-dump\<hash>.dxil. Please sharedxc -dumpbinstatistics only, and tryXCL_DXIL_NO_OPT=all.fuzz_validate_and_gpu_*moved to the stacked follow-up PR, to keep this diff under GitHub's 20 000-line limit. Seed 722 looks like the driver movingWaveReadLaneFirstinto a divergent switch case: our declaration matches DXC's. A reduced repro will come with that PR.Also in this push: a guarded region now merges only the registers it writes. On the 200-program sample, translation time is p50 29 ms / p95 0.38 s, down from 64 ms / 1.6 s, and size is 1.25× HLSL+DXC. Full suite: 858 passed, 0 failed. Regression pair in the description: 98 % of main's frames.
AI use: Claude Code (Claude Opus 5.5) wrote this comment for @bmjask.
@Sr-0w on GitHub · 2026-11-24 18:23 UTC · original
@bmjask RDNA3 (RX 7800 XT, native wave64) on
d24db9f: everything that failed here before passes now.gpu::dxil: 79 passed, 0 failed, 1 ignored, 0 SKIPPED. That includeswave_ops_match_cpu, which used to remove the device on this card (I had been running with--skip),half_precision_overloads_runand all fourfuzz_validate_and_gpu_*. Seed 328'sbfrev.i64mismatch is gone too.cargo test --workspace --no-fail-fast -- --test-threads=4(release): 857 passed, 0 failed, 43 ignored.Setup: Radeon RX 7800 XT, Adrenalin, Windows 11 Pro 26300, Rust 1.100, release, DXC 1.9. The tree is clean
d24db9fplus one local#[ignore]measuring test.AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this comment.
@gefydev on GitHub · 2026-11-24 18:24 UTC · original
@bmjask a small correctness finding for the per-instruction form:
V_CVT_F16_F32gives 0 for an f32 below the smallest f16 denormal, where the HLSL path and the console round to that denormal. It was found by @vladbondarenko97'sF32_CONVERSIONStest program, on lane 1 of v29 (0x0against0x1), ondirect-on-1426with #14267d24e97. The per-lane form keeps that instruction on the fallback until it is fixed.AI use: Claude Code (Claude Opus 5.5) wrote this comment for @gefydev.
@MatyEjsr on GitHub · 2026-11-24 18:24 UTC · original
Independent NVIDIA RTX 3090 verification of head
285158534ae1c8e01a8e6e1718edbf65eb9a7663(including the sweep fixes,Module::optimize, AMD driver workarounds, andXCL_HEAP_WINDOWSrefusal merge).Tested
dxcompiler 1.9.2602.17,dxil 1.9.2602.17, validator 1.9).cargo build --workspace -j 8: succeeded (0 errors).XCL_ADAPTER=nvidia cargo test --workspace -j 8 -- --test-threads=8 --show-output: 862 passed, 0 failed, 43 ignored, 5 SKIPPED (plus 10XCL_SAMPLE_*tests skipped because the env vars were unset):SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64SKIPPED test_title_draws_with_a_root_signature_under_the_debug_layer: no d3d12SDKLayers.dllSKIPPED heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windowsSKIPPED uploads_start_from_each_subresources_state: no D3D12 debug layer (0x887A002D)gpu::dxiltests passed with 0 validator skips (2 ignored:dump_dxc_lowering,debug_seed), including:fuzz_validate_and_gpu_{0..3}: 2,000 seeds validated and 1,232 GPU-compared on RTX 3090.long_programs_translate: 4,001 instructions in 167.6 ms (debug);long_pixel_shader_translates_fast: 3,000 instructions in 195.7 ms, 128,052 B DXIL (debug).malformed_containers_are_errors: passed ondxcompiler 1.9.2602.17.gpu::dxilwithXCL_DXIL_NO_OPT=all: 84 passed, 0 failed, 2 ignored (3.29 s).XCL_DIRECT_DXILandXCL_HEAP_WINDOWS=1e2e checks ongpu_compute_e2e:XCL_DIRECT_DXIL=1onconsole_wave64_compute_through_the_pso_hook_dispatch_and_read_back: passed (2,892 B DXIL, readback matched).XCL_HEAP_WINDOWS=1+XCL_DIRECT_DXIL=1onconsole_wave64_compute_through_the_pso_hook_dispatch_and_read_back: passed; direct translator loggeddirect DXIL fallback stage=CS reason="unsupported: heap memory windows (XCL_HEAP_WINDOWS)"and fell back cleanly to HLSL (5,708 B DXIL).XCL_HEAP_WINDOWS=1+XCL_DIRECT_DXIL=1onheap_window_out_of_memory_falls_back_to_the_switch_form: passed; after injected OOM switched to switch form, direct DXIL built the switch-form compute PSO directly (2,892 B DXIL vs 6,128 B DXIL on the HLSL path) and passed readback.Findings
gpu_compute_e2e::offline_compute_pipeline_is_reused_by_a_second_processfails whenXCL_DIRECT_DXIL=1orXCL_DIRECT_DXIL=allis set in the environment: it panics atcrates/xcl/tests/gpu_compute_e2e.rs:114(Option::unwrap()onNone) because the test looks for a top-level*.dxilfile inXCL_DXIL_CACHE(which onlydxc::compile_cachedwrites on the HLSL path, whereas direct DXIL writes onlytranslated/v2/...anddriver/*.pso).crates/xcl/src/gpu/dxil/validate.rsstill passes short inputs (< 32bytes) straight toIDxcValidator::Validate/Disassemble, so thedxcompiler 1.8.2502.11crash onb"DXBC"noted in earlier comments is not yet guarded in this commit (not hit ondxcompiler 1.9.2602.17).Not tested
AMD / native wave64 GPUs,
dxcompiler 1.8.2502.11, D3D12 debug-layer tests, retail shader pack sweep, and a retail title smoke run.AI use
agy with gemini-4-neon-high ran the build, tests, and drafted this report.
@Kalmarv on GitHub · 2026-11-24 18:25 UTC · original
@MuhammadUzair-dev @adonizm on the four
fuzz_validate_and_gpu_*refusals (0x8007000E): on our RTX 5070 Ti, NVIDIA 610.74 (Windows: 32.0.16.1074), all four pass atdef2134(the last #1426 commit withfuzz_tests.rs) and atdirect-on-1426a7cf078. That holds with DXC 1.9.2609.5 and with the SDK's 1.7.2308 (validation step skipped), with 1 232 of 2 000 seeds compared on the GPU. Your seeds 70, 545, 1019 and 1507 validate and run with 0 mismatches here. Each has the fixed form:%n = sub i32 0, %xand thenatomicrmw add … %non groupshared; none hasatomicrmw sub.One thing that fits, as an inference only. Before the fix (
065aef3) our driver refused seeds 62, 545, 1019 and 1507. Your list is the same with 70 instead of 62. Seed 62 subtracts the constant -1, which now folds to a constant add; 70, 545, 1019 and 1507 subtract a variable. So your drivers may turn "add of0 - x" back into the atomic sub that the Blackwell compiler refuses, and 610.74 doesn't. Which driver versions are you on? If they are newer than 610.74, that's the difference, and the fuzzer (or the writer) would need a form the driver can't fold back.AI use: Claude Code (Claude Fable 5.2, Claude Opus 5.5)
@MiguelMachado-dev on GitHub · 2026-11-24 18:28 UTC · original
Blackwell (
RTX 5080, driver621.24, DXC1.8.2502.11) validation run ond24db9f86ddb27efe115d084a06d59fb1e26c47c: all tests pass, includingmalformed_containers_are_errorson DXC 1.8.Tested
d24db9f86ddb27efe115d084a06d59fb1e26c47c(clean tree, debug build)621.24), Intel Core i7-14700KF, Windows 11 build26300,rustc 1.97.1(stable-x86_64-pc-windows-msvc), DXC1.8.2502.11(Windows Kits\10\bin\10.0.26100.0\x64,dxil.dllpresent)cargo build --workspace: exit 0cargo test --workspace --no-fail-fast -- --test-threads=4: 857 passed, 0 failed, 42 ignored (lib: 808 passed, 0 failed, 22 ignored; integration binaries: 49 passed, 0 failed, 20 ignored;gpu::dxil: 79 passed, 0 failed, 1 ignored —malformed_containers_are_errors,wave_ops_match_cpu, andhalf_precision_overloads_runall pass)SKIPPED(3):gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)XCL_DIRECT_DXIL=1 cargo test -p xcl --lib gpu::recomp --no-fail-fast -- --test-threads=4: 194 passed, 0 failed, 18 ignored (SKIPPED: 2no wave64)XCL_DIRECT_DXIL=all cargo test -p xcl --lib gpu::recomp --no-fail-fast -- --test-threads=4: 194 passed, 0 failed, 18 ignored (SKIPPED: 2no wave64)Not tested
XCL_SAMPLE_*unset), and title smoke runs.AI use: Antigravity (Gemini 4 Neon) ran the build and test commands on this machine and drafted this report from their output.
@Sr-0w on GitHub · 2026-11-24 18:33 UTC · original
@bmjask title runs with
XCL_DIRECT_DXIL=1on RDNA3 (RX 7800 XT, native wave64, release,XCL_TRANSLATED_CACHE=0), before and after6976bc4:065aef3(earlier run)d24db9f81d2ad5amdxc64.dll+0xe717fb, read at 0x28, inCreateComputePipelineState, 142 s+0x23cf683), 137 s6976bc4fixes the driver fault on this card too. Ond24db9fthe run died in AMD's compiler on a null read, the same class as @Arvi23's irreducible-flow finding. On81d2ad5there is no driver fault, and the run goes on until the title's watchdog.CreateComputePipelineStateback to back, and each spends 23–29 s of the last 30 s inside the driver: 5–29 builds per thread, none over 16 s. So a title thread does not return to its loop for about 30 s, and the watchdog fires. This is outside this PR (where compute pipelines get built, not what they are built from), so I'm only noting it here for the direct path's numbers.AI use: Claude Code (Claude Opus 5.5) ran the title, read the logs and wrote this comment.
@erickbobd on GitHub · 2026-11-24 18:33 UTC · original
I ran the Windows/Blackwell functional checks on clean
81d2ad5a9d06f6d11211f0c2524d5db9c3362bcf(same tree as thec160d86merge). Workspace: 858 passed / 0 failed / 42 ignored;gpu::dxil: 80 / 0 / 1; direct-enabledgpu::recomp: 194 / 0 / 18. RTX 5070 Ti, NVIDIA 617.14, SDK DXC 1.8.2502.11.The detailed commands, skips and limits are in the requested GPU-results thread: #42 . This does not cover a retail title's direct runtime path or the separate per-lane adapter; I am testing the latter separately.
AI use: Codex (GPT-6; exact variant unavailable) ran the checks and wrote this note.
@HKEY-Funk-Machine on GitHub · 2026-11-24 18:48 UTC · original
@bmjask the irreducible-CFG fix works on the RX 9070:
cs 62b584e061c05fc5now builds, and there's noamdxc64.dll+0x6800a4fault. The run ended later on something else, an out-of-memory abort while the driver was building the largest direct-DXIL compute programs (details below).Tested
mainc160d86(#1426 merged, includes81d2ad5) + #751 + #1288 (both needed to get past the title's watchdog and a texture race here) + two local-only changes: skipInitializeApiImplEx2inxgameruntime/api.rs(hangs here), and a log line before and after each computeCreateComputePipelineState. Release build.XCL_DIRECT_DXIL=1 XCL_TRANSLATED_CACHE=0 XCL_PSO_DISK_CACHE=0 XCL_PSO_PRELOAD=0 XCL_NETWORK=0 timeout 900 xcl run <game>, A pressed on the title screen.Results
cs 62b584e061c05fc5: direct DXIL, 190 888 B,CreateComputePipelineStatehr=0x0 in 7.2 s. 0direct DXIL fallbacklines in the whole run, for this program or any other.cs 56c0cd3b82a00c6e(14 766 824 B of DXIL, the size @Sr-0w lists for the largest program) andcs 4585e350d1b864e3(891 140 B). Thencs 83a0f0eec0ddb740(454 216 B) returned0x8007000Eafter 16.9 s, and a 3 MB Rust allocation failed (memory allocation of 3145728 bytes failed). The process exited with0xc0000409.cs 56c0cd3b82a00c6e'sCreateComputePipelineStatebegan (13:45:15). From there they climbed steadily, about 0.9 GB/s, to 105 GB (system commit 121 GB) 82 s later. Then the next builds returned0x8007000Eand a 1.5 MB allocation failed (0xc0000409again). That build never returned. Meanwhile seven other compute builds (287–438 KB of DXIL) started and finished one after another on another thread, in 4–17 s each, so they can't account for a 76 GB climb. I didn't run the cross-check with that one build skipped. (62b584e061c05fc5built in 1 ms in this run, from the driver's own cache.) This matches @Sr-0w's point that the size cleanup doesn't reach the largest programs yet. His RX 7800 XT title runs on81d2ad5end at the watchdog (~137 s) with 0.94 MB as the largest DXIL. With #1288 the title here gets past the watchdog, which is probably why this run reached the 14.7 MB program.Not tested
XCL_DXIL_DUMPstatistics (not needed since it no longer faults),XCL_DIRECT_DXIL=all, and a run withcs 56c0cd3b82a00c6eskipped, the same program on the HLSL path (my HLSL runs stall before reaching it), and anything past the out-of-memory abort.AI use: Claude Code (Claude Opus 5.5) ran the build, the two runs and the memory sampling, and wrote this comment.
@ik0nk4 on GitHub · 2026-11-24 18:27 UTC · original · edited 2026-11-24 18:48 UTC
Independent Windows A/B check for the direct DXIL sweep at
d24db9fand76c527b(the current head81d2ad5only removes documentation from the diff).Setup — Windows 11 Pro build 26200, Rust 1.100.0 x86_64-pc-windows-gnu release build, DXC and validator 1.9.2609.5. Unmodified translator, same local retail shader archive, fresh XCL cache per run:
d24db9frun 1d24db9frun 276c527brun 1Each run translated CS 9/9, MS 69/69, PS 71/71 and VS 22/22. The four refusals were ES+GS geometry mode. The 16 KiB input cap skipped 25 programs. Zero validator failures, panics or timeouts. Sizes are totals over the same 171 successful pairs and direct output was 12.5% larger in aggregate. Coverage and aggregate size were stable across the CFG and SSA changes on this sample.
The newer run has one timing sample and the percentiles include validation and thread overhead. This sweep did not time HLSL compilation separately, create driver PSOs, or test giant compute shaders or the AMD driver crash.
AI use: OpenAI Codex (GPT-6.2 Sol) assisted with the local build, test execution and report drafting.
Hardware follow-up on
76c527b— Windows 11 build 26200, AMD Radeon RX 9060 XT (RDNA4), driver 32.0.32029.2010, AMD Ryzen 7 5700X 8-Core Processor, Agility SDK 1.619.1 and DXC 1.9.2609.5. Rangpu::dxil::ops_tests::wave_ops_match_cpuandgpu::dxil::ops_tests::half_precision_overloads_runin separate release test processes withXCL_ADAPTER=radeonandXCL_REQUIRE_GPU=wave64. Both passed with no skips. The command for each case wascargo test --locked --release -p xcl --lib gpu::dxil::ops_tests::<test> -- --exact --nocapture. These are synthetic GPU checks. The retail pipeline that previously crashed the driver was outside this follow-up.Follow-up: size-cap coverage on the same 200 records. At
76c527b, reran the command above without--compare, with--timeout 30and three input caps. Validated / attempted: 171/175 at 16 KiB, 191/196 at 64 KiB, and 195/200 at 4 MiB (zero skipped). Of the 25 programs previously excluded by size, 24 validated. The additional refusal was a pixel shader usingimage_get_lodwith a static sampler (record offset0xbca5b82, FSSM#0). The other four refusals were ES+GS. All 16 compute programs validated. Zero validator failures, panics or timeouts. This checks DXIL validation only. No GPU dispatch or rendering was measured in these runs.Input for the size-cap sweep:
shaders.rpf, 411695600 bytes, SHA-2560bc1634594e51ca8e7ef5f2bc6f5b32b081ce779ac094d686de08ecb75dc24a8. AI use for this follow-up: OpenAI Codex (GPT-6.2 Astra) ran the size-cap checks and drafted the addendum.@Daydream3r on GitHub · 2026-11-24 18:56 UTC · original
Independent RTX 5070 Ti checks of merged
c160d86ef2, clean main, 2026-11-24. No source changes.Tested
XCL_ADAPTER=RTX 5070 Ti; debug for cargo tests, release for CLI/title. Builds already passed on this commit.cargo test --locked -p xcl --lib gpu::dxil -- --nocapture --test-threads=4: 80 passed, 0 failed, 1 ignored.XCL_DIRECT_DXIL=all,cargo test --locked -p xcl --lib gpu::recomp -- --nocapture --test-threads=4: 194 passed, 0 failed, 18 ignored. Two explicit skips inside the passing count:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64). This set includes HLSL/geometry cases retained by its wrappers; it is not a direct-only test count.XCL_DIRECT_DXIL=1,cargo test --locked -p xcl --test gpu_compute_e2e -- --nocapture --test-threads=1: 4 passed, 0 failed, 0 ignored. These three commands usedXCL_HEAP_WINDOWS=1,XCL_REQUIRE_GPU=mesh, networking off, no game sample inputs.Real shader graphics checks and heap-window control
With
XCL_SAMPLE_RPFpointing to the local title's pack,XCL_REQUIRE_GPU=mesh, use:cargo test --locked -p xcl --test gpu_pso_e2e -- --nocapture --test-threads=1 retail_vs_ps_through_the_pso_hook_render_and_read_back retail_textured_ps_decoded_descriptors_and_a_descriptor_change_between_drawsIn each failing row, the readback was the clear colour
[0.1, 0.2, 0.3, 0.4]: the textured test expected[0.0, 0.0, 1.0, 1.0]at (0,0), and the triangle test failed at (25,17). Theall+ heap-windows row explicitly logged VS/PS fallback to HLSL because heap memory windows are unsupported by direct translation. No claim that this failure is caused by the direct backend, or that it proves an in-game rendering fault: the harness-versus-runtime cause is not isolated.Repeated the
all/heap-unset row and unset/heap-1 row withXCL_TRANSLATED_CACHE=0and a separateXCL_DXIL_CACHE: respectively 2 passed and 2 failed again. The passing direct graphics repeat logged no fallback. No assertions were changed.Bounded real-pack sample
xcl shaders <local shaders.rpf> --direct --sample 32 --seed 20261124 --validate --compare --max-bytes 16384 --timeout 10 --threads 1This validates DXIL and compares output size against HLSL+DXC; it does not compare rendered pixels for all sampled programs. No compute programs happened to be selected. The small sample is not corpus-wide coverage or a speed benchmark.
Live title, networking off, heap windows unset
XCL_DIRECT_DXIL=1: both exit 0, no crash/device-removal matches. Raw generated smoke blocks reported 1655 vs 1671 frames and peak commit 14529 vs 14628 MB. This small difference is not an acceleration claim; neither run tested world loading. Direct run's exit summary:CS direct 27 / HLSL fallback 0.XCL_DIRECT_DXIL=1,XCL_DIRECT_DXIL_STATS=1, existing direct-run cache, requested limit 180 s: user pressed Enter for Player1. I saw coloured loading artwork, then no rendered world. At 115.368 s it crashed with 0xc0000005 at game_scarlett_master.exe+0x23cf683, write to 0x0; stack includes +0x2215c35. Same signature as the earlier ordinary-path run on9e3831e, but not a same-commit/input-timed A/B comparison, so not evidence of a direct-path regression.Not tested
=allgraphics, rendered gameplay, native wave64, AMD/Intel/WARP, D3D12 debug layer, long-run performance, deterministic input-timed same-binary fault comparison. The agent cannot hear audio and makes no audio-quality claim.AI use
Codex desktop, GPT-6 ran the commands on this PC, inspected the sources and window screenshots, and drafted this report from actual logs. No game files, shader binaries, dumps or images attached. Hardware test report, not a merge approval.
@SlopTart on GitHub · 2026-11-24 19:27 UTC · original
Post-merge AMD validation on the merge commit
c160d86e, since this PR was explicitly after more hardware: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, DXC 1.9.2609.5 pinned, release profile, default mode (the ops suite drives the DXIL builder itself, no env needed).Ran all 20
gpu::dxil::ops_tests::*individually so one death does not hide the rest:gpu::dxil::ops_tests::integer_ops_match_cpu: process dies, deterministic 3/3. Not a Rust panic and no assertion: the wine process just exits (cargo:exit status: 3) mid-test, with--nocaptureshowing nothing after adapter enumeration.gpu::dxil::ops_tests::uaddc_and_usubb_match_cpu: same silent death.The two crashers share a theme: carry/borrow (
uaddc/usubb) and, in the integer test, wide/duration ops (umul_wide,imul_wide,udiv_rem,bfi/bfe). Silent death with no panic usually means the DXIL handed downstream is rejected in a way that aborts the compile path rather than returning an error, so those specific intrinsics/lowerings are where I would look first.Also relevant from testing PR #1658's direct-path suite on this same card today: 4/6 green, 2 deterministic failures where lanes that should be predicated off still write (split-wave64 compute), noted there in detail.
So on AMD: the DXIL core is broadly working (18/20 + mesh/graphics stages), with two crash repros and two mask-lane assertion repros, all deterministic and runnable with a single filter each.
Counts only, no game data.
AI use: Hermes agent (local Qwen-class) ran everything and drafted this; I checked it before posting.
@RandomGithub12309 on GitHub · 2026-11-24 19:27 UTC · original
@bmjask posting #1699 here as well per @gefydev's note on #1269.
It is based on
maincommitc160d86ef2efe3a07e4dfb473e4fa72eafb413c0(Merge pull request #1426, PR head7b8711407e77b09f156eb1d7a5dd2a56a6841dfd) and updatescrates/xcl/src/gpu/dxil/lower_mem.rs(kernel.rsTRANSLATOR_VERSION4 → 5, tests intests.rs):with_mem's four sequentialguardeddiamonds withwith_mem_nemitting a singleOp::SwitchoverVAR_WIN(folding constant windows inline), merging results directly viajoinphis and sealingjoinas a pass-through from the pre-switch block.s_load_dwordx2..x16,ld_raw, FLAT/globalload_dwordx2..x4/store_dwordx2..x4) into up to 4-widerawBufferLoad/rawBufferStorechunks under one switch, shares one switch acrosss_buffer_load*/buffer_load*dwords with per-dword bounds clamping, and combines 1-dwordbuffer_store_dword's lane and range guards.On a 200-program retail pack sweep (
--direct --sample 200 --max-bytes 0 --validate --compare, 4 windows, split wave64):197 / 200translated (0validator errors), total DXIL30.24 MB → 22.57 MB(−25.4 %,direct/HLSL 1.25 → 0.94), translation timep50 20.36 → 15.66 ms,p95 277.55 → 152.00 ms,max 837.86 → 417.81 ms. (Note:#1699also toucheswith_meminlower_mem.rs, which overlaps textually with open#1693; happy to rebase if#1693lands first.)AI use: Antigravity (Gemini 4 Neon) wrote this comment (PR #1699 was written with Gemini 4 Carbon and Gemini 4 Hydrogen).
@Sr-0w on GitHub · 2026-11-24 19:37 UTC · original
@bmjask: a heads-up on your code before I open a PR against
main, as @gefydev suggested on #1269.What: heap memory windows (
XCL_HEAP_WINDOWS=1) in the direct form. Todaytranslate_entryrefuses them, and the program falls back to HLSL. In heap mode,Lw::with_memmakes one access throughResourceDescriptorHeap[MEM_HEAP_BASE + w], with a non-uniform index, as the HLSL path's heap form does. It no longer switches over 4 root UAVs.wstill goes to window 0, the same as your switch.gpu/dxil, +40 lines:Shader::heap_raw_uav;Lw::heap_mems;Lw::multi_windowin place of the threemems.len() > 1checks.Why: AMD driver time. RX 7800 XT,
mainc160d86, coldCreateComputePipelineState, one build at a time. The programs are the slowest builds from my title runs, in your per-instruction form:5683ddcd014910676e148dbd563de205cc047f458010c5d21404420b38db85972e0055c25f49848a34207613d17f8b9673000efc296c082e6da1f38b06d6c735The heap form is within 2–5 % of the one-window DXIL size. On the 21 programs measured (the ones without textures, which the test root signature takes), total driver time goes from 123.4 s to 52.9 s.
A second finding, for a later PR against
mainif you agree:buffer_*_formatcomputes every conversion for each access and then picks one. For example,6973db5b609fa431is 1.7 KB of console code and gives 181 KB of DXIL from 48 format accesses. Tell me if you'd rather do that one yourself.AI use: Claude Code (Claude Opus 5.5) wrote the change, ran the measurements and wrote this comment.
@Fran-co-F on GitHub · 2026-11-24 19:44 UTC · original
@bmjask as @gefydev asked: the DXC-optimizer experiment from #1269 (#1269), for comparison with
Module::optimize.It runs on top of
Module::optimize: the baseline ismainc160d86, whereshader.rsalready callsself.m.optimize(). The container then goes throughIDxcOptimizer(-hlsl-dxilload -instcombine -simplifycfg -early-cse -gvn -adce -dxil-remove-dead-blocks -globaldce -hlsl-dxilemit), back into a container withIDxcAssembler, and is signed byIDxcValidator(InPlaceEdit).RX 9070 XT, RADV (Mesa 26.3.1), vkd3d-proton
ec20719, cold, one program per process. Totals are translation + optimizer + driver. The same 106 sample programs and 21 hard ones are measured on the HLSL path too.maindirect (withModule::optimize)Against
main's direct path alone, on the 77 programs measured both ways:maindirect (Module::optimize)So
instcombine/gvn/simplifycfgstill find a lot on top of the in-tree passes, mostly on the big programs. Those are the passes I would look at first. Running them only above a size threshold (about 64 KB of DXIL) would avoid the small-program cost.Flags must match usage: 4 of 106 sample programs (22253, 23062, 23076, 23085), 22617, and 8 programs in a title run. The validator refuses them after the passes, presumably because the shader flags are not recomputed. Those keep the unoptimized container.patch against
c160d86(opt-in,XCL_DIRECT_OPT, 62 lines)Tested: release cross-build for
x86_64-pc-windows-msvcfrom Linux, runs under Wine + vkd3d-proton on the hardware above. Not tested: the test suite (Linux only here), Windows / NVIDIA, other pass lists.AI use: Claude Code (Claude Opus 5.5) wrote the patch, ran the measurements on my machine and wrote this.
@Itsmetibo on GitHub · 2026-11-24 19:50 UTC · original
@bmjask a small change to
maincode ingpu/dxil/module.rs, which gefydev is pulling intodirect-on-1426from #1269 (branch: https://github.com/Itsmetibo/xcl/tree/recomp/batch-phi-replace, commit4c3fe1e):Module::replace_uses(&HashMap<Value, Value>): replaces everyold → newof the map in one pass over the instructions and metadata, following chains (a → b,b → c: a use ofabecomesc), the same asreplace_all_usescalled once per entry in order;replace_all_uses(old, new)stays, with the same behaviour, and now callsreplace_useswith a one-entry map.Why: the per-lane lowering called
replace_all_usesonce per trivial phi, and each call walks the whole module, so the time was about quadratic in program size. On an RTX 3060 Ti machine (i5-11600), the CS + MS per-lane survey did not finish in 10 minutes before and takes 177 s with the batched call. A new test indxil/tests.rs(batched_replacements_match_one_at_a_time) checks that a batched map with a chain gives the same container as the one-at-a-time calls.AI use: Claude Code (Claude Opus 5.5) wrote this change and this comment.
@SlopTart on GitHub · 2026-11-24 20:04 UTC · original
Pinpoint follow-up: split the two crashing tests into one-op-per-kernel probes (19 probes, same commit/stack as my comment above, each run solo). Crashes reproduce with a single intrinsic, no other ops in the kernel:
uaddcalone: crash (exit status 3)usubbalone: crashudiv_remalone: crashAll 16 others ok solo:
bfrev, all fourbit_countvariants,imax/imin/umax/umin,imad/umad,ibfe/ubfe/bfi,umul_wide,imul_wide.Not a divide-by-zero artifact: the second input vector is
rotate_left(7) ^ 0x9e37_79b9, never zero.So the crashing set is exactly: add-with-carry, sub-with-borrow, and unsigned div/rem.
integer_ops_match_cpucrashes because it containsudiv_rem;uaddc_and_usubb_match_cpubecause of the carry/borrow pair. Wide multiplies are fine.That is a much smaller hunting ground: three lowering paths (
UAddc,USubb,udiv_rem) emit something the downstream compile path on this card dies on instead of returning an error. Each is now a ~10-line repro kernel.(These are local probe tests; happy to PR them as a permanent one-op-per-kernel suite if useful.)
AI use: Hermes agent (local Qwen-class) wrote the probes, ran them, drafted this; I checked it before posting.
@oni-swr on GitHub · 2026-11-24 20:34 UTC · original
@bmjask a heads-up, as gefydev asked on #1269: #1742 changes
gpu/dxil(prelude.rs,lower_valu.rs,lower_wide.rs). In the default rounding mode,v_cvt_f16_f32,v_mul_f16andv_pk_mul_f16now round to nearest-even, as the HLSL path does since #166. Before, they went throughdx.op.legacyF32ToF16, which rounds toward zero. A newLw::to_f16_roundeddoes this, and programs that setMODE[3:2]keep the dynamic path.TRANSLATOR_VERSIONgoes from 5 to 6. The GPU test runs in wave32, split wave64 and native wave64 (RX 7800 XT). It is your code, so a look would be welcome.AI use: Claude Code (Claude Opus 5.5) wrote this comment for @oni-swr.
@Itsmetibo on GitHub · 2026-11-24 20:38 UTC · original
@bmjask Windows / NVIDIA data for Fran-co-F's DXC-optimizer patch (#1426), the two "Not tested" items. Machine: RTX 3060 Ti 8 GB, i5-11600, Windows 11, NVIDIA driver, release build of
main6c89285+ the patch as posted.Tests.
cargo test --release --workspace --no-fail-fast -- --test-threads=4withXCL_DIRECT_OPTset: 863 passed, 0 failed, 42 ignored.gpu_compute_e2ewithXCL_DIRECT_DXIL=1: 3 passed, 1 failed, the same with and without the optimizer (offline_compute_pipeline_is_reused_by_a_second_process, the failure already reported onmain). No optimizer refusals in the tests.Driver time. One fresh process per program and setting (
xcl shaders --precompile --pipelines,XCL_DIRECT_DXIL=1, XCL's caches off, a freshXCL_DXIL_CACHE), timingconsole_to_dxil_in(translate, plus the DXC passes when on) andCreateComputePipelineState. NVIDIA's own driver cache can't be turned off here, so each container is timed on its first build only (a second build of the same DXIL takes ~11 ms). This GPU is wave32-only, so the programs go through the split wave64 form with 4 heap windows. One run per program and setting, with the on/off order alternating, so differences of a few percent are within noise.Summary:
Flags must match usage: 0 refusals in the 40 runs (optrefcounted from the "direct DXIL optimizer refused" log line).So on Windows / NVIDIA, this pass list costs translation time without lowering driver time. I didn't test other pass lists.
AI use: Claude Code (Claude Opus 5.5) ran these measurements on this machine and wrote this comment.
@cansolele on GitHub · 2026-11-24 20:45 UTC · original
@bmjask, following @gefydev's suggestion in #1269, I've opened draft PR #1788 to defer cold direct-DXIL compute translation during cached-only async PSO probes.
Synthetic GPU regression tests passed on an RTX 5060 Ti. The required paired retail-title smoke runs are still pending.
#1788
AI use: Codex (GPT-6.2 Sol) for development, analysis, and testing.
@Gevroska on GitHub · 2026-11-24 20:46 UTC · original
I compared the default shader path with
XCL_DIRECT_DXIL=allon an RTX 3080 under Windows, using clean merge commitc160d86. I ran the same first-run form sequence once per configuration, with matching cache conditions. Both runs accepted Confirm, reached a black screen during world loading, and exited with0xc0000005at the same guest offset (+0x23cf683). Neither reached gameplay.XCL_DIRECT_DXIL=allThe
allrun recorded 119 compute, 31 pixel, and 23 vertex shader translations through the direct backend, with zero recorded HLSL fallback attempts in those stages. Those counts confirm that direct translation was exercised. With one run per configuration, my conclusion is limited to this revision and setup: the same world-loading fault occurred in both runs. Its cause remains open.I used Codex with GPT-6.2 Sol to run the comparison and prepare the report. A separate GPT-6.2 Sol agent independently checked the saved observations, input sequences, and log summaries. GPT-6.1 Terra checked for overlap with existing upstream reports.
@SlopTart on GitHub · 2026-11-24 21:00 UTC · original
Following up on my comments here: opened #1807 with the probe suite as real tests (one-op-per-kernel section in
ops_tests.rs, reusing the existing helpers, +157 lines, no deletions). Fresh run on the same stack confirms 10 probes pass and exactlyuaddc,usubb,udiv_remabort, every run.If the CI NVIDIA card runs them: passing there localizes the fault to the AMD path; aborting there means it is reproducible without AMD hardware. Either way it stops being a comment-thread claim and becomes a standing test either fixed or triaged.
AI use: Hermes agent (local Qwen-class) wrote and ran the probes; I checked the diff and logs before opening.
@tycosnh on GitHub · 2026-11-24 21:05 UTC · original
#1426 on an RTX 4090 (621.24): the three giant compute programs, and a title run
Head
bc93a3a, release, Ryzen 7 9800X3D, 31 GB RAM, Windows 11 Pro 26300, DXC 1.8.2502.11. Retail 1.0.2.1. Each program alone in a folder,xcl shaders <folder> --precompile --only csand then--pipelines, each backend into its own emptyXCL_DXIL_CACHE,XCL_PSO_DISK_CACHE=0, 900 s cap per step.XCL_DIRECT_DXIL=1: translate / DXIL / driverbillboard_nobump:CS_RaytracingResolve_c6735e5findirect_diffuse_lighting:CS_ScreenProbes_ActivateRays_d60186e6indirect_diffuse_lighting:CS_ScreenProbes_ActivateProbes_9083c094So the direct path gets ActivateRays built where DXC never finishes, and is a bit faster on RaytracingResolve, but its containers are 33–130× the size of DXC's, and ActivateProbes still does not finish in NVIDIA's compiler either way.
Title run (5 min,
XCL_PSO_WAIT_MS=50, A pressed every 5 s from 55 s,XCL_NETWORK=0), same build with and withoutXCL_DIRECT_DXIL=1:direct DXIL: … – HLSL pathline). Reached the world load (6 922 dispatches in the 2 s at 116 s); 269 compute pipelines built cold, the longest 31.0 s for a 33.9 MB container. At 146.6 s the title hit a breakpoint:0x80000003 in game_scarlett_master.exe+0x3bf4.+0x2215c35GPU watchdog at 172 s. Its driver cache was warm (325 of 506 pipelines from blobs), so the pipeline times are not comparable.The
+0x3bf4breakpoint has not shown up in our HLSL-path runs. I have the logs if a trace of the programs used before it helps.AI use: Claude Code (Claude Opus 5.5) ran these on my machine and wrote this report.
@bmjask on GitHub · 2026-11-24 22:06 UTC · original
Thanks for the post-merge reports and heads-ups. Short answers per thread:
mainis welcome. Out-of-rangewmapping to window 0 matches the switch form.56c0cd3b82a00c6e(14.8 MB) is still open. @raylitebull reports the same program OOMingamdxc64.dllon #1809.uaddc,usubbandudiv_remalone, and for turning the probes into #1807. I haven't found the cause yet. Whether they also abort on NVIDIA will tell us whether it's our lowering or the RADV/vkd3d path.replace_uses): thanks for the heads-ups. They'll be reviewed as their own PRs. @oni-swr: since #1679 also bumpsTRANSLATOR_VERSION(now 8 with the pending MSAA fix), the version numbers will need reconciling at merge.bc93a3a(#1748 among others) is aimed at that.+0x23cf683fault on both paths points away from the direct backend, as you concluded.AI use: Claude Code (Claude Opus 5.5) wrote this comment for @bmjask.
@nineforge0 on GitHub · 2026-11-24 16:35 UTC · original · edited 2026-11-24 23:13 UTC
The complete opcode target set for this backend, in case it helps decide what to implement before discovering gaps by fallback. I decoded all 24,804 shader records in the retail shader database (
shaders.rpfentry 0) (25,194 programs, 44.25M instructions) and counted every distinct GFX10.3 opcode.Coverage: 470 distinct opcodes total. 85 cover 90% of executed instructions, 194 cover 99%, 282 cover 99.9%. 0 undecodable dwords, 0 opcodes we couldnt name. Per stage: CS 437 (81 unique to CS), MS 249 (all also in CS except
expands_sendmsg), PS 358, VS 269, ES/GS 65. So the direct path for MS+CS needs ~437 opcodes; the 99% core is 194.Two correctness traps worth hardcoding before they bite (both are high-frequency):
v_mul_legacy_f32is the single most-executed instruction (12.4% of all instructions, ~5.5M occurrences). It is a legacy multiply where0 * x == 0even whenxis Inf or NaN. Translating it as a plainfmulgives wrong results on those operands — a subtle source of wrong pixels.v_mac_f32appears in 5,091 programs (VOP2 form) andv_mad_f32in 7,293. These must NOT be lowered to fusedfma— they round the intermediate.One ambiguity I cant resolve without hardware (you have the AMD cards, we dont): VOP3 opcode
0x140— 24,717 occurrences in 6,058 programs. The current RDNA2 spec calls itv_fma_legacy_f32(fused); the older GFX10.1 spec calls itv_mad_legacy_f32(non-fused). Since the console keeps the other GFX10.1 non-fused ops, non-fused is the likely meaning, but a native wave64 probe (fma vs mad rounding on a crafted input) would settle it. If someone running the AMD native tests here can check, it would pin down 6,058 programs.Full census + per-opcode table: https://github.com/nineforge0/forge9/blob/main/docs/rdna2_opcode_coverage.md (reproduce:
forge9 isa shaders.rpf 0 --opcodes, or--opcodes --stage MS).Analysis produced with AI assistance (Claude Opus 5.5), directed and reviewed by the account owner. Data extracted from the account owner's own copy of the executable; no game files or keys were shared.
Edit: the source is the title's shader database (
shaders.rpfentry 0), not the pipeline cache (entry 1). The numbers are unchanged.@DavidM1911 on GitHub · 2026-11-26 05:13 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
@GonZiin on GitHub · 2026-11-24 17:46 UTC · original · reviewed
Native Windows RDNA4 recheck of
424d315372d60948b79422b1976ef8d486632b49. The direct recompiler suite passes on this head. The DXIL suite still has two GPU/CPU mismatches, plus the previously reported SDK validator crash.Tested
XCL_REQUIRE_GPU=wave64,mesh.XCL_DIRECT_DXIL=1 cargo test -p xcl --lib gpu::recomp -- --test-threads=4reported 191 passed, 0 failed, 18 ignored and 0 GPU skips.cargo test -p xcl --lib gpu::dxil -- --skip malformed_containers_are_errors --test-threads=1 --nocapturereported 81 passed, 2 failed, 2 ignored and 0 GPU skips. Bothwave_ops_match_cpuandhalf_precision_overloads_runpassed.fuzz_validate_and_gpu_1, seed 722, returnedres[30] = 0x1with CPU reference0x7fffffff.fuzz_validate_and_gpu_3, seed 1599, returnedres[193] = 0x1with CPU reference0x0. The other two fuzz ranges passed.cargo test -p xcl --lib -- --exact gpu::dxil::validate::tests::malformed_containers_are_errors --test-threads=1independently reproduced the SDK 1.8.2502.11 process exit0xC0000005on this head.Not tested
Retail titles, DXC 1.9 on this setup, and the cause of the two residual fuzz mismatches.
AI use
Codex (
gpt-6.2-sol) ran the tests and drafted this review.