kernelx: XCL_COHERENT_HEAPS=sparse:N puts big GPU heaps in video memory #2009

Open
github-bot wants to merge 2 commits from github-bot/gh-2009 into main AGit
Owner

@⁠Ariorh1337 on GitHub · 2026-11-25 00:40 UTC · original
Ariorh1337:kernelx/coherent-heaps-sparse → main · +1101 −36 · 5 files · 2 commits · open

Stacked on #1993; only the top commit belongs here.

An opt-in switch, XCL_COHERENT_HEAPS=sparse[:N], that puts a title's GPU heaps (committed with a PAGE_GRAPHICS_* protection) in the sparse windows (video memory) instead of the coherent window (process memory the GPU reaches over the bus). With sparse every heap moves, with sparse:N those of at least N MB. Part of #505.

Why. In the coherent window, on an RTX 5090:

  • dependent reads from a shader are ~30× slower than from video memory (no L2 hits, about 2.4 µs each);
  • store instructions whose lanes leave gaps (per-lane dwordx2/x4, 8- and 16-byte formats) run at about 0.1 GB/s. Lane-contiguous ones run at about 50 GB/s, and the same stores in video memory at over 1 TB/s. Micro-benchmark in my #505 comments.

The retail title of #505 keeps 4.4 GB of heaps there (1172, 2199, 563 and 596 MB), and its world passes take 0.4–2.7 s each.

Keeping the heaps out of the window (XCL_COHERENT_HEAPS=0) removed the GPU stall on an RTX 5090, an RTX 5080 (@⁠kanade333), an RTX 3080 (@⁠not-rex) and RDNA3 / Linux (@⁠lucsoft). But there the shaders read zeros, and the 3D picture is black. This switch keeps them GPU-visible at the same addresses.

