xmem: since #464, unwatched section-backed pages make ProjectScarlett's start 4–5× slower on an 8 GB RX 6600 #472

Open
opened 2026-11-29 12:55:28 +00:00 by 1093i3511 · 56 comments
1093i3511 commented 2026-11-29 12:55:28 +00:00 (Migrated from github.com)
Contributor

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-11-29T12:55:28Z.


#464 backs XMem physical pages with their section, and its description names the trade-off: those pages have no write watch, so the d3d12 provider digests their textures instead. On an RX 6600 (8 GB, RADV, Mesa 26.3.1, GE-Proton11-14, 32 GB RAM), that cost makes the start of ProjectScarlett 4–5× slower. Measured with warm caches, one run per row. Section 2 is the TUXBOX_SUBMIT_PROFILE=1 comparison @NickStallman asked for on #413, which shows what the write watch is worth on this card. cc @Jerkin42

1. Since #464, the start is 4–5× slower

Presents per 10 s from launch, covering the Rockstar logo and the scenes after it (4-minute runs):

Build Presents per 10 s
#462 before the merge (cb11fafb on 75453953, without #464) 777, 764, 693, 684, 910, 449
main 6e2c5dab 179, 172, 160, 161, 242, 274
main 6e2c5dab with TUXBOX_PLACEMENT_WATCH=0 172, 166, 158, 159, 228, 280
main 6e2c5dab with #464 reverted locally 797, 754, 667, 672, 911, 442
  • With the revert, the start is back at #462's pace.
  • On main, the logo animation plays slowly, its audio drops out and doesn't recover, and the scenes after it fall to about 50–60 presents per 10 s.
  • TUXBOX_PLACEMENT_WATCH=0 makes no difference on main. That fits #464's description: section-backed pages have no write watch any more, so the provider digests their textures either way.
  • A full run on main reached the world and ended on the title's watchdog. On this card the runs haven't got as far as the first story mission, where #456 kills the title.

TUXBOX_XMEM_PRIVATE_VIEWS=1 should bring back the earlier pace here, at the cost of #456. I can measure that if it helps. Would a write watch for section-backed pages be possible, or a way to digest only the textures whose pages a host import holds?

