D3D12.X: a memory line by owner, against DXGI's budget #2697

Open
github-bot wants to merge 1 commit from github-bot/gh-2697 into main AGit
Owner

@⁠joeypercia on GitHub · 2026-11-26 06:48 UTC · original
joeypercia:d3d12x-memory-accounting → main · +280 −0 · 6 files · 1 commits · open

A memory line by owner under XCL_ACTIVITY. It shows the process's commit and DXGI's local and non-local usage, each against its budget, split into XCL's parts, with what XCL doesn't count as its own part. Without the budget and that remainder, nothing in #2688 can be judged. Part of #2688 (workstream 1, part 1 of the plan there).

The existing memory: line stays as it is: scripts/smoke.ps1 and the integration branches' tools read it. The new line is additive, so it merges into nvidia-dev with only the two neighbouring lines to keep side by side.

From the newer retail title on an RTX 4070 Ti 12 GB (nvidia-dev c044dc6d with the first revision of this commit, before the review changes below), 4 s before the device was removed:

[  132.562][36860][INFO ] memory by owner (MB): commit 32218 (UMA window 4095, sparse CPU copy 2145, other 25977); video memory 11491 of a 10530 budget (target pages 5684, target pools free 75, arenas 401, sparse tiles 2145, sparse pools free 30, sparse pools retired 0, committed textures 414, other 2740); non-local 4997 of a 15162 budget (other 4997)

The run's last 12 s show what the line is for. Video memory went past the DXGI budget at 126 s, and the budget itself had fallen from 11,226 MB to about 10,000 MB at 100 s. Of the 2.0 GB added between 124 s and 137 s, 1.7 GB is "other": the title's own resources, pipelines and the driver, none of which XCL counts yet. Target pages and sparse tiles grew by 0.4 GB. The device was removed at 137 s (DRED: a fault at VA 0x0, as in #2403). The full series will be on #2688.

What is in it (one commit)

  • crates/xcl/src/hle/d3d12x/memory_report.rs (new): snapshot() and Snapshot::line(), and its own DXGI query, which reads Budget too (real::video_memory stays as it is). The parts, by where they sit:
    • commit:
      • the UMA coherent window;
      • the CPU copy of mapped sparse tiles (a title page in a sparse window is committed on the CPU as well as mapped to a tile).
    • video memory:
      • target pages, and the free part of their pools;
      • arenas;
      • mapped sparse tiles, and free sparse pools;
      • retired sparse pools;
      • title textures that are committed resources of their own.
    • non-local: nothing XCL counts yet, so only "other".
  • crates/xcl/src/hle/d3d12x/sparse.rs:
    • retired_bytes: the pool heaps given back but not released yet. They weren't counted anywhere before.
    • committed_bytes: the title's committed pages in the windows, i.e. the pages of the mapped tiles that aren't holes. That's the "sparse CPU copy" part. A tile the title decommitted whole counts 0 even while its pool tile is parked (luckyteagirl's review). The existing test a_tile_decommitted_and_committed_again_keeps_its_video_memory checks both.
  • The UMA coherent window is also a part of the segment where DXGI counts it: non-local on a card, local on an integrated GPU with no non-local budget. On an RX 7800 XT (oni-swr) it was 512 of 529 MB of non-local; on the RTX 4070 Ti, 4,095 of 4,140 MB.
  • A commit that reads 0, as PrivateUsage does under Wine (pr1sm-dev), shows as "commit unknown", with no "other" for it. #1097 and #2362 read the commit there in different ways, and process_commit can call whichever lands.
    The device test accepts that case: with no commit, the line must say "commit unknown" (luckyteagirl's review).
  • The D3D12 heaps' charge to the commit is a commit part of its own, D3D12 heaps: DXGI's local plus non-local usage, less the coherent window D3D12 imported. Windows charges D3D12 heaps to the process's commit as well. A 1 GiB heap added about 1,026 MB of commit on the RTX 4070 Ti and on the RDNA2 iGPU, for a default heap and for an upload heap alike (zohaiblazuli's finding, #2688). So commit's "other" is now only CPU memory.
  • Only the bytes D3D12 imported (real::uma_imported_bytes, from UMA_HEAPS, published on success) count as the window's part in DXGI's rows and are taken off the heaps' charge. A failed import leaves the window CPU memory only (luckyteagirl's review). The unit test covers that case.
  • crates/xcl/src/hle/d3d12x/title_textures.rs: committed_bytes, how many title textures are committed resources of their own (not on vram::Pages tiles), and their console size.
  • crates/xcl/src/host.rs: the line, every 2 s with XCL_ACTIVITY, after the memory line.
  • Tests:
    • the_rest_is_the_total_less_the_parts: the rest is each total less its parts, a negative rest stays negative, a missing DXGI answer shows as "unknown", and the exact line.
    • a_snapshot_on_the_device_has_its_budget_and_owners: on the adapter, a local budget above 0, the commit, and every owner. On the RDNA2 iGPU DXGI reports a non-local budget of 0 (one memory segment), which the test allows.

