d3d12: keep GPU-written placed textures on the GPU until title memory is looked at (#300, draft) #413

Closed
NickStallman wants to merge 7 commits from upstream-pr/413 into main
NickStallman commented 2026-11-28 20:57:37 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-28T20:57:37Z.


Draft, off by default (TUXBOX_GPU_OWNED=1 turns it on; it was on unless 0 before). Rebuilt on current main (28717263). The write watch went in as #430; what's left is ownership, 7 commits. Earlier comments on this PR describe the old version.

What it does

A placed texture the GPU wrote stays on the GPU, with its title pages closed to the CPU, until something reads or writes its memory. Nothing is read back until then.

What changed since the last version

  • Textures that share a 64 KiB page but no bytes can be owned. The provider refreshes and publishes the neighbours around the closed page.
  • Textures over imported pages can be owned where no imported buffer covers their bytes, compared by physical page, and only where a probe shows the GPU still uses an import whose page is closed. Hosts that take imports again at each submit (RADV) are never probed and copy back as before.
  • A look no longer holds the texture's lock while it waits for the GPU. Before, it could wait on a worker that needed that lock, give up after 10 s and open stale memory. Found by reading; its test needs a device and hasn't run.
  • The submit profile splits copied-back textures by reason, with MiB, so refused-* and shared can be compared with what's really copied back.

Still copied back

Textures with bytes in common with another placed texture or under an imported buffer, plain XMem allocations, arena pages, unmapped mips, NV12, and textures looked at four times. Each new import on a page is a look, which may keep engagement low.

Relies on

GPU reads through an imported buffer staying inside its declared width, as gpu_writes already does. That may not hold for raw root addresses: in ProjectScarlett we're investigating GPU faults on reads just past a root SRV's mapped window, with no cause established. If such reads are real, a read past an import would see stale texels of an owned page here.

Known gaps

A title's own ReadFile or VirtualProtect on closed pages. A queue the title gates with its own CPU fence: 10 s, then stale memory, logged.

Expected benefit: unknown

Runs of the earlier version by four people showed owned=0, or next to it. This version hasn't been run in the game. The counters that decide it, with the switch on and off on one build:

  • owned-mib and beside up, eager-mib down by about as much, timed-out 0.
  • shared-mib, refused-held-mib, refused-imported-mib, refused-foreign-mib: if most bytes stay there, close this.

Most readback in a world window we logged was of mips that hadn't changed (about 90% of published MiB), so narrowing what counts as written may matter more than ownership. Which pipelines still count the whole heap isn't established yet.

Tested

  • python tuxbox.py check --no-gpu: all steps passed.
  • 38 XMem unit tests and the device-free D3D12 tests that cover the change, in Wine without Vulkan. The new guard tests fail under each of 5 mutations tried.
  • Not run: the D3D12 device tests, the probe, Lanes (two new scenarios: gpu-owned-beside, gpu-owned-import), the full check on AMD and NVIDIA, the game. Not run on Windows.

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:issue:5544505937 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/413). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-28T20:57:37Z. --- **Draft, off by default (`TUXBOX_GPU_OWNED=1` turns it on; it was on unless `0` before).** Rebuilt on current `main` (28717263). The write watch went in as #430; what's left is ownership, 7 commits. Earlier comments on this PR describe the old version. ## What it does A placed texture the GPU wrote stays on the GPU, with its title pages closed to the CPU, until something reads or writes its memory. Nothing is read back until then. ## What changed since the last version - **Textures that share a 64 KiB page but no bytes can be owned.** The provider refreshes and publishes the neighbours around the closed page. - **Textures over imported pages can be owned where no imported buffer covers their bytes,** compared by physical page, and only where a probe shows the GPU still uses an import whose page is closed. Hosts that take imports again at each submit (RADV) are never probed and copy back as before. - **A look no longer holds the texture's lock while it waits for the GPU.** Before, it could wait on a worker that needed that lock, give up after 10 s and open stale memory. Found by reading; its test needs a device and hasn't run. - **The submit profile splits copied-back textures by reason, with MiB,** so `refused-*` and `shared` can be compared with what's really copied back. ## Still copied back Textures with bytes in common with another placed texture or under an imported buffer, plain XMem allocations, arena pages, unmapped mips, NV12, and textures looked at four times. Each new import on a page is a look, which may keep engagement low. ## Relies on GPU reads through an imported buffer staying inside its declared width, as `gpu_writes` already does. **That may not hold for raw root addresses:** in ProjectScarlett we're investigating GPU faults on reads just past a root SRV's mapped window, with no cause established. If such reads are real, a read past an import would see stale texels of an owned page here. ## Known gaps A title's own `ReadFile` or `VirtualProtect` on closed pages. A queue the title gates with its own CPU fence: 10 s, then stale memory, logged. ## Expected benefit: unknown Runs of the earlier version by four people showed `owned=0`, or next to it. This version hasn't been run in the game. The counters that decide it, with the switch on and off on one build: - `owned-mib` and `beside` up, `eager-mib` down by about as much, `timed-out` 0. - `shared-mib`, `refused-held-mib`, `refused-imported-mib`, `refused-foreign-mib`: if most bytes stay there, close this. Most readback in a world window we logged was of mips that hadn't changed (about 90% of published MiB), so narrowing what counts as written may matter more than ownership. Which pipelines still count the whole heap isn't established yet. ## Tested - `python tuxbox.py check --no-gpu`: all steps passed. - 38 XMem unit tests and the device-free D3D12 tests that cover the change, in Wine without Vulkan. The new guard tests fail under each of 5 mutations tried. - **Not run:** the D3D12 device tests, the probe, Lanes (two new scenarios: `gpu-owned-beside`, `gpu-owned-import`), the full check on AMD and NVIDIA, the game. Not run on Windows. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
DrArroway commented 2026-11-28 22:48:50 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-28T22:48:50Z.


Tested draft #413 (aef121f) in ProjectScarlett (1.0.2.1, 3840×2160, offline) on AMD Radeon RX 6900 XT (1002:73bf, RADV NAVI21, Mesa 26.3.1, Linux 7.3.6, GE-Proton11-14), merged cleanly on top of main (b8355fa) + #424 + local BLAS lifetime fixes + #389 + #390 + #408.

Results (2 runs: 354.6s unprofiled, 481.9s with TUXBOX_SUBMIT_PROFILE=1)

  • ~2× faster 3D world frames from write watch:
    • Before #413: 1 frame every 13–16 s (~14.5 s/frame), 8 frames before stall watchdog.
    • With #413: 2 frames every 13–14 s unprofiled (13 consecutive 3D frames) and 2 frames every 16–20 s with TUXBOX_SUBMIT_PROFILE=1 (25 consecutive 3D frames).
    • Write watch skipped digesting ~142 GiB per window (placement watch: unwritten=492542/141880.4MiB), bringing placement digest down to 94.8 ms and placement waits to 9.4 ms.
  • No regressions from GPU ownership itself: faulted=0, timed-out=0, raced=0 in steady state; 8 small textures (160×90, 256×256, 8×8, 1×1) hit the 4-touch fallback cleanly.
  • Why the 939 MiB / 504-texture readback still dominates (7.4 s / 8.9 s window, 83.5% of frame time):
    Almost every big render-target/UAV texture stayed on eager readback (owned=0 in steady state):
submit profile 8.9s placement readback: 10x/152.231ms/max67.837ms units=2088 3784.9MiB/max925.2MiB
submit profile 8.9s placement publication: 10x/7434.357ms/max2218.998ms 3847.7MiB
submit profile 8.9s placement own: 18x/143.345ms/max121.744ms units=0 0.0MiB/max0.0MiB
submit profile placement owned: owned=0 owned-mib=0.0 kept=146 faulted=0 acquired=0 settled=0 published-mib=0.0 published-ms=0.000 raced=0 timed-out=0
submit profile placement copied back: eager=2088 eager-mib=3847.2 held=146 shared=1129 struck=34 refused=779 refused-mib=1909.5 refused-unmapped=0 refused-section=0 refused-held=457 refused-foreign=96