2. Where the time goes with and without the write watch (before #464)

Both runs on #462 cb11fafb on 75453953, so without #464 and without #455.

Phase Watch on Watch off
First 260 s from launch 5,386 presents (20.7/s) 13,499 presents (52.1/s)
… time in submission batches on direct 15 s, 14 s of it placement 34 s, 32 s of it placement
World (after the first readback batch over 200 MiB) 120 s, 22 presents (5.5 s each) 311 s, 35 presents (8.9 s each)
… placement on compute + direct 46 + 22 s 196 + 115 s, so nearly all of the world time
… largest placement stages publication 32.9 s, publish-store 16.8 s, scan 14.3 s, publish-retile 11.1 s, digest 6.4 s digest 174.5 s, resolve 41.6 s, read 34.6 s, publication 29.2 s, publish-retile 17.8 s
Peak card GTT / RAM / swap 11.0 / 27.1 / 15.3 GB 11.3 / 27.5 / 13.6 GB
  • In the world, the watch helps here too. Without it, placement digest alone takes 174 s of the 311 s world. With it, scan and digest take about 21 s, and world frames come in 5.5 s instead of 8.9 s. That's roughly 1.5–2× @DrArroway's 6900 XT frame time on #462.
  • The watch's cost at the start isn't in the submission path. The first 260 s present 2.5× fewer frames with the watch on. But direct then spends less time in batches and placement (15 s against 34 s), and nothing in the profile adds up to the difference. So the time goes somewhere the profile doesn't measure, probably on the game's own threads. I haven't checked that.
  • Both runs ended in the title's main-thread wait (EXCEPTION_BREAKPOINT, caller +0x2215ECA), with no GPU fault, after 553 s (watch on) and 752 s (watch off).

So on this card the watch is a net gain in the world and a cost at the start. Since #464, the title's pages lose it and get the full digest cost instead, from the start onwards.

Separately, #455 didn't stop the host-page fault here. On main 6e2c5dab, the game's vkd3d_queue faulted at 0x8002c2f00000 (10 lines shown, 151 suppressed). The gfx_0.0.0 ring reset succeeded, and the watchdog ended the game 30 s later.

<!-- greyfinch-sync:brcly/TuxBox:issue:6678959239 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-11-29T12:55:28Z. --- #464 backs XMem physical pages with their section, and its description names the trade-off: those pages have no write watch, so the d3d12 provider digests their textures instead. On an RX 6600 (8 GB, RADV, Mesa 26.3.1, GE-Proton11-14, 32 GB RAM), that cost makes the start of ProjectScarlett 4–5× slower. Measured with warm caches, one run per row. Section 2 is the `TUXBOX_SUBMIT_PROFILE=1` comparison @NickStallman asked for on #413, which shows what the write watch is worth on this card. cc @Jerkin42 ### 1. Since #464, the start is 4–5× slower Presents per 10 s from launch, covering the Rockstar logo and the scenes after it (4-minute runs): | Build | Presents per 10 s | | --- | --- | | #462 before the merge (`cb11fafb` on `75453953`, without #464) | 777, 764, 693, 684, 910, 449 | | `main` `6e2c5dab` | 179, 172, 160, 161, 242, 274 | | `main` `6e2c5dab` with `TUXBOX_PLACEMENT_WATCH=0` | 172, 166, 158, 159, 228, 280 | | `main` `6e2c5dab` with #464 reverted locally | 797, 754, 667, 672, 911, 442 | - With the revert, the start is back at #462's pace. - On `main`, the logo animation plays slowly, its audio drops out and doesn't recover, and the scenes after it fall to about 50–60 presents per 10 s. - `TUXBOX_PLACEMENT_WATCH=0` makes no difference on `main`. That fits #464's description: section-backed pages have no write watch any more, so the provider digests their textures either way. - A full run on `main` reached the world and ended on the title's watchdog. On this card the runs haven't got as far as the first story mission, where #456 kills the title. `TUXBOX_XMEM_PRIVATE_VIEWS=1` should bring back the earlier pace here, at the cost of #456. I can measure that if it helps. Would a write watch for section-backed pages be possible, or a way to digest only the textures whose pages a host import holds? ### 2. Where the time goes with and without the write watch (before #464) Both runs on #462 `cb11fafb` on `75453953`, so without #464 and without #455. | Phase | Watch on | Watch off | | --- | --- | --- | | First 260 s from launch | 5,386 presents (20.7/s) | 13,499 presents (52.1/s) | | … time in submission batches on `direct` | 15 s, 14 s of it `placement` | 34 s, 32 s of it `placement` | | World (after the first readback batch over 200 MiB) | 120 s, 22 presents (5.5 s each) | 311 s, 35 presents (8.9 s each) | | … `placement` on `compute` + `direct` | 46 + 22 s | 196 + 115 s, so nearly all of the world time | | … largest `placement` stages | `publication` 32.9 s, `publish-store` 16.8 s, `scan` 14.3 s, `publish-retile` 11.1 s, `digest` 6.4 s | `digest` 174.5 s, `resolve` 41.6 s, `read` 34.6 s, `publication` 29.2 s, `publish-retile` 17.8 s | | Peak card GTT / RAM / swap | 11.0 / 27.1 / 15.3 GB | 11.3 / 27.5 / 13.6 GB | - **In the world, the watch helps here too.** Without it, `placement digest` alone takes 174 s of the 311 s world. With it, `scan` and `digest` take about 21 s, and world frames come in 5.5 s instead of 8.9 s. That's roughly 1.5–2× @DrArroway's 6900 XT frame time on #462. - **The watch's cost at the start isn't in the submission path.** The first 260 s present 2.5× fewer frames with the watch on. But `direct` then spends less time in batches and `placement` (15 s against 34 s), and nothing in the profile adds up to the difference. So the time goes somewhere the profile doesn't measure, probably on the game's own threads. I haven't checked that. - Both runs ended in the title's main-thread wait (`EXCEPTION_BREAKPOINT`, caller `+0x2215ECA`), with no GPU fault, after 553 s (watch on) and 752 s (watch off). So on this card the watch is a net gain in the world and a cost at the start. Since #464, the title's pages lose it and get the full digest cost instead, from the start onwards. Separately, #455 didn't stop the host-page fault here. On `main` `6e2c5dab`, the game's `vkd3d_queue` faulted at `0x8002c2f00000` (10 lines shown, 151 suppressed). The `gfx_0.0.0` ring reset succeeded, and the watchdog ended the game 30 s later.
1093i3511 commented 2026-11-29 13:17:34 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-11-29T13:17:34Z.


Follow-up: TUXBOX_XMEM_PRIVATE_VIEWS=1 on main 6e2c5dab, same card, one run, warm caches.

The start is back at the pre-#464 pace. Presents per 10 s from launch:

Build Presents per 10 s
main 6e2c5dab 179, 172, 160, 161, 242, 274
main 6e2c5dab with #464 reverted 797, 754, 667, 672, 911, 442
main 6e2c5dab with TUXBOX_XMEM_PRIVATE_VIEWS=1 780, 765, 690, 689, 908, 410

It also went further than any run on this card so far. The run stayed in the world for about 350 s: 68 readback windows, 65 presents, mission at F:6793, end at F:6850, so 57 world frames. Earlier runs got 6–35. For the first time, new scenes of the intro rendered, with the opening credits over them.

  • No #456 death: no write fault not promoted line in the log. This run didn't reach the first story mission, though, so it doesn't say whether #456 would come back there.
  • Readbacks stayed small: 291–303 MiB with 81–85 textures at most, 542 MiB copied per window on average.
  • Memory peaks: game VRAM requested 8.1 GB with the card full, card GTT 12.8 GB, RAM 28.2 GB, swap 17.3 GB.
  • World pace: still one frame every 5–7 s.

What ended it was the host-page GPU fault, not memory. At 14:12:40, the game's vkd3d_queue faulted at host page 0x8002c0174000 on ring 24 (10 lines shown, 139 suppressed). The gfx_0.0.0 ring reset succeeded, and 30 s later the title's watchdog ended the game: EXCEPTION_ACCESS_VIOLATION at +0x23CF683 (callers +0x2215C35, +0x2215ECA), exit 5 after 1,002 s. Same shape as the earlier faults here (0x8002c2f00000 on main, 0x8005174f0000 and 0x8001dddb0000 before #455). So on this card that fault is now the next limit, with #455 merged.

So on 8 GB, TUXBOX_XMEM_PRIVATE_VIEWS=1 is currently the better setting for ProjectScarlett, as long as nobody reaches #456's spot with it.

<!-- greyfinch-sync:brcly/TuxBox:comment:7256429823 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7256429823). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-11-29T13:17:34Z. --- Follow-up: `TUXBOX_XMEM_PRIVATE_VIEWS=1` on `main` `6e2c5dab`, same card, one run, warm caches. **The start is back at the pre-#464 pace.** Presents per 10 s from launch: | Build | Presents per 10 s | | --- | --- | | `main` `6e2c5dab` | 179, 172, 160, 161, 242, 274 | | `main` `6e2c5dab` with #464 reverted | 797, 754, 667, 672, 911, 442 | | `main` `6e2c5dab` with `TUXBOX_XMEM_PRIVATE_VIEWS=1` | 780, 765, 690, 689, 908, 410 | **It also went further than any run on this card so far.** The run stayed in the world for about 350 s: 68 readback windows, 65 presents, mission at F:6793, end at F:6850, so 57 world frames. Earlier runs got 6–35. For the first time, new scenes of the intro rendered, with the opening credits over them. - **No #456 death:** no `write fault not promoted` line in the log. This run didn't reach the first story mission, though, so it doesn't say whether #456 would come back there. - **Readbacks stayed small:** 291–303 MiB with 81–85 textures at most, 542 MiB copied per window on average. - **Memory peaks:** game VRAM requested 8.1 GB with the card full, card GTT 12.8 GB, RAM 28.2 GB, swap 17.3 GB. - **World pace:** still one frame every 5–7 s. **What ended it was the host-page GPU fault, not memory.** At 14:12:40, the game's `vkd3d_queue` faulted at host page `0x8002c0174000` on ring 24 (10 lines shown, 139 suppressed). The `gfx_0.0.0` ring reset succeeded, and 30 s later the title's watchdog ended the game: `EXCEPTION_ACCESS_VIOLATION` at `+0x23CF683` (callers `+0x2215C35`, `+0x2215ECA`), exit 5 after 1,002 s. Same shape as the earlier faults here (`0x8002c2f00000` on `main`, `0x8005174f0000` and `0x8001dddb0000` before #455). So on this card that fault is now the next limit, with #455 merged. So on 8 GB, `TUXBOX_XMEM_PRIVATE_VIEWS=1` is currently the better setting for ProjectScarlett, as long as nobody reaches #456's spot with it.
NickStallman commented 2026-11-29 13:21:29 +00:00 (Migrated from github.com)
Author
Contributor

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


Measured on an RTX 5090 (620.70.10, GE-Proton11-14, warm caches), where the display caps at 60 Hz, so the start can't show a 4–5× drop unless it falls below that. Presents per 10 s from launch:

Build windows 0–9 (10 s each)
with #464 (main d2eb99ed + others), run 1 606, 600, 600, 600, 577, 191, 560, 563, 369, 300
with #464, run 2 (traced) 604, 596, 590, 599, 577, 216, 553, 578, 386, 299
with #464, run 3 (traced) 606, 600, 600, 600, 580, 222, 570, 594, 383, 300
the same build, TUXBOX_XMEM_PRIVATE_VIEWS=1 604, 600, 601, 600, 590, 522, 600, 377, 300, 300
the same family without #464 (main 75453953) 605, 600, 600, 600, 601, 600, 600, 600, 599, 584
as above, traced 606, 600, 600, 592, 529, 599, 547, 300, 300, 300

So the pace mostly stays at the cap on this card, but the sixth window falls to about 200 in all three runs with #464 and to 522 or more in the others. That's a one-off dip here, not your slowdown. Private views on the 5090 didn't reach the world without an access violation in XCRDAPI.dll (about 100 s after the story load), which I reported on #464; it didn't appear with #464, so I'd rather keep it.

These runs all had a local experiment (#459) that computes wrong values in some mesh programs on NVIDIA, so nothing after the story load from them is evidence, including the endings. The start isn't affected by that as far as I can see.

On the host-page fault: two of my traced runs ended on the same kind, a GPU read of memory that had been unmapped earlier (6.9 s before in one, about 15 s after a clean release in the other). On a 5090 it's an Xid 109 or 13. I can't say it's the same as yours, and the runs carried that experiment; I'm rerunning without it.

<!-- greyfinch-sync:brcly/TuxBox:comment:7256477548 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7256477548). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T13:21:29Z. --- Measured on an RTX 5090 (620.70.10, GE-Proton11-14, warm caches), where the display caps at 60 Hz, so the start can't show a 4–5× drop unless it falls below that. Presents per 10 s from launch: | Build | windows 0–9 (10 s each) | |---|---| | with #464 (`main` d2eb99ed + others), run 1 | 606, 600, 600, 600, 577, **191**, 560, 563, 369, 300 | | with #464, run 2 (traced) | 604, 596, 590, 599, 577, **216**, 553, 578, 386, 299 | | with #464, run 3 (traced) | 606, 600, 600, 600, 580, **222**, 570, 594, 383, 300 | | the same build, `TUXBOX_XMEM_PRIVATE_VIEWS=1` | 604, 600, 601, 600, 590, 522, 600, 377, 300, 300 | | the same family without #464 (`main` 75453953) | 605, 600, 600, 600, 601, 600, 600, 600, 599, 584 | | as above, traced | 606, 600, 600, 592, 529, 599, 547, 300, 300, 300 | So the pace mostly stays at the cap on this card, but the sixth window falls to about 200 in all three runs with #464 and to 522 or more in the others. That's a one-off dip here, not your slowdown. Private views on the 5090 didn't reach the world without an access violation in `XCRDAPI.dll` (about 100 s after the story load), which I reported on #464; it didn't appear with #464, so I'd rather keep it. **These runs all had a local experiment (#459) that computes wrong values in some mesh programs on NVIDIA**, so nothing after the story load from them is evidence, including the endings. The start isn't affected by that as far as I can see. On the host-page fault: two of my traced runs ended on the same kind, a GPU read of memory that had been unmapped earlier (6.9 s before in one, about 15 s after a clean release in the other). On a 5090 it's an Xid 109 or 13. I can't say it's the same as yours, and the runs carried that experiment; I'm rerunning without it.
DrArroway commented 2026-11-29 13:28:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-29T13:28:17Z.


Seeing the exact same trade-off on an RX 6900 XT (1002:73bf, 16 GB, RADV, Mesa 26.3.1, GE-Proton11-14, 3840x2160, offline):

  • Default #464 section-backed main (6e2c5dab + #474 + #475): stayed alive for 17+ min (74 3D world windows / 458 s in-world, 0 crashes, 0 GPU faults — confirming #464 eliminates the #456 late-world crash), but world cadence drops to 12–24 s/frame because every submit checks all section-backed textures (~398k textures / ~34 GiB per 5 s window, vs ~2.5 GiB with private views).
  • TUXBOX_XMEM_PRIVATE_VIEWS=1 (with #462 + #474 + #475): world cadence is 3.39 s/frame (best window 2.75 s/frame), with zero GPU faults or ERROR_BUSY up to the known late-world #456 point.

Two notes from profiling both modes that may help here and on RX 6600:

  1. #475 (skipping unchanged UNTRACKED Watch::rearm calls + 16 MiB PrivateArena slabs + 4 MiB chunked PrivateSpan reservations) skips tens of millions of redundant SECTION rearms on default main (27.2M in the 74-window run), and in TUXBOX_XMEM_PRIVATE_VIEWS=1 mode cuts Wine PrivateSpan VMAs by 22× (~97,290 → 4,449) and GetWriteWatch runs/scan by 11.5× (4,258 → 369). Reducing ~97k Wine VMAs down to ~4.4k may also help the startup slowdown you saw with the write watch on an 8 GB / smaller CPU budget.
  2. #474 (lock-free parallel CheckPool in-place digest) cuts placement digest by ~2× without XMem lock contention (113.2M mips digested in 14.8% of wall time in the 74-window default-mode run). After #474 and #475, the next largest CPU cost in #464 section-backed mode is the per-texture GuestRuns access-hold churn (27.2M acquires in placement resolve = 8.5% wall + 27.2M releases in unaccounted = 18.6% wall).
<!-- greyfinch-sync:brcly/TuxBox:comment:7256561930 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7256561930). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-11-29T13:28:17Z. --- Seeing the exact same trade-off on an RX 6900 XT (`1002:73bf`, 16 GB, RADV, Mesa 26.3.1, GE-Proton11-14, 3840x2160, offline): - **Default `#464` section-backed `main` (`6e2c5dab` + #474 + #475):** stayed alive for 17+ min (`74` 3D world windows / `458 s` in-world, `0` crashes, `0` GPU faults — confirming `#464` eliminates the `#456` late-world crash), but world cadence drops to **`12–24 s/frame`** because every submit checks all section-backed textures (`~398k` textures / `~34 GiB` per 5 s window, vs `~2.5 GiB` with private views). - **`TUXBOX_XMEM_PRIVATE_VIEWS=1` (with #462 + #474 + #475):** world cadence is **`3.39 s/frame`** (best window **`2.75 s/frame`**), with zero GPU faults or `ERROR_BUSY` up to the known late-world `#456` point. Two notes from profiling both modes that may help here and on RX 6600: 1. **#475** (skipping unchanged `UNTRACKED` `Watch::rearm` calls + 16 MiB `PrivateArena` slabs + 4 MiB chunked `PrivateSpan` reservations) skips tens of millions of redundant `SECTION` rearms on default `main` (`27.2M` in the 74-window run), and in `TUXBOX_XMEM_PRIVATE_VIEWS=1` mode cuts Wine `PrivateSpan` VMAs by **22×** (`~97,290 → 4,449`) and `GetWriteWatch` runs/scan by **11.5×** (`4,258 → 369`). Reducing ~97k Wine VMAs down to ~4.4k may also help the startup slowdown you saw with the write watch on an 8 GB / smaller CPU budget. 2. **#474** (lock-free parallel `CheckPool` in-place digest) cuts `placement digest` by ~2× without XMem lock contention (`113.2M` mips digested in `14.8%` of wall time in the 74-window default-mode run). After `#474` and `#475`, the next largest CPU cost in `#464` section-backed mode is the per-texture `GuestRuns` access-hold churn (`27.2M` acquires in `placement resolve` = `8.5%` wall + `27.2M` releases in `unaccounted` = `18.6%` wall).
1093i3511 commented 2026-11-29 13:38:49 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-11-29T13:38:49Z.


Thanks both. A repeat of the TUXBOX_XMEM_PRIVATE_VIEWS=1 run on main 6e2c5dab, same card, and answers to your points.

The repeat run matches the first one.

Private views run 1 (above) Private views run 2
Presents per 10 s from launch 780, 765, 690, 689, 908 545, 748, 676, 692, 869
In the world about 350 s, 57 frames about 260 s, 45 frames (F:1204–F:1249)
Peak card GTT / RAM / swap 12.8 / 28.2 / 17.3 GB 12.3 / 27.6 / 16.3 GB
write fault not promoted none none
Ending host-page fault, then the watchdog host-page fault, then exit 3 after 690 s

Run 2's fault came at 14:30:57, at host pages 0x8002ca6b0000 (7 lines) and 0x8002ca6b1000 (3), with 18 more suppressed. The comp_1.3.1 and gfx_0.0.0 ring resets both succeeded. The game then stopped with EXCEPTION_BREAKPOINT from the same main-thread wait as the watchdog (+0x2215ECA).

@NickStallman:

  • The XCRDAPI.dll access violation didn't show up here. Neither private-views run had an exception with xcrdapi in its backtrace. But neither run got as far past the story load as yours, so it may just not have had the chance.
  • The 4–5× drop isn't capped here. At 60 Hz the 5090 only shows a dip in one window. Here the whole start, including the logo, runs at 160–270 presents per 10 s with #464, against 670–910 without it.
  • On the host-page fault: our faults are also reads, always one or two adjacent 4 KiB pages at host addresses, followed by a successful ring reset. I can't tell from the kernel log whether the memory was unmapped before. If your traced rerun without #459 gives something to compare, I'm happy to run the same trace here.

@DrArroway: thanks for #474 and #475. The fewer Wine VMAs and GetWriteWatch runs sound like what an 8 GB machine with less CPU headroom needs. I'll run main with #474 and #475 here, in both modes: the default with #464, and TUXBOX_XMEM_PRIVATE_VIEWS=1. Then I'll report the start pace and the world cadence.

<!-- greyfinch-sync:brcly/TuxBox:comment:7256694956 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7256694956). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-11-29T13:38:49Z. --- Thanks both. A repeat of the `TUXBOX_XMEM_PRIVATE_VIEWS=1` run on `main` `6e2c5dab`, same card, and answers to your points. **The repeat run matches the first one.** | | Private views run 1 (above) | Private views run 2 | | --- | --- | --- | | Presents per 10 s from launch | 780, 765, 690, 689, 908 | 545, 748, 676, 692, 869 | | In the world | about 350 s, 57 frames | about 260 s, 45 frames (F:1204–F:1249) | | Peak card GTT / RAM / swap | 12.8 / 28.2 / 17.3 GB | 12.3 / 27.6 / 16.3 GB | | `write fault not promoted` | none | none | | Ending | host-page fault, then the watchdog | host-page fault, then exit 3 after 690 s | Run 2's fault came at 14:30:57, at host pages `0x8002ca6b0000` (7 lines) and `0x8002ca6b1000` (3), with 18 more suppressed. The `comp_1.3.1` and `gfx_0.0.0` ring resets both succeeded. The game then stopped with `EXCEPTION_BREAKPOINT` from the same main-thread wait as the watchdog (`+0x2215ECA`). @NickStallman: - **The `XCRDAPI.dll` access violation didn't show up here.** Neither private-views run had an exception with `xcrdapi` in its backtrace. But neither run got as far past the story load as yours, so it may just not have had the chance. - **The 4–5× drop isn't capped here.** At 60 Hz the 5090 only shows a dip in one window. Here the whole start, including the logo, runs at 160–270 presents per 10 s with #464, against 670–910 without it. - **On the host-page fault:** our faults are also reads, always one or two adjacent 4 KiB pages at host addresses, followed by a successful ring reset. I can't tell from the kernel log whether the memory was unmapped before. If your traced rerun without #459 gives something to compare, I'm happy to run the same trace here. @DrArroway: thanks for #474 and #475. The fewer Wine VMAs and `GetWriteWatch` runs sound like what an 8 GB machine with less CPU headroom needs. I'll run `main` with #474 and #475 here, in both modes: the default with #464, and `TUXBOX_XMEM_PRIVATE_VIEWS=1`. Then I'll report the start pace and the world cadence.
1093i3511 commented 2026-11-29 14:05:06 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-11-29T14:05:06Z.


@DrArroway, here are #474 and #475 on the RX 6600, as promised above. I ran main 6e2c5dab + #474 (df2a6a93) + #475 (9f9266ec), merged locally, once in each mode (Lanes 27/27).

Default (#464 section backing) TUXBOX_XMEM_PRIVATE_VIEWS=1
Presents per 10 s from launch 168, 169, 159, 162, 240, 275 705, 778, 703, 715, 906, 395
Same mode on main without #474/#475 179, 172, 160, 161, 242, 274 780, 765, 690, 689, 908, 410
In the world about 90 s, 8 frames (F:1095–F:1103) about 30 s, 8 frames (F:1185–F:1193)
Ending host-page fault at 14:51:25, 2,009 lines suppressed, gfx_0.0.0 reset, watchdog (exit 5, 603 s) host-page fault at 15:00:08, 42 suppressed, gfx_0.0.0 reset, watchdog (exit 5, 497 s)
  • The start doesn't change with #474 and #475 on this card, in either mode. With #464's section backing it stays at about 160–275 presents per 10 s.
  • Both runs hit the host-page fault early in the world, at 0x800327390000/…391000 and 0x80033cf00000/…f01000, the same two-adjacent-pages shape, so they don't say much about the world cadence. With one run per mode, I can't tell whether reaching the fault sooner has anything to do with the two PRs.
<!-- greyfinch-sync:brcly/TuxBox:comment:7257027437 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7257027437). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-11-29T14:05:06Z. --- @DrArroway, here are #474 and #475 on the RX 6600, as promised above. I ran `main` `6e2c5dab` + #474 (`df2a6a93`) + #475 (`9f9266ec`), merged locally, once in each mode (Lanes 27/27). | | Default (#464 section backing) | `TUXBOX_XMEM_PRIVATE_VIEWS=1` | | --- | --- | --- | | Presents per 10 s from launch | 168, 169, 159, 162, 240, 275 | 705, 778, 703, 715, 906, 395 | | Same mode on `main` without #474/#475 | 179, 172, 160, 161, 242, 274 | 780, 765, 690, 689, 908, 410 | | In the world | about 90 s, 8 frames (F:1095–F:1103) | about 30 s, 8 frames (F:1185–F:1193) | | Ending | host-page fault at 14:51:25, 2,009 lines suppressed, `gfx_0.0.0` reset, watchdog (exit 5, 603 s) | host-page fault at 15:00:08, 42 suppressed, `gfx_0.0.0` reset, watchdog (exit 5, 497 s) | - **The start doesn't change with #474 and #475** on this card, in either mode. With #464's section backing it stays at about 160–275 presents per 10 s. - **Both runs hit the host-page fault early in the world**, at `0x800327390000`/`…391000` and `0x80033cf00000`/`…f01000`, the same two-adjacent-pages shape, so they don't say much about the world cadence. With one run per mode, I can't tell whether reaching the fault sooner has anything to do with the two PRs.
gtb-sbe commented 2026-11-29 16:49:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-11-29T16:49:44Z.


On an RX 9060 XT (RDNA 4, 1002:7590, RADV, Mesa 26.2.6, GE-Proton11-14, Linux 6.18.60, 32 GB RAM) I see the same slowdown with #464's section backing, and I found a second per-submit cost besides the placement digest: the shadow sync that runs before every submission. It isn't in any submit profile stage, so it's easy to miss.

My build was main 6e2c5dab with #441 on top, so without #474 and #475. Neither of them touches heap/shadow.rs or commands/submit.rs, so this part is the same on current main.

What the profile shows

With TUXBOX_SUBMIT_PROFILE=1, the direct queue spends 1.5-5.0 s of every 5 s window inside ExecuteCommandLists at the loading screen, while placement takes only 0.1-0.3 s of it and the host submit under 1 ms. A build before #464 (7d26508 plus a few PRs) spent 0.1-1.6 s per 5 s in batches in the same phase.

Where the time goes

This card's host profile says section-import=substituted, so every import of section-backed pages goes through #200's anonymous shadow copy. Since #464 the physical pages are section-backed from the start, so that's most title memory the GPU reads. execute_locked calls sync_shadow_imports() before every batch, and sync_cpu_writes runs diff_copy_chunks over the whole of every live shadow, whether or not the batch uses it.

I put a timer around it (a local patch, not meant for merging). One run: about 6 minutes from launch to the world, then 35 minutes in the world:

Phase Shadows (memory ledger) Shadow sync per direct batch Share of direct batch time
Loading screen about 1.5 GiB in ~460 80-110 ms 81-95 %
World, first 5 minutes 3.9-4.1 GiB in ~11,000 130-160 ms typical, 234 ms on average 47 % (placement another 49 %)
World, all 35 minutes up to 4.3 GiB in ~12,500 158 ms on average 30 % (placement another 69 %)
  • The compute queues sync too. There a single sync sometimes takes 1.4-1.8 s, I guess while it waits on locks the direct queue holds.
  • The CBV/SRV mirrors and the index-map refresh next to it are negligible, under 12 ms per window.
  • The ledger counts the shadows as system memory, so they also hold up to 4.3 GiB of RAM here.

So on a host that substitutes section imports, #464 turns more and more title memory into shadows, and every submission pays for diffing all of them. That would fit TUXBOX_PLACEMENT_WATCH=0 making no difference on your RX 6600. It would also fit TUXBOX_XMEM_PRIVATE_VIEWS=1 bringing the start back, since private views shouldn't need shadows; I haven't checked that. With #474 halving the digest, I'd expect the shadow sync to become a larger share of what's left in the world.

Ideas

  • Sync only the shadows the batch's lists import, instead of every live shadow.
  • Track CPU writes to the shadowed pages, so a clean shadow costs nothing. XMem knows which pages it hands out writable, or the shadow could protect its guest range and catch the first write.
  • Time it as its own submit profile stage, so it shows up in the profile.

cc @DrArroway (#200) @Jerkin42 (#464)

<!-- greyfinch-sync:brcly/TuxBox:comment:7259208393 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7259208393). Originally posted by [gtb-sbe](https://github.com/gtb-sbe) on 2026-11-29T16:49:44Z. --- On an RX 9060 XT (RDNA 4, `1002:7590`, RADV, Mesa 26.2.6, GE-Proton11-14, Linux 6.18.60, 32 GB RAM) I see the same slowdown with #464's section backing, and I found a second per-submit cost besides the placement digest: the shadow sync that runs before every submission. It isn't in any `submit profile` stage, so it's easy to miss. My build was `main` `6e2c5dab` with #441 on top, so without #474 and #475. Neither of them touches `heap/shadow.rs` or `commands/submit.rs`, so this part is the same on current `main`. ### What the profile shows With `TUXBOX_SUBMIT_PROFILE=1`, the direct queue spends 1.5-5.0 s of every 5 s window inside `ExecuteCommandLists` at the loading screen, while `placement` takes only 0.1-0.3 s of it and the host submit under 1 ms. A build before #464 (`7d26508` plus a few PRs) spent 0.1-1.6 s per 5 s in batches in the same phase. ### Where the time goes This card's host profile says `section-import=substituted`, so every import of section-backed pages goes through #200's anonymous shadow copy. Since #464 the physical pages are section-backed from the start, so that's most title memory the GPU reads. `execute_locked` calls `sync_shadow_imports()` before every batch, and `sync_cpu_writes` runs `diff_copy_chunks` over the whole of every live shadow, whether or not the batch uses it. I put a timer around it (a local patch, not meant for merging). One run: about 6 minutes from launch to the world, then 35 minutes in the world: | Phase | Shadows (memory ledger) | Shadow sync per direct batch | Share of direct batch time | | --- | --- | --- | --- | | Loading screen | about 1.5 GiB in ~460 | 80-110 ms | 81-95 % | | World, first 5 minutes | 3.9-4.1 GiB in ~11,000 | 130-160 ms typical, 234 ms on average | 47 % (placement another 49 %) | | World, all 35 minutes | up to 4.3 GiB in ~12,500 | 158 ms on average | 30 % (placement another 69 %) | - The compute queues sync too. There a single sync sometimes takes 1.4-1.8 s, I guess while it waits on locks the direct queue holds. - The CBV/SRV mirrors and the index-map refresh next to it are negligible, under 12 ms per window. - The ledger counts the shadows as system memory, so they also hold up to 4.3 GiB of RAM here. So on a host that substitutes section imports, #464 turns more and more title memory into shadows, and every submission pays for diffing all of them. That would fit `TUXBOX_PLACEMENT_WATCH=0` making no difference on your RX 6600. It would also fit `TUXBOX_XMEM_PRIVATE_VIEWS=1` bringing the start back, since private views shouldn't need shadows; I haven't checked that. With #474 halving the digest, I'd expect the shadow sync to become a larger share of what's left in the world. ### Ideas - Sync only the shadows the batch's lists import, instead of every live shadow. - Track CPU writes to the shadowed pages, so a clean shadow costs nothing. XMem knows which pages it hands out writable, or the shadow could protect its guest range and catch the first write. - Time it as its own `submit profile` stage, so it shows up in the profile. cc @DrArroway (#200) @Jerkin42 (#464)
DrArroway commented 2026-11-29 17:22:46 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-29T17:22:46Z.


@gtb-sbe's RX 9060 XT measurement matches what I see on an RX 6900 XT (1002:73bf, Mesa RADV, GE-Proton11-14, Ryzen 9 7900X): on section-import=substituted hosts, the 4–5× startup and video slowdown after #464 comes from sync_shadow_imports() diffing every live shadow buffer on every batch, outside any submit profile stage.

On my runs, Shadows grew from 174 MiB (menu) to 742 MiB (video) to 2.17–3.90 GiB (world). In menu and video, sync_shadow_imports() burned ~96% of submission wall time (~4.8 s out of every 5 s window). Even after parallelizing sync_shadow_imports() across 12 workers with single-read 64 KiB guarded digests, scanning those buffers on every batch hits a ~43 GiB/s physical DDR5 read-bandwidth ceiling, capping video at 18.5 FPS.

ProjectScarlett measurements (RX 6900 XT, TUXBOX_SUBMIT_PROFILE=1)

Build / Mode Menu FPS Video FPS 3D World Shadow buffers Notes
#464 baseline (main + #474/#475) 41 FPS 10 FPS 12–23 s/frame (placement 245.5 ms/b) up to ~4 GiB sync_shadow_imports() unprofiled
PR #495 (placement run cache + XMem seqlock/rearm) 41 FPS 10 FPS 4.7–12 s/frame (placement 137.3 ms/b, resolve 5.08 ms/b) ~3.9 GiB (10,580) Cuts placement digest/resolve overhead
PR #498 (Stage::Shadow + parallel 64 KiB guarded shadow sync) 104 FPS 18.5 FPS — 174–742 MiB shadow 4.3 ms/b (40.5 GiB/s) menu, 17.4 ms/b (42.6 GiB/s) video
PR #501 (TUXBOX_XMEM_PRIVATE_VIEWS=1 hybrid private views + #456 fix) 144 FPS 29–33 FPS 2.75–4.3 s/frame (14+ frames) 0 MiB (0 shadows) 0 #456 / secondary-alias / xcrdapi / 0x80004001 faults

Split PRs (all verified with tuxbox.py check on both 1002:73bf and 1002:164e)

  1. #495 — xmem, d3d12: cache placement backing runs across clean section-backed textures (caches clean placement RunMaps lock-free via TuxBoxPhysicalMappingState seqlock and speeds up XMem rearm).
  2. #498 — d3d12: parallelize shadow page sync with guarded 64 KiB digests and surface Stage::Shadow (adds Stage::Shadow to TUXBOX_SUBMIT_PROFILE=1 and replaces 2×-read per-page VirtualQuery shadow diffing with parallel guarded 64 KiB block digests).
  3. #501 — xmem, xcrdapi, d3d12: fix hybrid private-views aliasing and mixed buffer imports (keeps TUXBOX_XMEM_PRIVATE_VIEWS=1 opt-in while fixing the #456 paths: xcrdapi TuxBoxAcquirePhysicalAccess routing, eager SharedSection promotion on a second 0x21 CPU aperture mapping, transient non-import VEH retry, and per-piece shadow mirroring in import_scattered_buffer).

@1093i3511 @gtb-sbe @NickStallman @Jerkin42 — if you can test PR #501 with TUXBOX_XMEM_PRIVATE_VIEWS=1 past the first story mission (the #456 repro point), that will tell us whether it's ready to make hybrid private views the default again.

(One unrelated note for debugging: without #441, both default #464 and TUXBOX_XMEM_PRIVATE_VIEWS=1 still hit the same TCP read host-page GPUVM fault around ~94.6% VRAM on RADV — e.g., 0x80032e952000 in default mode and 0x8002b9f31000 / 0x800100151000 with PRIVATE_VIEWS=1.)

<!-- greyfinch-sync:brcly/TuxBox:comment:7259643754 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7259643754). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-11-29T17:22:46Z. --- @gtb-sbe's RX 9060 XT measurement matches what I see on an **RX 6900 XT (`1002:73bf`, Mesa RADV, GE-Proton11-14, Ryzen 9 7900X)**: on `section-import=substituted` hosts, the 4–5× startup and video slowdown after `#464` comes from `sync_shadow_imports()` diffing every live shadow buffer on every batch, outside any `submit profile` stage. On my runs, `Shadows` grew from **174 MiB** (menu) to **742 MiB** (video) to **2.17–3.90 GiB** (world). In menu and video, `sync_shadow_imports()` burned ~96% of submission wall time (~4.8 s out of every 5 s window). Even after parallelizing `sync_shadow_imports()` across 12 workers with single-read 64 KiB guarded digests, scanning those buffers on every batch hits a **~43 GiB/s physical DDR5 read-bandwidth ceiling**, capping video at **18.5 FPS**. ### ProjectScarlett measurements (RX 6900 XT, `TUXBOX_SUBMIT_PROFILE=1`) | Build / Mode | Menu FPS | Video FPS | 3D World | Shadow buffers | Notes | | --- | --- | --- | --- | --- | --- | | `#464` baseline (`main` + `#474`/`#475`) | 41 FPS | 10 FPS | 12–23 s/frame (`placement` 245.5 ms/b) | up to ~4 GiB | `sync_shadow_imports()` unprofiled | | **PR #495** (placement run cache + XMem seqlock/rearm) | 41 FPS | 10 FPS | 4.7–12 s/frame (`placement` 137.3 ms/b, `resolve` 5.08 ms/b) | ~3.9 GiB (10,580) | Cuts placement digest/resolve overhead | | **PR #498** (`Stage::Shadow` + parallel 64 KiB guarded shadow sync) | 104 FPS | 18.5 FPS | — | 174–742 MiB | `shadow` 4.3 ms/b (40.5 GiB/s) menu, 17.4 ms/b (42.6 GiB/s) video | | **PR #501** (`TUXBOX_XMEM_PRIVATE_VIEWS=1` hybrid private views + `#456` fix) | **144 FPS** | **29–33 FPS** | **2.75–4.3 s/frame** (14+ frames) | **0 MiB** (`0` shadows) | `0` `#456` / secondary-alias / `xcrdapi` / `0x80004001` faults | ### Split PRs (all verified with `tuxbox.py check` on both `1002:73bf` and `1002:164e`) 1. **#495** — `xmem, d3d12: cache placement backing runs across clean section-backed textures` (caches clean placement `RunMap`s lock-free via `TuxBoxPhysicalMappingState` seqlock and speeds up XMem `rearm`). 2. **#498** — `d3d12: parallelize shadow page sync with guarded 64 KiB digests and surface Stage::Shadow` (adds `Stage::Shadow` to `TUXBOX_SUBMIT_PROFILE=1` and replaces `2×`-read per-page `VirtualQuery` shadow diffing with parallel guarded 64 KiB block digests). 3. **#501** — `xmem, xcrdapi, d3d12: fix hybrid private-views aliasing and mixed buffer imports` (keeps `TUXBOX_XMEM_PRIVATE_VIEWS=1` opt-in while fixing the `#456` paths: `xcrdapi` `TuxBoxAcquirePhysicalAccess` routing, eager `SharedSection` promotion on a second `0x21` CPU aperture mapping, transient non-import VEH retry, and per-piece shadow mirroring in `import_scattered_buffer`). @1093i3511 @gtb-sbe @NickStallman @Jerkin42 — if you can test **PR #501 with `TUXBOX_XMEM_PRIVATE_VIEWS=1`** past the first story mission (the `#456` repro point), that will tell us whether it's ready to make hybrid private views the default again. *(One unrelated note for debugging: without `#441`, both default `#464` and `TUXBOX_XMEM_PRIVATE_VIEWS=1` still hit the same `TCP` read host-page GPUVM fault around ~94.6% VRAM on RADV — e.g., `0x80032e952000` in default mode and `0x8002b9f31000` / `0x800100151000` with `PRIVATE_VIEWS=1`.)*
ReverendOzmund commented 2026-11-29 17:27:49 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by ReverendOzmund on 2026-11-29T17:27:49Z.


Data point from NVIDIA: RTX 3080 Ti, driver 620.73.04, GE-Proton11-14, current main plus #441. The host profile reports section-import=aliased and the log never says game memory is copied, so no shadows are made and this sync costs nothing there. NVIDIA's slowdown since #464 is the placement digest, which #474 targets.

So the shadow sync is RADV-only (or wherever section imports are substituted), which makes your first idea, syncing only the shadows a batch's lists import, the bigger win there. I've opened a small PR that times the sync as its own mirror stage in TUXBOX_SUBMIT_PROFILE, so it shows up on any host: #507

<!-- greyfinch-sync:brcly/TuxBox:comment:7259710700 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7259710700). Originally posted by [ReverendOzmund](https://github.com/ReverendOzmund) on 2026-11-29T17:27:49Z. --- Data point from NVIDIA: RTX 3080 Ti, driver 620.73.04, GE-Proton11-14, current main plus #441. The host profile reports `section-import=aliased` and the log never says game memory is copied, so no shadows are made and this sync costs nothing there. NVIDIA's slowdown since #464 is the placement digest, which #474 targets. So the shadow sync is RADV-only (or wherever section imports are substituted), which makes your first idea, syncing only the shadows a batch's lists import, the bigger win there. I've opened a small PR that times the sync as its own `mirror` stage in `TUXBOX_SUBMIT_PROFILE`, so it shows up on any host: #507
ReverendOzmund commented 2026-11-29 17:33:05 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by ReverendOzmund on 2026-11-29T17:33:05Z.


NVIDIA data point: RTX 3080 Ti, driver 620.73.04, GE-Proton11-14. The host profile reports section-import=aliased and the log never says game memory is copied, so NVIDIA makes no shadows and the shadow sync costs nothing there. Our slowdown since #464 is the placement digest. I opened #507 to time the sync before I saw #498, which covers it, so I've closed mine.

I'll test #501 with TUXBOX_XMEM_PRIVATE_VIEWS=1 on the 3080 Ti next and post frame times and whether it gets past the first story mission.

<!-- greyfinch-sync:brcly/TuxBox:comment:7259779667 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7259779667). Originally posted by [ReverendOzmund](https://github.com/ReverendOzmund) on 2026-11-29T17:33:05Z. --- NVIDIA data point: RTX 3080 Ti, driver 620.73.04, GE-Proton11-14. The host profile reports `section-import=aliased` and the log never says game memory is copied, so NVIDIA makes no shadows and the shadow sync costs nothing there. Our slowdown since #464 is the placement digest. I opened #507 to time the sync before I saw #498, which covers it, so I've closed mine. I'll test #501 with TUXBOX_XMEM_PRIVATE_VIEWS=1 on the 3080 Ti next and post frame times and whether it gets past the first story mission.
1093i3511 commented 2026-11-29 17:43:15 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-11-29T17:43:15Z.


@DrArroway, thanks, I'm on it. The RX 6600 (8 GB, RADV, section-import=substituted) is preparing main fd636d09 with #501 and #389 merged on top (in place of #441, which was closed in favour of #389). Lanes passed 27/27 on it. I'll run it with TUXBOX_XMEM_PRIVATE_VIEWS=1 and report whether it gets past the host-page fault and the first story mission. Our host-page faults so far were TCP reads of one to three adjacent pages at 0x8001…–0x8005…, which fits your note about running without #441.

The shader preparation for this main is slow here, so the result may take a while.

<!-- greyfinch-sync:brcly/TuxBox:comment:7259911740 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7259911740). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-11-29T17:43:15Z. --- @DrArroway, thanks, I'm on it. The RX 6600 (8 GB, RADV, `section-import=substituted`) is preparing `main` `fd636d09` with #501 and #389 merged on top (in place of #441, which was closed in favour of #389). Lanes passed 27/27 on it. I'll run it with `TUXBOX_XMEM_PRIVATE_VIEWS=1` and report whether it gets past the host-page fault and the first story mission. Our host-page faults so far were TCP reads of one to three adjacent pages at `0x8001…`–`0x8005…`, which fits your note about running without #441. The shader preparation for this `main` is slow here, so the result may take a while.
gtb-sbe commented 2026-11-29 18:35:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-11-29T18:35:41Z.


I ran #501 with TUXBOX_XMEM_PRIVATE_VIEWS=1 on my RX 9060 XT. It made no shadows at all and made the world about 1.5 times faster for the first few minutes. Then, at game time 6:14 in the intro, a secondary-alias promotion failed with ERROR_BUSY. The numbers, the log line, and what the old shadow sync was actually finding are in https://github.com/brcly/TuxBox/pull/501#issuecomment-7260594403.

<!-- greyfinch-sync:brcly/TuxBox:comment:7260605545 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7260605545). Originally posted by [gtb-sbe](https://github.com/gtb-sbe) on 2026-11-29T18:35:41Z. --- I ran #501 with `TUXBOX_XMEM_PRIVATE_VIEWS=1` on my RX 9060 XT. It made no shadows at all and made the world about 1.5 times faster for the first few minutes. Then, at game time 6:14 in the intro, a secondary-alias promotion failed with `ERROR_BUSY`. The numbers, the log line, and what the old shadow sync was actually finding are in https://github.com/brcly/TuxBox/pull/501#issuecomment-7260594403.
gtb-sbe commented 2026-11-29 19:57:14 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-11-29T19:57:14Z.


I looked into why my default-mode runs kept ending in the intro with the game clock at 3:00 (Unsignaled CrossQueueBarrier in the crash log), and then tested DrArroway's merged perf PRs against it. RX 9060 XT (RADV, Mesa 26.2.6), GE-Proton11-14, Ryzen 7 5800X, dual-channel DDR4-3600.

What the ends were: the title's main-thread heartbeat watchdog (exe+0x2215A60: 30 one-second checks with an unchanged heartbeat at +0x71B6338), not a deadlock. In both minidumps rbx = rbp = 0 at the crash, which is the heartbeat path (the 300 s thread check enters with 30 in both), and the last heartbeat seen was 29-30 s old. The label waits kept advancing frame by frame until the end. "3:00" is just the intro's starting clock; almost all my crash logs since the 27th show it.

Why the heartbeat stalled: the title submits to every queue from one thread, and in the world that thread was inside ExecuteCommandLists ~100 % of the time: placement ~70 % (mostly the in-place digest, ~53 GiB read per frame), shadow sync ~27 %. Frames took 17-24 s, so now and then one main-thread wait passed 30 s. At the crash the thread was in placement::submit -> texture refresh -> XMem rearm.

A/B with the perf PRs: same base as those runs (6e2c5dab + #441), same shader cache, plus only #474, #475, #478 (#495 needs it), #495 and #498, and a small sampler for the heartbeat:

before with the PRs
World frame ~21 s ~12 s
Submitting thread inside ExecuteCommandLists ~98 % 72 %
Digest rate 14 GiB/s 35 GiB/s
Where it ended watchdog at clock 3:00 clock 11:28, daylight, opening credits still rolling

So the PRs get it past the point where it always died here. Thanks, DrArroway.

What's left on this machine:

  • Heartbeat margin: the longest heartbeat stall was still 27.3 s, with four over 25 s in 33 minutes, so the watchdog is rarer here, not gone.
  • Publication is now the largest placement stage. Its store step ran at 0.14 GiB/s, against 0.68 GiB/s before on about the same work (3,156 vs. 3,175 stores, 4.7 vs. 5.0 GiB over 12 frames). Only one line in writeback.rs changed in that path. My guess is contention with the new digest and shadow pools (8 workers each on my 8-core CPU), but I haven't tested that, since there's no override for the pool sizes.
  • Single long batches: some batches still take 10-13 s, for example one compute batch with a 4.1 s placement flush and a 2.3 s resolve.
  • The count of skipped texture dependencies: "texture dependency on work behind a label wait left to the title" reached #524,288, against #16,384 for a whole run before. I haven't looked into it.

That run ended on something new: the title hit an int3 in a lock-free pool allocator (exe+0x63966F) whose free list was empty. I don't know yet which pool it is, or whether slow frames are what fill it.

<!-- greyfinch-sync:brcly/TuxBox:comment:7261689507 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7261689507). Originally posted by [gtb-sbe](https://github.com/gtb-sbe) on 2026-11-29T19:57:14Z. --- I looked into why my default-mode runs kept ending in the intro with the game clock at 3:00 (`Unsignaled CrossQueueBarrier` in the crash log), and then tested DrArroway's merged perf PRs against it. RX 9060 XT (RADV, Mesa 26.2.6), GE-Proton11-14, Ryzen 7 5800X, dual-channel DDR4-3600. **What the ends were:** the title's main-thread heartbeat watchdog (`exe+0x2215A60`: 30 one-second checks with an unchanged heartbeat at `+0x71B6338`), not a deadlock. In both minidumps `rbx = rbp = 0` at the crash, which is the heartbeat path (the 300 s thread check enters with 30 in both), and the last heartbeat seen was 29-30 s old. The label waits kept advancing frame by frame until the end. "3:00" is just the intro's starting clock; almost all my crash logs since the 27th show it. **Why the heartbeat stalled:** the title submits to every queue from one thread, and in the world that thread was inside `ExecuteCommandLists` ~100 % of the time: placement ~70 % (mostly the in-place digest, ~53 GiB read per frame), shadow sync ~27 %. Frames took 17-24 s, so now and then one main-thread wait passed 30 s. At the crash the thread was in `placement::submit` -> texture refresh -> XMem `rearm`. **A/B with the perf PRs:** same base as those runs (`6e2c5dab` + #441), same shader cache, plus only #474, #475, #478 (#495 needs it), #495 and #498, and a small sampler for the heartbeat: | | before | with the PRs | | --- | --- | --- | | World frame | ~21 s | ~12 s | | Submitting thread inside `ExecuteCommandLists` | ~98 % | 72 % | | Digest rate | 14 GiB/s | 35 GiB/s | | Where it ended | watchdog at clock 3:00 | clock 11:28, daylight, opening credits still rolling | So the PRs get it past the point where it always died here. Thanks, DrArroway. **What's left on this machine:** - **Heartbeat margin:** the longest heartbeat stall was still 27.3 s, with four over 25 s in 33 minutes, so the watchdog is rarer here, not gone. - **Publication is now the largest placement stage.** Its store step ran at 0.14 GiB/s, against 0.68 GiB/s before on about the same work (3,156 vs. 3,175 stores, 4.7 vs. 5.0 GiB over 12 frames). Only one line in `writeback.rs` changed in that path. My guess is contention with the new digest and shadow pools (8 workers each on my 8-core CPU), but I haven't tested that, since there's no override for the pool sizes. - **Single long batches:** some batches still take 10-13 s, for example one compute batch with a 4.1 s placement flush and a 2.3 s resolve. - **The count of skipped texture dependencies:** "texture dependency on work behind a label wait left to the title" reached #524,288, against #16,384 for a whole run before. I haven't looked into it. That run ended on something new: the title hit an `int3` in a lock-free pool allocator (`exe+0x63966F`) whose free list was empty. I don't know yet which pool it is, or whether slow frames are what fill it.
1093i3511 commented 2026-11-29 20:01:54 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-11-29T20:01:54Z.


@DrArroway, the #501 runs on the RX 6600 (8 GB, RADV, Mesa 26.3.1, section-import=substituted): main fd636d09 with #501 and #389 merged on top, TUXBOX_XMEM_PRIVATE_VIEWS=1, GE-Proton11-14. Lanes 27/27. Two runs with the same settings:

Run 1 Run 2
Time in the world about 460 s, 58 world frames (F:1302–F:1360) about 268 s, 43 world frames (F:1249–F:1292)
GPU fault none, no kernel line at all none, no kernel line at all
Where it ended intro (fbk_stry000_FBK_STRY000_INTRO, Prestream) intro, the same
How it ended the title's watchdog, exit 5 after 2,364 s fault not promoted, then an access violation, exit 5 after 852 s
Peak RAM / swap / card GTT 29.9 of 32 / 24.6 / 14.3 GB 30.2 of 32 / 19.3 / 12.8 GB

#389 removes the host-page fault here. In all five earlier private-views runs on this card, without #389, the TCP read fault at a host page ended the run after 30–350 s in the world. Neither of these runs had it.

#501 doesn't fully remove #456 on this card. Run 2 ended on the #456 path, still in the intro, so before the first story mission:

vkd3d_import_host_memory: Failed to import host memory, hr 0x8007000e.
TuxBox xmem: secondary alias 0x8d6690000 fault not promoted (err=170, write=true, token=0x77e20,
  span=0x8d6400000..0x8d67a0000, page_import_held=false, span_import_held=true, page_held=false,
  span_held=true, deferred=2)

The access violation that followed had the backtrace +0x4DA63F8, +0x12DEB4D, +0x465B53, …, +0x2215ECA. So it was a write through a secondary alias while an import held the span (not the page), with system memory nearly full. Failed to import host memory, hr 0x8007000e came 59 times in run 2 and 130 times in run 1, which didn't hit the fault. I can run a build with more logging around that path if it helps.

I had to leave two compute shaders out (TUXBOX_SKIP_SHADERS=35af8e6d,e5fbc632). Without that, RADV crashed twice at the same spot during loading, while compiling a compute pipeline:

err:seh:handle_syscall_fault Syscall stack overrun.
 backtrace: --- Exception 0xc0000005 at ...: libvulkan_radeon.so + 0x9d70d5.
err:vulkan:vkCreateComputePipelines Exception 0xc0000005 in Unix call.
  • What they are: two very large programs (requests d3f0ccbcb73a7369… and bda9b810e5c81052…, 4.8 and 4.2 MB of DXIL).
  • Why they're new: before #482, their HLSL was over the 8 MiB compiler budget and they got empty stand-ins. #482's smaller HLSL brings them under it, so the driver now compiles them for the first time, and its compile overflows its stack.
  • A third one, 8ae931bd (request feb4cf082da14d24…, 3.4 MB of DXIL), never finishes compiling in RADV. It compiled before #482. Now it was still running after 2,330 s in run 1 and after 815 s in run 2, each time until the run ended. The game doesn't wait for it, but one vkd3d_queue thread spends the whole run on it, and the game process already held 13 GB during loading. That may be part of the memory pressure behind the failed imports above.
  • #482 itself isn't slower: over 24 recorded requests, DXC took the same time before and after (40.1 s and 40.2 s), with HLSL 10–20 % smaller. It just lets programs through that RADV can't compile.

Next run here: the same settings with 8ae931bd left out as well (TUXBOX_SKIP_SHADERS=35af8e6d,e5fbc632,8ae931bd), and no other change. If the endless compile adds to the memory pressure, the import failures and the not promoted path should become rarer, and the run should get further into the world. I'll report the result.

cc @glovepost (#482)

<!-- greyfinch-sync:brcly/TuxBox:comment:7261750147 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7261750147). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-11-29T20:01:54Z. --- @DrArroway, the #501 runs on the RX 6600 (8 GB, RADV, Mesa 26.3.1, `section-import=substituted`): `main` `fd636d09` with #501 and #389 merged on top, `TUXBOX_XMEM_PRIVATE_VIEWS=1`, GE-Proton11-14. Lanes 27/27. Two runs with the same settings: | | Run 1 | Run 2 | | --- | --- | --- | | Time in the world | about 460 s, 58 world frames (F:1302–F:1360) | about 268 s, 43 world frames (F:1249–F:1292) | | GPU fault | none, no kernel line at all | none, no kernel line at all | | Where it ended | intro (`fbk_stry000_FBK_STRY000_INTRO`, `Prestream`) | intro, the same | | How it ended | the title's watchdog, exit 5 after 2,364 s | `fault not promoted`, then an access violation, exit 5 after 852 s | | Peak RAM / swap / card GTT | 29.9 of 32 / 24.6 / 14.3 GB | 30.2 of 32 / 19.3 / 12.8 GB | **#389 removes the host-page fault here.** In all five earlier private-views runs on this card, without #389, the TCP read fault at a host page ended the run after 30–350 s in the world. Neither of these runs had it. **#501 doesn't fully remove #456 on this card.** Run 2 ended on the #456 path, still in the intro, so before the first story mission: ```text vkd3d_import_host_memory: Failed to import host memory, hr 0x8007000e. TuxBox xmem: secondary alias 0x8d6690000 fault not promoted (err=170, write=true, token=0x77e20, span=0x8d6400000..0x8d67a0000, page_import_held=false, span_import_held=true, page_held=false, span_held=true, deferred=2) ``` The access violation that followed had the backtrace `+0x4DA63F8`, `+0x12DEB4D`, `+0x465B53`, …, `+0x2215ECA`. So it was a write through a secondary alias while an import held the span (not the page), with system memory nearly full. `Failed to import host memory, hr 0x8007000e` came 59 times in run 2 and 130 times in run 1, which didn't hit the fault. I can run a build with more logging around that path if it helps. **I had to leave two compute shaders out (`TUXBOX_SKIP_SHADERS=35af8e6d,e5fbc632`).** Without that, RADV crashed twice at the same spot during loading, while compiling a compute pipeline: ```text err:seh:handle_syscall_fault Syscall stack overrun. backtrace: --- Exception 0xc0000005 at ...: libvulkan_radeon.so + 0x9d70d5. err:vulkan:vkCreateComputePipelines Exception 0xc0000005 in Unix call. ``` - **What they are:** two very large programs (requests `d3f0ccbcb73a7369…` and `bda9b810e5c81052…`, 4.8 and 4.2 MB of DXIL). - **Why they're new:** before #482, their HLSL was over the 8 MiB compiler budget and they got empty stand-ins. #482's smaller HLSL brings them under it, so the driver now compiles them for the first time, and its compile overflows its stack. - **A third one, `8ae931bd` (request `feb4cf082da14d24…`, 3.4 MB of DXIL), never finishes compiling in RADV.** It compiled before #482. Now it was still running after 2,330 s in run 1 and after 815 s in run 2, each time until the run ended. The game doesn't wait for it, but one `vkd3d_queue` thread spends the whole run on it, and the game process already held 13 GB during loading. That may be part of the memory pressure behind the failed imports above. - **#482 itself isn't slower:** over 24 recorded requests, DXC took the same time before and after (40.1 s and 40.2 s), with HLSL 10–20 % smaller. It just lets programs through that RADV can't compile. **Next run here:** the same settings with `8ae931bd` left out as well (`TUXBOX_SKIP_SHADERS=35af8e6d,e5fbc632,8ae931bd`), and no other change. If the endless compile adds to the memory pressure, the import failures and the `not promoted` path should become rarer, and the run should get further into the world. I'll report the result. cc @glovepost (#482)
NickStallman commented 2026-11-29 20:04:20 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-29T20:04:20Z.


Corrected. I first wrote here that the driver was still compiling 8ae931bd (request feb4cf08…) when our runs ended. That was wrong. dxil-spirv (in vkd3d-proton) overflows the 64 MiB stack of the pipeline thread, the thread dies, and the provider keeps reporting "still running". Every run of ours I checked with that 3,455,520-byte DXIL (19) has exactly one Wine virtual_setup_exception stack overflow line; none of the six older runs I checked without it does. It's CS_ScreenProbes_ActivateRays.

The -O0 helper added in #479 runs -simplifycfg, which leaves five blocks returning to the dispatcher loop's header; dxil-spirv allows one. On builds without #479 the program finished on an RTX 5090 in 174 and 161 s. So neither #482 nor #489 is the cause there; whether your RADV hang is the same I can't tell. @1093i3511, does your Wine log have that line? 35af8e6d/e5fbc632 crashing inside libvulkan_radeon look like a different fault.

A one-pass fix is in #535. On main 2d6dc338 this program takes the structured form (#489), which converts, so it should compile there as it is.

<!-- greyfinch-sync:brcly/TuxBox:comment:7261783206 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7261783206). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T20:04:20Z. --- **Corrected.** I first wrote here that the driver was still compiling `8ae931bd` (request `feb4cf08…`) when our runs ended. That was wrong. dxil-spirv (in vkd3d-proton) overflows the 64 MiB stack of the pipeline thread, the thread dies, and the provider keeps reporting "still running". Every run of ours I checked with that 3,455,520-byte DXIL (19) has exactly one Wine `virtual_setup_exception stack overflow` line; none of the six older runs I checked without it does. It's `CS_ScreenProbes_ActivateRays`. The `-O0` helper added in #479 runs `-simplifycfg`, which leaves five blocks returning to the dispatcher loop's header; dxil-spirv allows one. On builds without #479 the program finished on an RTX 5090 in 174 and 161 s. So neither #482 nor #489 is the cause there; whether your RADV hang is the same I can't tell. @1093i3511, does your Wine log have that line? `35af8e6d`/`e5fbc632` crashing inside `libvulkan_radeon` look like a different fault. A one-pass fix is in #535. On main 2d6dc338 this program takes the structured form (#489), which converts, so it should compile there as it is.
DrArroway commented 2026-11-29 20:08:49 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-29T20:08:49Z.


@1093i3511 Thanks a lot for running those RX 6600 tests — and that not promoted line is actually the exact confirmation we needed:

span=0x8d6400000..0x8d67a0000, page_import_held=false, span_import_held=true, page_held=false, span_held=true, deferred=2

No custom logging build is needed for this case: that shows the faulting page itself is not held (page_import_held=false), and promotion is being blocked because a sibling page inside the same 4 MiB PrivateSpan is holding an import / deferred unmap, which prevents detach_private_slot from releasing/re-reserving the span as a whole.

The rebased #501 (cbb6a2df) now also logs [email protected](page_imp=...,span_imp=...,span_held=...,def=...) and handles write=false read faults via a PAGE_READONLY mirror. Once #501 merges, we can tackle sibling-span blocking on write=true in a focused follow-up PR without blocking the #495/#508 rebase.


@gtb-sbe Thanks as well for the detailed #474/#475/#495/#498 A/B numbers (~21 s -> ~12 s per frame, 14 -> 35 GiB/s digest rate, clearing the 3:00 watchdog).

One quick heads-up on #495 (2d6dc338): we also just caught and fixed a #495 check_sequential stale-cache invalidation bug (Watch::rearm clearing WRITTEN before watch_cacheable() checked it) plus a redundant first-upload digest in check_mips_speculative (which also caused the 4 hardware unit-test failures in tuxbox-d3d12). We're running a live check on that fix now before opening a small follow-up PR, and we'll keep your 8-core worker-pool contention note on publication store in mind too.

<!-- greyfinch-sync:brcly/TuxBox:comment:7261844649 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7261844649). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-11-29T20:08:49Z. --- @1093i3511 Thanks a lot for running those RX 6600 tests — and that `not promoted` line is actually the exact confirmation we needed: ```text span=0x8d6400000..0x8d67a0000, page_import_held=false, span_import_held=true, page_held=false, span_held=true, deferred=2 ``` No custom logging build is needed for this case: that shows the faulting page itself is **not** held (`page_import_held=false`), and promotion is being blocked because a sibling page inside the same 4 MiB `PrivateSpan` is holding an import / deferred unmap, which prevents `detach_private_slot` from releasing/re-reserving the span as a whole. The rebased `#501` (`cbb6a2df`) now also logs `[email protected](page_imp=...,span_imp=...,span_held=...,def=...)` and handles `write=false` read faults via a `PAGE_READONLY` mirror. Once `#501` merges, we can tackle sibling-span blocking on `write=true` in a focused follow-up PR without blocking the `#495`/`#508` rebase. --- @gtb-sbe Thanks as well for the detailed `#474`/`#475`/`#495`/`#498` A/B numbers (`~21 s` -> `~12 s` per frame, `14` -> `35 GiB/s` digest rate, clearing the 3:00 watchdog). One quick heads-up on `#495` (`2d6dc338`): we also just caught and fixed a `#495` `check_sequential` stale-cache invalidation bug (`Watch::rearm` clearing `WRITTEN` before `watch_cacheable()` checked it) plus a redundant first-upload digest in `check_mips_speculative` (which also caused the 4 hardware unit-test failures in `tuxbox-d3d12`). We're running a live check on that fix now before opening a small follow-up PR, and we'll keep your 8-core worker-pool contention note on publication `store` in mind too.
DrArroway commented 2026-11-29 21:44:04 +00:00 (Migrated from github.com)
Author
Contributor

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