Where it does not pay. The moved heaps cost their size in video memory. On 12 GB cards two people measured it:

  • mgrein (RTX 4070 12 GB, #1773): with sparse:1024 the world-load stall is gone, but local video memory reaches 20 GB by 256 s and CreatePlacedResourceX fails with E_OUTOFMEMORY. Without the switch the world load stalls at once (queue.Wait time-outs from 132 s, device removed at 575 s).

  • joeypercia (RTX 4070 Ti 12 GB, with a page budget, #1773): with sparse:512 the device went at 184.6 s instead of 304 s. Texture pools went to system memory from 23 s on, and compute passes slowed to ~0.5 s a dispatch.

  • STmihan (RTX 3070 Ti 8 GB, on this PR): sparse:2048 (the 2199 MB heap only) made the world's compute passes 27–36× faster, and then local video memory ran to 17–21 GB and the 5 s timeouts came back past ~16 GB.

So the switch is for cards whose video memory holds the heaps on top of the title's textures (24–32 GB). It stays off by default. The next step is a limit by the adapter's video-memory budget instead of a fixed size.

Other ways at the same problem:

  • #1329 (XCL_UMA_SHADOW=1) keeps a copy of the whole committed window in video memory. This switch moves only the big heaps.
  • #2090 (XCL_SPARSE_DIRECT=1) goes the other way: the sparse windows become memory the GPU reads where it is, which ends the write-watch scan and the copies back. With it, this switch has nothing to gain, since the heaps would land in system memory again. Which way is faster on a card with enough video memory is not measured yet; I'll run both on the RTX 5090.

What is in it (crates/xcl/src/hle/kernelx.rs, one commit)

  • In the coherent-heap branch of VirtualAlloc, a heap the switch selects goes to d3d12x::sparse::alloc, as the title's MEM_GRAPHICS commits already do. A heap that goes there is not counted in the coherent window's size for the next run (note_coherent_need).
  • parse_sparse_heaps and the test sparse_heaps_setting.
  • Off by default. It costs a second copy in video memory and the per-submit write-watch scan of it. It needs #1993: the title's lists write into these heaps (fence values among them), and without #1993 each copy back of such a write waits for the submitting thread.

Tested

  • RTX 5090 32 GB (driver 32.0.16.1692), Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 26300, rustc 1.99.0, DXC 1.9.2609.5.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 (debug):
    • this PR (2f49088, on #1993 0a755f0 and main 06055a7): 1419 passed, 4 failed, 46 ignored;
    • main (06055a7): 1409 passed, 4 failed, 46 ignored.
    • The 4 failures are gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3 (0x8007000E), the same on main. SKIPPED: 26 lines, the same tests as on main.
  • Retail title (1.0.2.1), on a local tree: main b9b6ea6 + open PRs + #1329 + the earlier prototype of #1993 + this switch, with XCL_COHERENT_HEAPS=sparse:1024 XCL_HEAP_WINDOWS=1. That moves the 1172 and 2199 MB heaps; the 563 and 596 MB ones, which hold the fences, stay in the window.
    • The intro played to the in-game HUD.
    • The title ran 465 s after the first #101 with 0 draws and 0 dispatches skipped.
    • 125 123 ops of console code took 21.1 s of GPU time. With the heaps in the window it was 30.9 s for 23 452 ops, and the title stopped ~45 s after #101.
    • One run each.
  • Retail title on 2f49088 alone (main 06055a7 + #1993 + this PR, XCL_COHERENT_HEAPS=sparse:1024 XCL_HEAP_WINDOWS=1, release): both big heaps moved (sparse pools 5.4 GB, local video memory 17.7 GB). The world's first burst ran (7861 dispatches after the first #101) with no GPU wait or copy back running out and no crash or device removal in 438 s. Presents stopped 8 s after the first #101 while the title waited on cold driver builds of compute pipelines (68 with no driver blob for main's HLSL on this machine). So this shows the switch's path up to there, not the world running with it.
  • Cost seen in that run: the write-watch scan of the sparse windows took 88 s of the first 137 s (7.9 M dirty pages). That is the main thing between this and a default. theaustinayers' looks at the blocks written lately (7c18bc4 in #2057) go at that cost; #2057 runs this switch as sparse:16.

Regression run
scripts/smoke.ps1 -Game <retail title> -Seconds 60 (start screen, no input, switch not set, so this checks the default path), XCL_HEAP_WINDOWS=1, same machine. The main block is the one from #1993.

xcl-smoke v1
commit: 06055a7a0fb43c5f83f55e7a2ce201417de171e9
gpu: NVIDIA GeForce RTX 5090
title: a155fb60
seconds: 60
exit: 0x0
frames shown: 1604 (PresentX 1604)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14766 MB
xcl-smoke v1
commit: 2f490889758f32dfafd9c0593dd1125332168c7d
gpu: NVIDIA GeForce RTX 5090
title: a155fb60
seconds: 60
exit: 0x0
frames shown: 1607 (PresentX 1607)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14995 MB

Not tested

  • Cards with 16 GB or less. The two runs above on 12 GB cards say it hurts there.
  • The switch on Intel. On AMD only lucsoft's runs (RX 7800 XT 16 GB, Linux, on this PR): sparse:1024 on 99a7e4f with #1993 and about 20 other PRs; two runs reached the prologue with no device removal and no GPU-wait timeout, at about 1 fps, with the write-watch scan taking 215 s by 811 s.
  • The world running on main + #1993 + this PR with the switch: the run above stops on cold compute builds first. The smoke run does not set the switch.
  • sparse without :N (every heap, the fences included) in a title run on top of #1993. On my prototype, moving every heap made the readbacks of fence writes the bottleneck.

AI use

  • Claude Code (Claude Opus 5.5) found the cause with a micro-benchmark and the title runs, wrote the change and the test, ran the suite and the smoke runs on the machine above, and wrote this description. I read the diff and checked the results before pushing.

🤖 Generated with Claude Code

**@⁠Ariorh1337** on GitHub · 2026-11-25 00:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/2009) `Ariorh1337:kernelx/coherent-heaps-sparse` → `main` · +1101 −36 · 5 files · 2 commits · open Stacked on #1993; only the top commit belongs here. An opt-in switch, `XCL_COHERENT_HEAPS=sparse[:N]`, that puts a title's GPU heaps (committed with a `PAGE_GRAPHICS_*` protection) in the sparse windows (video memory) instead of the coherent window (process memory the GPU reaches over the bus). With `sparse` every heap moves, with `sparse:N` those of at least N MB. Part of #505. **Why.** In the coherent window, on an RTX 5090: - **dependent reads** from a shader are ~30× slower than from video memory (no L2 hits, about 2.4 µs each); - **store instructions whose lanes leave gaps** (per-lane `dwordx2`/`x4`, 8- and 16-byte formats) run at about 0.1 GB/s. Lane-contiguous ones run at about 50 GB/s, and the same stores in video memory at over 1 TB/s. Micro-benchmark in my #505 comments. The retail title of #505 keeps 4.4 GB of heaps there (1172, 2199, 563 and 596 MB), and its world passes take 0.4–2.7 s each. Keeping the heaps out of the window (`XCL_COHERENT_HEAPS=0`) removed the GPU stall on an RTX 5090, an RTX 5080 (@⁠kanade333), an RTX 3080 (@⁠not-rex) and RDNA3 / Linux (@⁠lucsoft). But there the shaders read zeros, and the 3D picture is black. This switch keeps them GPU-visible at the same addresses. **Where it does not pay.** The moved heaps cost their size in video memory. On 12 GB cards two people measured it: - mgrein (RTX 4070 12 GB, [#1773](https://git.gtahub.st/github/xcl-dev--xcl/issues/1773)): with `sparse:1024` the world-load stall is gone, but local video memory reaches 20 GB by 256 s and `CreatePlacedResourceX` fails with `E_OUTOFMEMORY`. Without the switch the world load stalls at once (`queue.Wait` time-outs from 132 s, device removed at 575 s). - joeypercia (RTX 4070 Ti 12 GB, with a page budget, [#1773](https://git.gtahub.st/github/xcl-dev--xcl/issues/1773)): with `sparse:512` the device went at 184.6 s instead of 304 s. Texture pools went to system memory from 23 s on, and compute passes slowed to ~0.5 s a dispatch. - STmihan (RTX 3070 Ti 8 GB, [on this PR](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2009)): `sparse:2048` (the 2199 MB heap only) made the world's compute passes 27–36× faster, and then local video memory ran to 17–21 GB and the 5 s timeouts came back past ~16 GB. So the switch is for cards whose video memory holds the heaps on top of the title's textures (24–32 GB). It stays off by default. The next step is a limit by the adapter's video-memory budget instead of a fixed size. **Other ways at the same problem:** - #1329 (`XCL_UMA_SHADOW=1`) keeps a copy of the whole committed window in video memory. This switch moves only the big heaps. - #2090 (`XCL_SPARSE_DIRECT=1`) goes the other way: the sparse windows become memory the GPU reads where it is, which ends the write-watch scan and the copies back. With it, this switch has nothing to gain, since the heaps would land in system memory again. Which way is faster on a card with enough video memory is not measured yet; I'll run both on the RTX 5090. **What is in it** (`crates/xcl/src/hle/kernelx.rs`, one commit) - In the coherent-heap branch of `VirtualAlloc`, a heap the switch selects goes to `d3d12x::sparse::alloc`, as the title's `MEM_GRAPHICS` commits already do. A heap that goes there is not counted in the coherent window's size for the next run (`note_coherent_need`). - `parse_sparse_heaps` and the test `sparse_heaps_setting`. - **Off by default.** It costs a second copy in video memory and the per-submit write-watch scan of it. It needs #1993: the title's lists write into these heaps (fence values among them), and without #1993 each copy back of such a write waits for the submitting thread. **Tested** - RTX 5090 32 GB (driver 32.0.16.1692), Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 26300, rustc 1.99.0, DXC 1.9.2609.5. - `cargo test --workspace --no-fail-fast -- --test-threads=4` (debug): - this PR (`2f49088`, on #1993 `0a755f0` and `main` `06055a7`): 1419 passed, 4 failed, 46 ignored; - `main` (`06055a7`): 1409 passed, 4 failed, 46 ignored. - The 4 failures are `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0..3` (`0x8007000E`), the same on `main`. SKIPPED: 26 lines, the same tests as on `main`. - **Retail title** (1.0.2.1), on a local tree: `main` `b9b6ea6` + open PRs + #1329 + the earlier prototype of #1993 + this switch, with `XCL_COHERENT_HEAPS=sparse:1024 XCL_HEAP_WINDOWS=1`. That moves the 1172 and 2199 MB heaps; the 563 and 596 MB ones, which hold the fences, stay in the window. - The intro played to the in-game HUD. - The title ran 465 s after the first `#101` with 0 draws and 0 dispatches skipped. - 125 123 ops of console code took 21.1 s of GPU time. With the heaps in the window it was 30.9 s for 23 452 ops, and the title stopped ~45 s after `#101`. - One run each. - **Retail title on `2f49088` alone** (`main` `06055a7` + #1993 + this PR, `XCL_COHERENT_HEAPS=sparse:1024 XCL_HEAP_WINDOWS=1`, release): both big heaps moved (sparse pools 5.4 GB, local video memory 17.7 GB). The world's first burst ran (7861 dispatches after the first `#101`) with no GPU wait or copy back running out and no crash or device removal in 438 s. Presents stopped 8 s after the first `#101` while the title waited on cold driver builds of compute pipelines (68 with no driver blob for `main`'s HLSL on this machine). So this shows the switch's path up to there, not the world running with it. - **Cost seen in that run:** the write-watch scan of the sparse windows took 88 s of the first 137 s (7.9 M dirty pages). That is the main thing between this and a default. theaustinayers' looks at the blocks written lately (`7c18bc4` in #2057) go at that cost; #2057 runs this switch as `sparse:16`. **Regression run** `scripts/smoke.ps1 -Game <retail title> -Seconds 60` (start screen, no input, switch not set, so this checks the default path), `XCL_HEAP_WINDOWS=1`, same machine. The `main` block is the one from #1993. ``` xcl-smoke v1 commit: 06055a7a0fb43c5f83f55e7a2ce201417de171e9 gpu: NVIDIA GeForce RTX 5090 title: a155fb60 seconds: 60 exit: 0x0 frames shown: 1604 (PresentX 1604) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14766 MB ``` ``` xcl-smoke v1 commit: 2f490889758f32dfafd9c0593dd1125332168c7d gpu: NVIDIA GeForce RTX 5090 title: a155fb60 seconds: 60 exit: 0x0 frames shown: 1607 (PresentX 1607) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14995 MB ``` **Not tested** - Cards with 16 GB or less. The two runs above on 12 GB cards say it hurts there. - The switch on Intel. On AMD only lucsoft's runs (RX 7800 XT 16 GB, Linux, [on this PR](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2009)): `sparse:1024` on `99a7e4f` with #1993 and about 20 other PRs; two runs reached the prologue with no device removal and no GPU-wait timeout, at about 1 fps, with the write-watch scan taking 215 s by 811 s. - **The world running on `main` + #1993 + this PR with the switch:** the run above stops on cold compute builds first. The smoke run does not set the switch. - `sparse` without `:N` (every heap, the fences included) in a title run on top of #1993. On my prototype, moving every heap made the readbacks of fence writes the bottleneck. **AI use** - Claude Code (Claude Opus 5.5) found the cause with a micro-benchmark and the title runs, wrote the change and the test, ran the suite and the smoke runs on the machine above, and wrote this description. I read the diff and checked the results before pushing. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
`readback_after_execute` made the sparse queue GPU-wait for the title's
queue and then waited on the CPU for the copy, on the thread that was
submitting. The title's queues can wait for work that same thread submits
next (four compute queues waiting for a Write64 on q1 whose list is
recorded but not submitted yet). So the copy waited its 5 s on every such
submission, and the uploads queued behind it on the sparse queue waited
too (`before_execute` waiting for ring room). In thread dumps of a retail
title on an RTX 5090, the submitting thread is in `readback_ranges` ->
`wait_for` while another title thread waits for the sparse state's lock in
`commit_range`. lucsoft found the same cycle on RDNA3 / Linux (#505).

The copies now run on a lane per title queue: a fence the title's queue
signals after its lists, and a queue of its own that GPU-waits for that
fence. The submitting thread returns. With one fence for all title
queues, a later signal on another queue let a copy start before its own
queue's lists ran (CharlyRien); with one queue for all, a title queue
waiting for work still to come held back the copies of the others.
The lanes (8) are made in `init`, before the device's methods are hooked:
made later, a lane's queue was adopted as one of the title's, and the e2e
title under the debug layer read 0 for what its lists wrote.
A copy back's allocator and list are made with the device's own methods,
past its hooks (`real::create_own_list`), as `init`'s objects are: made
through the adopted device, the list took XCL's list hooks on the lane's
queue, and vkd3d-proton crashed at its Close (St5sz2Jk, RDNA4 / Wine).
Tiles quarantined behind the title queues' marks (#2345) also wait for
the copies back still to run on a lane: they read the windows after the
title's work. A lane serves
a title queue while that queue has copies back in flight; with all lanes
busy (or none made), the old path runs. Readback buffers are sized to the
copy (64 KiB and up) and reused; idle ones above 256 MB are given back
(each holds commit, and with the title's queues stalled every submit's
copies wait, one buffer each; found by Chrysana's RDNA4 run). Each time the
buffers pass another doubling from 64 MB, their size is logged.

The data lands in the title's memory once the copy is done, before the
title can see the work it follows is done:
- on the next submit, and from a thread that looks every 0.5 ms;
- before Map's readback (waiting for the copy once the title's lists it
  follows are done), and in the CPU memory waits of Wait64BitValueX, which
  only try the sparse state's lock: its holder can be waiting for work the
  waiting thread is to submit;
- in the title's fence observations: `GetCompletedValue` settles the copies
  first. `SetEventOnCompletion` hands the fence an event of XCL's own, and a
  thread-pool wait on it settles them, then sets the title's event.
  These only try the lock; a copy whose title work is done but which still
  runs is waited for with the lock let go, then landed. Waiting for it with
  the lock held stood every submit behind a copy that stood behind a stalled
  GPU (lucsoft, RDNA3).
  Until they landed, the title is not told its work is done: the thread-pool
  wait tries again every millisecond before it sets the title's event (10 s
  at most), and `GetCompletedValue` gives no more than the value the fence
  was last seen at with its copies landed (its initial value at first).
  Before, a lock that could not be had let the title read stale memory
  (bmjask).
Lanes land in their own order, so an older copy back of one lane can land
after a newer one of another: it leaves the bytes the newer one landed.
A CPU wait for a copy uses its lane's event, not the sparse state's: a wait
that gave up leaves its registration behind, which set the shared event
later and ended a tile-queue wait early (theaustinayers, in #2057).

Tests:
- `a_copy_back_does_not_wait_for_the_title_queue` waits 5.0 s on the old
  path and under 1 s with this change;
- `a_copy_back_waits_for_its_own_title_queue`: two title queues, the first
  blocked; with one lane for both, the first one's copy lands before its
  list ran;
- `an_older_copy_back_does_not_overwrite_a_newer_one`.
- `a_copy_still_running_after_its_title_work_is_waited_for_outside_the_lock`.
- `idle_copy_back_buffers_above_the_cap_are_given_back`.
- `a_copy_back_list_of_an_adopted_device_is_not_adopted`.
- `quarantined_tiles_wait_for_copies_back_still_to_run`.
- `a_title_fence_shows_its_work_done_only_once_copies_back_can_land`: an
  adopted fence, the sparse state held by another thread.
- `a_fence_value_goes_past_its_landed_copies_only_once_they_land`.
They run on a WARP device of their own: they block a queue on purpose, and
on the GPU's device, which the tests in the process share, other queue
tests then hung in the driver releasing resources (upipibi; reproduced in 3
of 3 runs of the d3d12x queue tests). Without the fence hooks, the e2e test
title read 0 for its Write32BitValueBottomOfPipeX after its fence wait.
With them, both e2e tests pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A title's GPU heaps (committed with a PAGE_GRAPHICS_* protection) go to
the coherent window, process memory the GPU reaches over the bus. On an
RTX 5090 a shader's dependent reads there are ~30x slower than from video
memory (no L2 hits, about 2.4 us each). Its store instructions whose lanes
leave gaps (per-lane dwordx2/x4, 8- and 16-byte formats) run at ~0.1 GB/s,
against ~50 GB/s for lane-contiguous ones and >1 TB/s in video memory. The
retail title of #505 keeps 4.4 GB of heaps there (1172, 2199, 563 and
596 MB), and its world passes take 0.4-2.7 s each. Keeping the heaps out
of the window was reproduced as removing the stall on an RTX 5080, an
RTX 3080 and RDNA3 / Linux (#505), but there the shaders read zeros.

With `XCL_COHERENT_HEAPS=sparse` every such heap, with `sparse:N` those of
at least N MB, goes to the sparse windows instead: video memory, with the
CPU's writes uploaded before each submission, like the title's other
graphics memory. A heap that goes there is not counted in the coherent
window's size for the next run (`note_coherent_need`). Off by default: it
costs a second copy in video memory and the write-watch scan of it, and it
needs the asynchronous copies back of the commit below. Without them, the
copies back of the title's lists' writes into these heaps wait for the
submitting thread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:14:32 +00:00
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 01:12 UTC · original

Code review on 5370f4b:

  • In crates/xcl/src/hle/kernelx.rs, sparse_heaps_min() / parse_sparse_heaps (XCL_COHERENT_HEAPS=sparse[:N], overflow-safe checked_mul(1 << 20), and sparse_heaps_setting unit tests) cleanly routes graphics heaps >= N MiB into d3d12x::sparse::alloc.
  • Diff audited and CI workflow approved (currently running).
  • Note: This branch also carries the crates/xcl/src/hle/d3d12x/sparse.rs async-readback changes from #1993 — so please keep the shared monotonic rb_fence multi-queue ordering note from #1993 in mind (or rebase onto #1993 once settled).

Remaining before merge: Settling the #1993 sparse.rs overlap / multi-queue rb_fence note, Build and test finishing green, and an AMD verification pass.

**@⁠raylitebull** on GitHub · 2026-11-25 01:12 UTC · [original](https://github.com/xcl-dev/xcl/pull/2009#issuecomment-7149321488) Code review on `5370f4b`: - In `crates/xcl/src/hle/kernelx.rs`, `sparse_heaps_min()` / `parse_sparse_heaps` (`XCL_COHERENT_HEAPS=sparse[:N]`, overflow-safe `checked_mul(1 << 20)`, and `sparse_heaps_setting` unit tests) cleanly routes graphics heaps `>= N MiB` into `d3d12x::sparse::alloc`. - Diff audited and `CI` workflow approved (currently running). - **Note:** This branch also carries the `crates/xcl/src/hle/d3d12x/sparse.rs` async-readback changes from `#1993` — so please keep the shared monotonic `rb_fence` multi-queue ordering note from `#1993` in mind (or rebase onto `#1993` once settled). **Remaining before merge:** Settling the `#1993` `sparse.rs` overlap / multi-queue `rb_fence` note, `Build and test` finishing green, and an **AMD** verification pass.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-25 01:05 UTC · original · edited 2026-11-25 01:26 UTC

Full-suite run, since this PR has no test report yet. Tested exact head 5370f4b (on its base 8e87fc7).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 981 passed, 0 failed, 43 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • The new tests ran and passed: a_copy_back_does_not_wait_for_the_title_queue, sparse_heaps_setting.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 991 passed, 0 failed, 45 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main 7994cd1 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests and const_and_null_mask_operands_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • 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.
**@⁠futurepro62** on GitHub · 2026-11-25 01:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/2009#issuecomment-7149201133) · edited 2026-11-25 01:26 UTC Full-suite run, since this PR has no test report yet. Tested exact head `5370f4b` (on its base `8e87fc7`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests`: **981 passed, 0 failed, 43 ignored**. SKIPPED (no wave64): `a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu`, `a_per_lane_2d_or_3d_group_runs_on_the_gpu`, `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu`. - The new tests ran and passed: `a_copy_back_does_not_wait_for_the_title_queue`, `sparse_heaps_setting`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: **991 passed, 0 failed, 45 ignored**. SKIPPED: `f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `--skip` leaves out tests that fail on main `7994cd1` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651), the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests and `const_and_null_mask_operands_agree_with_hlsl_on_the_gpu` ([follow-up on #1651](https://git.gtahub.st/github/xcl-dev--xcl/issues/1651)) fail because `runner::skip_test` turns their skips into failures under `XCL_REQUIRE_GPU=mesh`, and `gpu::dxil::fuzz_tests` seeds 70, 545, 1019 and 1507 fail `CreateComputePipelineState` with `E_OUTOFMEMORY` on this card (drivers 616.64 and 621.40). On AMD: `fuzz_validate_and_gpu_1` fails on seed 540 (`res[833]` 0x7 vs CPU 0x6). The AMD run does not set `XCL_REQUIRE_GPU`. **Not tested** - 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.
Author
Owner

@⁠Filip722 on GitHub · 2026-11-25 01:40 UTC · original

On the RTX 5060 Laptop GPU (8 GiB), the first sample with zero render-target pages showed 256 MiB of sparse pools on main and 3,584 MiB with #1993 + #2009 (197 and 3,527 MiB mapped). The cost was already visible before render-target streaming.

Requested size Main bf9eebd 5370f4b integrated on the same main
1,172 MiB Coherent Sparse VRAM
2,199 MiB Write-watched fallback Sparse VRAM
563 MiB Coherent Coherent
596 MiB Write-watched fallback Coherent

Both offline Series X runs used fresh copies of the same prefix/cache seeds and XCL_COHERENT_MB=2048 XCL_COHERENT_HEAPS=sparse:1024 XCL_HEAP_WINDOWS=1. I retained main’s internal-wait diagnostics when integrating the stack. The 2 GiB free-VRAM guard stopped each run around 30 s, before account input. I added 100 ms VRAM sampling for the second run after seeing a >1 GiB drop between baseline samples. Each had seven black captures, zero scope swap and zero reported storage failures. World entry remains unverified here.

Bazzite 44, NVIDIA 615.78.08, Proton Experimental 11.0-20261112, local vkd3d-proton 3.1.0 (4522cc1a8b1347f with dxil-spirv compatibility changes). Focused Windows release tests under Proton, including sparse GPU readback, passed 5/5 on main and 7/7 with the stack. No reported skips.

OpenAI Codex (GPT-6.2-Sol) integrated the PRs locally, ran the comparison and wrote this report.

**@⁠Filip722** on GitHub · 2026-11-25 01:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/2009#issuecomment-7149829600) On the **RTX 5060 Laptop GPU (8 GiB)**, the first sample with zero render-target pages showed **256 MiB of sparse pools on main and 3,584 MiB with #1993 + #2009** (197 and 3,527 MiB mapped). The cost was already visible before render-target streaming. | Requested size | Main `bf9eebd` | `5370f4b` integrated on the same main | |---|---|---| | 1,172 MiB | Coherent | Sparse VRAM | | 2,199 MiB | Write-watched fallback | Sparse VRAM | | 563 MiB | Coherent | Coherent | | 596 MiB | Write-watched fallback | Coherent | Both offline Series X runs used fresh copies of the same prefix/cache seeds and `XCL_COHERENT_MB=2048 XCL_COHERENT_HEAPS=sparse:1024 XCL_HEAP_WINDOWS=1`. I retained main’s internal-wait diagnostics when integrating the stack. The 2 GiB free-VRAM guard stopped each run around 30 s, before account input. I added 100 ms VRAM sampling for the second run after seeing a >1 GiB drop between baseline samples. Each had seven black captures, zero scope swap and zero reported storage failures. World entry remains unverified here. Bazzite 44, NVIDIA 615.78.08, Proton Experimental 11.0-20261112, local vkd3d-proton 3.1.0 (`4522cc1a8b1347f` with dxil-spirv compatibility changes). Focused Windows release tests under Proton, including sparse GPU readback, passed 5/5 on main and 7/7 with the stack. No reported skips. OpenAI Codex (GPT-6.2-Sol) integrated the PRs locally, ran the comparison and wrote this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 03:51 UTC · original

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-25 03:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/2009#issuecomment-7152306519) Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 11:00 UTC · original

Code review on 783ac15 (top commit in crates/xcl/src/hle/kernelx.rs, stacked on #1993):

  • sparse_heaps_min + parse_sparse_heaps (checked_mul(1 << 20) guarding usize::MAX overflow, tested in sparse_heaps_setting) cleanly routes opt-in XCL_COHERENT_HEAPS=sparse[:N] PAGE_GRAPHICS_* allocations into d3d12x::sparse::alloc before note_coherent_need.
  • Diff audited and CI workflow approved (45598152814).

Remaining before merge: Land #1993 first (or rebase once #1993 merges), Build and test green, and independent AMD + NVIDIA verification exercising the opt-in switch on 783ac15.

**@⁠raylitebull** on GitHub · 2026-11-25 11:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/2009#issuecomment-7160467236) Code review on `783ac15` (top commit in `crates/xcl/src/hle/kernelx.rs`, stacked on `#1993`): - `sparse_heaps_min` + `parse_sparse_heaps` (`checked_mul(1 << 20)` guarding `usize::MAX` overflow, tested in `sparse_heaps_setting`) cleanly routes opt-in `XCL_COHERENT_HEAPS=sparse[:N]` `PAGE_GRAPHICS_*` allocations into `d3d12x::sparse::alloc` before `note_coherent_need`. - Diff audited and CI workflow approved (`45598152814`). **Remaining before merge:** Land `#1993` first (or rebase once `#1993` merges), `Build and test` green, and independent **AMD** + **NVIDIA** verification exercising the opt-in switch on `783ac15`.
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 11:06 UTC · original

CI \45598152814\ on \783ac15\ reported \1154 passed; 1 failed: the lone failure is pre-existing \hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa\ (\device_x.rs:1376), unrelated to #2009\ (\sparse_heaps_setting\ passed).

**@⁠raylitebull** on GitHub · 2026-11-25 11:06 UTC · [original](https://github.com/xcl-dev/xcl/pull/2009#issuecomment-7160588117) CI \45598152814\ on \783ac15\ reported \1154 passed; 1 failed\: the lone failure is pre-existing \hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa\ (\device_x.rs:1376\), unrelated to \#2009\ (\sparse_heaps_setting\ passed).
Author
Owner

@⁠Ariorh1337 on GitHub · 2026-11-25 11:44 UTC · original · edited 2026-11-25 11:48 UTC

@⁠mgrein, @⁠joeypercia thanks for running the switch on 12 GB cards. Both runs show what it costs there: the heaps fill video memory, and textures go to system memory early. I've added both to the description, along with where the switch does not pay (16 GB or less) and how it relates to #1329 and #2090. It stays off by default.

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

**@⁠Ariorh1337** on GitHub · 2026-11-25 11:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/2009#issuecomment-7161443552) · edited 2026-11-25 11:48 UTC @⁠mgrein, @⁠joeypercia thanks for running the switch on 12 GB cards. Both runs show what it costs there: the heaps fill video memory, and textures go to system memory early. I've added both to the description, along with where the switch does not pay (16 GB or less) and how it relates to #1329 and #2090. It stays off by default. AI use: Claude Code (Claude Opus 5.5) drafted this.
Author
Owner

@⁠STmihan on GitHub · 2026-11-25 13:19 UTC · original

#2009 on an 8 GB Ampere card: sparse:2048 makes the world compute passes 27–36× faster, but local VRAM then runs to 17–21 GB and the 5 s timeouts come back past ~16 GB.

RTX 3070 Ti 8 GB, driver 621.14, Ryzen 7 5800X, 64 GB RAM, Windows 11 26100, release. Retail 1.0.2.1, local tree on main f087b99 + #2009 + #1993 and other open PRs, XCL_DIRECT_DXIL=all XCL_HEAP_WINDOWS=1 XCL_PAGE_BUDGET_MB=3584, warm caches, XCL_GPU_PROFILE=1.

Per-call GPU time from XCL_GPU_PROFILE (median of the "longest" field over all windows), without and with XCL_COHERENT_HEAPS=sparse:2048 (moves the 2199 MB heap only):

| program | without | with sparse:2048 |
|

**@⁠STmihan** on GitHub · 2026-11-25 13:19 UTC · [original](https://github.com/xcl-dev/xcl/pull/2009#issuecomment-7163621368) **#2009 on an 8 GB Ampere card: `sparse:2048` makes the world compute passes 27–36× faster, but local VRAM then runs to 17–21 GB and the 5 s timeouts come back past ~16 GB.** RTX 3070 Ti 8 GB, driver 621.14, Ryzen 7 5800X, 64 GB RAM, Windows 11 26100, release. Retail 1.0.2.1, local tree on `main` `f087b99` + #2009 + #1993 and other open PRs, `XCL_DIRECT_DXIL=all XCL_HEAP_WINDOWS=1 XCL_PAGE_BUDGET_MB=3584`, warm caches, `XCL_GPU_PROFILE=1`. Per-call GPU time from `XCL_GPU_PROFILE` (median of the "longest" field over all windows), without and with `XCL_COHERENT_HEAPS=sparse:2048` (moves the 2199 MB heap only): | program | without | with `sparse:2048` | |
Author
Owner

@⁠Ariorh1337 on GitHub · 2026-11-25 16:51 UTC · original

@⁠STmihan thanks for the 8 GB run. Your comment ends at the table's header row, so if the per-program numbers got cut off when pasting, they would still be useful here.

What it adds: on a card that small, moving only the 2199 MB heap (sparse:2048) made the world's compute passes 27–36× faster, and then video memory ran to 17–21 GB and the 5 s timeouts came back past ~16 GB. With @⁠mgrein's and @⁠joeypercia's 12 GB runs, the picture is the same on all three: a large gain while the heaps fit, worse than without the switch once they don't. So the next step for this switch is a limit by the adapter's video-memory budget: move a heap only while it fits, instead of a fixed size in MB. I've added your run to the description.

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

**@⁠Ariorh1337** on GitHub · 2026-11-25 16:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/2009#issuecomment-7168632572) @⁠STmihan thanks for the 8 GB run. Your comment ends at the table's header row, so if the per-program numbers got cut off when pasting, they would still be useful here. What it adds: on a card that small, moving only the 2199 MB heap (`sparse:2048`) made the world's compute passes 27–36× faster, and then video memory ran to 17–21 GB and the 5 s timeouts came back past ~16 GB. With @⁠mgrein's and @⁠joeypercia's 12 GB runs, the picture is the same on all three: a large gain while the heaps fit, worse than without the switch once they don't. So the next step for this switch is a limit by the adapter's video-memory budget: move a heap only while it fits, instead of a fixed size in MB. I've added your run to the description. AI use: Claude Code (Claude Opus 5.5) drafted this.
Author
Owner

@⁠STmihan on GitHub · 2026-11-25 16:57 UTC · original

@⁠Ariorh1337 thanks, my earlier comment got cut off at the table when I posted it and I didn't notice. Here is the rest:

program without with sparse:2048
CS 6da1f38b06d6c735 (wave64 split) 715 ms 20 ms
CS 19a1c1ba0b567618 (wave64 split) 541 ms 20 ms
CS b78fa10b425b8e54 969 ms 487 ms
CS 24de2aef6c31d55e (wave32) 908 ms 643 ms
  • Without the switch, 3–4 small programs with no loops (e.g. 3429c04607b00016, 119 instructions, 57600 groups) take 0.3–1.7 s per call; their output buffers are in the coherent window (0x7…), which fits the ~0.1 GB/s store rate in #505.
  • With it, 0 bridge watchdog timeouts for the first ~4 min of the world, against 250–300 per run without.
  • The cost on 8 GB: local video memory reached 20.7 GB (DXGI local budget ~7.1 GB), commit 40.5 GB, and the 5 s timeouts returned (36) once local passed ~16 GB.
  • XCL_TEXTURE_PAGES_SYSTEM_MEMORY=1 alongside it kept local at ~5 GB, but menu draws went to ~40 ms each and the device hung (0x887a0006) at world entry with a DRED page fault at VA 0x0. One run.

Not tested: sparse:1024 (all four heaps) on this card, other drivers, AMD.

AI use: Claude Code ran the runs and wrote this.

**@⁠STmihan** on GitHub · 2026-11-25 16:57 UTC · [original](https://github.com/xcl-dev/xcl/pull/2009#issuecomment-7168783924) @⁠Ariorh1337 thanks, my earlier comment got cut off at the table when I posted it and I didn't notice. Here is the rest: | program | without | with `sparse:2048` | |---|---|---| | CS `6da1f38b06d6c735` (wave64 split) | 715 ms | 20 ms | | CS `19a1c1ba0b567618` (wave64 split) | 541 ms | 20 ms | | CS `b78fa10b425b8e54` | 969 ms | 487 ms | | CS `24de2aef6c31d55e` (wave32) | 908 ms | 643 ms | - Without the switch, 3–4 small programs with no loops (e.g. `3429c04607b00016`, 119 instructions, 57600 groups) take 0.3–1.7 s per call; their output buffers are in the coherent window (0x7…), which fits the ~0.1 GB/s store rate in #505. - With it, 0 bridge watchdog timeouts for the first ~4 min of the world, against 250–300 per run without. - The cost on 8 GB: local video memory reached 20.7 GB (DXGI local budget ~7.1 GB), commit 40.5 GB, and the 5 s timeouts returned (36) once local passed ~16 GB. - `XCL_TEXTURE_PAGES_SYSTEM_MEMORY=1` alongside it kept local at ~5 GB, but menu draws went to ~40 ms each and the device hung (`0x887a0006`) at world entry with a DRED page fault at VA 0x0. One run. **Not tested:** `sparse:1024` (all four heaps) on this card, other drivers, AMD. AI use: Claude Code ran the runs and wrote this.
Author
Owner

@⁠lucsoft on GitHub · 2026-11-25 19:27 UTC · original

Test report: Linux / RADV, RX 7800 XT (RDNA3). Head 99a7e4f, in a stack, not alone. Two runs reached gameplay with no device removal.

  • Setup: Mesa 26.3.1 RADV, kernel 7.3.5, Wine 11.21 Staging, vkd3d-proton 3.1. XCL main 50a9fde plus about 20 other PRs, including #1993 at 69903fc on top of this one. The full list is in #505.
  • Env: XCL_COHERENT_HEAPS=sparse:1024 XCL_COHERENT_MB=1024 XCL_HEAP_WINDOWS=1.
  • What this PR did in the runs: the two big GPU heaps went to the sparse windows, as the log shows:
    kernelx: a GPU heap of 1172 MB in the sparse windows (XCL_COHERENT_HEAPS)
    kernelx: a GPU heap of 2199 MB in the sparse windows (XCL_COHERENT_HEAPS)
    
    The coherent window stayed at 679–715 of 1024 MB for the whole run.
  • Result: the warm-cache run went past 2 000 000 dispatches. It reached the prologue title card and the first movement prompt in 2500 s. There were no GPU-wait timeouts.
  • Cost: the write-watch scan over the windows is large. By 811 s it had taken 215 s, over 37 M dirty pages. The frame rate in the world is ~1 fps or below.
  • Not tested: without the rest of the stack, or on other hardware.

AI use: Claude Code (Claude Opus 5.5) ran the analysis and drafted this. The runs were real, on the hardware above.

**@⁠lucsoft** on GitHub · 2026-11-25 19:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/2009#issuecomment-7172334058) **Test report: Linux / RADV, RX 7800 XT (RDNA3). Head `99a7e4f`, in a stack, not alone.** Two runs reached gameplay with no device removal. - **Setup:** Mesa 26.3.1 RADV, kernel 7.3.5, Wine 11.21 Staging, vkd3d-proton 3.1. XCL `main` `50a9fde` plus about 20 other PRs, including #1993 at `69903fc` on top of this one. The full list is in https://git.gtahub.st/github/xcl-dev--xcl/issues/505. - **Env:** `XCL_COHERENT_HEAPS=sparse:1024 XCL_COHERENT_MB=1024 XCL_HEAP_WINDOWS=1`. - **What this PR did in the runs:** the two big GPU heaps went to the sparse windows, as the log shows: ``` kernelx: a GPU heap of 1172 MB in the sparse windows (XCL_COHERENT_HEAPS) kernelx: a GPU heap of 2199 MB in the sparse windows (XCL_COHERENT_HEAPS) ``` The coherent window stayed at 679–715 of 1024 MB for the whole run. - **Result:** the warm-cache run went past 2 000 000 dispatches. It reached the prologue title card and the first movement prompt in 2500 s. There were no GPU-wait timeouts. - **Cost:** the write-watch scan over the windows is large. By 811 s it had taken 215 s, over 37 M dirty pages. The frame rate in the world is ~1 fps or below. - **Not tested:** without the rest of the stack, or on other hardware. AI use: Claude Code (Claude Opus 5.5) ran the analysis and drafted this. The runs were real, on the hardware above.
Author
Owner

@⁠Ariorh1337 on GitHub · 2026-11-25 21:16 UTC · original

@⁠bmjask the fence hooks are fixed in #1993's 0a755f0 (details there). This PR is restacked on it as 2f49088.

About the other two points:

  • Windows CI: the CI workflow waits for a maintainer's approval on PRs from forks. I can't start it myself. The full suite on this machine is in the description: cargo test --workspace --no-fail-fast -- --test-threads=4 on 2f49088, 1419 passed, 4 failed, 46 ignored (the same 4 fuzz_validate_and_gpu_0..3 and SKIPPED tests as main 06055a7, 1409 passed).
  • A title run of main + #1993 + this PR with the switch on: done on 2f49088 alone (RTX 5090, release, XCL_COHERENT_HEAPS=sparse:1024 XCL_HEAP_WINDOWS=1, through the menus by controller):
    • both big heaps moved (a GPU heap of 1172 MB and of 2199 MB in the sparse windows); sparse pools at 5.4 GB, local video memory 17.7 GB;
    • the world's first burst ran (7861 dispatches after the first #101). There was no did not complete within, no has not reached fence and no copy-back line, and no crash or device removal in the 438 s watched;
    • presents stopped 8 s after the first #101, because the title then waited on cold driver builds of compute pipelines (68 of them with no driver blob, as main's HLSL is new to this machine's cache). So the run shows the switch's path working up to that point. It doesn't show the world running with it.

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

**@⁠Ariorh1337** on GitHub · 2026-11-25 21:16 UTC · [original](https://github.com/xcl-dev/xcl/pull/2009#issuecomment-7174862753) @⁠bmjask the fence hooks are fixed in #1993's `0a755f0` (details there). This PR is restacked on it as `2f49088`. About the other two points: - **Windows CI:** the `CI` workflow waits for a maintainer's approval on PRs from forks. I can't start it myself. The full suite on this machine is in the description: `cargo test --workspace --no-fail-fast -- --test-threads=4` on `2f49088`, 1419 passed, 4 failed, 46 ignored (the same 4 `fuzz_validate_and_gpu_0..3` and SKIPPED tests as `main` `06055a7`, 1409 passed). - **A title run of `main` + #1993 + this PR with the switch on:** done on `2f49088` alone (RTX 5090, release, `XCL_COHERENT_HEAPS=sparse:1024 XCL_HEAP_WINDOWS=1`, through the menus by controller): - both big heaps moved (`a GPU heap of 1172 MB` and `of 2199 MB in the sparse windows`); sparse pools at 5.4 GB, local video memory 17.7 GB; - the world's first burst ran (7861 dispatches after the first `#101`). There was no `did not complete within`, no `has not reached fence` and no copy-back line, and no crash or device removal in the 438 s watched; - presents stopped 8 s after the first `#101`, because the title then waited on cold driver builds of compute pipelines (68 of them with no driver blob, as `main`'s HLSL is new to this machine's cache). So the run shows the switch's path working up to that point. It doesn't show the world running with it. AI use: Claude Code (Claude Opus 5.5) drafted this.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 00:49 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

**@⁠DavidM1911** on GitHub · 2026-11-26 00:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/2009#issuecomment-7179153853) 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
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2009/head:github-bot/gh-2009'
git switch 'github-bot/gh-2009'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2009'
git switch 'github-bot/gh-2009'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2009'
git switch 'github-bot/gh-2009'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2009'
git switch 'main'
git merge --squash 'github-bot/gh-2009'
git switch 'main'
git merge --ff-only 'github-bot/gh-2009'
git switch 'main'
git merge 'github-bot/gh-2009'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.