Recompiler: route compute programs through a compact backend (XCL_COMPACT_CS) #1316
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!1316
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1316"
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?
@CowboyBingus on GitHub · 2026-11-24 14:39 UTC · original
CowboyBingus:recomp-compact-routing→main· +1894 −55 · 8 files · 4 commits · openStacked on #1315; only the top commit belongs here.
Routes translated compute programs through the compact form of #1315 when it pays, behind
XCL_COMPACT_CS:auto(the default): the programscompact::compact_wantedtakes (20,000+ instructions, distinct blocks under 30 % of them);0: never;1: every compute program. It is for tests and measurements, not for play: in brainhay5's run it raised the total driver compile time from 84.2 s to 158.8 s; on an RX 7800 XT, forcing it on 18 sampled records raised DXIL from 5.29 to 17.03 MB and driver time from 186.5 s to more than 1,152 s (oni-swr).A compact translation that returns an error or is incomplete falls back to
translate, and so does one whose HLSL fails in DXC (dxc::compile_cached). Part of #1269, #505 and #1598.With it,
indirect_diffuse_lighting:CS_ScreenProbes_ActivateProbes(56c0cd3b82a00c6e) is compiled as 1,053,264 B of DXIL instead of 29,750,144 B (numbers in #1315).What is in it
Recompiler: route compute programs through a compact backend (XCL_COMPACT_CS):gpu/recomp/mod.rs:CompactCs(the switch, read once) andtranslate_routed. Only compute is routed; geometry, mesh and kernel mode are not.gpu/recomp/pso.rs:console_translationusestranslate_as(translate_routedwith the switch given). A program routed to the compact backend gets a…_c.bintranslated-cache entry, so the two forms never share an entry. DXC and driver-blob keys already come from the HLSL / DXIL bytes. Whendxc::compile_cachedfails on a compact form, the program is compiled in the normal form (or taken from the normal entry when that is on disk) and kept under the normal entry, not the_cone, with one WARN line; a cached-only attempt is not retried, and a refusal is not remembered between runs. A driver (CreateComputePipelineState) rejection of a compact pipeline is not retried in the normal form. WithXCL_DIRECT_DXIL(#1426) on, a compute programXCL_COMPACT_CSroutes to the compact form goes to the compact form first, not to the direct translator; a program the compact form then refuses (e.g. its table limit) falls back totranslate, and one whose compact HLSL DXC refuses is retried in the normal form through the direct translator first, thentranslate. Every other compute program goes to the direct translator as before (goes_direct, tested inthe_compact_routing_goes_before_direct_dxil). The reason: forActivateProbeson an RX 9070 XT, ezamelczyk measured 80.9 / 81.2 MB of DXIL from #1426's direct translator against 0.77 / 0.87 MB compact.main, a title's compute program (andxcl shaders --precompile's) whose HLSL is longer thandxc::UNOPTIMISED_ABOVE(8 MiB) is tried in the direct translator first whenXCL_DIRECT_DXILis off (pso::compile_hlsl);xcl shaders --measure-psodoes not do this. That check is made on the HLSLconsole_translationreturns: the compact HLSL for a program in the compact form, the normal HLSL for one the compact form refuses or whose compact HLSL DXC refuses.shaders.rs,gpu/shader.rs: the offlinexcl shaderspaths are routed the same way.build.rs:compact.rsis listed as a translator source, so the translated cache's identity follows it.Tested
RTX 5070 Ti (driver 621.24), AMD Ryzen 7 9800X3D, Windows 11 (10.0.26300).
This PR's head
5328b15(onmainafc5ee8):cargo build --workspaceandcargo build --release -p xclsucceeded;cargo test -p xcl --lib compact -- --test-threads=4: 33 passed, 0 failed, 0 ignored, withgpu_compact_native_wave64_formSKIPPED (no wave64);cargo test -p xcl --lib pso:: -- --test-threads=4: 23 passed, 0 failed, 1 ignored (compile_time_bench::repeated_pso_shader_compile). The full suite was not run locally on this head.cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4(debug) on an earlier head of this PR,964f5ed(onmain266b845): 981 passed, 1 failed, 42 ignored (lib tests 932 / 1 / 22). The failure ishle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory(kernelx.rs:2070), which fails the same way onmain930e8b4. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,gpu_compact_native_wave64_form, and 16 lines ofmain'slower/lower_dxiltests. SKIPPED (per-lane form refused): 3 lines oflower_dxil's f16 / f32-conversion tests. SKIPPED (no heap windows):heap_window_out_of_memory_falls_back_to_the_switch_form.Same base, cold:
main266b845against this PR's head964f5edwithXCL_COMPACT_CSunset (auto), on the programsautoroutes. Each record was extracted to a folder of its own (xcl rpf shaders.rpf --extract <name>) and measured withxcl shaders <folder> --measure-pso <hash>(driver caches off), one process per run from a new copy of the exe and an emptyXCL_DXIL_CACHE, 4 memory windows, split wave64; HLSL fromxcl shaders shaders.rpf --export-hlsl <dir> --record-hash <hash>; peak commit is the process's peak private commit, sampled every 0.5 s; one run each, a run ofmainstopped at 600 s:CreateComputePipelineState56c0cd3b82a00c6e(ActivateProbes)main958400d2caf07244(ActivateProbesTarget)main95cc13288a27a96e(ActivateRays) is left out: both builds translate it the same way (15,000 KB of HLSL each; this PR's compact form refuses it,9975-word table (at most 8192)).A title run (retail title) of a local build of
31be310plusac1ca18:31be310is a merge of this stack's branches; its tree differs from this stack's intests_compact.rs, two comments incompact.rsand the order of twopub modlines inmod.rs.ac1ca18is an earlier local version of theSleeprule in #1288; its code differs from #1288's.56c0cd3b82a00c6ein the compact form, logged by its code hash:[SHADER] compact backend, compute program d122faa48eb0afdc: 88863 instructions, 723453 B HLSL.ActivateRaysfell back:compact form: 19949 blocks of 11909 texts need a 9975-word table (at most 8192) – translated as before.Regression run
scripts/smoke.ps1 -Game <game folder> -Seconds 60 -Title retail(release builds, menus, no input):main:
this PR:
Not tested
ActivateProbeswith this stack alone, without aSleeprule like #1288's.XCL_HEAP_WINDOWS=1).XCL_DIRECT_DXILtogether withXCL_COMPACT_CSin a title orxcl shadersrun: only the unit test of their order.ActivateProbespipeline was not built within 300 s on an RX 9070 XT (RADV), nor wasmain's form (47efa2e) (ezamelczyk); with the legacy structurizer (a local vkd3d-proton patch) it was built in about 75 s each.AI use
🤖 Generated with Claude Code
@Filip722 on GitHub · 2026-11-24 15:02 UTC · original
Tested on Bazzite
RTX 5060 Laptop GPU (8 GB, NVIDIA 615.78.08), Intel Core 7 240H, 16 GB RAM, Bazzite 44 Testing and Proton Experimental 11.0-20261112. Windows MSVC release, Rust 1.98.1 and DXC 1.9.2609.5. Exact #1316 head
490ccbb491e99508e10be5c1b78e4ba03f543398on XCL main930e8b4with our existing local Series X texture and mesh loading changes. Eight focused routing, cache-key and DXC tests passed.Using the same executable, separate empty DXIL caches, one compile worker, four memory windows and split wave64, I compiled the same 88,863-instruction compute shader used in #1315. Both runs compiled one input with zero errors. XCL's CPU-only precompile took 125.3 s with
XCL_COMPACT_CS=0and 15.0 s withauto. The single cached DXIL file went from 29,750,440 to 1,053,272 bytes. Auto selected the compact route and emitted 723,453 bytes of HLSL.Separate offline Series X title runs with
0andautoreached loading artwork, then the same title GPU watchdog. Both recorded 17 pipeline-bind timeout warnings and zero D3D12 device removals or kernel GPU faults. Auto logged no compact translation attempts in this window. The memory caps tightened at different elapsed times, so I am reporting the shared milestone and route observation.Not tested
Driver PSO creation for the isolated CPU comparison, native Windows on this laptop, or playable world entry.
AI use
OpenAI Codex with GPT-6.2-Sol high ran the focused tests, compared the builds and prepared this report.
@brainhay5 on GitHub · 2026-11-24 15:10 UTC · original
Tested the branch you named (
5e312d5, merged ontomain930e8b4, clean), RTX 5070 Ti, driver 32.0.16.1088, Windows 11 22631, release,XCL_NETWORK=0, A every 5 s, 140 s world load each.auto(default): 1 program routed, 156 compute PSO builds, driver time 84.2 s, largest 1,144,224 B / 84,029 ms.XCL_COMPACT_CS=1: 106 programs routed, 102 builds, driver time 158.8 s, largest 1,537,704 B / 57,249 ms.So forcing the compact form on every compute program is a regression on this title: nearly double the driver time, and the largest build got bigger (1.54 MB against 1.14 MB). It compacted 106 programs where it does not pay. Worth saying in the PR description, because
1reads like "turn the feature on" and invites exactly this test.autois the right default and behaves likemainin this window — it routed one program and the totals are within run-to-run variance (84.2 s here against 104.1 s onmainin the previous run).The other thing the run shows: the programs the compact form targets are not reached in the first 140 s. With
auto, one program is routed; you sawActivateProbestranslated at 342 s in your run. So no 140 s run can show the tail benefit either way — the comparison needs a run that gets past ~340 s, which ours does not (it ends at+0x23cf683first).If you want, I can run
autowith a longer window (say 400 s, watchdog permitting) once the branch is rebased on the nextmain, and report the tail share before and after as two numbers.AI use: OpenCode, DeepSeek V4.1 Flash 1017.
@More1215 on GitHub · 2026-11-24 15:10 UTC · original
Testing #1316 at
5e312d5againstmain930e8b4on Windows: the full-pack passxcl shaders --precompile --only cs --pipelines(driver PSO creation included), RTX 5080 (driver 621.35), Ryzen 7 9800X3D, 32 GB, DXC 1.9.2602.17, separate empty DXIL caches. This is the pass that stops advancing around record 22 600 on RTX 4080/4090/5080 (#744). I will report whether it gets past that point, how long it takes, and the driver times of the routed programs. Counts and timings only.AI use: Claude Code (Claude Opus 5.5) runs the measurements and writes the report.
@futurepro62 on GitHub · 2026-11-24 15:04 UTC · original · edited 2026-11-24 15:12 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
5e312d5(on its base930e8b4).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 773 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_compact_native_wave64_form,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.equal_blocks_share_one_case,compact_is_wanted_for_large_repetitive_programs,gpu_compact_matches_translate,the_switch_reads_auto_0_and_1,only_compute_goes_to_the_compact_backend,translated_compact_and_normal_forms_are_kept_apart,compact_and_normal_forms_compile,gpu_compact_execz_nest,gpu_compact_backward_loops,gpu_compact_repeated_blocks,gpu_compact_far_jumps,gpu_compact_v_mul_lo_u32,gpu_compact_buffer_load_format_x,gpu_compact_native_wave64_form,gpu_compact_compute_dispatch,gpu_compact_memory_windows,gpu_compact_memory_windows_loop,gpu_compact_programs_with_four_windows,gpu_compact_exchange_repeated,gpu_compact_buffer_load_format_x_repeated,gpu_compact_endpgm_before_last_block,gpu_compact_sample_big_cs.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 773 passed, 0 failed, 41 ignored, no skips.XCL_COMPACT_CS=1,cargo test -p xcl --lib -- gpu::on both GPUs: 306 passed, 0 failed, 18 ignored. That says less than it looks: the recompiler GPU tests intests.rs(viarunner.rs) calltranslatedirectly, and only thepso.rs,shader.rsandshaders.rspaths go throughtranslate_routed. So the env var does not put the existing GPU tests on the compact backend, and the compact backend is covered bytests_compact.rsonly. A switch inrunner.rsto route throughtranslate_aswould let the whole GPU test set run against it.Not tested
AI use
@IvyNotFound on GitHub · 2026-11-24 15:15 UTC · original
Retail world load on an RTX 5080 (32-lane waves) at
5e312d5:ActivateProbestakes the compact form and its pipeline is built in 24.2 s; onmainit is not built within the run.ActivateRaysfalls back as described. No new crash: every run of both builds ends in the title's known ones at 140–160 s.Tested
5e312d5as is (basemain930e8b4), clean tree.cargo test -p xcl --lib compact(debug): 22 passed, 0 failed;SKIPPED gpu_compact_native_wave64_form(no wave64).scripts/smoke.ps1 -Seconds 240,XCL_PRESS_A_AT=15,XCL_PSO_WAIT_MS=50(past the firstListX #101, into world loading),XCL_COMPACT_CSunset (auto). Two runs of the PR back to back, then one ofmain930e8b4, same DXIL / driver-blob caches.main[SHADER] compact backend, compute program d122faa48eb0afdc: 88863 instructions, 723453 B HLSL15ec6daefb19a780(ActivateRays):… need a 9975-word table (at most 8192) – translated as beforeActivateProbes)GPU queue.Waittimeouts (#505)+0x2215c35(#232) at 140.5 s0xc0000409+0x23cf683("GPU Loc Sig") at 160.6 smainno compute PSO of more than 1.85 MB of DXIL is built in the 240 s: the 29.75 MB form of56c0cd3b82a00c6enever reaches the driver. With this PR its compact form is translated at 67.8 s in run 1. Its DXC result is in the cache for run 2, where the driver builds it in 24.2 s on this GPU (9.7 s in the description, on a 5070 Ti, from a new exe).mainon this machine (#232, #505,0xc0000409).Not tested
XCL_COMPACT_CS=1(every compute program) and=0AI use
@CowboyBingus on GitHub · 2026-11-24 15:20 UTC · original
@brainhay5 thanks.
1routes every compute program and is for tests and measurements, not for play. I've added your 84.2 s → 158.8 s numbers to the description, under that setting.autostays the default.AI use: Claude Code (Claude Opus 5.5) wrote this reply.
@DavidM1911 on GitHub · 2026-11-24 15:34 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 21 ignored.Thanks!
@t4l03 on GitHub · 2026-11-24 15:35 UTC · original
RTX 4070 Ti follow-up: the shared-target prototype completed ActivateRays with a longer time budget
This is an independent check alongside Pipodi’s RTX 4090 experiment. I reran the exact branch-free, factored DXIL from my earlier #1269 report, which stopped at 75 s. With a 150 s limit, both runs created the pipeline and saved a 1,300,766-byte driver blob.
RTX 4070 Ti, driver 617.14, Windows 11 build 26300, DXC 1.9.2609.5. Four switch-based memory windows, release helper using XCL’s ABI root signature and the shader’s static samplers. Each run used a differently named helper executable and a fresh XCL cache. NVIDIA’s global DXCache remained enabled.
The local prototype also has 2,516 shared cases. It uses a different override encoding: a default target per case plus 6,566 sparse absolute-target overrides assigned by block index (11,498 total table words in this experiment). Its 2,787,188-byte DXIL has 6,418 explicit block labels, 44,484 SSA definitions and 6,526
selectinstructions. This adds Ada data for the tradeoff between table size and override work. The two machines and encodings differ, so the timings are separate observations.Not tested: dispatch output, full-title loading, or Pipodi’s exact implementation. The shared-target PR is theirs. I’m looking at the remaining case bodies and memory-window variants as noted in #1269.
AI use: Codex (
gpt-6.2-sol) ran the measurements and wrote this report.@imnicho on GitHub · 2026-11-24 15:38 UTC · original
Test report at
5e312d5on a small machine (16 GB RAM, 4 cores): the fallback of15ec6daefb19a780takes the title's process to its commit cap at the start of every run. With the table cap at 12,288 words it takes the compact form and the commit stays flat, but DXC does not finish that form in 14 minutes here.Tested
main930e8b4+ #266 + #684 + #680 (heap windows on, so the HLSL sizes are a little below yours) + #968 + #1288, and this PR at5e312d5merged into it. One conflict, with #680 ingpu/recomp/mod.rs, resolved by hand (#680's window-flag normalisation at the start oftranslateandtranslate_as). Your newer head6cefa5cdiffers from5e312d5in a test only.XCL_NETWORK=0, scripted pad, binds waiting (noXCL_PSO_WAIT_MS),XCL_COMPACT_CSunset. Every run inside a job with a 50 GB commit cap. One DXIL / driver-blob cache folder, kept across the runs, in this order:0xc0000409at 95.6 to 99.5 s, before the title's world set-up, 3 of 35e312d50xc0000409at 125.8 sMAX_TABLE_WORDS = 12288(local)xcl-dxcworker insidedxcompiler.dlland onexcl-pso-preworker insidenvgpucomp64.dll, the same two each time. I did not separate DXC's share of the growth from the driver's.d122faa48eb0afdcgoes through the compact form (88,863 instructions, 718,281 B of HLSL, 983,404 B of DXIL). The driver built its pipeline in 75.6 s here, during the title's start with other builds beside it, and later runs take it from its blob.15ec6daefb19a780is refused ("19949 blocks of 11909 texts need a 9975-word table (at most 8192) – translated as before"), and the commit goes to the cap again; the process ends about half a minute later than without the PR.15ec6daefb19a780goes through the compact form too (76,699 instructions, 5,249,095 B of HLSL) and the commit stays flat. But its DXIL never reached the cache: no…_c.binentry for it after the 420 s run or after the 900 s run (884 s after its translation at 16.0 s), and the second run translated it again. So on this CPU DXC needs more than 14 minutes for that form with the title running beside it. The driver's time for it was not reached.So on a machine of this size the fallback is more than slow: once the title has used the program, the preload starts it in every run and the process is gone before the world's set-up. A higher cap alone does not make the program usable here either (11,909 texts are 5.2 MB of HLSL), which speaks for the denser table discussed in #1269. I can run that on this machine when it is up.
Not tested
AI use
@oni-swr on GitHub · 2026-11-24 15:39 UTC · original
AMD dedicated GPU (RX 7800 XT, native wave64) at
5e312d5: full suite green; the compactActivateProbesandActivateProbesTargetbuild in the AMD driver, but in 439 s and 342 s with 19–23 GB of commit; the old forms fail withE_OUTOFMEMORY. Counts and timings only. This adds the AMD driver side next to @Pipodi's RTX 4090 numbers on #1269, and the per-program times for the programsautoroutes, which theXCL_COMPACT_CS=1run on an RX 9070 in #1269 did not reach.Tested
5e312d5(onmain930e8b4), clean tree, its own worktree and its ownCARGO_TARGET_DIR. The PR's head is now6cefa5c; it differs from5e312d5in one test (only_compute_goes_to_the_compact_backend), and I did not rerun on it.cargo test --workspace -- --test-threads=4(debug), twice (the second with--nocapture): 773 passed, 0 failed, 41 ignored both times, noSKIPPEDline.gpu_compact_native_wave64_formran and passed.XCL_DXIL_CACHE, thenxcl shaders <folder> --precompile --only cs(DXC), then the same with--pipelines(cold driver build), then--pipelinesagain (from the blob). Release, one process at a time, wall time of each process, peak private commit polled every 0.5 s, one run each:--pipelinesrun15ec6daefb19a780)19949 blocks of 11909 texts need a 9975-word table (at most 8192) – translated as beforeFor the same two programs @Pipodi measured on the 4090: 14.3 s and 11.4 s of driver time, 1.8 and 1.5 GB. Here the driver time is about 30 times longer and the commit about 13 times higher. The rows are not matched (DXC 1.8.2502.11 here, and the HLSL is the native wave64 form), but a factor of 30 is not explained by that.
gpu_compact_sample_big_cs(release,XCL_SAMPLE_BIG_CSset to each program's code, native wave64, no split), on the old form (translate):translate/ compact)CreateComputePipelineStateE_OUTOFMEMORY(0x8007000E), about 110 s laterE_OUTOFMEMORY(0x8007000E), about 100 s latertranslate_compactrefuses:19832 blocks of 11829 texts need a 9916-word table (at most 8192)On this adapter that test panics at
tests_compact.rs:1163on the old form'sE_OUTOFMEMORY, and attests_compact.rs:91on ActivateRays' refusal, before it compares or times the compact form. On a driver that builds the old form the test gets further; here it does not, so it shows nothing about the compact form on AMD. The compact form is covered by the two cold builds in the table above.What it says
XCL_COMPACT_CS=1) and @Sr-0w's RX 7800 XT variant table, at a much larger factor, on the programsautoroutes.autodefault helps or hurts a world load on AMD is not answered here: no title run reached these programs on this card.Not tested
scripts/smoke.ps1), and a full-pack--pipelinespass.XCL_COMPACT_CS=0and=1in the title; DXC 1.9.x; repeat runs of the timings (one run each).translateon the GPU for the retail programs.6cefa5c.AI use
gpu_compact_sample_big_csruns, and wrote the timing script.@CowboyBingus on GitHub · 2026-11-24 15:43 UTC · original
Thanks, @pvfreis (review). New head:
6cefa5c, the same single commit on top of #1315, amended.only_compute_goes_to_the_compact_backendnow uses a program with a branch (S_CBRANCH_SCC1to the next instruction, thenS_ENDPGM). ForMode::KernelandMode::Computeit asserts thatcompact::translate_compactgives a complete translation whose HLSL differs fromtranslate's, and thattranslate_as(.., CompactCs::Always)returnstranslate's HLSL forMode::Kerneland the compact HLSL forMode::Compute. Withmatches!(opt.mode, Mode::Compute(_))removed fromtranslate_as(locally, not pushed), the test fails (assertion `left == right` failedatmod.rs:1594); with it, the test passes.recomp::compact.git merge-treeof6cefa5cwith #1321's head0936337conflicts incrates/xcl/src/gpu/recomp/mod.rsonly, in one block: #1321 addslet program = code;as the first line oftranslate, at the lines that #1315 moves intoprepare(). Keeping this PR's side and addinglet program = code;as the first line oftranslateresolves it. The resultingmod.rsis identical to the one in our local merge of5e312d5with #1321's earlier head156b0de(in our local integration tree355c727, not pushed), apart from this push's test change.0936337differs from156b0deonly intests.rs.Full suite on
6cefa5c(cargo test --workspace --no-fail-fast -- --test-threads=4): 772 passed, 1 failed, 41 ignored, of the passed 3 SKIPPED (no wave64). The failure isxmem_virtual_query_marks_cpu_readable_memory(kernelx.rs:2070), the one listed in the description. The description's Tested line and regression run are updated to6cefa5c.AI use: Claude Code (Claude Opus 5.5) wrote this reply.
@Anon64 on GitHub · 2026-11-24 15:45 UTC · original
World-loading run on a 12 GB 32-lane card, for the case nobody above has: RTX 3060 12 GB (581.80), Windows 11 26200, 64 GB RAM. This PR's head
6cefa5c(with #1315, onmain930e8b4), release,XCL_COMPACT_CSunset (auto),XCL_NETWORK=0, A pressed every 4 s from 20 s, 200 s, warm DXIL and driver caches. Compared with a run of #253's head on the samemain(f67e35a; #253 only changeseh.rs), same setup.main930e8b4(+ #253)+0x23cf683)smoke.ps1)d122faa48eb0afdctook the compact form at 5.9 s (88 863 instructions, 723 453 B HLSL); its pipeline was built at 56.0 s: 1 053 272 B DXIL, 36.5 s in the driver.15ec6daefb19a780fell back at 71.9 s (9 975-word table, at most 8 192), as in your run.So on this card the PR gets the big program built, but the title still stops at the same point, and process commit grows by ~18 GB between 80 s and 100 s where
mainstays flat; I have not found which thread allocates it. One run each.Written with Claude Code (Claude Opus 5.5) from runs on this machine.
@claudetools-gh on GitHub · 2026-11-24 15:46 UTC · original
A data point for the routing rule here: forcing the compact form on the title's mid-size compute programs (
XCL_COMPACT_CS=1) does not help them, so theautorule looks right.Setup: RTX 5070 Ti (driver 621.01), Ryzen 7 9700X, Windows 11 26300, release.
main47efa2eplus #1315/#1316 and other local PRs. The test isgpu_compact_sample_big_cswithXCL_SAMPLE_BIG_CSset to programs from the retail 1.0.2.1 pack. The program code was dumped locally and is not attached.a90b92233fcb9719(wave32)e666f4964e13c649(wave32)ddee0954b55bc286(12,638 instructions, wave64 split), failed in the harness's run of the plaintranslateform, before the compact form was tried. I have not looked into why.xcl pipelinespass (XCL_COMPACT_CS=1) routed 116 programs. Only the small ones reached the driver (55–205 KB DXIL, 0.3–2.7 s). The large ones were still in DXC when the pass was stopped.So the compact form pays off for the giants with heavy block repetition, as in the PR's 29.75 MB case, but not as a general switch for big programs. The title's ~1,800 compute programs with 0.5–1.4 MB of DXIL, at 30–190 s each in NVIDIA's compiler in our precompile logs, stay the open problem from #1269.
Not tested: the 1.4 MB-DXIL programs themselves (the two above are smaller), AMD, and the driver compile timed on its own, separately from the run.
AI-assisted.
@Tjabooo on GitHub · 2026-11-24 15:49 UTC · original
AMD on Linux, since the reports so far are NVIDIA:
5e312d5, RX 9070 XT (RDNA4), RADV / Mesa 26.2.6, Wine 11.21, vkd3d-proton v3.1 (with #257's patch), DXC 2026_09_29, cross-built forx86_64-pc-windows-gnu, debug.cargo test -p xcl --lib -- tests_compact --test-threads=1: 16 passed, 0 failed. All the GPU A/B tests of the compact form, includinggpu_compact_backward_loopsandgpu_compact_far_jumps, pass through dxil-spirv on RADV.jumps_to_outer_loop_heads_are_structured(frommain'sb8b1f49) crashes the test process in dxil-spirv onmain930e8b4as well. Details in #1425. Up to that point this branch fails only the three tests thatmainfails on this machine (gpu_f64_roots,gpu_f64_math_random(#530) andgpu_nonfused_mad_and_mac_prevent_fma_contraction(#676)).Not tested:
XCL_COMPACT_CS=1over the whole suite (blocked by the same crash), a title. No game data. AI-assisted (Claude Code, Claude Opus 5.5).@IvovdBruggen on GitHub · 2026-11-24 15:51 UTC · original
RTX 3080 10 GB on head
6cefa5c(the current head; earlier reports were on5e312d5): 773 passed, 0 failed, 41 ignored; smoke run equal tomainwith warm cachesTested
6cefa5c342fe71a88cd64153d81e755683887fb3(basemain930e8b4), no local changesstable-x86_64-pc-windows-msvc, MSVC 14.52.37025, DXC 1.8.2502.11 (Windows SDK 10.0.26100.0)cargo test --workspace --no-fail-fast -- --test-threads=4(debug): 773 passed, 0 failed, 41 ignored (lib tests 729 / 0 / 21)gpu_compact_native_wave64_form,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwareRegression run
scripts/smoke.ps1 -Game <game folder>(release builds, 60 s, menus, no input), both with warm caches:main:
this PR:
main.compact backendline: in 60 s of menus the title did not reach a program this PR routes.Review note (found with an AI tool, checked in the code):
translate_asfalls back totranslateonly when the compact translation errors or is incomplete. If DXC orCreateComputePipelineStatelater rejects the compact HLSL,compile_console_shader(pso.rs:262→:292) has no retry with the normal form, and that program gets the stand-in CS. WithMAX_TABLE_WORDSmeasured on one adapter, a retry in the normal form on rejection may be worth considering.Not tested
ActivateProbes/ActivateRaysXCL_COMPACT_CS=1XCL_SAMPLE_*setAI use
mainbuild and tests; Claude Opus 5.5 ran this PR's tests, all smoke runs and the review, and wrote this report. All results are from runs on the machine above.@pvfreis on GitHub · 2026-11-24 15:51 UTC · original
Thanks. Checked at
6cefa5c(read only):only_compute_goes_to_the_compact_backendnow uses a branching program and asserts the compact text differs and that onlyMode::Computeis routed (mod.rs:1581-1595), so dropping the mode check fails it; the commit message no longer mentions the stub. Both points are fixed.Reply by Claude Code (Claude Opus 5.5); checked by a person before posting.
@CowboyBingus on GitHub · 2026-11-24 15:52 UTC · original
@Anon64 thanks for the A/B (your report). Some numbers on
15ec6daefb19a780, and a request.15ec6daefb19a780fell back at 71.9 s in your run (9 975-word table, at most 8 192) and was translated bytranslate. It isActivateRaysin IvyNotFound's table, and this PR's description gives the same table size and cap forActivateRays(… need a 9975-word table (at most 8192)).CS_ScreenProbes_ActivateRays, #1321's description gives 148.5 MB of HLSL onmainand 13.8 MB with #1321.-O0, HLSL with four memory windows, wave32) on that program with a 6 GiB process commit cap (report): on930e8b4, 154,575,599 B of HLSL ran out of memory at the cap and made no DXIL; on #1321's156b0de, 15,359,988 B compiled in 67.7 s with a 2.8 GB peak commit.Could you rerun
6cefa5cwith #1321 (head0936337) merged on top, with the same setup, and post the same rows (process commit at 80 / 90 / 100 s, peak commit)? The merge conflicts incrates/xcl/src/gpu/recomp/mod.rsin one block: keep this PR's side and addlet program = code;as the first line oftranslate(details).AI use: Claude Code (Claude Opus 5.5) wrote this reply.
@mastrr9 on GitHub · 2026-11-24 16:04 UTC · original
Verified head
6cefa5c342fe71a88cd64153d81e755683887fb3on Windows 11 / NVIDIA RTX 5080 (wave32 / split-wave64, DXC 1.9.2602.17, Rust MSVC, debug build, clean worktree):cargo test -p xcl --lib -- gpu::recomp --test-threads=4: 211 passed, 0 failed, 18 ignored (0 new compiler warnings).Not tested: AMD native wave64, full workspace, retail smoke (
scripts/smoke.ps1).AI use: T3 Code (Antigravity / Claude Sonnet 5.5) ran the build and tests on our RTX 5080 and drafted this report.
@Creaa on GitHub · 2026-11-24 16:10 UTC · original
Test report:
ee904f1(tests) and5e312d5(measurements) on an RTX 4070 12 GB (split wave64 form).Setup: RTX 4070 12 GB (driver 617.14), i7-13700F, 32 GB RAM, Windows 11 build 26300, Rust 1.100.0, DXC 1.9.2602.17, release for the measurements.
cargo test --workspace -- --test-threads=4(debug), on both5e312d5andee904f1: 773 passed, 0 failed, 41 ignored. SKIPPED:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,gpu_compact_native_wave64_form(no wave64).5e312d5(not rerun onee904f1, whosemod.rsrouting change I did not measure).ActivateProbesandActivateProbesTarget,xcl shaders <folder> --precompile --only cs,XCL_COMPACT_CSunset, 4 windows, split wave64: both took the compact form (88863 instructions, 723453 B HLSL/88445 instructions, 665554 B HLSL), 2 009 528 B of DXIL together, translate + DXC 28.8 s for both.ActivateRaysin the same process (4 pipeline threads), so I have no per-program time. A repeat took 0.5 s because the NVIDIA driver's own disk cache had them. For comparison, on this machine an earlier offline run of the normal form (6efdabc, 29 750 152 B of DXIL) had not returned fromCreateComputePipelineStateafter 467 s and was stopped at 53 GB of private commit.ActivateRaysfalls back as the description says (19949 blocks of 11909 texts need a 9975-word table (at most 8192)). In its normal form, DXC took free system commit from ~70 GB to under 12 GB within 50 s, and my script stopped it there.Not tested: these programs in a title run (whether the cutscene that waits on
ActivateProbesgoes on), cold per-program driver times, AMD.AI use: Claude Code (Claude Opus 5.5) ran the tests and measurements on my machine and drafted this comment; I checked it before posting.
@vitor127wt on GitHub · 2026-11-24 15:15 UTC · original · edited 2026-11-24 16:19 UTC
Linux / Wine test report on the RTX 5070 Ti
I tested the exact head
5e312d5b3252d2a20a8a687bd4f2ef20eecfb877in a clean release build. This adds the offline PSO step to the earlier Wine precompile results. Both selected shaders translated through the compact route. With the default structurizer, both cold PSO attempts reached the 120 s process cap. Both completed with the legacy structurizer in the follow-up below. Earlier Bazzite reportTested
7.3.5-2-cachyos), Wine 11.22, DXVKv2.7.1-498-ga6764047e587178, vkd3d-protonec20719452e916b(dxil-spirv7c04863), Windows DXC 1.9.2609.5, Rust 1.100.0 and cargo-xwin 0.24.1. Upstream vkd3d-proton artifactcargo xwin build --offline --locked --target x86_64-pc-windows-msvc --release -p xcl --bin xcl. I usedxcl rpfto isolate each compute record from my Series 1.0.2.1 extract in its own input folder.wine xcl.exe shaders DIR --precompile --only cs --windows 4 --split 1withXCL_COMPACT_CS=auto, a fresh XCL DXIL cache, and one DXC and PSO worker. I then ran the same command with--pipelinesand reused that DXIL. XCL PSO blobs, vkd3d-proton shader cache, and NVIDIA disk cache were disabled. Each PSO process had a 120 s timeout and an 8 GiB memory cap.ActivateProbesActivateProbesTargetThe two precompiles completed with zero errors. Both PSO runs logged entry to D3D12 pipeline creation with an empty pipeline cache, then exited with timeout code 124. I collected a five-second user-space CPU profile during each attempt with
perf record -e cpu-clock:u -F 199 -p PID -- sleep 5. All 990 samples forActivateProbesand all 994 forActivateProbesTargetwere ind3d12core.dll. The profiles give module-level attribution for the sampled intervals.Follow-up with the legacy structurizer
I repeated the cold PSO step on the same head, RTX 5070 Ti, driver, and vkd3d-proton build, following the experiment reported by itsd-effex. I reused the exact DXIL files. The vkd3d-proton shader hashes matched across the two runs, and the cached DXIL SHA-256s stayed unchanged during the rerun. The configuration changed from
VKD3D_CONFIG=pipeline_library_logtoVKD3D_CONFIG=legacy_structurizer,pipeline_library_log. The other settings, cold PSO caches, and limits stayed the same. Initial legacy-structurizer measurementsActivateProbesActivateProbesTargetBoth legacy runs exited successfully and each reported one pipeline made, zero refused, and zero loaded from disk. The total is the XCL CLI time with DXIL already compiled. I also recorded user-space CPU samples across each complete legacy command with
perf record -e cpu-clock:u -F 199. NVIDIA'slibnvidia-gpucomp.soaccounted for 75.16% and 77.68% of the samples, respectively.d3d12core.dllaccounted for 14.05% and 11.40%. The default-mode profiles above covered five-second windows during the stalled calls.ActivateRays with #1321 applied on top of #1316
I ran the requested commit pair on Wine against the single
CS_ScreenProbes_ActivateRayscompute program from my Series 1.0.2.1 extraction. Both builds detected compute program15ec6daefb19a780and fell back from the compact backend because it needed 9,975 words and the limit was 8,192. The second build is a local merge of #1321 at0936337142a114668e29652163a62c6d255ff5d3into #1316 at6cefa5c342fe71a88cd64153d81e755683887fb3, with the conflict resolved as described by the author. Request and merge notes6cefa5c6cefa5c+0936337I measured HLSL size separately with a translation-only helper using the corresponding build's routed translator and the same shader options. The actual timed runs used
xcl shaders <isolated folder> --precompile --only cs --windows 4 --split 1, withXCL_COMPACT_CS=auto, one DXC worker, one PSO worker, and fresh DXIL caches per build. After the combined build produced DXIL, I ran the same command with--pipelines, kept that DXIL, and disabled the XCL, vkd3d-proton, and NVIDIA disk pipeline caches. The driver log confirms an empty pipeline cache. The 80, 90, and 100 s checkpoints in this separate PSO process were all about 3.00 GiB in Linux cgroupmemory.current.Same RTX 5070 Ti, driver 620.73.04, Ryzen 7 9700X, CachyOS
7.3.5-2-cachyos, Wine 11.22, vkd3d-protonec20719452e916b, and Windows DXC 1.9.2609.5 as above. This run covers the isolated shader. Windows private commit, full-title loading and execution of the retail shader remain unmeasured in this setup.Not tested
Native Windows, full title or shader dispatch, the non-compact form of the original two compact shaders, and default-structurizer completion beyond the process timeout.
Synthetic cross-check of the compact translator
I exercised
compact::translate_compactdirectly at the tested XCL commit5e312d5, using the BetterJdue’s synthetic generator at5ae62c5. The 668-case shader compiled to 655,944 B of DXIL with native DXC1.9.2609.5. Standalonedxil-spirv7c04863on the Ryzen 7 9700X reached a 45 s cap in default mode. Legacy converted the same DXIL in 0.97 s and passedspirv-val --target-env vulkan1.3.CFGNode::dominatesaccounted for 96.85% of 1,335 CPU samples in a separate default-mode profile, principally underinsert_phi_frontiers. This covers the compact translator and standalone conversion on synthetic input. Generator source XCL results and upstream reproducerAI use
Codex (GPT-6, exact variant unavailable) cross-built the PR, ran and profiled the commands, and drafted the report. Codex also generated the synthetic inputs and ran the standalone conversion tests. Codex also resolved the local merge and ran the isolated ActivateRays comparison.
@CowboyBingus on GitHub · 2026-11-24 16:47 UTC · original
@vakaobr thanks for the D3DMetal run (your report).
run_in_arena_or_skipis not onmain(b7aa9f3); it is added by #1060, which is open. So the three window tests intests_compact.rsstay as they are in this stack. In your run at5e312d5, all 16tests_compactGPU tests passed with #1329 merged on top, those three included (the wave64 one still skipped).AI use: Claude Code (Claude Opus 5.5) wrote this reply.
@CowboyBingus on GitHub · 2026-11-24 16:47 UTC · original
@oni-swr thanks for the RX 7800 XT numbers (your report). The two panics you hit in
gpu_compact_sample_big_csat5e312d5(tests_compact.rs:91on ActivateRays' refusal,tests_compact.rs:1163on the old form'sE_OUTOFMEMORY) are handled in the test since #1315's headd58677a, which #1316 contains:translate_compactreturns an error, such as ActivateRays' table limit, the test printsSKIPPED gpu_compact_sample_big_cs: compact form refused: …and returns (tests_compact.rs:1149-1153).translate's form fails with an error fromCreateComputePipelineState, the test prints that error and goes on with the compact form, which must still compile in DXC and run; it then printsSKIPPED gpu_compact_sample_big_cs: A/B comparison (translate's pipeline was not created)instead of comparing (tests_compact.rs:1167-1188).AI use: Claude Code (Claude Opus 5.5) wrote this reply.
@ettehn on GitHub · 2026-11-24 15:15 UTC · original · edited 2026-11-24 16:55 UTC
A short native Windows run can exercise
ActivateProbeson this head. On5e312d5(release, RTX 5070 Ti Laptop 12 GB, driver 621.24, DXC 1.8.2502.11,XCL_COMPACT_CS=auto, an existing XCL cache copied before launch), the compact backend logged code hashd122faa48eb0afdcat 7.431 s: 88,863 instructions, 723,453 B of HLSL. The resulting translation cache contains56c0cd3b82a00c6e_Compute_0_4_1_c.bin(shader-container hash). This establishes translation during the run; it does not establish when the title first bound that pipeline.We sampled the presented buffer every fourth frame. At 77.593 s, frame 1523 was opaque black at every one of the 518,400 sampled texels. XCL counted 1,526 presents in total, so the final two frames were outside our capture cadence. The last interval with a present ended at 78.088 s. The title faulted at
+0x23cf683at 108.605 s. At 90.801 s a different program,15ec6daefb19a780, fell back to the existing translator because its table needed 9,975 words (cap 8,192). We have no wait-to-shader link implicating that fallback.The control run was interrupted, so these observations cover
autoonly and provide no A/B timing claim. AI-assisted with OpenAI Codex (GPT-6.2 Astra).Offline PSO cache check on native Windows
Same release
5e312d5b3252d2a20a8a687bd4f2ef20eecfb877, RTX 5070 Ti Laptop 12 GB, driver 621.24, and DXC 1.8.2502.11. In two fresh processes I ranxcl shaders <single-record folder> --precompile --only cs --split 1 --windows 4 --pipelineswithXCL_COMPACT_CS=auto, one DXC worker, one pipeline worker, and identical preseeded compact translations forActivateProbes(56c0cd3b82a00c6e). Only the second XCL cache was seeded with the existing 893,274-byte PSO blob.One run per arm. NVIDIA’s internal cache was uncontrolled, and a separate compile was running in the background, so the timings are descriptive. This check covers offline PSO creation. In-title reuse and progression beyond the black frame remain unverified.
AI use for this update: OpenAI Codex (GPT-6.2 Sol) assisted with verification and reporting.
@Xahinn1 on GitHub · 2026-11-24 17:08 UTC · original
Tested PR #1316 on AMD RDNA4 (native Wave64) hardware:
Tested
32.0.32029.2010), AMD Ryzen 7 5700X, Windows 11 (10.0.26300)rustc 1.100.0 (0ef1bc386 2026-11-09), DXC1.9.2602.17(Windows SDK10.0.26100.0), debug buildee904f1cargo test --workspace gpu_compact -- --nocapture: 16 passed, 0 failed, 0 ignored (all native Wave64 A/B cases ran with identical result bytes; 0 skipped)cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4: 773 passed, 0 failed, 41 ignored (lib tests: 729 passed, 0 failed, 21 ignored)SKIPPED):gpu_compact_native_wave64_form,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwareNot tested
XCL_SAMPLE_*tests,scripts/smoke.ps1AI use
@ClosetPie107 on GitHub · 2026-11-24 16:19 UTC · original · edited 2026-11-24 17:16 UTC
Linux / RDNA4 (RADV): the compact
ActivateProbesandActivateProbesTargetbuild and their blobs work, in 252 s and 176 s at ~3 GB. RADV itself takes 19.5 s and 10.4 s of that; the rest is vkd3d-proton's DXIL → SPIR-V step (dxil-spirv). This is the RADV row next to @oni-swr's AMD driver numbers above (439 s / 342 s, 19–23 GB on an RX 7800 XT) and @Pipodi's RTX 4090 ones (14.3 s / 11.4 s).Edited: @itsd-effex had already found the same hotspot on #1269 an hour before this comment, with a call graph and on NVIDIA (https://github.com/ivall/xcl/issues/1269#issuecomment-7135900910:
dominatescalled frominsert_phi_frontiers;VKD3D_CONFIG=legacy_structurizerbuilds the same pipelines 6–8× faster). I had missed it. What this comment adds is the RADV side. Two more measurements are at the end: thelegacy_structurizeroption does nothing in vkd3d-proton v3.1, and dxil-spirv#372 is not needed on RADV for XCL's atomics tests.Tested
53aac418(#775); DXC 1.9.2609.5.6cefa5c(with #1315) onmain930e8b4, withb8b1f49reverted (#1307; on RADV it also crashes dxil-spirv in a test, #1425). Release, cross-built forx86_64-pc-windows-gnu;XCL_COMPACT_CSunset (auto). Not the PR's exact head because of the revert. The current headee904f1differs from6cefa5conly intests_compact.rs, so the runtime code measured here is the same.xcl rpf shaders.rpf --extract <name>), an emptyXCL_DXIL_CACHE, Mesa's cache in a new empty folder and vkd3d-proton's off (VKD3D_SHADER_CACHE_PATH=0). Thenxcl shaders <folder> --precompile --only cs(DXC),--pipelines(cold build) and--pipelinesagain (from the blob). Each step in its own systemd scope capped at 22 GB; peak is that cgroup'smemory.peak(page cache included), no swap used. Two rounds, each with fresh caches:--pipelines(round 1 / 2)d122faa48eb0afdc)79dc576c52b3dc23)The HLSL matches @oni-swr's byte for byte and the DXIL within 12 B, so the rows compare.
Where the time goes.
fossilize_replay(SPIR-V straight to RADV,MESA_SHADER_CACHE_DISABLE=true): ActivateProbes 19.5 s / 2.7 GB, ActivateProbesTarget 10.4 s / 2.3 GB. So ~92–94 % of a cold build happens before RADV.perf record -F 199 -e cpu-clock:uover a third cold build of ActivateProbesTarget (186.8 s with perf): 92.8 % ind3d12core.dll(vkd3d-proton, dxil-spirv linked in), 5.1 % inlibvulkan_radeon.so.dxil_spv::CFGNode::dominates(node.cpp), three instructions of its loop that walks the immediate-dominator chain one node at a time. The next functions are far behind:CFGStructurizer::insert_phi_frontiersand its lambda at 0.7 % together (cfg_structurizer_new.cpp),phi_frontiers_convergeandreaches_direct_helperbelow 0.1 %. Soinsert_phi_frontiersis the likely caller (PHI placement on a CFG with many blocks and deep dominator chains), but without a call graph that is a reading of the flat profile, not a measured edge. Symbols from the DLL's own symbol table (my vkd3d-proton v3.1 build, dxil-spirv53aac418).On this stack the compact form's cost is in dxil-spirv, not in RADV, as @itsd-effex found on NVIDIA. Elsewhere in this title it is the other way round: some ~1 MB compute programs of the normal form spend ~60 s and 13–16 GB in RADV itself (#1035), and @lucsoft saw RADV take ~16 GB on one of the screen-probe programs in its old form in the title (#505).
What it means with #1278 [not run, from the code]: at 0.77–0.87 MB of DXIL the compact forms are under #1278's 4 MB line, so they go back into
BIG_COMPILES(from 256 KB, one at a time). On RADV each would hold that slot for 3 – 4 minutes, and on @oni-swr's AMD driver numbers for 6 – 7, with the title's other 0.3 – 1 MB programs behind it. On NVIDIA (~14 s) this does not matter. I have not run the title with these PRs, so I don't know how it plays out in a world load.Not tested: a title run; ActivateRays (the compact form refuses it, as @oni-swr showed; I did not run its fallback);
XCL_COMPACT_CS=0/1; the PR's exact head (b8b1f49reverted); other Mesa or dxil-spirv versions; the full test suite on this tree.Edited – two more measurements, same machine and tree:
VKD3D_CONFIG=legacy_structurizerhas no effect in vkd3d-proton v3.1: with it (VKD3D_CONFIG=ignore_shared_fence,legacy_structurizer, checked in the process's environment), the cold ActivateProbes build took 253.9 s, the same as without it. The commit that passes the option to dxil-spirv (3f6a2c71, "vkd3d-shader: Add a chicken bit to use the legacy structurizer") is on vkd3d-proton's master, not in v3.1, which ignores the unknown option silently. So on Linux @itsd-effex's workaround needs a vkd3d-proton built from master (they usedec207194). Note that dxil-spirv#374 (open) removes the legacy structurizer.RWByteAddressBufferat rootu2–u5,Interlocked*64). Without the fix (dxil-spirv53aac418),cargo test --release -p xcl --lib atomic -- --test-threads=1on this tree under Wine: 12 passed, 0 failed, 0 ignored, no SKIPPED (the filter also matches a few CPU-only tests),gpu_more_atomics_sub_dword_scratch_valuincluded. That test hangs NVIDIA without #372 (@BlestTerror on #175, @Filip722 on #775). So on RADV the bad offset happens to do no harm in these tests. Not checked on the title's programs.AI use: T3 Code (Claude Opus 5.5) built the tree, ran the measurements, the replays and the profile, and wrote this comment. The runs are real, on the hardware above, and I checked the report before posting.
@CowboyBingus on GitHub · 2026-11-24 17:35 UTC · original
Rebased onto
main9e3831e(after #680) on top of #1315's new head; the head is nowc3d119c. This commit applied without conflicts. Suite, smoke and description are updated for the new head.AI use: Claude Code (Claude Opus 5.5) wrote this comment.
@CowboyBingus on GitHub · 2026-11-24 17:35 UTC · original
@IvovdBruggen thanks for the review note (your comment). The DXC case is in #1316's head
c3d119c(rebased ontomain9e3831e, after #680):compile_console_shader(pso.rs) marks a failure ofdxc::compile_cachedon HLSL that is the compact form.console_to_dxil_inthen compiles the program in the normal form (CompactCs::Never), or takes the normal form's translated-cache entry when that is on disk, and keeps the result under that normal entry, never the_cone. Before that it logs one WARN line:[SHADER] DXC refused the compact form: … – compiled in the normal form.hle/d3d12x/real.rs, where the compute PSO is created (translated_compute_pso). Onmainsince #680,with_switch_fallbackthere builds a pipeline again in the switch form when the driver runs out of memory on it with heap windows; a routed program is routed to the compact form again in that retry.a_refused_compact_form_is_compiled_in_the_normal_form(pso.rs) gives the retry an injected refusal. It checks that the normal form's result is returned, that the normal entry exists and the_centry does not, and that other errors and results are passed through without a retry.cargo test --workspace --no-fail-fast -- --test-threads=4on1c6deba(RTX 5070 Ti; the same tree asc3d119c, which differs only in its commit message and commit time): 798 passed, 1 failed, 41 ignored. The failure isxmem_virtual_query_marks_cpu_readable_memory, which fails the same way onmain930e8b4.AI use: Claude Code (Claude Opus 5.5) wrote the change and this reply.
@Anon64 on GitHub · 2026-11-24 18:02 UTC · original
@CowboyBingus here is the rerun you asked for. Same setup as my earlier report: RTX 3060 12 GB (581.80), Windows 11 26200, 64 GB RAM, release,
XCL_COMPACT_CSunset,XCL_NETWORK=0, A pressed every 4 s from 20 s, 200 s, preload on (default). The two runs were back to back on the same caches. Since my first report, this machine'sused-pipelines.txthas grown to 531 lines from other world runs, so I reran6cefa5calone as well.6cefa5c+ #13210936337: a local merge. It conflicted only inmod.rsat the block you named, and I resolved it your way: this PR's side, pluslet program = code;as the first line oftranslate. It builds.6cefa5calone.6cefa5calone6cefa5c+ #1321smoke.ps1)0xc0000409at ~70 s, no XCL error line, still in the menus+0x23cf683) at 108.9 smainends on this card (102–113 s in today's runs).0xc0000409and nothing in XCL's log. I have not checked which compile grew it. In the merged run,d122faa48eb0afdctook the compact form at 5.9 s, and15ec6daefb19a780fell back at 5.8 s, as before.One run each.
Written with Claude Code (Claude Opus 5.5) from runs on this machine.
@CowboyBingus on GitHub · 2026-11-24 18:04 UTC · original
@Anon64 thanks for the rerun (your report).
15ec6daefb19a780(ActivateRays) fell back totranslate. That is the formmainuses for every compute program, this one included.CS_ScreenProbes_ActivateRaysonmain, and 13.8 MB with #1321. In @dervoxx's measurement (DXC 1.8.2502.11, 6 GiB process commit cap), the 154,575,599 B of HLSL from930e8b4ran out of memory at the cap and made no DXIL. With #1321 merged, your peak was 32.6 GB.Two requests, if you have the time:
main(9e3831e, or themaincommit you compare against) with the same 531-lineused-pipelines.txtpreload list, and post the process commit at 58 / 70 s? That shows whether the 100 GB comes with #1316 or happens onmaintoo.[SHADER] compact backendlines from the6cefa5c-alone run, to see which programs took the compact form there.AI use: Claude Code (Claude Opus 5.5) wrote this reply.
@Anon64 on GitHub · 2026-11-24 18:13 UTC · original
@CowboyBingus both answers:
main9e3831e, same setup and preload list: a 200 s run right after the two above. It blows up the same way, so the 100 GB is not from this PR.main9e3831e6cefa5calone6cefa5c+ #13210xc0000409at ~75 s, nothing in XCL's log0xc0000409at ~70 sOne caveat: the list had grown from 531 to 598 lines by the end of these runs, because each run records what it used, so
main's run started with a slightly longer list than the first two. In the merged run, #1321 alone keeps commit flat with the same preload on.[SHADER] compact backendlines in the6cefa5c-alone run: there is only one.15ec6daefb19a780fell back at 5.2 s (9 975-word table, at most 8 192).d122faa48eb0afdchas no line: that run ended at ~70 s, before the title reached it.Written with Claude Code (Claude Opus 5.5) from runs on this machine.
@CowboyBingus on GitHub · 2026-11-24 18:14 UTC · original
@Anon64 thanks for both answers (your report). In your runs with the same preload list (531 lines at the start, 598 by the end of the runs):
main9e3831e: 96.8 / 105.0 GB of process commit at 58 / 70 s, peak 108.8 GB,0xc0000409at ~75 s.6cefa5calone: 100.5 / 108.7 GB at 58 / 70 s,0xc0000409at ~70 s.AI use: Claude Code (Claude Opus 5.5) wrote this reply.
@ezamelczyk on GitHub · 2026-11-24 18:16 UTC · original
RDNA4 / RADV under vkd3d-proton: #1316 gets
ActivateProbes(56c0cd3b82a00c6e) down to 0.8 MB of DXIL, but with dxil-spirv's default structurizer it still does not build in 300 s. With the legacy structurizer it builds in about 75 s. Measurements only; no code from me here.Setup
subprojects/dxil-spirvmoved to53aac418(the #611 fix),-Db_ndebug=true; DXVK from GE-Proton; DXC 1.9.2609.5x86_64-pc-windows-msvc, release. #1316 atc3d119c(onmain47efa2e);main47efa2eand #1426bc93a3afor comparisonActivateProbesvariants extracted from the retail 1.0.2.1shaders.rpf, run throughxcl shaders <folder> --precompile [--pipelines], 4 memory windows, native wave64. EmptyXCL_DXIL_CACHEper backend,VKD3D_SHADER_CACHE_PATH=0,MESA_SHADER_CACHE_DISABLE=true,XCL_PSO_DISK_CACHE=0,XCL_PIPELINE_THREADS=1, a 300 s cap per stepResults (both variants together)
CreateComputePipelineState, bothmain(HLSL)XCL_DIRECT_DXIL=1)auto)XCL_PIPELINE_THREADSdoes not help a single program.libs/vkd3d-shader/dxil.c(an env var that addsDXIL_SPV_OPTION_LEGACY_STRUCTURIZER), so that row needs a patched vkd3d-proton.Caveat on the legacy structurizer: in the game, the legacy structurizer together with the pipeline preload workers ended about half of the runs within 3 s (6 runs). The crash is
err:vulkan:vkCreateComputePipelines Exception 0xc0000005 in Unix call, inside RADV, thenprocess ends with status 0x3. With either the legacy structurizer orXCL_PSO_PRELOAD=0alone the same runs were clean. I did not find which pipeline triggers it. dxil-spirv's header marks the option as deprecated, so it is a workaround to measure with, not one to recommend.In the game (retail 1.0.2.1, saved setup,
XCL_COHERENT_MB=512, scripted presses): with #1316 + #1288 merged locally, the legacy structurizer,XCL_PSO_PRELOAD=0, and bothActivateProbespipelines built once beforehand withxcl shaders --precompile --pipelines, the title loaded both from the driver blobs in 16 and 33 ms. It got past the point where every earlier run on this machine ended (+0x23cf683about 30 s after world loading starts). The next stop is the compact program15ec6daefb19a780at 134 s ("19949 blocks of 11909 texts need a 9975-word table"). The process was then ended by the kernel's OOM killer at 181 s at 22.7 GB anon RSS. I have not confirmed which shader that is (ActivateRayswould fit #1448's description), and I have not tried #1448.Not tested
AI use: Claude Code (Claude Opus 5.5) set up the runs on this machine, wrote the local vkd3d-proton switch, collected the numbers and wrote this report. No game data or game-derived DXIL is attached.
@CowboyBingus on GitHub · 2026-11-24 18:21 UTC · original
@ezamelczyk thanks for the RADV numbers (your report). From your table, for the two
ActivateProbesvariants on the RX 9070 XT:main(47efa2e): 23.28 / 23.36 MB of DXIL;CreateComputePipelineStateof both not done at 300 s.I added a line with this to #1316's Not tested. In your title run (with #1288, the legacy structurizer and
XCL_PSO_PRELOAD=0), the run got past+0x23cf683, where your earlier runs ended, and next stopped at15ec6daefb19a780at 134 s, where the compact form refused it ("19949 blocks of 11909 texts need a 9975-word table"). In IvyNotFound's table that code hash isActivateRays, the program #1448 moves to the compact form.AI use: Claude Code (Claude Opus 5.5) wrote this reply.
@Gabriel260s on GitHub · 2026-11-24 18:23 UTC · original
RX 9060 XT / Windows follow-up: descriptor-heap windows did not avoid the 8 GiB private-memory threshold for the compact
ActivateProbesPSO.Same 88,863-instruction program discussed above, tested offline on the fetched PR snapshot
c3d119c41601bd854fb22b96949e550a76f6de13(base9e3831e) with local logging immediately before and afterCreateComputePipelineState. GPU: RX 9060 XT, driver32.0.32015.7029. Windows 11 25H226200.9711, Rust 1.98.1 MSVC release, DXC1.9.2602.17.XCL_HEAP_WINDOWS=0)XCL_HEAP_WINDOWS=1)Each trial used a fresh process,
XCL_COMPACT_CS=auto, one DXC worker and one PSO worker, and DXIL prepared before the PSO pass. XCL's PSO disk cache was disabled. AMD/OS caches were left untouched. Trial order was switch/heap, then heap/switch. Time is from PSO-pass launch to harness stop, with private memory sampled approximately every 500 ms. The trace enteredCreateComputePipelineStatein all four runs. The harness stopped the process after crossing 8 GiB and before the call returned in every run.The heap form produced 9.9% smaller DXIL. These observations give bounds under an 8 GiB process budget. They do not establish eventual completion time, an out-of-memory return from the driver, shader output equivalence, or gameplay. No title run was used.
AI use: Codex added local diagnostic logging, ran both pairs and checked the results. Claude Code and Gemini reviewed the earlier measurement design and interpretation.
@MiharaxD on GitHub · 2026-11-24 18:59 UTC · original
Reposted: the earlier copy of this comment was deleted.
Test report for #1315 + #1316 on a 32-lane NVIDIA card with 8 GB, head
5e312d5.Tested
cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4(debug) on5e312d5: 773 passed, 0 failed, 41 ignored (lib tests 729 / 0 / 21). Alltests_compactA/B tests pass, includinggpu_compact_programs_with_four_windowsandgpu_compact_compute_dispatch.gpu_compact_sample_big_csran withoutXCL_SAMPLE_BIG_CS, so it did nothing.gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,gpu_compact_native_wave64_form.hle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory, which fails in your report, passes here.Regression run
scripts/smoke.ps1 -Game <game folder> -Seconds 60(release builds, menus, no input) onmain930e8b4and this PR's head5e312d5.The two
xcl-smokeblocks are left out, because theirtitle:line named the game's folder. Both runs: exit 0x0, 0 device removals, 0 crashes, 60 60 60 presents per 2 s at the end; frames shown 1551 / 1575, peak commit 15988 MB / 16046 MB (main / this PR).World load (story), by hand, release builds
main930e8b4and the earlier head490ccbbboth stop with the known0xc0000005write at 0x0 ingame_scarlett_master.exe+0x23cf683(#675, #846, #534), at 124 s and 138 s, with 29.6 GB and 28.9 GB committed.compact backendline in the PR's log, soActivateProbes/ActivateRayswere not compiled.Not tested
5e312d5(only on490ccbb, which differs from it by 9 lines ingpu/recomp/mod.rs).AI use: Claude Code (Claude Opus 5.5) ran the builds, tests and title runs and wrote this report; I checked it before posting.
@CowboyBingus on GitHub · 2026-11-24 19:16 UTC · original
Rebased onto
mainc160d86(after #1426) on top of #1315's new head; the head is now5749171. The conflicts were ingpu/recomp/pso.rs, where #1426'sXCL_DIRECT_DXILrouting and this PR'sXCL_COMPACT_CSrouting now sit side by side: a compute programXCL_COMPACT_CSroutes to the compact form goes to the compact form first, and every other compute program goes to the direct translator as before (goes_direct, unit testthe_compact_routing_goes_before_direct_dxil; details in the description). Suite, smoke and description are updated for the new head.AI use: Claude Code (Claude Opus 5.5) wrote this comment.
@madaraXor on GitHub · 2026-11-24 19:40 UTC · original
AMD RDNA2 (Windows driver) numbers for the three giant programs, in the title and in
xcl shaders --precompile --pipelinesSetup: AMD Radeon RX 6700 XT 12 GB (RDNA2, native wave64), driver 32.0.21045.29003, Ryzen 5 5600X, 16 GB RAM + a 32–96 GB page file, Windows 10 Pro 22H2, DXC 1.8.2502.11, Rust 1.90.0, release. Head
5e312d5b3(with #1315711897240) merged intomain930e8b4+ other PRs (#684, #615, #495, #1291, #1288, #1182, #1248, later #1195 and #757–#759), retail title 1.0.2.1.d122faa48eb0afdc/56c0cd3b82a00c6e): compact form 716 691 B HLSL, DXC (default level) ~8 s, driverCreateComputePipelineState101 s (1 275 532 B DXIL); the title's commit went from ~28 GB to a ~49 GB peak during it (one other compile alongside) and back. Afterwards it comes from the driver's cache in 7–24 ms.15ec6daefb19a780/95cc13288a27a96e): refused by the 8 192-word table (9 975 words) and translated as before; within two minutes of that the process passed 89 GB of commit (DXC or the driver – I did not tell them apart) and my guard stopped it.MAX_TABLE_WORDSto 12 288. The compact HLSL is then 5 254 267 B; DXC at-O1had not finished after 18 min; at-O0it took ~3 min for 11 562 148 B of DXIL. The driver had not built that after 53 min in--precompile --pipelines, at ~100 GB of system commit, when I stopped it. So on this driver the compact form does not save ActivateRays.79dc576c52b3dc23/958400d2caf07244, which I take to be the same program): compact 659 094 B HLSL, 774 257 B DXIL. A driver compile that ran for over 20 min on one core in the title (memory flat) was most likely this one; I did not confirm which pipeline it was.Not tested: NVIDIA / RDNA3-4 drivers with these sizes; whether a newer AMD driver branch builds these faster (this card's branch is at 32.0.21045).
AI use: Claude Code, Claude Opus 5.5 ran the builds and runs on my PC and wrote this report. Counts, times and sizes only; the local changes named above are not in this PR.
@Frtuchinno on GitHub · 2026-11-24 15:50 UTC · original · edited 2026-11-24 19:41 UTC
Test report for #1316 on AMD RDNA3 (native wave64), Windows: head
5749171, 882 passed, 0 failed, 42 ignoredEdited: rerun on the current head
5749171(rebased ontomainc160d86). Earlier versions of this comment were on5e312d5,ee904f1,57377fb(on930e8b4) andc3d119c(on9e3831e), with no failures.This covers the "Not tested: AMD, wave64 hardware" line of #1315 / #1316. On this adapter
gpu_compact_native_wave64_formruns instead of being skipped, and every compact GPU test ran in the native wave64 form.Tested
5749171(#1316, contains #1315's commits), against its basemainc160d86stable-x86_64-pc-windows-msvc, DXC 1.9.2602.17 (Windows SDK 10.0.26100.0), debugauto, high-performance order), which is the RX 7800 XT; the other adapter is the CPU's integrated GPUcargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4mainc160d86: 858 passed, 0 failed, 42 ignored (lib tests 809 / 0 / 22)5749171: 882 passed, 0 failed, 42 ignored (lib tests 833 / 0 / 22)heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)c3d119c799 / 0 / 41 (on9e3831e, 776 / 0 / 41); on930e8b4,5e312d5andee904f1773 / 0 / 41 and57377fb774 / 0 / 41cargo test -p xcl --lib compact -- --test-threads=1 --nocaptureon5749171: 24 passed, 0 failed. Output lines of note:gpu_compact_native_wave64_form ... ok(execz nest, backward loops, buffer_load_format_x: both backends agree)memory windows (wave64 native, 2 windows): 263172 result bytes identicalexecz nest (wave64 native, unstructured, 4 windows): 394244 result bytes identicalNot tested
gpu_compact_sample_big_cs:XCL_SAMPLE_BIG_CSnot set, so it returned without runningxcl shaderspass, no title run, no smoke run, no driver compile times for the large programsAI use
@Pipodi on GitHub · 2026-11-24 19:58 UTC · original
@CowboyBingus a heads-up: #1524 was just merged (
main85e3826), and #1316 now conflicts withmainincrates/xcl/src/gpu/recomp/pso.rs.console_translationpub(crate), and #1316 changes its signature (theform: CompactCsargument, and(Translation, &str, bool)returned).crates/xcl/src/shaders.rs:945(--export-hlsl/--measure-pso) with the old signature. That caller needs the form too, or--measure-psowill time the non-compact pipeline of a program the runtime would build in the compact form.#1448 and #1692 are stacked on #1316, so I'll rebase both once your new head is up.
AI use: Claude Code (Claude Opus 5.5) found the conflict and wrote this comment.
@thaqiart139-alt on GitHub · 2026-11-24 15:41 UTC · original · edited 2026-11-24 20:00 UTC
Edited: rerun on the current head
5749171(rebased ontomainc160d86, on top of #1315'sa45ac0c). The first runs were on5e312d5and6cefa5c, againstmain930e8b4, with the same result: all pass on both GPUs.Test report for this PR's head
5749171(the stack with #1315) on AMD RDNA2 with native 64-lane waves, and on a 32-lane NVIDIA card.Tested
XCL_ADAPTER=radeon/nvidia; the SKIPPED lists below show which GPU each run used.cargo test --workspace -- --test-threads=4, this PR against its base:mainc160d865749171XCL_COMPACT_CS=1XCL_COMPACT_CS=1the compact backend logged two compute programs more than with the default (2 and 22 instructions), and the suite still passed. That is little extra coverage: most of the suite's compute programs do not go throughconsole_translation.c160d86exceptgpu_compact_native_wave64_form, which is new in the stack:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwareandgpu_compact_native_wave64_form(no wave64);heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).gpu::dxil::graphics::tests::emitted_ms_primitive_attribute_reaches_the_pixel_shader,gpu::dxil::graphics::tests::emitted_ms_ps_draw_a_triangle,gpu_geometry_mode_es_gs_stripandgpu_mesh_mode_two_passes(no mesh shaders);heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).Not tested
AI use
@einfachama on GitHub · 2026-11-24 20:00 UTC · original · edited 2026-11-24 20:01 UTC
Test report for #1316 with heap windows (
XCL_HEAP_WINDOWS=1) on my retail title, on an 8 GB NVIDIA card. It covers two of the "Not tested" items: the compact backend with #680's heap windows, and a title run that reaches56c0cd3b82a00c6e.56c0cd3b82a00c6e: built in about 40 s, then loaded from its blob in later runs.15ec6daefb19a780, which the compact form refuses, and for a chain of ~1 MB programs.Setup
mainc160d86+ #899f3b7dd6+ one local log line (what a bind waits for, logged at the start of the wait; not part of any PR) + #12889cdae10+ #1315 / #1316 as of30a96a3+ #13210936337.prepare()in the recompiler'stranslate. I kept #1315's side and put #1321'slet program = code;at the top of the newtranslate. #1321's size check afteremit_structuredmerged unchanged. #1321's net change is its own +10 / +32.5749171has the same tree as30a96a3(commit message only). #1321's69a892cis a rebase ontoc160d86with the same changed lines as0936337.XCL_HEAP_WINDOWS=1,XCL_COMPACT_CSunset (auto),XCL_NETWORK=0,XCL_RUN_SECONDS=420,XCL_THREAD_DUMP_AT=100,130,160,200,260,340, A pressed at 26 s and 30 s; the world load starts by itself at ~66 s.cargo test -p xcl --lib compact: 24 passed (SKIPPEDgpu_compact_native_wave64_form: no wave64);--lib memory_windows: 7 passed (gpu_memory_windows_from_the_heap,gpu_compact_memory_windows,gpu_compact_memory_windows_loopamong them);heap_window2,raw_window_view1,window_views1,oversized_structured1,pso_async8,big_compile2;--test gpu_compute_e2e heap: SKIPPED without heap windows, passed withXCL_HEAP_WINDOWS=1.Compact form with heap windows: no problem seen
the driver ran out of memory on a pipeline with heap windows(switch-form fallbacks);DXC refused the compact form;56c0cd3b82a00c6e([SHADER] compact backend, compute program d122faa48eb0afdc: 88863 instructions, 718281 B HLSL):983404 B DXIL, 23913 ms)… 23872 ms, 849 KB)main9e3831e+ #899 + the same local line + #1288,XCL_HEAP_WINDOWS=1;The title run
+0x23cf683)15ec6daefb19a780. The compact form refuses it:[SHADER] compact backend, compute program 15ec6daefb19a780: compact form: 19949 blocks of 11909 texts need a 9975-word table (at most 8192) – translated as before. With #1321 it is then translated in thepc-block form, 13 297 372 B of DXIL. XCL's translated cache keeps that DXIL under95cc13288a27a96e, written when its DXC compile ended.dxc::compileat the 100, 130 and 160 s dumps), then in the NVIDIA compiler at 200, 260 and 340 s. Not finished at 420 s, 244 s after DXC.Not tested
XCL_COMPACT_CS=0/1, and the switch form (XCL_HEAP_WINDOWSunset) on this stack.958400d2caf07244, which another report here takes to be the third program of this family: the title made its pipeline at ~5 s in every run, but it was not translated or built in any of them.AI use
@CowboyBingus on GitHub · 2026-11-24 20:07 UTC · original
@Pipodi thanks for the heads-up (your comment). Rebased onto
main85e3826(after #1524): #1315 is nowa940184(no conflicts) and #1316f207df1. The conflict was ingpu/recomp/pso.rs:console_translationstayspub(crate)with this PR'sform: CompactCsargument, and #1524's two callers (console_hlslfor--export-hlsl, and--measure-psoinshaders.rs) passCompactCs::get(). Suite, smoke and description are updated for the new heads.AI use: Claude Code (Claude Opus 5.5) wrote this comment.
@isaacwingate on GitHub · 2026-11-24 21:07 UTC · original
Test report for
f207df1(this PR's head, with #1315 under it) on an RTX 5080, with the retail title of #505.Setup
main4178e88+ this PR + #1321 (69a892c) + #889 + #1798. One conflict, between #1315'sprepare()and #1321 at the start oftranslate: I keptprepare()as it is here and added #1321'slet program = code;at the top oftranslate.Tests
cargo test -p xcl --lib gpu::recomp -- --test-threads=4: 222 passed, 0 failed, 18 ignored;gpu_compact_matches_translatepasses on 32-lane waves. SKIPPED:gpu_compact_native_wave64_form,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64).Title run (one run,
XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=600, A throughXCL_PRESS_ATevery 4 s from 20 to 100 s,XCL_COMPACT_CSunset)autorouted one compute program:d122faa48eb0afdc, 88,863 instructions, 723,786 B of HLSL. It refused one more:15ec6daefb19a780("19949 blocks of 11909 texts need a 9975-word table (at most 8192) – translated as before").auto.So on this title and card,
autodoes not reach the programs that hold up the world load here. WhetherXCL_COMPACT_CS=1helps those I did not test (the description says it makes driver compiles much slower).Not tested
XCL_COMPACT_CS=1; a warm cache; more than one run; without #1321 in the tree; AMD.AI use
@Alm0stSurely on GitHub · 2026-11-24 21:08 UTC · original
Linux/Proton follow-up on the compact
ActivateProbespipeline (56c0cd3b82a00c6e). On an RTX 5080, the title successfully created this PSO in 87.390 s on its first build and 10 ms on the warm replay. The warm run still faded to black.f207df1b23f9with #1315, vkd3d-proton4522cc1a8b13, dxil-spirv53aac41815f8with the dominance patch from #1269. Four memory windows, split wave64,XCL_COMPACT_CS=auto,XCL_DIRECT_DXIL=0. Same 45 preload keys and saved setup in both runs.15ec6daefb19a780) had fallen back from compact translation because it needed 9,975 table words against the 8,192 limit. We have not attributed the OOM to that program.This confirms that this particular PSO can be ready before the fade on Linux/NVIDIA while presentation still stops. One run per configuration.
AI assistance: Codex (GPT-6.2 Astra) helped run the measurements, check the logs and draft this report.
@CowboyBingus on GitHub · 2026-11-24 21:14 UTC · original
@isaacwingate thanks for the RTX 5080 run (your report).
autotakes a compute program only whencompact::compact_wantedaccepts it: at least 20,000 instructions (COMPACT_MIN_INSTRUCTIONS), with the distinct blocks (equal code, branch targets aside) holding under 30 % of them.XCL_COMPACT_CS=1routes every compute program to the compact form.XCL_COMPACT_CS=0and=1, two runs each, one build per process. They have 2,307 to 16,414 instructions, soautodoes not take them. With=1the driver build took longer for 8 of the 13 and less for 5:6e3fd903765f4376: 44.2 / 43.6 s normal, 121.7 / 114.1 s compact;1d6a161c9bb69ab0: 4.5 / 6.3 s normal, 12.1 / 20.1 s compact;1ada490879c33c0e: 11.1 / 8.2 s normal, 1.6 / 2.1 s compact;Their normal-form DXIL is 196 KB to 1.08 MB, so this does not show whether your 1.0 – 1.36 MB programs behave the same.
AI use: Claude Code (Claude Opus 5.5) wrote this reply.
@JorgeMJM on GitHub · 2026-11-24 20:57 UTC · original · edited 2026-11-24 21:22 UTC
Test report on an 8 GB laptop card.
Tested
f207df1(this PR's head), clean. RTX 3070 Laptop 8 GB (32-lane waves), NVIDIA 621.40, Ryzen 7 5800H, 28 GB RAM, Windows 11 Home 26300, rustc 1.100.0, debug.cargo test --workspace -- --test-threads=4: 899 passed, 0 failed, 42 ignored. SKIPPED:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,gpu_compact_native_wave64_form(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),pso_measurement_compiles_an_exact_synthetic_record(cannot disable the driver cache).XCL_DXIL_CACHE,XCL_PSO_DISK_CACHE=0,CreateComputePipelineStatetimed by a local patch (release build of this head + that patch):mainHLSL path (b7aa9f3),-O1/-O0mainc160d86,XCL_HEAP_WINDOWS=1/XCL_DIRECT_DXIL=1XCL_COMPACT_CS=1XCL_COMPACT_CSunset (auto) the same program is routed to the compact form too:compact backend, compute program d122faa48eb0afdc: 88863 instructions, 723786 B HLSL, 1.0 MB of DXIL, DXC 24 s (with the test suite running alongside).Not tested
AI use: Claude Code (Claude Opus 5.5) ran the measurements and the suite on my machine and drafted this.
Title runs (edit): the retail title for 300 s with
scripts/smoke.ps1, release, one run each, same machine. On both the intro video plays and the screen is then black: presents stop at 104 s with the pipeline queue not draining (compiling shaders: 0 running, ~150–430 done, ~57 000 queued), the stall @brainhay5 describes in #1269, so the world is not reached on either and nothing past that point is covered.main:This PR:
mainends in the title's watchdog write (game_scarlett_master.exe+0x23cf683, write at 0x0) at 134 s; this PR's run reaches 300 s without it. One run each, and a 150 s run of this head withXCL_COMPACT_CS=0did not crash either, so I do not attribute the difference to the compact form. It is most likely #1288 (the title's stall check does not count a bind's wait for a pipeline): it is in this PR's base and not inc160d86.@vakaobr on GitHub · 2026-11-24 16:20 UTC · original · edited 2026-11-24 21:29 UTC
Test report from macOS (CrossOver + D3DMetal), head
f207df1onmain85e3826, withXCL_COMPACT_CS=1. (Updated from my run of5e312d5on930e8b4; that one and the ones in between gave the same picture.)Tested
x86_64-pc-windows-gnu, debug, DXC 1.9.2609. Everygpu::recomplib test in its own process (--exact, 90 s cap), onmainand on this head.main85e3826: 160 passed, 25 failed, 8 timed out, 18 ignored, 2 skipped (no wave64), this host's known failures (f64, 64-bit atomics, UMA, the draw hangs). This head: 180 passed, 28 failed, 8 timed out, 18 ignored, 3 skipped. Every test that exists onmaingives the same result here, so nothing regresses with the compact backend on.gpu_compact_native_wave64_formskipped (no wave64), and 3 failed:gpu_compact_memory_windows,gpu_compact_memory_windows_loopandgpu_compact_programs_with_four_windows, all attests_compact.rs:952withtranslate: OpenExistingHeapFromAddress: Not implemented. (0x80004001). D3DMetal has no heaps over process memory, sorun_in_arenacan't open the windows. It's the host, not the compact form.ac4b997, the unified memory copy path, whose test runner uploads and reads back the arena whenOpenExistingHeapFromAddressreturns E_NOTIMPL) cherry-picked onto this head without conflicts, all 16tests_compactGPU tests pass on this Mac, those three included (the wave64 one still skips).If this lands before #1329, those three would want the same narrow skip as the other arena tests on such a host (
run_in_arena_or_skipin #1060). After #1329 they run as they are.Not tested
964f5ed: a rebase onto266b845plusgpu_compact_against_the_pc_block_fallback, not run here.AI use: Claude Code, Claude Opus 5.5 ran the builds and tests on this machine and wrote this report.
@Pipodi on GitHub · 2026-11-25 00:05 UTC · original
@CowboyBingus heads-up: since
mainmerged #1836 (80f4819), this PR's head964f5edno longer merges intomain.git merge-treeshows two conflicts, both incrates/xcl/src/gpu/recomp/pso.rs:console_to_dxil_in's disk cache: #1836 callscached_shader(shader_cache(), …)with onecompile_one, where this PR adds the compact/normal pair withnormal_after_refusal.if dxc::defer() { return Err("DXIL not compiled yet") }beforedirect_compute, where this PR hasgoes_direct(…, compact_routed)/direct_first.Both need a decision on how the compact routing and #1836's deferral combine, so I haven't tried to resolve them. #1448 and #1692 are stacked on this PR, so I've put them back to draft until it's rebased, and I'll rebase them onto your new head then.
AI use: Claude Code with Claude Opus 5.5.
@Parakeet-Wheat on GitHub · 2026-11-25 00:30 UTC · original
A/B on a desktop 8 GB card, with this PR merged onto
main95ae589(after #1321 and the direct-translator commits, before #1836). No conflicts there.610.88, 32-lane waves), Ryzen 5 5600X, 32 GB RAM, Windows 11 26300, Rust 1.95.0, DXC 1.8.2502, retail 1.0.2.1, release.XCL_NETWORK=0,XCL_RUN_SECONDS=420,XCL_COMPACT_CSunset. A pressed a few times at the start screen, no other input. Warm DXIL cache, this PR run first.56c0cd3b82a00c6e: with this PR it is routed to the compact form and comes out at 1,050,616 B of DXIL. Its driver build starts at 113 s, after waiting behind another ~1 MB build (94.9 s), and finishes in 41.9 s. Onmainit is 29,215,776 B and never finishes: not within 420 s here, and not within 904 s in an earlier run on this machine.15ec6daefb19a780falls back (9975-word table (at most 8192)), as reported above. After that the title stops presenting. At 420 s a 13,823,000 B compute build (record95cc13288a27a96e, started at 280 s) and a 1,064,140 B one are still in the driver.0x0, 0 crashes, 0 device removals, 0 ERROR lines, 40 mesh pipelines refused (MS in the AS slot). Both stop presenting after the world load starts, so neither reaches the world.Not tested: the test suite, the smoke pair, AMD, native wave64. AI-assisted (Claude Code, Claude Opus 5.5); run on my machine.
@Royalflamejlh on GitHub · 2026-11-25 00:48 UTC · original
With #1448 merged in, record
95cc13288a27a96etakes the compact form, and its DXIL crashes vkd3d-proton's dxil-spirv in the recursion @vitor127wt, @St5sz2Jk and @0naku reported for it on #1269 (1, 2, 3). On XCL's side the cause is two back edges to the dispatch loop's head. Three lines incompact.rsgive it one: dxil-spirv then no longer crashes, and in 1 title run with the change on an RTX 4060 Ti the pipeline was made in 149.5 s (vkd3d-proton with the dxil-spirv speed patches of #1269; unpatched, the conversion alone had not finished in 2,400 s).Setup: RTX 4060 Ti 16 GB (NVIDIA 615.71.09), Ryzen 9 9950X3D, Fedora 44, Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b (dxil-spirv
34f0ff8with its pull request 372), DXC 1.9.2609.5, retail 1.0.2.1, release, the first-run screens completed once, no story progress. Tree:main4178e88merged locally with #684e56dbc3, #7511a480bc, #850a314f04, #90629e21fb, #688760f742, #1273be8d052, this PR atf207df1, #144842b2f11and #132169a892c. It is #1448 that makes this record compact (with this PR alone it falls back at the table limit).Tested
driver compile startat 523.0 s is its thread's last line; the thread is in the 8 thread dumps from 150 to 500 s and in none of the 11 afterNatively, no GPU:
xcl shaders shaders.rpf --export-hlsl <dir> --record-hash 95cc13288a27a96e --split 1from the tree, then DXC with-E main -T cs_6_6 -HV 2021 -O1, gives byte for byte the DXIL the first run cached. dxil-spirv's CLI, built from the same34f0ff8, with the options vkd3d-proton passes:34f0ff8master061225datoo219287eb2f6021feandc963276f38285bf4(this PR at30a96a3, #1448 at4cbb6b6) and off839072880d49fb4(this PR at30a96a3) has the same two back edges, 5 of 5 files. The three I ran through dxil-spirv segfault the same way: the first two from #1448, the third from this PR.cargo test -p xcl --lib compactpass with the change under Wine with Mesa lavapipe; 17 of them, every GPU comparison, printSKIPPED … no GPUthere, so 9 ran. Not run without the change.Read
The line is in
compact.rs, which comes from #1315 (bd69c5d); it is the same at this PR's head964f5ed(line 218) and, ascompact.rs:269, at #1448's57d7574:At
-O1, which XCL uses from 1 MB of HLSL, DXC leaves both sides of thatifas branches to the loop head (@ClosetPie107 found that the recursion needs-O1, 5). dxil-spirv keeps one back edge per loop head and, in shaders with wave shuffles, analyses the CFG before it merges them (#1805; #1860 does the same repair for the direct backend). Without the branch there is one:(
LOOP_GUARDthen leaves the file'suseline.) The HLSL the changed tree exports for the record differs from the original in those three lines only.The SPIR-V of this program fails
spirv-val --target-env vulkan1.3with or without the change ("Maximum Control Flow nesting depth exceeded"), as @0naku and @itsd-effex found (3, 4). Offline, 0naku's NVIDIA compiler went past 20 GB on it (RTX 4060 Ti 8 GB, 620.70.06); in the title run above, 615.71.09 built it in 149.5 s. I have not looked for what differs.dxil-spirv's maintainer has since fixed the recursion on its branch
legacy-struct-remove(e084e35c, not in itsmasteryet): natively the unchanged DXIL above no longer crashes there (not converted in 900 s; 11.1 s with the speed patches of #1269 on top). So the three lines are a stopgap: they are not needed once a vkd3d-proton with that dxil-spirv is what people run.Not tested: the title with the change on unpatched vkd3d-proton; #1448's current head
57d7574and #1692's nested form (the same line,compact.rs:312there); whether the changed loop gives the same results on a GPU (the 17 GPU tests were skipped here, and the title run did not compare output); Windows and AMD, where no dxil-spirv is involved.AI use: Claude Code (Claude Fable 5.2) read the runs, made the native reproduction and the change, and wrote this comment.
Posted without review by a person: the account owner was away and reads replies later.
@FuzyBeast on GitHub · 2026-11-25 01:50 UTC · original
Test report for the table cap on RTX 5090 (driver 32.0.16.1714), main
689f2db+ this PR (964f5ed):ActivateRays (
95cc13288a27a96e, 9,975-word table) builds in the compact form whenMAX_TABLE_WORDSis raised to 10,240 (local change): DXC 797.6 s, driver 1,109.9 s (896.2 s withXCL_HEAP_WINDOWS=1), DXIL 10.66 MB, ~2 GB peak — vs 8,586 s (2 h 23 min) for the normal form on the same machine. Details and the full table in #1269.Not tested: correctness of the compact ActivateRays against the normal form. AI use: Claude Code (Claude Opus 5.5).
@ettehn on GitHub · 2026-11-25 03:38 UTC · original
I tested a local resolution of the
pso.rsconflicts Pipodi described above, merging964f5ed9be2eff8d18e4ed5073f0a826c9ed6015intomaincbc296ab65a2661a61e3e2da109134bcd5319f60without committing.shader_cache()as the in-memory cache and this PR'snormal_after_refusalaround the two translated-disk lookups. Passcompact = falsefromconsole_meshto the extended disk-cache API.dxc::defer()check inside theSome(direct)arm ofdirect_first, before invoking the direct translator.Nonestill reaches the HLSL path and can use its cached DXIL. The outer caches still get first chance to return a finished translation.Tested on Windows 11 26200.9974, RTX 5070 Ti Laptop (621.24), Rust 1.97.1, DXC 1.8.2502.11, release.
shader_cache_tests: 20 passed, including a regression test where a coldcached_onlycall marks a miss and runs neither translator, then a normal call populates the cache and a latercached_onlycall returns the same entry.gpu::recomp::compact::tests: 3 passed.gpu::recomp::tests_compact: 17 reported OK, including one explicit native-wave64 skip and one unconfigured retail sample.pso_measurement_compiles_an_exact_synthetic_record: 1 passed. No failures or ignored tests in those filters.Not tested: full suite, retail smoke, Linux, and native wave64. This is a candidate resolution for the rebase, with the branch left to the PR author.
AI use: OpenAI Codex (GPT-6.2 Sol) assisted with the local integration and verification.
@Swagi-REDACTED on GitHub · 2026-11-25 05:39 UTC · original
Targeted RTX 3060 test report for the compute record
56c0cd3b82a00c6efrom A newer retail game, encountered during first world loading.Hardware: Ryzen 7 9800X3D, RTX 3060 12 GB (driver 621.14), approximately 16 GB RAM, Windows 11 Home 26200. Rust 1.95.0 MSVC; DXC/DXIL 1.9.2602.17.
Tested local integration: main
cbc296ab65a2661a61e3e2da109134bcd5319f60plus the four original commitsd94c34a,bd69c5d,c195f07,964f5ed(local headfc05b6d). This is not an unmodified PR-head test: conflicts were resolved to retain main's shared shader cache and cached-only direct-DXIL deferral, and the current mesh-cache call needed afalsecompact argument. A separate, optional live-input test harness was also present.With
XCL_COMPACT_CS=auto, the existing CLI commandxcl shaders <private-single-record-folder> --precompile --only cs --pipelines --limit 1produced:The serialized translated-cache payload contains 1,067,116 bytes of DXIL. The previous main-based world-load attempt logged this same record entering driver compilation with 22,089,024 bytes of DXIL; it had not finished when that run was intentionally stopped. This is not a timed, completed before/after benchmark.
Additional validation on this integration:
cargo test --locked -p xcl --lib compact -- --test-threads=4: 30 passed, 0 failed, 0 ignored; 1 explicit native-wave64 skip (included among the passing tests).cargo test --locked -p xcl --lib gpu::recomp::pso::shader_cache_tests -- --test-threads=4: 19 passed, 0 failed, 0 ignored; no explicit skips.World loading is being retested separately; this report does not establish gameplay or prologue completion. No game data is attached.
AI use: Codex, GPT-6 (exact serving variant not exposed), integrated the existing patches, ran these commands, inspected the cache payload, and wrote this report. The compact backend remains CowboyBingus's work.
@CowboyBingus on GitHub · 2026-11-25 06:20 UTC · original
@Pipodi thanks for the heads-up. Rebased onto
main6e1e2beand pushed: #1315 is now0d7907b, this PReb1f131. Both show as mergeable.console_to_dxil_in: the compact / normal pair withnormal_after_refusalnow goes through #1836'sshader_cache()(and its in-flight coalescing).compile_console_shader: #1836'sdxc::defer()check stays in front of the direct translator, for the programs that go there (goes_direct). A programXCL_COMPACT_CSroutes to the compact form goes to the HLSL path, as before (so it is not deferred).4b0af47) added no text conflict:git merge-treeof964f5edgives the same twopso.rshunks againstmainbefore and after its merge. But the mesh-pass call in itsconsole_mesh_withauto-merges as a 7-argumenttranslated::cachedcall, and this PR givestranslated::cachedan 8th argument,compact, so that call needs the argument to build. Mesh passes are not routed, so they passfalse.TESTED on
eb1f131(RTX 5070 Ti, Windows 11):cargo build --workspaceandcargo build --releasesucceeded;cargo test -p xcl --lib compact -- --test-threads=4: 30 passed, 0 failed, 0 ignored (gpu_compact_native_wave64_formprinted SKIPPED: no wave64 and counts among the passed);cargo test -p xcl --lib pso:: -- --test-threads=4: 19 passed, 0 failed, 1 ignored (compile_time_bench::repeated_pso_shader_compile). On #1315's0d7907b: the same builds succeeded,compact25 / 0 / 0 (same skip),pso::16 / 0 / 1. No full suite or smoke run on these heads.AI use: Claude Code (Claude Opus 5.5) wrote this reply.
@itsSio on GitHub · 2026-11-25 10:19 UTC · original
Tested
Independent Windows verification requested in #1269, on clean head
eb1f1313a8ce0515b1b9587b4bcbee521718996d. Windows 11 Pro 26200 on both systems, x64 MSVC, unoptimized dev/test with debug info off.cargo build --workspace --lockedandcargo test --workspace --locked --no-fail-fast -- --test-threads=4 --nocaptureexited 0 on both.32.0.16.108832.0.16.1088Both logged 21 native-wave64 skips, three per-lane f16/f32 refusals, unavailable driver-cache control and unavailable heap windows. The RTX 2080 SUPER also skipped two D3D12 debug-layer tests (
test_title_draws_with_a_root_signature_under_the_debug_layer,uploads_start_from_each_subresources_state).Focused
cargo test -p xcl --lib --locked gpu::recomp::tests_compact -- --test-threads=1 --nocapture: 17 / 0 / 0 on the Radeon RDNA2 iGPU (32.0.21043.5001, same Ryzen 7 system) with no runtime skips, and 17 / 0 / 0 on the RTX 2080 SUPER with one native-wave64 skip. Default XCL shader options throughout.Not tested
Retail smoke or shader samples, full AMD workspace, RADV, Intel, or compile and gameplay performance.
AI use
Ran via Samaritan:
openai/gpt-6.2-sol): ran both Windows checks, verified the raw results and wrote this report.@DavidM1911 on GitHub · 2026-11-26 04:47 UTC · original
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.@pvfreis on GitHub · 2026-11-24 15:33 UTC · original · reviewed
Review of
5e312d5(stacked on #1315; merge base930e8b4), by reading the code; nothing was built or run here. No defect found in the routing or the cache naming: only compute programs are routed, an incomplete or failed compact form falls back totranslate, and a_centry and a normal one are never served for each other.only_compute_goes_to_the_compact_backenddoes not test that only compute is routed. Its non-compute case is a loneS_ENDPGM, which has no branch target, socompact()returnstranslatefor it (compact.rs:167-169) andalways.hlsl == normal.hlslholds whether or not kernel programs are routed. Removingmatches!(opt.mode, Mode::Compute(_))fromtranslate_as(mod.rs:1409) would leave the test green, and that check is what keeps other modes out underXCL_COMPACT_CS=1. A branching program for the non-compute mode, asserting that its compact text differs fromtranslate's and that the routed result equalstranslate's, would cover it.Also: the stack conflicts with #1321 in
crates/xcl/src/gpu/recomp/mod.rs(git merge-tree), so whichever lands second needs a rebase; and at the next rebase, the body of5e312d5still says it adds "a stubrecomp::compact", which comes from2912ed3.Verdict: fine as far as I read once the routing test checks what its name says.
Review by Claude Code (written by Claude Opus 5.5, two adversarial checks by Claude Fable 5.2, checked by Claude Opus 5.5); each point checked by a person before posting.
@gsucristo on GitHub · 2026-11-25 02:10 UTC · original · reviewed
Reviewed the top commit (
964f5ed9) — clean routing,_c.bincache isolation, and thorough unit tests forXCL_COMPACT_CS.A couple of points to consider:
compact_wantedscans on cache misses (crates/xcl/src/gpu/recomp/pso.rs&mod.rs): InAutomode on a cache miss,compact_form(blob)/cs.takes(code)decodes and scans the full compute program up to 3 times (once inconsole_to_dxil_into choose the_c.binpath, once incompile_console_shaderforgoes_direct, and once intranslate_as). Passing the already-computedbooldown would avoid re-decoding 88k-instruction shaders on misses.XCL_DIRECT_DXILprecedence (pso.rs,goes_direct): Now that #2034 implements the compact form natively in Direct DXIL (0.48 MBDXIL with no DXC compile), routingXCL_DIRECT_DXIL=1compute shaders to the HLSL+DXC compact path first may no longer be desirable once #2034 lands.crates/xcl/src/gpu/recomp/mod.rs): Missing space inlet compact =compact::translate_compact(&code, &opt).unwrap();inonly_compute_goes_to_the_compact_backend.(AI disclosure: review drafted with Antigravity — exact model name not provided to the agent — and checked by the reviewer before posting.)
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.