@1093i3511 @gtb-sbe Quick overnight hand-off update:

  • Opened #550 with the #495 placement run-cache fix (check_sequential watch invalidation + skipping the wasted first-upload digest; verified on RX 6900 XT + AMD Raphael iGPU + live runs).
  • From our live RX 6900 XT test with #501 (cbb6a2df) + #389 + #550 (TUXBOX_XMEM_PRIVATE_VIEWS=1, 584.7s, 15,653 presents, 0 GPUVM faults, 0 shadows), the new blocker= log caught why that write=true #456 fault still triggers: map_private_contiguous (runtime/xmem/src/physical_pages/private_views.rs) creates a single multi-GiB PrivateSpan (0xf00200000..0x1085e00000 = 6.09 GiB) instead of chunking at PRIVATE_SPAN_CHUNK (4 MiB), so one GPU-imported page inside the pool blocks promoting any other unheld page (page_imp=false, span_imp=true).

Posted the full hand-off note on #533 so anyone can pick up map_private_contiguous chunking after #501 lands.

<!-- greyfinch-sync:brcly/TuxBox:comment:7263108018 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7263108018). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-11-29T21:44:04Z. --- @1093i3511 @gtb-sbe Quick overnight hand-off update: - Opened `#550` with the `#495` placement run-cache fix (`check_sequential` watch invalidation + skipping the wasted first-upload digest; verified on RX 6900 XT + AMD Raphael iGPU + live runs). - From our live RX 6900 XT test with `#501` (`cbb6a2df`) + `#389` + `#550` (`TUXBOX_XMEM_PRIVATE_VIEWS=1`, 584.7s, `15,653` presents, `0` GPUVM faults, `0` shadows), the new `blocker=` log caught why that `write=true` `#456` fault still triggers: `map_private_contiguous` (`runtime/xmem/src/physical_pages/private_views.rs`) creates a single multi-GiB `PrivateSpan` (`0xf00200000..0x1085e00000` = **6.09 GiB**) instead of chunking at `PRIVATE_SPAN_CHUNK` (4 MiB), so one GPU-imported page inside the pool blocks promoting any other unheld page (`page_imp=false, span_imp=true`). Posted the full hand-off note on `#533` so anyone can pick up `map_private_contiguous` chunking after `#501` lands.
1093i3511 commented 2026-11-29 23:34:32 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-11-29T23:34:32Z.


