Recompiler: XCL_LOOP_BUDGET sets the loop iteration budget of a lane #1274

Open
upipibi wants to merge 2 commits from upstream-pr/1284 into main
upipibi commented 2026-11-24 14:19:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T14:19:25Z.


LOOP_GUARD caps every lane at 65 536 loop iterations. In the stops of #505, the GPU runs translated compute loops at 100 % for tens of seconds. The current reading there is that the loops run on data a skipped dispatch never wrote:

  • @IvyNotFound found one CS whose loop count is read from a buffer;
  • @oeirughrepuiohg ruled out the split-wave64 meets.

If that reading holds, the budget is what finally ends those loops. There was no way to try a lower one without editing the prelude, so this adds a switch for it. It is a diagnostic, not a fix: the default does not change.

Part of #505.

What is in it

  • Scope: the HLSL path only. Compute programs that go to the direct DXIL translator keep its fixed dxil::lower::LOOP_BUDGET (gpu/dxil/lower.rs:36, 65 536), whatever XCL_LOOP_BUDGET says. The README doesn't list the variable; it is a diagnostic for #505.
  • With #2793: its loop guard passes a fixed budget to region_budget_limits. Whichever of the two lands second has to pass the configured budget there too (throny's merge check).
  • gpu/recomp/mod.rs: loop_budget() reads XCL_LOOP_BUDGET. A whole number from 1 sets the budget; anything else keeps 65 536. Documented at LOOP_GUARD.
  • gpu/recomp/emit.rs: with the variable set to anything but 65 536, the prelude's static uint xcl_budget = 1u << 16; becomes static uint xcl_budget = <n>u;. Unset, the HLSL is byte for byte as on main, so DXIL cache keys and driver blobs stay valid (an earlier head wrote a #define into every prelude; changed after @not-rex's point on #505).
  • gpu/recomp/pso.rs: XCL_LOOP_BUDGET joins the switches whose translations are not cached in memory or on disk (cache_allowed, and its test). DXC's cache is keyed by the HLSL, so it stays correct. The first run with a new value recompiles every shader it meets.
  • gpu/recomp/tests.rs:
    • loop_budget_reads_a_whole_number_from_one checks the parser.
    • gpu_loop_budget_caps_a_loop runs a loop whose exit never comes (s_cmp_lg against 0 after the first increment). It checks that the unset translation keeps main's prelude line, then that the loop stops after 4 096 iterations with the budget at 4096, and 61 440 iterations later at 65 536.

Tested