Steady-state 5 s windows showed the exact same split:

  • shared=852–1129 (~54% of eager textures share a 64 KiB page with another placed texture, e.g. aliased/transient targets in the render-target pool).
  • refused=592–779 (1,445–1,910 MiB, ~50% of all readback bytes):
    • refused-held=348–457 (pages under an XMem host import hold)
    • refused-foreign=73–96 (non-XMem memory)
    • 171–226 uncategorized (XMem guard codes 4/5/7/8 — REFUSED_OWN, REFUSED_NO_VIEW, REFUSED_FAILED, REFUSED_GUARDED — aren't tallied separately in ownership.rs:470)
    • refused-unmapped=0, refused-section=0
  • held=110–146 (all dropped cleanly via kept=108–146), struck=26–34.

Hope these RADV numbers help when iterating on #413 (and splitting out the write watch, which is already a huge standalone win!).

<!-- greyfinch-sync:brcly/TuxBox:comment:7247001155 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/413#issuecomment-7247001155). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-11-28T22:48:50Z. --- Tested draft `#413` (`aef121f`) in ProjectScarlett (1.0.2.1, 3840×2160, offline) on AMD Radeon RX 6900 XT (`1002:73bf`, RADV NAVI21, Mesa 26.3.1, Linux 7.3.6, `GE-Proton11-14`), merged cleanly on top of `main` (`b8355fa`) + `#424` + local BLAS lifetime fixes + `#389` + `#390` + `#408`. ### Results (2 runs: `354.6s` unprofiled, `481.9s` with `TUXBOX_SUBMIT_PROFILE=1`) - **~2× faster 3D world frames from write watch:** - Before `#413`: 1 frame every 13–16 s (~14.5 s/frame), 8 frames before stall watchdog. - With `#413`: 2 frames every 13–14 s unprofiled (13 consecutive 3D frames) and 2 frames every 16–20 s with `TUXBOX_SUBMIT_PROFILE=1` (25 consecutive 3D frames). - Write watch skipped digesting ~142 GiB per window (`placement watch: unwritten=492542/141880.4MiB`), bringing `placement digest` down to `94.8 ms` and `placement waits` to `9.4 ms`. - **No regressions from GPU ownership itself:** `faulted=0`, `timed-out=0`, `raced=0` in steady state; 8 small textures (`160×90`, `256×256`, `8×8`, `1×1`) hit the 4-touch fallback cleanly. - **Why the 939 MiB / 504-texture readback still dominates (`7.4 s` / `8.9 s` window, 83.5% of frame time):** Almost every big render-target/UAV texture stayed on eager readback (`owned=0` in steady state): ```text submit profile 8.9s placement readback: 10x/152.231ms/max67.837ms units=2088 3784.9MiB/max925.2MiB submit profile 8.9s placement publication: 10x/7434.357ms/max2218.998ms 3847.7MiB submit profile 8.9s placement own: 18x/143.345ms/max121.744ms units=0 0.0MiB/max0.0MiB submit profile placement owned: owned=0 owned-mib=0.0 kept=146 faulted=0 acquired=0 settled=0 published-mib=0.0 published-ms=0.000 raced=0 timed-out=0 submit profile placement copied back: eager=2088 eager-mib=3847.2 held=146 shared=1129 struck=34 refused=779 refused-mib=1909.5 refused-unmapped=0 refused-section=0 refused-held=457 refused-foreign=96 ``` Steady-state 5 s windows showed the exact same split: - `shared=852–1129` (~54% of eager textures share a 64 KiB page with another placed texture, e.g. aliased/transient targets in the render-target pool). - `refused=592–779` (`1,445–1,910 MiB`, ~50% of all readback bytes): - `refused-held=348–457` (pages under an XMem host import hold) - `refused-foreign=73–96` (non-XMem memory) - `171–226` uncategorized (XMem guard codes `4`/`5`/`7`/`8` — `REFUSED_OWN`, `REFUSED_NO_VIEW`, `REFUSED_FAILED`, `REFUSED_GUARDED` — aren't tallied separately in `ownership.rs:470`) - `refused-unmapped=0`, `refused-section=0` - `held=110–146` (all dropped cleanly via `kept=108–146`), `struck=26–34`. Hope these RADV numbers help when iterating on `#413` (and splitting out the write watch, which is already a huge standalone win!).
NickStallman commented 2026-11-28 22:50:02 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-28T22:50:02Z.


@DrArroway, thank you: this is the first measurement of it in the game, and the copied back split is the useful part. I've put a summary in the description, marked as your numbers.

What I take from it:

  • The write watch carries the gain you saw, so I'll split it out as its own PR first, since it's useful without ownership.
  • Ownership needs a wider reach before it can matter. On your run, most eager textures share a 64 KiB page with another placed texture, or sit under an XMem host import hold. Those are exactly the cases the current code refuses on purpose, so owned=0 in steady state is the expected outcome, not noise.
  • The uncategorised refusals (the guard codes not tallied separately) are a gap in the accounting. I'll make each one its own counter.

I'm treating these as the two design questions for ownership: whether a page-sharing group of transient targets can be owned as a group, and whether an import hold on a title-memory page can be read without giving up the guard. I don't have an answer to either yet, and I haven't run this in the game myself.

On your side: if you can keep one log with TUXBOX_SUBMIT_PROFILE=1 from a steady window, I'd use it to pick the first case to fix.

<!-- greyfinch-sync:brcly/TuxBox:comment:7247014557 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/413#issuecomment-7247014557). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-28T22:50:02Z. --- @DrArroway, thank you: this is the first measurement of it in the game, and the `copied back` split is the useful part. I've put a summary in the description, marked as your numbers. What I take from it: - **The write watch carries the gain you saw,** so I'll split it out as its own PR first, since it's useful without ownership. - **Ownership needs a wider reach before it can matter.** On your run, most eager textures share a 64 KiB page with another placed texture, or sit under an XMem host import hold. Those are exactly the cases the current code refuses on purpose, so `owned=0` in steady state is the expected outcome, not noise. - **The uncategorised refusals** (the guard codes not tallied separately) are a gap in the accounting. I'll make each one its own counter. I'm treating these as the two design questions for ownership: whether a page-sharing group of transient targets can be owned as a group, and whether an import hold on a title-memory page can be read without giving up the guard. I don't have an answer to either yet, and I haven't run this in the game myself. On your side: if you can keep one log with `TUXBOX_SUBMIT_PROFILE=1` from a steady window, I'd use it to pick the first case to fix.
DrArroway commented 2026-11-28 22:56:18 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-28T22:56:18Z.


Here is one complete steady-state 3D-world window (frame 3944, ~15 frames into the world) from that TUXBOX_SUBMIT_PROFILE=1 run — including the matching placed texture readback top 1..8, ledgers, and xmem backing stats (the full persistent log is also saved locally if you need another window later):

TuxBox d3d12_xs: presented 2 frames in 18s, 3944 in total, token=3944
TuxBox xmem: backing stats pages=114096 (7131 MiB) holds=11680 view_holds=23892 (1493 MiB) arena_holds=5 live_arenas=2045 (820 MiB) deferred=107
TuxBox d3d12_xs: placed texture readback 5.1s: batches=12 textures=508 copied=3849.9MiB largest=939.3MiB/504 textures | mips changed=106 (109.4MiB) unchanged=813 (1366.9MiB, 288 written again) unmapped=279 | buffers created=9 (4158.0MiB) reused=3
TuxBox d3d12_xs: placed texture readback top 1: 0x164c7d000 2560x1440x1 format=10 layout=0x102 flags=0x300004 mips=1 subresources=1 readbacks=4 copied=112.5MiB unchanged=0/0 mips (0.0MiB) unmapped=0 sources=heap-uav queues=direct
TuxBox d3d12_xs: placed texture readback top 2: 0x10ca590000 2560x1440x1 format=10 layout=0x102 flags=0x300004 mips=1 subresources=1 readbacks=4 copied=112.5MiB unchanged=1/1 mips (28.1MiB) unmapped=0 sources=heap-uav queues=direct
TuxBox d3d12_xs: placed texture readback top 3: 0x10c8940000 2560x1440x1 format=10 layout=0x102 flags=0x300004 mips=1 subresources=1 readbacks=4 copied=112.5MiB unchanged=1/1 mips (28.1MiB) unmapped=0 sources=heap-uav queues=direct
TuxBox d3d12_xs: placed texture readback top 4: 0x16689d000 2560x1440x1 format=10 layout=0x102 flags=0x300004 mips=1 subresources=1 readbacks=4 copied=112.5MiB unchanged=0/0 mips (0.0MiB) unmapped=0 sources=heap-uav queues=direct
TuxBox d3d12_xs: placed texture readback top 5: 0x10cd030000 2560x1440x1 format=10 layout=0x102 flags=0x300004 mips=1 subresources=1 readbacks=4 copied=112.5MiB unchanged=1/1 mips (28.1MiB) unmapped=0 sources=heap-uav queues=direct
TuxBox d3d12_xs: placed texture readback top 6: 0x108d6c0000 2048x2048x1 format=42 layout=0x102 flags=0x300004 mips=1 subresources=1 readbacks=5 copied=80.0MiB unchanged=1/1 mips (16.0MiB) unmapped=0 sources=heap-uav queues=direct+compute
TuxBox d3d12_xs: placed texture readback top 7: 0x1158860000 2560x1440x1 format=26 layout=0x102 flags=0x300004 mips=6 subresources=6 readbacks=4 copied=75.1MiB unchanged=5/6 mips (18.7MiB) unmapped=1 sources=heap-uav queues=direct
TuxBox d3d12_xs: placed texture readback top 8: 0x114bb40000 2560x1440x1 format=41 layout=0x102 flags=0x300004 mips=1 subresources=1 readbacks=5 copied=70.3MiB unchanged=1/2 mips (14.1MiB) unmapped=0 sources=heap-uav queues=direct+compute
TuxBox d3d12_xs: memory ledger: card 13932/14638 MiB, adapter system memory 9123/31168 MiB, upload staging 0 MiB, title pages 7131 MiB, process commit 15769 MiB
TuxBox d3d12_xs: texture ledger: unbacked 892 (286 MiB), card 24885 (7349 MiB) (title ranges 7877 MiB, 5914 MiB distinct), system 5019 (1327 MiB), committed 3186 (2 MiB)
TuxBox d3d12_xs: overlap ledger: cast 11 (1 MiB), reinterpreted 54 (187 MiB), subset 0 (0 MiB), other at address 20 (2 MiB), inside 13237 (1084 MiB)
TuxBox d3d12_xs: overlap formats: 42/67 187 MiB, 41/41 0 MiB, 72/71 0 MiB, 71/72 0 MiB, 98/78 0 MiB
TuxBox d3d12_xs: mip ledger: images missing large mips 7668 (2449 MiB)
TuxBox d3d12_xs: submit profile 9.3s direct: lists=198 batch=11x/647.454ms/max129.281ms lock=11x/0.001ms/max0.000ms pin=198x/2.242ms/max0.486ms placement=11x/588.484ms/max121.973ms host=11x/0.185ms/max0.049ms commit=10x/1.935ms/max0.964ms gap=11x/8650.304ms/max7494.971ms fence=11x/0.057ms
TuxBox d3d12_xs: submit profile 9.3s compute: lists=13 batch=13x/1129.897ms/max333.805ms lock=13x/0.002ms/max0.000ms pin=13x/0.125ms/max0.047ms placement=13x/1012.383ms/max325.698ms host=13x/31.911ms/max31.752ms commit=12x/0.438ms/max0.175ms gap=13x/7855.922ms/max7716.469ms fence=13x/0.079ms
TuxBox d3d12_xs: submit profile 9.3s placement gather: 24x/69.602ms/max4.760ms units=652549 188506.8MiB/max9425.5MiB
TuxBox d3d12_xs: submit profile 9.3s placement pending: 22x/15.289ms/max1.077ms units=641349 166609.6MiB/max8330.8MiB
TuxBox d3d12_xs: submit profile 9.3s placement resolve: 35x/134.394ms/max63.492ms units=105480 0.0MiB/max0.0MiB
TuxBox d3d12_xs: submit profile 9.3s placement read: 35x/15.886ms/max13.776ms units=4981 133.1MiB/max127.6MiB
TuxBox d3d12_xs: submit profile 9.3s placement digest: 35x/159.585ms/max27.148ms units=288724 1927.0MiB/max376.5MiB
TuxBox d3d12_xs: submit profile 9.3s placement upload: 2x/53.284ms/max53.125ms units=3710 126.2MiB/max126.0MiB
TuxBox d3d12_xs: submit profile 9.3s placement detile: 2x/18.168ms/max18.121ms units=3710 127.1MiB/max126.9MiB
TuxBox d3d12_xs: submit profile 9.3s placement waits: 22x/9.383ms/max0.591ms units=31 0.0MiB/max0.0MiB
TuxBox d3d12_xs: submit profile 9.3s placement readback: 12x/171.539ms/max80.842ms units=2089 3786.5MiB/max925.2MiB
TuxBox d3d12_xs: submit profile 9.3s placement flush: 16x/127.193ms/max117.648ms units=16 0.0MiB/max0.0MiB
TuxBox d3d12_xs: submit profile 9.3s placement scan: 29x/463.105ms/max76.570ms units=139684 0.0MiB/max0.0MiB
TuxBox d3d12_xs: submit profile 9.3s placement readers: 22x/90.319ms/max5.174ms units=652549 0.0MiB/max0.0MiB
TuxBox d3d12_xs: submit profile 9.3s placement own: 22x/40.110ms/max37.065ms units=0 0.0MiB/max0.0MiB
TuxBox d3d12_xs: submit profile 9.3s placement reads: in-place=284023/1793.9MiB not-xmem=991/6.0MiB refused=280/15.2MiB faulted=0/0.0MiB planes=105480/12141.7MiB mips=332103/12107.4MiB
TuxBox d3d12_xs: submit profile 9.3s placement unread: unmapped=1982/617.6MiB refused=0/0.0MiB noaccess=0/0.0MiB uncommitted=0/0.0MiB other=0/0.0MiB
TuxBox d3d12_xs: submit profile 9.3s placement backing: private=7061/1303.1MiB arena=150/22.9MiB section=0/0.0MiB unbacked=253/107.5MiB unmapped=807/262.2MiB held=5097/435.1MiB not-xmem=73/1.6MiB
TuxBox d3d12_xs: submit profile 9.3s placement watch: unwritten=535884/153583.5MiB written=2268/449.3MiB noted=1074/453.1MiB held=101885/10953.2MiB section=0/0.0MiB unmapped=0/0.0MiB unbacked=253/251.8MiB unwatched=0/0.0MiB held-unwritten=0/0.0MiB gpu-written=0/0.0MiB
TuxBox d3d12_xs: submit profile 9.3s placement publication: 12x/7575.744ms/max2092.665ms 3840.7MiB
TuxBox d3d12_xs: submit profile placement owned: owned=0 owned-mib=0.0 kept=146 faulted=0 acquired=0 settled=0 published-mib=0.0 published-ms=0.000 raced=0 timed-out=0
TuxBox d3d12_xs: submit profile placement copied back: eager=2089 eager-mib=3849.9 held=146 shared=1127 struck=34 refused=782 refused-mib=1913.7 refused-unmapped=0 refused-section=0 refused-held=460 refused-foreign=96
<!-- greyfinch-sync:brcly/TuxBox:comment:7247085647 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/413#issuecomment-7247085647). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-11-28T22:56:18Z. --- Here is one complete steady-state 3D-world window (frame `3944`, ~15 frames into the world) from that `TUXBOX_SUBMIT_PROFILE=1` run — including the matching `placed texture readback top 1..8`, ledgers, and `xmem` backing stats (the full persistent log is also saved locally if you need another window later): ```text TuxBox d3d12_xs: presented 2 frames in 18s, 3944 in total, token=3944 TuxBox xmem: backing stats pages=114096 (7131 MiB) holds=11680 view_holds=23892 (1493 MiB) arena_holds=5 live_arenas=2045 (820 MiB) deferred=107 TuxBox d3d12_xs: placed texture readback 5.1s: batches=12 textures=508 copied=3849.9MiB largest=939.3MiB/504 textures | mips changed=106 (109.4MiB) unchanged=813 (1366.9MiB, 288 written again) unmapped=279 | buffers created=9 (4158.0MiB) reused=3 TuxBox d3d12_xs: placed texture readback top 1: 0x164c7d000 2560x1440x1 format=10 layout=0x102 flags=0x300004 mips=1 subresources=1 readbacks=4 copied=112.5MiB unchanged=0/0 mips (0.0MiB) unmapped=0 sources=heap-uav queues=direct TuxBox d3d12_xs: placed texture readback top 2: 0x10ca590000 2560x1440x1 format=10 layout=0x102 flags=0x300004 mips=1 subresources=1 readbacks=4 copied=112.5MiB unchanged=1/1 mips (28.1MiB) unmapped=0 sources=heap-uav queues=direct TuxBox d3d12_xs: placed texture readback top 3: 0x10c8940000 2560x1440x1 format=10 layout=0x102 flags=0x300004 mips=1 subresources=1 readbacks=4 copied=112.5MiB unchanged=1/1 mips (28.1MiB) unmapped=0 sources=heap-uav queues=direct TuxBox d3d12_xs: placed texture readback top 4: 0x16689d000 2560x1440x1 format=10 layout=0x102 flags=0x300004 mips=1 subresources=1 readbacks=4 copied=112.5MiB unchanged=0/0 mips (0.0MiB) unmapped=0 sources=heap-uav queues=direct TuxBox d3d12_xs: placed texture readback top 5: 0x10cd030000 2560x1440x1 format=10 layout=0x102 flags=0x300004 mips=1 subresources=1 readbacks=4 copied=112.5MiB unchanged=1/1 mips (28.1MiB) unmapped=0 sources=heap-uav queues=direct TuxBox d3d12_xs: placed texture readback top 6: 0x108d6c0000 2048x2048x1 format=42 layout=0x102 flags=0x300004 mips=1 subresources=1 readbacks=5 copied=80.0MiB unchanged=1/1 mips (16.0MiB) unmapped=0 sources=heap-uav queues=direct+compute TuxBox d3d12_xs: placed texture readback top 7: 0x1158860000 2560x1440x1 format=26 layout=0x102 flags=0x300004 mips=6 subresources=6 readbacks=4 copied=75.1MiB unchanged=5/6 mips (18.7MiB) unmapped=1 sources=heap-uav queues=direct TuxBox d3d12_xs: placed texture readback top 8: 0x114bb40000 2560x1440x1 format=41 layout=0x102 flags=0x300004 mips=1 subresources=1 readbacks=5 copied=70.3MiB unchanged=1/2 mips (14.1MiB) unmapped=0 sources=heap-uav queues=direct+compute TuxBox d3d12_xs: memory ledger: card 13932/14638 MiB, adapter system memory 9123/31168 MiB, upload staging 0 MiB, title pages 7131 MiB, process commit 15769 MiB TuxBox d3d12_xs: texture ledger: unbacked 892 (286 MiB), card 24885 (7349 MiB) (title ranges 7877 MiB, 5914 MiB distinct), system 5019 (1327 MiB), committed 3186 (2 MiB) TuxBox d3d12_xs: overlap ledger: cast 11 (1 MiB), reinterpreted 54 (187 MiB), subset 0 (0 MiB), other at address 20 (2 MiB), inside 13237 (1084 MiB) TuxBox d3d12_xs: overlap formats: 42/67 187 MiB, 41/41 0 MiB, 72/71 0 MiB, 71/72 0 MiB, 98/78 0 MiB TuxBox d3d12_xs: mip ledger: images missing large mips 7668 (2449 MiB) TuxBox d3d12_xs: submit profile 9.3s direct: lists=198 batch=11x/647.454ms/max129.281ms lock=11x/0.001ms/max0.000ms pin=198x/2.242ms/max0.486ms placement=11x/588.484ms/max121.973ms host=11x/0.185ms/max0.049ms commit=10x/1.935ms/max0.964ms gap=11x/8650.304ms/max7494.971ms fence=11x/0.057ms TuxBox d3d12_xs: submit profile 9.3s compute: lists=13 batch=13x/1129.897ms/max333.805ms lock=13x/0.002ms/max0.000ms pin=13x/0.125ms/max0.047ms placement=13x/1012.383ms/max325.698ms host=13x/31.911ms/max31.752ms commit=12x/0.438ms/max0.175ms gap=13x/7855.922ms/max7716.469ms fence=13x/0.079ms TuxBox d3d12_xs: submit profile 9.3s placement gather: 24x/69.602ms/max4.760ms units=652549 188506.8MiB/max9425.5MiB TuxBox d3d12_xs: submit profile 9.3s placement pending: 22x/15.289ms/max1.077ms units=641349 166609.6MiB/max8330.8MiB TuxBox d3d12_xs: submit profile 9.3s placement resolve: 35x/134.394ms/max63.492ms units=105480 0.0MiB/max0.0MiB TuxBox d3d12_xs: submit profile 9.3s placement read: 35x/15.886ms/max13.776ms units=4981 133.1MiB/max127.6MiB TuxBox d3d12_xs: submit profile 9.3s placement digest: 35x/159.585ms/max27.148ms units=288724 1927.0MiB/max376.5MiB TuxBox d3d12_xs: submit profile 9.3s placement upload: 2x/53.284ms/max53.125ms units=3710 126.2MiB/max126.0MiB TuxBox d3d12_xs: submit profile 9.3s placement detile: 2x/18.168ms/max18.121ms units=3710 127.1MiB/max126.9MiB TuxBox d3d12_xs: submit profile 9.3s placement waits: 22x/9.383ms/max0.591ms units=31 0.0MiB/max0.0MiB TuxBox d3d12_xs: submit profile 9.3s placement readback: 12x/171.539ms/max80.842ms units=2089 3786.5MiB/max925.2MiB TuxBox d3d12_xs: submit profile 9.3s placement flush: 16x/127.193ms/max117.648ms units=16 0.0MiB/max0.0MiB TuxBox d3d12_xs: submit profile 9.3s placement scan: 29x/463.105ms/max76.570ms units=139684 0.0MiB/max0.0MiB TuxBox d3d12_xs: submit profile 9.3s placement readers: 22x/90.319ms/max5.174ms units=652549 0.0MiB/max0.0MiB TuxBox d3d12_xs: submit profile 9.3s placement own: 22x/40.110ms/max37.065ms units=0 0.0MiB/max0.0MiB TuxBox d3d12_xs: submit profile 9.3s placement reads: in-place=284023/1793.9MiB not-xmem=991/6.0MiB refused=280/15.2MiB faulted=0/0.0MiB planes=105480/12141.7MiB mips=332103/12107.4MiB TuxBox d3d12_xs: submit profile 9.3s placement unread: unmapped=1982/617.6MiB refused=0/0.0MiB noaccess=0/0.0MiB uncommitted=0/0.0MiB other=0/0.0MiB TuxBox d3d12_xs: submit profile 9.3s placement backing: private=7061/1303.1MiB arena=150/22.9MiB section=0/0.0MiB unbacked=253/107.5MiB unmapped=807/262.2MiB held=5097/435.1MiB not-xmem=73/1.6MiB TuxBox d3d12_xs: submit profile 9.3s placement watch: unwritten=535884/153583.5MiB written=2268/449.3MiB noted=1074/453.1MiB held=101885/10953.2MiB section=0/0.0MiB unmapped=0/0.0MiB unbacked=253/251.8MiB unwatched=0/0.0MiB held-unwritten=0/0.0MiB gpu-written=0/0.0MiB TuxBox d3d12_xs: submit profile 9.3s placement publication: 12x/7575.744ms/max2092.665ms 3840.7MiB TuxBox d3d12_xs: submit profile placement owned: owned=0 owned-mib=0.0 kept=146 faulted=0 acquired=0 settled=0 published-mib=0.0 published-ms=0.000 raced=0 timed-out=0 TuxBox d3d12_xs: submit profile placement copied back: eager=2089 eager-mib=3849.9 held=146 shared=1127 struck=34 refused=782 refused-mib=1913.7 refused-unmapped=0 refused-section=0 refused-held=460 refused-foreign=96 ```
1093i3511 commented 2026-11-28 23:04:28 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-11-28T23:04:28Z.


A second AMD data point, on a smaller card. I merged this draft (aef121f) locally onto #409 at ce620c7 with no conflicts, so without #408, #389, #390 or #424. I ran it twice, with TUXBOX_GPU_OWNED on and off, and compared with my run of ce620c7 alone. My results match DrArroway's split: ownership doesn't change anything here, and the gain comes from the write watch.

Setup: RX 6600 (1002:73ff, RDNA2, 8 GB), 32 GB RAM + 34 GB swap, Mesa RADV 26.3.1, Linux 7.3.6, GE-Proton11-14, default settings, warm caches. lanes-selftest passes 28 of 28, including the new GPU-written texture cases. No GPU fault or reset in any of the three runs.

ce620c7 + #413 + #413, TUXBOX_GPU_OWNED=0
readback before the world 2,489 MiB 1,001 MiB 924 MiB
first world frame after the burst 22–28 s 12 s 14 s
world frames before the watchdog 13 6 6
peak resident GTT 15.9 GB 15.3 GB 16.0 GB
run length (watchdog, exit 5) 540 s 447 s 422 s
kernel nothing nothing 6× Not enough memory for command submission!
  • The readback before the world drops by 60% with ownership off too, and the world frames are faster in both #413 runs. That fits the write watch carrying the gain. With so few world frames per run, the frame times are a small sample.
  • In the world the same 504 textures are read back either way: 1–2.9 GB per window. The largest are 2560x1440 targets with one mip, unmapped=0, sources=heap-uav. That matches the shared and refused-held cases in DrArroway's split. Two 160x90 textures hit the 4-touch fallback.
  • On 8 GB, GTT is what ends the runs. In both #413 runs it rose by about 6 GB within the first 50 s in the world, to 15.3–16.0 GB on a 16 GB limit. I suspect that's why the runs end sooner than the one without #413, but I haven't shown it. With ownership off, the kernel refused command submissions at the end. So once the 504-texture readbacks are gone, this card should benefit the most.

If it's useful, I can do a run with TUXBOX_SUBMIT_PROFILE=1 to get the copied back split on an 8 GB card, and run the write watch PR alone once it's split out.

<!-- greyfinch-sync:brcly/TuxBox:comment:7247180714 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/413#issuecomment-7247180714). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-11-28T23:04:28Z. --- A second AMD data point, on a smaller card. I merged this draft (aef121f) locally onto #409 at ce620c7 with no conflicts, so without #408, #389, #390 or #424. I ran it twice, with `TUXBOX_GPU_OWNED` on and off, and compared with my run of ce620c7 alone. My results match DrArroway's split: ownership doesn't change anything here, and the gain comes from the write watch. **Setup:** RX 6600 (`1002:73ff`, RDNA2, 8 GB), 32 GB RAM + 34 GB swap, Mesa RADV 26.3.1, Linux 7.3.6, GE-Proton11-14, default settings, warm caches. `lanes-selftest` passes 28 of 28, including the new GPU-written texture cases. No GPU fault or reset in any of the three runs. | | ce620c7 | + #413 | + #413, `TUXBOX_GPU_OWNED=0` | | --- | ---: | ---: | ---: | | readback before the world | 2,489 MiB | 1,001 MiB | 924 MiB | | first world frame after the burst | 22–28 s | 12 s | 14 s | | world frames before the watchdog | 13 | 6 | 6 | | peak resident GTT | 15.9 GB | 15.3 GB | 16.0 GB | | run length (watchdog, exit 5) | 540 s | 447 s | 422 s | | kernel | nothing | nothing | 6× `Not enough memory for command submission!` | - **The readback before the world drops by 60% with ownership off too**, and the world frames are faster in both #413 runs. That fits the write watch carrying the gain. With so few world frames per run, the frame times are a small sample. - **In the world the same 504 textures are read back either way:** 1–2.9 GB per window. The largest are 2560x1440 targets with one mip, `unmapped=0`, `sources=heap-uav`. That matches the `shared` and `refused-held` cases in DrArroway's split. Two 160x90 textures hit the 4-touch fallback. - **On 8 GB, GTT is what ends the runs.** In both #413 runs it rose by about 6 GB within the first 50 s in the world, to 15.3–16.0 GB on a 16 GB limit. I suspect that's why the runs end sooner than the one without #413, but I haven't shown it. With ownership off, the kernel refused command submissions at the end. So once the 504-texture readbacks are gone, this card should benefit the most. If it's useful, I can do a run with `TUXBOX_SUBMIT_PROFILE=1` to get the `copied back` split on an 8 GB card, and run the write watch PR alone once it's split out.
NickStallman commented 2026-11-28 23:19:35 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-28T23:19:35Z.


Thank you both, this is exactly what I needed, and it corrects one of my own numbers.

  • readers. @DrArroway, your window has 90 ms over 22 batches, about 4 ms per batch. Ours looked like 44–80 ms; that was a trace-enabled vkd3d-proton of ours, which makes every COM QueryInterface about 12 times slower. The last commit on this branch (d3770e9) removes those calls. I've corrected the description.
  • Where your frame goes. In that window the direct and compute queues spend 1.8 s of 9.3 s in batches, and the publication worker 7.6 s. So for now the limit is publication of the eager readbacks, not submission.
  • Ownership. Two machines now say the same thing: it doesn't change the readback, because the big targets share pages or sit under an import hold. I'll keep it behind its switch and split the write watch out as its own PR, which is what your numbers support.

@1093i3511, thank you for both runs. The GTT figure is the most useful part for me: with ownership off the kernel refused submissions, and ownership on didn't lower GTT. I'd take the TUXBOX_SUBMIT_PROFILE=1 run on 8 GB, and the write-watch PR alone once it's open. I'll also look at why GTT grows by 6 GB in the first 50 s: the write watch and held pages are the first suspects on our side, but I haven't checked.

<!-- greyfinch-sync:brcly/TuxBox:comment:7247354654 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/413#issuecomment-7247354654). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-28T23:19:35Z. --- Thank you both, this is exactly what I needed, and it corrects one of my own numbers. - **`readers`.** @DrArroway, your window has 90 ms over 22 batches, about 4 ms per batch. Ours looked like 44–80 ms; that was a trace-enabled vkd3d-proton of ours, which makes every COM `QueryInterface` about 12 times slower. The last commit on this branch (`d3770e9`) removes those calls. I've corrected the description. - **Where your frame goes.** In that window the direct and compute queues spend 1.8 s of 9.3 s in batches, and the publication worker 7.6 s. So for now the limit is publication of the eager readbacks, not submission. - **Ownership.** Two machines now say the same thing: it doesn't change the readback, because the big targets share pages or sit under an import hold. I'll keep it behind its switch and split the write watch out as its own PR, which is what your numbers support. @1093i3511, thank you for both runs. The GTT figure is the most useful part for me: with ownership off the kernel refused submissions, and ownership on didn't lower GTT. I'd take the `TUXBOX_SUBMIT_PROFILE=1` run on 8 GB, and the write-watch PR alone once it's open. I'll also look at why GTT grows by 6 GB in the first 50 s: the write watch and held pages are the first suspects on our side, but I haven't checked.
1093i3511 commented 2026-11-28 23:27:45 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-11-28T23:27:45Z.


@NickStallman, here's the TUXBOX_SUBMIT_PROFILE=1 run on the RX 6600 (8 GB) you asked for. It's the same build as my comment above: #409 at ce620c7 plus this draft at aef121f, so without d3770e9. Default settings. It ended after 415 s on the watchdog: mission at frame 1,122, crash at frame 1,128, so 6 world frames again. No fault, one Not enough memory for command submission! in the kernel log.

Where the 6 GB of GTT come from

On your question about the GTT growth: in this run it matches the readback buffers created in the first world windows, almost one to one.

placed texture readback 5.0s: batches=7 textures=505 copied=2914.6MiB | ... | buffers created=6 (3168.0MiB) reused=1
placed texture readback 7.2s: batches=11 textures=507 copied=1962.2MiB | ... | buffers created=8 (2137.1MiB) reused=3
placed texture readback 6.9s: batches=1 textures=504 copied=939.3MiB | ... | buffers created=1 (1024.0MiB) reused=0

That's 6.3 GB of new readback buffers in about 19 s, with 4 reuses. Over the same time the process's resident GTT (/proc/<pid>/fdinfo, sampled every 10 s) went:

time resident GTT requested GTT RAM swap
00:15:20 10.3 GB 10.3 GB 26.9 GB 5.7 GB
00:15:31 14.5 GB 14.5 GB 30.6 GB 7.9 GB
00:15:43 15.9 GB 16.6 GB 30.2 GB 10.1 GB
~00:16:00 watchdog

The card's GTT is 16 GB, so at 00:15:43 the process was asking for more than exists. That points at readback buffers that are created per window and kept rather than reused. The write watch's held count also moves a lot between windows (held=4798/327.9MiB up to held=108680/16712.8MiB), but I can't tell from here what it adds to GTT.

The split matches DrArroway's

Two steady windows in the world:

submit profile placement copied back: eager=1058 eager-mib=1962.1 held=82 shared=574 struck=0 refused=398 refused-mib=972.0 refused-unmapped=0 refused-section=0 refused-held=224 refused-foreign=50
submit profile placement copied back: eager=504 eager-mib=939.3 held=39 shared=271 struck=0 refused=192 refused-mib=466.4 refused-unmapped=0 refused-section=0 refused-held=112 refused-foreign=23
submit profile placement owned: owned=0 owned-mib=0.0 kept=0 faulted=0 acquired=0 settled=0 published-mib=0.0 published-ms=0.000 raced=2 timed-out=0

About 54% shared and about 50% of the bytes refused (mostly refused-held, some refused-foreign, and 57–124 that aren't in a separate counter). owned=0. The same proportions as on the 6900 XT, so the two design questions apply to this card unchanged.

On 8 GB the readback itself is the cost

The difference from DrArroway's numbers is how long the copy takes:

6900 XT (DrArroway) RX 6600 window 1 RX 6600 window 2
placement readback 10x / 152 ms for 3,785 MiB 7x / 3,996 ms for 1,929 MiB 1x / 6,455 ms for 925 MiB
placement publication 10x / 7,434 ms for 3,848 MiB 1x / 16,873 ms for 939 MiB
submit profile 7.0s direct: lists=33 batch=1x/7045.458ms/max7045.458ms ... placement=1x/7030.611ms/max7030.611ms ...
submit profile 7.0s placement readback: 1x/6455.023ms/max6455.023ms units=504 925.2MiB/max925.2MiB
submit profile 7.0s placement publication: 1x/16872.711ms/max16872.711ms 939.4MiB

The same 504 textures take 25–40 times longer per MiB here. In the second window a single batch spent 7.0 s in placement, 6.5 s of it in the readback. At the same time GTT was full and swap was growing (table above). So I think the copy goes slow because system memory is full and paging, but the profile doesn't show that directly. On this card both are expensive: publication, as you found for the 6900 XT, and the readback itself.

The write watch does its job here too:

submit profile 6.8s placement watch: unwritten=784998/223632.7MiB written=923/18.3MiB noted=65/21.1MiB held=134344/9180.4MiB ...
submit profile 6.8s placement digest: 28x/169.807ms/max43.905ms units=254553 1042.7MiB/max48.3MiB

The full log is saved locally if you'd like a different window. I can rerun at d3770e9, and with the write-watch PR alone once it's open.

<!-- greyfinch-sync:brcly/TuxBox:comment:7247446977 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/413#issuecomment-7247446977). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-11-28T23:27:45Z. --- @NickStallman, here's the `TUXBOX_SUBMIT_PROFILE=1` run on the RX 6600 (8 GB) you asked for. It's the same build as my comment above: #409 at ce620c7 plus this draft at aef121f, so **without d3770e9**. Default settings. It ended after 415 s on the watchdog: mission at frame 1,122, crash at frame 1,128, so 6 world frames again. No fault, one `Not enough memory for command submission!` in the kernel log. ## Where the 6 GB of GTT come from On your question about the GTT growth: in this run it matches the readback buffers created in the first world windows, almost one to one. ```text placed texture readback 5.0s: batches=7 textures=505 copied=2914.6MiB | ... | buffers created=6 (3168.0MiB) reused=1 placed texture readback 7.2s: batches=11 textures=507 copied=1962.2MiB | ... | buffers created=8 (2137.1MiB) reused=3 placed texture readback 6.9s: batches=1 textures=504 copied=939.3MiB | ... | buffers created=1 (1024.0MiB) reused=0 ``` That's 6.3 GB of new readback buffers in about 19 s, with 4 reuses. Over the same time the process's resident GTT (`/proc/<pid>/fdinfo`, sampled every 10 s) went: | time | resident GTT | requested GTT | RAM | swap | | --- | ---: | ---: | ---: | ---: | | 00:15:20 | 10.3 GB | 10.3 GB | 26.9 GB | 5.7 GB | | 00:15:31 | 14.5 GB | 14.5 GB | 30.6 GB | 7.9 GB | | 00:15:43 | 15.9 GB | **16.6 GB** | 30.2 GB | 10.1 GB | | ~00:16:00 | watchdog | | | | The card's GTT is 16 GB, so at 00:15:43 the process was asking for more than exists. That points at readback buffers that are created per window and kept rather than reused. The write watch's `held` count also moves a lot between windows (`held=4798/327.9MiB` up to `held=108680/16712.8MiB`), but I can't tell from here what it adds to GTT. ## The split matches DrArroway's Two steady windows in the world: ```text submit profile placement copied back: eager=1058 eager-mib=1962.1 held=82 shared=574 struck=0 refused=398 refused-mib=972.0 refused-unmapped=0 refused-section=0 refused-held=224 refused-foreign=50 submit profile placement copied back: eager=504 eager-mib=939.3 held=39 shared=271 struck=0 refused=192 refused-mib=466.4 refused-unmapped=0 refused-section=0 refused-held=112 refused-foreign=23 submit profile placement owned: owned=0 owned-mib=0.0 kept=0 faulted=0 acquired=0 settled=0 published-mib=0.0 published-ms=0.000 raced=2 timed-out=0 ``` About 54% `shared` and about 50% of the bytes `refused` (mostly `refused-held`, some `refused-foreign`, and 57–124 that aren't in a separate counter). `owned=0`. The same proportions as on the 6900 XT, so the two design questions apply to this card unchanged. ## On 8 GB the readback itself is the cost The difference from DrArroway's numbers is how long the copy takes: | | 6900 XT (DrArroway) | RX 6600 window 1 | RX 6600 window 2 | | --- | ---: | ---: | ---: | | `placement readback` | 10x / 152 ms for 3,785 MiB | 7x / 3,996 ms for 1,929 MiB | 1x / **6,455 ms for 925 MiB** | | `placement publication` | 10x / 7,434 ms for 3,848 MiB | | 1x / **16,873 ms for 939 MiB** | ```text submit profile 7.0s direct: lists=33 batch=1x/7045.458ms/max7045.458ms ... placement=1x/7030.611ms/max7030.611ms ... submit profile 7.0s placement readback: 1x/6455.023ms/max6455.023ms units=504 925.2MiB/max925.2MiB submit profile 7.0s placement publication: 1x/16872.711ms/max16872.711ms 939.4MiB ``` The same 504 textures take 25–40 times longer per MiB here. In the second window a single batch spent 7.0 s in placement, 6.5 s of it in the readback. At the same time GTT was full and swap was growing (table above). So I think the copy goes slow because system memory is full and paging, but the profile doesn't show that directly. On this card both are expensive: publication, as you found for the 6900 XT, and the readback itself. The write watch does its job here too: ```text submit profile 6.8s placement watch: unwritten=784998/223632.7MiB written=923/18.3MiB noted=65/21.1MiB held=134344/9180.4MiB ... submit profile 6.8s placement digest: 28x/169.807ms/max43.905ms units=254553 1042.7MiB/max48.3MiB ``` The full log is saved locally if you'd like a different window. I can rerun at d3770e9, and with the write-watch PR alone once it's open.
NickStallman commented 2026-11-28 23:49:32 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-28T23:49:32Z.


@1093i3511, thank you. That's the first time anyone has tied the GTT growth to something, and I think you've found a real gap in my own #392: it reuses a readback buffer only when the earlier publication on that queue has finished, so when the worker lags, the in-flight set is unbounded. I haven't checked how much #392's own keeping of buffers adds to the peak.

I'm looking at two things with your and DrArroway's numbers: bounding the outstanding readback memory without breaking the publication order, and not copying textures that nobody wrote (unchanged is most of the mips in both of your logs). I don't have a result yet.

The write-watch PR should be up after its checks; a run of that alone on your card is the comparison I'd like most.

<!-- greyfinch-sync:brcly/TuxBox:comment:7247687993 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/413#issuecomment-7247687993). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-28T23:49:32Z. --- @1093i3511, thank you. That's the first time anyone has tied the GTT growth to something, and I think you've found a real gap in my own #392: it reuses a readback buffer only when the earlier publication on that queue has finished, so when the worker lags, the in-flight set is unbounded. I haven't checked how much #392's own keeping of buffers adds to the peak. I'm looking at two things with your and DrArroway's numbers: bounding the outstanding readback memory without breaking the publication order, and not copying textures that nobody wrote (`unchanged` is most of the mips in both of your logs). I don't have a result yet. The write-watch PR should be up after its checks; a run of that alone on your card is the comparison I'd like most.
NickStallman commented 2026-11-28 23:55:04 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-28T23:55:04Z.


The write watch on its own is now #430 (15 commits, on current main; the full check passed on both cards). @1093i3511, that's the one I'd like your TUXBOX_PLACEMENT_WATCH=0 comparison of, on the 8 GB card. This draft (#413) keeps the ownership work, and I'll rebase it onto #430.

<!-- greyfinch-sync:brcly/TuxBox:comment:7247748586 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/413#issuecomment-7247748586). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-28T23:55:04Z. --- The write watch on its own is now #430 (15 commits, on current `main`; the full check passed on both cards). @1093i3511, that's the one I'd like your `TUXBOX_PLACEMENT_WATCH=0` comparison of, on the 8 GB card. This draft (#413) keeps the ownership work, and I'll rebase it onto #430.
1093i3511 commented 2026-11-29 00:10:35 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-11-29T00:10:35Z.


@NickStallman, thanks. I'll do the #430 comparison on the RX 6600 (normal, and with TUXBOX_PLACEMENT_WATCH=0) tomorrow. #430 is on main with the BVH walk translation, so it needs a full prepare first, and I'll add #409 on top for the fault fix. Expect both runs in the next day. It's already pretty late here and I was already about to call it a day.

<!-- greyfinch-sync:brcly/TuxBox:comment:7247928178 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/413#issuecomment-7247928178). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-11-29T00:10:35Z. --- @NickStallman, thanks. I'll do the #430 comparison on the RX 6600 (normal, and with `TUXBOX_PLACEMENT_WATCH=0`) tomorrow. #430 is on main with the BVH walk translation, so it needs a full prepare first, and I'll add #409 on top for the fault fix. Expect both runs in the next day. It's already pretty late here and I was already about to call it a day.
brcly commented 2026-11-29 01:28:52 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-29T01:28:52Z.


I ran this in ProjectScarlett tonight. In short, GPU ownership never engaged in the game.

Setup: #413's head merged onto current main, which already has #430's final version, #425 and #432. That gave 19 conflicts, mostly this branch adding code where main has none; I took this branch's side for all of them. Release build, TUXBOX_SUBMIT_PROFILE=1, RTX 4070 Ti SUPER on NVIDIA's driver, Proton, offline.

What happened: it reached the title screen (72 FPS) and the prologue scene. The prologue ran at about 0.3 FPS, and I stopped it after about 5 minutes because host swap was nearly full.

Ownership, from the last two 5 s windows of submit profile placement:

copied back: eager=2092 eager-mib=3896.4 held=166 shared=1145 struck=17 refused=764 refused-mib=1921.7 refused-unmapped=0 refused-section=0 refused-held=501 refused-foreign=83
owned:       owned=0 owned-mib=0.0 kept=170 faulted=0 acquired=0 settled=0 published-mib=0.0 published-ms=0.000 raced=0 timed-out=0
copied back: eager=1594 eager-mib=2957.2 held=130 shared=871 struck=13 refused=580 refused-mib=1455.9 refused-unmapped=0 refused-section=0 refused-held=378 refused-foreign=63
  • owned=0 in every window: no texture stayed on the GPU, and 3–4 GB per window was still read back eagerly.
  • The refusals are mostly refused-held: textures over pages under a host import hold. shared is large too, so many written textures share a page with another placed texture.
  • So in this title the route would first need to cover textures over imported pages and textures that share pages.

Memory (measured, cause not isolated): the process reached about 23 GB (10 GB resident plus 12 GB swapped). Before tonight's merges it was 17–18 GB. Readback buffers held 3.3 GB of system memory. I haven't separated what this branch contributes from #430 (now on main) and a large batch of newly compiled shaders in the same run, so I'm not attributing the increase to this branch. A run of plain main is next.

Not tested: AMD, Windows, any CPU timing comparison.

<!-- greyfinch-sync:brcly/TuxBox:comment:7248809287 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/413#issuecomment-7248809287). Originally posted by [brcly](https://github.com/brcly) on 2026-11-29T01:28:52Z. --- I ran this in ProjectScarlett tonight. In short, GPU ownership never engaged in the game. **Setup:** #413's head merged onto current `main`, which already has #430's final version, #425 and #432. That gave 19 conflicts, mostly this branch adding code where `main` has none; I took this branch's side for all of them. Release build, `TUXBOX_SUBMIT_PROFILE=1`, RTX 4070 Ti SUPER on NVIDIA's driver, Proton, offline. **What happened:** it reached the title screen (72 FPS) and the prologue scene. The prologue ran at about 0.3 FPS, and I stopped it after about 5 minutes because host swap was nearly full. **Ownership, from the last two 5 s windows of `submit profile placement`:** ``` copied back: eager=2092 eager-mib=3896.4 held=166 shared=1145 struck=17 refused=764 refused-mib=1921.7 refused-unmapped=0 refused-section=0 refused-held=501 refused-foreign=83 owned: owned=0 owned-mib=0.0 kept=170 faulted=0 acquired=0 settled=0 published-mib=0.0 published-ms=0.000 raced=0 timed-out=0 copied back: eager=1594 eager-mib=2957.2 held=130 shared=871 struck=13 refused=580 refused-mib=1455.9 refused-unmapped=0 refused-section=0 refused-held=378 refused-foreign=63 ``` - `owned=0` in every window: no texture stayed on the GPU, and 3–4 GB per window was still read back eagerly. - The refusals are mostly `refused-held`: textures over pages under a host import hold. `shared` is large too, so many written textures share a page with another placed texture. - So in this title the route would first need to cover textures over imported pages and textures that share pages. **Memory (measured, cause not isolated):** the process reached about 23 GB (10 GB resident plus 12 GB swapped). Before tonight's merges it was 17–18 GB. Readback buffers held 3.3 GB of system memory. I haven't separated what this branch contributes from #430 (now on `main`) and a large batch of newly compiled shaders in the same run, so I'm not attributing the increase to this branch. A run of plain `main` is next. Not tested: AMD, Windows, any CPU timing comparison.
NickStallman commented 2026-11-29 01:49:48 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T01:49:48Z.


@brcly, thanks for trying it on main. Three runs on three cards now say the same thing: owned=0, and the bytes are in shared and refused-held. I'll leave this draft as a record of the approach and not try to make it engage until it handles those two cases; the write watch that did help is already in main as #430.

On memory: the readback buffers you saw (3.3 GB) fit 1093i3511's finding that they are created faster than they are retired. Your c92559b6 should cut the number, since most of those textures aren't written. I have a follow-up for the publication side too (skip unchanged mips, share one readback buffer between a queue's in-flight publications), on a branch, unrun in the game; I'll only open it if it still helps on top of yours.

If your plain-main run shows the memory too, that would settle whether it's this branch.

<!-- greyfinch-sync:brcly/TuxBox:comment:7249040548 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/413#issuecomment-7249040548). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T01:49:48Z. --- @brcly, thanks for trying it on `main`. Three runs on three cards now say the same thing: `owned=0`, and the bytes are in `shared` and `refused-held`. I'll leave this draft as a record of the approach and not try to make it engage until it handles those two cases; the write watch that did help is already in `main` as #430. On memory: the readback buffers you saw (3.3 GB) fit 1093i3511's finding that they are created faster than they are retired. Your `c92559b6` should cut the number, since most of those textures aren't written. I have a follow-up for the publication side too (skip unchanged mips, share one readback buffer between a queue's in-flight publications), on a branch, unrun in the game; I'll only open it if it still helps on top of yours. If your plain-`main` run shows the memory too, that would settle whether it's this branch.
NickStallman commented 2026-11-29 04:32:32 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T04:32:32Z.


@brcly, after your run I said I'd leave this as a record. I've rebuilt it on current main after all, without the parts #430 covered, and off by default. It now tries the two cases your run showed: textures sharing a 64 KiB page (no shared bytes) and textures over imported pages (no buffer over their bytes, NVIDIA only, behind a probe). Not run on a GPU or in the game, so it's still a draft and I claim nothing for it.

Correction (edited): I first suggested here that DispatchRays and ray ExecuteIndirect still counting the whole heap as written could explain your eager=2092 eager-mib=3896.4 window. Our logs say the game doesn't use either: no ray state object is ever created in the runs that trace them, so please disregard that. By reading, other paths still fall back to the whole heap (null compute stand-ins, programs whose image stores can't be traced, tables not resolved). I haven't measured which, or whether any of this applies in your window. If you have the textures and largest values from its readback lines, they'd help: on our older build, without c92559b6, they were 504 textures and 939 MiB per batch.

<!-- greyfinch-sync:brcly/TuxBox:comment:7250714304 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/413#issuecomment-7250714304). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T04:32:32Z. --- @brcly, after your run I said I'd leave this as a record. I've rebuilt it on current `main` after all, without the parts #430 covered, and off by default. It now tries the two cases your run showed: textures sharing a 64 KiB page (no shared bytes) and textures over imported pages (no buffer over their bytes, NVIDIA only, behind a probe). Not run on a GPU or in the game, so it's still a draft and I claim nothing for it. **Correction (edited):** I first suggested here that `DispatchRays` and ray `ExecuteIndirect` still counting the whole heap as written could explain your `eager=2092 eager-mib=3896.4` window. Our logs say the game doesn't use either: no ray state object is ever created in the runs that trace them, so please disregard that. By reading, other paths still fall back to the whole heap (null compute stand-ins, programs whose image stores can't be traced, tables not resolved). I haven't measured which, or whether any of this applies in your window. If you have the `textures` and `largest` values from its readback lines, they'd help: on our older build, without `c92559b6`, they were 504 textures and 939 MiB per batch.
DrArroway commented 2026-11-29 09:04:43 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-29T09:04:43Z.


Tested updated #413 (0038fe83) on AMD Radeon RX 6900 XT (1002:73bf, RADV NAVI21, Mesa 26.3.1, Linux 7.3.6, GE-Proton11-14).

  • Setup: Built from main (2871726) + #455 (guest-memory BLAS lifetime) + #441 (root SRV/UAV reach, keeping both held / pages_held() and hold / covers() in runtime/d3d12/src/device/heap/import.rs) + #413 (0038fe83).

1. Targeted Lanes on 1002:73bf (TUXBOX_GPU_OWNED=1)

7/7 passed (exit=0, passed=1 via lanes.exe --selftest <scenario> --adapter 1002:73bf --report):

  • gpu-owned-idle, gpu-owned-read, gpu-owned-write, gpu-owned-alias, gpu-owned-held, gpu-owned-beside, gpu-owned-import

2. ProjectScarlett Same-Binary A/B (TUXBOX_SUBMIT_PROFILE=1, TUXBOX_GPU_OWNED=0 vs 1)

  • Startup probe on RADV (as designed): logged both:
    • host imports disturb the write watch on game memory
    • host imports are not tried on game memory closed to the CPU
  • Runs:
    • TUXBOX_GPU_OWNED=0 (460.2s total, 9 3D world windows / 18 placement publication profile windows = 156.2s)
    • TUXBOX_GPU_OWNED=1 (437.8s total, 11 3D world windows / 22 placement publication profile windows = 183.2s)
3D World Steady-State Metric TUXBOX_GPU_OWNED=0 TUXBOX_GPU_OWNED=1
3D frame cadence 19 frames / 151s (7.95 s/frame; steady 8.50 s/frame, 0.118 FPS) 22 frames / 185s (8.41 s/frame; steady 8.40 s/frame, 0.119 FPS)
placement publication 127.16s (81.4% wall, avg 652.1 ms, 64,701.3 MiB) 150.73s (82.3% wall, avg 669.9 ms, 78,142.3 MiB)
placement own 0.00s 4.08s (2.2% wall, avg 8.9 ms, max 300.1 ms)
owned / owned-mib / beside 0 / 0.0 MiB / 0 0 / 0.0 MiB / 0 (owned=3 / 0.2 MiB once pre-3D)
held / kept 0 / 0 2,919 / 2,976 (~45.2 MiB, 0.06% of eager-mib)
eager / eager-mib 37,098 / 68,516.8 MiB 41,292 / 76,165.1 MiB
shared / shared-mib 0 / 0.0 MiB 4,379 / 14,048.8 MiB (18.4% of eager-mib)
struck / struck-mib 0 / 0.0 MiB 632 / 24.6 MiB (0.03%)
refused / refused-mib 0 / 0.0 MiB 33,348 / 62,046.5 MiB (81.5% of eager-mib)
refused-unmapped / refused-section 0 / 0 0 (0.0 MiB) / 0 (0.0 MiB)
refused-held 0 9,068 (27.2% of refused count)
raced / acquired / faulted / timed-out 0 / 0 / 0 / 0 14 / 16 (18 total) / 0 / 0
GPU faults / VK_ERROR_DEVICE_LOST 0 0 (both runs ended on unrelated title CPU exceptions)

Notes

  1. No speedup on RADV: 99.94% of eager-mib is still copied back (81.5% in refused-mib + 18.4% in shared-mib), and the ~145 textures/window kept on label-wait batches (kept=2,976) only covered ~45.2 MiB across 183.2s (beside=0). Since RADV does not try imports on closed pages by design, an NVIDIA run where the closed-page probe passes could still see different refused-held / refused-imported numbers.
  2. Submit-profile log truncation under Wine: In runtime/d3d12/src/device/placement/ownership.rs (window_lines), submit profile placement copied back: packs 25 fields into a ~450-character line, so Wine's OutputDebugStringA truncates every line right after refused-held=<N> refused-hel.... That hides refused-held-mib, refused-imported(-mib), refused-foreign(-mib), refused-own, refused-no-view, and refused-other (which cover the remaining 24,280 refused textures). Splitting that line in two would make the full breakdown readable under Proton/Wine.
<!-- greyfinch-sync:brcly/TuxBox:comment:7253521397 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/413#issuecomment-7253521397). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-11-29T09:04:43Z. --- Tested updated `#413` (`0038fe83`) on AMD Radeon RX 6900 XT (`1002:73bf`, RADV NAVI21, Mesa 26.3.1, Linux 7.3.6, `GE-Proton11-14`). - **Setup:** Built from `main` (`2871726`) + `#455` (guest-memory BLAS lifetime) + `#441` (root SRV/UAV reach, keeping both `held` / `pages_held()` and `hold` / `covers()` in `runtime/d3d12/src/device/heap/import.rs`) + `#413` (`0038fe83`). ### 1. Targeted Lanes on `1002:73bf` (`TUXBOX_GPU_OWNED=1`) **7/7 passed** (`exit=0`, `passed=1` via `lanes.exe --selftest <scenario> --adapter 1002:73bf --report`): - `gpu-owned-idle`, `gpu-owned-read`, `gpu-owned-write`, `gpu-owned-alias`, `gpu-owned-held`, `gpu-owned-beside`, `gpu-owned-import` ### 2. ProjectScarlett Same-Binary A/B (`TUXBOX_SUBMIT_PROFILE=1`, `TUXBOX_GPU_OWNED=0` vs `1`) - **Startup probe on RADV (as designed):** logged both: - `host imports disturb the write watch on game memory` - `host imports are not tried on game memory closed to the CPU` - **Runs:** - `TUXBOX_GPU_OWNED=0` (`460.2s` total, `9` 3D world windows / `18` `placement publication` profile windows = `156.2s`) - `TUXBOX_GPU_OWNED=1` (`437.8s` total, `11` 3D world windows / `22` `placement publication` profile windows = `183.2s`) | 3D World Steady-State Metric | `TUXBOX_GPU_OWNED=0` | `TUXBOX_GPU_OWNED=1` | |---|---:|---:| | **3D frame cadence** | `19` frames / `151s` (`7.95 s/frame`; steady `8.50 s/frame`, `0.118 FPS`) | `22` frames / `185s` (`8.41 s/frame`; steady `8.40 s/frame`, `0.119 FPS`) | | **`placement publication`** | `127.16s` (`81.4%` wall, avg `652.1 ms`, `64,701.3 MiB`) | `150.73s` (`82.3%` wall, avg `669.9 ms`, `78,142.3 MiB`) | | **`placement own`** | `0.00s` | `4.08s` (`2.2%` wall, avg `8.9 ms`, max `300.1 ms`) | | **`owned` / `owned-mib` / `beside`** | `0` / `0.0 MiB` / `0` | `0` / `0.0 MiB` / `0` (`owned=3` / `0.2 MiB` once pre-3D) | | **`held` / `kept`** | `0` / `0` | `2,919` / `2,976` (~`45.2 MiB`, `0.06%` of `eager-mib`) | | **`eager` / `eager-mib`** | `37,098` / `68,516.8 MiB` | `41,292` / `76,165.1 MiB` | | **`shared` / `shared-mib`** | `0` / `0.0 MiB` | `4,379` / `14,048.8 MiB` (`18.4%` of `eager-mib`) | | **`struck` / `struck-mib`** | `0` / `0.0 MiB` | `632` / `24.6 MiB` (`0.03%`) | | **`refused` / `refused-mib`** | `0` / `0.0 MiB` | `33,348` / `62,046.5 MiB` (`81.5%` of `eager-mib`) | | **`refused-unmapped` / `refused-section`** | `0` / `0` | `0` (`0.0 MiB`) / `0` (`0.0 MiB`) | | **`refused-held`** | `0` | `9,068` (`27.2%` of `refused` count) | | **`raced` / `acquired` / `faulted` / `timed-out`** | `0` / `0` / `0` / `0` | `14` / `16` (`18` total) / `0` / `0` | | **GPU faults / `VK_ERROR_DEVICE_LOST`** | `0` | `0` (both runs ended on unrelated title CPU exceptions) | ### Notes 1. **No speedup on RADV:** `99.94%` of `eager-mib` is still copied back (`81.5%` in `refused-mib` + `18.4%` in `shared-mib`), and the ~`145` textures/window kept on label-wait batches (`kept=2,976`) only covered `~45.2 MiB` across `183.2s` (`beside=0`). Since RADV does not try imports on closed pages by design, an NVIDIA run where the closed-page probe passes could still see different `refused-held` / `refused-imported` numbers. 2. **Submit-profile log truncation under Wine:** In `runtime/d3d12/src/device/placement/ownership.rs` (`window_lines`), `submit profile placement copied back:` packs 25 fields into a ~450-character line, so Wine's `OutputDebugStringA` truncates every line right after `refused-held=<N> refused-hel...`. That hides `refused-held-mib`, `refused-imported(-mib)`, `refused-foreign(-mib)`, `refused-own`, `refused-no-view`, and `refused-other` (which cover the remaining `24,280` refused textures). Splitting that line in two would make the full breakdown readable under Proton/Wine.
NickStallman commented 2026-11-29 09:19:58 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T09:19:58Z.


Thank you, that's a clear result: no gain on RADV, as it's meant to fall back there, and the owned path did almost nothing in your run. I'd read it as no reason to merge this for AMD.

The truncated line makes the one interesting number (why 24,280 textures were refused) unreadable, so I'll split it when I next rebase this. It stays a draft, and it conflicts with main at the moment. An NVIDIA A/B isn't scheduled: I'm on two other faults first.

<!-- greyfinch-sync:brcly/TuxBox:comment:7253692092 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/413#issuecomment-7253692092). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T09:19:58Z. --- Thank you, that's a clear result: no gain on RADV, as it's meant to fall back there, and the owned path did almost nothing in your run. I'd read it as no reason to merge this for AMD. The truncated line makes the one interesting number (why 24,280 textures were refused) unreadable, so I'll split it when I next rebase this. It stays a draft, and it conflicts with `main` at the moment. An NVIDIA A/B isn't scheduled: I'm on two other faults first.
1093i3511 commented 2026-11-29 10:20:22 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-11-29T10:20:22Z.


@NickStallman, here is the #430 comparison on 8 GB that you asked for, plus the textures and largest values. Everything is plain main 2871726 (with #409, #430 and c92559b6, without #413) on the RX 6600 (8 GB, RADV, Mesa 26.3.1, Linux 7.3.6, GE-Proton11-14), default settings except where noted, warm Mesa shader cache, offline.

Runs

Run TUXBOX_PLACEMENT_WATCH Length World readback windows Presents in the world Peak card GTT (of 16 GB) Ending
1 default 7.5 min 3 – 16.0 GB kernel Not enough memory for command submission! (5×), the compositor's submission rejected (-12), compositor aborted, game gone
2 default 7.3 min 2 14 15.6 GB title watchdog (exit 5), 6 world frames
3 0 6.3 min 6 5 12.7 GB GPU page fault in the game (see below), ring reset succeeded, then the title watchdog (exit 5), 10 world frames
4 0 10.4 min 28 27 16.0 GB Not enough memory for command submission! (12×), compositor aborted, game gone

A cold-cache run before these (default) took 39 min to reach the world and ended on the watchdog with GTT at 15.5 GB.

1. The write watch slows the start on this card. Frames presented per 10 s, from the first window after startup (the Rockstar logo and the scenes after it):

watch on  (run 1): 847 755 282 129 105 104 110
watch on  (run 2): 841 771 284 127 105 109 110
watch off (run 3): 911 938 950 703 435 376 291
watch off (run 4): 983 882 996 724 539 433 296
before #430 (ce620c7, yesterday): 997 901 847 635 610 300 300

With the watch on, the logo animation plays visibly slower (about 2/3 to 3/4 speed) and its audio drops out at the start. With TUXBOX_PLACEMENT_WATCH=0 it plays normally. From the third window on, the watch costs 3–4× in presents. I haven't profiled where the time goes.

2. In the world, the watch makes no difference to the batches. Every world window in all four runs had the same batch: 504–509 textures, largest=939.3MiB/504 textures, about 1–4.8 GB copied per 5 s, with buffers created of 1–5 GB per window and few reuses. So c92559b6 doesn't shrink this batch in this title: these are the numbers from our build without it. The largest textures are 2560x1440 with one mip, sources=heap-uav, queues=direct. Example from run 1:

placed texture readback 5.0s: batches=10 textures=508 copied=3001.9MiB largest=939.3MiB/504 textures | ... | buffers created=9 (3262.0MiB) reused=1
placed texture readback 5.1s: batches=5 textures=504 copied=1919.6MiB largest=939.3MiB/504 textures | ... | buffers created=5 (2091.0MiB) reused=0
placed texture readback 5.5s: batches=2 textures=505 copied=995.0MiB largest=939.3MiB/504 textures | ... | buffers created=2 (1080.0MiB) reused=0

3. On 8 GB, the readback buffers now end the whole desktop session. Within 15–40 s of world entry, card GTT goes from about 9–10 GB to the full 16 GB. Then the kernel refuses command submissions, including the compositor's, which aborts. Runs 1 and 4 lost the desktop this way, with no GPU fault and no ring reset. Run 4 lasted longest in the world (28 windows, about 140 s, a frame every 10–16 s): GTT went up and down between 12.5 and 16 GB for two minutes before it ran out. RAM peaked at 30.7 of 32 GB and swap at 13.4 GB. Bounding the outstanding readback memory, as you planned, would help here first.

4. One GPU fault (run 3, watch off): 10 gfxhub page faults from the game's vkd3d_queue on ring 24, host pages 0x8001dddb0000, 0x8001dddb1000 and 0x8001dddb3000 (TCP, status 0x00501031), then gfx_0.0.0 timeout and a successful ring reset; the title's watchdog ended the game 30 s later. It didn't happen in run 4 with the same setting, nor in runs 1 and 2. These are host addresses like the freed-storage faults in #403 (cause 2), which #455 targets; I can't tell from the kernel log alone which structure it was.

I can run #455 on top of main on this card if that helps, or a TUXBOX_SUBMIT_PROFILE=1 run to see where the watch spends its time before the world.

<!-- greyfinch-sync:brcly/TuxBox:comment:7254367805 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/413#issuecomment-7254367805). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-11-29T10:20:22Z. --- @NickStallman, here is the #430 comparison on 8 GB that you asked for, plus the `textures` and `largest` values. Everything is plain `main` `2871726` (with #409, #430 and `c92559b6`, without #413) on the RX 6600 (8 GB, RADV, Mesa 26.3.1, Linux 7.3.6, GE-Proton11-14), default settings except where noted, warm Mesa shader cache, offline. **Runs** | Run | `TUXBOX_PLACEMENT_WATCH` | Length | World readback windows | Presents in the world | Peak card GTT (of 16 GB) | Ending | | --- | --- | ---: | ---: | ---: | ---: | --- | | 1 | default | 7.5 min | 3 | – | 16.0 GB | kernel `Not enough memory for command submission!` (5×), the compositor's submission rejected (`-12`), compositor aborted, game gone | | 2 | default | 7.3 min | 2 | 14 | 15.6 GB | title watchdog (exit 5), 6 world frames | | 3 | `0` | 6.3 min | 6 | 5 | 12.7 GB | GPU page fault in the game (see below), ring reset succeeded, then the title watchdog (exit 5), 10 world frames | | 4 | `0` | 10.4 min | 28 | 27 | 16.0 GB | `Not enough memory for command submission!` (12×), compositor aborted, game gone | A cold-cache run before these (default) took 39 min to reach the world and ended on the watchdog with GTT at 15.5 GB. **1. The write watch slows the start on this card.** Frames presented per 10 s, from the first window after startup (the Rockstar logo and the scenes after it): ```text watch on (run 1): 847 755 282 129 105 104 110 watch on (run 2): 841 771 284 127 105 109 110 watch off (run 3): 911 938 950 703 435 376 291 watch off (run 4): 983 882 996 724 539 433 296 before #430 (ce620c7, yesterday): 997 901 847 635 610 300 300 ``` With the watch on, the logo animation plays visibly slower (about 2/3 to 3/4 speed) and its audio drops out at the start. With `TUXBOX_PLACEMENT_WATCH=0` it plays normally. From the third window on, the watch costs 3–4× in presents. I haven't profiled where the time goes. **2. In the world, the watch makes no difference to the batches.** Every world window in all four runs had the same batch: 504–509 textures, `largest=939.3MiB/504 textures`, about 1–4.8 GB copied per 5 s, with `buffers created` of 1–5 GB per window and few reuses. So `c92559b6` doesn't shrink this batch in this title: these are the numbers from our build without it. The largest textures are 2560x1440 with one mip, `sources=heap-uav`, `queues=direct`. Example from run 1: ```text placed texture readback 5.0s: batches=10 textures=508 copied=3001.9MiB largest=939.3MiB/504 textures | ... | buffers created=9 (3262.0MiB) reused=1 placed texture readback 5.1s: batches=5 textures=504 copied=1919.6MiB largest=939.3MiB/504 textures | ... | buffers created=5 (2091.0MiB) reused=0 placed texture readback 5.5s: batches=2 textures=505 copied=995.0MiB largest=939.3MiB/504 textures | ... | buffers created=2 (1080.0MiB) reused=0 ``` **3. On 8 GB, the readback buffers now end the whole desktop session.** Within 15–40 s of world entry, card GTT goes from about 9–10 GB to the full 16 GB. Then the kernel refuses command submissions, including the compositor's, which aborts. Runs 1 and 4 lost the desktop this way, with no GPU fault and no ring reset. Run 4 lasted longest in the world (28 windows, about 140 s, a frame every 10–16 s): GTT went up and down between 12.5 and 16 GB for two minutes before it ran out. RAM peaked at 30.7 of 32 GB and swap at 13.4 GB. Bounding the outstanding readback memory, as you planned, would help here first. **4. One GPU fault (run 3, watch off):** 10 gfxhub page faults from the game's `vkd3d_queue` on ring 24, host pages `0x8001dddb0000`, `0x8001dddb1000` and `0x8001dddb3000` (TCP, status `0x00501031`), then `gfx_0.0.0` timeout and a successful ring reset; the title's watchdog ended the game 30 s later. It didn't happen in run 4 with the same setting, nor in runs 1 and 2. These are host addresses like the freed-storage faults in #403 (cause 2), which #455 targets; I can't tell from the kernel log alone which structure it was. I can run #455 on top of `main` on this card if that helps, or a `TUXBOX_SUBMIT_PROFILE=1` run to see where the watch spends its time before the world.
NickStallman commented 2026-11-29 10:49:52 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T10:49:52Z.


Thank you, that's a lot of careful work, and it corrects a hope of mine: c92559b6 doesn't shrink the world batch here either. Your 939.3 MiB/504 is the same set I measured on a 5090.

For the memory, the PRs to try are #439, #460 and #462 (which contains both). On a 4070 Ti SUPER brcly measured pinned readback in the world load going from 2.5–4.4 GiB to 0.29 GiB with all three, and no whole-heap batch; DrArroway got 216–712 MiB on an RX 6900 XT. I haven't run it on 8 GB, so a run of #462 on your card would say more than anything I can offer. I'd still bound what's outstanding, but after that, not before.

The slow start with the watch on is new to me, and I don't have a guess I'd trust: a TUXBOX_SUBMIT_PROFILE=1 run of the first minutes, watch on and off, would be very useful. For the fault, yes, #455 on main is the one to try.

<!-- greyfinch-sync:brcly/TuxBox:comment:7254697477 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/413#issuecomment-7254697477). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T10:49:52Z. --- Thank you, that's a lot of careful work, and it corrects a hope of mine: `c92559b6` doesn't shrink the world batch here either. Your 939.3 MiB/504 is the same set I measured on a 5090. For the memory, the PRs to try are #439, #460 and #462 (which contains both). On a 4070 Ti SUPER brcly measured pinned readback in the world load going from 2.5–4.4 GiB to 0.29 GiB with all three, and no whole-heap batch; DrArroway got 216–712 MiB on an RX 6900 XT. I haven't run it on 8 GB, so a run of #462 on your card would say more than anything I can offer. I'd still bound what's outstanding, but after that, not before. The slow start with the watch on is new to me, and I don't have a guess I'd trust: a `TUXBOX_SUBMIT_PROFILE=1` run of the first minutes, watch on and off, would be very useful. For the fault, yes, #455 on `main` is the one to try.
NickStallman commented 2026-11-29 19:34:32 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T19:34:32Z.


Closing this: it no longer has enough value to justify its size.

  • #464 made XMem pages section-backed by default, and this refuses those, so it does nothing without TUXBOX_XMEM_PRIVATE_VIEWS=1.
  • #439, #460 and #462 removed most of what it saved: unchanged mips are skipped and whole-heap readbacks are gone.
  • The only comparison (DrArroway, RADV, thanks) showed no gain. It was never measured in game on NVIDIA.

Keeping textures on the GPU with section pages would need all mappings of a page closed at once, which is a new design rather than a rebase. If someone wants to take that up, the branch rebases onto 2d6dc338 (unit tests and check --no-gpu pass, no GPU run since), and I can push it. Thanks to everyone who tested or reviewed it.

<!-- greyfinch-sync:brcly/TuxBox:comment:7261388030 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/413#issuecomment-7261388030). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T19:34:32Z. --- Closing this: it no longer has enough value to justify its size. - **#464** made XMem pages section-backed by default, and this refuses those, so it does nothing without `TUXBOX_XMEM_PRIVATE_VIEWS=1`. - **#439, #460 and #462** removed most of what it saved: unchanged mips are skipped and whole-heap readbacks are gone. - The only comparison (DrArroway, RADV, thanks) showed no gain. It was never measured in game on NVIDIA. Keeping textures on the GPU with section pages would need all mappings of a page closed at once, which is a new design rather than a rebase. If someone wants to take that up, the branch rebases onto 2d6dc338 (unit tests and `check --no-gpu` pass, no GPU run since), and I can push it. Thanks to everyone who tested or reviewed it.

Pull request closed

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
brcly/TuxBox!413
No description provided.