An update on the start since #464, now with #474, #475, #495 and #498 merged. This is main 39463ea5 with #527's two acphal commits reverted (#554), in default mode, so section-backed and without private views. RX 6600, warm caches. Presents per 10 s from launch:

Build Presents per 10 s
main 6e2c5dab (with #464, before the perf PRs) 179, 172, 160, 161, 242, 274
main 39463ea5, acphal reverted 424, 494, 564, 588, 470, 582, 597
6e2c5dab with TUXBOX_XMEM_PRIVATE_VIEWS=1, or #464 reverted 780, 765, 690, 689, 908 / 797, 754, 667, 672, 911

The perf PRs roughly triple the start on this card, but it's still clearly below the pre-#464 pace. After the logo came a long slow stretch, about 58–86 presents per 10 s from 11 to 31 minutes. The world was reached after about 35 minutes (mission at F:1685). The title's watchdog ended it after 8 world frames, about 15 s. There was no GPU fault. Peaks: RAM 29.6 of 32 GB, swap 12.1 GB, card GTT 10.7 GB.

So on 8 GB this issue is smaller, but not gone. Next here: #501 with TUXBOX_XMEM_PRIVATE_VIEWS=1 on top of #557, as you asked, @DrArroway.

<!-- greyfinch-sync:brcly/TuxBox:comment:7264563956 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7264563956). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-11-29T23:34:32Z. --- An update on the start since #464, now with #474, #475, #495 and #498 merged. This is `main` `39463ea5` with #527's two acphal commits reverted (#554), in default mode, so section-backed and without private views. RX 6600, warm caches. Presents per 10 s from launch: | Build | Presents per 10 s | | --- | --- | | `main` `6e2c5dab` (with #464, before the perf PRs) | 179, 172, 160, 161, 242, 274 | | `main` `39463ea5`, acphal reverted | 424, 494, 564, 588, 470, 582, 597 | | `6e2c5dab` with `TUXBOX_XMEM_PRIVATE_VIEWS=1`, or #464 reverted | 780, 765, 690, 689, 908 / 797, 754, 667, 672, 911 | **The perf PRs roughly triple the start on this card**, but it's still clearly below the pre-#464 pace. After the logo came a long slow stretch, about 58–86 presents per 10 s from 11 to 31 minutes. The world was reached after about 35 minutes (mission at F:1685). The title's watchdog ended it after 8 world frames, about 15 s. There was no GPU fault. Peaks: RAM 29.6 of 32 GB, swap 12.1 GB, card GTT 10.7 GB. So on 8 GB this issue is smaller, but not gone. Next here: #501 with `TUXBOX_XMEM_PRIVATE_VIEWS=1` on top of #557, as you asked, @DrArroway.
Jerkin42 commented 2026-11-30 00:09:35 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by Jerkin42 on 2026-11-30T00:09:35Z.


Two results from an RX 9060 XT (1002:7590, RDNA 4, RADV, section-import=substituted, same card as @gtb-sbe), offline, Series S.

1. With private views, the write=true alias fault ends the run here too. Build: #501 (cbb6a2df) + #389, TUXBOX_XMEM_PRIVATE_VIEWS=1, cold caches.

  • Before the title, while shaders compiled: 680–880 presents per 10 s. Default mode on 090cf6ce managed 240–390.
  • After the title: 130–170 presents per 10 s.
  • 0 GPU faults, 0 shadows.
  • The game crashed on the loading screen, 16 min after the title (35,541 presents in total), on one access violation:
TuxBox xmem: secondary alias 0x4fc600000 read mirrored as PAGE_READONLY (token=0x9f1b0, [email protected](page_imp=false,span_imp=true,span_held=true,def=0))
TuxBox xmem: secondary alias 0x4fc600000 fault not promoted (err=170, write=true, token=0x9f1b0, span=0x4fc600000..0x4fc800000, page_import_held=false, span_import_held=false, page_held=false, span_held=false, deferred=0, [email protected](...)

The blocking span is 3.88 GiB. This is the same shape as @DrArroway's 6.09 GiB map_private_contiguous span.

2. On this card, the start is not placement checks. I ran an A/B on 090cf6ce in default mode, 5.5 min each, comparing TUXBOX_CHECK_ONCE_PER_FRAME=1 + TUXBOX_CHECK_SAMPLED=1 (a local branch) against no switches.

Switches on No switches
Presents per 10 s, before the title 250–390 240–390
Presents per 10 s, after the title 90–127 88–125
Placement time 8.1 s 7.5 s

About 221–226 s of the ~245 s in direct-queue batches went elsewhere, which is the shadow sync from #498 that this build predates. So I'm not opening that branch as a PR.

<!-- greyfinch-sync:brcly/TuxBox:comment:7265018690 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7265018690). Originally posted by [Jerkin42](https://github.com/Jerkin42) on 2026-11-30T00:09:35Z. --- Two results from an RX 9060 XT (`1002:7590`, RDNA 4, RADV, `section-import=substituted`, same card as @gtb-sbe), offline, Series S. **1. With private views, the `write=true` alias fault ends the run here too.** Build: #501 (`cbb6a2df`) + #389, `TUXBOX_XMEM_PRIVATE_VIEWS=1`, cold caches. - Before the title, while shaders compiled: 680–880 presents per 10 s. Default mode on `090cf6ce` managed 240–390. - After the title: 130–170 presents per 10 s. - 0 GPU faults, 0 shadows. - The game crashed on the loading screen, 16 min after the title (35,541 presents in total), on one access violation: ```text TuxBox xmem: secondary alias 0x4fc600000 read mirrored as PAGE_READONLY (token=0x9f1b0, [email protected](page_imp=false,span_imp=true,span_held=true,def=0)) TuxBox xmem: secondary alias 0x4fc600000 fault not promoted (err=170, write=true, token=0x9f1b0, span=0x4fc600000..0x4fc800000, page_import_held=false, span_import_held=false, page_held=false, span_held=false, deferred=0, [email protected](...) ``` The blocking span is 3.88 GiB. This is the same shape as @DrArroway's 6.09 GiB `map_private_contiguous` span. **2. On this card, the start is not placement checks.** I ran an A/B on `090cf6ce` in default mode, 5.5 min each, comparing `TUXBOX_CHECK_ONCE_PER_FRAME=1` + `TUXBOX_CHECK_SAMPLED=1` (a local branch) against no switches. | | Switches on | No switches | | --- | --- | --- | | Presents per 10 s, before the title | 250–390 | 240–390 | | Presents per 10 s, after the title | 90–127 | 88–125 | | Placement time | 8.1 s | 7.5 s | About 221–226 s of the ~245 s in direct-queue batches went elsewhere, which is the shadow sync from #498 that this build predates. So I'm not opening that branch as a PR.
1093i3511 commented 2026-11-30 00:14:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-11-30T00:14:04Z.


@DrArroway, for #501's needs-check: I ran f482572a + #557 + #501 (cbb6a2df) with TUXBOX_XMEM_PRIVATE_VIEWS=1, twice, on the RX 6600. I left out 35af8e6d, e5fbc632 and 8ae931bd (#535).

Run 1 Run 2
Length 662 s 676 s
World reached (mission set) F:1394, after about 10.5 min F:1364
World frames before the watchdog 3 6
not promoted / blocker= none none
GPU fault or kernel line none none
Peak RAM / swap 30.0 / 4.8 GB 29.7 / 6.6 GB

The start was at the pre-#464 pace again (745, 651, 654, 707, 780 presents per 10 s in run 1). Swap stayed far lower than in my #389 + #501 runs (19–25 GB). Both runs ended on the title's watchdog a few seconds after world entry, still in the intro, so I couldn't get to the first story mission on 8 GB. That needs world frames under the 30 s heartbeat first. So there's no #456 crash in two runs, but they don't show that #456 is fixed.

<!-- greyfinch-sync:brcly/TuxBox:comment:7265085229 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7265085229). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-11-30T00:14:04Z. --- @DrArroway, for #501's `needs-check`: I ran `f482572a` + #557 + #501 (`cbb6a2df`) with `TUXBOX_XMEM_PRIVATE_VIEWS=1`, twice, on the RX 6600. I left out `35af8e6d`, `e5fbc632` and `8ae931bd` (#535). | | Run 1 | Run 2 | | --- | --- | --- | | Length | 662 s | 676 s | | World reached (mission set) | F:1394, after about 10.5 min | F:1364 | | World frames before the watchdog | 3 | 6 | | `not promoted` / `blocker=` | none | none | | GPU fault or kernel line | none | none | | Peak RAM / swap | 30.0 / 4.8 GB | 29.7 / 6.6 GB | The start was at the pre-#464 pace again (745, 651, 654, 707, 780 presents per 10 s in run 1). Swap stayed far lower than in my #389 + #501 runs (19–25 GB). Both runs ended on the title's watchdog a few seconds after world entry, still in the intro, so I couldn't get to the first story mission on 8 GB. That needs world frames under the 30 s heartbeat first. So there's no #456 crash in two runs, but they don't show that #456 is fixed.
Jerkin42 commented 2026-11-30 00:54:47 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by Jerkin42 on 2026-11-30T00:54:47Z.


