Recompiler: each loop region of a program gets its own iteration budget #2793
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!2793
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2793"
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?
@jessenic on GitHub · 2026-11-26 13:29 UTC · original
jessenic:recompiler/loop-region-budgets→main· +257 −13 · 6 files · 2 commits · openA translated program caps its loops with one per-lane counter: 65,536 iterations, shared by the whole program. When a program's own spin-wait gives up after exactly 0x10000 tries, it spends all of them, and every later loop leaves at its first guard. Each outermost loop region now gets its own budget. The program stays capped at four budgets in all.
Part of #505.
Found on a retail FSR pass. CS
a8de35e47f36d28cpolls flags from an earlier pass, inside an outer loop, and gives up after 0x10000 tries.0should have been.1.5f29d7e51b2c6230, the one in my #505 GPU profile) spun to its own cap every frame. That took about 260 ms of GPU time a frame, two thirds of the console code's GPU time.These values were measured with a local probe that reads the buffers at bind time: the flags,
cb[0xa8] = 0, and the weight dword the flags carry.What is in it (two commits)
gpu/recomp/mod.rs:budget_regions(the outermost ranges ofloop_ranges),budget_regionandloop_guard.LOOP_BUDGETS_PER_REGION(2) budgets and countsxcl_btotaldown fromLOOP_BUDGETS_IN_ALL(4) budgets. Both forms are covered: structuredfor (;;)and thepcform'swhile.gpu/dxil/kernel.rs,compact.rs,lower.rs: the same in the direct translator's plain and compact forms. It adds two variables,VAR_BUDGET + 7and+ 24, which are free onmain. A loop head's compact class now includes its region.main. On AMD, multi-region mesh loop headers crashed the driver's compiler. On this RTX 5070 Ti, a 900 s run with region budgets in every stage hung (0x887a0006) 580 s into the world, and the same run with this scope ran to the end (one run each).recomp::tests::gpu_a_loop_after_a_spin_to_the_budget_still_runs: a spin of 0x10000, of 0xFFF0, and of 0x10000 inside an outer loop, each followed by a loop. Both HLSL forms.recomp::tests::gpu_endless_loops_in_many_regions_stop_after_four_budgets.dxil::compact_tests::gpu_a_loop_after_a_spin_to_the_budget_still_runs_in_both_forms: direct plain and compact.Cost: the guard text changes in every program with two or more loop regions: 1,512 of the title's 2,682 compute programs (counted in an export with this change), and graphics programs too. My precompile after the change rebuilt 1,032 compute, 9,282 mesh, 3,133 pixel and 145 vertex programs. Those programs are translated and compiled once more, so the first run after this change rebuilds most pipelines; I needed a precompile plus two runs before the world was warm again. The worst case for a program that really runs away is four budgets instead of one.
(The commit message says 1,916; that was a brace count of
[loop]s. The exact count is 1,512.)Tested
cargo test --workspace -- --test-threads=4on this head (22c5f68): 1439 passed, 0 failed, 47 ignored, 37 test binaries (per_region_loop_budgets_are_compute_onlyadded).lower/lower_dxilcomparisons,dispatch_chain_native_wave64_builds_whole,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware), andheap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).0xc0000005ingamesave::tests::blob_enumeration_sees_one_submitted_update(#2421). The next two runs passed.main0829441+ about 40 open PRs, #929 among them), with the same change. Settings:XCL_DIRECT_DXIL=1, UMA shadow, the RT resolve programs refused, warm caches.5f29…fell out of the profile's top 15; it had been at about 260 ms a call.0x887a0006), and so did the run without the change. With warm caches, all three hung after 565–602 presents in the world, so the hang follows how far the world gets, not the change, which only gets there sooner. An older run of my tree went past 1,072 world presents with no hang. Today, that tree without this change and without the probe hung after 222. So the hang comes from something else that changed on this machine since then (my guess is the much larger driver-blob cache after two precompiles, so pipelines that used to be skipped while building now run); I have not found it.Regression run
scripts/smoke.ps1 -Game <the retail title>, 60 s, onmainand on this head (the default length does not reach the FSR passes):Tested by others
main:[65536, 0, 0, 0]).main1435 / 0 / 47), and a review of the diff.gpu::tests on both paths: only the three new tests differ frommain, all pass.Not tested
mainin the retail title's world: the game runs above were on my integration tree. The smoke runs only reach the menus.XCL_PER_LANE=1: it has no loop budget at all yet (#2769).a8de…ran its HLSL translation in every run, even withXCL_DIRECT_DXIL=1; the direct plain and compact forms are covered by the GPU tests only.HANDOFF.md(around line 1660) describes one per-laneLOOP_GUARDbudget per shader, and its "4 M iterations" was already out of date. With this change, a program with two or more loop regions has a budget per region and four in all.AI use
🤖 Generated with Claude Code
@ettehn on GitHub · 2026-11-26 13:35 UTC · original
Independent Windows GPU check of the global cap in direct DXIL on
3cde150b3c7a869e95b8eefcb5a2379859ad77d0, withb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7as the control. The only local change on each checkout was one synthetic test.The test requests three consecutive finite loops of 98,304 iterations each and records their counters and completed-region count. On the PR, both direct DXIL forms (plain and compact) returned
[98304, 98304, 65536, 2], stopping the third loop at the global 262,144-iteration limit. The main control failed at the plain-form assertion with[65536, 0, 0, 0]. The four existing loop-budget tests also passed on the PR checkout.Windows 11 build 26200, Ryzen 9 8945HX, RTX 5070 Ti Laptop GPU (12 GB, driver 621.24), Rust 1.97.1 MSVC debug, DXC 1.8.2502.11. With
XCL_ADAPTER=NVIDIA XCL_REQUIRE_GPU=wave64, I ran:PR plus local test: 5 passed, 0 failed, 0 ignored, no reported skips. The control ran only the new test. Native wave64, the full workspace suite, and a retail title were outside this check.
OpenAI Codex assisted with the synthetic test and verification. The exact model identifier was unavailable in this session.
@retrope13 on GitHub · 2026-11-26 13:45 UTC · original
Independent Ada Lovelace (RTX 4060 Laptop 8 GB) full-suite verification and diff review of
#2793(3cde150b) againstmain(b49be183): full debug suite + release recompiler/DXIL tests green, 0 failures. No title was run.Tested
32.0.16.2140, wave32), Intel Core i5-14500HX (14C/20T), 24 GB RAM, Windows 11 26H2 (build26300.9818),rustc 1.100.0(stable-x86_64-pc-windows-msvc), Windows SDK10.0.26100.0DXC1.9.2602.17,XCL_ADAPTER=NVIDIA.cargo test --locked -p xcl --lib -- gpu_a_loop_after_a_spin_to_the_budget_still_runs gpu_endless_loops_in_many_regions_stop_after_four_budgets gpu_a_loop_after_a_spin_to_the_budget_still_runs_in_both_forms --test-threads=4 --nocapture: 3 passed, 0 failed, 0 ignored (0.49 s; all three executed on GPU, none skipped).cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4:main(b49be183): 1435 passed, 0 failed, 47 ignored#2793(3cde150b): 1438 passed, 0 failed, 47 ignored (+3 new tests, 0 failures)--release):cargo test --release --locked -p xcl --lib -- gpu::recomp::tests:: gpu::dxil::compact_tests:: --test-threads=4: 183 passed, 0 failed, 17 ignored (12.44 s).Code Review Notes (
b49be183..3cde150b)lower.rs,kernel.rs,compact.rs): VerifiedVAR_BUDGET_OWNER(VAR_BUDGET + 7) andVAR_BUDGET_TOTAL(VAR_BUDGET + 24) do not collide with any existingVAR_*constant (+0..+5,VAR_IMG_WRITE+8..+23,VAR_TMP = 1024), and both are initialized inInit(0andLOOP_BUDGET * 4).kernel.rsandcompact.rs,spent(total == 0) forcesleft = 0beforecond_br(none, end, cont), so neitherleft - 1nortotal - 1can underflow incont. Incompact.rs:84,budget_regionis 1-based, sohead as u64 + region(0non-head,1unregioned head,2..per region) cleanly separates heads across regions without key collisions.phase_splitscoping (recomp/mod.rs,emit.rs): Programs with< 2regions produce emptyregionsand keep identicalLOOP_GUARDHLSL text. For multi-regionphase_splitgeometry shaders,emit::finishwraps each phase'sbodyin its own{ ... }scope, so localxcl_bown/xcl_btotaldeclarations do not collide across ES and GS phases (andxcl_bown = 0uresetsstatic xcl_budgeton the first region entered). Also confirmed every loop innested_loop_rangesmaps into an enclosing outermost range ofbudget_regions(&loops).Not Tested
#[ignore]/SKIPPEDtests.AI disclosure: Antigravity (Gemini 4 Neon, XHigh) ran the builds/tests, reviewed the diff, and drafted this report.
@DarkPanda69 on GitHub · 2026-11-26 13:51 UTC · original · edited 2026-11-26 20:48 UTC
Update for head
22c5f68: same result. Applied onmain8b957be,gpu::on both cards, withXCL_DIRECT_DXIL=1and with it unset: RX 9070 XT 708 → 712 passed, 2 failed both times (the #2115 fuzz seeds, same onmain), 6 SKIPPED; RTX 3060 710 → 714 passed, 0 failed, 24 SKIPPED. The only changes are four ok results: the three tests from before plus the newper_region_loop_budgets_are_compute_only.AMD run (listed as untested) on an RX 9070 XT, plus an RTX 3060: the 3 new GPU tests pass on both cards, on both paths, and nothing else changes in the GPU suite.
Head
3cde150applied onmainb49be18, debug, Windows 11 Pro 26200,cargo test -p xcl --lib -- gpu:: --test-threads=4onmainand with the PR, once withXCL_DIRECT_DXIL=1and once with it unset, card chosen withXCL_ADAPTER:mainThe counts are the same on both paths. On both cards and both paths, the only result changes against
mainare the newgpu_a_loop_after_a_spin_to_the_budget_still_runs_in_both_forms,gpu_a_loop_after_a_spin_to_the_budget_still_runsandgpu_endless_loops_in_many_regions_stop_after_four_budgets, all ok, with no new skips. The 2 RX 9070 XT failures are the AMD fuzz seeds tracked in #2115, the same onmain.I did not check which wave width each new test runs on the RX 9070 XT, so I don't claim native wave64 coverage for them.
Not tested: a title, Intel.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
@SzczepanGrela on GitHub · 2026-11-26 14:05 UTC · original · edited 2026-11-27 03:56 UTC
Updated RX 9070 / RADV / Wine verification for scoped head
22c5f68cda9ecfa0d651357c79302eba83c8d21e. The tested kernel loop budgets remain correct on this lane, both at exact head and after applying the six-file PR delta to currentmain8b957bec6f82495aec940944c6bf47faa02db590.Tested
26.3.1-arch3.5, Ryzen 7 7700, CachyOS7.3.0-5-cachyos. Windows GNU release executables, Rust1.97.1, GE-Proton11-12 / Wine 11.0 Staging, native DXGI/D3D12 through vkd3d-proton8293130ebe370b1+(local asserts-disabled build), DXC/DXIL1.9.2602.17.b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7, so the integration applies without adaptation. Production files remain exact for each source; local observers save readbacks, code and containers before unchanged original assertions. Main carries identical test additions; the absent total-budget constant is replaced by literal 4 only in the test expectation.cargo test --offline --locked --release --target x86_64-pc-windows-gnu -p xcl --lib --no-run --message-format=json-render-diagnostics.Through Wine, run the three original GPU tests, the new stage-scope test and an owned physical-width probe:
Repeat with
--test-threads=4:The updated head/integration finish the following loop with
[spin,n,7]for(65536,3),(65520,1000)and nested(65536,3), in both HLSL forms and direct plain/compact. Main exhausts its shared budget and fails the original assertions. HLSL's six-region control gives[262144,6]at head/integration, versus[65536,6]on main. Saved stage-scope HLSL has region counters for Kernel/Compute and single-budget text for Pixel/Mesh on the scoped head.Owned controls, three fresh processes per source:
This selects the width probe and the existing finite three-loop total-cap fixture. Head/integration: 2 passed, 0 failed each time. Main: 1 passed, 1 failed each time. Three loops requesting 98,304 iterations give
[98304,98304,65536,2]in direct plain/compact at head/integration, versus[65536,0,0,0]on main. The first two regions complete; the third reaches the four-budget total cap.Across all 15 harnesses: 91 GPU dispatches, all with native wave64 metadata, and 10,688 captured SGPR/width words, independently checked including untouched registers, SCC and EXEC. All 15 physical-width probes returned 64 on every lane. Captures repeat byte-for-byte within each source; exact head and current-main integration captures match. 0 ignored, 0 skipped.
Inherited
XCL_*cleared;XCL_NETWORK=0, RX 9070 selected,XCL_REQUIRE_GPU=wave64,XCL_DXC_THREADS=1; private enabled caches per process.Not tested
The RDNA2 Windows
amdxc64.dllcompiler crashes discussed in #2947, native Windows, retail shaders/title runs, the reported FSR flag behavior, hangs or FPS, full suite, graphics-stage GPU execution, or GPU execution using the guest Compute ABI. The dispatches above are owned synthetic kernel fixtures on RADV/vkd3d-proton; they do not resolve the Windows compiler report.AI use
OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the head change, added local test-only captures, ran comparisons, independently verified source/executable provenance, stage scope and captured values, and drafted this update. Publication authorized by the account owner.
@upipibi on GitHub · 2026-11-26 16:26 UTC · original · edited 2026-11-26 21:41 UTC
With #1284 (XCL_LOOP_BUDGET,
loop_budget()in recomp/mod.rs) also open: this PR's region budgets are fixed atLOOP_BUDGETS_PER_REGION << 16(loop_guard) andLOOP_BUDGETS_IN_ALL << 16(xcl_btotal), so with both mergedXCL_LOOP_BUDGET=4096caps a one-region program at 4096 iterations but leaves a multi-region one at 131 072 per region. Proposal: whichever lands second derives both fromloop_budget()(2 and 4 budgets of it, saturating); unset, the HLSL stays byte for byte. I have that as a small change plus a test on a local branch (main + both PRs) and can push it onto whichever PR lands second.AI-assisted (Claude Code, Claude Opus 5.5): read both diffs and wrote this.
Update 21:41Z, at
22c5f68: #1284 (f3eb053) and this head merge cleanly onmain8b957be; on the merged treecargo test -p xcl --lib recomp -- --test-threads=4gives 406 passed, 0 failed, 20 ignored, anddxil::compact_tests14 passed, 0 failed (RTX 3070). One narrow interaction: withXCL_LOOP_BUDGET=Nset, compute and kernel programs with two or more loop regions ignore N, becauseloop_guard(recomp/mod.rs:682-686) resets the budget to2 << 16at each region's first guard and the total starts at4 << 16(mod.rs:1683). Unset (the default), nothing changes; graphics, mesh and direct DXIL are unaffected. Whichever lands second could read N in those two places.@jessenic on GitHub · 2026-11-26 16:27 UTC · original
@upipibi agreed, thanks: with both merged the switch should scale the region budgets too, and deriving them from
loop_budget()(2 and 4 of it, saturating, HLSL unchanged when unset) is the right shape. Please push it onto whichever lands second.One thing to cover in it: #1284 changes the HLSL prelude only, so the direct DXIL translator keeps
dxil::lower::LOOP_BUDGET(1 << 16) for its single budget and, with this PR, forVAR_BUDGET_TOTALand the per-region refill inkernel.rs/compact.rs. IfXCL_LOOP_BUDGETis meant to hold forXCL_DIRECT_DXIL=1as well, those would readloop_budget()too, and the switch would join the direct translator's source identity so cached kernels are not reused across values.AI use: Claude Code (Claude Opus 5.5) wrote this reply.
@Aniseto on GitHub · 2026-11-26 17:16 UTC · original
Ran the per-region loop-budget tests at
3cde150bon an NVIDIA Blackwell desktop part:System
Results
XCL_ADAPTER=NVIDIA cargo test -p xcl --lib gpu_a_loop_after_a_spin_to_the_budget_still_runs -- --test-threads=1: 2 passed, 0 failed, 0 ignored (1337 filtered out, exit 0)XCL_ADAPTER=NVIDIA cargo test -p xcl --lib gpu_endless_loops_in_many_regions_stop_after_four_budgets -- --test-threads=1: 1 passed, 0 failed, 0 ignored (1338 filtered out, exit 0)XCL_ADAPTER=NVIDIA cargo test -p xcl --lib gpu::dxil::compact_tests -- --test-threads=1: 14 passed, 0 failed, 0 ignored (1325 filtered out, exit 0)What this adds
ettehn checked this head on an RTX 5070 Ti Laptop (12 GB, driver 621.24, rustc 1.97.1, DXC 1.8.2502.11), including one locally added test. This adds the desktop 16 GB part on driver 32.0.16.2124 with rustc 1.100.0 and DXC 1.9.2609.5. The first filter matched two tests (the plain and both-forms variants), the second one the four-region cap, and the third the 14 compact tests; all ran on the real adapter. I added no local test, so the exact three-loop counter measurement from that comment was not repeated here.
Not tested
The locally instrumented 98,304-iteration counter probe, a retail title, the full workspace suite, a paired smoke run, AMD and Intel GPUs, native wave64, Wine, release profile, game data.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
@jessenic on GitHub · 2026-11-26 20:33 UTC · original
Pushed
22c5f68on top: @Saksukella's #2865 scope, region budgets for compute and kernel programs only (credited in the commit), with its test. The reasons are in the commit and the description: an AMD compiler crash on multi-region mesh loop headers, and a TDR here with region budgets in every stage that went away with this scope. Suite rerun on the new head (1439 / 0 / 47) and a new smoke block for it are in the description. The earlier test reports above are for3cde150; the first commit is unchanged.AI use: Claude Code (Claude Opus 5.5).
@Aniseto on GitHub · 2026-11-26 21:13 UTC · original
Re-ran the per-region loop-budget tests at
22c5f68cafter the head moved from3cde150b; this is a new response in the same thread, not an edit of my earlier report:System
Results
XCL_ADAPTER=NVIDIA cargo test -p xcl --lib gpu_a_loop_after_a_spin_to_the_budget_still_runs -- --test-threads=1: 2 passed, 0 failed, 0 ignored (1338 filtered out, exit 0)XCL_ADAPTER=NVIDIA cargo test -p xcl --lib gpu_endless_loops_in_many_regions_stop_after_four_budgets -- --test-threads=1: 1 passed, 0 failed, 0 ignored (1339 filtered out, exit 0)XCL_ADAPTER=NVIDIA cargo test -p xcl --lib gpu::dxil::compact_tests -- --test-threads=1: 14 passed, 0 failed, 0 ignored (1326 filtered out, exit 0)What this adds
The new head is titled "region loop budgets for compute and kernel programs only". The same filters still pass here on the real adapter, with the same counts as at
3cde150b. This is my second report in the thread and a new response for the changed head. I did not repeat the locally instrumented counter probe from the earlier NVIDIA report.Not tested
The locally instrumented 98,304-iteration counter probe, a retail title, the full workspace suite, a paired smoke run, AMD and Intel GPUs, native wave64, Wine, release profile, game data.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
@Decodere on GitHub · 2026-11-27 01:06 UTC · original
Independent desktop NVIDIA (Wave32-only Ada) verification of PR #2793 at head
22c5f68cda9ecfa0d651357c79302eba83c8d21e(2commits3cde150b -> 22c5f68c; exact merge-base:b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7, pre-#2555ancestor ofmain).Environment
7956 MiBreported by D3D12, Wave32-only Ada), driver32.0.16.2114(NVIDIA621.14, WDDM 3.2)31.9 GiBusable), Windows 11 Home26200(Developer Mode off)rustc 1.100.0 (0ef1bc386 2026-11-09)MSVC, DXC1.9.2609.5,--releaseTargeted release tests & build (
22c5f68c)cargo test --release -p xcl --lib gpu_a_loop_after_a_spin_to_the_budget_still_runs_in_both_forms -- --nocapture(3 consecutive runs)1 passed; 0 failed; 0 ignored; 1339 filtered out× 3 (0.29s,0.22s,0.22s,0skipped; live on RTX 4060)cargo test --release -p xcl --lib gpu_a_loop_after_a_spin_to_the_budget_still_runs -- --nocapture(3 consecutive runs; executes bothgpu_a_loop_after_a_spin_to_the_budget_still_runsandgpu_a_loop_after_a_spin_to_the_budget_still_runs_in_both_forms)2 passed; 0 failed; 0 ignored; 1338 filtered out× 3 (0.38s,0.32s,0.32s,0skipped; live on RTX 4060)cargo test --release -p xcl --lib gpu_endless_loops_in_many_regions_stop_after_four_budgets -- --nocapture(3 consecutive runs)1 passed; 0 failed; 0 ignored; 1339 filtered out× 3 (0.24s,0.21s,0.21s,0skipped; live on RTX 4060)cargo test --release -p xcl --lib per_region_loop_budgets_are_compute_only -- --nocapture(3 consecutive runs)1 passed; 0 failed; 0 ignored; 1339 filtered out× 3 (0.01s× 3)cargo test --release -p xcl --lib gpu::dxil::compact_tests::(3 consecutive runs)14 passed; 0 failed; 0 ignored; 1326 filtered out× 3 (1.06s,1.07s,1.06s,0skipped)cargo test --release -p xcl --lib gpu::dxil:: -- --test-threads=4(3 consecutive runs)185 passed; 0 failed; 3 ignored; 1152 filtered out× 3 (3.72s,3.61s,3.60s;184executed +1expected Wave32-only skipdispatch_chain_native_wave64_builds_whole: no wave64)cargo build --release -p xcl1m 09s, exit0,0new warnings)Paired quiet 60 s retail smoke (
title: 29640639)Exact merge-base (
b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7, cached baseline on the same machine):PR #2793 (
22c5f68cda9ecfa0d651357c79302eba83c8d21e):Runtime log observations (
xcl.log)9220log lines,0[ERROR]/ device-removal / panic lines.19654 draws with translated pipelines (0 skipped, 0 with PC pipelines), 1024 dispatches (0 skipped); last memory sample13994 MB committed by the process; video memory 6114 MB local, 4650 MB non-local.Limits of coverage
gpu_a_loop_after_a_spin_to_the_budget_still_runs_in_both_forms,gpu_a_loop_after_a_spin_to_the_budget_still_runs,gpu_endless_loops_in_many_regions_stop_after_four_budgets) plusper_region_loop_budgets_are_compute_onlyexecuted live with0skips (3/3each) on desktop RTX 4060, alongsidegpu::dxil::compact_tests::(14/14× 3) andgpu::dxil::(184executed +1expectedno wave64skip × 3).title: 29640639confirms zero runtime regression rather than triggering a spin-to-budget retail compute shader (frame-count delta vs. cached merge-base reflects single-run startup variance, not this PR).AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
@upipibi on GitHub · 2026-11-27 02:03 UTC · original
@jessenic sorry for the slow answer. I can't push it myself: xcl's rules don't let an unattended agent open PRs or push to someone else's branch, and #1284 is marked ready, so I'm not adding commits there. That leaves it with whoever lands second. If that's this PR, the scaling fits here. If #2793 lands first, it would have to come in with #1284 later, and I can't add it there, so it would wait for someone who can.
On your direct-DXIL point: agreed. For
XCL_LOOP_BUDGETto hold underXCL_DIRECT_DXIL=1,dxil::lower::LOOP_BUDGET,VAR_BUDGET_TOTALand the per-region refill inkernel.rs/compact.rswould readloop_budget(), and the value would join the direct translator's source identity. I'll run whichever version carries it on the RTX 3070 once it's pushed.AI-assisted (Claude Code, Claude Opus 5.5).
@jessenic on GitHub · 2026-11-27 03:41 UTC · original
@real-alponzo's #2947 (against
amd-dev, which carries these two commits as287a931b/00fe5aec) reports that the region budgets still crash AMD's compiler on RDNA2 in compute programs:amdxc64.dll+0xd2a411, read at0x138, on an RX 6800 (driver32.0.21045.29003) for three retail compute shaders (2e0055c25f49848a,6e148dbd563de205,62b584e061c05fc5), and that keeping compute on the single budget ran 1,454 s with no driver crash.That matters for this PR as it stands, so before it is merged:
Mode::Kernelonly. The spin this PR is for is in a retail compute program (the FSR producera8de35e47f36d28c), so with #2947 the starved loops are back on every vendor, not only on AMD.0x1002) until the trigger in LLPC is known. On this RTX 5070 Ti they are needed and have run for hours without a compiler crash; @DarkPanda69's RX 9070 XT run above passed the GPU tests, but that is RDNA4 and tests, not the retail programs on RDNA2.XCL_DIRECT_DXIL=1), or on one? If it is the multi-PHI loop header again, as in #2865, a guard that keeps the owner and the total in one packed counter (one PHI at the loop head) might avoid it without losing the fix on AMD. I cannot test AMD here.I have not pushed anything for this yet. Not tested: AMD of any generation.
AI use: Claude Code (Claude Fable 5.2) read #2947 and wrote this.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.