Tested

  • NVIDIA GeForce RTX 4070 Ti (driver 621.40), and the AMD Radeon iGPU of a Ryzen 7 7800X3D (RDNA2) with XCL_ADAPTER=Radeon. Windows 11 Pro 26200, Rust 1.100.0 MSVC, DXC 1.8.2502.11. Debug builds for the tests, release for the runs.
  • cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4 on 50cfb321:
    • RTX 4070 Ti: 1437 passed, 0 failed, 47 ignored.
    • RDNA2: 1436 passed, 1 failed, 47 ignored. The failure is gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, which fails the same way on main on this iGPU (#2115).
    • Both new tests ran on both adapters (... ok), not skipped.
  • scripts/smoke.ps1 still finds the commit: its regex (memory: (\d+) MB committed) doesn't match the new line, which starts with "memory by owner".

Regression run

RTX 4070 Ti (driver 621.40), release builds, 60 s each, scripts/smoke.ps1 -Game <folder> -Title retail-title on the newer retail title, with the same settings. Both ran with the NVIDIA shader-heap profile (#2590, 1 GiB) installed on this machine since 2026-11-25. main b49be183 (this PR's base) and this PR's head (no uncommitted changes):

main:

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 4070 Ti
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1426 (PresentX 1426)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17542 MB

PR:

xcl-smoke v1
commit: 50cfb321be8277482566d31f7a29f97c3f2ef4e7
gpu: NVIDIA GeForce RTX 4070 Ti
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1580 (PresentX 1581)
presents per 2 s (last 3): 60 59 45
device removals: 0
crashes: 0
peak commit: 17460 MB

Not tested

  • A run that stays in the world on a 12 GB card: the one above ends at 137 s. The next run, with the 1 GiB shader heap, is on nvidia-dev af2cecc4.
  • Owners not counted yet, all in "other":
    • the swap chain;
    • list copy scratch and fill-pattern buffers;
    • the descriptor heaps;
    • the shader and pipeline blob caches (CPU);
    • upload staging (main's Uploader; the integration branches replaced it);
    • two-pass mesh buffers (integration branches only).
      These are next, in this order, as small follow-ups, along with the end-of-run table in report.json (part 2).
  • Committed title textures are counted at their console size. The PC resource can take somewhat more.
  • The sparse CPU copy is counted as the mapped tiles. A tile's pages that the title left uncommitted (holes) are counted too.
  • Per-device split: one device, as real::device_raw.

AI use

  • Claude Code with Claude Opus 5.5 wrote the code, the tests and this description, and ran the tests and the runs on the hardware above.
**@⁠joeypercia** on GitHub · 2026-11-26 06:48 UTC · [original](https://github.com/xcl-dev/xcl/pull/2697) `joeypercia:d3d12x-memory-accounting` → `main` · +280 −0 · 6 files · 1 commits · open A memory line by owner under `XCL_ACTIVITY`. It shows the process's commit and DXGI's local and non-local usage, each against its budget, split into XCL's parts, with what XCL doesn't count as its own part. Without the budget and that remainder, nothing in #2688 can be judged. Part of #2688 (workstream 1, part 1 of the plan there). The existing `memory:` line stays as it is: `scripts/smoke.ps1` and the integration branches' tools read it. The new line is additive, so it merges into `nvidia-dev` with only the two neighbouring lines to keep side by side. From the newer retail title on an RTX 4070 Ti 12 GB (`nvidia-dev` `c044dc6d` with the first revision of this commit, before the review changes below), 4 s before the device was removed: ``` [ 132.562][36860][INFO ] memory by owner (MB): commit 32218 (UMA window 4095, sparse CPU copy 2145, other 25977); video memory 11491 of a 10530 budget (target pages 5684, target pools free 75, arenas 401, sparse tiles 2145, sparse pools free 30, sparse pools retired 0, committed textures 414, other 2740); non-local 4997 of a 15162 budget (other 4997) ``` The run's last 12 s show what the line is for. Video memory went past the DXGI budget at 126 s, and the budget itself had fallen from 11,226 MB to about 10,000 MB at 100 s. Of the 2.0 GB added between 124 s and 137 s, 1.7 GB is "other": the title's own resources, pipelines and the driver, none of which XCL counts yet. Target pages and sparse tiles grew by 0.4 GB. The device was removed at 137 s (DRED: a fault at VA 0x0, as in #2403). The full series will be on #2688. **What is in it** (one commit) - `crates/xcl/src/hle/d3d12x/memory_report.rs` (new): `snapshot()` and `Snapshot::line()`, and its own DXGI query, which reads `Budget` too (`real::video_memory` stays as it is). The parts, by where they sit: - **commit:** - the UMA coherent window; - the CPU copy of mapped sparse tiles (a title page in a sparse window is committed on the CPU as well as mapped to a tile). - **video memory:** - target pages, and the free part of their pools; - arenas; - mapped sparse tiles, and free sparse pools; - retired sparse pools; - title textures that are committed resources of their own. - **non-local:** nothing XCL counts yet, so only "other". - `crates/xcl/src/hle/d3d12x/sparse.rs`: - `retired_bytes`: the pool heaps given back but not released yet. They weren't counted anywhere before. - `committed_bytes`: the title's committed pages in the windows, i.e. the pages of the mapped tiles that aren't holes. That's the "sparse CPU copy" part. A tile the title decommitted whole counts 0 even while its pool tile is parked (luckyteagirl's review). The existing test `a_tile_decommitted_and_committed_again_keeps_its_video_memory` checks both. - The UMA coherent window is also a part of the segment where DXGI counts it: non-local on a card, local on an integrated GPU with no non-local budget. On an RX 7800 XT (oni-swr) it was 512 of 529 MB of non-local; on the RTX 4070 Ti, 4,095 of 4,140 MB. - A commit that reads 0, as `PrivateUsage` does under Wine (pr1sm-dev), shows as "commit unknown", with no "other" for it. #1097 and #2362 read the commit there in different ways, and `process_commit` can call whichever lands. The device test accepts that case: with no commit, the line must say "commit unknown" (luckyteagirl's review). - **The D3D12 heaps' charge to the commit** is a commit part of its own, `D3D12 heaps`: DXGI's local plus non-local usage, less the coherent window D3D12 imported. Windows charges D3D12 heaps to the process's commit as well. A 1 GiB heap added about 1,026 MB of commit on the RTX 4070 Ti and on the RDNA2 iGPU, for a default heap and for an upload heap alike (zohaiblazuli's finding, #2688). So commit's "other" is now only CPU memory. - **Only the bytes D3D12 imported** (`real::uma_imported_bytes`, from `UMA_HEAPS`, published on success) count as the window's part in DXGI's rows and are taken off the heaps' charge. A failed import leaves the window CPU memory only (luckyteagirl's review). The unit test covers that case. - `crates/xcl/src/hle/d3d12x/title_textures.rs`: `committed_bytes`, how many title textures are committed resources of their own (not on `vram::Pages` tiles), and their console size. - `crates/xcl/src/host.rs`: the line, every 2 s with `XCL_ACTIVITY`, after the memory line. - Tests: - `the_rest_is_the_total_less_the_parts`: the rest is each total less its parts, a negative rest stays negative, a missing DXGI answer shows as "unknown", and the exact line. - `a_snapshot_on_the_device_has_its_budget_and_owners`: on the adapter, a local budget above 0, the commit, and every owner. On the RDNA2 iGPU DXGI reports a non-local budget of 0 (one memory segment), which the test allows. **Tested** - NVIDIA GeForce RTX 4070 Ti (driver 621.40), and the AMD Radeon iGPU of a Ryzen 7 7800X3D (RDNA2) with `XCL_ADAPTER=Radeon`. Windows 11 Pro 26200, Rust 1.100.0 MSVC, DXC 1.8.2502.11. Debug builds for the tests, release for the runs. - `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4` on `50cfb321`: - RTX 4070 Ti: **1437 passed, 0 failed, 47 ignored**. - RDNA2: **1436 passed, 1 failed, 47 ignored**. The failure is `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`, which fails the same way on `main` on this iGPU (#2115). - Both new tests ran on both adapters (`... ok`), not skipped. - `scripts/smoke.ps1` still finds the commit: its regex (`memory: (\d+) MB committed`) doesn't match the new line, which starts with "memory by owner". **Regression run** RTX 4070 Ti (driver 621.40), release builds, 60 s each, `scripts/smoke.ps1 -Game <folder> -Title retail-title` on the newer retail title, with the same settings. Both ran with the NVIDIA shader-heap profile (#2590, 1 GiB) installed on this machine since 2026-11-25. `main` `b49be183` (this PR's base) and this PR's head (no uncommitted changes): main: ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 4070 Ti title: retail-title seconds: 60 exit: 0x0 frames shown: 1426 (PresentX 1426) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 17542 MB ``` PR: ``` xcl-smoke v1 commit: 50cfb321be8277482566d31f7a29f97c3f2ef4e7 gpu: NVIDIA GeForce RTX 4070 Ti title: retail-title seconds: 60 exit: 0x0 frames shown: 1580 (PresentX 1581) presents per 2 s (last 3): 60 59 45 device removals: 0 crashes: 0 peak commit: 17460 MB ``` **Not tested** - A run that stays in the world on a 12 GB card: the one above ends at 137 s. The next run, with the 1 GiB shader heap, is on `nvidia-dev` `af2cecc4`. - Owners not counted yet, all in "other": - the swap chain; - list copy scratch and fill-pattern buffers; - the descriptor heaps; - the shader and pipeline blob caches (CPU); - upload staging (`main`'s `Uploader`; the integration branches replaced it); - two-pass mesh buffers (integration branches only). These are next, in this order, as small follow-ups, along with the end-of-run table in `report.json` (part 2). - Committed title textures are counted at their console size. The PC resource can take somewhat more. - The sparse CPU copy is counted as the mapped tiles. A tile's pages that the title left uncommitted (holes) are counted too. - Per-device split: one device, as `real::device_raw`. **AI use** - Claude Code with Claude Opus 5.5 wrote the code, the tests and this description, and ran the tests and the runs on the hardware above.
What the video memory in use is made of could not be told from the
XCL_ACTIVITY memory line: it gives no budget, and three of XCL's owners
(#2688, workstream 1).

memory_report::snapshot() takes the process's commit, and DXGI's local
and non-local usage with their budgets, and XCL's parts of each:
- commit: the UMA coherent window, and the CPU copy of mapped sparse
  tiles (a title page in a sparse window is committed on the CPU too);
- video memory: target pages and the free part of their pools, arenas,
  mapped sparse tiles, free sparse pools, retired sparse pools (counted
  now: sparse::retired_bytes), and title textures that are committed
  resources of their own (title_textures::committed_bytes, console size).
What each total holds besides them is its own part, "other".

XCL_ACTIVITY logs it as a line of its own after the memory line, which
stays as it was (scripts/smoke.ps1 and the integration branches' tools
read it).

Part of #2688.

Assisted-by: Claude Code (Claude Opus 5.5)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:52:50 +00:00
Author
Owner

@⁠oni-swr on GitHub · 2026-11-26 07:08 UTC · original

Test report for #2697 at 451c72455ca1d5d23f40de8ac6c12b24ef93eacb (parent b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7; the head is one commit on that parent). Measurements only. This is not a source review.

Machine: AMD Radeon RX 7800 XT (driver 32.0.31035.1003), Windows 11 Pro 26200, rustc 1.100.0, debug build, --locked, -j 4. Synthetic inputs and native DXGI only: no game files, dumps, shader names or retail hashes.

Targeted tests on the head (cargo test -p xcl --lib memory_report): 2 passed, 0 failed, 0 ignored.

  • a_snapshot_on_the_device_has_its_budget_and_owners ran on the real adapter, not skipped (backend real, RX 7800 XT, 16176 MiB).
  • the_rest_is_the_total_less_the_parts passed. It covers the synthetic owner/remainder arithmetic, the negative remainder and the exact line format.

Extra probe, not committed, reverted afterwards. It took snapshot() twice and compared it with an independent EnumAdapters1 + QueryVideoMemoryInfo.

  • Local budget: snapshot 16157503488 B, independent 16157503488 B.
  • Non-local budget: snapshot 50654904320 B, independent 50654904320 B.
  • Usage agreed within the tolerance I set (5% + 64 MiB): 7688192 B local, 555032576 B non-local.
  • other(kind) == total - counted held for video, non-local and commit.
  • The live line was identical across the two snapshots:
    memory by owner (MB): commit 607 (UMA window 512, sparse CPU copy 0, other 95); video memory 7 of a 15408 budget (target pages 0, target pools free 0, arenas 0, sparse tiles 0, sparse pools free 0, sparse pools retired 0, committed textures 0, other 7); non-local 529 of a 48308 budget (other 529)

Locked workspace suite (cargo test --locked --workspace --no-fail-fast -- --test-threads=4):

passed failed ignored
head 451c7245 1436 1 47
parent b49be183 1434 1 47
  • Both runs fail only gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1, with seed 722: res[30] = 0x1, CPU 0x7fffffff. This is the known seed 722 baseline, and it reproduces identically on the parent.
  • The 2 extra passes on the head are the 2 new tests.
  • Both runs print the same 7 SKIPPED lines: f16 and f32 conversion programs on the GPU, refused because of V_MUL_F16, V_PK_MUL_F16 and V_CVT_F16_F32 (#1426). None are new.
  • A first head run without --no-fail-fast stopped after the lib failure. The numbers above come from the --no-fail-fast reruns.

Limits of coverage

  • No title was run, so every XCL owner reads 0 and only other is non-zero. Nothing here shows the owners' byte counts are right under load.
  • It does not cover sparse::retired_bytes, title_textures::committed_bytes, the host.rs logging cadence, or the PR's scripts/smoke.ps1 regression run.
  • The test run does not check which side of the commit/video split each owner is counted on, or whether anything is double counted.
  • The two adapter entries that enumerated as RX 7800 XT reported identical values.
  • The machine has a single AMD GPU and no NVIDIA, Intel or iGPU.

AI use: Claude Code (Claude Sonnet 5.5) ran the tests and wrote this report; Codex (gpt-6.2-sol) orchestrated. Temporary probe reverted, checkout restored, scratch target directory removed.

**@⁠oni-swr** on GitHub · 2026-11-26 07:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/2697#issuecomment-7185140632) **Test report for #2697 at `451c72455ca1d5d23f40de8ac6c12b24ef93eacb`** (parent `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`; the head is one commit on that parent). Measurements only. This is not a source review. **Machine:** AMD Radeon RX 7800 XT (driver 32.0.31035.1003), Windows 11 Pro 26200, rustc 1.100.0, debug build, `--locked`, `-j 4`. Synthetic inputs and native DXGI only: no game files, dumps, shader names or retail hashes. **Targeted tests on the head** (`cargo test -p xcl --lib memory_report`): 2 passed, 0 failed, 0 ignored. - `a_snapshot_on_the_device_has_its_budget_and_owners` ran on the real adapter, not skipped (backend `real`, RX 7800 XT, 16176 MiB). - `the_rest_is_the_total_less_the_parts` passed. It covers the synthetic owner/remainder arithmetic, the negative remainder and the exact line format. **Extra probe, not committed, reverted afterwards.** It took `snapshot()` twice and compared it with an independent `EnumAdapters1` + `QueryVideoMemoryInfo`. - Local budget: snapshot 16157503488 B, independent 16157503488 B. - Non-local budget: snapshot 50654904320 B, independent 50654904320 B. - Usage agreed within the tolerance I set (5% + 64 MiB): 7688192 B local, 555032576 B non-local. - `other(kind) == total - counted` held for video, non-local and commit. - The live line was identical across the two snapshots: `memory by owner (MB): commit 607 (UMA window 512, sparse CPU copy 0, other 95); video memory 7 of a 15408 budget (target pages 0, target pools free 0, arenas 0, sparse tiles 0, sparse pools free 0, sparse pools retired 0, committed textures 0, other 7); non-local 529 of a 48308 budget (other 529)` **Locked workspace suite** (`cargo test --locked --workspace --no-fail-fast -- --test-threads=4`): | | passed | failed | ignored | |---|---|---|---| | head `451c7245` | 1436 | 1 | 47 | | parent `b49be183` | 1434 | 1 | 47 | - Both runs fail only `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`, with `seed 722: res[30] = 0x1, CPU 0x7fffffff`. This is the known seed 722 baseline, and it reproduces identically on the parent. - The 2 extra passes on the head are the 2 new tests. - Both runs print the same 7 `SKIPPED` lines: f16 and f32 conversion programs on the GPU, refused because of `V_MUL_F16`, `V_PK_MUL_F16` and `V_CVT_F16_F32` (#1426). None are new. - A first head run without `--no-fail-fast` stopped after the lib failure. The numbers above come from the `--no-fail-fast` reruns. **Limits of coverage** - No title was run, so every XCL owner reads 0 and only `other` is non-zero. Nothing here shows the owners' byte counts are right under load. - It does not cover `sparse::retired_bytes`, `title_textures::committed_bytes`, the `host.rs` logging cadence, or the PR's `scripts/smoke.ps1` regression run. - The test run does not check which side of the commit/video split each owner is counted on, or whether anything is double counted. - The two adapter entries that enumerated as RX 7800 XT reported identical values. - The machine has a single AMD GPU and no NVIDIA, Intel or iGPU. AI use: Claude Code (Claude Sonnet 5.5) ran the tests and wrote this report; Codex (gpt-6.2-sol) orchestrated. Temporary probe reverted, checkout restored, scratch target directory removed.
Author
Owner

@⁠joeypercia on GitHub · 2026-11-26 07:10 UTC · original

Thanks, @⁠oni-swr. Your line shows something worth acting on: non-local usage is 529 MB with a 512 MB UMA window, and nothing else is running. So DXGI counts the imported coherent window (OpenExistingHeapFromAddress) in the non-local segment. The RTX 4070 Ti run in the description agrees: 4,140 MB non-local 2 s in, with a 4,095 MB window. (On the RDNA2 iGPU, one segment, non-local is 0.)

So the window belongs in non-local's parts as well as in commit, and most of non-local's "other" is the window. The next part puts it there. (Claude Code, Claude Opus 5.5)

**@⁠joeypercia** on GitHub · 2026-11-26 07:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/2697#issuecomment-7185167154) Thanks, @⁠oni-swr. Your line shows something worth acting on: non-local usage is 529 MB with a 512 MB UMA window, and nothing else is running. So DXGI counts the imported coherent window (`OpenExistingHeapFromAddress`) in the non-local segment. The RTX 4070 Ti run in the description agrees: 4,140 MB non-local 2 s in, with a 4,095 MB window. (On the RDNA2 iGPU, one segment, non-local is 0.) So the window belongs in non-local's parts as well as in commit, and most of non-local's "other" is the window. The next part puts it there. (Claude Code, Claude Opus 5.5)
github-bot force-pushed github-bot/gh-2697 from 451c72455c to 8c9433fe2e 2026-11-26 07:35:53 +00:00 Compare
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 07:30 UTC · original · reviewed

memory_report.rs:119,127–128: sparse CPU copy uses the second value of sparse::pool_bytes(), which is GPU pool occupancy (pool capacity - free tiles), not CPU committed pages. The PR discloses overcounting holes within a still-mapped tile, but a fully decommitted tile is more distinct: decommit_tiles removes it from mapped (sparse.rs:166–182), then decommit_range parks its GPU tile (:1393–1405) until unmap/fence retirement. The title's CPU copy is gone while this line still charges 64 KiB of commit to it. Under heavy decommit/churn, that shifts bytes from other to sparse CPU copy precisely while the report is meant to explain commit pressure.

Could the commit part count non-hole pages in mapped (or at least active mapped tiles), separately from GPU pool occupancy, and cover a fully decommitted parked tile in a focused test? The GPU sparse tiles part can retain the pool accounting. This is source review at exact head 451c72455ca1d5d23f40de8ac6c12b24ef93eacb; I have not measured the live byte difference on a title. AI-assisted review with Codex.

**@⁠luckyteagirl** on GitHub · 2026-11-26 07:30 UTC · [original](https://github.com/xcl-dev/xcl/pull/2697#pullrequestreview-6070065611) · **reviewed** `memory_report.rs:119,127–128`: `sparse CPU copy` uses the second value of `sparse::pool_bytes()`, which is GPU pool occupancy (`pool capacity - free tiles`), not CPU committed pages. The PR discloses overcounting holes within a still-mapped tile, but a fully decommitted tile is more distinct: `decommit_tiles` removes it from `mapped` (`sparse.rs:166–182`), then `decommit_range` parks its GPU tile (`:1393–1405`) until unmap/fence retirement. The title's CPU copy is gone while this line still charges 64 KiB of commit to it. Under heavy decommit/churn, that shifts bytes from `other` to `sparse CPU copy` precisely while the report is meant to explain commit pressure. Could the commit part count non-hole pages in `mapped` (or at least active mapped tiles), separately from GPU pool occupancy, and cover a fully decommitted parked tile in a focused test? The GPU `sparse tiles` part can retain the pool accounting. This is source review at exact head `451c72455ca1d5d23f40de8ac6c12b24ef93eacb`; I have not measured the live byte difference on a title. AI-assisted review with Codex.
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 07:36 UTC · original

Thanks for the quick update. I checked the new head 8c9433f: sparse::committed_bytes() now counts non-hole pages in active mapped tiles, so a fully decommitted parked tile contributes zero to the CPU commit part. The added parked-tile assertion covers the case I raised. This resolves my review point. AI-assisted follow-up with Codex.

**@⁠luckyteagirl** on GitHub · 2026-11-26 07:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/2697#issuecomment-7185641994) Thanks for the quick update. I checked the new head `8c9433f`: `sparse::committed_bytes()` now counts non-hole pages in active mapped tiles, so a fully decommitted parked tile contributes zero to the CPU commit part. The added parked-tile assertion covers the case I raised. This resolves my review point. AI-assisted follow-up with Codex.
github-bot force-pushed github-bot/gh-2697 from 8c9433fe2e to f7e4869cf3 2026-11-26 07:52:50 +00:00 Compare
Author
Owner

@⁠pr1sm-dev on GitHub · 2026-11-26 07:49 UTC · original

Under Wine (Linux, Wine 11.22) the commit row reads 0, so other goes negative (−4,935 MB here at 8c9433f, 120 s in the menus, RTX 3070). process_commit reads PrivateUsage, which Wine leaves at 0. In a probe under the same Wine, PagefileUsage tracked commit (3 → 1,027 MiB after committing and touching 1 GiB). #1097 / #2362 fix this counter for the activity log but not memory_report.rs, so reusing their helper once one lands would cover it. The video and non-local rows look right here (local budget ~7.2 GB of 8 GB, non-local 48 GB).

AI use: Claude Code (Claude Opus 5.5) ran the build, the run and the probe on this machine and wrote this comment.

**@⁠pr1sm-dev** on GitHub · 2026-11-26 07:49 UTC · [original](https://github.com/xcl-dev/xcl/pull/2697#issuecomment-7185876153) **Under Wine (Linux, Wine 11.22) the commit row reads 0, so `other` goes negative** (−4,935 MB here at `8c9433f`, 120 s in the menus, RTX 3070). `process_commit` reads `PrivateUsage`, which Wine leaves at 0. In a probe under the same Wine, `PagefileUsage` tracked commit (3 → 1,027 MiB after committing and touching 1 GiB). #1097 / #2362 fix this counter for the activity log but not `memory_report.rs`, so reusing their helper once one lands would cover it. The video and non-local rows look right here (local budget ~7.2 GB of 8 GB, non-local 48 GB). AI use: Claude Code (Claude Opus 5.5) ran the build, the run and the probe on this machine and wrote this comment.
Author
Owner

@⁠joeypercia on GitHub · 2026-11-26 07:51 UTC · original

Thanks, @⁠pr1sm-dev. Right: PrivateUsage reads 0 under Wine. Now a commit that reads 0 shows as commit unknown (…), with no "other" for it, instead of 0 and a negative rest. The video and non-local rows stay as they are. I didn't copy either way of reading the commit under Wine here: #1097 uses PagefileUsage, and #2362 walks VirtualQuery because PagefileUsage isn't the commit on macOS. Whichever lands, process_commit can call it. Amended into f7e4869c; the unit test covers the unknown commit. (Claude Code, Claude Opus 5.5)

**@⁠joeypercia** on GitHub · 2026-11-26 07:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/2697#issuecomment-7185916962) Thanks, @⁠pr1sm-dev. Right: `PrivateUsage` reads 0 under Wine. Now a commit that reads 0 shows as `commit unknown (…)`, with no "other" for it, instead of 0 and a negative rest. The video and non-local rows stay as they are. I didn't copy either way of reading the commit under Wine here: #1097 uses `PagefileUsage`, and #2362 walks `VirtualQuery` because `PagefileUsage` isn't the commit on macOS. Whichever lands, `process_commit` can call it. Amended into `f7e4869c`; the unit test covers the unknown commit. (Claude Code, Claude Opus 5.5)
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 07:58 UTC · original

Focused Windows AMD check of current head f7e4869cf35d646caf05dd158dc79363b4b76ef1 (clean detached checkout; base b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7). This follows the sparse CPU accounting correction discussed in my earlier review.

Environment: Windows 11 Home build 26200 x64, AMD Radeon RX 6800M (driver 30.0.13002.13003), Ryzen 9 5980HX, Rust 1.99 MSVC. XCL_ADAPTER=6800M, XCL_REQUIRE_GPU=1; the native memory-report test log identifies the RX 6800M backend.

  • cargo test --locked -p xcl --lib memory_report -j 1 -- --test-threads=1 --nocapture: 2 passed, 0 failed, 0 ignored; 1336 filtered out, exit 0.
  • cargo test --locked -p xcl --lib a_tile_decommitted_and_committed_again_keeps_its_video_memory -j 1 -- --test-threads=1 --nocapture: 1 passed, 0 failed, 0 ignored; 1337 filtered out, exit 0. This fixture creates a default D3D12 device, so I am not claiming it selected the RX 6800M.

No full workspace suite, release build, or paired title smoke was run for this head. The focused tests do not measure the Windows/Wine budget behavior or a live title's peak commit.

AI use: OpenAI Codex (GPT-6.2 Astra) checked out the exact head, ran the tests on this machine, and drafted this report.

**@⁠luckyteagirl** on GitHub · 2026-11-26 07:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/2697#issuecomment-7186043965) Focused Windows AMD check of current head `f7e4869cf35d646caf05dd158dc79363b4b76ef1` (clean detached checkout; base `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`). This follows the sparse CPU accounting correction discussed in my earlier review. Environment: Windows 11 Home build 26200 x64, AMD Radeon RX 6800M (driver 30.0.13002.13003), Ryzen 9 5980HX, Rust 1.99 MSVC. `XCL_ADAPTER=6800M`, `XCL_REQUIRE_GPU=1`; the native memory-report test log identifies the RX 6800M backend. - `cargo test --locked -p xcl --lib memory_report -j 1 -- --test-threads=1 --nocapture`: **2 passed, 0 failed, 0 ignored; 1336 filtered out**, exit 0. - `cargo test --locked -p xcl --lib a_tile_decommitted_and_committed_again_keeps_its_video_memory -j 1 -- --test-threads=1 --nocapture`: **1 passed, 0 failed, 0 ignored; 1337 filtered out**, exit 0. This fixture creates a default D3D12 device, so I am not claiming it selected the RX 6800M. No full workspace suite, release build, or paired title smoke was run for this head. The focused tests do not measure the Windows/Wine budget behavior or a live title's peak commit. AI use: OpenAI Codex (GPT-6.2 Astra) checked out the exact head, ran the tests on this machine, and drafted this report.
Author
Owner

@⁠Decodere on GitHub · 2026-11-26 07:59 UTC · original

Independent RTX 4060 (8 GB) verification of PR #2697 at 8c9433fe2e7b4795e262c783b55554d724c6e136 (exact parent origin/main b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7). Measurements only; not a source review.

Note: Measurements were taken on 8c9433fe just before f7e4869c landed; verified 8c9433fe..f7e4869c only changes Snapshot.commit to Option<u64> for the Wine PrivateUsage == 0 ("commit unknown") path, leaving native Windows 11 output identical.

Setup

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6 cores / 12 threads), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200
  • Toolchain / caches: rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.9.2609.5, release builds, warm DXIL/pipeline caches (dxil_cache: 460 hits, 0 misses), quiet machine (zero concurrent builds/tests during timed runs)
  • Workload: Retail workload title: 29640639 via scripts/smoke.ps1 -Seconds 60 (XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=60, default flags, no input)

Targeted RTX 4060 release unit tests (8c9433fe)

  • cargo test --release -p xcl --lib hle::d3d12x::memory_report -- --nocapture: 2 passed, 0 failed, 0 ignored (0.36 s; a_snapshot_on_the_device_has_its_budget_and_owners ran live on NVIDIA GeForce RTX 4060 (7956 MiB VRAM), not skipped; the_rest_is_the_total_less_the_parts passed).
  • cargo test --release -p xcl --lib hle::d3d12x::sparse -- --nocapture: 17 passed, 0 failed, 1 ignored (0.39 s; early_commit_timing ignored).
  • cargo test --release -p xcl --lib hle::d3d12x::title_textures -- --nocapture: 19 passed, 0 failed, 0 ignored (0.89 s).

Live workload accounting under XCL_ACTIVITY=1 (60 s, 8c9433fe)

  • Cadence & scripts/smoke.ps1 compatibility: 29 legacy memory: lines paired 1:1 with 29 memory by owner (MB): lines (0 unparsed lines). scripts/smoke.ps1 continued matching only the legacy memory: (\d+) MB committed line.
  • Verbatim periodic lines (first, peak VRAM, final):
[    2.002][15624][INFO ] memory by owner (MB): commit 5245 (UMA window 4095, sparse CPU copy 20, other 1129); video memory 91 of a 7188 budget (target pages 0, target pools free 0, arenas 0, sparse tiles 20, sparse pools free 44, sparse pools retired 0, committed textures 0, other 27); non-local 4243 of a 15556 budget (UMA window 4095, other 148)
[   18.070][15624][INFO ] memory by owner (MB): commit 13995 (UMA window 4095, sparse CPU copy 838, other 9061); video memory 6175 of a 6945 budget (target pages 3576, target pools free 7, arenas 465, sparse tiles 838, sparse pools free 57, sparse pools retired 0, committed textures 400, other 829); non-local 4603 of a 15556 budget (UMA window 4095, other 507)
[   58.094][15624][INFO ] memory by owner (MB): commit 14015 (UMA window 4095, sparse CPU copy 838, other 9081); video memory 6114 of a 6922 budget (target pages 3542, target pools free 41, arenas 401, sparse tiles 838, sparse pools free 57, sparse pools retired 0, committed textures 400, other 832); non-local 4684 of a 15556 budget (UMA window 4095, other 588)
  • End-of-run owner table (29 samples across 2.0 s .. 58.1 s, MB):
Segment / Owner First (2.0 s) Peak End (58.1 s) End share of segment
Commit total 5,245 14,015 14,015 100.0%
— UMA window 4,095 4,095 4,095 29.2%
— sparse CPU copy 20 838 838 6.0%
— other 1,129 9,081 9,081 64.8%
Video memory (local) total 91 6,175 6,114 100.0% (88.3% of end budget)
— DXGI local budget 7,188 7,188 (min 6,910) 6,922 —
— target pages 0 3,576 3,542 57.9%
— target pools free 0 71 41 0.7%
— arenas 0 465 401 6.6%
— sparse tiles 20 838 838 13.7%
— sparse pools free 44 58 57 0.9%
— sparse pools retired 0 0 0 0.0%
— committed textures 0 400 400 6.5%
— other 27 832 832 13.6%
Non-local total 4,243 4,684 4,684 100.0% (30.1% of budget)
— DXGI non-local budget 15,556 15,556 15,556 —
— UMA window 4,095 4,095 4,095 87.4%
— other 148 588 588 12.6%

Key findings on 8c9433fe (RTX 4060 8 GB)

  1. Non-local UMA window attribution verified live on 8 GB NVIDIA: uma_segment(non_local) places UMA window 4095 in non-local on this discrete RTX 4060, accounting for 87.4% (4,095 / 4,684 MB) of steady-state non-local usage and leaving non-local other strictly positive (148..588 MB, integer >> 20 floor rounding difference <= 1 MB) across all 29/29 samples.
  2. Active sparse::committed_bytes() accounting verified live: sparse CPU copy tracked 20 -> 838 MB cleanly across all 29/29 samples, matching sparse tiles (0 MB hole delta in this 60 s menu/intro window; sub-tile decommit / hole paths are covered by hle::d3d12x::sparse::tests, 17/0/1).
  3. 86.3% of local VRAM attributed under load on 8 GB: Tracked owners sum to 5,279 MB of 6,114 MB steady-state local VRAM (other = 832 MB, strictly positive 27..832 MB across all 29/29 samples; integer >> 20 floor rounding difference <= 2 MB on commit and <= 4 MB on video memory). target pages (3,542 MB, 57.9%) and sparse tiles (838 MB, 13.7%) dominate local VRAM.
  4. 8 GB local budget headroom: DXGI local budget started at 7,188 MB, tightened to 6,910 MB (-278 MB) during load, and ended at 6,922 MB. Peak local usage reached 6,175 MB (88.9% of the concurrent 6,945 MB budget at t = 18.1 s; 0/29 samples over budget), leaving ~770–810 MB of local headroom before world load.

Paired 60 s RTX 4060 smoke (b49be183 vs 8c9433fe)

Parent origin/main (b49be183):

xcl-smoke v1
commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1518 (PresentX 1518)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14018 MB

PR #2697 head (8c9433fe):

xcl-smoke v1
commit: 8c9433fe2e7b4795e262c783b55554d724c6e136
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1597 (PresentX 1597)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14015 MB

Limits of coverage

  • Default main 60 s no-input menu/intro run: sparse pools retired stayed 0 MB and sparse tiles - sparse CPU copy stayed 0 MB throughout this window; VRAM stayed under the 8 GB DXGI budget (0/29 over-budget samples), so negative video memory other under VRAM oversubscription/demotion was not exercised here.
  • Full workspace suite was not re-run on 8c9433fe (only targeted memory_report, sparse, and title_textures tests plus paired 60 s smoke).
  • Single discrete NVIDIA 8 GB GPU (RTX 4060); no AMD, Intel, or iGPU tested on this host.

AI use

Ran the targeted tests, paired quiet 60 s smoke runs, and log analysis with assistance from Google Antigravity (Gemini 4 Neon); all numbers were extracted directly from the xcl.log, report.json, and scripts/smoke.ps1 outputs.

**@⁠Decodere** on GitHub · 2026-11-26 07:59 UTC · [original](https://github.com/xcl-dev/xcl/pull/2697#issuecomment-7186063701) **Independent RTX 4060 (8 GB) verification of PR #2697 at `8c9433fe2e7b4795e262c783b55554d724c6e136`** (exact parent `origin/main` `b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7`). Measurements only; not a source review. > Note: Measurements were taken on `8c9433fe` just before `f7e4869c` landed; verified `8c9433fe..f7e4869c` only changes `Snapshot.commit` to `Option<u64>` for the Wine `PrivateUsage == 0` (`"commit unknown"`) path, leaving native Windows 11 output identical. ### Setup - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6 cores / 12 threads), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` - **Toolchain / caches:** `rustc 1.100.0 (0ef1bc386 2026-11-09)`, DXC `1.9.2609.5`, release builds, warm DXIL/pipeline caches (`dxil_cache: 460 hits, 0 misses`), quiet machine (zero concurrent builds/tests during timed runs) - **Workload:** Retail workload `title: 29640639` via `scripts/smoke.ps1 -Seconds 60` (`XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_RUN_SECONDS=60`, default flags, no input) ### Targeted RTX 4060 release unit tests (`8c9433fe`) - `cargo test --release -p xcl --lib hle::d3d12x::memory_report -- --nocapture`: **2 passed, 0 failed, 0 ignored** (`0.36 s`; `a_snapshot_on_the_device_has_its_budget_and_owners` ran live on `NVIDIA GeForce RTX 4060 (7956 MiB VRAM)`, not skipped; `the_rest_is_the_total_less_the_parts` passed). - `cargo test --release -p xcl --lib hle::d3d12x::sparse -- --nocapture`: **17 passed, 0 failed, 1 ignored** (`0.39 s`; `early_commit_timing` ignored). - `cargo test --release -p xcl --lib hle::d3d12x::title_textures -- --nocapture`: **19 passed, 0 failed, 0 ignored** (`0.89 s`). ### Live workload accounting under `XCL_ACTIVITY=1` (60 s, `8c9433fe`) - **Cadence & `scripts/smoke.ps1` compatibility:** `29` legacy `memory:` lines paired 1:1 with `29` `memory by owner (MB):` lines (`0` unparsed lines). `scripts/smoke.ps1` continued matching only the legacy `memory: (\d+) MB committed` line. - **Verbatim periodic lines (first, peak VRAM, final):** ```text [ 2.002][15624][INFO ] memory by owner (MB): commit 5245 (UMA window 4095, sparse CPU copy 20, other 1129); video memory 91 of a 7188 budget (target pages 0, target pools free 0, arenas 0, sparse tiles 20, sparse pools free 44, sparse pools retired 0, committed textures 0, other 27); non-local 4243 of a 15556 budget (UMA window 4095, other 148) [ 18.070][15624][INFO ] memory by owner (MB): commit 13995 (UMA window 4095, sparse CPU copy 838, other 9061); video memory 6175 of a 6945 budget (target pages 3576, target pools free 7, arenas 465, sparse tiles 838, sparse pools free 57, sparse pools retired 0, committed textures 400, other 829); non-local 4603 of a 15556 budget (UMA window 4095, other 507) [ 58.094][15624][INFO ] memory by owner (MB): commit 14015 (UMA window 4095, sparse CPU copy 838, other 9081); video memory 6114 of a 6922 budget (target pages 3542, target pools free 41, arenas 401, sparse tiles 838, sparse pools free 57, sparse pools retired 0, committed textures 400, other 832); non-local 4684 of a 15556 budget (UMA window 4095, other 588) ``` - **End-of-run owner table (`29` samples across `2.0 s .. 58.1 s`, MB):** | Segment / Owner | First (`2.0 s`) | Peak | End (`58.1 s`) | End share of segment | |---|---:|---:|---:|---:| | **Commit total** | **5,245** | **14,015** | **14,015** | **100.0%** | | — `UMA window` | 4,095 | 4,095 | 4,095 | 29.2% | | — `sparse CPU copy` | 20 | 838 | 838 | 6.0% | | — `other` | 1,129 | 9,081 | 9,081 | 64.8% | | **Video memory (local) total** | **91** | **6,175** | **6,114** | **100.0%** (`88.3%` of end budget) | | — DXGI local budget | 7,188 | 7,188 (min 6,910) | 6,922 | — | | — `target pages` | 0 | 3,576 | 3,542 | 57.9% | | — `target pools free` | 0 | 71 | 41 | 0.7% | | — `arenas` | 0 | 465 | 401 | 6.6% | | — `sparse tiles` | 20 | 838 | 838 | 13.7% | | — `sparse pools free` | 44 | 58 | 57 | 0.9% | | — `sparse pools retired` | 0 | 0 | 0 | 0.0% | | — `committed textures` | 0 | 400 | 400 | 6.5% | | — `other` | 27 | 832 | 832 | 13.6% | | **Non-local total** | **4,243** | **4,684** | **4,684** | **100.0%** (`30.1%` of budget) | | — DXGI non-local budget | 15,556 | 15,556 | 15,556 | — | | — `UMA window` | 4,095 | 4,095 | 4,095 | 87.4% | | — `other` | 148 | 588 | 588 | 12.6% | ### Key findings on `8c9433fe` (RTX 4060 8 GB) 1. **Non-local `UMA window` attribution verified live on 8 GB NVIDIA:** `uma_segment(non_local)` places `UMA window 4095` in `non-local` on this discrete RTX 4060, accounting for **87.4%** (`4,095 / 4,684 MB`) of steady-state non-local usage and leaving `non-local other` strictly positive (`148..588 MB`, integer `>> 20` floor rounding difference `<= 1 MB`) across all `29/29` samples. 2. **Active `sparse::committed_bytes()` accounting verified live:** `sparse CPU copy` tracked `20 -> 838 MB` cleanly across all `29/29` samples, matching `sparse tiles` (`0 MB` hole delta in this 60 s menu/intro window; sub-tile decommit / hole paths are covered by `hle::d3d12x::sparse::tests`, `17/0/1`). 3. **86.3% of local VRAM attributed under load on 8 GB:** Tracked owners sum to `5,279 MB` of `6,114 MB` steady-state local VRAM (`other = 832 MB`, strictly positive `27..832 MB` across all `29/29` samples; integer `>> 20` floor rounding difference `<= 2 MB` on commit and `<= 4 MB` on video memory). `target pages` (`3,542 MB`, 57.9%) and `sparse tiles` (`838 MB`, 13.7%) dominate local VRAM. 4. **8 GB local budget headroom:** DXGI local budget started at `7,188 MB`, tightened to `6,910 MB` (`-278 MB`) during load, and ended at `6,922 MB`. Peak local usage reached `6,175 MB` (`88.9%` of the concurrent `6,945 MB` budget at `t = 18.1 s`; `0/29` samples over budget), leaving ~770–810 MB of local headroom before world load. ### Paired 60 s RTX 4060 smoke (`b49be183` vs `8c9433fe`) Parent `origin/main` (`b49be183`): ``` xcl-smoke v1 commit: b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1518 (PresentX 1518) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14018 MB ``` PR #2697 head (`8c9433fe`): ``` xcl-smoke v1 commit: 8c9433fe2e7b4795e262c783b55554d724c6e136 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1597 (PresentX 1597) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14015 MB ``` ### Limits of coverage - Default `main` 60 s no-input menu/intro run: `sparse pools retired` stayed `0 MB` and `sparse tiles - sparse CPU copy` stayed `0 MB` throughout this window; VRAM stayed under the 8 GB DXGI budget (`0/29` over-budget samples), so negative `video memory other` under VRAM oversubscription/demotion was not exercised here. - Full workspace suite was not re-run on `8c9433fe` (only targeted `memory_report`, `sparse`, and `title_textures` tests plus paired 60 s smoke). - Single discrete NVIDIA 8 GB GPU (`RTX 4060`); no AMD, Intel, or iGPU tested on this host. ### AI use Ran the targeted tests, paired quiet 60 s smoke runs, and log analysis with assistance from Google Antigravity (Gemini 4 Neon); all numbers were extracted directly from the `xcl.log`, `report.json`, and `scripts/smoke.ps1` outputs.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-26 08:00 UTC · original · edited 2026-11-26 09:05 UTC

Updated independent Windows/NVIDIA check for #2697 head f7e4869 against b49be18. This supersedes my earlier 8c9433f test report. I applied the connector's current patch to that parent and verified all five changed files against the head's Git blob IDs.

Tested: Windows 11 build 26300, RTX 3080 Ti (12 GB, NVIDIA 621.35), Rust 1.99.1 MSVC, DXC 1.8.2502.11; debug build. XCL_DXIL_CACHE was set to writable folders under the worktree's target directory.

  • cargo test --offline --locked -p xcl --lib memory_report -- --nocapture --test-threads=1: 2 passed, 0 failed, 0 ignored. The native DXGI budget/owner snapshot ran on the real RTX 3080 Ti.
  • cargo build --offline --locked --workspace: passed.
  • cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --quiet: 1,437 passed, 0 failed, 47 ignored across 37 targets; 25 GPU SKIPPED notices (native wave64, three refused per-lane cases, and no heap windows). The e2e target passed 4/0/0. Untouched b49be18 under the same writable-cache setting passed 1,435/0/47 with the same 25 skips.

The earlier console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk failure came from this managed worktree's default %LOCALAPPDATA% DXIL cache path: it reproduced in isolation without a cache override and passed 1/0/0 when XCL_DXIL_CACHE pointed inside the worktree. No XCL code change was needed for that test.

Not tested: a retail title, sustained in-world memory accounting, another adapter, or the 47 ignored tests. Synthetic inputs only; no game files or diagnostics were used or posted.

AI use: Codex (GPT-6.2 Sol) reconstructed and verified the tested source, ran the tests, checked the base failure, and drafted this report.

**@⁠thehollowedone** on GitHub · 2026-11-26 08:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/2697#issuecomment-7186075938) · edited 2026-11-26 09:05 UTC Updated independent Windows/NVIDIA check for [#2697 head `f7e4869`](https://git.gtahub.st/github/xcl-dev--xcl/pulls/2697/commits/f7e4869cf35d646caf05dd158dc79363b4b76ef1) against [`b49be18`](https://github.com/xcl-dev/xcl/commit/b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7). This supersedes my earlier `8c9433f` test report. I applied the connector's current patch to that parent and verified all five changed files against the head's Git blob IDs. **Tested:** Windows 11 build 26300, RTX 3080 Ti (12 GB, NVIDIA 621.35), Rust 1.99.1 MSVC, DXC 1.8.2502.11; debug build. `XCL_DXIL_CACHE` was set to writable folders under the worktree's `target` directory. - `cargo test --offline --locked -p xcl --lib memory_report -- --nocapture --test-threads=1`: **2 passed, 0 failed, 0 ignored**. The native DXGI budget/owner snapshot ran on the real RTX 3080 Ti. - `cargo build --offline --locked --workspace`: passed. - `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --quiet`: **1,437 passed, 0 failed, 47 ignored** across 37 targets; **25 GPU `SKIPPED` notices** (native wave64, three refused per-lane cases, and no heap windows). The `e2e` target passed 4/0/0. Untouched `b49be18` under the same writable-cache setting passed 1,435/0/47 with the same 25 skips. The earlier `console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk` failure came from this managed worktree's default `%LOCALAPPDATA%` DXIL cache path: it reproduced in isolation without a cache override and passed 1/0/0 when `XCL_DXIL_CACHE` pointed inside the worktree. No XCL code change was needed for that test. **Not tested:** a retail title, sustained in-world memory accounting, another adapter, or the 47 ignored tests. Synthetic inputs only; no game files or diagnostics were used or posted. AI use: Codex (GPT-6.2 Sol) reconstructed and verified the tested source, ran the tests, checked the base failure, and drafted this report.
github-bot force-pushed github-bot/gh-2697 from f7e4869cf3 to 50cfb321be 2026-11-26 11:17:19 +00:00 Compare
Author
Owner

@⁠GodlyBDS on GitHub · 2026-11-26 10:40 UTC · original

Independent #2697 port check on nvidia-dev (RTX 3090 Ti)

Windows 10, NVIDIA 621.40, 32 GiB system RAM. Local release tree af2cecc40886a8682ecf3267f5328c6dc4b66ad7 plus this PR's f7e4869cf35d646caf05dd158dc79363b4b76ef1 report, merged with existing NVIDIA activity text. The run also uses the same local Agility/XG startup adapters as the previous #2688 test. The exact main-targeted PR head was not run.

One port detail: nvidia-dev has GPU-view mirror entries in sparse::State::mapped. A mirror has TileEntry.src != 0 and no CPU commitment at its own VA. Counting every entry's non-hole pages in the sparse CPU-copy row counts an alias as backing and can count the coherent window again. The NVIDIA port filters for src == 0 before applying the existing hole count. The main PR's TileEntry has no mirrors, so its existing sum is appropriate on that branch.

Tested: cargo test --locked --release -p xcl --lib memory_report -- --nocapture --test-threads=1 (2 passes, one using this physical D3D12 adapter) and the extended a_tile_decommitted_and_committed_again_keeps_its_video_memory regression (1 pass). Zero failures, ignores or skips in these focused runs. The regression exercises original backing, a second GPU view, and a decommitted but parked tile.

The report also works in the title transition with the 4,095 MiB coherent window, 1 GiB app shader-heap profile and level pages enabled. At 110.46 s it accounted for 4,095 MiB coherent and 6,207 MiB sparse CPU backing of 33,762 MiB private commit. DXGI non-local use was 1,964 MiB while the whole UMA window is assigned 4,095 MiB there, so the signed residual was −2,131 MiB. This is a useful indication that the assumed segment attribution and DXGI residency differ. The run is still progressing, and the report does not assign the remaining 23,460 MiB process commit to a particular owner.

AI use: Codex (GPT-6) adapted the NVIDIA port, ran the checks and wrote this report.

**@⁠GodlyBDS** on GitHub · 2026-11-26 10:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/2697#issuecomment-7189680488) **Independent #2697 port check on nvidia-dev (RTX 3090 Ti)** Windows 10, NVIDIA 621.40, 32 GiB system RAM. Local release tree `af2cecc40886a8682ecf3267f5328c6dc4b66ad7` plus this PR's `f7e4869cf35d646caf05dd158dc79363b4b76ef1` report, merged with existing NVIDIA activity text. The run also uses the same local Agility/XG startup adapters as the previous [#2688 test](https://git.gtahub.st/github/xcl-dev--xcl/issues/2688). The exact main-targeted PR head was not run. One port detail: `nvidia-dev` has GPU-view mirror entries in `sparse::State::mapped`. A mirror has `TileEntry.src != 0` and no CPU commitment at its own VA. Counting every entry's non-hole pages in the sparse CPU-copy row counts an alias as backing and can count the coherent window again. The NVIDIA port filters for `src == 0` before applying the existing hole count. The main PR's `TileEntry` has no mirrors, so its existing sum is appropriate on that branch. **Tested:** `cargo test --locked --release -p xcl --lib memory_report -- --nocapture --test-threads=1` (2 passes, one using this physical D3D12 adapter) and the extended `a_tile_decommitted_and_committed_again_keeps_its_video_memory` regression (1 pass). Zero failures, ignores or skips in these focused runs. The regression exercises original backing, a second GPU view, and a decommitted but parked tile. The report also works in the title transition with the 4,095 MiB coherent window, 1 GiB app shader-heap profile and level pages enabled. At 110.46 s it accounted for 4,095 MiB coherent and 6,207 MiB sparse CPU backing of 33,762 MiB private commit. DXGI non-local use was 1,964 MiB while the whole UMA window is assigned 4,095 MiB there, so the signed residual was −2,131 MiB. This is a useful indication that the assumed segment attribution and DXGI residency differ. The run is still progressing, and the report does not assign the remaining 23,460 MiB process commit to a particular owner. AI use: Codex (GPT-6) adapted the NVIDIA port, ran the checks and wrote this report.
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 10:51 UTC · original · reviewed

On current head 2c77c71299fe8653845c78b2893cb3cc5521ba01, could the native snapshot test accept the supported unknown-commit result? This PR now intentionally maps PrivateUsage == 0 to None because the Wine run in this discussion observed that value with a real adapter and valid DXGI budgets. a_snapshot_on_the_device_has_its_budget_and_owners skips only when the backend is not Real, then unconditionally asserts s.commit.is_some_and(|c| c > 0). On that Wine configuration, production reports commit unknown as intended but this test fails. The fixture could still require budgets and owners, and for commit == None assert that the line says commit unknown. This is exact-head source review tied to the reported Wine behavior; I did not rerun Wine.

AI use: OpenAI Codex (GPT-6.2 Sol) found and checked the mismatch; OpenAI Codex (GPT-6.2 Astra) independently checked the source and discussion and wrote this review.

**@⁠luckyteagirl** on GitHub · 2026-11-26 10:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/2697#pullrequestreview-6072815644) · **reviewed** On current head `2c77c71299fe8653845c78b2893cb3cc5521ba01`, could the native snapshot test accept the supported unknown-commit result? This PR now intentionally maps `PrivateUsage == 0` to `None` because the Wine run in this discussion observed that value with a real adapter and valid DXGI budgets. `a_snapshot_on_the_device_has_its_budget_and_owners` skips only when the backend is not `Real`, then unconditionally asserts `s.commit.is_some_and(|c| c > 0)`. On that Wine configuration, production reports `commit unknown` as intended but this test fails. The fixture could still require budgets and owners, and for `commit == None` assert that the line says `commit unknown`. This is exact-head source review tied to the reported Wine behavior; I did not rerun Wine. AI use: OpenAI Codex (GPT-6.2 Sol) found and checked the mismatch; OpenAI Codex (GPT-6.2 Astra) independently checked the source and discussion and wrote this review.
Author
Owner

@⁠joeypercia on GitHub · 2026-11-26 10:53 UTC · original

Right, thanks. The device test now accepts an unknown commit. With commit == None it checks that the line says commit unknown; otherwise it checks a commit above 0. The budget and owner checks stay as they were. It's in 9e7c976c (#2750 rebased onto it); the suite and smoke rerun on both are running. (Claude Code, Claude Opus 5.5)

**@⁠joeypercia** on GitHub · 2026-11-26 10:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/2697#issuecomment-7189967775) Right, thanks. The device test now accepts an unknown commit. With `commit == None` it checks that the line says `commit unknown`; otherwise it checks a commit above 0. The budget and owner checks stay as they were. It's in `9e7c976c` (#2750 rebased onto it); the suite and smoke rerun on both are running. (Claude Code, Claude Opus 5.5)
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 10:54 UTC · original · reviewed

On current head 9e7c976ce68cd700e08ad67e1e03658193404be9, heap_charge(local, non_local, uma) subtracts the full CPU UMA window from DXGI usage even when the window was never imported into D3D12. open_uma can return on OpenExistingHeapFromAddress or CreatePlacedResource failure before publishing UMA_HEAPS, while real::init still publishes the device; snapshot() then sees gpu::uma::get().size() and live DXGI usage. For example, with 3 GiB of unrelated DXGI usage and a 4 GiB CPU UMA window whose first import failed, saturating_sub reports zero D3D12 heap charge instead of those 3 GiB; the video-memory UMA owner is also counted although no window was imported. Could the DXGI rows subtract/count only the successfully imported coherent bytes, while retaining the full CPU UMA amount for the commit row? A focused failed-import case would cover the distinction. This is source and arithmetic review; I did not induce a real import failure.

AI use: Two OpenAI Codex GPT-6.2 Sol agents independently traced the failure and accounting paths; OpenAI Codex (GPT-6.2 Astra) verified them and wrote this review.

**@⁠luckyteagirl** on GitHub · 2026-11-26 10:54 UTC · [original](https://github.com/xcl-dev/xcl/pull/2697#pullrequestreview-6072868143) · **reviewed** On current head `9e7c976ce68cd700e08ad67e1e03658193404be9`, `heap_charge(local, non_local, uma)` subtracts the full CPU UMA window from DXGI usage even when the window was never imported into D3D12. `open_uma` can return on `OpenExistingHeapFromAddress` or `CreatePlacedResource` failure before publishing `UMA_HEAPS`, while `real::init` still publishes the device; `snapshot()` then sees `gpu::uma::get().size()` and live DXGI usage. For example, with 3 GiB of unrelated DXGI usage and a 4 GiB CPU UMA window whose first import failed, `saturating_sub` reports zero D3D12 heap charge instead of those 3 GiB; the video-memory UMA owner is also counted although no window was imported. Could the DXGI rows subtract/count only the successfully imported coherent bytes, while retaining the full CPU UMA amount for the commit row? A focused failed-import case would cover the distinction. This is source and arithmetic review; I did not induce a real import failure. AI use: Two OpenAI Codex GPT-6.2 Sol agents independently traced the failure and accounting paths; OpenAI Codex (GPT-6.2 Astra) verified them and wrote this review.
Author
Owner

@⁠joeypercia on GitHub · 2026-11-26 10:57 UTC · original

Right. real::uma_imported_bytes() now gives the bytes of the coherent windows D3D12 actually imported, read from UMA_HEAPS, which is only published on success. The DXGI rows use that: the window's part in its segment, and what heap_charge takes off. The commit row keeps the whole window. A failed import then counts as CPU memory only, and the heaps' charge isn't reduced. The unit test covers that case (3 GiB of usage, nothing imported, 3 GiB charged). It's in 50cfb321, with #2750 rebased; the suite and smoke rerun follow. I didn't induce a real import failure. (Claude Code, Claude Opus 5.5)

**@⁠joeypercia** on GitHub · 2026-11-26 10:57 UTC · [original](https://github.com/xcl-dev/xcl/pull/2697#issuecomment-7190057206) Right. `real::uma_imported_bytes()` now gives the bytes of the coherent windows D3D12 actually imported, read from `UMA_HEAPS`, which is only published on success. The DXGI rows use that: the window's part in its segment, and what `heap_charge` takes off. The commit row keeps the whole window. A failed import then counts as CPU memory only, and the heaps' charge isn't reduced. The unit test covers that case (3 GiB of usage, nothing imported, 3 GiB charged). It's in `50cfb321`, with #2750 rebased; the suite and smoke rerun follow. I didn't induce a real import failure. (Claude Code, Claude Opus 5.5)
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-26 11:07 UTC · original

Independent Windows/NVIDIA check of #2697 head 50cfb321, based on main b49be183. This supersedes my earlier report on the amended f7e4869 revision.

Clean head: RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, rustc 1.99.1 MSVC, DXC 1.8.2502.11. cargo build --offline --locked --workspace passed. cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 passed: 1,437 passed, 0 failed, 47 ignored across 37 test targets. The 25 GPU skip notices were 21 no-wave64 cases, three refused per-lane cases tracked in #1426, and one no-heap-windows case. The native memory_report test ran on the RTX 3080 Ti.

Separate bounded probe: I added an uncommitted, test-only fixture to the same head and ran cargo test --offline --locked -p xcl --lib probe_default_heap_charge_on_this_adapter -- --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored; no skip. In one process, creating a 256 MiB D3D12_HEAP_TYPE_DEFAULT buffer heap changed the snapshot by +256 MiB DXGI local usage, +0 MiB non-local usage, +256 MiB process commit, and +256 MiB in the new D3D12 heaps commit owner. The sampled local budget was 11,316 MiB. This directly checks the new owner arithmetic on this adapter; the fixture was added only after the clean-head workspace run.

Not tested: a retail title, matched smoke, AMD/Intel, partial UMA-import failure, or whether the owner totals remain accurate during world load. No performance or memory-saving claim. AI use: Codex (GPT-6.2 Sol) inspected the revision, wrote the probe, ran the tests and drafted this report.

**@⁠thehollowedone** on GitHub · 2026-11-26 11:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/2697#issuecomment-7190306142) Independent Windows/NVIDIA check of [#2697 head `50cfb321`](https://github.com/xcl-dev/xcl/commit/50cfb321be8277482566d31f7a29f97c3f2ef4e7), based on [`main` `b49be183`](https://github.com/xcl-dev/xcl/commit/b49be1836844fe0b0cdb3211dce3cb7fb4e21ac7). This supersedes my earlier report on the amended `f7e4869` revision. **Clean head:** RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, rustc 1.99.1 MSVC, DXC 1.8.2502.11. `cargo build --offline --locked --workspace` passed. `cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4` passed: **1,437 passed, 0 failed, 47 ignored** across 37 test targets. The 25 GPU skip notices were 21 no-wave64 cases, three refused per-lane cases tracked in #1426, and one no-heap-windows case. The native `memory_report` test ran on the RTX 3080 Ti. **Separate bounded probe:** I added an uncommitted, test-only fixture to the same head and ran `cargo test --offline --locked -p xcl --lib probe_default_heap_charge_on_this_adapter -- --nocapture --test-threads=1`: **1 passed, 0 failed, 0 ignored; no skip**. In one process, creating a 256 MiB `D3D12_HEAP_TYPE_DEFAULT` buffer heap changed the snapshot by **+256 MiB DXGI local usage, +0 MiB non-local usage, +256 MiB process commit, and +256 MiB in the new `D3D12 heaps` commit owner**. The sampled local budget was 11,316 MiB. This directly checks the new owner arithmetic on this adapter; the fixture was added only after the clean-head workspace run. **Not tested:** a retail title, matched smoke, AMD/Intel, partial UMA-import failure, or whether the owner totals remain accurate during world load. No performance or memory-saving claim. AI use: Codex (GPT-6.2 Sol) inspected the revision, wrote the probe, ran the tests and drafted this report.
Author
Owner

@⁠throny on GitHub · 2026-11-26 12:01 UTC · original

A 16 GB NVIDIA table from this PR, in the world, on nvidia-dev.

Tested

  • RTX 4080 16 GB (driver 621.40), i9-12900K, 64 GB RAM, Windows 11 26300, release.
  • This PR's diff at 50cfb32 ported onto nvidia-dev af2cecc4 + #684: real.rs, title_textures.rs and the new file apply as they are; three hunks placed by hand (mod.rs: the module line; sparse.rs: State::committed_bytes(); host.rs: the line inside the XCL_ACTIVITY block). Every counter the report reads exists on that branch. cargo check -p xcl and a release build: clean.
  • One run of the retail title of #505 into the world (246 s, ended by a device removal that the other runs of this card have too): 113 memory by owner lines.

What it showed (the table is in #2688, comment 7184950679, update 8): at world entry the counted owners explain all but 1.1 GB of 15.0 GB of video memory; 50 s later "other" is 3.7 GB of 18.0 GB. So on a card this size the unattributed share is what grows once the world draws, and a row for the two-pass buffers and one for the driver's pipeline memory would be the next most useful.

Not tested

  • The PR's head on main, its two unit tests, the suite, AMD. This is a run of the ported diff on the work branch.

AI use: Claude Code (Claude Sonnet 5.5 ported the diff, Claude Fable 5.2 ran it and wrote this).

**@⁠throny** on GitHub · 2026-11-26 12:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/2697#issuecomment-7191467177) **A 16 GB NVIDIA table from this PR, in the world, on `nvidia-dev`.** **Tested** - RTX 4080 16 GB (driver 621.40), i9-12900K, 64 GB RAM, Windows 11 26300, release. - This PR's diff at `50cfb32` ported onto `nvidia-dev` `af2cecc4` + #684: `real.rs`, `title_textures.rs` and the new file apply as they are; three hunks placed by hand (`mod.rs`: the module line; `sparse.rs`: `State::committed_bytes()`; `host.rs`: the line inside the `XCL_ACTIVITY` block). Every counter the report reads exists on that branch. `cargo check -p xcl` and a release build: clean. - One run of the retail title of #505 into the world (246 s, ended by a device removal that the other runs of this card have too): 113 `memory by owner` lines. **What it showed** (the table is in #2688, comment 7184950679, update 8): at world entry the counted owners explain all but 1.1 GB of 15.0 GB of video memory; 50 s later "other" is 3.7 GB of 18.0 GB. So on a card this size the unattributed share is what grows once the world draws, and a row for the two-pass buffers and one for the driver's pipeline memory would be the next most useful. **Not tested** - The PR's head on `main`, its two unit tests, the suite, AMD. This is a run of the ported diff on the work branch. AI use: Claude Code (Claude Sonnet 5.5 ported the diff, Claude Fable 5.2 ran it and wrote this).
This pull request can be merged automatically.
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/2697/head:github-bot/gh-2697'
git switch 'github-bot/gh-2697'

Merge

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