A follow-up on the 3.88 GiB span, for whoever picks up the map_private_contiguous chunking (@DrArroway's hand-off). I tried the simple version, and it trades the crash for a GPU fault here.

The change: map() and copy_page_mappings call map_private_contiguous once per 4 MiB PRIVATE_SPAN_CHUNK instead of once for the whole range. A unit test checks that a hold in one chunk no longer blocks promoting a page in the next one.

Same build as before otherwise: #501 cbb6a2df + #389 + this, TUXBOX_XMEM_PRIVATE_VIEWS=1, RX 9060 XT. Only xmem.dll differs from my earlier run.

  • The crash is gone: 0 not promoted lines. Both runs reached the earlier run's crash state (about 3,100 placements) in 7 min after the title instead of 16.
  • The GPU fault, twice: both runs then hit an SQC (scalar data) permission fault at about 6.5 min after the title. The addresses were 0x8000fa801000 and 0x8000c3d33000. Each time the gfx ring was reset and the device was lost.
  • What faulted: with TUXBOX_TRACE_GPU_FAULT=1, all 32 unfinished commands were mesh draws, PS cdce1ebe / MS 3ba95711 and PS 019166fc / MS b91b86fc.
  • The cause is likely the imports: the run without chunking had no GPU fault in 16 min. With chunking, the region ledger shows the 3,977 MiB region D3D12 imported as one piece replaced by about 1,000 regions of 4 MiB, each a separate allocation. A buffer that crosses a chunk boundary then becomes a scattered import bound with UpdateTileMappings. My guess is a scalar load landing on a page of such a buffer that isn't bound. I haven't confirmed that.

So chunking the spans probably needs the importer to keep large ranges in one host allocation, or the fix has to promote a page without detaching its whole span. I'm not opening this as a PR.

<!-- greyfinch-sync:brcly/TuxBox:comment:7265682112 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7265682112). Originally posted by [Jerkin42](https://github.com/Jerkin42) on 2026-11-30T00:54:47Z. --- A follow-up on the 3.88 GiB span, for whoever picks up the `map_private_contiguous` chunking (@DrArroway's hand-off). I tried the simple version, and it trades the crash for a GPU fault here. **The change:** `map()` and `copy_page_mappings` call `map_private_contiguous` once per 4 MiB `PRIVATE_SPAN_CHUNK` instead of once for the whole range. A unit test checks that a hold in one chunk no longer blocks promoting a page in the next one. **Same build as before otherwise:** #501 `cbb6a2df` + #389 + this, `TUXBOX_XMEM_PRIVATE_VIEWS=1`, RX 9060 XT. Only `xmem.dll` differs from my earlier run. - **The crash is gone:** 0 `not promoted` lines. Both runs reached the earlier run's crash state (about 3,100 placements) in 7 min after the title instead of 16. - **The GPU fault, twice:** both runs then hit an SQC (scalar data) permission fault at about 6.5 min after the title. The addresses were `0x8000fa801000` and `0x8000c3d33000`. Each time the gfx ring was reset and the device was lost. - **What faulted:** with `TUXBOX_TRACE_GPU_FAULT=1`, all 32 unfinished commands were mesh draws, PS `cdce1ebe` / MS `3ba95711` and PS `019166fc` / MS `b91b86fc`. - **The cause is likely the imports:** the run without chunking had no GPU fault in 16 min. With chunking, the region ledger shows the 3,977 MiB region D3D12 imported as one piece replaced by about 1,000 regions of 4 MiB, each a separate allocation. A buffer that crosses a chunk boundary then becomes a scattered import bound with `UpdateTileMappings`. My guess is a scalar load landing on a page of such a buffer that isn't bound. I haven't confirmed that. So chunking the spans probably needs the importer to keep large ranges in one host allocation, or the fix has to promote a page without detaching its whole span. I'm not opening this as a PR.
Jerkin42 commented 2026-11-30 02:18:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by Jerkin42 on 2026-11-30T02:18:04Z.


One more data point on the write=true not promoted crash, from a logging build: here it isn't only a sibling page pinning a span.

Setup: the same #501 + #389 build with TUXBOX_XMEM_PRIVATE_VIEWS=1, RX 9060 XT. I tried letting the faulting alias take over as the canonical copy (as SlotRole::Upgrade does), and logged why it refused. It crashed 7 min after the title as before:

TuxBox xmem: LOCAL take-over of 0x489270000 refused: backing is arena page 0xc931f0000 (held=true)
TuxBox xmem: secondary alias 0x489270000 fault not promoted (err=170, write=true, ... blocker=…@0xb00200000..0xbf8b00000(page_imp=false,span_imp=true,span_held=true,def=0))

What the log shows:

  • The canonical copy: a PrivateArena page that the GPU itself holds.
  • The blocker= address: a GPU-only alias of the same token. It lies in the 3.88 GiB span whose other pages are imported, but it isn't imported itself.
  • Why promotion stops: promote_token_to_section already handles a held arena page; it invalidates the imports through was_held_arena. It stops only because detaching that GPU-only alias would unmap the whole held span.

Why neither of my tries works:

  • Chunking the spans: it splits the GPU's imports and led to the SQC faults I reported above.
  • The take-over: the canonical copy can't move while the GPU holds it.

A possible way through: a GPU-only alias in a held span isn't read by the CPU, and resolve_backings could resolve a SharedSection page through another address that maps the section. Then promotion could leave such an alias in place, mark it stale, and not detach its span. I'm looking at that unless @DrArroway already has the follow-up in hand.

<!-- greyfinch-sync:brcly/TuxBox:comment:7266884230 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7266884230). Originally posted by [Jerkin42](https://github.com/Jerkin42) on 2026-11-30T02:18:04Z. --- One more data point on the `write=true` `not promoted` crash, from a logging build: here it isn't only a sibling page pinning a span. **Setup:** the same #501 + #389 build with `TUXBOX_XMEM_PRIVATE_VIEWS=1`, RX 9060 XT. I tried letting the faulting alias take over as the canonical copy (as `SlotRole::Upgrade` does), and logged why it refused. It crashed 7 min after the title as before: ```text TuxBox xmem: LOCAL take-over of 0x489270000 refused: backing is arena page 0xc931f0000 (held=true) TuxBox xmem: secondary alias 0x489270000 fault not promoted (err=170, write=true, ... blocker=…@0xb00200000..0xbf8b00000(page_imp=false,span_imp=true,span_held=true,def=0)) ``` **What the log shows:** - **The canonical copy:** a `PrivateArena` page that the GPU itself holds. - **The `blocker=` address:** a GPU-only alias of the same token. It lies in the 3.88 GiB span whose other pages are imported, but it isn't imported itself. - **Why promotion stops:** `promote_token_to_section` already handles a held arena page; it invalidates the imports through `was_held_arena`. It stops only because detaching that GPU-only alias would unmap the whole held span. **Why neither of my tries works:** - **Chunking the spans:** it splits the GPU's imports and led to the SQC faults I reported above. - **The take-over:** the canonical copy can't move while the GPU holds it. **A possible way through:** a GPU-only alias in a held span isn't read by the CPU, and `resolve_backings` could resolve a `SharedSection` page through another address that maps the section. Then promotion could leave such an alias in place, mark it stale, and not detach its span. I'm looking at that unless @DrArroway already has the follow-up in hand.
gtb-sbe commented 2026-11-30 02:22:18 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-11-30T02:22:18Z.


@1093i3511, @NickStallman: I found the cause of the Syscall stack overrun in vkCreateComputePipelines on 35af8e6d and e5fbc632. It's a different fault from 8ae931bd's dxil-spirv overflow, as Nick guessed.

The cause: Wine runs each Unix call, and so the Vulkan driver's pipeline compile, on a per-thread kernel stack of 1 MiB. TuxBox's 64 MiB compile thread only covers vkd3d-proton's DXIL to SPIR-V step on the PE side. Mesa's SPIR-V front end walks structured control flow recursively (structured_post_order_traversal() in vtn_structured_cfg.c), about 96 bytes per block in a row. e5fbc632 is 15,521 ifs in sequence (49,875 blocks). Converted with the dxil-spirv CLI and compiled natively on RADV (Mesa 26.2.6), it segfaults on a 1 MiB stack at the same instruction as in the game (the recursive call, +0x71fcd5 on my build) and compiles in 4.7 s on 2 MiB. A generated SPIR-V with N sequential ifs fails on 1 MiB from about 11,000.

Workaround: Proton reads WINE_KERNEL_STACK_SIZE (KiB); Valve's Proton 10/11/Experimental and GE-Proton11-14 all have it. With WINE_KERNEL_STACK_SIZE=16384, all three programs compile on my RX 9060 XT (f482572a + #557 + #389, private views): 35af8e6d in 155 s, 8ae931bd in 119 s, e5fbc632 in 118 s, with no overrun and no virtual_setup_exception stack overflow. So you should be able to drop TUXBOX_SKIP_SHADERS. #564 makes 16 MiB the launcher's default for Proton and adds a Lanes scenario that crashes without it.

A repeat with the same settings (the programs now came from the caches) ended on the title's watchdog at the intro start (game time 3:00, 700 s), like yours on the RX 6600. In the last 30 s, the submitting thread was outside ExecuteCommandLists the whole time, and eight compute-queue label waits were held that no submitted list writes; they were released after 5 s each. The title's crash log shows an Unsignaled CrossQueueBarrier. I'm tracing which wait the title thread is in, and I'll post that separately.

<!-- greyfinch-sync:brcly/TuxBox:comment:7266947072 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7266947072). Originally posted by [gtb-sbe](https://github.com/gtb-sbe) on 2026-11-30T02:22:18Z. --- @1093i3511, @NickStallman: I found the cause of the `Syscall stack overrun` in `vkCreateComputePipelines` on `35af8e6d` and `e5fbc632`. It's a different fault from `8ae931bd`'s dxil-spirv overflow, as Nick guessed. **The cause:** Wine runs each Unix call, and so the Vulkan driver's pipeline compile, on a per-thread kernel stack of 1 MiB. TuxBox's 64 MiB compile thread only covers vkd3d-proton's DXIL to SPIR-V step on the PE side. Mesa's SPIR-V front end walks structured control flow recursively (`structured_post_order_traversal()` in `vtn_structured_cfg.c`), about 96 bytes per block in a row. `e5fbc632` is 15,521 `if`s in sequence (49,875 blocks). Converted with the dxil-spirv CLI and compiled natively on RADV (Mesa 26.2.6), it segfaults on a 1 MiB stack at the same instruction as in the game (the recursive call, `+0x71fcd5` on my build) and compiles in 4.7 s on 2 MiB. A generated SPIR-V with N sequential `if`s fails on 1 MiB from about 11,000. **Workaround:** Proton reads `WINE_KERNEL_STACK_SIZE` (KiB); Valve's Proton 10/11/Experimental and GE-Proton11-14 all have it. With `WINE_KERNEL_STACK_SIZE=16384`, all three programs compile on my RX 9060 XT (`f482572a` + #557 + #389, private views): `35af8e6d` in 155 s, `8ae931bd` in 119 s, `e5fbc632` in 118 s, with no overrun and no `virtual_setup_exception stack overflow`. So you should be able to drop `TUXBOX_SKIP_SHADERS`. #564 makes 16 MiB the launcher's default for Proton and adds a Lanes scenario that crashes without it. A repeat with the same settings (the programs now came from the caches) ended on the title's watchdog at the intro start (game time 3:00, 700 s), like yours on the RX 6600. In the last 30 s, the submitting thread was outside `ExecuteCommandLists` the whole time, and eight compute-queue label waits were held that no submitted list writes; they were released after 5 s each. The title's crash log shows an `Unsignaled CrossQueueBarrier`. I'm tracing which wait the title thread is in, and I'll post that separately.
Jerkin42 commented 2026-11-30 02:53:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by Jerkin42 on 2026-11-30T02:53:42Z.


A correction to my last comment: the write=true alias fault looks like a symptom, not the cause. Please don't spend time on the stale-alias idea on my account.

I built a version where promotion leaves a GPU-only alias in a held span alone. It reads through its own section view. Two runs with it (#501 + #389, TUXBOX_XMEM_PRIVATE_VIEWS=1, RX 9060 XT) never needed that path: no not promoted and no GPU fault. They still died at the same moment, about 6 min after the title, on the grey loading screen. All five runs I have from this build end the same way:

  1. The presents drop: from about 35 per 10 s to 4–5 per 11 s, for about 40 s.
  2. Then a worker thread dies, on the thread entry +0x2215EA0 → +0x2592D69 → +0x2593E91, in the routine at +0x4DA6330. That routine translates a pointer through a per-thread table of {base, destination, size} ranges, then writes a header at the result. It ends in one of two ways:
    • The write lands on a secondary alias: +0x4DA63F8, from +0x12E8331. Three runs, and the "not promoted" log appears.
    • No range matches the pointer, and the lookup's own int3 fires at +0x4DA6315, from +0x12DEB4D or +0x4E641DD. Two runs.

So the title is handing that worker a pointer its table doesn't know, or one that leads into an alias. That fits wrong data from somewhere earlier more than an xmem promotion problem. 1093i3511's run of main f482572a + #557 + #501 got past this point, so I'll try current main next.

<!-- greyfinch-sync:brcly/TuxBox:comment:7267408374 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7267408374). Originally posted by [Jerkin42](https://github.com/Jerkin42) on 2026-11-30T02:53:42Z. --- A correction to my last comment: the `write=true` alias fault looks like a symptom, not the cause. Please don't spend time on the stale-alias idea on my account. I built a version where promotion leaves a GPU-only alias in a held span alone. It reads through its own section view. Two runs with it (`#501` + `#389`, `TUXBOX_XMEM_PRIVATE_VIEWS=1`, RX 9060 XT) never needed that path: no `not promoted` and no GPU fault. They still died at the same moment, about 6 min after the title, on the grey loading screen. All five runs I have from this build end the same way: 1. **The presents drop:** from about 35 per 10 s to 4–5 per 11 s, for about 40 s. 2. **Then a worker thread dies,** on the thread entry `+0x2215EA0` → `+0x2592D69` → `+0x2593E91`, in the routine at `+0x4DA6330`. That routine translates a pointer through a per-thread table of `{base, destination, size}` ranges, then writes a header at the result. It ends in one of two ways: - **The write lands on a secondary alias:** `+0x4DA63F8`, from `+0x12E8331`. Three runs, and the "not promoted" log appears. - **No range matches the pointer,** and the lookup's own `int3` fires at `+0x4DA6315`, from `+0x12DEB4D` or `+0x4E641DD`. Two runs. So the title is handing that worker a pointer its table doesn't know, or one that leads into an alias. That fits wrong data from somewhere earlier more than an xmem promotion problem. 1093i3511's run of `main` `f482572a` + #557 + #501 got past this point, so I'll try current `main` next.
NickStallman commented 2026-11-30 03:53:59 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T03:53:59Z.


An NVIDIA data point for the private views, in the world: RTX 5090 (10de:2b85, 620.70.10, GE-Proton11-14, Ubuntu), an integration build of f482572a with our open PRs (#566 included, which gets past the crash that stopped us earlier), warm, offline, one run each:

default (section-backed) TUXBOX_XMEM_PRIVATE_VIEWS=1
Frames in the story 4 to 8 s each (one late frame 4.2 s mean) 1.5 to 3.1 s (28 frames, then the run ended)
Placement time per frame, last 30 s about 4.0 s about 0.5 s
Digest, per 6 s window 1753 ms (83 GB hashed) 58 ms
Publication, per 6 s window 2291 ms 903 ms (store 440, retile 374)

Correction (15:25 local): I first listed a "flush" row of 2858 ms against 90 ms as if it were the title flushing its cache. It isn't: in these runs that profile step counts the title's Unmap of one texture, on other threads than the presenting one (80a to 83b: as many units as calls, and no flush caller line at all), so it says nothing about the frame. I've taken it out.

So on this card hashing nearly disappears, and what's left is mostly copying GPU-written textures back (and 0.5 to 1.0 s of GPU memory waits per frame). The frames in the two windows aren't the same scene or length, so read it as the size of the effect, not a precise ratio.

It ended 554 s in, under a minute into the world, in the write=true alias fault others have: secondary alias 0x8fdc20000 fault not promoted (err=170, write=true, …) with a held-span blocker (span_held=true), then an access violation in the title (exit code 5). One earlier read-only alias fault in the same run was mirrored without trouble. No GPU fault, no Xid. The default-mode runs of this build lasted 1 and 19 minutes in the world and ended in a GPU loss instead.

<!-- greyfinch-sync:brcly/TuxBox:comment:7268289658 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7268289658). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T03:53:59Z. --- An NVIDIA data point for the private views, in the world: RTX 5090 (`10de:2b85`, 620.70.10, GE-Proton11-14, Ubuntu), an integration build of `f482572a` with our open PRs (#566 included, which gets past the crash that stopped us earlier), warm, offline, one run each: | | default (section-backed) | `TUXBOX_XMEM_PRIVATE_VIEWS=1` | |---|---|---| | Frames in the story | 4 to 8 s each (one late frame 4.2 s mean) | 1.5 to 3.1 s (28 frames, then the run ended) | | Placement time per frame, last 30 s | about 4.0 s | about 0.5 s | | Digest, per 6 s window | 1753 ms (83 GB hashed) | 58 ms | | Publication, per 6 s window | 2291 ms | 903 ms (store 440, retile 374) | **Correction (15:25 local):** I first listed a "flush" row of 2858 ms against 90 ms as if it were the title flushing its cache. It isn't: in these runs that profile step counts the title's Unmap of one texture, on other threads than the presenting one (80a to 83b: as many units as calls, and no flush caller line at all), so it says nothing about the frame. I've taken it out. So on this card hashing nearly disappears, and what's left is mostly copying GPU-written textures back (and 0.5 to 1.0 s of GPU memory waits per frame). The frames in the two windows aren't the same scene or length, so read it as the size of the effect, not a precise ratio. It ended 554 s in, under a minute into the world, in the `write=true` alias fault others have: `secondary alias 0x8fdc20000 fault not promoted (err=170, write=true, …)` with a held-span blocker (`span_held=true`), then an access violation in the title (exit code 5). One earlier read-only alias fault in the same run was mirrored without trouble. No GPU fault, no Xid. The default-mode runs of this build lasted 1 and 19 minutes in the world and ended in a GPU loss instead.
Jerkin42 commented 2026-11-30 05:04:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by Jerkin42 on 2026-11-30T05:04:17Z.


@NickStallman, data on the shader MMU fault after the story loads, from RX 9060 XT (1002:7590, RADV). It's the same kind as your Xid 13 in default mode, I think.

Build: main f482572a + #557 + #389 + #566 + #564. Default mode (no private views). All 13 inline ray-query programs left out (TUXBOX_SKIP_SHADERS), because fb8e97e0 faulted reading an unmapped host page otherwise. Reaches the "PROLOGUE" card, then faults 9–11 min after the title, every run:

Run Fault address Client Unfinished draws (most)
m389c 0x800041600000 SQC (data), PERMISSION_FAULTS 0x3, MAPPING_ERROR 0 VS 8b6223a0/PS 0a3fd624, MS e13e607e/PS 9ca310f6
mint1 0x8000fb21b000 same MS 84798173, MS 4db9a403
mfault1 0x8000bda37000 same MS b91b86fc/PS 019166fc ×27, MS 3ba95711/PS cdce1ebe
mwatch0 0x800041600000 same VS 8b6223a0/PS 0a3fd624 ×26
  • The same 2 MiB-aligned address and draw twice (VS 8b6223a0 at 0x800041600000) looks like a scalar read running off the end of a buffer into the next region. The MS b91b86fc/MS 3ba95711 pair also faulted this morning on the older #501 base.
  • Ruled out, one run each:
    • Replaced descriptors freed too early: a 120 s retire grace in placement/descriptors.rs (local env override) still faulted.
    • Write watches on imported pages: TUXBOX_PLACEMENT_WATCH=0 still faulted, at the same address.
    • Private views: these runs were all in default mode.
  • VKD3D_CONFIG=fault (RADV has VK_EXT_device_fault and VK_EXT_device_address_binding_report) printed nothing beyond the device loss.
  • The GPU recovers every time (gfx_0.0.0 ring reset succeeded).

Next here: logging the root and table GPU addresses that VS 8b6223a0 is given, to name the buffer at 0x800041600000. If you've already got the resource from your Xid 13 trace, I'll stop and try yours instead.

<!-- greyfinch-sync:brcly/TuxBox:comment:7269329261 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7269329261). Originally posted by [Jerkin42](https://github.com/Jerkin42) on 2026-11-30T05:04:17Z. --- @NickStallman, data on the shader MMU fault after the story loads, from RX 9060 XT (`1002:7590`, RADV). It's the same kind as your Xid 13 in default mode, I think. **Build:** `main` `f482572a` + #557 + #389 + #566 + #564. Default mode (no private views). All 13 inline ray-query programs left out (`TUXBOX_SKIP_SHADERS`), because `fb8e97e0` faulted reading an unmapped host page otherwise. Reaches the "PROLOGUE" card, then faults 9–11 min after the title, every run: | Run | Fault address | Client | Unfinished draws (most) | |---|---|---|---| | m389c | `0x800041600000` | SQC (data), `PERMISSION_FAULTS 0x3`, `MAPPING_ERROR 0` | `VS 8b6223a0`/`PS 0a3fd624`, `MS e13e607e`/`PS 9ca310f6` | | mint1 | `0x8000fb21b000` | same | `MS 84798173`, `MS 4db9a403` | | mfault1 | `0x8000bda37000` | same | `MS b91b86fc`/`PS 019166fc` ×27, `MS 3ba95711`/`PS cdce1ebe` | | mwatch0 | `0x800041600000` | same | `VS 8b6223a0`/`PS 0a3fd624` ×26 | - **The same 2 MiB-aligned address and draw twice** (`VS 8b6223a0` at `0x800041600000`) looks like a scalar read running off the end of a buffer into the next region. The `MS b91b86fc`/`MS 3ba95711` pair also faulted this morning on the older #501 base. - **Ruled out, one run each:** - **Replaced descriptors freed too early:** a 120 s retire grace in `placement/descriptors.rs` (local env override) still faulted. - **Write watches on imported pages:** `TUXBOX_PLACEMENT_WATCH=0` still faulted, at the same address. - **Private views:** these runs were all in default mode. - **`VKD3D_CONFIG=fault`** (RADV has `VK_EXT_device_fault` and `VK_EXT_device_address_binding_report`) printed nothing beyond the device loss. - **The GPU recovers every time** (`gfx_0.0.0` ring reset succeeded). Next here: logging the root and table GPU addresses that `VS 8b6223a0` is given, to name the buffer at `0x800041600000`. If you've already got the resource from your Xid 13 trace, I'll stop and try yours instead.
NickStallman commented 2026-11-30 05:19:28 +00:00 (Migrated from github.com)
Author
Contributor

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


@Jerkin42 thank you, that's very useful: it looks like the same fault. I don't have the resource, so please don't stop; your next step is the right one.

Where we overlap (corrected; my first version counted lines from other parts of the log). Among the unfinished draws each trace printed, in 83a (48 of 84 printed): MS 84798173 14, 4db9a403 6, 3ba95711 4. In 84b (33 printed): 4db9a403 12, and none of your other ones. b91b86fc, e13e607e and VS 8b6223a0 aren't in either trace's printed draws. Your client being the scalar data cache and ours "SM warp, MMU fault" doesn't say more than that.

What we know about the addresses (details in my comment on #232):

  • 83a read 0xdcf6068000, inside a range vkd3d had bound to an image and unbound 846 s before. 84b read 0x1030b5000, which is in no allocation vkd3d knows. No import or placement we logged lies between 4 GiB and about 0x123e70000, and 27 of the 65 fault pages in our older logs are in that band; three of them repeat exactly across runs. That points to a fixed base plus a repeatable offset, like your 0x800041600000 twice.
  • None of the in-flight root descriptors in 84b held an address outside a host import or placement (714 of 714 pairs but 4 that are all one address), so #389's windows don't explain that one. The programs we disassembled don't dereference 64-bit pointers; de01af6f/566c096c (vkd3d hashes) index the resource heap with a 27-bit value from title data, through an unchecked index-map load.
  • Ruled out there: stale descriptors the diagnostic follows (#567: 0 named an ended image at the loss), and the indirect mesh records (#568: 393,498, all in range). Not ruled out: stale views at mapped indices.

Trying now: draft #572 gives index-map entries without a slot a null view instead of slot 0. No evidence it's the cause. If you can, the test that would help most is whether your SQC read is from a table/heap descriptor or a root one for VS 8b6223a0: if it's a descriptor-heap buffer, its size and the offset would name the missing bound; if it's a root SRV, #389's reach and clip for that draw. TUXBOX_CHECK_STALE_IMAGES=1 (#567) is log-only and off by default if you want to add it.

<!-- greyfinch-sync:brcly/TuxBox:comment:7269559785 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7269559785). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T05:19:28Z. --- @Jerkin42 thank you, that's very useful: it looks like the same fault. I don't have the resource, so please don't stop; your next step is the right one. **Where we overlap** (corrected; my first version counted lines from other parts of the log). Among the unfinished draws each trace printed, in 83a (48 of 84 printed): `MS 84798173` 14, `4db9a403` 6, `3ba95711` 4. In 84b (33 printed): `4db9a403` 12, and none of your other ones. `b91b86fc`, `e13e607e` and `VS 8b6223a0` aren't in either trace's printed draws. Your client being the scalar data cache and ours "SM warp, MMU fault" doesn't say more than that. **What we know about the addresses** (details in my comment on #232): - 83a read `0xdcf6068000`, inside a range vkd3d had bound to an image and unbound 846 s before. 84b read `0x1030b5000`, which is in no allocation vkd3d knows. No import or placement we logged lies between 4 GiB and about 0x123e70000, and 27 of the 65 fault pages in our older logs are in that band; three of them repeat exactly across runs. That points to a fixed base plus a repeatable offset, like your `0x800041600000` twice. - None of the in-flight root descriptors in 84b held an address outside a host import or placement (714 of 714 pairs but 4 that are all one address), so #389's windows don't explain that one. The programs we disassembled don't dereference 64-bit pointers; `de01af6f`/`566c096c` (vkd3d hashes) index the resource heap with a 27-bit value from title data, through an unchecked index-map load. - **Ruled out there:** stale descriptors the diagnostic follows (#567: 0 named an ended image at the loss), and the indirect mesh records (#568: 393,498, all in range). Not ruled out: stale views at mapped indices. **Trying now:** draft #572 gives index-map entries without a slot a null view instead of slot 0. No evidence it's the cause. If you can, the test that would help most is whether your SQC read is from a table/heap descriptor or a root one for `VS 8b6223a0`: if it's a descriptor-heap buffer, its size and the offset would name the missing bound; if it's a root SRV, #389's reach and clip for that draw. `TUXBOX_CHECK_STALE_IMAGES=1` (#567) is log-only and off by default if you want to add it.
NickStallman commented 2026-11-30 05:28:52 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T05:28:52Z.


@Jerkin42 one more thing to check before you log the resource; it could save you a run. This is read from code at f482572a and not tested, so please treat it as a question.

On main, a mesh draw with a reflected table (mesh_table::reflected, index_map: None) appears to be run without the "no paged descriptor layout" skip the other path has. If the pixel stage or mesh stage indexes the resource heap directly, it would then use the title's heap index as a visible slot, which under descriptor paging names something else. Your build (f482572a + #557 + #389 + #566 + #564) doesn't have #390, which gives those pipelines the index map; ours does. From your lists, PS cdce1ebe and PS 019166fc read the heap through 60 and 28 places with the raw index in the translation we have recorded; MS de01af6f and MS 8ca15b1e take their first heap index from a constant (& 1023).

Three log lines would settle most of it, without a run:

  • skipped draw / no paged descriptor layout lines around mesh pipelines, and whether any name the programs you listed
  • index map and descriptor arena lines (whether heaps are paged at all on your card)
  • root CBV … has no mapped 64 KiB window (a different candidate: on AMD a root CBV is a raw address)

If you can also run #390 (our rebased copy is d3d12/mesh-index-map-bitmap, de1a16f0 on f482572a; MathiewMay's commit kept) on top of your build: if the same SQC fault on the same draws remains, this isn't it. @Kayotic1337 ran it on an RX 9070 XT and still had crashes in the first cutscene, so I don't expect it to be the whole story. It doesn't explain our own losses: those builds have #390.

<!-- greyfinch-sync:brcly/TuxBox:comment:7269708197 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7269708197). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T05:28:52Z. --- @Jerkin42 one more thing to check before you log the resource; it could save you a run. This is read from code at f482572a and not tested, so please treat it as a question. On `main`, a mesh draw with a *reflected table* (`mesh_table::reflected`, `index_map: None`) appears to be run without the "no paged descriptor layout" skip the other path has. If the pixel stage or mesh stage indexes the resource heap directly, it would then use the title's heap index as a visible slot, which under descriptor paging names something else. Your build (f482572a + #557 + #389 + #566 + #564) doesn't have #390, which gives those pipelines the index map; ours does. From your lists, `PS cdce1ebe` and `PS 019166fc` read the heap through 60 and 28 places with the raw index in the translation we have recorded; `MS de01af6f` and `MS 8ca15b1e` take their first heap index from a constant (`& 1023`). Three log lines would settle most of it, without a run: - `skipped draw` / `no paged descriptor layout` lines around mesh pipelines, and whether any name the programs you listed - `index map` and `descriptor arena` lines (whether heaps are paged at all on your card) - `root CBV … has no mapped 64 KiB window` (a different candidate: on AMD a root CBV is a raw address) If you can also run #390 (our rebased copy is [`d3d12/mesh-index-map-bitmap`](https://github.com/NickStallman/TuxBox/tree/d3d12/mesh-index-map-bitmap), de1a16f0 on f482572a; MathiewMay's commit kept) on top of your build: if the same SQC fault on the same draws remains, this isn't it. @Kayotic1337 ran it on an RX 9070 XT and still had crashes in the first cutscene, so I don't expect it to be the whole story. It doesn't explain our own losses: those builds have #390.
ReverendOzmund commented 2026-11-30 06:04:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by ReverendOzmund on 2026-11-30T06:04:17Z.


NVIDIA data point for #501: RTX 3080 Ti, driver 620.73.04, GE-Proton11-14, main f482572a + #557 + #501 with TUXBOX_XMEM_PRIVATE_VIEWS=1, WINE_KERNEL_STACK_SIZE=16384, Nick's lost-GPU recorder (hold and fault only).

  • No "not promoted" lines and no Xid at all during the run (7774 s). It's the first run on this card that didn't end in a device loss.
  • Presents: about 70 per second at first, 15–35 per second for most of the two hours, then about 1 per second once the heavy part started. Placement still took about 2.1 s of every 5 s window.
  • Near the end the card reached 7.4 of its 7.9 GiB budget and vkd3d-proton failed 781 allocations of 16 MiB on the device-local type. Then the compute queues held on title fence labels that were never signalled ("stalled label 0x518fa78 >= 0x2c272 ... submitted to a type 2 queue"), a texture-readback worker fence stalled, and the title's crash handler ended it (exit code 5).

@gtb-sbe the stalled labels at the end look like the held compute-queue label waits you're tracing. Here they came right after the card ran out of room, so memory pressure may be one way into that state.

<!-- greyfinch-sync:brcly/TuxBox:comment:7270274376 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7270274376). Originally posted by [ReverendOzmund](https://github.com/ReverendOzmund) on 2026-11-30T06:04:17Z. --- NVIDIA data point for #501: RTX 3080 Ti, driver 620.73.04, GE-Proton11-14, main f482572a + #557 + #501 with TUXBOX_XMEM_PRIVATE_VIEWS=1, WINE_KERNEL_STACK_SIZE=16384, Nick's lost-GPU recorder (hold and fault only). - No "not promoted" lines and no Xid at all during the run (7774 s). It's the first run on this card that didn't end in a device loss. - Presents: about 70 per second at first, 15–35 per second for most of the two hours, then about 1 per second once the heavy part started. Placement still took about 2.1 s of every 5 s window. - Near the end the card reached 7.4 of its 7.9 GiB budget and vkd3d-proton failed 781 allocations of 16 MiB on the device-local type. Then the compute queues held on title fence labels that were never signalled ("stalled label 0x518fa78 >= 0x2c272 ... submitted to a type 2 queue"), a texture-readback worker fence stalled, and the title's crash handler ended it (exit code 5). @gtb-sbe the stalled labels at the end look like the held compute-queue label waits you're tracing. Here they came right after the card ran out of room, so memory pressure may be one way into that state.
Jerkin42 commented 2026-11-30 06:47:19 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by Jerkin42 on 2026-11-30T06:47:19Z.


@NickStallman I ran #390 (your d3d12/mesh-index-map-bitmap, the three commits picked onto my build: f482572a + #557 + #389 + #566 + #564). RX 9060 XT, RADV, default mode (no private views), the 13 inline ray shaders skipped. One run, so treat it as a single data point.

It got further. Every earlier run on this build hit the SQC fault 9–11 min after the title, during the PROLOGUE mesh draws (VS 8b6223a0/PS 0a3fd624, MS b91b86fc/PS 019166fc, MS 3ba95711/PS cdce1ebe). With #390 none of those faulted and the run reached the world (28,133 draws per frame). The time is longer only because #390's requests compiled cold.

Then the same kind of fault, about 90 s into the world: SQC (data), PERMISSION_FAULTS 0x3, MAPPING_ERROR 0, page 0x800093900000; the ring reset succeeded. Of the 15 unfinished commands, the draws were:

draws PS MS
8 9b9409d0 4db9a403
8 238af1d1 44638b1a
6 564084c7 144764f5
4 60f67616 f562a532

MS 4db9a403 is the one that's in both of your traces (83a and 84b).

Your three log lines, from the runs before #390:

  • skipped draw … no paged descriptor layout: 3 lines in one run (#256, #2048, #4096, guest caller 0x4e33f98), none in the other; nothing naming the programs above.
  • Heaps are paged here: bound paged resource descriptor index map at graphics root slot 2 (and the compute index map and stride table).
  • root CBV … has no mapped 64 KiB window: 0.

With #390, 7 mesh pixel stages logged has no translation on its root and cannot read the resource index map (7b27692b, 1b24cb42, 6b2de15f, 861d25b4, f8510ed6, 06cba455, faa0615e). None of them is among the faulting draws.

Next I'll add #572, with #567 logging, on top of this. The cache is warm now, so that run should reach the world in minutes.

<!-- greyfinch-sync:brcly/TuxBox:comment:7271012306 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7271012306). Originally posted by [Jerkin42](https://github.com/Jerkin42) on 2026-11-30T06:47:19Z. --- @NickStallman I ran #390 (your `d3d12/mesh-index-map-bitmap`, the three commits picked onto my build: f482572a + #557 + #389 + #566 + #564). RX 9060 XT, RADV, default mode (no private views), the 13 inline ray shaders skipped. One run, so treat it as a single data point. **It got further.** Every earlier run on this build hit the SQC fault 9–11 min after the title, during the PROLOGUE mesh draws (`VS 8b6223a0`/`PS 0a3fd624`, `MS b91b86fc`/`PS 019166fc`, `MS 3ba95711`/`PS cdce1ebe`). With #390 none of those faulted and the run reached the world (28,133 draws per frame). The time is longer only because #390's requests compiled cold. **Then the same kind of fault, about 90 s into the world:** SQC (data), `PERMISSION_FAULTS 0x3`, `MAPPING_ERROR 0`, page `0x800093900000`; the ring reset succeeded. Of the 15 unfinished commands, the draws were: | draws | PS | MS | |---|---|---| | 8 | `9b9409d0` | `4db9a403` | | 8 | `238af1d1` | `44638b1a` | | 6 | `564084c7` | `144764f5` | | 4 | `60f67616` | `f562a532` | `MS 4db9a403` is the one that's in both of your traces (83a and 84b). Your three log lines, from the runs before #390: - `skipped draw … no paged descriptor layout`: 3 lines in one run (#256, #2048, #4096, guest caller `0x4e33f98`), none in the other; nothing naming the programs above. - Heaps are paged here: `bound paged resource descriptor index map at graphics root slot 2` (and the compute index map and stride table). - `root CBV … has no mapped 64 KiB window`: 0. With #390, 7 mesh pixel stages logged `has no translation on its root and cannot read the resource index map` (`7b27692b`, `1b24cb42`, `6b2de15f`, `861d25b4`, `f8510ed6`, `06cba455`, `faa0615e`). None of them is among the faulting draws. Next I'll add #572, with #567 logging, on top of this. The cache is warm now, so that run should reach the world in minutes.
NickStallman commented 2026-11-30 06:49:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T06:49:42Z.


@Jerkin42 thank you, this is the most useful run anyone has had on it. You've split it: #390 took away the faults in the PROLOGUE draws (VS 8b6223a0, MS b91b86fc, MS 3ba95711), and what's left is MS 4db9a403 / PS 9b9409d0, the pair in both of our gap-type losses on an RTX 5090 (14 and 13 of the unfinished draws in 87a and 84b). In the other kind of loss of ours (83a, 86a, former texture ranges) it's 6 draws or so.

Two things about that pair that may help you look (read from the translated HLSL of the recorded requests, vkd3d hashes de01af6f/566c096c):

  • The mesh stage has a root SRV (slot 3 / t5) with dynamic byte offsets, 20 loads, chains from table data; the console code gives it no limit either (a V# with num_records = 0xffffffff), as far as I can see. It also takes one heap index from a root constant (& 1023) and one from a 27-bit table value; the pixel stage takes 6 heap indices from table values.
  • #390 is in our builds, so a raw guest index isn't ours. root CBV … has no mapped 64 KiB window is 0 for you, so it isn't that.

If you can log them for that pair at the fault: the root SRV's GPU address and reach, the root constants (c0 & 0x3ff picks the heap view), and whether the faulting page falls in that SRV's range + offset or in a heap view. On NVIDIA the fault pages sit in an unmapped gap at 4 GiB and repeat across runs (0x10de2f000, 0x10be2f000, 0x1030b5000, 32 MiB apart in one case). Please keep #572 as a control: 86a with it still lost the GPU, so it isn't the fix.

<!-- greyfinch-sync:brcly/TuxBox:comment:7271055101 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7271055101). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T06:49:42Z. --- @Jerkin42 thank you, this is the most useful run anyone has had on it. You've split it: #390 took away the faults in the PROLOGUE draws (`VS 8b6223a0`, `MS b91b86fc`, `MS 3ba95711`), and what's left is `MS 4db9a403` / `PS 9b9409d0`, the pair in **both** of our gap-type losses on an RTX 5090 (14 and 13 of the unfinished draws in 87a and 84b). In the other kind of loss of ours (83a, 86a, former texture ranges) it's 6 draws or so. Two things about that pair that may help you look (read from the translated HLSL of the recorded requests, vkd3d hashes `de01af6f`/`566c096c`): - The mesh stage has a root SRV (slot 3 / t5) with dynamic byte offsets, 20 loads, chains from table data; the console code gives it no limit either (a V# with `num_records = 0xffffffff`), as far as I can see. It also takes one heap index from a root constant (`& 1023`) and one from a 27-bit table value; the pixel stage takes 6 heap indices from table values. - #390 is in our builds, so a raw guest index isn't ours. `root CBV … has no mapped 64 KiB window` is 0 for you, so it isn't that. If you can log them for that pair at the fault: the root SRV's GPU address and reach, the root constants (c0 & 0x3ff picks the heap view), and whether the faulting page falls in that SRV's range + offset or in a heap view. On NVIDIA the fault pages sit in an unmapped gap at 4 GiB and repeat across runs (`0x10de2f000`, `0x10be2f000`, `0x1030b5000`, 32 MiB apart in one case). Please keep #572 as a control: 86a with it still lost the GPU, so it isn't the fix.
ReverendOzmund commented 2026-11-30 08:14:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by ReverendOzmund on 2026-11-30T08:14:29Z.


@DrArroway I put together a small opt-in experiment for the section-page digest: TUXBOX_SECTION_GUARD=1 makes the CPU views of a watched section-backed page read-only at rearm and catches the first store in a vectored handler (its own lock, never the pool lock), so clean section pages skip the digest. Holds and mapping changes drop the guards first. About 150 lines in xmem, off by default.

I'm testing it on the RTX 3080 Ti now and will post the placement numbers. Since this is inside your XMem claim: would you rather I open it as a PR for you to review, hand it to you to fold into #550, or drop it if it clashes with what you're doing?

<!-- greyfinch-sync:brcly/TuxBox:comment:7272656966 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7272656966). Originally posted by [ReverendOzmund](https://github.com/ReverendOzmund) on 2026-11-30T08:14:29Z. --- @DrArroway I put together a small opt-in experiment for the section-page digest: TUXBOX_SECTION_GUARD=1 makes the CPU views of a watched section-backed page read-only at rearm and catches the first store in a vectored handler (its own lock, never the pool lock), so clean section pages skip the digest. Holds and mapping changes drop the guards first. About 150 lines in xmem, off by default. I'm testing it on the RTX 3080 Ti now and will post the placement numbers. Since this is inside your XMem claim: would you rather I open it as a PR for you to review, hand it to you to fold into #550, or drop it if it clashes with what you're doing?
NickStallman commented 2026-11-30 08:21:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T08:21:41Z.


@ReverendOzmund in case you haven't seen it: @NathansDomainSolutions has #573 open, which from its description does much the same thing (CPU views of a watched section page made read-only at rearm, first store caught in a vectored handler with its own lock, pages dropped on map, unmap, alias or hold, off by default, TUXBOX_XMEM_SECTION_WATCH=1). I haven't compared the code, and yours may differ where it matters, so this is only so the two of you and @DrArroway can see both. We have #573 in a build and plan an on/off comparison on an RTX 5090 tonight; I'll post the numbers there. Your 3080 Ti figures beside them would help a lot.

<!-- greyfinch-sync:brcly/TuxBox:comment:7272810234 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7272810234). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T08:21:41Z. --- @ReverendOzmund in case you haven't seen it: @NathansDomainSolutions has #573 open, which from its description does much the same thing (CPU views of a watched section page made read-only at rearm, first store caught in a vectored handler with its own lock, pages dropped on map, unmap, alias or hold, off by default, `TUXBOX_XMEM_SECTION_WATCH=1`). I haven't compared the code, and yours may differ where it matters, so this is only so the two of you and @DrArroway can see both. We have #573 in a build and plan an on/off comparison on an RTX 5090 tonight; I'll post the numbers there. Your 3080 Ti figures beside them would help a lot.
ReverendOzmund commented 2026-11-30 08:24:01 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by ReverendOzmund on 2026-11-30T08:24:01Z.


Thanks Nick, I hadn't seen #573. It's the same approach and further along (tests, release for kernel writers), so I'll drop mine and test #573 on the RTX 3080 Ti instead: on/off with TUXBOX_XMEM_SECTION_WATCH, plus #390. I'll post placement time per 5 s window and frame times beside your 5090 numbers.

<!-- greyfinch-sync:brcly/TuxBox:comment:7272861069 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7272861069). Originally posted by [ReverendOzmund](https://github.com/ReverendOzmund) on 2026-11-30T08:24:01Z. --- Thanks Nick, I hadn't seen #573. It's the same approach and further along (tests, release for kernel writers), so I'll drop mine and test #573 on the RTX 3080 Ti instead: on/off with TUXBOX_XMEM_SECTION_WATCH, plus #390. I'll post placement time per 5 s window and frame times beside your 5090 numbers.
Jerkin42 commented 2026-11-30 08:43:05 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by Jerkin42 on 2026-11-30T08:43:05Z.


@NickStallman I think I've found the SQC fault: translated shaders don't bounds-check the guest heap index before reading the index map. Details and a test that stops it below.

What the fault addresses are. I ran with RADV_DEBUG=bo_history (Mesa 26.1.8), which logs every buffer RADV allocates or frees with its GPU VA. In the game it's written to the game's own /tmp, so it has to be copied out through /proc/<pid>/root/tmp/radv_bo_history.log while the game runs.

  • The fault page in that run, 0x800080a77000, was never inside any allocation. The log covers the whole process, ending 45 ms before the fault.
  • Every SQC fault page from today's 8 runs lies between 0x800041600000 and 0x8000fb21b000. RADV never allocated anything in 0x8000_xxxxxxxx above 0x800039449000.
  • The shader-visible resource heap is the 30.5 MiB allocation at 0x800000a00000: 1,000,064 descriptors of 32 bytes. Read as an index into it, every fault page is index 34M–131M, i.e. somewhere in the 4 GiB a 32-bit descriptor offset can reach, and far past the heap.

That's an index nobody bounded. It may also explain your fault pages sitting at a fixed base plus a repeatable offset.

Where it comes from. The translator emits:

uint tb_heap_index(uint i) { return tb_heap_map.Load(0) == 0u ? i : tb_heap_map.Load(4u+i*4u); }

tb_heap_map is a root SRV, so there is no size to clamp against. Word 0 is only a flag (count != 0), so a guest index at or past the map's count reads whatever memory follows the map, and that word becomes the heap index.

Test (one run, a diagnostic, not the fix). TUXBOX_INDEX_MAP_PAD=1 pads the map to 2^27 entries, all the null view, so the existing translations (no recompile) read the null view for any index up to 2^27.

  • Same build as before (f482572a + #557 + #389 + #566 + #564 + #390 + #572), RX 9060 XT, RADV.
  • Result: no fault 9 min into the world. Every earlier run on this build faulted 1.5–2 min in. The run reached gameplay (the movement tutorial prompt) with 236k draws per frame, against 28k–55k before. The picture is still black, at about 0.5 fps.

The fix I'm testing next, which I'll open as a PR if the run holds:

  • Word 0 of the map holds count, which is still nonzero when paged, so existing translations keep working.
  • The word after the last index holds the null view.
  • The translator clamps: uint n = tb_heap_map.Load(0); return n == 0u ? i : tb_heap_map.Load(4u+min(i, n)*4u);

The identity path (n == 0, no paging) still uses the raw index. On NVIDIA that might be your remaining case, if any of your runs are unpaged.

<!-- greyfinch-sync:brcly/TuxBox:comment:7273255492 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7273255492). Originally posted by [Jerkin42](https://github.com/Jerkin42) on 2026-11-30T08:43:05Z. --- @NickStallman I think I've found the SQC fault: **translated shaders don't bounds-check the guest heap index before reading the index map.** Details and a test that stops it below. **What the fault addresses are.** I ran with `RADV_DEBUG=bo_history` (Mesa 26.1.8), which logs every buffer RADV allocates or frees with its GPU VA. In the game it's written to the game's own `/tmp`, so it has to be copied out through `/proc/<pid>/root/tmp/radv_bo_history.log` while the game runs. - The fault page in that run, `0x800080a77000`, was never inside any allocation. The log covers the whole process, ending 45 ms before the fault. - Every SQC fault page from today's 8 runs lies between `0x800041600000` and `0x8000fb21b000`. RADV never allocated anything in `0x8000_xxxxxxxx` above `0x800039449000`. - The shader-visible resource heap is the 30.5 MiB allocation at `0x800000a00000`: 1,000,064 descriptors of 32 bytes. Read as an index into it, every fault page is index 34M–131M, i.e. somewhere in the 4 GiB a 32-bit descriptor offset can reach, and far past the heap. That's an index nobody bounded. It may also explain your fault pages sitting at a fixed base plus a repeatable offset. **Where it comes from.** The translator emits: ```hlsl uint tb_heap_index(uint i) { return tb_heap_map.Load(0) == 0u ? i : tb_heap_map.Load(4u+i*4u); } ``` `tb_heap_map` is a root SRV, so there is no size to clamp against. Word 0 is only a flag (`count != 0`), so a guest index at or past the map's `count` reads whatever memory follows the map, and that word becomes the heap index. **Test (one run, a diagnostic, not the fix).** `TUXBOX_INDEX_MAP_PAD=1` pads the map to 2^27 entries, all the null view, so the existing translations (no recompile) read the null view for any index up to 2^27. - Same build as before (f482572a + #557 + #389 + #566 + #564 + #390 + #572), RX 9060 XT, RADV. - **Result:** no fault 9 min into the world. Every earlier run on this build faulted 1.5–2 min in. The run reached gameplay (the movement tutorial prompt) with 236k draws per frame, against 28k–55k before. The picture is still black, at about 0.5 fps. **The fix I'm testing next**, which I'll open as a PR if the run holds: - Word 0 of the map holds `count`, which is still nonzero when paged, so existing translations keep working. - The word after the last index holds the null view. - The translator clamps: `uint n = tb_heap_map.Load(0); return n == 0u ? i : tb_heap_map.Load(4u+min(i, n)*4u);` The identity path (`n == 0`, no paging) still uses the raw index. On NVIDIA that might be your remaining case, if any of your runs are unpaged.
NickStallman commented 2026-11-30 08:50:07 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T08:50:07Z.


@Jerkin42 this is a very good lead, and it matches something in our notes that we never finished. After an earlier loss (84b, RTX 5090) we wrote down that the pair in both of our gap losses (MS 4db9a403 / PS 9b9409d0) indexes the resource heap with a 27-bit title value through an unbounded map load, and inferred "bad resource-heap descriptor". We then tested only indices inside the map without a slot (#572's null view) and not an index past its end, so our "unmapped index ruled out" did not cover yours. I read index_map.rs on e5d2e913 and it agrees with you: the buffer holds exactly 1 + count words, word 0 is only count != 0, and tb_heap_index does not clamp.

What I can and can't say about NVIDIA:

  • The gap faults (0x1030b5000, 0x10de2f000, both just above 4 GiB) are a fair fit for a wild heap index. The other loss family, an address in the last 64 KiB tile of a texture destroyed minutes earlier (83a, 86a), may have another cause: 86a was lost with #572's null view active.
  • I haven't shown either is your index. The index that faults isn't in our dumps.

I'd like to run your diagnostic on the 5090 as well: pad the map to 2^27 entries with the null view and look for gap faults (three losses so far, so we need a longer clean run than yours to say anything). I'll use your branch if you push one, otherwise I'll write the padding from your description. The fix is yours, and I'm not building one.

<!-- greyfinch-sync:brcly/TuxBox:comment:7273402568 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7273402568). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T08:50:07Z. --- @Jerkin42 this is a very good lead, and it matches something in our notes that we never finished. After an earlier loss (84b, RTX 5090) we wrote down that the pair in both of our gap losses (`MS 4db9a403` / `PS 9b9409d0`) indexes the resource heap with a **27-bit title value through an unbounded map load**, and inferred "bad resource-heap descriptor". We then tested only indices inside the map without a slot (#572's null view) and not an index past its end, so our "unmapped index ruled out" did not cover yours. I read `index_map.rs` on e5d2e913 and it agrees with you: the buffer holds exactly `1 + count` words, word 0 is only `count != 0`, and `tb_heap_index` does not clamp. What I can and can't say about NVIDIA: - The gap faults (0x1030b5000, 0x10de2f000, both just above 4 GiB) are a fair fit for a wild heap index. The other loss family, an address in the last 64 KiB tile of a texture destroyed minutes earlier (83a, 86a), may have another cause: 86a was lost with #572's null view active. - I haven't shown either is your index. The index that faults isn't in our dumps. I'd like to run your diagnostic on the 5090 as well: pad the map to 2^27 entries with the null view and look for gap faults (three losses so far, so we need a longer clean run than yours to say anything). I'll use your branch if you push one, otherwise I'll write the padding from your description. The fix is yours, and I'm not building one.
Jerkin42 commented 2026-11-30 09:19:09 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by Jerkin42 on 2026-11-30T09:19:09Z.


@NickStallman thanks. Two branches on my fork, both on e5d2e913:

  • diag/index-map-pad (4348e7ff) is the diagnostic. With TUXBOX_INDEX_MAP_PAD=1, the map is sized for every 27-bit guest index, and it logs index map padded to … when the map is made. Existing translations work unchanged, with no recompile.
    • On plain main the padding words are 0 (the upload heap is zeroed), so a wild index reads slot 0 rather than a null view.
    • That's still inside the heap, so it should still stop a gap fault.
    • If your build has #572, fill the padding with its null view instead, as my local run did: Resident::new writes arena.limit into every entry up to the padded size.
  • fix/heap-index-clamp (61580565) is the fix:
    • Word 0 holds count, and one extra word after the last index holds what an unwritten index reads.
    • tb_heap_index clamps with min(i, n).
    • It changes the translation of every program that uses the map, so expect those to recompile.
    • My run of it (translator and runtime together, no padding) is compiling now. I'll open the PR when it gets as far as the padded run did. That run also stayed fault-free for the rest of its 20-minute window, 23 min in the world in all.

On your other family (an address in a texture destroyed minutes earlier, 86a with #572's null view): agreed, that one doesn't look like this.

<!-- greyfinch-sync:brcly/TuxBox:comment:7274038496 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7274038496). Originally posted by [Jerkin42](https://github.com/Jerkin42) on 2026-11-30T09:19:09Z. --- @NickStallman thanks. Two branches on my fork, both on e5d2e913: - [`diag/index-map-pad`](https://github.com/Jerkin42/TuxBox/tree/diag/index-map-pad) (4348e7ff) is the diagnostic. With `TUXBOX_INDEX_MAP_PAD=1`, the map is sized for every 27-bit guest index, and it logs `index map padded to …` when the map is made. Existing translations work unchanged, with no recompile. - On plain main the padding words are 0 (the upload heap is zeroed), so a wild index reads slot 0 rather than a null view. - That's still inside the heap, so it should still stop a gap fault. - If your build has #572, fill the padding with its null view instead, as my local run did: `Resident::new` writes `arena.limit` into every entry up to the padded size. - [`fix/heap-index-clamp`](https://github.com/Jerkin42/TuxBox/tree/fix/heap-index-clamp) (61580565) is the fix: - Word 0 holds `count`, and one extra word after the last index holds what an unwritten index reads. - `tb_heap_index` clamps with `min(i, n)`. - It changes the translation of every program that uses the map, so expect those to recompile. - My run of it (translator and runtime together, no padding) is compiling now. I'll open the PR when it gets as far as the padded run did. That run also stayed fault-free for the rest of its 20-minute window, 23 min in the world in all. On your other family (an address in a texture destroyed minutes earlier, 86a with #572's null view): agreed, that one doesn't look like this.
NickStallman commented 2026-11-30 09:20:53 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T09:20:53Z.


@Jerkin42 both branches fetched and read, and they do what you describe. For the 5090 test we have the padding in our own build from your description (2^27 entries, filled with #572's null view), off by default, with a control run without it and a third run that skips seven pixel programs. Those seven belong to mesh pipelines whose root has no translation, so they read raw guest indices and never go through the map. They start after tonight's current run and a build. With clamping in the translator everything recompiles, so I'd test the padding first and fix/heap-index-clamp afterwards, and will post both, whichever way they go.

Two things worth knowing from our side, for your PR:

  • An 89a run tonight (RTX 5090, #572's null view on, VK_NV_raw_access_chains disabled) was lost after 13.7 min in the world, untraced, so it doesn't tell the two families apart.
  • With #390 in our build, those seven programs are logged as mesh pipeline pixel stage … cannot read the resource index map, so they go around the map, and so does the identity path, as you noted. Clamping doesn't reach them. (I first wrote "on main too"; that line comes with #390, and I haven't looked at plain main.)
<!-- greyfinch-sync:brcly/TuxBox:comment:7274079004 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7274079004). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T09:20:53Z. --- @Jerkin42 both branches fetched and read, and they do what you describe. For the 5090 test we have the padding in our own build from your description (2^27 entries, filled with #572's null view), off by default, with a control run without it and a third run that skips seven pixel programs. Those seven belong to mesh pipelines whose root has no translation, so they read raw guest indices and never go through the map. They start after tonight's current run and a build. With clamping in the translator everything recompiles, so I'd test the padding first and `fix/heap-index-clamp` afterwards, and will post both, whichever way they go. Two things worth knowing from our side, for your PR: - An 89a run tonight (RTX 5090, #572's null view on, `VK_NV_raw_access_chains` disabled) was lost after 13.7 min in the world, untraced, so it doesn't tell the two families apart. - With #390 in our build, those seven programs are logged as `mesh pipeline pixel stage … cannot read the resource index map`, so they go around the map, and so does the identity path, as you noted. Clamping doesn't reach them. (I first wrote "on main too"; that line comes with #390, and I haven't looked at plain main.)
ReverendOzmund commented 2026-11-30 10:24:05 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by ReverendOzmund on 2026-11-30T10:24:05Z.


@Jerkin42 @NickStallman I'll run fix/heap-index-clamp on the RTX 3080 Ti, merged with #572 (the clamp word holds #572's null view), #390 and #573. My remaining loss is Xid 13 MMU faults in VS 281b4977 / PS 96e8aaaa, a vertex/pixel pair that reads through the map, so if that's a wild index the clamp should stop it. Will report either way.

<!-- greyfinch-sync:brcly/TuxBox:comment:7275538531 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7275538531). Originally posted by [ReverendOzmund](https://github.com/ReverendOzmund) on 2026-11-30T10:24:05Z. --- @Jerkin42 @NickStallman I'll run fix/heap-index-clamp on the RTX 3080 Ti, merged with #572 (the clamp word holds #572's null view), #390 and #573. My remaining loss is Xid 13 MMU faults in VS 281b4977 / PS 96e8aaaa, a vertex/pixel pair that reads through the map, so if that's a wild index the clamp should stop it. Will report either way.
Jerkin42 commented 2026-11-30 10:25:56 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by Jerkin42 on 2026-11-30T10:25:56Z.


fix/heap-index-clamp held on the RX 9060 XT.

  • The run: translator and runtime from that branch, map padding off. Otherwise the build and settings were the same as the padded run.
  • Result: about 20 min in the world, 440 frames at 367k–370k draws each, with no GPU fault. The launcher's time limit then ended the run, after a cold recompile of the clamped translations.
  • With the padded run: that's two clean runs of 20+ min in the world on this card. Every run before them faulted within 2 min.

@NickStallman on the seven pixel stages that go around the map (and the identity path): agreed, the clamp doesn't reach them. None of the seven were among the unfinished draws in any of my traces. I'll say so in the PR.

<!-- greyfinch-sync:brcly/TuxBox:comment:7275584572 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7275584572). Originally posted by [Jerkin42](https://github.com/Jerkin42) on 2026-11-30T10:25:56Z. --- `fix/heap-index-clamp` held on the RX 9060 XT. - **The run:** translator and runtime from that branch, map padding off. Otherwise the build and settings were the same as the padded run. - **Result:** about 20 min in the world, 440 frames at 367k–370k draws each, with no GPU fault. The launcher's time limit then ended the run, after a cold recompile of the clamped translations. - **With the padded run:** that's two clean runs of 20+ min in the world on this card. Every run before them faulted within 2 min. @NickStallman on the seven pixel stages that go around the map (and the identity path): agreed, the clamp doesn't reach them. None of the seven were among the unfinished draws in any of my traces. I'll say so in the PR.
NickStallman commented 2026-11-30 11:12:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T11:12:41Z.


@Jerkin42 first paired result on the RTX 5090 (10de:2b85, 620.70.10, GE-Proton11-14, main 8ece312f with #390, #572 and other PRs, one build, 45-minute limit each, driver cache warm, world in about 10 minutes):

Run Padding (2^27 entries, null view) In the world Result
91a on 34.3 min (time limit) no device loss
91b off 4.3 min Xid 13, ReadInvalid 0x103044000, "no candidate VA entries"
  • The control is another gap fault. PS 9b9409d0 MS 4db9a403 is 23 of the draws our fault trace lists as unfinished, and the pair de01af6f/566c096c is in the breadcrumbs. That's the fourth traced gap loss with it.
  • The map's own address, measured for the first time (its log line): 0x1c0f60000, 4.75 MiB, in the control. So a wild load from the map doesn't reach a fault 3 GiB below it; it's the index that load returns (or a raw index) that does, as you described.
  • One pair, and a loss takes 1 to 19 minutes in the world here, so I'm running it again in the opposite order (four more runs) before I call it. I also haven't run your clamp branch yet; that's next if the repeats agree.
  • The seven pixel programs that bypass the map stay untouched by padding and are named nowhere in the log after this loss, so if one of them faults it will show in the repeats.
<!-- greyfinch-sync:brcly/TuxBox:comment:7276698097 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7276698097). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T11:12:41Z. --- @Jerkin42 first paired result on the RTX 5090 (`10de:2b85`, 620.70.10, GE-Proton11-14, main 8ece312f with #390, #572 and other PRs, one build, 45-minute limit each, driver cache warm, world in about 10 minutes): | Run | Padding (2^27 entries, null view) | In the world | Result | |---|---|---|---| | 91a | on | 34.3 min (time limit) | no device loss | | 91b | off | 4.3 min | Xid 13, `ReadInvalid 0x103044000`, "no candidate VA entries" | - The control is another gap fault. `PS 9b9409d0 MS 4db9a403` is 23 of the draws our fault trace lists as unfinished, and the pair `de01af6f`/`566c096c` is in the breadcrumbs. That's the fourth traced gap loss with it. - The map's own address, measured for the first time (its log line): `0x1c0f60000`, 4.75 MiB, in the control. So a wild *load from the map* doesn't reach a fault 3 GiB below it; it's the *index* that load returns (or a raw index) that does, as you described. - One pair, and a loss takes 1 to 19 minutes in the world here, so I'm running it again in the opposite order (four more runs) before I call it. I also haven't run your clamp branch yet; that's next if the repeats agree. - The seven pixel programs that bypass the map stay untouched by padding and are named nowhere in the log after this loss, so if one of them faults it will show in the repeats.
NickStallman commented 2026-11-30 11:32:26 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T11:32:26Z.


A third run in this set, on the same build as 91a and 91b (RTX 5090, no padding): the control, plus the seven pixel programs that go around the map left out (TUXBOX_SKIP_SHADERS).

  • Lost 7.2 min into the world, differently: Xid 109 (context switch timeout) and Xid 31, ReadInvalid 0xdae994a000. vkd3d-proton: a freed VkImage range, 0xb0000 long, last unbound 228 s earlier, "very likely use-after-free". The fault is in its last 64 KiB tile, as in our two earlier losses of that kind.
  • So removing those seven programs didn't prevent a loss, and this one is the freed-texture family, not the gap.
  • With the padding on (91a) neither family appeared in 34 min. That's one run; the padding may also have moved memory around. The repeats decide.
  • #567 names one stale image at this loss, a texture destroyed 31 s before. It isn't the one in the fault range.
<!-- greyfinch-sync:brcly/TuxBox:comment:7277173823 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7277173823). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T11:32:26Z. --- A third run in this set, on the same build as 91a and 91b (RTX 5090, no padding): the control, plus the seven pixel programs that go around the map left out (`TUXBOX_SKIP_SHADERS`). - **Lost 7.2 min into the world, differently:** Xid 109 (context switch timeout) and Xid 31, `ReadInvalid 0xdae994a000`. vkd3d-proton: a freed `VkImage` range, 0xb0000 long, last unbound 228 s earlier, "very likely use-after-free". The fault is in its last 64 KiB tile, as in our two earlier losses of that kind. - So removing those seven programs didn't prevent a loss, and this one is the freed-texture family, not the gap. - With the padding on (91a) neither family appeared in 34 min. That's one run; the padding may also have moved memory around. The repeats decide. - `#567` names one stale image at this loss, a texture destroyed 31 s before. It isn't the one in the fault range.
Jerkin42 commented 2026-11-30 12:10:31 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by Jerkin42 on 2026-11-30T12:10:31Z.


A warm-cache world A/B of #573 (with #574) on the RX 9060 XT (1002:7590, RADV, section-import=substituted), for @NathansDomainSolutions and @NickStallman.

Build: e5d2e913 + #390, #572, #567 and the heap-index clamp, then #573 (through f73b79c3) and #574 picked on top. Warm cache, TUXBOX_XMEM_SECTION_WATCH=1, parallel publication at its default. Two switches in one build and one run each, so read the numbers with that in mind.

1. Without a fix it never reached the world. Four guest batches were rejected with 0x800703e6 (ERROR_NOACCESS), then PresentX failed planes=2 HRESULT=0x800703e6, and the title crashed.

  • The first rejection came right after a memory-wait write (Write64BitValueBottomOfPipeX). The same build without the watch had no rejections.
  • The cause: d3d12's heap::backing::write_host_slice is a WriteProcessMemory with no TuxBoxPrepareKernelWrite before it. That write fails on a page the watch has made read-only.
  • writeback::write_mapped has the same gap. It prepares only on its fallback path, after try_write_xmem_bytes has already gone through write_host_slice.
  • Fix used: I moved prepare_kernel_write into backing.rs and called it at the top of write_host_slice. With that, the second run reached the world with 0 rejections.

2. In the world it was slower here. Frames per second, by 90 s window after reaching the world:

0–90 s 90–180 s 180–270 s
without the PRs 0.20 0.22 0.27
#573 + #574 + the fix 0.14 0.12 0.02

Placement profile over the last minute, per call:

digest upload
without the PRs 1057 calls, 15.7 ms, 519 MiB each 71 calls, 600 MiB in all
with 477 calls, 16.0 ms, 614 MiB each 282 calls, 1314 MiB in all
  • The digest per batch didn't drop. The watch line shows why: section=373688/89131 MiB still goes by the section reason, against about 5.8k pages watched as written or unwritten. On this card nearly every section page seems to have a GPU alias or an import hold, so it falls back.
  • Uploads quadrupled. My guess, unconfirmed, is that pages released or faulted open count as written for the whole page.

I didn't separate #573 from #574 in these runs. If someone with an NVIDIA card sees section pages actually watched, that would show whether this is RADV-specific.

<!-- greyfinch-sync:brcly/TuxBox:comment:7278061380 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7278061380). Originally posted by [Jerkin42](https://github.com/Jerkin42) on 2026-11-30T12:10:31Z. --- A warm-cache world A/B of #573 (with #574) on the RX 9060 XT (`1002:7590`, RADV, `section-import=substituted`), for @NathansDomainSolutions and @NickStallman. **Build:** e5d2e913 + #390, #572, #567 and the heap-index clamp, then #573 (through f73b79c3) and #574 picked on top. Warm cache, `TUXBOX_XMEM_SECTION_WATCH=1`, parallel publication at its default. Two switches in one build and one run each, so read the numbers with that in mind. **1. Without a fix it never reached the world.** Four guest batches were rejected with `0x800703e6` (`ERROR_NOACCESS`), then `PresentX failed planes=2 HRESULT=0x800703e6`, and the title crashed. - The first rejection came right after a memory-wait write (`Write64BitValueBottomOfPipeX`). The same build without the watch had no rejections. - The cause: d3d12's `heap::backing::write_host_slice` is a `WriteProcessMemory` with no `TuxBoxPrepareKernelWrite` before it. That write fails on a page the watch has made read-only. - `writeback::write_mapped` has the same gap. It prepares only on its fallback path, after `try_write_xmem_bytes` has already gone through `write_host_slice`. - **Fix used:** I moved `prepare_kernel_write` into `backing.rs` and called it at the top of `write_host_slice`. With that, the second run reached the world with **0 rejections**. **2. In the world it was slower here.** Frames per second, by 90 s window after reaching the world: | | 0–90 s | 90–180 s | 180–270 s | |---|---|---|---| | without the PRs | 0.20 | 0.22 | 0.27 | | #573 + #574 + the fix | 0.14 | 0.12 | 0.02 | Placement profile over the last minute, per call: | | digest | upload | |---|---|---| | without the PRs | 1057 calls, 15.7 ms, 519 MiB each | 71 calls, 600 MiB in all | | with | 477 calls, 16.0 ms, 614 MiB each | 282 calls, 1314 MiB in all | - **The digest per batch didn't drop.** The watch line shows why: `section=373688/89131 MiB` still goes by the section reason, against about 5.8k pages watched as written or unwritten. On this card nearly every section page seems to have a GPU alias or an import hold, so it falls back. - **Uploads quadrupled.** My guess, unconfirmed, is that pages released or faulted open count as written for the whole page. I didn't separate #573 from #574 in these runs. If someone with an NVIDIA card sees section pages actually watched, that would show whether this is RADV-specific.
ReverendOzmund commented 2026-11-30 12:16:14 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by ReverendOzmund on 2026-11-30T12:16:14Z.


@Jerkin42 NVIDIA side for #573 (RTX 3080 Ti, 620.73.04, default mode, TUXBOX_XMEM_SECTION_WATCH=1; f482572a-era main + #572, #566, #563, #567, #564, #390, #573 and the heap-index clamp, without #574). One 90-minute cold run that stayed on the loading screen, so no world numbers yet.

Section pages are watched here: across the run the placement profile counted unwritten=182,457 and section=1,373 (under 1% falling back), written=7, noted=15, held=0. No 0x800703e6 rejections and no PresentX failure, but loading may never have reached write_host_slice. This host imports sections directly (section-import=aliased), which may be why pages aren't left with GPU aliases or holds as on RADV.

Placement still reached 2.6–3.2 s in the busiest 5 s windows, so the digest isn't all of it. I don't have a same-build run without #573 yet; I'll pair one once I'm in the world.

<!-- greyfinch-sync:brcly/TuxBox:comment:7278196546 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7278196546). Originally posted by [ReverendOzmund](https://github.com/ReverendOzmund) on 2026-11-30T12:16:14Z. --- @Jerkin42 NVIDIA side for #573 (RTX 3080 Ti, 620.73.04, default mode, TUXBOX_XMEM_SECTION_WATCH=1; f482572a-era main + #572, #566, #563, #567, #564, #390, #573 and the heap-index clamp, without #574). One 90-minute cold run that stayed on the loading screen, so no world numbers yet. Section pages are watched here: across the run the placement profile counted unwritten=182,457 and section=1,373 (under 1% falling back), written=7, noted=15, held=0. No 0x800703e6 rejections and no PresentX failure, but loading may never have reached write_host_slice. This host imports sections directly (section-import=aliased), which may be why pages aren't left with GPU aliases or holds as on RADV. Placement still reached 2.6–3.2 s in the busiest 5 s windows, so the digest isn't all of it. I don't have a same-build run without #573 yet; I'll pair one once I'm in the world.
gtb-sbe commented 2026-11-30 12:48:19 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-11-30T12:48:19Z.


@ReverendOzmund yes, it looks like the same state. Your stalled label 0x518fa78 >= 0x2c272 on a type 2 queue is the same label as in my run 44d (0x518fa78 >= 0x1dad, RX 9060 XT, f482572a + #557 + #389, private views), which ended on the title's watchdog at game time 3:00 with the texture_readback fence stalled as well. My run wasn't short of memory at the end (no failed allocations after start-up, 8.8 GiB available at the lowest), so memory pressure may be one way in but probably isn't needed. I've claimed the watchdog end on #533 and will post here what the stall turns out to be.

<!-- greyfinch-sync:brcly/TuxBox:comment:7278947082 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7278947082). Originally posted by [gtb-sbe](https://github.com/gtb-sbe) on 2026-11-30T12:48:19Z. --- @ReverendOzmund yes, it looks like the same state. Your `stalled label 0x518fa78 >= 0x2c272` on a type 2 queue is the same label as in my run 44d (`0x518fa78 >= 0x1dad`, RX 9060 XT, `f482572a` + #557 + #389, private views), which ended on the title's watchdog at game time 3:00 with the `texture_readback` fence stalled as well. My run wasn't short of memory at the end (no failed allocations after start-up, 8.8 GiB available at the lowest), so memory pressure may be one way in but probably isn't needed. I've claimed the watchdog end on #533 and will post here what the stall turns out to be.
NickStallman commented 2026-11-30 13:00:33 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T13:00:33Z.


@Jerkin42 an update that weakens what I posted last night. The repeat control (no padding, same build, same caches) survived its full 45 minutes, 35.6 of them in the world. So far on this build (RTX 5090), in minutes in the world:

Arm Runs Losses
Padding on 34.3 (no loss) 0
No padding 4.3 (lost, gap fault), 35.6 (no loss), 10.6 (90a, no loss) 1
No padding, seven programs left out 7.2 (lost, freed texture's range) 1

Nothing here separates the arms yet: losses come at very different times, and one of three no-padding runs died early. I don't have evidence on NVIDIA that the padding prevents the loss, only one pair that went the right way. Three more runs are queued overnight (padding twice, control once more), then your clamp. I'll post the counts either way.

<!-- greyfinch-sync:brcly/TuxBox:comment:7279227073 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7279227073). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T13:00:33Z. --- @Jerkin42 an update that weakens what I posted last night. The repeat control (no padding, same build, same caches) **survived its full 45 minutes, 35.6 of them in the world.** So far on this build (RTX 5090), in minutes in the world: | Arm | Runs | Losses | |---|---|---| | Padding on | 34.3 (no loss) | 0 | | No padding | 4.3 (lost, gap fault), 35.6 (no loss), 10.6 (90a, no loss) | 1 | | No padding, seven programs left out | 7.2 (lost, freed texture's range) | 1 | Nothing here separates the arms yet: losses come at very different times, and one of three no-padding runs died early. **I don't have evidence on NVIDIA that the padding prevents the loss, only one pair that went the right way.** Three more runs are queued overnight (padding twice, control once more), then your clamp. I'll post the counts either way.
gtb-sbe commented 2026-11-30 13:42:11 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-11-30T13:42:11Z.


@ReverendOzmund a correction to my answer above: on my card the stalled labels weren't the cause. A direct batch was refused (inline ray scene or geometry changed after recording, rejecting submission), and after that the direct queue drops everything, so the lists that write those labels never run. That's the crash #566 fixes (merged this morning). Your build (f482572a + #557 + #501) doesn't have it either, so it's worth checking whether your log has that line before the stalled labels.

<!-- greyfinch-sync:brcly/TuxBox:comment:7280229962 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7280229962). Originally posted by [gtb-sbe](https://github.com/gtb-sbe) on 2026-11-30T13:42:11Z. --- @ReverendOzmund a correction to my answer above: on my card the stalled labels weren't the cause. A direct batch was refused (`inline ray scene or geometry changed after recording, rejecting submission`), and after that the direct queue drops everything, so the lists that write those labels never run. That's the crash #566 fixes (merged this morning). Your build (`f482572a` + #557 + #501) doesn't have it either, so it's worth checking whether your log has that line before the stalled labels.
ReverendOzmund commented 2026-11-30 14:40:19 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by ReverendOzmund on 2026-11-30T14:40:19Z.


@gtb-sbe checked: run35 has it. "inline ray scene or geometry changed after recording, rejecting submission" and "direct queue rejected a guest command-list batch (0x80070057); its later batches are dropped" come about 1,200 lines before the first stalled label. That run didn't have #566; my two later runs with #566 have no rejection line at all. So that ending was the #566 crash here too, and the failed allocations just before it are probably a side issue, not the cause.

<!-- greyfinch-sync:brcly/TuxBox:comment:7281744060 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7281744060). Originally posted by [ReverendOzmund](https://github.com/ReverendOzmund) on 2026-11-30T14:40:19Z. --- @gtb-sbe checked: run35 has it. "inline ray scene or geometry changed after recording, rejecting submission" and "direct queue rejected a guest command-list batch (0x80070057); its later batches are dropped" come about 1,200 lines before the first stalled label. That run didn't have #566; my two later runs with #566 have no rejection line at all. So that ending was the #566 crash here too, and the failed allocations just before it are probably a side issue, not the cause.
NickStallman commented 2026-11-30 15:07:08 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T15:07:08Z.


@Jerkin42 the overnight repeats are in (RTX 5090, one build, minutes in the world, 45-minute cap):

Arm Runs World minutes Losses
Padding on 91a 34.3, 92b 35.6, 93a 35.8 105.7 0
No padding 91b 4.3 lost, 92a 35.6, 90a 10.6, 93b 17.1 lost 67.6 2
No padding, seven programs left out 91c 7.2 lost 7.2 1
  • 93b is a gap fault at 0x10de2f000, exactly the address of our 87a loss on an older build the day before (an older one, 0x10be2f000, is 32 MiB lower). With the map at a different place each time, a repeat like that points to a fixed title value rather than a random stale pointer.
  • How strong is this? Not strong alone. If the padding did nothing, the chance that all two losses fell in the no-padding arm is about 15%, or 7% counting 91c. Counting our earlier losses on other builds (six in about 63 world minutes without padding) it's under 1%, but those builds differ.
  • So my view: the padding very likely helps on NVIDIA too, and 106 world minutes without a loss is more than we'd had in total before. It isn't proof. The clamp runs are next.
<!-- greyfinch-sync:brcly/TuxBox:comment:7282459547 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7282459547). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T15:07:08Z. --- @Jerkin42 the overnight repeats are in (RTX 5090, one build, minutes in the world, 45-minute cap): | Arm | Runs | World minutes | Losses | |---|---|---|---| | Padding on | 91a 34.3, 92b 35.6, 93a 35.8 | 105.7 | **0** | | No padding | 91b **4.3 lost**, 92a 35.6, 90a 10.6, 93b **17.1 lost** | 67.6 | 2 | | No padding, seven programs left out | 91c **7.2 lost** | 7.2 | 1 | - 93b is a gap fault at **`0x10de2f000`, exactly the address of our 87a loss** on an older build the day before (an older one, 0x10be2f000, is 32 MiB lower). With the map at a different place each time, a repeat like that points to a fixed title value rather than a random stale pointer. - **How strong is this?** Not strong alone. If the padding did nothing, the chance that all two losses fell in the no-padding arm is about 15%, or 7% counting 91c. Counting our earlier losses on other builds (six in about 63 world minutes without padding) it's under 1%, but those builds differ. - So my view: the padding very likely helps on NVIDIA too, and 106 world minutes without a loss is more than we'd had in total before. It isn't proof. The clamp runs are next.
NickStallman commented 2026-11-30 18:02:22 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T18:02:22Z.


@Jerkin42 your clamp on the RTX 5090 (fix/heap-index-clamp 61580565 on main ba7680e5 with our other PRs, the word an out-of-range index reads set to #572's null view; 10de:2b85, 620.70.10, GE-Proton11-14):

Arm Runs (minutes in the world) Losses
Clamp 94a 42.6 (cold driver cache, ~57 min load), 94b 35.3 (warm) 0
Padding 34.3, 35.6, 35.8 0
Neither 4.3 lost, 35.6, 10.6, 17.1 lost 2
Neither, seven programs left out 7.2 lost 1
  • Protected: 183.6 world minutes, 5 runs, no loss. Unprotected: 74.8 minutes, 3 losses. If protection did nothing, the chance of all three losses falling in the unprotected runs is 2.4% (7% counting only the plain control). Builds differ a little between the two sets (main-13 and main-14), so it isn't a clean experiment, but I'd now say the index is very likely the cause on our card too.
  • It recompiles a lot here: 279 of 700 sampled requests (40%) change translation, so about 11 min of DXC work in preparation, then a cold driver. The clamp's word 0 holding the count, with existing translations still testing nonzero, is what makes that only a cost and not a break.
  • What I didn't do: GPU checks on this build (check --no-gpu 13 of 13 passes; the device tests didn't run), and nothing on AMD.

If the PR goes up I'll run the full checks on both cards at its head.

<!-- greyfinch-sync:brcly/TuxBox:comment:7287235763 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7287235763). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T18:02:22Z. --- @Jerkin42 your clamp on the RTX 5090 (`fix/heap-index-clamp` 61580565 on main ba7680e5 with our other PRs, the word an out-of-range index reads set to #572's null view; `10de:2b85`, 620.70.10, GE-Proton11-14): | Arm | Runs (minutes in the world) | Losses | |---|---|---| | **Clamp** | 94a 42.6 (cold driver cache, ~57 min load), 94b 35.3 (warm) | **0** | | Padding | 34.3, 35.6, 35.8 | 0 | | Neither | 4.3 **lost**, 35.6, 10.6, 17.1 **lost** | 2 | | Neither, seven programs left out | 7.2 **lost** | 1 | - **Protected: 183.6 world minutes, 5 runs, no loss. Unprotected: 74.8 minutes, 3 losses.** If protection did nothing, the chance of all three losses falling in the unprotected runs is 2.4% (7% counting only the plain control). Builds differ a little between the two sets (main-13 and main-14), so it isn't a clean experiment, but I'd now say the index is very likely the cause on our card too. - **It recompiles a lot here:** 279 of 700 sampled requests (40%) change translation, so about 11 min of DXC work in preparation, then a cold driver. The clamp's word 0 holding the count, with existing translations still testing nonzero, is what makes that only a cost and not a break. - What I didn't do: GPU checks on this build (`check --no-gpu` 13 of 13 passes; the device tests didn't run), and nothing on AMD. If the PR goes up I'll run the full checks on both cards at its head.
1093i3511 commented 2026-11-30 18:21:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-11-30T18:21:40Z.


@Jerkin42 @NickStallman, an RDNA 2 data point for the index-map padding. On an RX 6600 it does not stop the fault that ends my runs, which looks like a different family from the SQC one.

Setup: RX 6600 (8 GB, 1002:73ff, RADV / Mesa 26.3.1, GE-Proton11-14), host profile section-import=substituted descriptor-bytes=64/16. Build: main 87298944 + diag/index-map-pad (4348e7ff), warm caches. Every run used Series S (ConsoleMode=96, Conole Type: Lockhart) with TUXBOX_XMEM_PRIVATE_VIEWS=1, launched back to back, alternating the padding.

Run TUXBOX_INDEX_MAP_PAD Length Mission set / end Fault pages (TCP)
1 1 330 s F:1185 / F:1193 0x8001e94f5000–0x8001e94ff000, 0x8001e91fd000, 0x8001e6ff4000
2 0 330 s reached; no crash report 0x8001e99fc000, 0x8001e99fd000
3 1 269 s F:1171 / F:1177 0x8001e93f7000
4 0 240 s F:1006 / F:1013 0x8001e55dc000
5 1 476 s F:5368 / F:5375 0x8002344b0000–0x8002344b2000
6 0 330 s F:1112 / F:1119 0x8001e7ffc000, 0x8001e8df8000, 0x8001e8dfd000, 0x8001e91fa000–0x8001e91ff000
  • The padding was active in runs 1, 3 and 5: index map padded to 134217728 entries.
  • Run 5 waited at the account picker, so it reached the world later.

What every run has in common:

  • The faults come from the game's vkd3d_queue on ring 24. The client is TCP, not SQC, with PERMISSION_FAULTS 0x3 and MAPPING_ERROR 0, so these are vector memory reads, not scalar descriptor loads.
  • Each run ended a few frames after the first mission was set (6–8 frames).
  • The ring reset worked except once. Run 2 needed a second reset that lost VRAM, and the desktop went with it.
  • The pages repeat across runs: 0x8001e5…–0x8001e9…, often the last pages just below a 2 MiB boundary (…e94ff000, …e99fd000, …e91ff000, …e7ffc000). Run 5's waiting at the account picker moved them to 0x800234….
  • On e5d2e913 without the padding, two earlier runs (Series S and packaged) faulted at 0x8001e9df5000–0x8001e9dfd000 and 0x8001ed9fd000.

So on this card it's 3 of 3 runs with the padding and 3 of 3 without, plus those 2 earlier runs. It looks like a read just past the end of an allocation, or in the last pages of something freed, so closer to @NickStallman's other family. Memory isn't exhausted at the time: requested VRAM is 5.7–6.0 GB, card GTT 7.8–8.6 GB and RAM 24.5–26 GB of 32. On an older base, #389 (title memory mapped past root SRVs and UAVs) removed this fault on this card in 3 of 3 runs.

Series S against packaged, on e5d2e913 with the same settings otherwise:

Series S Packaged
Largest placed-texture readback 115 MiB / 83 textures 303 MiB / 83 textures
Peak card GTT 7.9 GB 10.7 GB
Peak RAM / swap 28.1 / 4.4 GB 29.9 / 6.3 GB

Series S takes clear memory pressure off an 8 GB card. It doesn't change the ending.

<!-- greyfinch-sync:brcly/TuxBox:comment:7287735707 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7287735707). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-11-30T18:21:40Z. --- @Jerkin42 @NickStallman, an RDNA 2 data point for the index-map padding. On an RX 6600 it does **not** stop the fault that ends my runs, which looks like a different family from the SQC one. **Setup:** RX 6600 (8 GB, `1002:73ff`, RADV / Mesa 26.3.1, GE-Proton11-14), host profile `section-import=substituted descriptor-bytes=64/16`. Build: `main` `87298944` + `diag/index-map-pad` (`4348e7ff`), warm caches. Every run used Series S (`ConsoleMode=96`, `Conole Type: Lockhart`) with `TUXBOX_XMEM_PRIVATE_VIEWS=1`, launched back to back, alternating the padding. | Run | `TUXBOX_INDEX_MAP_PAD` | Length | Mission set / end | Fault pages (TCP) | | --- | --- | --- | --- | --- | | 1 | 1 | 330 s | F:1185 / F:1193 | `0x8001e94f5000`–`0x8001e94ff000`, `0x8001e91fd000`, `0x8001e6ff4000` | | 2 | 0 | 330 s | reached; no crash report | `0x8001e99fc000`, `0x8001e99fd000` | | 3 | 1 | 269 s | F:1171 / F:1177 | `0x8001e93f7000` | | 4 | 0 | 240 s | F:1006 / F:1013 | `0x8001e55dc000` | | 5 | 1 | 476 s | F:5368 / F:5375 | `0x8002344b0000`–`0x8002344b2000` | | 6 | 0 | 330 s | F:1112 / F:1119 | `0x8001e7ffc000`, `0x8001e8df8000`, `0x8001e8dfd000`, `0x8001e91fa000`–`0x8001e91ff000` | - The padding was active in runs 1, 3 and 5: `index map padded to 134217728 entries`. - Run 5 waited at the account picker, so it reached the world later. **What every run has in common:** - The faults come from the game's `vkd3d_queue` on ring 24. The client is **TCP**, not SQC, with `PERMISSION_FAULTS 0x3` and `MAPPING_ERROR 0`, so these are vector memory reads, not scalar descriptor loads. - Each run ended a few frames after the first mission was set (6–8 frames). - The ring reset worked except once. Run 2 needed a second reset that lost VRAM, and the desktop went with it. - The pages repeat across runs: `0x8001e5…`–`0x8001e9…`, often the last pages just below a 2 MiB boundary (`…e94ff000`, `…e99fd000`, `…e91ff000`, `…e7ffc000`). Run 5's waiting at the account picker moved them to `0x800234…`. - On `e5d2e913` without the padding, two earlier runs (Series S and packaged) faulted at `0x8001e9df5000`–`0x8001e9dfd000` and `0x8001ed9fd000`. So on this card it's 3 of 3 runs with the padding and 3 of 3 without, plus those 2 earlier runs. It looks like a read just past the end of an allocation, or in the last pages of something freed, so closer to @NickStallman's other family. Memory isn't exhausted at the time: requested VRAM is 5.7–6.0 GB, card GTT 7.8–8.6 GB and RAM 24.5–26 GB of 32. On an older base, #389 (title memory mapped past root SRVs and UAVs) removed this fault on this card in 3 of 3 runs. **Series S against packaged**, on `e5d2e913` with the same settings otherwise: | | Series S | Packaged | | --- | --- | --- | | Largest placed-texture readback | 115 MiB / 83 textures | 303 MiB / 83 textures | | Peak card GTT | 7.9 GB | 10.7 GB | | Peak RAM / swap | 28.1 / 4.4 GB | 29.9 / 6.3 GB | Series S takes clear memory pressure off an 8 GB card. It doesn't change the ending.
NickStallman commented 2026-11-30 19:41:47 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T19:41:47Z.


A note on the setup behind our overnight runs on this issue (RTX 5090, 91a to 94b): they used a diagnostic build of vkd3d-proton, the commit GE-Proton11-14 ships (cae8353e) with tracing on and a timestamp patch, not the DLLs Proton installs. That affects timing, not which address faulted, but I should have said so. The next runs use GE-Proton11-15 and its own vkd3d-proton.

<!-- greyfinch-sync:brcly/TuxBox:comment:7289797286 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7289797286). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T19:41:47Z. --- A note on the setup behind our overnight runs on this issue (RTX 5090, 91a to 94b): they used a diagnostic build of vkd3d-proton, the commit GE-Proton11-14 ships (cae8353e) with tracing on and a timestamp patch, not the DLLs Proton installs. That affects timing, not which address faulted, but I should have said so. The next runs use GE-Proton11-15 and its own vkd3d-proton.
NickStallman commented 2026-11-30 22:41:07 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T22:41:07Z.


Corrected: I told @Jerkin42 and @ReverendOzmund to keep #572 out of their builds because of a descriptor stride bug. The bug is real but only for small paged heaps (it fails 8 Lanes suites); ProjectScarlett's heap is larger than 1,000,000 and takes the exact path, so your game results with #572 are not affected by it. Details: https://github.com/brcly/TuxBox/pull/572. The clamp alone passes all of plain main's checks on an RTX 5090.

<!-- greyfinch-sync:brcly/TuxBox:comment:7294170448 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7294170448). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T22:41:07Z. --- **Corrected:** I told @Jerkin42 and @ReverendOzmund to keep #572 out of their builds because of a descriptor stride bug. The bug is real but only for small paged heaps (it fails 8 Lanes suites); ProjectScarlett's heap is larger than 1,000,000 and takes the exact path, so your game results with #572 are not affected by it. Details: https://github.com/brcly/TuxBox/pull/572. The clamp alone passes all of plain main's checks on an RTX 5090.
NickStallman commented 2026-11-30 22:46:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T22:46:40Z.


@Jerkin42 fix/heap-index-clamp (61580565) on main 40a69c3f (cherry-picked, no conflicts: da64064a), full python tuxbox.py check, GE-Proton11-15, without any of our other branches:

  • RTX 5090 (10de:2b85, 620.70.10): 205 pass, 0 fail. Plain 40a69c3f: 205, 0.
  • AMD iGPU (1002:13c0, RADV): 204 pass, 0 fail. Plain 40a69c3f: 204, 0.

Our earlier 8 failures are not from the clamp; we think they come from our draft #572 in the same build, and the probe that isolates it is running.

Evidence: TuxBox check of da64064a21c6, no uncommitted changes, GPU 10de:2b85: 17 passed, 0 failed, 0 not run
Evidence: TuxBox check of da64064a21c6, no uncommitted changes, GPU 1002:13c0: 17 passed, 0 failed, 0 not run

<!-- greyfinch-sync:brcly/TuxBox:comment:7294290445 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7294290445). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T22:46:40Z. --- @Jerkin42 `fix/heap-index-clamp` (61580565) on main 40a69c3f (cherry-picked, no conflicts: da64064a), full `python tuxbox.py check`, GE-Proton11-15, without any of our other branches: - RTX 5090 (`10de:2b85`, 620.70.10): 205 pass, 0 fail. Plain 40a69c3f: 205, 0. - AMD iGPU (`1002:13c0`, RADV): 204 pass, 0 fail. Plain 40a69c3f: 204, 0. Our earlier 8 failures are not from the clamp; we think they come from our draft #572 in the same build, and the probe that isolates it is running. Evidence: TuxBox check of da64064a21c6, no uncommitted changes, GPU 10de:2b85: 17 passed, 0 failed, 0 not run Evidence: TuxBox check of da64064a21c6, no uncommitted changes, GPU 1002:13c0: 17 passed, 0 failed, 0 not run
1093i3511 commented 2026-12-01 07:19:45 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-12-01T07:19:45Z.


TUXBOX_XMEM_SECTION_WATCH=1 (#573) with TUXBOX_CHECK_ONCE_PER_FRAME=1 (#590) on the 8 GB RX 6600 (1002:73ff, RADV, section-import=substituted), main 717a74c4, GE-Proton11-15, Series S. One run per setting. Presents per 10 s for the first six windows, from the presented N frames in 10s lines:

Setting First minute World
Defaults (section-backed pages, #464) 350, 329, 386, 310, 320, 387 probably reached, then a GPU fault
Section watch + check once per frame 352, 318, 369, 303, 300, 383 F:973, end F:1027
TUXBOX_XMEM_PRIVATE_VIEWS=1 575, 627, 567, 577, 455, 197 F:1226, end F:1267
  • Start pace: on this card the two opt-ins don't change the first minute: they're within a few percent of the defaults. Private views are still about 1.7× faster there. Since 6e2c5dab the default start went from about 170 to about 350 per 10 s, so the perf PRs roughly doubled it, but private views are faster again.
  • A different GPU fault in the opt-in run: at the end, the game's queue faulted with TCP writes (GCVM_L2_PROTECTION_FAULT_STATUS 0x00641041, PERMISSION_FAULTS 4, RW 1) at 0x8001cc8f5000 and 0x8001cb0e5000. There were also reads (0x00601031) at five more pages, all at offset 0x5000 in their 64 KiB block (0x8001c4f55000–0x8001ca7e5000). The ring was a compute one (comp_1.0.1). Its reset succeeded and the title's watchdog ended the game. In the runs I've reported so far, every fault was a read. One run doesn't tell whether the write comes from the opt-ins; I can repeat it with each one alone.
  • Peaks in that run: requested VRAM 7.0 GB, card GTT 9.3 GB, RAM 28.0 GB, swap 5.0 GB.
<!-- greyfinch-sync:brcly/TuxBox:comment:7303924231 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7303924231). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-12-01T07:19:45Z. --- `TUXBOX_XMEM_SECTION_WATCH=1` (#573) with `TUXBOX_CHECK_ONCE_PER_FRAME=1` (#590) on the 8 GB RX 6600 (`1002:73ff`, RADV, `section-import=substituted`), main `717a74c4`, GE-Proton11-15, Series S. One run per setting. Presents per 10 s for the first six windows, from the `presented N frames in 10s` lines: | Setting | First minute | World | | --- | --- | --- | | Defaults (section-backed pages, #464) | 350, 329, 386, 310, 320, 387 | probably reached, then a GPU fault | | Section watch + check once per frame | 352, 318, 369, 303, 300, 383 | F:973, end F:1027 | | `TUXBOX_XMEM_PRIVATE_VIEWS=1` | 575, 627, 567, 577, 455, 197 | F:1226, end F:1267 | - **Start pace:** on this card the two opt-ins don't change the first minute: they're within a few percent of the defaults. Private views are still about 1.7× faster there. Since 6e2c5dab the default start went from about 170 to about 350 per 10 s, so the perf PRs roughly doubled it, but private views are faster again. - **A different GPU fault in the opt-in run:** at the end, the game's queue faulted with TCP **writes** (`GCVM_L2_PROTECTION_FAULT_STATUS 0x00641041`, `PERMISSION_FAULTS 4`, `RW 1`) at `0x8001cc8f5000` and `0x8001cb0e5000`. There were also reads (`0x00601031`) at five more pages, all at offset 0x5000 in their 64 KiB block (`0x8001c4f55000`–`0x8001ca7e5000`). The ring was a compute one (`comp_1.0.1`). Its reset succeeded and the title's watchdog ended the game. In the runs I've reported so far, every fault was a read. One run doesn't tell whether the write comes from the opt-ins; I can repeat it with each one alone. - Peaks in that run: requested VRAM 7.0 GB, card GTT 9.3 GB, RAM 28.0 GB, swap 5.0 GB.
brcly commented 2026-12-01 15:14:22 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by brcly on 2026-12-01T15:14:22Z.


@1093i3511 thanks, that settles one question: on the RX 6600 neither the section watch nor once-per-frame checks change the start, and private views stay about 1.7x faster.

Note that TUXBOX_CHECK_ONCE_PER_FRAME is on by default since e40d8052 (on a 16 GB NVIDIA card it cut the digest of section-backed textures from about 1.2 s to 0.2 s per 5 s in the world, which is where it mattered there). Read residency and lazy publication became defaults at the same time, so the next comparison should be on current main.

On the write fault: yes please, one run with each opt-in alone would tell whether it comes from one of them. It's the first write fault in your series, so it's worth pinning down.

<!-- greyfinch-sync:brcly/TuxBox:comment:7315577856 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7315577856). Originally posted by [brcly](https://github.com/brcly) on 2026-12-01T15:14:22Z. --- @1093i3511 thanks, that settles one question: on the RX 6600 neither the section watch nor once-per-frame checks change the start, and private views stay about 1.7x faster. Note that `TUXBOX_CHECK_ONCE_PER_FRAME` is on by default since e40d8052 (on a 16 GB NVIDIA card it cut the digest of section-backed textures from about 1.2 s to 0.2 s per 5 s in the world, which is where it mattered there). Read residency and lazy publication became defaults at the same time, so the next comparison should be on current main. On the write fault: yes please, one run with each opt-in alone would tell whether it comes from one of them. It's the first write fault in your series, so it's worth pinning down.
1093i3511 commented 2026-12-02 20:58:53 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-12-02T20:58:53Z.


@brcly, the run with each opt-in alone that you asked for. RX 6600 (8 GB, RADV / Mesa 26.3.1, GE-Proton11-15, section-import=substituted), Series S (--graphics-profile series-s), one run each, warm caches. Build: 6d4f1cd7 + #647 (0bde5bb3), because current main stops at the start menu on this card (#533 issuecomment-7354129812).

Setting Menus, presents per 10 s End
Defaults (check once per frame on) 270–300 world (F:3260), 830 s, title abort on full VRAM, no GPU fault
TUXBOX_XMEM_SECTION_WATCH=1 TUXBOX_CHECK_ONCE_PER_FRAME=0 330–400 world (F:1012), 896 s, title abort on full VRAM, no GPU fault
TUXBOX_XMEM_PRIVATE_VIEWS=1 560–670 world (F:1150), 307 s, #603 TCP read fault
  • The write fault from 1 Dec (section watch + check once per frame on 717a74c4) does not come back with section watch alone. One run, so it doesn't rule it out.
  • Start pace: section watch alone is the same as the defaults. Private views are still about twice as fast in the menus (frame median 18 ms against 31–64 ms over the whole run).
  • Both Series S runs without a GPU fault ended when the card was full (memory ledger: card 7187/7195 MiB and 7348/7356 MiB), on the title's abort path.

With TUXBOX_FRAME_LOG, most of the run after the intro starts was in slow frames (76–86 %). Their time is in the presenting thread's submits (46–65 %, placement 0.3–0.9 s per slow frame), while GPU queues wait at title memory waits (465 s with the defaults, 1,611 s with section watch, summed over the slow frames). None of those waits was released by the timeout.

<!-- greyfinch-sync:brcly/TuxBox:comment:7358615863 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/472#issuecomment-7358615863). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-12-02T20:58:53Z. --- @brcly, the run with each opt-in alone that you asked for. RX 6600 (8 GB, RADV / Mesa 26.3.1, GE-Proton11-15, `section-import=substituted`), Series S (`--graphics-profile series-s`), one run each, warm caches. Build: `6d4f1cd7` + #647 (`0bde5bb3`), because current main stops at the start menu on this card (#533 issuecomment-7354129812). | Setting | Menus, presents per 10 s | End | | --- | --- | --- | | Defaults (check once per frame on) | 270–300 | world (F:3260), 830 s, title abort on full VRAM, no GPU fault | | `TUXBOX_XMEM_SECTION_WATCH=1 TUXBOX_CHECK_ONCE_PER_FRAME=0` | 330–400 | world (F:1012), 896 s, title abort on full VRAM, **no GPU fault** | | `TUXBOX_XMEM_PRIVATE_VIEWS=1` | 560–670 | world (F:1150), 307 s, #603 TCP read fault | - The write fault from 1 Dec (section watch + check once per frame on `717a74c4`) does not come back with section watch alone. One run, so it doesn't rule it out. - Start pace: section watch alone is the same as the defaults. Private views are still about twice as fast in the menus (frame median 18 ms against 31–64 ms over the whole run). - Both Series S runs without a GPU fault ended when the card was full (`memory ledger: card 7187/7195 MiB` and `7348/7356 MiB`), on the title's abort path. With `TUXBOX_FRAME_LOG`, most of the run after the intro starts was in slow frames (76–86 %). Their time is in the presenting thread's submits (46–65 %, placement 0.3–0.9 s per slow frame), while GPU queues wait at title memory waits (465 s with the defaults, 1,611 s with section watch, summed over the slow frames). None of those waits was released by the timeout.
Sign in to join this conversation.
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#472
No description provided.