Recompiler: oversized structured code falls back to pc blocks (#1307) #1321
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!1321
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1321/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?
@tiagonogueiraa-bit on GitHub · 2026-11-24 14:45 UTC · original
tiagonogueiraa-bit:structured-size-bound→main· +42 −0 · 2 files · 1 commits · merged 2026-11-24 21:00 UTCSince
b8b1f49, one compute program of the retail pack comes out as 148 MB of HLSL (334 KB of code), against 14 MB aspcblocks before. The structured form's guards each list every pending skip flag and reopen whenever the set changes, so they grow with the square of the flags: this program has 3 861 flags, guards of up to 597 terms, and 99 MB in guard lines. DXC on that fits #1307's commit growing about 1 GB/s withb8b1f49and not without it. Fixes #1307 and #1332 (record 22619 of the pack, the same program), pending a run that confirms the title's memory.Structured code longer than 128 bytes per byte of program is now translated as
pcblocks.What is in it
crates/xcl/src/gpu/recomp/mod.rs:STRUCTURED_BYTES_PER_CODE_BYTE. Intranslate, structured code past it goes throughtranslateagain withstructured: false.crates/xcl/src/gpu/recomp/tests.rs:oversized_structured_code_falls_back_to_pc_blocks(CPU only). 200 conditional forward jumps whose targets all follow them, in order, cross the bound; 50 do not.Tested
69a892cis0936337rebased ontomainc160d86. The conflict with #680'sHEAP_WINDOWSnormalization at the top oftranslateis resolved by keeping both, as @emirduran707 also did.0936337itself changed onlytests.rsagainst156b0de(review). The runs below were made on156b0de/0936337.shaders.rpf, translated on the CPU withgpu::recompbuilt on its own (macOS) frommain, frommainwithb8b1f49reverted, and from this branch:pcblocksmainb8b1f49revertedOnly one program changes against
main:CS_ScreenProbes_ActivateRaysinindirect_diffuse_lighting, 148.5 MB → 13.8 MB. The next largest structured program is at 61 bytes per byte.cargo check -p xcl --lib --tests --target x86_64-pc-windows-msvcpasses (C code stubbed, nothing linked). The new test's two cases give the expected result in the standalone build:mainkeeps 200 structured, so the test fails there.156b0de:cargo test --workspace --no-fail-fast -- --test-threads=4752 passed, 0 failed, 41 ignored. The new test fails with the bound disabled. On the GPU, both forms of the test's programs agree with a CPU model in all 64 lanes. (report)930e8b4, 154.6 MB of HLSL runs out of memory at the cap and makes no DXIL. On this head, 15.4 MB of HLSL compiles in 68 s, with a 2.8 GB peak commit. (report)XCL_REQUIRE_GPU=wave64,mesh cargo test --workspace -- --test-threads=4752 passed, 0 failed, 41 ignored, noSKIPPED. A secondxcl-smokepair on the retail title had no removal or crash: 95 % ofmain's frames, peak commit +0.9 %. Those 60 s may not reach the changed program. (report)156b0de): no out-of-memory in the first minute in 3 of 3 runs. Onb8b1f49it was killed for memory at 24–71 s in 4 of 4.xcl shaders --precompile --only cs --limit 23000finished with 843 compiled and a 2.6 GB peak, where930e8b4was killed at the 30 GB limit after 34 s. Later growth at world load is the same withb8b1f49reverted. (report)0936337, title left at its start screen, no input: with this change the host's commit levels off at about 18 GB (18.6 GB at 50 s). On930e8b4and onb8b1f49it grew about 2 GB/s and the run was killed at 72 GB at 47–50 s.cargo test --release -p xcl --lib recomp: 190 passed, 0 failed, 18 ignored. (report)0936337:cargo test --workspace --no-fail-fast -- --test-threads=4withXCL_SAMPLE_RPF/_DLLS/_BVH4set gives 752 passed, 0 failed, 41 ignored. Peak commit at the start screen was 16.3 GB with this change, against 87.5 GB on930e8b4. (report)main9e3831e: alone, the process ends at 68 s at 43 GB. With this change (plus #1288, #751 and #684), commit peaks at 30.7–33.7 GB until the title's watchdog. (report)69a892cand onmainc160d86, release builds:xcl shaders <pack> --precompile --only cswithXCL_DXC_THREADS=8and an empty DXIL cache. Onmain, private bytes jumped to 39.1 GB at 270 s and the run was stopped at its 20 GB cap; the program this PR changes was a 151 MB source, and DXC on it alone passed 24 GB in 8 s. With this change, at most 8.7 GB, still compiling normally after 10 min. (report)mainc160d86+0936337:xcl shaders --precompile --only cson the retail pack with an empty DXIL cache finishes: 2 689 compiled, 0 errors, peak 7.1 GB private, in 1 317 s. Without this change (9e3831e) it runs away at about record 22 600 every time, with 15 DXC threads, with one, and with DXC 1.8, ending inLLVM ERROR: out of memoryat 35 GB. With--pipelinesit now passes the point where the unfixed build crashed in the driver; the later driver-side growth there is #1598 / #1657, not this. (report)XCL_HEAP_WINDOWS=1, this change as of0936337onc160d86with #1288 / #1315 / #1316: the program compiles in DXC in about 80 s with no jump in commit, to 13 297 372 B of DXIL; the NVIDIA compiler had not finished it after 244–327 s, and the title ran to its 420 s limit in 3 of 3 runs. Without this change (another base) two of three runs had a 4–6 GB jump in seconds during an 80–94 s DXC compile and were ended by their memory guard.oversized_structured_code_falls_back_to_pc_blockspasses. (report)main6c89285merged with69a892cno longer grows without bound. (#1704)Regression run
The PR block on this head
69a892cis by @CuteBooty (RTX 3070, 32 GB,scripts/smoke.ps1 -Seconds 60, no input, the title left at its start screen), unedited, from the report. Themainblock is @IvyNotFound's (RTX 5080,XCL_PRESS_A_AT=15), from their report. They are from two machines, so this pair shows only that the PR's run ended by itself with no device removal or crash; its frames and commit are not a comparison withmain. A pair from one machine is still welcome.main:
PR, this head (@CuteBooty):
PR, earlier head
156b0de(@IvyNotFound, same machine as themainblock above):@CuteBooty's process commit levelled off at 17.7–17.9 GB by 36 s in both runs on
69a892c, wheremainb7aa9f3with a local change passed 30 GB by 34–36 s; base and input differ between those sides.In @IvyNotFound's report, two 140 s world-load runs of this head had no device removal and exited normally, like
main. TheirGPU queue.Waittimeouts were 63 and 133, against 19 formain. On that machine the count varies from 13 to 55 between runs of other builds, so the report does not attribute it to this change, and neither do I.Not tested
pc-block form's DXIL: @einfachama's 8 GB card had not finished it after more than 4 minutes.xcl-smokepair on this head.AI use
🤖 Generated with Claude Code
@fromthemoonx on GitHub · 2026-11-24 14:54 UTC · original
Windows run, since Tested says the suite was not run on Windows and Not tested lists any GPU.
Tested
NVIDIA GeForce RTX 3060 12 GB (32-lane waves, so wave64 runs split), driver 32.0.16.1088; AMD Ryzen 7 5700X; native Windows 11 Pro 26H2 (build 26300.9974), Graphics Tools (D3D12 debug layer) installed; rustc 1.100.0
stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17; debugExact head
156b0de6de0dc303141e9d1906bdb4efb1ab8290, which is on currentmain930e8b4(so also the merged result):cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.Fails without the fallback: with the
STRUCTURED_BYTES_PER_CODE_BYTEcheck intranslatedisabled,oversized_structured_code_falls_back_to_pc_blocksfails with200 crossing jumps: past the bound, pc blocks. 10 runs with it: 10 of 10 passed.Both forms on the GPU (a scratch test, not pushed): I took your test's programs and changed each
v_addto add 1, sov1counts the adds that ran. Each program went through DXC and ran on this GPU throughrunner::run_codein kernel mode.s0was set so the first taken branch is the 1st, 17th, 49th, 161st or 193rd, or none.v1matches a CPU model in all 64 lanes for all six starts.pcblocks: the same, in all 64 lanes.So the fallback form compiles and gives the same results as the structured one at this size. It says nothing about DXC or the driver on the retail 13.8 MB program.
e2e+gpu_pso_e2e, 3 runs: 3 of 3 passedD3D12 debug layer: the e2e test title logs the same debug-layer error and warning ids as on
main930e8b4.Not tested
AI use
@dervoxx on GitHub · 2026-11-24 14:56 UTC · original
Windows A/B on the retail compute shader from #1307. Both release builds used Rust 1.100.0 on Windows 11 build 26300 with a Ryzen 9 9900X3D. I generated HLSL with four memory windows in wave32, then ran Windows SDK DXC 1.8.2502.11 in a fresh process for each input with
-T cs_6_6 -E main -HV 2021 -O0and a hard 6 GiB process commit cap.930e8b49c1c2ec683d22c724a398b39111cd0e56156b0de6de0dc303141e9d1906bdb4efb1ab8290Both builds completed HLSL translation. This run covered one shader through DXC. Driver PSO creation and title execution were outside its scope.
Codex (GPT-6 family) ran the experiment and drafted this report.
@tiagonogueiraa-bit on GitHub · 2026-11-24 14:56 UTC · original
Thank you both, @fromthemoonx and @dervoxx: that covers the suite on the exact head, the test failing without the bound, and DXC on the retail program itself. I added both to Tested, with links, and marked the PR ready for review.
Written with Claude Code (Claude Opus 5.5).
@IvyNotFound on GitHub · 2026-11-24 15:05 UTC · original
Regression runs on Windows for
156b0de(the description has none). Retail title, RTX 5080 (32-lane waves), plus two world-load runs.Tested
930e8b4), clean tree.scripts/smoke.ps1 -Seconds 60,XCL_PRESS_A_AT=15, unedited, for Regression run if you want them. Themainblock is from930e8b4on the same machine.main:
this PR:
XCL_PSO_WAIT_MS=50), against one ofmain930e8b4with the same settings:mainGPU queue.Waittimeouts (#505)The driver times depend on which blobs earlier runs left, not on this PR: run 1 had nearly everything cached. The timeout counts vary a lot between runs of one build on this title: 13–55 on other builds here. I can't tell from these runs whether this PR's one changed program (
ActivateRays) was reached: I have no name-to-hash mapping for it on this side.Not tested
AI use
@tiagonogueiraa-bit on GitHub · 2026-11-24 15:06 UTC · original
Thank you, @IvyNotFound! I put both
xcl-smokeblocks under Regression run exactly as posted, with credit. I also mentioned the world-load runs, with thequeue.Waittimeout counts and your note that they vary between runs.Written with Claude Code (Claude Opus 5.5).
@Rednaxeh on GitHub · 2026-11-24 15:11 UTC · original
Regression run on RDNA3, since the PR has none:
main930e8b4against this PR's head156b0dechecked out on it (fast-forward, so the second block names the head itself), same retail title, same 60 s, same input (A at ~13 s), same warm caches. Written with Claude Code (Claude Fable 5.1); the runs are mine.Tested
stable-x86_64-pc-windows-msvc, DXC 1.9.2602.17 (Windows SDK), release for the runs, debug for the testsXCL_REQUIRE_GPU=wave64,mesh cargo test --workspace -- --test-threads=4on156b0de: 752 passed, 0 failed, 41 ignored, no SKIPPED (oversized_structured_code_falls_back_to_pc_blocksamong them)Regression run
Frames 95 % of
main, peak commit +0.9 %; both runs end normally at 60 s during the world-loading screens, with the process at 24.1 / 24.3 GB committed and 11.7 / 12.1 GB of local video memory.Not tested
CS_ScreenProbes_ActivateRays): the log does not name the programs DXC compiles, and the two runs' commit at 60 s is the same, so this pair covers the intro and the first stage of the world load, not the compile #1307 / #1332 describe. On this card the load then stalls on the driver's own compute-pipeline builds (#232), so a longer run here would show that before it showed the memory.@tiagonogueiraa-bit on GitHub · 2026-11-24 15:13 UTC · original
Thank you, @Rednaxeh: a second GPU vendor for the suite and the smoke pair. Added to Tested, with your note that 60 s may not reach the changed program.
Written with Claude Code (Claude Opus 5.5).
@DavidM1911 on GitHub · 2026-11-24 15:24 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib -- --test-threads=1: 708 passed, 0 failed, 21 ignored. (Parallel runs intermittently abort with 0xc0000005 — same harness flake seen on unmodifiedmain.)Thanks!
@tiagonogueiraa-bit on GitHub · 2026-11-24 15:25 UTC · original
Thanks, @DavidM1911, a third data point for the lib tests on this branch.
Written with Claude Code (Claude Opus 5.5).
@tiagonogueiraa-bit on GitHub · 2026-11-24 15:35 UTC · original
Thanks for the careful read, @pvfreis. Both points were right.
pcform keeps the same stretch under one guard and is no smaller, and the gain shows on the retail program, whosepcform is split into blocks (148 MB → 14 MB). The test also no longer sits betweenjumps_to_outer_loop_heads_are_structuredand its doc comment. Both changes are in0936337, which touches onlytests.rs.@IvyNotFound, @Rednaxeh: the force-push moved the head to
0936337(tests only, runtime code identical), soPR checkswants the PR'sxcl-smokeblock on that commit. If either of you can rerun the PR side, I'll put it in.Written with Claude Code (Claude Opus 5.5).
@Royalflamejlh on GitHub · 2026-11-24 15:51 UTC · original
The run this asks for: with
156b0demerged the retail title's process no longer runs out of memory in its first minute on Linux / Wine (3 of 3 runs), where the same setup onb8b1f49was killed for memory at 24–71 s (4 of 4). I ran156b0de; the head0936337differs from it intests.rsonly.Tested
Setup: Fedora 44 (kernel 7.2.9), 62 GB RAM, Ryzen 9 9950X3D, RTX 4060 Ti 16 GB (driver 615.71.09), Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b, DXC 1.9.2609.5, release,
x86_64-pc-windows-gnu. Title 1.0.2.1 from a saved profile, one A press throughXCL_PRESS_AT, pipeline preload on (the default),XCL_PSO_WAIT_MS=50.used-pipelines.txtholds 1260 shader sets, the program of #1332 among them. Each run is in a cgroup with a memory limit, 34 GB unless said.b8b1f49+ #684 #751 #1045 #850 #851 #906 #688930e8b4+ #684 #751 #850 #906 #688 +156b0deAfter the first minute, on the tree with this pull request: 2 runs reached the world's pipelines at 92–94 s and were ended at the 34 GB limit at 110.3 and 113.8 s; a third with
XCL_DXC_THREADS=4stayed under it and ended at the title's watchdog (game+0x23cf683) at 152.6 s, the stall of #505. That later growth is not from this change: the first tree withb8b1f49reverted reached the same limit at 130.8 s (1 run).The two trees differ by more than this pull request (
mainmoved fromb8b1f49to930e8b4, #851 and #1045 no longer merge, #751 and #688 have new heads).The offline pass on
156b0dealone (xcl shaders shaders.rpf --precompile --only cs, 2 DXC threads, 30 GB limit;--limit 22619is already on #1332):--limit 23000finished in 527 s, 843 compiled, 0 errors, and the process's resident memory, sampled every 2 s, peaked at 2.6 GB. On930e8b4without it,--limit 22619was killed at the limit after 34 s.Read
recomp/mod.rsonly. The bound is checked afteremit_structuredhas written the whole structured text, so the oversized form is still built once (148 MB for this program) beforetranslateruns again withstructured: false. That is the cost the description gives (about 1.5 s), and the second call cannot come back to the check. I found nothing in the ten lines that does more than the description says.Not tested: the
cargo testsuite and the new test; the head0936337; native Windows; AMD; the title without the other pull requests listed.AI use: Claude Code (Claude Fable 5.2) merged the trees, ran the title and the offline pass, read the diff and drafted this comment.
@pvfreis on GitHub · 2026-11-24 15:51 UTC · original
Thanks. Checked at
0936337(read only): the test's doc comment now says it checks the switch only, andjumps_to_outer_loop_heads_are_structuredhas its doc comment back. Understood on #1345.Reply by Claude Code (Claude Opus 5.5); checked by a person before posting.
@tiagonogueiraa-bit on GitHub · 2026-11-24 15:53 UTC · original
Thank you, @Royalflamejlh: the title's first minute and the offline pass are exactly the check #1307 / #1332 needed. It's in Tested, with your note that the later growth also shows with
b8b1f49reverted. And thanks, @pvfreis, for checking the fixes.Written with Claude Code (Claude Opus 5.5).
@tiagonogueiraa-bit on GitHub · 2026-11-24 15:55 UTC · original
Thank you, @WillyboPeep: native Windows on the current head, with
mainandb8b1f49side by side, is the clearest picture of #1307 so far. It's in Tested, including your note that it shows when the title is left at its start screen.Written with Claude Code (Claude Opus 5.5).
@rntzaj on GitHub · 2026-11-24 16:43 UTC · original
The full suite on
0936337, which the last report lists as not tested, and a smoke pair from a smaller machine (8 GB Ampere, 32 GB RAM). The pair agrees with @WillyboPeep's: with this PR the commit levels off, and without it the commit keeps climbing.Tested
stable-x86_64-pc-windows-msvc; DXC 1.8.2502.11 (Windows SDK 10.0.26100); debug for the tests, release for the runs0936337142a114668e29652163a62c6d255ff5d3, on currentmain930e8b4(a fast-forward), clean tree:cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4withXCL_SAMPLE_RPF,XCL_SAMPLE_DLLSandXCL_SAMPLE_BVH4set: 752 passed, 0 failed, 41 ignored (oversized_structured_code_falls_back_to_pc_blocksamong them). SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.memory: … MB committed by the processlines in the two runs below:main930e8b4On
mainthe commit grows by about 1.7 GB/s from 20 s on and passes this machine's 32 GB of RAM before 30 s. The run still ended normally at 60 s.Regression run
scripts/smoke.ps1 -Seconds 60, unedited, back to back on the same machine, with warm caches, the preload on (used-pipelines.txtfrom earlier world-load runs) and no input: the title stays at its start screen.main:
this PR:
Frames 102 % of
main, peak commit 81 % lower.Not tested
pcform ofActivateRaysgives the right picture in the title.AI use
@emirduran707 on GitHub · 2026-11-24 18:14 UTC · original
Test report:
0936337on AMD RDNA4 (Windows), world load on today'smain: with this PR the commit stays at about 30 GB; without it the process dies at 68 s at 43 GBscripts/smoke.ps1(soXCL_NETWORK=0),XCL_ACTIVITY=1, A at 14, 17, 21 s and every 6 s from 125 s (XCL_PRESS_A_AT). Commit is read from XCL'smemory: … MB committed by the processlines.main9e3831ealone: commit rises to 42,950 MB, and the process ends with0xc0000409at 68 s.main9e3831e+ this PR + #1288, #751, #684 (local tree, not a clean commit of this PR):XCL_SLEEP_HOLD=0): commit 17.5 GB at 22 s, 29.2 GB at 82 s, peak 33.7 GB, until the title's watchdog at 130.8 s.XCL_THREAD_DUMP_ATdump, reported in #1288). In the other run (600 s) commit was 31–38 GB for 600 s, with one sample of 44.8 GB at ~460 s, while the driver was building ~1 MB compute programs (that run is in #1288).recomp::translate. It resolves by keeping both blocks: theHEAP_WINDOWSnormalization from #680 first, then this PR's code oncode. The tree then builds, and the runs above used it.Not tested: this PR alone on
main(it does not apply cleanly), the full suite on this tree,XCL_HEAP_WINDOWS=1instead of this PR, more than one run per arm.Written with Claude Code (Claude Opus 5.5); the runs are mine.
@tiagonogueiraa-bit on GitHub · 2026-11-24 19:23 UTC · original
Thank you, @rntzaj and @emirduran707: the full suite on
0936337and the RDNA4 world load are both in Tested. The PR had started to conflict with #680 intranslate, so it's rebased ontomainc160d86(head69a892c), keeping both blocks the way emirduran707 resolved it. Since the head moved,PR checkswants a smoke pair made on69a892c. If anyone can rerun the PR side (with a neutral folder name), I'll paste it.Written with Claude Code (Claude Opus 5.5).
@JRamos1993 on GitHub · 2026-11-24 19:40 UTC · original
Test report: with #1321 a cold
xcl shaders --precompilestays under 9 GB. Onmainit jumped to 39 GB in 30 s. This is the precompile of #1657.Setup: i9-14900KF, 64 GB RAM, Windows 11 Pro 26200, DXC 1.9.2609.5, release builds of
mainc160d86and of this PR's head69a892c, which sits directly on it. Retail 1.0.2.1 pack. CPU only, no--pipelines.Command for both:
xcl shaders <pack>\shaders.rpf --precompile --only cswithXCL_DXC_THREADS=8and an empty DXIL cache. A script sampled private bytes every 10–30 s and stopped the process at 20 GB or after 10 min.mainc160d8669a892c(this PR)What the jump on
mainis: I added local-only logging (not part of any PR) of each DXC compile's source size.Not tested: a title run with this PR;
--pipelines; the full pack to the end (10 min covers the point wheremainblows up, not the rest).AI use: Claude Code with Claude Opus 5.5 ran the builds and measurements above and wrote this report.
@tiagonogueiraa-bit on GitHub · 2026-11-24 19:42 UTC · original
Thank you @JRamos1993, that is the clearest A/B so far: same base, same command, and the 151 MB source pinned as the jump. I added it to the description under Tested. A
xcl-smokepair on69a892c(with the title folder namedgame) is still the one thing the check needs.@CuteBooty on GitHub · 2026-11-24 19:50 UTC · original
The PR side on
69a892c, as asked: pass, and the commit levels off here too.Second of two runs back to back, no input, the title left at its start screen; run 1: 1496 frames, 19271 MB. Free system commit never went under 15.8 GB.
Commit of the process from XCL's
memory:lines (GB, 1 GB = 1000 MB), with the same 718 shader sets built ahead as in my runs on #1307:mainb7aa9f3+ one commit of mine inreal.rs(two runs, A pressed at 15 s)69a892c(two runs, no input)Plain
b7aa9f3was stopped the same way twice, at 31.9 and 29.1 GB. The two sides differ in base and input, so this is not a clean A/B of this PR alone.Tested: RTX 3070 8 GB (32-lane waves), NVIDIA 621.24; Ryzen 5 3600, 32 GB; Windows 11 Pro 26200; rustc 1.100.0 MSVC; release build from a clean checkout;
scripts\smoke.ps1 -Game <folder> -Seconds 60.Not tested:
mainc160d86on this machine, the world load, the test suite, whether the 60 s compile the program this PR changes.AI use: Claude Code (Claude Opus 5.5) made the runs with me present, read the logs and wrote this.
@WillyboPeep on GitHub · 2026-11-24 15:54 UTC · original · edited 2026-11-24 19:54 UTC
Test report:
0936337on an RTX 4090 (Windows). With it, the host's commit levels off at about 18 GB when the title is left at its start screen; without it, it grows about 2 GB a second until my guard ended the run at 70 GB. Counts only.Setup: NVIDIA GeForce RTX 4090 (driver 621.01, 32-lane waves), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro 26300, Rust 1.98.1 MSVC, release, DXC 1.9.2602.17. Retail 1.0.2.1. Tree:
main930e8b4+ this PR (0936337, a fast-forward), nothing else.XCL_NETWORK=0,XCL_RUN_SECONDS=60, no input, page file grown beforehand, the run killed at 70 GB of process commit. Commit from XCL's ownmemory: … MB committed by the processlines.main930e8b4b8b1f49main+ this PR930e8b4it needed the title left at its start screen here (not on today'smain: see the update at the end). The samemain930e8b4(plus two script/README-only PRs) with A pressed every 4 s from 15 s had 18.0 GB at 60 s and 30.4 GB at 110 s, and reached the world load. That may be why @CuteBooty's run with input by hand did not show it.cargo test --release -p xcl --lib recomp -- --test-threads=4on this tree: 190 passed, 0 failed, 18 ignored.Not tested: the full suite on this head, a world-load run with this PR, AMD.
AI use: Claude Code (Claude Opus 5.5) ran the builds and runs on my PC and wrote this report; I checked it.
Update, today's
main:9e3831e+ three approved VFS / script PRs (#1170, #1092, #1229), same machine, A pressed every 4 s from 15 s. The growth shows with input now too: 13.2 GB at 10 s, 24.9 GB at 20 s, 51.0 GB at 30 s, and my guard ended the run at 45 s (60.9 GB, 0.9 GB of commit left). So "it needs the title left at its start screen" above held for930e8b4here, not for9e3831e. The same build withXCL_HEAP_WINDOWS=1(#680) stayed at or under 30.4 GB until the title's watchdog at 121 s. One run each; I have not looked into which program the growing run was building.Update 2, the pipeline preload:
main9039900+ #1170 + #1229,XCL_HEAP_WINDOWS=1, the compute programs ofused-pipelines.txtwarmed into the driver cache beforehand (the three screen-probe programs left out), A every 4 s from 15 s, one run each:XCL_PSO_PRELOAD=0+0x23cf683at 106.9 s, commit at most 31.1 GBWith a cold cache (run above,
XCL_HEAP_WINDOWS=1, preload on) the growth did not show either. So here it comes from what the preload builds once the rest is in the cache, which fits #1307's program being inused-pipelines.txt; I did not check which program it was. In the preload-off run the render thread waited from about 77 s inexecute_indirect→resolve_wait, with onexcl-psoworker innvgpucomp64.dllat 100 s.@einfachama on GitHub · 2026-11-24 20:00 UTC · original · edited 2026-11-24 20:03 UTC
Test report for #1321 on my retail title, on an 8 GB NVIDIA card with
XCL_HEAP_WINDOWS=1. It covers DXC and the driver on thepc-block form, and the title's commit with and without it.Setup
mainc160d86+ #899 + one local log line (what a bind waits for; not part of any PR) + #12889cdae10+ #1315 / #131630a96a3+ this PR as of0936337.prepare()intranslate: #1315's side kept,let program = code;at the top of the newtranslate, the size check merged unchanged. Net change: this PR's own +10 / +32.69a892chas the same changed lines onc160d86.main9e3831e+ #899 + the same local line + #12889cdae10: no #1315 / #1316, no #1321, so a different base and build. 3 runs.XCL_HEAP_WINDOWS=1,XCL_NETWORK=0,XCL_RUN_SECONDS=420, thread dumps at 100, 130, 160, 200, 260, 340 s.oversized_structured_code_falls_back_to_pc_blockspassed, plus the recompiler'scompact(24),memory_windows(7) and heap-window tests. The whole suite was not run.With #1321
15ec6daefb19a780: #1316's compact form refuses it (… need a 9975-word table (at most 8192) – translated as before), and it is translated in thepc-block form.95cc13288a27a96e.dxc::compileat the 100, 130 and 160 s dumps, with one DXC compile running from 96.5 s to ~176 s.Without #1321
dxc::compileat the 200 s and 260 s dumps, with onexcl-dxcworker indxcompiler.56c0cd3b82a00c6e) from 160 s to at least 340 s with the commit flat at 28–33 GB.15ec6daefb19a780because:15ec6daefb19a780by its compact line on the same thread, and its DXIL was written when that compile ended.Not tested
XCL_HEAP_WINDOWSunset.AI use
@CDR-0000 on GitHub · 2026-11-24 20:09 UTC · original
Windows run on RTX 3080 Ti: with this PR
xcl shaders --precompile --only csfinishes (peak 7.1 GB); without it, it runs away at ~22 600/26 503 every time, also with one compile thread and with DXC 1.8.Tested
stable-x86_64-pc-windows-msvc; release.mainc160d86+0936337cherry-picked (one conflict at the top oftranslate()with the heap-windows normalization; kept both). Retail 1.0.2.1shaders.rpf(26 503 records), empty DXIL cache.9e3831e)--precompile --only cs, DXC 1.9.2602.17, 15 threadsLLVM ERROR: out of memoryXCL_DXC_THREADS=1Not fixed by this PR (expected): with
--pipelineson the same cache, it now gets past the 450–525 pipelines where the unfixed build crashed innvgpucomp64.dll. Around 840 s, private memory went 8 → 20 GB in ~10 s and my 20 GB guard stopped it. That looks like the driver side of #1598 / #1657.Written with Claude Code (Claude Opus 5.5); the runs are mine.
@tiagonogueiraa-bit on GitHub · 2026-11-24 20:14 UTC · original
Thank you all, these settle the open points:
69a892cblock is now the PR block under Regression run, unedited. Themainblock there is @IvyNotFound's from another machine, and the description says so; amainrun on your 3070 with the same settings would make it a one-machine pair, if you have the time.--precompile --only csto the end at 7.1 GB, against the runaway at ~22 600 three ways, is the cleanest evidence for the precompile side. Agreed that the later--pipelinesgrowth is the driver side (#1598 / #1657).All four are in Tested.
@ivall on GitHub · 2026-11-24 21:01 UTC · original
Merged as
e9e94ce. Thank you, @tiagonogueiraa-bit, and everyone who ran it: the same-base A/Bs made this easy to decide. The regression came fromb8b1f49, which I had checked on a sample of programs only and not for how the source grows over the whole pack.Tested on AMD RDNA4 (native wave64), Windows, DXC 1.8.2502.11:
69a892cmerged onmain4178e88:cargo test --workspace --no-fail-fast -- --test-threads=4: 892 passed, 0 failed, 42 ignored. SKIPPED:heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).oversized_structured_code_falls_back_to_pc_blockspasses.XCL_DIRECT_DXIL=all cargo test -p xcl --lib gpu:: -- --test-threads=4: 375 passed, 0 failed, 19 ignored, none SKIPPED.crates/andtests/ate9e94ceare identical to the tested tree.xcl shaders <pack> --export-hlsl … --record-hash 95cc13288a27a96e, 4 windows, native wave64: 154,575,932 B onmain→ 15,360,321 B. A second large program (56c0cd3b82a00c6e, 30,983,672 B) is unchanged.Not tested: a title run on the merged tree, DXC on the new 15 MB source, NVIDIA.
AI use: Claude Code (Claude Opus 5.5) merged, ran the tests and wrote this.
@isaacwingate on GitHub · 2026-11-24 21:07 UTC · original
Test report for
69a892c(this PR's head) together with #1316 on an RTX 5080, with the retail title of #505.Setup
main4178e88+ #1316 (f207df1, with #1315 under it) + this PR + #889 + #1798.mainis at the start oftranslateingpu/recomp/mod.rs: #1315 (under #1316) moved decoding, the #680HEAP_WINDOWSnormalization and the emitter set-up intoprepare(). I keptprepare()unchanged and added this PR'slet program = code;as the first line oftranslate; the size check afteremit_structuredmerged on its own. The retry withstructured: falsepasses options not yet normalized;prepare()normalizes them again, so the result is the same as before the move.Tests
cargo test -p xcl --lib -- recomp:: --skip gpu_: 116 passed, 0 failed, 17 ignored,oversized_structured_code_falls_back_to_pc_blocksincluded.cargo test -p xcl --lib gpu::recomp -- --test-threads=4(GPU tests): 222 passed, 0 failed, 18 ignored (SKIPPED: three tests – 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)Not tested
AI use
@zGLados on GitHub · 2026-11-24 20:49 UTC · original · edited 2026-11-24 21:33 UTC
Test report for the new head
69a892con Windows AMD RDNA3, with the retail title: the commit growth from #1307 is gone with this PR.Tested
scripts/smoke.ps1for 300 s on this PR's basemainc160d86and on its head69a892c, both clean trees, run back to back with the same caches.XCL_PRESS_A_ATevery 6 s from 10 to 118 s. My own guard stops the process above 60 GB.c160d86: commit grew from ~20 s on (22 GB at 30 s, 42 GB at 45 s, 58 GB at 55 s), and the guard stopped it at 62.4 GB at ~60 s.69a892c: no growth. Peak commit 35.2 GB, no device removal. The run ended at ~128 s with an access violation; the game's crash log reads "Game State: Game Running". That matches the title's stall watchdog I see onmainwithout the growth (#505 / #534, ~116–118 s in earlier runs). I did not keep the XCL log of this run, so the address is not confirmed.Regression run
main:PR head:
Not tested
9e3831ethe offline precompile grows the same way at95cc13288a27a96e(my comment on #1307).Update after the merge: the two points under "Not tested" in the merge note, on merged
maine9e94ce. Same machine; clean tree, release.xcl shaders shaders.rpf --precompile --only cs --limit 22824, 15 DXC threads, cold cache (the newmainchanges the HLSL of most programs). It compiled 667 programs with 0 errors in 395 s, and the process peaked at about 10 GB of private bytes.95cc13288a27a96efinished last, about 4 min after the others, as 13.8 MB of DXIL. On9e3831ethe same command passed 32 GB within 40 s at that record.XCL_PRESS_A_ATas above: no commit growth. It levelled off at ~31 GB from ~110 s and reached 36 GB near the end. No device removal and no crash; the run ended at the 300 s limit.The title presents nothing from ~104 s on (0 presents in every 2 s window to the end), and this time it did not end at its stall watchdog. I did not look into why.
AI use: Claude Code (Claude Opus 5.5) ran the builds and runs on this machine and drafted this report.
@isaacwingate on GitHub · 2026-11-24 21:52 UTC · original
Follow-up to my report above: the same title on the same machine,
mainwithout this PR against the merged tree with it. Same settings for both:XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_PSO_WAIT_MS=50, A throughXCL_PRESS_ATevery 4 s from 20 s, back to back.main4178e88+ #1798memory allocation of 2073600 bytes failedand the process ended (0xc0000409) at 39 s, before the world load4178e88+ #1316 + this PR + #889 + #1798+0x2215c35) while it waited on shader buildsAn earlier 600 s run of the second tree (no
XCL_PSO_WAIT_MS) also stayed at 36.0 GB to the end.[SHADER] csline after 20 s);b8b1f49is in both trees.Machine: NVIDIA GeForce RTX 5080, driver 32.0.16.2124, i9-12900K, 32 GB RAM, 48 GB commit limit, Windows 11 build 26300, release builds.
AI use
@skypinglost on GitHub · 2026-11-24 23:04 UTC · original
Post-merge follow-up covering two items from @ivall's merge note (
Not tested: DXC on the new 15 MB source, NVIDIA) on container95cc13288a27a96e(rec=22618, 333,596 B console code, 76,699 instructions, wave32, 4 memory windows). Counts, sizes, timings, and peak private commit only; no game or shader names.Summary
#1321'spc-block fallback shrinks HLSL from 154,570,427 B (9039900) to 15,355,149 B (7f7e768,-90.1%), rescuing DXC from hitting our 20 GiB commit guard at 28.3 s to a clean 77.19 s / 2,494.7 MB compile producing 13,016,392 B (12.41 MiB) of DXIL.CreateComputePipelineStateon that 12.41 MiB DXIL (hlsl-heap) hit our 900 s timeout (900.37 s, peak commit 7,868.4 MB, still climbing ~200–230 MB per 30 s). This aligns with @afpruivo's uninterrupted RTX 3090 run on #1269 (comment), where the#1321DXIL took 83 min 9 s (~23.1 GB).main: on the exact same commit (7f7e768),XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1(#1748+#1693) emits 3,324,912 B (3.17 MiB) of DXIL and builds cold in 32.89 s / 1,606.7 MB (>27×faster in the driver and>4.9×lower peak commit than#1321HLSL).Measured (
95cc13288a27a96e, one isolated process per run)617.42, Windows, DXC1.9.2602.17(Windows SDK10.0.26100.0), release builds (9039900Pre-#1321/#1748 vs7f7e768Post-#1321/#1748,XCL_PER_LANEunset).XCL_DXC_THREADS=1,XCL_PIPELINE_THREADS=1,XCL_PSO_DISK_CACHE=0, fresh emptyXCL_DXIL_CACHEper run, 20 GiB process commit guard.9039900(Pre-#1321)hlsl-heap7f7e768(Post-#1321)hlsl-heaptimeout(900s)7f7e768(#1748only)direct-rootPASS)timeout(600s)7f7e768(#1748+#1693)direct-heapPASS)OK(made=1, reused=0)Full 58-run Pre/Post dataset across 118–477 KiB compute programs: #1269 (comment).
Not tested: a title run on the merged tree; GPU dispatch correctness of the compiled pipeline; AMD / Intel / Linux.
AI use: Antigravity (Gemini 4 Neon) ran the isolated benchmark harness, summarized the logs, and drafted this comment.
@DavidM1911 on GitHub · 2026-11-26 04:53 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
@pvfreis on GitHub · 2026-11-24 15:32 UTC · original · reviewed
Review of
156b0de(merge base930e8b4, currentmain), by reading the code; nothing was built or run here. No defect found in the fallback itself: it is a freshtranslatewith onlystructuredchanged, and cached translations frommainare not reused.pcform, not that thepcform is smaller. Withstructured: false,emit_rangestill emits the longest single-entry stretch throughemit_structured(mod.rs:1084-1107,1124-1126). In the 200-jump program that stretch is[0, last target), so the fallback isif (pc == 0u) { <the same guards> }plus one block, andcontains("pc ==")(tests.rs:7482) holds because of the wrapper. This is howmainalready behaves and does not affect the retail program, which the reports here and in #1307 show fixed. Suggested: say in the test's comment that it checks the switch only, or use a program whose jumps are split across stretches. While there: the new test sits betweenjumps_to_outer_loop_heads_are_structuredand its doc comment (tests.rs:7456-7463).Question: #1345 makes these guards constant-size (
if (xcl_skip == 0u)). On a tree with both, does the 200-jump program still cross the bound? If not, this test's second assertion fails without a merge conflict to warn of it.Verdict: fine to merge as far as I read; the test comment and the #1345 interaction are worth a look.
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.