At the current head 8fc2816 (rebased onto main e99b0bd on 2026-12-03; Foniass's indentation nit in gpu_loop_budget_caps_a_loop fixed): NVIDIA GeForce RTX 3070, driver 621.40, Windows 11 Pro, rustc 1.100.0, debug.

  • cargo test -p xcl --lib -- --test-threads=4: 2865 passed, 0 failed, 37 ignored
  • gpu_loop_budget_caps_a_loop, 3 runs each with XCL_DIRECT_DXIL=0 and =1: 1 passed, 0 failed every run (the test compiles the HLSL prelude, so it checks the HLSL path)

Limit since the rebase: the direct-DXIL backend is now the default (dxil/kernel.rs:43-64), and it has its own fixed budget, LOOP_BUDGET = 1 << 16 (dxil/lower.rs:45, used at :135 and kernel.rs:1311). So XCL_LOOP_BUDGET changes the budget only for programs that take the HLSL path (XCL_DIRECT_DXIL=0, or the HLSL fallback). Wiring it into the direct path would also need a test that can set the budget without the process environment; I have not done that here.

Earlier, at 998dda8:

  • Rebased onto main e429936c as 998dda8 (main added XCL_SAFE_BARRIER to the two lists in pso.rs where this adds XCL_LOOP_BUDGET; both kept). RTX 3070 (616.56), Windows 11 Pro 10.0.26100, debug: cargo test -p xcl --lib -- --test-threads=4: 1997 passed, 6 failed, 28 ignored; main alone: 1995 passed, 6 failed, 28 ignored. The 6 are three dispatch_chain_*, gpu_heap_flat_reads_match_guarded_and_root_output, gpu_compute_mode_dispatch_abi and gpu_float_cas_uses_ieee_equality, the same as on main (#3093). This PR's own tests pass. The smoke pairs below are for the previous head; this one needs a new pair (I have no title).
  • AMD and a second NVIDIA card, run by DarkPanda69 (comment, thanks): head f3eb053 applied on main 1a0bbe3, debug, Windows 11, cargo test -p xcl --lib -- gpu:: --test-threads=4. RX 9070 XT (RDNA4, native wave64): gpu_loop_budget_caps_a_loop passes; 631 passed, 2 failed, 22 ignored (the 2 are #2115's AMD fuzz seeds, the same on main). RTX 3060: the new test passes; 633 passed, 0 failed, 22 ignored.
  • At f3eb053f (rebased onto main 426a5a74, the first main with green CI after 5478c4a7, whose two failing tests main fixed in 0d13b071), RTX 3070 (616.56): gpu_ suite (--skip gpu_sparse_vram) 144 passed, 0 failed with XCL_DIRECT_DXIL=0 and with =1. main 426a5a74 gives 143 passed on both.
  • NVIDIA GeForce RTX 3070, driver 616.56; Windows 11 Pro 26100; Rust 1.100.0 MSVC; debug.
  • cargo build --workspace + cargo test --workspace --no-fail-fast -- --test-threads=4:
    • this PR at the older head 3980a81 (before the rebases; the current head is f3eb053): 753 passed, 0 failed, 41 ignored;
    • main 930e8b4: 751 passed, 0 failed, 41 ignored, same machine.
    • Both skip the same two tests (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware.
  • XCL_LOOP_BUDGET=4096 cargo test -p xcl --lib loop_budget: 2 passed. The budget follows the variable.
  • On cost: in my timing on #505, a 64-thread split-wave64 loop with one exchange per iteration takes 15 ms per Dispatch(4,1,1) to reach 65 536 iterations. At 4 096 it is 16 times shorter.

Regression run

The pairs below are for earlier heads; a pair on 8fc2816 is needed.

Pair for the current head f3eb053 against main 1a0bbe3, run by thehollowedone (comment, thanks): RTX 3080 Ti (621.35), stock scripts/smoke.ps1, clean release builds, 60 s. Pasted unedited. Their note: it checks the default startup path; the world load and a non-default XCL_LOOP_BUDGET were outside these runs.

xcl-smoke v1
commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6
gpu: NVIDIA GeForce RTX 3080 Ti
title: retail-private-fixture
seconds: 60
exit: 0x0
frames shown: 1619 (PresentX 1619)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14439 MB
xcl-smoke v1
commit: f3eb053f932be6070c37300627fa2caf4158e218
gpu: NVIDIA GeForce RTX 3080 Ti
title: retail-private-fixture
seconds: 60
exit: 0x0
frames shown: 1640 (PresentX 1641)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14361 MB

Earlier pair, for the old head 0b28a6b, from Kalmarv's run (thanks):

From Kalmarv's run on an RTX 5070 Ti (NVIDIA 610.74), main 20cf130 and this head 0b28a6b, 60 s each (https://github.com/xcl-dev/xcl/pull/1284#issuecomment-7148089060), thanks:

xcl-smoke v1
commit: 20cf13022f764208384c610c2ae6a3f4eed201a2
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1279 (PresentX 1279)
presents per 2 s (last 3): 4 40 42
device removals: 0
crashes: 0
peak commit: 26967 MB
xcl-smoke v1
commit: 0b28a6bc618d5580c99ada0bc182929536f06abe
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1289 (PresentX 1289)
presents per 2 s (last 3): 11 41 36
device removals: 0
crashes: 0
peak commit: 27396 MB

Not tested

  • Since #2120, main sends enormous compute programs to the direct DXIL translator, which uses its fixed dxil::lower::LOOP_BUDGET. XCL_LOOP_BUDGET sets only the HLSL path's budget, so it doesn't reach those programs.
  • A title, with or without the variable. Whether a working program of the title needs more than a few thousand iterations of one loop per lane, so that a low budget breaks it, is not known.
  • Wine. On AMD, only DarkPanda69's run above.

AI use

  • Claude Code (Claude Opus 5.5) wrote the change and the tests, ran the suites, and wrote this description.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5473912408 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1284). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T14:19:25Z. --- `LOOP_GUARD` caps every lane at 65 536 loop iterations. In the stops of #505, the GPU runs translated compute loops at 100 % for tens of seconds. The current reading there is that the loops run on data a skipped dispatch never wrote: - @IvyNotFound found one CS whose loop count is read from a buffer; - @oeirughrepuiohg ruled out the split-wave64 meets. If that reading holds, the budget is what finally ends those loops. There was no way to try a lower one without editing the prelude, so this adds a switch for it. It is a diagnostic, not a fix: the default does not change. Part of #505. **What is in it** - **Scope: the HLSL path only.** Compute programs that go to the direct DXIL translator keep its fixed `dxil::lower::LOOP_BUDGET` (`gpu/dxil/lower.rs:36`, 65 536), whatever `XCL_LOOP_BUDGET` says. The README doesn't list the variable; it is a diagnostic for #505. - **With #2793:** its loop guard passes a fixed budget to `region_budget_limits`. Whichever of the two lands second has to pass the configured budget there too (throny's merge check). - `gpu/recomp/mod.rs`: `loop_budget()` reads `XCL_LOOP_BUDGET`. A whole number from 1 sets the budget; anything else keeps 65 536. Documented at `LOOP_GUARD`. - `gpu/recomp/emit.rs`: with the variable set to anything but 65 536, the prelude's `static uint xcl_budget = 1u << 16;` becomes `static uint xcl_budget = <n>u;`. Unset, the HLSL is byte for byte as on `main`, so DXIL cache keys and driver blobs stay valid (an earlier head wrote a `#define` into every prelude; changed after @not-rex's point on #505). - `gpu/recomp/pso.rs`: `XCL_LOOP_BUDGET` joins the switches whose translations are not cached in memory or on disk (`cache_allowed`, and its test). DXC's cache is keyed by the HLSL, so it stays correct. The first run with a new value recompiles every shader it meets. - `gpu/recomp/tests.rs`: - `loop_budget_reads_a_whole_number_from_one` checks the parser. - `gpu_loop_budget_caps_a_loop` runs a loop whose exit never comes (`s_cmp_lg` against 0 after the first increment). It checks that the unset translation keeps `main`'s prelude line, then that the loop stops after 4 096 iterations with the budget at 4096, and 61 440 iterations later at 65 536. **Tested** At the current head 8fc2816 (rebased onto `main` e99b0bd on 2026-12-03; Foniass's indentation nit in `gpu_loop_budget_caps_a_loop` fixed): NVIDIA GeForce RTX 3070, driver 621.40, Windows 11 Pro, rustc 1.100.0, debug. - `cargo test -p xcl --lib -- --test-threads=4`: 2865 passed, 0 failed, 37 ignored - `gpu_loop_budget_caps_a_loop`, 3 runs each with `XCL_DIRECT_DXIL=0` and `=1`: 1 passed, 0 failed every run (the test compiles the HLSL prelude, so it checks the HLSL path) **Limit since the rebase:** the direct-DXIL backend is now the default (`dxil/kernel.rs:43-64`), and it has its own fixed budget, `LOOP_BUDGET = 1 << 16` (`dxil/lower.rs:45`, used at `:135` and `kernel.rs:1311`). So `XCL_LOOP_BUDGET` changes the budget only for programs that take the HLSL path (`XCL_DIRECT_DXIL=0`, or the HLSL fallback). Wiring it into the direct path would also need a test that can set the budget without the process environment; I have not done that here. Earlier, at 998dda8: - **Rebased onto `main` `e429936c` as `998dda8`** (main added `XCL_SAFE_BARRIER` to the two lists in `pso.rs` where this adds `XCL_LOOP_BUDGET`; both kept). RTX 3070 (616.56), Windows 11 Pro 10.0.26100, debug: `cargo test -p xcl --lib -- --test-threads=4`: 1997 passed, 6 failed, 28 ignored; main alone: 1995 passed, 6 failed, 28 ignored. The 6 are three `dispatch_chain_*`, `gpu_heap_flat_reads_match_guarded_and_root_output`, `gpu_compute_mode_dispatch_abi` and `gpu_float_cas_uses_ieee_equality`, the same as on main (#3093). This PR's own tests pass. The smoke pairs below are for the previous head; this one needs a new pair (I have no title). - AMD and a second NVIDIA card, run by DarkPanda69 ([comment](https://github.com/xcl-dev/xcl/pull/1284#issuecomment-7163789100), thanks): head `f3eb053` applied on `main` `1a0bbe3`, debug, Windows 11, `cargo test -p xcl --lib -- gpu:: --test-threads=4`. RX 9070 XT (RDNA4, native wave64): `gpu_loop_budget_caps_a_loop` passes; 631 passed, 2 failed, 22 ignored (the 2 are #2115's AMD fuzz seeds, the same on `main`). RTX 3060: the new test passes; 633 passed, 0 failed, 22 ignored. - At `f3eb053f` (rebased onto `main` `426a5a74`, the first `main` with green CI after `5478c4a7`, whose two failing tests main fixed in `0d13b071`), RTX 3070 (616.56): `gpu_` suite (`--skip gpu_sparse_vram`) 144 passed, 0 failed with `XCL_DIRECT_DXIL=0` and with `=1`. `main` `426a5a74` gives 143 passed on both. - NVIDIA GeForce RTX 3070, driver 616.56; Windows 11 Pro 26100; Rust 1.100.0 MSVC; debug. - `cargo build --workspace` + `cargo test --workspace --no-fail-fast -- --test-threads=4`: - this PR at the older head `3980a81` (before the rebases; the current head is `f3eb053`): 753 passed, 0 failed, 41 ignored; - `main` `930e8b4`: 751 passed, 0 failed, 41 ignored, same machine. - Both skip the same two tests (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware`. - `XCL_LOOP_BUDGET=4096 cargo test -p xcl --lib loop_budget`: 2 passed. The budget follows the variable. - On cost: in my timing on #505, a 64-thread split-wave64 loop with one exchange per iteration takes 15 ms per `Dispatch(4,1,1)` to reach 65 536 iterations. At 4 096 it is 16 times shorter. **Regression run** The pairs below are for earlier heads; a pair on 8fc2816 is needed. Pair for the current head `f3eb053` against `main` `1a0bbe3`, run by thehollowedone ([comment](https://github.com/xcl-dev/xcl/pull/1284#issuecomment-7162107083), thanks): RTX 3080 Ti (621.35), stock `scripts/smoke.ps1`, clean release builds, 60 s. Pasted unedited. Their note: it checks the default startup path; the world load and a non-default `XCL_LOOP_BUDGET` were outside these runs. ``` xcl-smoke v1 commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6 gpu: NVIDIA GeForce RTX 3080 Ti title: retail-private-fixture seconds: 60 exit: 0x0 frames shown: 1619 (PresentX 1619) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14439 MB ``` ``` xcl-smoke v1 commit: f3eb053f932be6070c37300627fa2caf4158e218 gpu: NVIDIA GeForce RTX 3080 Ti title: retail-private-fixture seconds: 60 exit: 0x0 frames shown: 1640 (PresentX 1641) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14361 MB ``` Earlier pair, for the old head `0b28a6b`, from Kalmarv's run (thanks): From Kalmarv's run on an RTX 5070 Ti (NVIDIA 610.74), `main` `20cf130` and this head `0b28a6b`, 60 s each (https://github.com/xcl-dev/xcl/pull/1284#issuecomment-7148089060), thanks: ``` xcl-smoke v1 commit: 20cf13022f764208384c610c2ae6a3f4eed201a2 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1279 (PresentX 1279) presents per 2 s (last 3): 4 40 42 device removals: 0 crashes: 0 peak commit: 26967 MB ``` ``` xcl-smoke v1 commit: 0b28a6bc618d5580c99ada0bc182929536f06abe gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1289 (PresentX 1289) presents per 2 s (last 3): 11 41 36 device removals: 0 crashes: 0 peak commit: 27396 MB ``` **Not tested** - Since #2120, `main` sends enormous compute programs to the direct DXIL translator, which uses its fixed `dxil::lower::LOOP_BUDGET`. `XCL_LOOP_BUDGET` sets only the HLSL path's budget, so it doesn't reach those programs. - A title, with or without the variable. Whether a working program of the title needs more than a few thousand iterations of one loop per lane, so that a low budget breaks it, is not known. - Wine. On AMD, only DarkPanda69's run above. **AI use** - Claude Code (Claude Opus 5.5) wrote the change and the tests, ran the suites, and wrote this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
futurepro62 commented 2026-11-24 15:05:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T14:34:01Z.


Full-suite run, since this PR has no test report yet. Tested exact head e1573e3 (on its base 930e8b4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 753 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: loop_budget_reads_a_whole_number_from_one, gpu_loop_budget_define_caps_a_loop.

Not tested

  • AMD, a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7134585808 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1284#issuecomment-7134585808). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T14:34:01Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `e1573e3` (on its base `930e8b4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **753 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `loop_budget_reads_a_whole_number_from_one`, `gpu_loop_budget_define_caps_a_loop`. **Not tested** - AMD, a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Kalmarv commented 2026-11-24 16:07:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-24T15:25:30Z.


Regression pair for 3980a81 against main 930e8b4 (this PR's base), on a retail title, for the Regression run section. Both runs pass: no device removal, no crash, 101 % of main's frames, 105 % of its peak commit.

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74), AMD Ryzen 9 9950X, Windows 11 Pro 26200.
  • scripts/smoke.ps1, the same retail title for 60 s each: main at 930e8b4 (this PR's base) first, then this PR's head, one after the other on the same machine. XCL_LOOP_BUDGET was unset, so the PR's run used the default budget.

main 930e8b4:

xcl-smoke v1
commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56
gpu: NVIDIA GeForce RTX 5070 Ti
title: GTA VI
seconds: 60
exit: 0x0
frames shown: 1302 (PresentX 1302)
presents per 2 s (last 3): 12 17 21
device removals: 0
crashes: 0
peak commit: 25725 MB

this PR, 3980a81:

xcl-smoke v1
commit: 3980a81864ea3eb2a181472e857a54b69ae39349
gpu: NVIDIA GeForce RTX 5070 Ti
title: GTA VI
seconds: 60
exit: 0x0
frames shown: 1318 (PresentX 1318)
presents per 2 s (last 3): 39 40 37
device removals: 0
crashes: 0
peak commit: 26939 MB

For #505 (earlier runs, not this pair). On this machine the 100 % phase before the removal is one dispatch: the BVH builder's refit program (cs b6043104de672057), whose threads climb parent links, and a local build of main that skipped it had no device removal. A lower XCL_LOOP_BUDGET caps exactly that climb.

Not tested

  • XCL_PSO_WAIT_MS=50 + XCL_LOOP_BUDGET=4096 for 300 s (on e1573e3, before the last push): it ended at 118 s in the known title crash at +0x2215c35 (#1270), before the point where #505 stops. It may have reused cached programs built with the default budget, so it does not show the 4096 budget applied. There is no main run with these settings.
  • World loading: a 60 s run ends before it, so neither run reaches the point where #505 stops.
  • The whole suite (futurepro62's run above covers it), AMD, Linux.

AI use: Claude Code (Claude Opus 5.5)

<!-- greyfinch-sync:ivall/xcl:comment:7136003793 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1284#issuecomment-7136003793). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-24T15:25:30Z. --- Regression pair for `3980a81` against `main` `930e8b4` (this PR's base), on a retail title, for the **Regression run** section. Both runs pass: no device removal, no crash, 101 % of `main`'s frames, 105 % of its peak commit. **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74), AMD Ryzen 9 9950X, Windows 11 Pro 26200. - `scripts/smoke.ps1`, the same retail title for 60 s each: `main` at `930e8b4` (this PR's base) first, then this PR's head, one after the other on the same machine. `XCL_LOOP_BUDGET` was unset, so the PR's run used the default budget. `main` `930e8b4`: ``` xcl-smoke v1 commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56 gpu: NVIDIA GeForce RTX 5070 Ti title: GTA VI seconds: 60 exit: 0x0 frames shown: 1302 (PresentX 1302) presents per 2 s (last 3): 12 17 21 device removals: 0 crashes: 0 peak commit: 25725 MB ``` this PR, `3980a81`: ``` xcl-smoke v1 commit: 3980a81864ea3eb2a181472e857a54b69ae39349 gpu: NVIDIA GeForce RTX 5070 Ti title: GTA VI seconds: 60 exit: 0x0 frames shown: 1318 (PresentX 1318) presents per 2 s (last 3): 39 40 37 device removals: 0 crashes: 0 peak commit: 26939 MB ``` **For #505 (earlier runs, not this pair).** On this machine the 100 % phase before the removal is one dispatch: the BVH builder's refit program (`cs b6043104de672057`), whose threads climb parent links, and a local build of `main` that skipped it had no device removal. A lower `XCL_LOOP_BUDGET` caps exactly that climb. **Not tested** - `XCL_PSO_WAIT_MS=50` + `XCL_LOOP_BUDGET=4096` for 300 s (on `e1573e3`, before the last push): it ended at 118 s in the known title crash at `+0x2215c35` (#1270), before the point where #505 stops. It may have reused cached programs built with the default budget, so it does not show the 4096 budget applied. There is no `main` run with these settings. - World loading: a 60 s run ends before it, so neither run reaches the point where #505 stops. - The whole suite (futurepro62's run above covers it), AMD, Linux. **AI use:** Claude Code (Claude Opus 5.5)
not-rex commented 2026-11-24 21:08:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by not-rex on 2026-11-24T19:14:39Z.


RTX 3080 (10 GB, driver 610.88, Windows 11), retail 1.0.2.1 into the world: with XCL_LOOP_BUDGET=4096 the GPU no longer hangs; it works in bounded bursts and the title keeps presenting for about 110 s longer, until a different fault in the title.

Tested

  • Tree: main 930e8b4 + #1123 + #1254 (diagnostics) + this PR at 3980a81 (clean merge), release. Warm DXIL cache and save from earlier runs, no full pipeline precompile. XCL_PSO_WAIT_MS=50, A pressed at 30 and 40 s, XCL_ACTIVITY=1, XCL_NETWORK=0, 400 s limit, GPU sampled with nvidia-smi every 2 s. One run with the budget; the comparison run is the same tree without this PR (without the variable this PR leaves the HLSL unchanged).
without (main tree) this PR, XCL_LOOP_BUDGET=4096
first ListX #101 90.3 s 88.6 s
presents after #101 12 (last at 124.1 s) 35 (last at 238.2 s)
GPU queue.Wait … did not complete within 5000 ms 18 (first 125.1 s) 93 (first 129.1 s)
"would close a GPU cycle" 5 32
GPU after presents slow down 100 % from ~122 s until the hang 100 % bursts of 6-12 s with idle gaps, ~128-238 s; idle after
end 0x887A0006 (hung) at 168.5 s 0xC0000005 at +0x4e8b4be (read at -1, about ten threads at once) at 241.3 s
peak commit / local video memory 31.9 GB / 14.5 GB 32.7 GB / 15.0 GB

With the budget, the title limps on at about 1 present and 40-60 submissions per 2 s for ~110 s after the point where the tree without it hangs, and the GPU keeps coming back between bursts. That fits the reading on #505 that the stop is loops running long on data a skipped dispatch never wrote. The title then faults at +0x4e8b4be, which I haven't seen in any other run on this machine; it may be what a capped loop leaves behind.

Not tested: other budgets (4096 only); more than one run; without XCL_PSO_WAIT_MS; AMD.

AI use: Claude Code (Claude Opus 5.5) ran the runs on my machine through a scripted runner and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7141812198 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1284#issuecomment-7141812198). Originally posted by [not-rex](https://github.com/not-rex) on 2026-11-24T19:14:39Z. --- **RTX 3080 (10 GB, driver 610.88, Windows 11), retail 1.0.2.1 into the world: with `XCL_LOOP_BUDGET=4096` the GPU no longer hangs; it works in bounded bursts and the title keeps presenting for about 110 s longer, until a different fault in the title.** **Tested** - Tree: `main` `930e8b4` + #1123 + #1254 (diagnostics) + this PR at `3980a81` (clean merge), release. Warm DXIL cache and save from earlier runs, no full pipeline precompile. `XCL_PSO_WAIT_MS=50`, A pressed at 30 and 40 s, `XCL_ACTIVITY=1`, `XCL_NETWORK=0`, 400 s limit, GPU sampled with `nvidia-smi` every 2 s. One run with the budget; the comparison run is the same tree without this PR (without the variable this PR leaves the HLSL unchanged). | | without (`main` tree) | this PR, `XCL_LOOP_BUDGET=4096` | |---|---|---| | first `ListX #101` | 90.3 s | 88.6 s | | presents after `#101` | 12 (last at 124.1 s) | 35 (last at 238.2 s) | | `GPU queue.Wait … did not complete within 5000 ms` | 18 (first 125.1 s) | 93 (first 129.1 s) | | "would close a GPU cycle" | 5 | 32 | | GPU after presents slow down | 100 % from ~122 s until the hang | 100 % bursts of 6-12 s with idle gaps, ~128-238 s; idle after | | end | `0x887A0006` (hung) at 168.5 s | `0xC0000005` at `+0x4e8b4be` (read at -1, about ten threads at once) at 241.3 s | | peak commit / local video memory | 31.9 GB / 14.5 GB | 32.7 GB / 15.0 GB | With the budget, the title limps on at about 1 present and 40-60 submissions per 2 s for ~110 s after the point where the tree without it hangs, and the GPU keeps coming back between bursts. That fits the reading on #505 that the stop is loops running long on data a skipped dispatch never wrote. The title then faults at `+0x4e8b4be`, which I haven't seen in any other run on this machine; it may be what a capped loop leaves behind. **Not tested:** other budgets (4096 only); more than one run; without `XCL_PSO_WAIT_MS`; AMD. AI use: Claude Code (Claude Opus 5.5) ran the runs on my machine through a scripted runner and wrote this report.
upipibi commented 2026-11-25 00:08:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T23:32:09Z.


Rebased onto main 20cf130 (now 0b28a6b). One conflict in recomp/mod.rs: #1307's STRUCTURED_BYTES_PER_CODE_BYTE landed next to loop_budget; both are kept, unchanged. RTX 3070, driver 616.56: tests matching loop_budget / loop, 23 passed, 0 failed, with and without XCL_DIRECT_DXIL=1.

<!-- greyfinch-sync:ivall/xcl:comment:7147509990 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1284#issuecomment-7147509990). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T23:32:09Z. --- Rebased onto `main` `20cf130` (now `0b28a6b`). One conflict in `recomp/mod.rs`: #1307's `STRUCTURED_BYTES_PER_CODE_BYTE` landed next to `loop_budget`; both are kept, unchanged. RTX 3070, driver 616.56: tests matching `loop_budget` / `loop`, 23 passed, 0 failed, with and without `XCL_DIRECT_DXIL=1`.
upipibi commented 2026-11-25 00:09:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T23:39:58Z.


The rebase onto 20cf130 moved the head to 0b28a6b, so the PR description check now wants the Regression-run pair made on that head. The pair in the description (Kalmarv's, thanks) is for 3980a81. The rebase changed only the conflict lines in recomp/mod.rs; loop_budget is untouched and the suite passes. I can't make a smoke run here (no title). If someone with one has a minute, a scripts/smoke.ps1 pair of main 20cf130 and 0b28a6b would clear it, and I'll paste it in with credit.

<!-- greyfinch-sync:ivall/xcl:comment:7147658964 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1284#issuecomment-7147658964). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T23:39:58Z. --- The rebase onto `20cf130` moved the head to `0b28a6b`, so the `PR description` check now wants the Regression-run pair made on that head. The pair in the description (Kalmarv's, thanks) is for `3980a81`. The rebase changed only the conflict lines in `recomp/mod.rs`; `loop_budget` is untouched and the suite passes. I can't make a smoke run here (no title). If someone with one has a minute, a `scripts/smoke.ps1` pair of `main` `20cf130` and `0b28a6b` would clear it, and I'll paste it in with credit.
Kalmarv commented 2026-11-25 00:09:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-24T23:45:48Z.


@upipibi on it: a scripts/smoke.ps1 pair of main 20cf130 and 0b28a6b on an RTX 5070 Ti is queued behind a run that's using the GPU now. I'll post both blocks here within the hour.

AI use: Claude Code (Claude Opus 5.5) wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7147766789 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1284#issuecomment-7147766789). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-24T23:45:48Z. --- @upipibi on it: a `scripts/smoke.ps1` pair of `main` `20cf130` and `0b28a6b` on an RTX 5070 Ti is queued behind a run that's using the GPU now. I'll post both blocks here within the hour. AI use: Claude Code (Claude Opus 5.5) wrote this.
Kalmarv commented 2026-11-25 00:09:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-25T00:03:25Z.


@upipibi here is the pair. scripts/smoke.ps1, the same retail title for 60 s each, one after the other, release builds from clean trees. RTX 5070 Ti (NVIDIA 610.74), Ryzen 9 9950X, Windows 11 26200. A separate NVIDIA driver build was running in another process during both runs.

main 20cf130:

xcl-smoke v1
commit: 20cf13022f764208384c610c2ae6a3f4eed201a2
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1279 (PresentX 1279)
presents per 2 s (last 3): 4 40 42
device removals: 0
crashes: 0
peak commit: 26967 MB

#1284 0b28a6b:

xcl-smoke v1
commit: 0b28a6bc618d5580c99ada0bc182929536f06abe
gpu: NVIDIA GeForce RTX 5070 Ti
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1289 (PresentX 1289)
presents per 2 s (last 3): 11 41 36
device removals: 0
crashes: 0
peak commit: 27396 MB

1289 / 1279 frames (101 %), peak commit 27396 / 26967 MB (102 %), no device removal or crash on either run. No out-of-memory or exception lines in either log.

AI use: Claude Code (Claude Opus 5.5) ran the pair and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7148089060 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1284#issuecomment-7148089060). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-25T00:03:25Z. --- @upipibi here is the pair. `scripts/smoke.ps1`, the same retail title for 60 s each, one after the other, release builds from clean trees. RTX 5070 Ti (NVIDIA 610.74), Ryzen 9 9950X, Windows 11 26200. A separate NVIDIA driver build was running in another process during both runs. `main` `20cf130`: ``` xcl-smoke v1 commit: 20cf13022f764208384c610c2ae6a3f4eed201a2 gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1279 (PresentX 1279) presents per 2 s (last 3): 4 40 42 device removals: 0 crashes: 0 peak commit: 26967 MB ``` #1284 `0b28a6b`: ``` xcl-smoke v1 commit: 0b28a6bc618d5580c99ada0bc182929536f06abe gpu: NVIDIA GeForce RTX 5070 Ti title: ea3b5e4d seconds: 60 exit: 0x0 frames shown: 1289 (PresentX 1289) presents per 2 s (last 3): 11 41 36 device removals: 0 crashes: 0 peak commit: 27396 MB ``` 1289 / 1279 frames (101 %), peak commit 27396 / 26967 MB (102 %), no device removal or crash on either run. No out-of-memory or exception lines in either log. AI use: Claude Code (Claude Opus 5.5) ran the pair and wrote this.
JJAutoCompare commented 2026-11-25 03:05:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T03:00:46Z.


XCL PR #1284 — Intel Arc A770 loop budget compatibility

Tested

  • Exact clean head 81745f8d18. GitHub showed the PR open at that head before and after the run. I checked the seven existing comments and found no Arc report for this head. PR #1284
  • Intel Arc A770, driver 32.0.101.9175, AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation 25H2 build 26200.9974. Rust 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc), Cargo 1.100.0 (3acc79c0c), unoptimized test profile. The GPU log reports dxcompiler 1.9.2609.5 (01b62ad4) and dxil 1.9.2609.5 from the configured DXC directory. dxc.exe in that directory also reports file version 1.9.2609.5.
  • The parser fixture passed in 0.40 s. Counts were 1 passed, 0 failed, 0 ignored, 0 skipped.
  • The bounded HLSL/DXC GPU fixture passed in 3.82 s under the Arc lock. Counts were 1 passed, 0 failed, 0 ignored, 0 skipped. With XCL_LOOP_BUDGET unset, it verified the default prelude line and dispatched the checked-in wave32 cases for 4,096 and 65,536. Its assertions verified that the smaller case returned 4,096 or 4,097 and that the default-budget case returned exactly 61,440 more. The fixture reports the combined time and only prints exact counter values on an assertion failure.
  • Each exact harness invocation filtered out 1,125 other tests. Cargo prebuild and both test processes exited 0. The GPU log records acquisition and release of the Arc lock.

Commands

Process environment for both commands (XCL_LOOP_BUDGET unset).

CARGO_TARGET_DIR=L:/XclTooling/pr1844-71f2ceb-t3-737e5ee5/target
CARGO_BUILD_JOBS=2
CARGO_INCREMENTAL=0
CARGO_PROFILE_DEV_DEBUG=0
CARGO_PROFILE_TEST_DEBUG=0
TEMP=L:/XclTooling/pr1284/81745f8-20261125-035452420/temp
TMP=L:/XclTooling/pr1284/81745f8-20261125-035452420/temp
XCL_ADAPTER=A770
XCL_DXC_DIR=C:/Users/ljensen/AppData/Local/XclTooling/dxc-1.9.2609/bin/x64

Prebuilt the library test executable outside the Arc lock (Cargo reported 1m 02s).

& 'C:/Users/ljensen/.cargo/bin/cargo.exe' +stable-x86_64-pc-windows-msvc test -p xcl --lib --no-run --locked --message-format=json

Exact test arguments for the Cargo-reported executable.

$bin = 'L:/XclTooling/pr1844-71f2ceb-t3-737e5ee5/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe'
& $bin gpu::recomp::tests::loop_budget_reads_a_whole_number_from_one --exact --nocapture --test-threads=1
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { & $bin gpu::recomp::tests::gpu_loop_budget_caps_a_loop --exact --nocapture --test-threads=1 }

The GPU command ran in a child Windows PowerShell with -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -EncodedCommand, with the test executable path passed through XCL_PR1284_LIBTEST_EXE. RemoteSigned applied to that process only. The machine policy was unchanged.

Logs beside this report include prebuild.log, prebuild.jsonl, parser.stdout.log, parser.stderr.log, gpu.stdout.log, gpu.stderr.log, and run-status.log.

Not tested

  • Retail titles or the paired main/PR smoke run, the workspace suite, release builds, other adapters, the direct DXIL backend, or stress cases. The GPU fixture exercised only its checked-in 4,096 and 65,536 budgets.

AI use

  • T3 Code / Codex (gpt-6.2-sol) ran the two checked-in fixtures, verified the head and existing conversation, and wrote this report.
<!-- greyfinch-sync:ivall/xcl:comment:7151501642 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1284#issuecomment-7151501642). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T03:00:46Z. --- XCL PR #1284 — Intel Arc A770 loop budget compatibility Tested - Exact clean head 81745f8d185f1f90d893cc3700e25f4830ba96f2. GitHub showed the PR open at that head before and after the run. I checked the seven existing comments and found no Arc report for this head. [PR #1284](https://github.com/xcl-dev/xcl/pull/1284) - Intel Arc A770, driver 32.0.101.9175, AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation 25H2 build 26200.9974. Rust 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc), Cargo 1.100.0 (3acc79c0c), unoptimized test profile. The GPU log reports dxcompiler 1.9.2609.5 (01b62ad4) and dxil 1.9.2609.5 from the configured DXC directory. dxc.exe in that directory also reports file version 1.9.2609.5. - The parser fixture passed in 0.40 s. Counts were 1 passed, 0 failed, 0 ignored, 0 skipped. - The bounded HLSL/DXC GPU fixture passed in 3.82 s under the Arc lock. Counts were 1 passed, 0 failed, 0 ignored, 0 skipped. With XCL_LOOP_BUDGET unset, it verified the default prelude line and dispatched the checked-in wave32 cases for 4,096 and 65,536. Its assertions verified that the smaller case returned 4,096 or 4,097 and that the default-budget case returned exactly 61,440 more. The fixture reports the combined time and only prints exact counter values on an assertion failure. - Each exact harness invocation filtered out 1,125 other tests. Cargo prebuild and both test processes exited 0. The GPU log records acquisition and release of the Arc lock. Commands Process environment for both commands (XCL_LOOP_BUDGET unset). CARGO_TARGET_DIR=L:/XclTooling/pr1844-71f2ceb-t3-737e5ee5/target CARGO_BUILD_JOBS=2 CARGO_INCREMENTAL=0 CARGO_PROFILE_DEV_DEBUG=0 CARGO_PROFILE_TEST_DEBUG=0 TEMP=L:/XclTooling/pr1284/81745f8-20261125-035452420/temp TMP=L:/XclTooling/pr1284/81745f8-20261125-035452420/temp XCL_ADAPTER=A770 XCL_DXC_DIR=C:/Users/ljensen/AppData/Local/XclTooling/dxc-1.9.2609/bin/x64 Prebuilt the library test executable outside the Arc lock (Cargo reported 1m 02s). & 'C:/Users/ljensen/.cargo/bin/cargo.exe' +stable-x86_64-pc-windows-msvc test -p xcl --lib --no-run --locked --message-format=json Exact test arguments for the Cargo-reported executable. $bin = 'L:/XclTooling/pr1844-71f2ceb-t3-737e5ee5/target/debug/build/xcl/97fdf2b9ff8e1482/out/xcl-97fdf2b9ff8e1482.exe' & $bin gpu::recomp::tests::loop_budget_reads_a_whole_number_from_one --exact --nocapture --test-threads=1 & 'L:/XclTooling/Invoke-ArcTest.ps1' -Test { & $bin gpu::recomp::tests::gpu_loop_budget_caps_a_loop --exact --nocapture --test-threads=1 } The GPU command ran in a child Windows PowerShell with -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -EncodedCommand, with the test executable path passed through XCL_PR1284_LIBTEST_EXE. RemoteSigned applied to that process only. The machine policy was unchanged. Logs beside this report include prebuild.log, prebuild.jsonl, parser.stdout.log, parser.stderr.log, gpu.stdout.log, gpu.stderr.log, and run-status.log. Not tested - Retail titles or the paired main/PR smoke run, the workspace suite, release builds, other adapters, the direct DXIL backend, or stress cases. The GPU fixture exercised only its checked-in 4,096 and 65,536 budgets. AI use - T3 Code / Codex (gpt-6.2-sol) ran the two checked-in fixtures, verified the head and existing conversation, and wrote this report.
thehollowedone commented 2026-11-25 13:05:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-25T12:14:30Z.


Here is the requested pair from the stock scripts/smoke.ps1 on clean release builds of main 1a0bbe3 and PR head f3eb053.

RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC. Both runs used separate copies of the same starting profile and DXIL cache seed, networking and PSO preload off, a 16 GiB job commit cap, and a 12 GiB system commit floor. XCL_LOOP_BUDGET was unset and no input was sent. Both runs completed normally.

xcl-smoke v1
commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6
gpu: NVIDIA GeForce RTX 3080 Ti
title: retail-private-fixture
seconds: 60
exit: 0x0
frames shown: 1619 (PresentX 1619)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14439 MB
xcl-smoke v1
commit: f3eb053f932be6070c37300627fa2caf4158e218
gpu: NVIDIA GeForce RTX 3080 Ti
title: retail-private-fixture
seconds: 60
exit: 0x0
frames shown: 1640 (PresentX 1641)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14361 MB

This checks the default startup path. World load and the non-default loop budget were outside these runs.

AI-assisted. Codex (GPT-6, exact variant unavailable) ran the smoke pair and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7162107083 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1284#issuecomment-7162107083). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-25T12:14:30Z. --- Here is the requested pair from the stock `scripts/smoke.ps1` on clean release builds of [main 1a0bbe3](https://github.com/xcl-dev/xcl/commit/1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6) and [PR head f3eb053](https://github.com/xcl-dev/xcl/commit/f3eb053f932be6070c37300627fa2caf4158e218). RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC. Both runs used separate copies of the same starting profile and DXIL cache seed, networking and PSO preload off, a 16 GiB job commit cap, and a 12 GiB system commit floor. `XCL_LOOP_BUDGET` was unset and no input was sent. Both runs completed normally. ``` xcl-smoke v1 commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6 gpu: NVIDIA GeForce RTX 3080 Ti title: retail-private-fixture seconds: 60 exit: 0x0 frames shown: 1619 (PresentX 1619) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14439 MB ``` ``` xcl-smoke v1 commit: f3eb053f932be6070c37300627fa2caf4158e218 gpu: NVIDIA GeForce RTX 3080 Ti title: retail-private-fixture seconds: 60 exit: 0x0 frames shown: 1640 (PresentX 1641) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14361 MB ``` This checks the default startup path. World load and the non-default loop budget were outside these runs. AI-assisted. Codex (GPT-6, exact variant unavailable) ran the smoke pair and drafted this report.
DarkPanda69 commented 2026-11-25 13:26:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DarkPanda69 on 2026-11-25T13:26:49Z.


Update for head 998dda8 (on main e429936): cargo test -p xcl --lib -- gpu:: --test-threads=4 --nocapture, head against main, card picked with XCL_ADAPTER:

  • RX 9070 XT: 776 → 778 passed, 8 failed (the same 8 as main: the #2115 fuzz seeds, the five from #3093 and gpu_ps_readfirstlane_loop_on_a_primitive), 6 SKIPPED.
  • RTX 3060: 778 → 780 passed, 6 failed (the six from #3093, same as main), 24 SKIPPED.
  • On both, the only changes are gpu_loop_budget_caps_a_loop and loop_budget_reads_a_whole_number_from_one, both ok.

With XCL_LOOP_BUDGET=4096 set for the whole run, there's one more failure on both cards: console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk (pso.rs:2420, cache entries.len() 0, expected 1). It also fails with XCL_LOOP_BUDGET=1. That looks expected rather than a bug: this PR adds XCL_LOOP_BUDGET to cache_allowed's bypass list, and the test reads the real environment. main fails the same test the same way with XCL_SAFE_BARRIER=1 (checked on the RX 9070 XT). So if anyone runs the suite with the variable set, that failure is the cache bypass doing its job.

AMD run (listed as untested), plus an RTX 3060: the new GPU test passes on both.

Head f3eb053 applied on main 1a0bbe3, debug, Windows 11 Pro 26200, cargo test -p xcl --lib -- gpu:: --test-threads=4:

  • RX 9070 XT (RDNA4, driver 32.0.32029.2010, native wave64): gpu_loop_budget_caps_a_loop ok. 631 passed, 2 failed, 22 ignored, 6 SKIPPED; the 2 failures are the AMD fuzz seeds tracked in #2115, the same on main.
  • RTX 3060 (driver 32.0.16.1088): the new test ok; 633 passed, 0 failed, 22 ignored.

Not tested: a title with or without XCL_LOOP_BUDGET, Wine.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7163789100 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1284#issuecomment-7163789100). Originally posted by [DarkPanda69](https://github.com/DarkPanda69) on 2026-11-25T13:26:49Z. --- **Update for head `998dda8`** (on `main` `e429936`): `cargo test -p xcl --lib -- gpu:: --test-threads=4 --nocapture`, head against `main`, card picked with `XCL_ADAPTER`: - RX 9070 XT: 776 → 778 passed, 8 failed (the same 8 as `main`: the #2115 fuzz seeds, the five from #3093 and `gpu_ps_readfirstlane_loop_on_a_primitive`), 6 SKIPPED. - RTX 3060: 778 → 780 passed, 6 failed (the six from #3093, same as `main`), 24 SKIPPED. - On both, the only changes are `gpu_loop_budget_caps_a_loop` and `loop_budget_reads_a_whole_number_from_one`, both ok. With `XCL_LOOP_BUDGET=4096` set for the whole run, there's one more failure on both cards: `console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk` (`pso.rs:2420`, cache `entries.len()` 0, expected 1). It also fails with `XCL_LOOP_BUDGET=1`. That looks expected rather than a bug: this PR adds `XCL_LOOP_BUDGET` to `cache_allowed`'s bypass list, and the test reads the real environment. `main` fails the same test the same way with `XCL_SAFE_BARRIER=1` (checked on the RX 9070 XT). So if anyone runs the suite with the variable set, that failure is the cache bypass doing its job. AMD run (listed as untested), plus an RTX 3060: the new GPU test passes on both. Head `f3eb053` applied on `main` `1a0bbe3`, debug, Windows 11 Pro 26200, `cargo test -p xcl --lib -- gpu:: --test-threads=4`: - **RX 9070 XT** (RDNA4, driver 32.0.32029.2010, native wave64): `gpu_loop_budget_caps_a_loop` ok. 631 passed, 2 failed, 22 ignored, 6 SKIPPED; the 2 failures are the AMD fuzz seeds tracked in #2115, the same on `main`. - **RTX 3060** (driver 32.0.16.1088): the new test ok; 633 passed, 0 failed, 22 ignored. Not tested: a title with or without `XCL_LOOP_BUDGET`, Wine. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
DavidM1911 commented 2026-11-26 02:08:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T01:17:33Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 26 ignored.

Thanks!

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7179627284 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1284#issuecomment-7179627284). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T01:17:33Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 26 ignored. Thanks! — Devin
thehollowedone commented 2026-11-28 02:24:10 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-28T02:24:10Z.


Source-review note on the current #1284 diff: XCL_LOOP_BUDGET changes the HLSL prelude in recomp/emit.rs, but the direct DXIL compute backend initializes VAR_BUDGET from its separate fixed LOOP_BUDGET = 1 << 16 (gpu/dxil/lower.rs). A compute program routed through direct DXIL therefore still has the 65,536-iteration budget when this switch is set to 4,096; HLSL fallbacks use the requested value. The checked-in GPU test calls translate and compiles its HLSL, so running that test with XCL_DIRECT_DXIL=1 does not exercise the direct backend.

This need not expand this diagnostic PR. I suggest stating the HLSL-only scope in its description/README and, if the switch is intended to govern all routes, covering the direct path separately with a test that enters through production backend selection and checks a non-default value. #2769 adds the default loop guard to the per-lane path; it does not make the value configurable.

AI use: OpenAI Codex (GPT-6.2 Sol) traced the current source and drafted this note. No runtime measurement is claimed.

<!-- greyfinch-sync:ivall/xcl:comment:7232337733 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1284#issuecomment-7232337733). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-28T02:24:10Z. --- Source-review note on the current #1284 diff: `XCL_LOOP_BUDGET` changes the HLSL prelude in `recomp/emit.rs`, but the direct DXIL compute backend initializes `VAR_BUDGET` from its separate fixed `LOOP_BUDGET = 1 << 16` (`gpu/dxil/lower.rs`). A compute program routed through direct DXIL therefore still has the 65,536-iteration budget when this switch is set to 4,096; HLSL fallbacks use the requested value. The checked-in GPU test calls `translate` and compiles its HLSL, so running that test with `XCL_DIRECT_DXIL=1` does not exercise the direct backend. This need not expand this diagnostic PR. I suggest stating the HLSL-only scope in its description/README and, if the switch is intended to govern all routes, covering the direct path separately with a test that enters through production backend selection and checks a non-default value. [#2769](https://github.com/xcl-dev/xcl/pull/2769) adds the default loop guard to the per-lane path; it does not make the value configurable. AI use: OpenAI Codex (GPT-6.2 Sol) traced the current source and drafted this note. No runtime measurement is claimed.
throny commented 2026-11-28 02:30:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T02:30:36Z.


merge-check claim
head: f3eb053f93

<!-- greyfinch-sync:ivall/xcl:comment:7232409561 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1284#issuecomment-7232409561). Originally posted by [throny](https://github.com/throny) on 2026-11-28T02:30:36Z. --- merge-check claim head: f3eb053f932be6070c37300627fa2caf4158e218
throny commented 2026-11-28 02:45:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T02:45:21Z.


merge-check
base: 753e8b1a
head: f3eb053f93
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1514 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1512 passed, 0 failed, 47 ignored
review: no blocking finding. Opt-in: with the variable unset the generated HLSL is byte-identical, and when it is set the cache is skipped. Scope, open from the thread: it covers the HLSL path only; the direct-DXIL path keeps its own constant, so the description and README should say so (the README does not document the variable yet). Style: one unindented line and a raw newline inside a string literal in tests.rs. With #2793 (safe from my side): no textual conflict, but one in meaning: #2793's loop guard and translate pass a fixed budget to its helper region_budget_limits, so programs with two or more loop regions would reset the budget per region and ignore this variable. Whichever of the two lands second must pass the configured budget to that helper in both places.
performance: no default cost (one env read per translation). It changes translator sources: every tester re-translates all shaders once.
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

<!-- greyfinch-sync:ivall/xcl:comment:7232572817 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1284#issuecomment-7232572817). Originally posted by [throny](https://github.com/throny) on 2026-11-28T02:45:21Z. --- merge-check base: 753e8b1a head: f3eb053f932be6070c37300627fa2caf4158e218 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1514 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1512 passed, 0 failed, 47 ignored review: no blocking finding. Opt-in: with the variable unset the generated HLSL is byte-identical, and when it is set the cache is skipped. Scope, open from the thread: it covers the HLSL path only; the direct-DXIL path keeps its own constant, so the description and README should say so (the README does not document the variable yet). Style: one unindented line and a raw newline inside a string literal in tests.rs. With #2793 (safe from my side): no textual conflict, but one in meaning: #2793's loop guard and translate pass a fixed budget to its helper region_budget_limits, so programs with two or more loop regions would reset the budget per region and ignore this variable. Whichever of the two lands second must pass the configured budget to that helper in both places. performance: no default cost (one env read per translation). It changes translator sources: every tester re-translates all shaders once. verdict: safe to merge hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
upipibi commented 2026-11-28 08:50:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-28T08:50:59Z.


@thehollowedone @throny Thanks, both right. The description now says the switch covers the HLSL path only, so direct-DXIL programs keep dxil::lower::LOOP_BUDGET (lower.rs:36). It also notes the meaning conflict with #2793 for whichever of the two lands second. I'm leaving the head as is, since a new commit would drop the existing smoke pair.

<!-- greyfinch-sync:ivall/xcl:comment:7236851211 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1284#issuecomment-7236851211). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-28T08:50:59Z. --- @thehollowedone @throny Thanks, both right. The description now says the switch covers the HLSL path only, so direct-DXIL programs keep `dxil::lower::LOOP_BUDGET` (`lower.rs:36`). It also notes the meaning conflict with #2793 for whichever of the two lands second. I'm leaving the head as is, since a new commit would drop the existing smoke pair.
upipibi commented 2026-11-28 10:38:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-28T10:38:53Z.


@thehollowedone @throny Correction to my note above: the head did move after all. The branch conflicted with main (XCL_SAFE_BARRIER was added to the same two lists in pso.rs), so it couldn't merge as it was. It's now 998dda8 on e429936c, with both entries kept. On the RTX 3070, cargo test -p xcl --lib -- --test-threads=4 gives 1997 passed, 6 failed, 28 ignored, against 1995 / 6 / 28 on main, with the same 6 failures (#3093). This PR's tests pass. The old smoke pair is for the previous head, so this one needs a new pair.

<!-- greyfinch-sync:ivall/xcl:comment:7238031322 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1284#issuecomment-7238031322). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-28T10:38:53Z. --- @thehollowedone @throny Correction to my note above: the head did move after all. The branch conflicted with `main` (`XCL_SAFE_BARRIER` was added to the same two lists in `pso.rs`), so it couldn't merge as it was. It's now `998dda8` on `e429936c`, with both entries kept. On the RTX 3070, `cargo test -p xcl --lib -- --test-threads=4` gives 1997 passed, 6 failed, 28 ignored, against 1995 / 6 / 28 on `main`, with the same 6 failures (#3093). This PR's tests pass. The old smoke pair is for the previous head, so this one needs a new pair.
Foniass commented 2026-12-01 05:19:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:19:56Z.


Triage (#1607) – head 998dda8

No open or merged PR adds this variable. #2793 (per-region loop budgets) and #2769 (LOOP_BUDGET at loop headers in per-lane lowering) work on the same guard, and #2793 refers to this PR's XCL_LOOP_BUDGET as the value to pass to its region budgets. They complement each other, not duplicates.
No problems found in the logic: the default leaves the prelude, and so the HLSL and the cache key, unchanged, and cache_allowed bypasses the cache when the variable is set. In tests.rs, let mut st in gpu_loop_budget_caps_a_loop lost its indentation.
The Build and test check failed on the last run, and the branch conflicts with main; it needs a rebase and a green run.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7301658739 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1284#issuecomment-7301658739). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T05:19:56Z. --- **Triage (#1607)** – head 998dda8 No open or merged PR adds this variable. #2793 (per-region loop budgets) and #2769 (LOOP_BUDGET at loop headers in per-lane lowering) work on the same guard, and #2793 refers to this PR's `XCL_LOOP_BUDGET` as the value to pass to its region budgets. They complement each other, not duplicates. No problems found in the logic: the default leaves the prelude, and so the HLSL and the cache key, unchanged, and `cache_allowed` bypasses the cache when the variable is set. In tests.rs, `let mut st` in `gpu_loop_budget_caps_a_loop` lost its indentation. The `Build and test` check failed on the last run, and the branch conflicts with main; it needs a rebase and a green run. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Foniass commented 2026-12-03 17:17:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T17:17:04Z.


Follow-up review of 8fc28165, since 998dda8 (code reading only, not a merge-check; PR description red) · 2 medium

In short: Rebased onto main e99b0bd. The indentation nit from the earlier triage is fixed. The rest of the range-diff is the doc comment on the loop guard, merged with the per-dispatch loop budget main gained meanwhile. The logic is unchanged and still right for the HLSL path. But the direct-DXIL backend is now the default, and it keeps its own fixed budget, so XCL_LOOP_BUDGET no longer reaches most programs. The description says so.

Medium

  1. On the default backend, XCL_LOOP_BUDGET does nothing.

    • Direct-DXIL programs start VAR_BUDGET from the fixed dxil::lower::LOOP_BUDGET (65 536). The guard in dxil/kernel.rs ~581 never reads loop_budget(). That backend is now the default.
    • So for the #505 diagnosis this variable exists for, setting it changes nothing unless XCL_DIRECT_DXIL=0 is also set. A user who sets it and sees no change cannot tell that.

    Either make the direct path start its budget from loop_budget(), keeping the cache bypass pso::cache_allowed already gives the variable, or log once when the variable is set while the direct backend is on.

  2. The whole workspace is not reported on this head. Tested gives cargo test -p xcl --lib on 8fc28165 (2865 passed, 0 failed, 37 ignored). CONTRIBUTING.md asks for cargo test --workspace -- --test-threads=4 on the head under review.

Checked and fine
  • Earlier triage nit fixed: let mut st in gpu_loop_budget_caps_a_loop is indented again.
  • The doc comment on the loop guard now names both budgets: the lane's xcl_budget (XCL_LOOP_BUDGET or 65 536), and the per-entry dispatch_loop_budget that main added for compute loops. dispatch_loop_budget is untouched, and the two are independent.
  • Without the variable, the prelude line is still static uint xcl_budget = 1u << 16;, so the HLSL and its cache key are as on main. The test checks that line.
  • XCL_LOOP_BUDGET is in both pso.rs lists next to XCL_SAFE_BARRIER, so a translation made with it set is neither cached nor loaded.
  • The head merges cleanly onto main.

Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7386261524 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1284#issuecomment-7386261524). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-03T17:17:04Z. --- **Follow-up review** of `8fc28165`, since `998dda8` (code reading only, not a merge-check; `PR description` red) · 2 medium **In short:** Rebased onto `main` `e99b0bd`. The indentation nit from the earlier triage is fixed. The rest of the range-diff is the doc comment on the loop guard, merged with the per-dispatch loop budget `main` gained meanwhile. The logic is unchanged and still right for the HLSL path. But the direct-DXIL backend is now the default, and it keeps its own fixed budget, so `XCL_LOOP_BUDGET` no longer reaches most programs. The description says so. #### Medium 1. **On the default backend, `XCL_LOOP_BUDGET` does nothing.** - Direct-DXIL programs start `VAR_BUDGET` from the fixed `dxil::lower::LOOP_BUDGET` (65 536). The guard in `dxil/kernel.rs` ~581 never reads `loop_budget()`. That backend is now the default. - So for the #505 diagnosis this variable exists for, setting it changes nothing unless `XCL_DIRECT_DXIL=0` is also set. A user who sets it and sees no change cannot tell that. Either make the direct path start its budget from `loop_budget()`, keeping the cache bypass `pso::cache_allowed` already gives the variable, or log once when the variable is set while the direct backend is on. 2. **The whole workspace is not reported on this head.** **Tested** gives `cargo test -p xcl --lib` on `8fc28165` (2865 passed, 0 failed, 37 ignored). CONTRIBUTING.md asks for `cargo test --workspace -- --test-threads=4` on the head under review. <details><summary>Checked and fine</summary> - Earlier triage nit fixed: `let mut st` in `gpu_loop_budget_caps_a_loop` is indented again. - The doc comment on the loop guard now names both budgets: the lane's `xcl_budget` (`XCL_LOOP_BUDGET` or 65 536), and the per-entry `dispatch_loop_budget` that `main` added for compute loops. `dispatch_loop_budget` is untouched, and the two are independent. - Without the variable, the prelude line is still `static uint xcl_budget = 1u << 16;`, so the HLSL and its cache key are as on `main`. The test checks that line. - `XCL_LOOP_BUDGET` is in both `pso.rs` lists next to `XCL_SAFE_BARRIER`, so a translation made with it set is neither cached nor loaded. - The head merges cleanly onto `main`. </details> <sub>Written by Claude Code (Claude Opus 5.5) and posted by Foniass without a human check of each point.</sub>
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1284:upstream-pr/1284'
git switch 'upstream-pr/1284'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1284'
git switch 'upstream-pr/1284'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1284'
git switch 'upstream-pr/1284'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1284'
git switch 'main'
git merge --squash 'upstream-pr/1284'
git switch 'main'
git merge --ff-only 'upstream-pr/1284'
git switch 'main'
git merge 'upstream-pr/1284'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!1274
No description provided.