UMA: XCL_COHERENT_HEAP_WINDOWS gives the title's GPU heaps windows of their own #3696

Open
Prime1997 wants to merge 7 commits from upstream-pr/3696 into main
Prime1997 commented 2026-12-02 15:14:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Prime1997 on 2026-12-02T15:14:38Z.


Requested by Prime

Stacked on #3695; only the top 5 commits belong here.

With XCL_COHERENT_MB=512, a retail title's world on an 8 GB GPU makes GPU heaps of 1162, 1277 and 258 MB that the coherent window has no room for. They end up in plain, write-watched memory the GPU never sees directly: shaders read zeros there, and every submit copies and watches about 2.7 GB. XCL_COHERENT_HEAP_WINDOWS gives such a heap a committed window of its own, in a free slot of the 16-window aperture, at the title's own address. On NVIDIA it is a driver CUSTOM write-back L0 heap in system memory (else imported), so the GPU reads and writes the heap where the title has it. It is off by default.

What is in it

  • UMA: XCL_COHERENT_HEAP_WINDOWS gives the title's GPU heaps windows of their own (gpu/uma.rs, hle/kernelx.rs, README.md)
    • 1 or auto uses the sizes the last run stored in cache/uma_heap_windows.txt (the first run only stores them).
    • 1277,1162,258 gives the sizes in MB.
    • XCL_COHERENT_HEAP_WINDOWS_CAP_MB caps the total: 4096 by default, or an eighth of the RAM below 24 GB.
  • D3D12.X: the coherent window's headroom checks leave the heaps' own windows out (gpu/uma.rs, hle/d3d12x/real.rs)
  • D3D12.X: a heap's own window the GPU cannot open is dropped alone, not all of unified memory (gpu/uma.rs, hle/d3d12x/real.rs)
  • UMA: a heap's own window goes to the heap it was made for, not to any heap half its size (gpu/uma.rs, hle/kernelx.rs)
  • D3D12.X: logs give the coherent window without the heaps' own windows (gpu/uma.rs, hle/d3d12x/bind.rs, hle/d3d12x/real.rs)

Tested

  • cargo check -p xcl --lib --tests --target x86_64-pc-windows-gnu on Linux: builds, no new warnings.
  • Prime's batch builds since 1 Dec on an RTX 3060 Ti 8 GB, 32 GB, Windows 11, release, with a retail title, XCL_COHERENT_MB=512 and XCL_UMA_WINDOWS=16:
    • XCL_COHERENT_HEAP_WINDOWS=258 reaches the world and is stable there; it ran 925 s in one run.
    • Windows for 1277,1162,258 all at once hung the GPU at world entry in 3 runs out of 3. Use only the sizes that fit your GPU's budget.

Regression run

  • No smoke blocks: this branch was not built and run on its own from main (Prime's call for our PRs; they merge after community testing). Off by default, so nothing changes unless the variable is set.

Not tested

  • The full test suite on this exact branch, AMD GPUs, and a smoke comparison against main.

AI use

  • Claude Code wrote the code, the commit messages and this description; Prime ran the builds.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:5609307728 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3696). Originally posted by [Prime1997](https://github.com/Prime1997) on 2026-12-02T15:14:38Z. --- <!-- claude-projects-attribution: {"github_login":"Prime1997"} --> _Requested by **Prime**_ Stacked on #3695; only the top 5 commits belong here. With `XCL_COHERENT_MB=512`, a retail title's world on an 8 GB GPU makes GPU heaps of 1162, 1277 and 258 MB that the coherent window has no room for. They end up in plain, write-watched memory the GPU never sees directly: shaders read zeros there, and every submit copies and watches about 2.7 GB. `XCL_COHERENT_HEAP_WINDOWS` gives such a heap a committed window of its own, in a free slot of the 16-window aperture, at the title's own address. On NVIDIA it is a driver CUSTOM write-back L0 heap in system memory (else imported), so the GPU reads and writes the heap where the title has it. It is off by default. **What is in it** - `UMA: XCL_COHERENT_HEAP_WINDOWS gives the title's GPU heaps windows of their own` (`gpu/uma.rs`, `hle/kernelx.rs`, `README.md`) - `1` or `auto` uses the sizes the last run stored in `cache/uma_heap_windows.txt` (the first run only stores them). - `1277,1162,258` gives the sizes in MB. - `XCL_COHERENT_HEAP_WINDOWS_CAP_MB` caps the total: 4096 by default, or an eighth of the RAM below 24 GB. - `D3D12.X: the coherent window's headroom checks leave the heaps' own windows out` (`gpu/uma.rs`, `hle/d3d12x/real.rs`) - `D3D12.X: a heap's own window the GPU cannot open is dropped alone, not all of unified memory` (`gpu/uma.rs`, `hle/d3d12x/real.rs`) - `UMA: a heap's own window goes to the heap it was made for, not to any heap half its size` (`gpu/uma.rs`, `hle/kernelx.rs`) - `D3D12.X: logs give the coherent window without the heaps' own windows` (`gpu/uma.rs`, `hle/d3d12x/bind.rs`, `hle/d3d12x/real.rs`) **Tested** - `cargo check -p xcl --lib --tests --target x86_64-pc-windows-gnu` on Linux: builds, no new warnings. - Prime's batch builds since 1 Dec on an RTX 3060 Ti 8 GB, 32 GB, Windows 11, release, with a retail title, `XCL_COHERENT_MB=512` and `XCL_UMA_WINDOWS=16`: - `XCL_COHERENT_HEAP_WINDOWS=258` reaches the world and is stable there; it ran 925 s in one run. - Windows for `1277,1162,258` all at once hung the GPU at world entry in 3 runs out of 3. Use only the sizes that fit your GPU's budget. **Regression run** - No smoke blocks: this branch was not built and run on its own from `main` (Prime's call for our PRs; they merge after community testing). Off by default, so nothing changes unless the variable is set. **Not tested** - The full test suite on this exact branch, AMD GPUs, and a smoke comparison against `main`. **AI use** - Claude Code wrote the code, the commit messages and this description; Prime ran the builds. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
pvfreis commented 2026-12-02 15:27:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by pvfreis on 2026-12-02T15:27:14Z.

Review: COMMENTED


Preserve slot ownership when combining this with #3653. On 73a68e2e3, dedicated heaps start at heaps_at = views_at + view_wins. On #3653's 1de2334d6, that same tail becomes write-watched overflow views. A trial merge stops in gpu/uma.rs. Moving the OS reservation to rest_at alone would still leave the dedicated heap addresses in #3653's overflow free list and lookup range, so an overflow reservation could reuse a committed heap address.

Please derive the heap capacity and overflow ranges from the same layout. With 16 windows, four sparse windows, one coherent window and six primary views, five slots remain. The current own_window_slots calculation assumes three sparse windows and would admit six if carried over unchanged. A layout test can exercise one dedicated heap plus one overflow reservation, then fill the tail and verify that an extra dedicated heap gets no slot.

Switch-form access. The fallback discussed in #3517 binds four root UAVs. The dedicated heaps added here sit beyond them, so a raw load from one of those heaps returns zero after a heap-window PSO is rebuilt in switch form. Please document that limit for XCL_COHERENT_HEAP_WINDOWS until the fallback can address the dedicated heaps.

AI use: OpenAI Codex (GPT-6.2 Sol) reviewed the source, ran the local trial merge and drafted this review. Claude Code (Claude Fable 5.2) independently checked it.

<!-- greyfinch-sync:ivall/xcl:review:6153851314 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3696#pullrequestreview-6153851314). Originally posted by [pvfreis](https://github.com/pvfreis) on 2026-12-02T15:27:14Z. **Review:** COMMENTED --- **Preserve slot ownership when combining this with #3653.** On `73a68e2e3`, dedicated heaps start at `heaps_at = views_at + view_wins`. On #3653's `1de2334d6`, that same tail becomes write-watched overflow views. A trial merge stops in `gpu/uma.rs`. Moving the OS reservation to `rest_at` alone would still leave the dedicated heap addresses in #3653's overflow free list and lookup range, so an overflow reservation could reuse a committed heap address. Please derive the heap capacity and overflow ranges from the same layout. With 16 windows, four sparse windows, one coherent window and six primary views, five slots remain. The current `own_window_slots` calculation assumes three sparse windows and would admit six if carried over unchanged. A layout test can exercise one dedicated heap plus one overflow reservation, then fill the tail and verify that an extra dedicated heap gets no slot. **Switch-form access.** The fallback discussed in #3517 binds four root UAVs. The dedicated heaps added here sit beyond them, so a raw load from one of those heaps returns zero after a heap-window PSO is rebuilt in switch form. Please document that limit for `XCL_COHERENT_HEAP_WINDOWS` until the fallback can address the dedicated heaps. AI use: OpenAI Codex (GPT-6.2 Sol) reviewed the source, ran the local trial merge and drafted this review. Claude Code (Claude Fable 5.2) independently checked it.
IvovdBruggen commented 2026-12-02 17:02:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by IvovdBruggen on 2026-12-02T17:02:54Z.


Test report (not a merge-check): #3696 at 73a68e2e on an RTX 3080 10 GB. I ran a matched pair, without heap windows and with XCL_COHERENT_HEAP_WINDOWS=563, both warm and with an 80 GB commit limit and DRED.

  • The feature works as described. The 563 MB heap gets its own window: a driver CUSTOM write-back L0 heap at the title's address.
  • On this machine it does not change the outcome. Both runs get past the loading screen into the intro, but show only its credits and subtitles on a black picture.
  • Both lose the device at about the same time, 217 s and 206 s, with the same DRED page fault at GPU VA 0x0. That points to a separate bug rather than to #3696.
  • A fixed 258 from the description doesn't apply here. This title's heaps on this machine are 2199, 1172, 596 and 563 MB.

Setup

  • RTX 3080 10 GB (10,240 MiB; DXGI budget about 9.3 GB), NVIDIA 617.42, 32-lane waves. Ryzen 5 5600 (6C/12T), 32 GB RAM, 48 GB fixed page file (commit limit 81.8 GB). Windows 11 IoT Enterprise LTSC 26100.
  • 73a68e2e3dce4eb7cfcc870924c72ea78c755f42: this PR's head, a fast-forward of main 5eaadb54c14e. Clean tree, cargo build --release --workspace, Rust 1.100.0, DXC 1.9.2602.17.
  • The large retail title from #505 (1.0.2.1, TitleID 7952987A), Series X profile. Played by hand: menus, then the story start. Neither run was closed by hand.
  • Env for both: XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 XCL_COHERENT_MB=512 XCL_DRED=1 XCL_NETWORK=0 XCL_ACTIVITY=1. Run B: no XCL_COHERENT_HEAP_WINDOWS. Run A: XCL_COHERENT_HEAP_WINDOWS=563.
  • Caches warm: compute pipelines in 2–3 s, the recorded graphics pipelines (845) built before the start.

Results (times from the title's start, read from the 2 s memory: and activity lines)

run B (no heap windows) run A (563)
heaps the 512 MB coherent window has no room for 1172, 2199, 563, 596 MB, all in plain memory 1172, 2199, 596 MB in plain memory; 563 MB in window 10 (a GPU heap of 563 MB at 0x1a00000000 in a window of its own)
what was on screen menus at 30 fps, past the loading screen; intro credits and subtitles on black, in sync with audio same as B
local video memory past the budget 91 s 84 s
presents after the world load 0–3 per 2 s from ~130 s 0–3 per 2 s from ~115 s
graphics pipeline waits 3 (10 s in all) 2 (6 s in all)
draws with translated pipelines (skipped), last line 86,093 (65,536) 138,265 (136,814)
dispatches (skipped) 161,058 (0) 262,144 (0)
peak local video memory / budget 17,980 / 9,272 MB 17,757 / 9,280 MB
peak non-local 1,875 MB 2,660 MB
peak commit (process) 39,278 MB 38,238 MB
target pages (pools), peak 10,195 (10,368) MB 10,146 (10,240) MB
sparse pools, peak 3,788 MB 3,820 MB
system commit at the end 49,631 of 81,845 MB, no running out of commit warning 48,705 of 81,845 MB, no warning
device removed 217 s, 0x887a0005 206 s, 0x887a0005
DRED page fault at GPU VA 0x0 = window 10 + 0x0; allocations there: [], no breadcrumbs (no list in flight) page fault at GPU VA 0x0 = window 11 + 0x0; allocations there: [], same
  • The console code so far lines are logged at power-of-two counts, so the two skip shares (76 % and 99 %) don't come from the same moment. In both runs most of the intro's 3D draws were skipped, which fits the black picture. nvidia-smi peaked at 9,954 / 9,955 of 10,240 MiB.
  • The fault at GPU VA 0 in both runs, with and without the heap window, looks like the case #3658 describes ("a memory window with no GPU buffer gives no GPU address"). I haven't tested #3658.
  • Two earlier runs on this head had a 16–32 GB page file (commit limit ~50 GB) and no DRED, so they aren't comparable. Run 1 used 258 (no heap matched) with cold graphics pipelines: 326 waits, 834 s in all, frames stopped at ~186 s, device removed at 778 s. Run 2 used 563: device removed at 237 s. Both ran with system commit within ~1 GB of the limit and XCL's running out of commit warnings. The 80 GB pair above rules that out as the cause.
  • The description gives 1277 / 1162 / 258 MB on a 3060 Ti 8 GB. Which build, title id and profile were those sizes measured on?

Not tested

  • Windows for the bigger heaps (1172,563, or 1 = auto).
  • #3695's default behaviour without XCL_COHERENT_MB.
  • #3658 on top of this.
  • The full test suite and a scripts/smoke.ps1 comparison against main on this head. AMD and other NVIDIA cards.

AI use: Claude Code (Claude Opus 5.5) built the branch, ran the title on this machine, read the logs and wrote this report; I posted it. The figures come from each run's xcl.log, report.json and an nvidia-smi trace.

<!-- greyfinch-sync:ivall/xcl:comment:7352824227 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3696#issuecomment-7352824227). Originally posted by [IvovdBruggen](https://github.com/IvovdBruggen) on 2026-12-02T17:02:54Z. --- **Test report (not a merge-check): #3696 at `73a68e2e` on an RTX 3080 10 GB.** I ran a matched pair, without heap windows and with `XCL_COHERENT_HEAP_WINDOWS=563`, both warm and with an 80 GB commit limit and DRED. - **The feature works as described.** The 563 MB heap gets its own window: a driver CUSTOM write-back L0 heap at the title's address. - **On this machine it does not change the outcome.** Both runs get past the loading screen into the intro, but show only its credits and subtitles on a black picture. - **Both lose the device at about the same time**, 217 s and 206 s, with the same DRED page fault at GPU VA `0x0`. That points to a separate bug rather than to #3696. - **A fixed `258` from the description doesn't apply here.** This title's heaps on this machine are 2199, 1172, 596 and 563 MB. **Setup** - RTX 3080 10 GB (10,240 MiB; DXGI budget about 9.3 GB), NVIDIA 617.42, 32-lane waves. Ryzen 5 5600 (6C/12T), 32 GB RAM, 48 GB fixed page file (commit limit 81.8 GB). Windows 11 IoT Enterprise LTSC 26100. - `73a68e2e3dce4eb7cfcc870924c72ea78c755f42`: this PR's head, a fast-forward of `main` `5eaadb54c14e`. Clean tree, `cargo build --release --workspace`, Rust 1.100.0, DXC 1.9.2602.17. - The large retail title from #505 (1.0.2.1, TitleID 7952987A), Series X profile. Played by hand: menus, then the story start. Neither run was closed by hand. - Env for both: `XCL_HEAP_WINDOWS=1 XCL_UMA_WINDOWS=16 XCL_COHERENT_MB=512 XCL_DRED=1 XCL_NETWORK=0 XCL_ACTIVITY=1`. Run B: no `XCL_COHERENT_HEAP_WINDOWS`. Run A: `XCL_COHERENT_HEAP_WINDOWS=563`. - Caches warm: compute pipelines in 2–3 s, the recorded graphics pipelines (845) built before the start. **Results** (times from the title's start, read from the 2 s `memory:` and `activity` lines) | | run B (no heap windows) | run A (`563`) | |---|---|---| | heaps the 512 MB coherent window has no room for | 1172, 2199, 563, 596 MB, all in plain memory | 1172, 2199, 596 MB in plain memory; **563 MB in window 10** (`a GPU heap of 563 MB at 0x1a00000000 in a window of its own`) | | what was on screen | menus at 30 fps, past the loading screen; intro credits and subtitles on black, in sync with audio | same as B | | local video memory past the budget | 91 s | 84 s | | presents after the world load | 0–3 per 2 s from ~130 s | 0–3 per 2 s from ~115 s | | graphics pipeline waits | 3 (10 s in all) | 2 (6 s in all) | | draws with translated pipelines (skipped), last line | 86,093 (65,536) | 138,265 (136,814) | | dispatches (skipped) | 161,058 (0) | 262,144 (0) | | peak local video memory / budget | 17,980 / 9,272 MB | 17,757 / 9,280 MB | | peak non-local | 1,875 MB | 2,660 MB | | peak commit (process) | 39,278 MB | 38,238 MB | | target pages (pools), peak | 10,195 (10,368) MB | 10,146 (10,240) MB | | sparse pools, peak | 3,788 MB | 3,820 MB | | system commit at the end | 49,631 of 81,845 MB, no `running out of commit` warning | 48,705 of 81,845 MB, no warning | | device removed | **217 s**, `0x887a0005` | **206 s**, `0x887a0005` | | DRED | `page fault at GPU VA 0x0 = window 10 + 0x0; allocations there: []`, no breadcrumbs (no list in flight) | `page fault at GPU VA 0x0 = window 11 + 0x0; allocations there: []`, same | - The `console code so far` lines are logged at power-of-two counts, so the two skip shares (76 % and 99 %) don't come from the same moment. In both runs most of the intro's 3D draws were skipped, which fits the black picture. `nvidia-smi` peaked at 9,954 / 9,955 of 10,240 MiB. - The fault at GPU VA 0 in both runs, with and without the heap window, looks like the case #3658 describes ("a memory window with no GPU buffer gives no GPU address"). I haven't tested #3658. - Two earlier runs on this head had a 16–32 GB page file (commit limit ~50 GB) and no DRED, so they aren't comparable. Run 1 used `258` (no heap matched) with cold graphics pipelines: 326 waits, 834 s in all, frames stopped at ~186 s, device removed at 778 s. Run 2 used `563`: device removed at 237 s. Both ran with system commit within ~1 GB of the limit and XCL's `running out of commit` warnings. The 80 GB pair above rules that out as the cause. - The description gives 1277 / 1162 / 258 MB on a 3060 Ti 8 GB. Which build, title id and profile were those sizes measured on? **Not tested** - Windows for the bigger heaps (`1172,563`, or `1` = auto). - #3695's default behaviour without `XCL_COHERENT_MB`. - #3658 on top of this. - The full test suite and a `scripts/smoke.ps1` comparison against `main` on this head. AMD and other NVIDIA cards. **AI use:** Claude Code (Claude Opus 5.5) built the branch, ran the title on this machine, read the logs and wrote this report; I posted it. The figures come from each run's `xcl.log`, `report.json` and an `nvidia-smi` trace.
tiagonleal commented 2026-12-02 17:34:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by tiagonleal on 2026-12-02T17:34:20Z.


Test report (not a merge-check: PR description red)
base: 5eaadb54c1
head: 73a68e2e3d
merge: clean (merge commit 826ab4850b7ff57d13def0ba0fed65539aa1ab8c; the head is already on this base, so the merged tree is the head's tree)
build: cargo build --workspace -> ok. One new compiler warning against main with rustc 1.100.0: fetch_update is deprecated (renamed to try_update), from coherent_heap_released in hle/kernelx.rs
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2982 passed, 0 failed, 52 ignored; SKIPPED: 24 (22 no wave64, 2 no heap windows); failing: none
review: diff read once, not a full review. Nothing found beyond the warning above.
performance: off by default. 60 s smoke of a retail title, main 5eaadb54 vs this merge (826ab485), switch unset in both: 1683 -> 1699 frames shown (101 %; last presents per 2 s: 60 60 60), peak commit 16744 -> 16400 MB, 0 device removals, 0 crashes.
hardware / tool and model: RTX 5070 Ti 16 GB (driver 617.42), Ryzen 7 9800X3D, 32 GB, Windows 11 Pro 26300 / Claude Code with Claude Opus 5.5

main:

xcl-smoke v1
commit: 5eaadb54c14e0fc29597b2a1689d7dbd83491303
gpu: NVIDIA GeForce RTX 5070 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1683 (PresentX 1683)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16744 MB

this merge:

xcl-smoke v1
commit: 826ab4850b7ff57d13def0ba0fed65539aa1ab8c
gpu: NVIDIA GeForce RTX 5070 Ti
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1699 (PresentX 1699)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16400 MB

World runs with the switch on

This is the case the PR describes: XCL_COHERENT_MB=512, XCL_UMA_WINDOWS=16, XCL_DEVICE_TYPE=lockhart, release, Newer Retail Game, with XCL_COHERENT_HEAP_WINDOWS=1162,1277,258 (the three heap sizes our 512 MB runs log). All runs are single runs.

  • Of this merge: W7 (XCL_GPU_TIMES=16,110, 300 s planned) and W5 (600 s planned, XCL_ACTIVITY=1).
  • Control, today: main 5eaadb54 with the same settings and no switch (300 s).
  • From earlier today on main 1c8b5514 (an older main), with no switch: one run with XCL_COHERENT_MB=512 (XCL_GPU_TIMES) and one with XCL_COHERENT_MB=3408 (one window large enough for all three heaps).

In every run of this merge, all three heaps got their own windows at start-up, each a driver CUSTOM write-back L0 heap:

UMA: XCL_COHERENT_HEAP_WINDOWS: 3 window(s) of their own for the title's GPU heaps the coherent window has no room for: window 10 at 0x1a00000000 1168 MB, window 11 at 0x1b00000000 1280 MB, window 12 at 0x1c00000000 272 MB (2720 MB in all, committed now)
kernelx: a GPU heap of 1162 MB at 0x1a00000000 in a window of its own (window 10, a driver CUSTOM write-back L0 heap; XCL_COHERENT_HEAP_WINDOWS): #1, 1162 MB alive there
kernelx: a GPU heap of 1277 MB at 0x1b00000000 in a window of its own (window 11, a driver CUSTOM write-back L0 heap; XCL_COHERENT_HEAP_WINDOWS): #2, 2439 MB alive there
kernelx: a GPU heap of 258 MB at 0x1c00000000 in a window of its own (window 12, a driver CUSTOM write-back L0 heap; XCL_COHERENT_HEAP_WINDOWS): #3, 2697 MB alive there
this merge, W7 this merge, W5 main 5eaadb54, 512 MB main 1c8b5514, 512 MB main 1c8b5514, 3408 MB
heaps "does not fit" 0 0 3 3 0
draws skipped (last counter line) 147 of 66,208 171 of 131,072 262,144 of 280,282 454,156 of 482,113 0 of 262,144
world entry (log s) 76.3 76.3 80.3 78.3 76.3
world time 96 s 156 s 216 s 276 s 344 s
mean fps in the world 0.73 0.45 0.74 0.86 0.31
2 s windows with no present 33 % 41 % 6 % 4 % 49 %
frame time in windows with presents 914 ms 1314 ms 1263 ms 1127 ms 1657 ms
cs e2046474 (1x1x1), GPU time not in the top 60 (under 1.72 ms/frame) - - 89.5 ms/frame, longest 44.9 ms not in the top 60 (under 2.45 ms/frame)
GPU frame, first to last stamp (16 frames) 0.66-3.93 s, median 2.05 s - - 1.10-1.32 s 4.52-5.34 s
top program (ms/frame) mesh two-pass ms 1f46b8c3: 570 - - cs 745b25de: 365 mesh two-pass ms 1f46b8c3: 2380
peak local video memory / budget 14,221 / 15,054 MB 14,309 / 15,025 MB 15,313 / 15,054 MB 15,202 / 15,048 MB 14,110 / 15,047 MB
peak non-local video memory 5,568 MB 5,594 MB 2,769 MB 3,104 MB 5,779 MB
peak process commit 31,184 MB 31,594 MB 32,984 MB 33,660 MB 31,364 MB
how it ended GPU-wait watchdog at log 172.6 s, 0x80004005 GPU-wait watchdog at log 232.2 s, 0x80004005 RAM guard at 302 s (296 s in the log) RAM guard at 360 s ended by itself, 420 s
  • W7's GPU times ran over log 117-149 s, early in the world. The other two GPU-time runs were measured later (from about 200 s), so the scenes differ. e2046474's exact time is not in the data, only an upper bound. It was 89.5 ms/frame in the 512 MB run without the switch.
  • GPU-wait watchdog: with the switch on, three runs after the RGB app was closed reached the world, and all three were stopped by it. Each logged 14 to 16 GPU queue.Wait ... did not complete within 5000 ms errors with four or five queues behind ("oldest unfinished for ~7.1 s"), then "a GPU queue wait exceeded its watchdog without a graph-proven cycle". The third is W4 (XCL_GPU_TIMES=16,200), stopped at log 199.2 s just before its measurement began. All three stopped at nearly the same fence value (0x683 to 0x68d completed). The control run on main without the switch had none in 296 s. The 3408 MB single-window run had the same watchdog once in three launches earlier today.
  • Driver resets: none in this merge's runs (System log checked, no nvlddmkm entries, no STOP_ALL_RUNS). The 3408 MB setting had one TDR in three launches earlier today.
  • One more launch of this merge (W6, same settings as W7) ended at log 95.4 s, before the world, with an access violation in the title's code (read at 0xffffffffffffffff). Once, not seen in the other runs.
  • Image (W2, an earlier run of this merge with frame dumps): the first frames in the world show a textured character and some lit geometry under a heavy grey-white haze, with a striped white ellipse over the middle. This is close to the 3408 MB run's frames and unlike the flat white or black frames of the 512 MB run without the switch.
  • The first world runs of this merge (W1, W2, W3, W1b) were cut short by another application's memory leak and are not used for timings or for how a run ended. A third-party RGB lighting app grew from about 0.3 GB to 6.6 GB during them, and our RAM guard stopped all four. That app was closed before W4-W7 and the control. Its working set was logged every minute and stayed at 0.

With only the 258 MB heap in a window (the recipe in the PR body)

XCL_COHERENT_HEAP_WINDOWS=258, recipe B otherwise unchanged (512 MB, XCL_UMA_WINDOWS=16), same merge 826ab485. Two single runs: W8 (XCL_GPU_TIMES=16,110, 420 s planned) and W9 (600 s planned). The RGB app was not running (logged every minute: 0 MB).

UMA: XCL_COHERENT_HEAP_WINDOWS: 1 window(s) of their own for the title's GPU heaps the coherent window has no room for: window 10 at 0x1a00000000 272 MB (272 MB in all, committed now)
kernelx: a GPU heap of 1162 MB does not fit in the coherent window (64 MB used, 448 MB free): #1, 1162 MB in all
kernelx: a GPU heap of 1277 MB does not fit in the coherent window (64 MB used, 448 MB free): #2, 2439 MB in all
kernelx: a GPU heap of 258 MB at 0x1a00000000 in a window of its own (window 10, a driver CUSTOM write-back L0 heap; XCL_COHERENT_HEAP_WINDOWS): #1, 258 MB alive there
W8 W9
heaps "does not fit" / empty V# / "not in unified memory" 2 / 1 / 5 2 / 1 / 5
draws skipped (last counter line) 42,421 of 65,536 186,750 of 205,477
world entry (log s) 84.3 80.3
world time 78 s 180 s
mean fps in the world 0.67 0.69
2 s windows with no present 15 % 9 %
frame time in windows with presents 1269 ms 1323 ms
cs e2046474 (1x1x1), GPU time 115.0 ms/frame, longest 57.5 ms (row 4) -
GPU frame, first to last stamp (16 frames, log 113-145 s) 1.01-3.92 s, median 1.42 s -
top program (ms/frame) mesh two-pass ms 1f46b8c3: 294 -
peak local video memory / budget 15,017 / 14,834 MB 14,665 / 14,868 MB
peak non-local video memory 3,165 MB 3,091 MB
peak process commit 32,445 MB 32,346 MB
how it ended RAM guard at 168 s (free RAM under 1 GB) RAM guard at 267 s (free RAM under 1 GB)
  • The two large heaps stay in plain memory as without the switch: the same "does not fit", empty V# and "not in unified memory" lines, and most draws skipped (65 % and 91 %). e2046474 is back at the top of the GPU times.
  • No GPU-wait watchdog and no driver reset in either run (System log checked). Both ended by our RAM guard at about 32.4 GB process commit. Free RAM at the start was 20.2 and 21.4 GB, lower than the 24 GB of W4-W7, because a chat app and a browser were open.

assessment: merges, builds and passes the whole suite on current main, and the smoke run with the switch off is clean. With the switch on and 512 MB, the three heaps land in GPU-visible windows of their own and nearly all draws run (about 0.2 % skipped, against 94 % without the switch). The long 1x1x1 compute program drops out of the GPU top 60, and geometry appears in the image. The cost resembles the single 3408 MB window's: about 2.8 GB more non-local memory, longer GPU frames than the 512 MB run, and in our runs a GPU-wait watchdog stop 2 to 3 minutes into the world (three runs out of three), which the control on main did not show. No driver reset at world entry on this 16 GB card, where Prime's 8 GB card hung three times in three. With only the 258 MB heap in a window, the PR body's recipe, the runs did not hang, but the two large heaps stay outside GPU memory and the GPU work looks like the 512 MB run without the switch: most draws skipped and e2046474 at 115 ms/frame. Single runs.

AI use: Claude Code (Claude Opus 5.5).
~Tiago

<!-- greyfinch-sync:ivall/xcl:comment:7353434839 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3696#issuecomment-7353434839). Originally posted by [tiagonleal](https://github.com/tiagonleal) on 2026-12-02T17:34:20Z. --- Test report (not a merge-check: `PR description` red) base: 5eaadb54c14e0fc29597b2a1689d7dbd83491303 head: 73a68e2e3dce4eb7cfcc870924c72ea78c755f42 merge: clean (merge commit 826ab4850b7ff57d13def0ba0fed65539aa1ab8c; the head is already on this base, so the merged tree is the head's tree) build: cargo build --workspace -> ok. One new compiler warning against main with rustc 1.100.0: `fetch_update` is deprecated (renamed to `try_update`), from `coherent_heap_released` in `hle/kernelx.rs` tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2982 passed, 0 failed, 52 ignored; SKIPPED: 24 (22 no wave64, 2 no heap windows); failing: none review: diff read once, not a full review. Nothing found beyond the warning above. performance: off by default. 60 s smoke of a retail title, main 5eaadb54 vs this merge (826ab485), switch unset in both: 1683 -> 1699 frames shown (101 %; last presents per 2 s: 60 60 60), peak commit 16744 -> 16400 MB, 0 device removals, 0 crashes. hardware / tool and model: RTX 5070 Ti 16 GB (driver 617.42), Ryzen 7 9800X3D, 32 GB, Windows 11 Pro 26300 / Claude Code with Claude Opus 5.5 main: ``` xcl-smoke v1 commit: 5eaadb54c14e0fc29597b2a1689d7dbd83491303 gpu: NVIDIA GeForce RTX 5070 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1683 (PresentX 1683) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16744 MB ``` this merge: ``` xcl-smoke v1 commit: 826ab4850b7ff57d13def0ba0fed65539aa1ab8c gpu: NVIDIA GeForce RTX 5070 Ti title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1699 (PresentX 1699) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16400 MB ``` **World runs with the switch on** This is the case the PR describes: `XCL_COHERENT_MB=512`, `XCL_UMA_WINDOWS=16`, `XCL_DEVICE_TYPE=lockhart`, release, Newer Retail Game, with `XCL_COHERENT_HEAP_WINDOWS=1162,1277,258` (the three heap sizes our 512 MB runs log). All runs are single runs. - Of this merge: W7 (`XCL_GPU_TIMES=16,110`, 300 s planned) and W5 (600 s planned, `XCL_ACTIVITY=1`). - Control, today: main 5eaadb54 with the same settings and no switch (300 s). - From earlier today on main 1c8b5514 (an older main), with no switch: one run with `XCL_COHERENT_MB=512` (`XCL_GPU_TIMES`) and one with `XCL_COHERENT_MB=3408` (one window large enough for all three heaps). In every run of this merge, all three heaps got their own windows at start-up, each a driver CUSTOM write-back L0 heap: ``` UMA: XCL_COHERENT_HEAP_WINDOWS: 3 window(s) of their own for the title's GPU heaps the coherent window has no room for: window 10 at 0x1a00000000 1168 MB, window 11 at 0x1b00000000 1280 MB, window 12 at 0x1c00000000 272 MB (2720 MB in all, committed now) kernelx: a GPU heap of 1162 MB at 0x1a00000000 in a window of its own (window 10, a driver CUSTOM write-back L0 heap; XCL_COHERENT_HEAP_WINDOWS): #1, 1162 MB alive there kernelx: a GPU heap of 1277 MB at 0x1b00000000 in a window of its own (window 11, a driver CUSTOM write-back L0 heap; XCL_COHERENT_HEAP_WINDOWS): #2, 2439 MB alive there kernelx: a GPU heap of 258 MB at 0x1c00000000 in a window of its own (window 12, a driver CUSTOM write-back L0 heap; XCL_COHERENT_HEAP_WINDOWS): #3, 2697 MB alive there ``` | | this merge, W7 | this merge, W5 | main 5eaadb54, 512 MB | main 1c8b5514, 512 MB | main 1c8b5514, 3408 MB | |---|---|---|---|---|---| | heaps "does not fit" | 0 | 0 | 3 | 3 | 0 | | draws skipped (last counter line) | 147 of 66,208 | 171 of 131,072 | 262,144 of 280,282 | 454,156 of 482,113 | 0 of 262,144 | | world entry (log s) | 76.3 | 76.3 | 80.3 | 78.3 | 76.3 | | world time | 96 s | 156 s | 216 s | 276 s | 344 s | | mean fps in the world | 0.73 | 0.45 | 0.74 | 0.86 | 0.31 | | 2 s windows with no present | 33 % | 41 % | 6 % | 4 % | 49 % | | frame time in windows with presents | 914 ms | 1314 ms | 1263 ms | 1127 ms | 1657 ms | | cs e2046474 (1x1x1), GPU time | not in the top 60 (under 1.72 ms/frame) | - | - | 89.5 ms/frame, longest 44.9 ms | not in the top 60 (under 2.45 ms/frame) | | GPU frame, first to last stamp (16 frames) | 0.66-3.93 s, median 2.05 s | - | - | 1.10-1.32 s | 4.52-5.34 s | | top program (ms/frame) | mesh two-pass ms 1f46b8c3: 570 | - | - | cs 745b25de: 365 | mesh two-pass ms 1f46b8c3: 2380 | | peak local video memory / budget | 14,221 / 15,054 MB | 14,309 / 15,025 MB | 15,313 / 15,054 MB | 15,202 / 15,048 MB | 14,110 / 15,047 MB | | peak non-local video memory | 5,568 MB | 5,594 MB | 2,769 MB | 3,104 MB | 5,779 MB | | peak process commit | 31,184 MB | 31,594 MB | 32,984 MB | 33,660 MB | 31,364 MB | | how it ended | GPU-wait watchdog at log 172.6 s, 0x80004005 | GPU-wait watchdog at log 232.2 s, 0x80004005 | RAM guard at 302 s (296 s in the log) | RAM guard at 360 s | ended by itself, 420 s | - W7's GPU times ran over log 117-149 s, early in the world. The other two GPU-time runs were measured later (from about 200 s), so the scenes differ. e2046474's exact time is not in the data, only an upper bound. It was 89.5 ms/frame in the 512 MB run without the switch. - GPU-wait watchdog: with the switch on, three runs after the RGB app was closed reached the world, and all three were stopped by it. Each logged 14 to 16 `GPU queue.Wait ... did not complete within 5000 ms` errors with four or five queues behind ("oldest unfinished for ~7.1 s"), then "a GPU queue wait exceeded its watchdog without a graph-proven cycle". The third is W4 (`XCL_GPU_TIMES=16,200`), stopped at log 199.2 s just before its measurement began. All three stopped at nearly the same fence value (0x683 to 0x68d completed). The control run on main without the switch had none in 296 s. The 3408 MB single-window run had the same watchdog once in three launches earlier today. - Driver resets: none in this merge's runs (System log checked, no nvlddmkm entries, no `STOP_ALL_RUNS`). The 3408 MB setting had one TDR in three launches earlier today. - One more launch of this merge (W6, same settings as W7) ended at log 95.4 s, before the world, with an access violation in the title's code (read at 0xffffffffffffffff). Once, not seen in the other runs. - Image (W2, an earlier run of this merge with frame dumps): the first frames in the world show a textured character and some lit geometry under a heavy grey-white haze, with a striped white ellipse over the middle. This is close to the 3408 MB run's frames and unlike the flat white or black frames of the 512 MB run without the switch. - The first world runs of this merge (W1, W2, W3, W1b) were cut short by another application's memory leak and are not used for timings or for how a run ended. A third-party RGB lighting app grew from about 0.3 GB to 6.6 GB during them, and our RAM guard stopped all four. That app was closed before W4-W7 and the control. Its working set was logged every minute and stayed at 0. **With only the 258 MB heap in a window (the recipe in the PR body)** `XCL_COHERENT_HEAP_WINDOWS=258`, recipe B otherwise unchanged (512 MB, `XCL_UMA_WINDOWS=16`), same merge 826ab485. Two single runs: W8 (`XCL_GPU_TIMES=16,110`, 420 s planned) and W9 (600 s planned). The RGB app was not running (logged every minute: 0 MB). ``` UMA: XCL_COHERENT_HEAP_WINDOWS: 1 window(s) of their own for the title's GPU heaps the coherent window has no room for: window 10 at 0x1a00000000 272 MB (272 MB in all, committed now) kernelx: a GPU heap of 1162 MB does not fit in the coherent window (64 MB used, 448 MB free): #1, 1162 MB in all kernelx: a GPU heap of 1277 MB does not fit in the coherent window (64 MB used, 448 MB free): #2, 2439 MB in all kernelx: a GPU heap of 258 MB at 0x1a00000000 in a window of its own (window 10, a driver CUSTOM write-back L0 heap; XCL_COHERENT_HEAP_WINDOWS): #1, 258 MB alive there ``` | | W8 | W9 | |---|---|---| | heaps "does not fit" / empty V# / "not in unified memory" | 2 / 1 / 5 | 2 / 1 / 5 | | draws skipped (last counter line) | 42,421 of 65,536 | 186,750 of 205,477 | | world entry (log s) | 84.3 | 80.3 | | world time | 78 s | 180 s | | mean fps in the world | 0.67 | 0.69 | | 2 s windows with no present | 15 % | 9 % | | frame time in windows with presents | 1269 ms | 1323 ms | | cs e2046474 (1x1x1), GPU time | 115.0 ms/frame, longest 57.5 ms (row 4) | - | | GPU frame, first to last stamp (16 frames, log 113-145 s) | 1.01-3.92 s, median 1.42 s | - | | top program (ms/frame) | mesh two-pass ms 1f46b8c3: 294 | - | | peak local video memory / budget | 15,017 / 14,834 MB | 14,665 / 14,868 MB | | peak non-local video memory | 3,165 MB | 3,091 MB | | peak process commit | 32,445 MB | 32,346 MB | | how it ended | RAM guard at 168 s (free RAM under 1 GB) | RAM guard at 267 s (free RAM under 1 GB) | - The two large heaps stay in plain memory as without the switch: the same "does not fit", empty V# and "not in unified memory" lines, and most draws skipped (65 % and 91 %). e2046474 is back at the top of the GPU times. - No GPU-wait watchdog and no driver reset in either run (System log checked). Both ended by our RAM guard at about 32.4 GB process commit. Free RAM at the start was 20.2 and 21.4 GB, lower than the 24 GB of W4-W7, because a chat app and a browser were open. assessment: merges, builds and passes the whole suite on current main, and the smoke run with the switch off is clean. With the switch on and 512 MB, the three heaps land in GPU-visible windows of their own and nearly all draws run (about 0.2 % skipped, against 94 % without the switch). The long 1x1x1 compute program drops out of the GPU top 60, and geometry appears in the image. The cost resembles the single 3408 MB window's: about 2.8 GB more non-local memory, longer GPU frames than the 512 MB run, and in our runs a GPU-wait watchdog stop 2 to 3 minutes into the world (three runs out of three), which the control on main did not show. No driver reset at world entry on this 16 GB card, where Prime's 8 GB card hung three times in three. With only the 258 MB heap in a window, the PR body's recipe, the runs did not hang, but the two large heaps stay outside GPU memory and the GPU work looks like the 512 MB run without the switch: most draws skipped and e2046474 at 115 ms/frame. Single runs. AI use: Claude Code (Claude Opus 5.5). ~Tiago
Edgaras0404 commented 2026-12-02 17:45:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Edgaras0404 on 2026-12-02T17:45:24Z.


test report (not a merge-check)
base: df0cfef638 (the last main before #3655; first parent of d71578f8)
head: 73a68e2e3d (tested as #3695 + #3696 cherry-picked onto df0cfef6; git diff base..tree is the stack's own diff, 799+/57-)
merge: clean (also clean on current main 5eaadb54, which builds; that base's suite is the #3694 breakage, so the functional run is on df0cfef6)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> base df0cfef6: lib aborted (exit 0x80004005) after 1,380 ok / 6 failed / 25 ignored, no test result:; failing: gpu::dxil::compact_tests::gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form, gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu, gpu::recomp::tests::gpu_f32_compares_with_nan, gpu::recomp::tests::gpu_float_compares_random, hle::d3d12x::alloc_pool::tests::a_reset_that_puts_the_allocator_aside_keeps_what_the_gpu_still_reads, hle::d3d12x::list_x::tests::a_put_off_call_whose_close_fails_is_not_submitted; integration 147 passed / 2 failed / 20 ignored (gpu_two_pass_cache_e2e 0/1 twice, lines 472 and 584); SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows. Merge: lib aborted the same way after 1,390 ok / 4 failed / 25 ignored; the 4 are the compact-form test and the three f32 tests, all on base; the base's alloc_pool and list_x failures did not recur in either merge (list_x is the known parallel flake; alloc_pool was not run alone); integration 147/2/20 with the same two-pass failure; the six new gpu::uma::own_window_tests and the three #3695 tests all pass (9 passed, 0 failed; own_window_tests are also 6/6 alone). Current main 5eaadb54: merges clean, build ok, but its suite is the #3694 breakage (lib aborted after 1,153 ok / 278 failed / 26 ignored; gpu_compute_e2e removed the device 0x887a0020) and was not used for functional evidence. rustc/cargo 1.100.1, debug.
review: 1) On AMD the feature does work, but one planned heap loses its window: with the learned sizes 2199, 1172, 596 and 563 MB and the default 4,096 MB cap, the plan made 2208, 1184 and 608 MB windows and dropped the 563 MB one; the 563 MB heap then took the 608 MB window via the made_for=false fallback (the coherent window had no room for it), so the 596 MB heap - the one the 608 MB window was made for - went to plain memory the GPU does not see. A cap large enough for all four (4,576 MB rounded; 4,608) gives both their own windows. The fallback should not let a heap whose size the cap dropped take a window made for another heap. 2) Stored coherent size vs own windows when XCL_COHERENT_MB is unset: own-window heaps return before note_coherent_heap/COHERENT_LIVE, so note_coherent_need writes only the coherent part, while get() subtracts the learned own-window total; if the coherent file is missing for the route or smaller than the own plan, the subtraction clamps the coherent window to 512 MB and keeps it there until the coherent part exceeds the own plan. This run set XCL_COHERENT_MB=512, so it did not exercise this path. 3) Plan vs slots: get() subtracts the whole plan, but for_runtime_windows_with_heaps takes only own_window_slots() entries; a plan longer than the slots would shrink the coherent window for windows never created. Four sizes fit the six slots here, so this was not exercised. 4) No HLE/integration test for the VirtualAlloc own-window path, the learned cache, the get() subtraction or the release accounting; the Uma unit tests cover layout, allocation and drop well. 5) drop_own_window's false path leaves bufs[k] = (0,0) with a nonzero window size, and set_window_views then rejects all window views; unreachable in the normal order, but the code only logs. 6) Scope: 656 changed lines in its own five commits (620+/36-), 799+/57- with #3695, over the ~400 target; one feature, could be split. README documents the switch; it says 16-window slots and omits that 8-window layouts get 4. Inherits #3695's review findings (release accounting untested, XCL_COHERENT_SHRINK undocumented, 600 s heuristic). No duplicate found: #632 (whole window in the first run), #3546 (commit planning), #3677 (watch ranges) and #3658 (no-buffer window address) are different changes; this PR is stacked on #3695.
performance: 60 s smoke on df0cfef6 with the #3544 workaround XCL_DIRECT_DXIL=1 on both trees. Default (switch unset): base 1,537 frames / 19,779 MB peak / 0 removals / 0 crashes; #3695 1,584 / 19,550 / 0 / 0 (103.1% frames, 98.8% peak, pass); with the switch unset this PR's frame time and memory are those of #3695. The switch, with XCL_COHERENT_MB=512 XCL_UMA_WINDOWS=16 XCL_HEAP_WINDOWS=1: #3695 control (16 windows, 512 MB) 972 frames / 16,522 MB, then 1,037 / 15,955, 0 removals/crashes both; #3696 first run (learns) 942 / 17,729, storing 2199, 1172, 596, 563 MB; #3696 second run (windows) 1,535 / 19,947, 0 removals / 0 crashes, three own windows (2208 + 1184 + 608 = 4,000 MB imported), with the 596 MB heap left in plain memory as described above. Frames are 148-158% of the control and peak +20.7% to +25.0% (the own windows are committed at startup, so the increase is the feature's cost); the 125% edge is from the 4,000 MB of own windows. Not tested: the default coherent-size path (XCL_COHERENT_MB unset) with the switch, where review point 2 applies; the default non-direct-DXIL path, which crashes on the base too (#3544).
verdict: test report only (not a merge-check): build and merge are clean; on df0cfef6 the stack's suite has four failures, all on the base (the base's other two did not recur), and no new one, and the nine new/changed tests pass; the switch works on AMD (three own windows, 0 removals, 0 crashes, frames up 48-58%, peak within 125%) but the 596 MB heap that had a 608 MB window made for it went to plain memory because the 563 MB heap took it after the cap dropped the 563 MB size; the stored-size and plan-slot interactions are also unguarded. Those are what I would fix before recommending the switch; the default path is unchanged and passes.
hardware / tool and model: AMD Radeon RX 6700 XT 12 GB (RDNA2), driver 32.0.21045.29003; AMD Ryzen 5 5600X; Windows 10 build 19045 / OpenCode, DeepSeek V4.1 Flash 1017

Smoke blocks (60 s, XCL_DIRECT_DXIL=1, title 1778c2d9; the default pair is in the #3695 report):

#3695 control, 16 windows and 512 MB (second run, warm):

xcl-smoke v1
commit: 1e2533ea4281c6c0b549da697b1ec5cfc16fa76a
gpu: AMD Radeon RX 6700 XT
title: 1778c2d9
seconds: 60
exit: 0x0
frames shown: 1037 (PresentX 1037)
presents per 2 s (last 3): 30 31 32
device removals: 0
crashes: 0
peak commit: 15955 MB

#3696 first run, XCL_COHERENT_HEAP_WINDOWS=1, no sizes stored yet:

xcl-smoke v1
commit: 3d40c50050d9d27a1c4e610a9a36ee18335048a5
gpu: AMD Radeon RX 6700 XT
title: 1778c2d9
seconds: 60
exit: 0x0
frames shown: 942 (PresentX 942)
presents per 2 s (last 3): 28 21 20
device removals: 0
crashes: 0
peak commit: 17729 MB

#3696 second run, three own windows:

xcl-smoke v1
commit: 3d40c50050d9d27a1c4e610a9a36ee18335048a5
gpu: AMD Radeon RX 6700 XT
title: 1778c2d9
seconds: 60
exit: 0x0
frames shown: 1535 (PresentX 1536)
presents per 2 s (last 3): 48 61 47
device removals: 0
crashes: 0
peak commit: 19947 MB
<!-- greyfinch-sync:ivall/xcl:comment:7353613464 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3696#issuecomment-7353613464). Originally posted by [Edgaras0404](https://github.com/Edgaras0404) on 2026-12-02T17:45:24Z. --- test report (not a merge-check) base: df0cfef638306f325b208e5adae18d35ab4bf4ed (the last main before #3655; first parent of d71578f8) head: 73a68e2e3dce4eb7cfcc870924c72ea78c755f42 (tested as #3695 + #3696 cherry-picked onto df0cfef6; git diff base..tree is the stack's own diff, 799+/57-) merge: clean (also clean on current main 5eaadb54, which builds; that base's suite is the #3694 breakage, so the functional run is on df0cfef6) build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> base df0cfef6: lib aborted (exit 0x80004005) after 1,380 ok / 6 failed / 25 ignored, no `test result:`; failing: `gpu::dxil::compact_tests::gpu_compact_form_with_micro_blocks_and_literal_table_runs_as_the_plain_form`, `gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu`, `gpu::recomp::tests::gpu_f32_compares_with_nan`, `gpu::recomp::tests::gpu_float_compares_random`, `hle::d3d12x::alloc_pool::tests::a_reset_that_puts_the_allocator_aside_keeps_what_the_gpu_still_reads`, `hle::d3d12x::list_x::tests::a_put_off_call_whose_close_fails_is_not_submitted`; integration 147 passed / 2 failed / 20 ignored (`gpu_two_pass_cache_e2e` 0/1 twice, lines 472 and 584); SKIPPED: `heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows`. Merge: lib aborted the same way after 1,390 ok / 4 failed / 25 ignored; the 4 are the compact-form test and the three f32 tests, all on base; the base's `alloc_pool` and `list_x` failures did not recur in either merge (`list_x` is the known parallel flake; `alloc_pool` was not run alone); integration 147/2/20 with the same two-pass failure; the six new `gpu::uma::own_window_tests` and the three #3695 tests all pass (9 passed, 0 failed; `own_window_tests` are also 6/6 alone). Current main 5eaadb54: merges clean, build ok, but its suite is the #3694 breakage (lib aborted after 1,153 ok / 278 failed / 26 ignored; `gpu_compute_e2e` removed the device 0x887a0020) and was not used for functional evidence. rustc/cargo 1.100.1, debug. review: 1) On AMD the feature does work, but one planned heap loses its window: with the learned sizes 2199, 1172, 596 and 563 MB and the default 4,096 MB cap, the plan made 2208, 1184 and 608 MB windows and dropped the 563 MB one; the 563 MB heap then took the 608 MB window via the `made_for=false` fallback (the coherent window had no room for it), so the 596 MB heap - the one the 608 MB window was made for - went to plain memory the GPU does not see. A cap large enough for all four (4,576 MB rounded; 4,608) gives both their own windows. The fallback should not let a heap whose size the cap dropped take a window made for another heap. 2) Stored coherent size vs own windows when `XCL_COHERENT_MB` is unset: own-window heaps return before `note_coherent_heap`/`COHERENT_LIVE`, so `note_coherent_need` writes only the coherent part, while `get()` subtracts the learned own-window total; if the coherent file is missing for the route or smaller than the own plan, the subtraction clamps the coherent window to 512 MB and keeps it there until the coherent part exceeds the own plan. This run set `XCL_COHERENT_MB=512`, so it did not exercise this path. 3) Plan vs slots: `get()` subtracts the whole plan, but `for_runtime_windows_with_heaps` takes only `own_window_slots()` entries; a plan longer than the slots would shrink the coherent window for windows never created. Four sizes fit the six slots here, so this was not exercised. 4) No HLE/integration test for the `VirtualAlloc` own-window path, the learned cache, the `get()` subtraction or the release accounting; the Uma unit tests cover layout, allocation and drop well. 5) `drop_own_window`'s false path leaves `bufs[k] = (0,0)` with a nonzero window size, and `set_window_views` then rejects all window views; unreachable in the normal order, but the code only logs. 6) Scope: 656 changed lines in its own five commits (620+/36-), 799+/57- with #3695, over the ~400 target; one feature, could be split. README documents the switch; it says 16-window slots and omits that 8-window layouts get 4. Inherits #3695's review findings (release accounting untested, `XCL_COHERENT_SHRINK` undocumented, 600 s heuristic). No duplicate found: #632 (whole window in the first run), #3546 (commit planning), #3677 (watch ranges) and #3658 (no-buffer window address) are different changes; this PR is stacked on #3695. performance: 60 s smoke on df0cfef6 with the #3544 workaround `XCL_DIRECT_DXIL=1` on both trees. Default (switch unset): base 1,537 frames / 19,779 MB peak / 0 removals / 0 crashes; #3695 1,584 / 19,550 / 0 / 0 (103.1% frames, 98.8% peak, pass); with the switch unset this PR's frame time and memory are those of #3695. The switch, with `XCL_COHERENT_MB=512 XCL_UMA_WINDOWS=16 XCL_HEAP_WINDOWS=1`: #3695 control (16 windows, 512 MB) 972 frames / 16,522 MB, then 1,037 / 15,955, 0 removals/crashes both; #3696 first run (learns) 942 / 17,729, storing 2199, 1172, 596, 563 MB; #3696 second run (windows) 1,535 / 19,947, 0 removals / 0 crashes, three own windows (2208 + 1184 + 608 = 4,000 MB imported), with the 596 MB heap left in plain memory as described above. Frames are 148-158% of the control and peak +20.7% to +25.0% (the own windows are committed at startup, so the increase is the feature's cost); the 125% edge is from the 4,000 MB of own windows. Not tested: the default coherent-size path (`XCL_COHERENT_MB` unset) with the switch, where review point 2 applies; the default non-direct-DXIL path, which crashes on the base too (#3544). verdict: test report only (not a merge-check): build and merge are clean; on df0cfef6 the stack's suite has four failures, all on the base (the base's other two did not recur), and no new one, and the nine new/changed tests pass; the switch works on AMD (three own windows, 0 removals, 0 crashes, frames up 48-58%, peak within 125%) but the 596 MB heap that had a 608 MB window made for it went to plain memory because the 563 MB heap took it after the cap dropped the 563 MB size; the stored-size and plan-slot interactions are also unguarded. Those are what I would fix before recommending the switch; the default path is unchanged and passes. hardware / tool and model: AMD Radeon RX 6700 XT 12 GB (RDNA2), driver 32.0.21045.29003; AMD Ryzen 5 5600X; Windows 10 build 19045 / OpenCode, DeepSeek V4.1 Flash 1017 Smoke blocks (60 s, XCL_DIRECT_DXIL=1, title 1778c2d9; the default pair is in the #3695 report): #3695 control, 16 windows and 512 MB (second run, warm): ```text xcl-smoke v1 commit: 1e2533ea4281c6c0b549da697b1ec5cfc16fa76a gpu: AMD Radeon RX 6700 XT title: 1778c2d9 seconds: 60 exit: 0x0 frames shown: 1037 (PresentX 1037) presents per 2 s (last 3): 30 31 32 device removals: 0 crashes: 0 peak commit: 15955 MB ``` #3696 first run, XCL_COHERENT_HEAP_WINDOWS=1, no sizes stored yet: ```text xcl-smoke v1 commit: 3d40c50050d9d27a1c4e610a9a36ee18335048a5 gpu: AMD Radeon RX 6700 XT title: 1778c2d9 seconds: 60 exit: 0x0 frames shown: 942 (PresentX 942) presents per 2 s (last 3): 28 21 20 device removals: 0 crashes: 0 peak commit: 17729 MB ``` #3696 second run, three own windows: ```text xcl-smoke v1 commit: 3d40c50050d9d27a1c4e610a9a36ee18335048a5 gpu: AMD Radeon RX 6700 XT title: 1778c2d9 seconds: 60 exit: 0x0 frames shown: 1535 (PresentX 1536) presents per 2 s (last 3): 48 61 47 device removals: 0 crashes: 0 peak commit: 19947 MB ```
throny commented 2026-12-02 18:51:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-12-02T18:51:18Z.


Review of the top 5 commits at 73a68e2e3 (git diff pr-3695 pr-3696; read, not run; not a merge check). With XCL_COHERENT_HEAP_WINDOWS unset, the behaviour is the same as #3695 alone. coherent_room equals size()-used(), holes_outside(..,0) equals holes, alloc_own_window returns None, and the hooks return early. With the switch on:

  1. Likely shrinking loop (gpu/uma.rs ~1617-1623 with hle/kernelx.rs ~1031-1041). At startup the coherent window is cut by the total of the own windows. Heaps placed in own windows return before ASKED / note_coherent_need, so they never count toward the stored need. Once the settle lowers the stored size to what the run put in the window, each run subtracts the own windows again, down to the 512 MB floor. I didn't check whether settled_need actually lowers it in this case.
  2. Up to 4 GB committed at startup without the free-commit check (gpu/uma.rs ~387). The windows are committed outside coherent_hint_for's free_commit() gate.
  3. Inconsistent counting (hle/kernelx.rs ~1070-1075). The "fitted by bytes" fallback has already added the heap to ASKED, note_coherent_heap and note_coherent_need before it sends it to an own window; the first path doesn't.
  4. README (~410-418): the new bullet sits inside the XCL_TEXTURE_LEVEL_PAGES item, so "Zero-filled mip uploads…" now reads as part of it.
  5. Minor: own_window_heap_bytes (hle/kernelx.rs ~1109) is never called.

AI use: Claude Code (Claude Opus 5.5) reviewed the diff; posted at throny's request.

<!-- greyfinch-sync:ivall/xcl:comment:7355254179 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3696#issuecomment-7355254179). Originally posted by [throny](https://github.com/throny) on 2026-12-02T18:51:18Z. --- Review of the top 5 commits at `73a68e2e3` (`git diff pr-3695 pr-3696`; read, not run; not a merge check). **With `XCL_COHERENT_HEAP_WINDOWS` unset, the behaviour is the same as #3695 alone.** `coherent_room` equals `size()-used()`, `holes_outside(..,0)` equals `holes`, `alloc_own_window` returns None, and the hooks return early. With the switch on: 1. **Likely shrinking loop** (`gpu/uma.rs` ~1617-1623 with `hle/kernelx.rs` ~1031-1041). At startup the coherent window is cut by the total of the own windows. Heaps placed in own windows return before `ASKED` / `note_coherent_need`, so they never count toward the stored need. Once the settle lowers the stored size to what the run put in the window, each run subtracts the own windows again, down to the 512 MB floor. I didn't check whether `settled_need` actually lowers it in this case. 2. **Up to 4 GB committed at startup without the free-commit check** (`gpu/uma.rs` ~387). The windows are committed outside `coherent_hint_for`'s `free_commit()` gate. 3. **Inconsistent counting** (`hle/kernelx.rs` ~1070-1075). The "fitted by bytes" fallback has already added the heap to `ASKED`, `note_coherent_heap` and `note_coherent_need` before it sends it to an own window; the first path doesn't. 4. **README** (~410-418): the new bullet sits inside the `XCL_TEXTURE_LEVEL_PAGES` item, so "Zero-filled mip uploads…" now reads as part of it. 5. **Minor:** `own_window_heap_bytes` (`hle/kernelx.rs` ~1109) is never called. *AI use: Claude Code (Claude Opus 5.5) reviewed the diff; posted at throny's request.*
throny commented 2026-12-02 20:37:32 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-12-02T20:37:32Z.


merge-check
base: c53e969602
head: 73a68e2e3d
merge: trial merge 338a811dd into main c53e96960: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace -- --test-threads=4 -> 3012 passed, 0 failed, 52 ignored; 25 SKIPPED; failing: none
title run: retail title, RTX 4080, 300 s in the world (run 494) with XCL_COHERENT_HEAP_WINDOWS unset, no crash, no device removal, 2.71 presents/s (the switch-on mode was not run: it hung the author's GPU)
review: the review comment above (whole diff read)
performance: switch off: same as #3695 (runs 497/498: 2.82 / 2.80 presents/s); switch on: not measured
verdict: not yet: it builds on #3695 (see there). The switch-off path is the same as #3695's, and the switch-on findings are in the review above.
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300 / Claude Code with Claude Opus 5.5 (builds, suite, world runs, review)

Smoke blocks for the description (60 s each, retail title):

main:

xcl-smoke v1
commit: c53e96960265a82477a9c98677afb0402e98d486
gpu: NVIDIA GeForce RTX 4080
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1563 (PresentX 1563)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 17578 MB

this PR's head:

xcl-smoke v1
commit: 73a68e2e3dce4eb7cfcc870924c72ea78c755f42
gpu: NVIDIA GeForce RTX 4080
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1557 (PresentX 1557)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16549 MB
<!-- greyfinch-sync:ivall/xcl:comment:7358044667 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3696#issuecomment-7358044667). Originally posted by [throny](https://github.com/throny) on 2026-12-02T20:37:32Z. --- merge-check base: c53e96960265a82477a9c98677afb0402e98d486 head: 73a68e2e3dce4eb7cfcc870924c72ea78c755f42 merge: trial merge `338a811dd` into main `c53e96960`: clean build: cargo build --workspace -> ok tests: cargo test --workspace -- --test-threads=4 -> 3012 passed, 0 failed, 52 ignored; 25 SKIPPED; failing: none title run: retail title, RTX 4080, 300 s in the world (run 494) with `XCL_COHERENT_HEAP_WINDOWS` unset, no crash, no device removal, 2.71 presents/s (the switch-on mode was not run: it hung the author's GPU) review: the review comment above (whole diff read) performance: switch off: same as #3695 (runs 497/498: 2.82 / 2.80 presents/s); switch on: not measured verdict: not yet: it builds on #3695 (see there). The switch-off path is the same as #3695's, and the switch-on findings are in the review above. hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300 / Claude Code with Claude Opus 5.5 (builds, suite, world runs, review) Smoke blocks for the description (60 s each, retail title): main: ``` xcl-smoke v1 commit: c53e96960265a82477a9c98677afb0402e98d486 gpu: NVIDIA GeForce RTX 4080 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1563 (PresentX 1563) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 17578 MB ``` this PR's head: ``` xcl-smoke v1 commit: 73a68e2e3dce4eb7cfcc870924c72ea78c755f42 gpu: NVIDIA GeForce RTX 4080 title: 21222967 seconds: 60 exit: 0x0 frames shown: 1557 (PresentX 1557) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16549 MB ```
KDenKC commented 2026-12-02 23:49:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by KDenKC on 2026-12-02T23:49:13Z.


A title crash with XCL_COHERENT_HEAP_WINDOWS=1: 4 bytes of a CPU pointer inside a heap's own window were overwritten

Run: a composite build on #3656's e1c7be06 with this PR at 73a68e2e (plus #3517, #3089, #3282, #3094; submit batching off),
the retail title, RTX 5090. Three own windows were made: window 11 at 0x1b00000000 (608 MB, a 596 MB heap),
window 12 at 0x1c00000000 (32 MB, 19 MB), window 13 at 0x1d00000000 (48 MB, 33 MB), each "a driver CUSTOM
write-back L0 heap mapped at its address, write-watched".

At 246.5 s (early in the world) the title crashed in its own code: access violation reading 0x600008ddd
(rcx = 0x600008dc5, read at +0x18). The rerun of the same build without XCL_COHERENT_HEAP_WINDOWS did not
crash there (it hit an unrelated GPU fault later).

What the title's crash dump shows (read from the dump's memory, no debugger):

  • The object the title was walking is at 0x1b00997df0, inside window 11 (9.6 MB into the 596 MB heap):
    a C++ object with a vtable in the title's image, floats, and pointers back into the same heap. The title keeps
    CPU objects in this GPU heap.
  • At 0x1b00997ec8 it holds an array of pointers with a fixed stride of 0x130:
    [0] 0x0000000600008dc5, [1] 0x00000006f2d05d30, [2] 0x00000006f2d05e60, [3] 0x00000006f2d05f90, …
    so element 0 should be 0x00000006f2d05c00. Its high dword is right, the low dword is 0x00008dc5: a 4-byte
    write landed on the low half of a CPU pointer. The title loaded it and faulted.

So something wrote a 32-bit value into CPU-object memory of a heap living in its own window. Not proven which
path; the candidates we see:

  1. A GPU 32-bit write (a title or XCL Write32 / write-immediate / UAV store) to an address the title meant
    for something else, which the own window now aliases differently than the coherent window did.
  2. An XCL copy-back or refresh over that range (write-watch refresh, sparse read-back, a texture or buffer
    copy-back) treating part of the own window as GPU-written memory and copying 4 stale bytes over the title's
    newer CPU write.
  3. A CPU write that went to a different mapping of the same pages (an L0 heap mapped twice, one view
    write-back and one not) and was lost or reordered.

Could you check whether any path that knows the coherent window by its address range (write-watch, copy-back,
the GPU-written page lists) also covers the own windows the same way, and whether a write-watched L0 heap can
be refreshed from the GPU side while the title is writing it?

Dump, log and the rerun are kept locally; we can read more of the dump on request (e.g. the bytes around other
pointers in window 11).

AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen (from a real run and the title's own crash dump).

<!-- greyfinch-sync:ivall/xcl:comment:7362464392 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3696#issuecomment-7362464392). Originally posted by [KDenKC](https://github.com/KDenKC) on 2026-12-02T23:49:13Z. --- **A title crash with `XCL_COHERENT_HEAP_WINDOWS=1`: 4 bytes of a CPU pointer inside a heap's own window were overwritten** Run: a composite build on #3656's e1c7be06 with this PR at 73a68e2e (plus #3517, #3089, #3282, #3094; submit batching off), the retail title, RTX 5090. Three own windows were made: window 11 at 0x1b00000000 (608 MB, a 596 MB heap), window 12 at 0x1c00000000 (32 MB, 19 MB), window 13 at 0x1d00000000 (48 MB, 33 MB), each "a driver CUSTOM write-back L0 heap mapped at its address, write-watched". At 246.5 s (early in the world) the title crashed in its own code: access violation reading 0x600008ddd (rcx = 0x600008dc5, read at +0x18). The rerun of the same build **without** `XCL_COHERENT_HEAP_WINDOWS` did not crash there (it hit an unrelated GPU fault later). What the title's crash dump shows (read from the dump's memory, no debugger): - The object the title was walking is at 0x1b00997df0, **inside window 11** (9.6 MB into the 596 MB heap): a C++ object with a vtable in the title's image, floats, and pointers back into the same heap. The title keeps CPU objects in this GPU heap. - At 0x1b00997ec8 it holds an array of pointers with a fixed stride of 0x130: `[0] 0x0000000600008dc5, [1] 0x00000006f2d05d30, [2] 0x00000006f2d05e60, [3] 0x00000006f2d05f90, …` so element 0 should be 0x00000006f2d05c00. Its **high dword is right, the low dword is 0x00008dc5**: a 4-byte write landed on the low half of a CPU pointer. The title loaded it and faulted. So something wrote a 32-bit value into CPU-object memory of a heap living in its own window. Not proven which path; the candidates we see: 1. A GPU 32-bit write (a title or XCL `Write32` / write-immediate / UAV store) to an address the title meant for something else, which the own window now aliases differently than the coherent window did. 2. An XCL copy-back or refresh over that range (write-watch refresh, sparse read-back, a texture or buffer copy-back) treating part of the own window as GPU-written memory and copying 4 stale bytes over the title's newer CPU write. 3. A CPU write that went to a different mapping of the same pages (an L0 heap mapped twice, one view write-back and one not) and was lost or reordered. Could you check whether any path that knows the coherent window by its address range (write-watch, copy-back, the GPU-written page lists) also covers the own windows the same way, and whether a write-watched L0 heap can be refreshed from the GPU side while the title is writing it? Dump, log and the rerun are kept locally; we can read more of the dump on request (e.g. the bytes around other pointers in window 11). AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen (from a real run and the title's own crash dump).
throny commented 2026-12-03 06:54:15 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-12-03T06:54:15Z.


Merge check: safe (head 73a68e2e3, merged onto main 16c2fd082)

  • RTX 4080 (driver 621.40), i9-12900K, Windows 11 26300, release build
  • cargo test --workspace -- --test-threads=4: 3020 passed, 0 failed, 56 ignored; 25 SKIPPED lines, no test binary ended abnormally
  • retail title, 300 s world run with default settings (+ XCL_RESIDENCY_PRIORITY=1): reached the world, no device removal, no crash, first frame 7.55 s, 2.86 presents/s (main 2.88 on the same setup today), 0 Aftermath dumps
  • diff scanned, nothing of concern

Not tested: AMD/Intel cards; the opt-in XCL_COHERENT_HEAP_WINDOWS=1 path (stored heap windows on the next start) was not switched on.

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

<!-- greyfinch-sync:ivall/xcl:comment:7370366419 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3696#issuecomment-7370366419). Originally posted by [throny](https://github.com/throny) on 2026-12-03T06:54:15Z. --- **Merge check: safe** (head 73a68e2e3, merged onto main 16c2fd082) - RTX 4080 (driver 621.40), i9-12900K, Windows 11 26300, release build - `cargo test --workspace -- --test-threads=4`: 3020 passed, 0 failed, 56 ignored; 25 SKIPPED lines, no test binary ended abnormally - retail title, 300 s world run with default settings (+ `XCL_RESIDENCY_PRIORITY=1`): reached the world, no device removal, no crash, first frame 7.55 s, 2.86 presents/s (main 2.88 on the same setup today), 0 Aftermath dumps - diff scanned, nothing of concern Not tested: AMD/Intel cards; the opt-in `XCL_COHERENT_HEAP_WINDOWS=1` path (stored heap windows on the next start) was not switched on. AI use: Claude Code (Claude Opus 5.5) ran the checks and wrote this comment.
Foniass commented 2026-12-03 10:35:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-03T10:35:43Z.


merge-check
base: 16c2fd082a
head: 73a68e2e3d
merge: clean
build: ok
tests: 3020 passed, 0 failed, 56 ignored; 28 skipped, the same as on main
review: 1 high, 7 medium, 3 nits (below)
performance: 60 s smoke run: 1683 → 1672 frames (99 % of main), peak commit 18505 → 17561 MB, no device removal, no crash
title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 232 s there, 0 device removals, 0 crashes, 2.6 presents/s; run with XCL_SKIP_CS=95cc13288a27a96e (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590)
verdict: not yet: 1 blocking finding (critical or high, below); also PR description is red
hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5


In short: Stacked on #3695. The top five commits add XCL_COHERENT_HEAP_WINDOWS (off by default): GPU heaps the coherent window has no room for get committed windows of their own in the free slots of the 16-window aperture. With the switch unset, the behaviour is the same as #3695 alone. With it on there are sizing, commit and stability problems, and an unexplained title crash was reported. It cannot land before #3695, whose open findings apply here too.

High

  1. Carries #3695 and its open high findings. The first two commits are #3695's, including the default-on lowering and the untested kernelx bookkeeping (see the #3695 merge-check). This PR has to wait for #3695 to be fixed and merged, then rebase.

Medium

  1. The coherent window can shrink run after run with the switch on. When XCL_COHERENT_MB is unset, get() takes the own windows' total off the stored coherent size (uma.rs ~1622). Heaps placed in own windows return before ASKED/note_coherent_need (kernelx.rs ~1037), so they never count in the stored size. Once the 600 s settle lowers the stored size to what this run put in the coherent window, the next run subtracts the own windows again, down to the 512 MB floor. Don't subtract, or keep the own-window heaps in the stored count.
  2. Up to 4 GB committed at startup without the free-commit check. The own windows are committed with MEM_COMMIT in reserve_runtime (uma.rs ~392), outside coherent_hint_for's free_commit() check that keeps the coherent window from taking the system's commit. The cap limits the size but not the commit check.
  3. A title crash with the switch on is unanswered. A tester reported a 4-byte overwrite of a CPU pointer inside a heap's own window (title crash at 246 s; no crash in the rerun without the switch). Nothing in the PR or its replies says whether write-watch refresh, copy-back or the driver L0 mapping can write into an own window the way it does into the coherent window.
  4. README's example sizes are the configuration that hung the GPU. README (~410-418) gives 1277,1162,258 as the example, and the description reports that these three windows hung the GPU at world entry in 3 runs of 3. Use another example, or say in README that windows past the GPU's budget can hang it.
  5. Routing and file bookkeeping untested. own_windows_hold_only_the_heaps covers the Uma side well. Nothing tests kernelx's routing (window made for the heap first, the fitted-by-bytes fallback ~1070), the release of an own-window heap from OWN_WINDOW_HEAPS, or note_heap_outside/heap_outside_released writing uma_heap_windows.txt.
  6. Conflicts with open #3653 on the aperture's tail. A test merge with #3653 conflicts in gpu/uma.rs. Both use the slots after the view windows: #3653 for overflow views, this PR for the heaps' own windows. own_window_slots assumes at most three sparse windows. The layout of the tail has to be agreed before both can land.
  7. Size and description. About 620 changed lines in the top five commits, over the ~400 target, with no reason given; the switch-off-neutral parts could have gone first. AI use says "Claude Code" without the exact model, and there is no issue link.

Nit

  1. Inconsistent counting in the fitted-by-bytes fallback. By the time a heap reaches the fallback that sends it to an own window (kernelx.rs ~1070), it has already been added to ASKED, HEAPS_ASKED and the noted need; only COHERENT_LIVE is taken back. The first own-window path counts none of these.
  2. README bullet breaks the item above it. The new XCL_COHERENT_HEAP_WINDOWS bullet is inserted before the indented "Zero-filled mip uploads..." line, which belongs to the XCL_TEXTURE_LEVEL_PAGES item, so that line now reads as part of the new bullet.
  3. own_window_heap_bytes is never called. kernelx.rs ~1109.
Checked and fine
  • Switch unset: own_windows is 0, alloc_own_window returns None, coherent_room equals size minus used, holes_outside(..,0) equals holes, and the release hooks return early
  • alloc with no window named never takes an own window, and a heap's own window that the GPU cannot open is dropped alone (decommitted, slot kept reserved, left out of the watch regions and views), refused while a block is held there
  • coherent_size/coherent_room replace size()/used() in the headroom checks and logs, so the own windows don't count as coherent room
How this was tested
  • Merged onto main 16c2fd08, then cargo build --workspace and cargo test --workspace --no-fail-fast -- --test-threads=4.
  • The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar).
  • scripts/smoke.ps1: 60 s of a retail title on main 16c2fd08 and on this merge; presents per 2 s at the end: 60 60 60.
  • Title run: the release build of this merge launched the retail title with XCL_RUN_SECONDS=300 and scripted A presses counted from the first frame (XCL_PRESS_BASE=frame, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run.

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

<!-- greyfinch-sync:ivall/xcl:comment:7375466623 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/3696#issuecomment-7375466623). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-03T10:35:43Z. --- merge-check base: 16c2fd082ae2e96967a2ab553bc2e1032e491f70 head: 73a68e2e3dce4eb7cfcc870924c72ea78c755f42 merge: clean build: ok tests: 3020 passed, 0 failed, 56 ignored; 28 skipped, the same as on main review: 1 high, 7 medium, 3 nits (below) performance: 60 s smoke run: 1683 → 1672 frames (99 % of main), peak commit 18505 → 17561 MB, no device removal, no crash title run: retail title on the RTX 5070 Ti (driver 621.14), into the world by scripted presses: 232 s there, 0 device removals, 0 crashes, 2.6 presents/s; run with `XCL_SKIP_CS=95cc13288a27a96e` (the NVIDIA hang at the end of loading, #3541) and NVIDIA's 2048 MB shader heap (#2590) verdict: not yet: 1 blocking finding (critical or high, below); also `PR description` is red hardware / tool and model: RTX 5070 Ti (driver 621.14), Ryzen 7 7800X3D, Windows 11 26300 / Claude Code with Claude Opus 5.5 --- **In short:** Stacked on #3695. The top five commits add XCL_COHERENT_HEAP_WINDOWS (off by default): GPU heaps the coherent window has no room for get committed windows of their own in the free slots of the 16-window aperture. With the switch unset, the behaviour is the same as #3695 alone. With it on there are sizing, commit and stability problems, and an unexplained title crash was reported. It cannot land before #3695, whose open findings apply here too. #### High 1. **Carries #3695 and its open high findings.** The first two commits are #3695's, including the default-on lowering and the untested kernelx bookkeeping (see the #3695 merge-check). This PR has to wait for #3695 to be fixed and merged, then rebase. #### Medium 2. **The coherent window can shrink run after run with the switch on.** When XCL_COHERENT_MB is unset, get() takes the own windows' total off the stored coherent size (uma.rs ~1622). Heaps placed in own windows return before ASKED/note_coherent_need (kernelx.rs ~1037), so they never count in the stored size. Once the 600 s settle lowers the stored size to what this run put in the coherent window, the next run subtracts the own windows again, down to the 512 MB floor. Don't subtract, or keep the own-window heaps in the stored count. 3. **Up to 4 GB committed at startup without the free-commit check.** The own windows are committed with MEM_COMMIT in reserve_runtime (uma.rs ~392), outside coherent_hint_for's free_commit() check that keeps the coherent window from taking the system's commit. The cap limits the size but not the commit check. 4. **A title crash with the switch on is unanswered.** A tester reported a 4-byte overwrite of a CPU pointer inside a heap's own window (title crash at 246 s; no crash in the rerun without the switch). Nothing in the PR or its replies says whether write-watch refresh, copy-back or the driver L0 mapping can write into an own window the way it does into the coherent window. 5. **README's example sizes are the configuration that hung the GPU.** README (~410-418) gives `1277,1162,258` as the example, and the description reports that these three windows hung the GPU at world entry in 3 runs of 3. Use another example, or say in README that windows past the GPU's budget can hang it. 6. **Routing and file bookkeeping untested.** own_windows_hold_only_the_heaps covers the Uma side well. Nothing tests kernelx's routing (window made for the heap first, the fitted-by-bytes fallback ~1070), the release of an own-window heap from OWN_WINDOW_HEAPS, or note_heap_outside/heap_outside_released writing uma_heap_windows.txt. 7. **Conflicts with open #3653 on the aperture's tail.** A test merge with #3653 conflicts in gpu/uma.rs. Both use the slots after the view windows: #3653 for overflow views, this PR for the heaps' own windows. own_window_slots assumes at most three sparse windows. The layout of the tail has to be agreed before both can land. 8. **Size and description.** About 620 changed lines in the top five commits, over the ~400 target, with no reason given; the switch-off-neutral parts could have gone first. AI use says "Claude Code" without the exact model, and there is no issue link. #### Nit 9. **Inconsistent counting in the fitted-by-bytes fallback.** By the time a heap reaches the fallback that sends it to an own window (kernelx.rs ~1070), it has already been added to ASKED, HEAPS_ASKED and the noted need; only COHERENT_LIVE is taken back. The first own-window path counts none of these. 10. **README bullet breaks the item above it.** The new XCL_COHERENT_HEAP_WINDOWS bullet is inserted before the indented "Zero-filled mip uploads..." line, which belongs to the XCL_TEXTURE_LEVEL_PAGES item, so that line now reads as part of the new bullet. 11. **own_window_heap_bytes is never called.** kernelx.rs ~1109. <details><summary>Checked and fine</summary> - Switch unset: own_windows is 0, alloc_own_window returns None, coherent_room equals size minus used, holes_outside(..,0) equals holes, and the release hooks return early - alloc with no window named never takes an own window, and a heap's own window that the GPU cannot open is dropped alone (decommitted, slot kept reserved, left out of the watch regions and views), refused while a block is held there - coherent_size/coherent_room replace size()/used() in the headroom checks and logs, so the own windows don't count as coherent room </details> <details><summary>How this was tested</summary> - Merged onto main `16c2fd08`, then `cargo build --workspace` and `cargo test --workspace --no-fail-fast -- --test-threads=4`. - The skipped GPU tests are those this card can't run (no wave64 on NVIDIA, no D3D12 debug layer, and similar). - `scripts/smoke.ps1`: 60 s of a retail title on main `16c2fd08` and on this merge; presents per 2 s at the end: 60 60 60. - Title run: the release build of this merge launched the retail title with `XCL_RUN_SECONDS=300` and scripted A presses counted from the first frame (`XCL_PRESS_BASE=frame`, #3712) into the world from an existing save; time in the world is counted from the first in-world draw call to the end of the run. </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/3696:upstream-pr/3696'
git switch 'upstream-pr/3696'

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/3696'
git switch 'upstream-pr/3696'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3696'
git switch 'upstream-pr/3696'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3696'
git switch 'main'
git merge --squash 'upstream-pr/3696'
git switch 'main'
git merge --ff-only 'upstream-pr/3696'
git switch 'main'
git merge 'upstream-pr/3696'
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!3696
No description provided.