d3d12: GPU reads a placed texture's image after it was destroyed (GPUVM ReadInvalid on ProjectScarlett, RX 9070 XT) #603

Open
opened 2026-11-30 23:03:56 +00:00 by Kayotic1337 · 26 comments
Kayotic1337 commented 2026-11-30 23:03:56 +00:00 (Migrated from github.com)
Contributor

Imported from brcly/TuxBox. Originally posted by Kayotic1337 on 2026-11-30T23:03:56Z.


On an RX 9070 XT (1002:7550, RDNA 4, RADV, Mesa 26.3.1, GE-Proton11-15, Linux 7.3.6) I made 13 ProjectScarlett runs on main (d00006b2, later 40a69c3f), most with @Jerkin42's fix/heap-index-clamp and local diagnostics. All 13 ended on a GPUVM read fault from TCP (RW: 0). With VKD3D_CONFIG=fault, vkd3d-proton's address tracker placed the address inside the sparse VkImage of a placed texture that TuxBox had already destroyed in 8 of them: 2 to 97 seconds earlier. In the other 5, all before #389, it found no entry for the address, and the nearest allocation was a 64 KiB buffer.

How I matched the fault to a texture

I added a local log line to placement::Texture::drop with the time on QPC, the same clock vkd3d's tracker uses, plus the texture's address, size and description. The tracker's UNBIND time for the faulting VkImage then names the texture:

Run Texture dropped vkd3d UNBIND Fault reported Texture
2129 13194.448855 s 13194.448870 s 13278.32 s (84 s later) 0xd98424000, 1024×1024, BC1, 9 mips
2143 14065.237892 s 14065.238127 s 14067.70 s (2.5 s later) 0xded0ed000, 512×512, BC1, 8 mips
2241 17545.980577 s 17545.980588 s 17590.13 s (44 s later) 0xd6c2d9d00, 16×4, R16G16B16A16_FLOAT, 1 mip
2303 18865.859927 s 18865.860046 s 18962.61 s (97 s later) 0xda7dc0000, 512×512×6 cube, BC6H_UF16, 10 mips

In 2129, 2143 and 2241 the drop is the last one before the UNBIND (11–235 µs), and the tracker's image size fits it: 0xb0000, 0x30000 and 0x10000. In 2143 the tracker also names the image as 512×512, 8 levels, BC1. In 2303, three cube textures were dropped within 0.4 ms. This is the last of them and the largest, which fits the 2.25 MiB image best, but it is the least certain row. All are flags 0x300000 placed textures that TuxBox backs with a reserved image (placement/residency.rs). Runs 2109 and 2119 showed the same use-after-free, but had no drop log. In 2241, by the time of the read a new 64 KiB VkDeviceMemory had been bound at the destroyed image's VA.

Run 2329, on 40a69c3f (with #389) plus the clamp, ended the same way. Ten 1024×1024 textures of that size were released together there, so I can't say which one it was. The out-of-bounds reads past 64 KiB buffers that I saw before #389 didn't happen in that run (one run only).

What I ruled out

  • GPU work in flight when the texture was dropped. I kept a dropped texture's image and residency backing alive until every queue in queue_trace::pending_fences() passed the value it had at the drop, released by a worker thread. The fault still came, 2.3 to 2.6 s after that delayed release (2155, 2329). So the read comes from work submitted after the drop, or from a queue that isn't tracked there.
  • The 3 s RETIRE_GRACE on replaced descriptors (placement/descriptors.rs). With 60 s instead, the image was still destroyed and read 2.2 s later (2119).
  • Descriptors TuxBox tracks. With TUXBOX_TRACE_RASTER_INPUTS=1, I looked up which slots in diagnostics::display's view registry still named the image at drop time. For the faulting textures in 2143 and 2303, none did. Nulling every slot that did name a dropped image (2303), and nulling evicted visible slots (below), did not stop the fault.

Something that looks wrong, but isn't proven to be this fault

descriptor_paging's release_slots → clear_host_tracking clears the tracking of an evicted table's visible slots. That releases their DescriptorBacking::Placed after RETIRE_GRACE. It leaves the native descriptors in the visible heap until the slots are reused. In three runs, 2.1–2.5% of dropped placed textures still had registry slots naming them at drop time:

  • in the history ring
  • in the staging heap
  • in the visible heap

In run 2251 that was 147 of 6957 drops, with 129 slots in the history ring, 122 in staging and 88 in the visible heap. Writing null SRVs into evicted slots (local experiment) didn't stop the faults: runs 2241, 2303 and 2329 had it on.

Open question

What still names a placed texture's image after the last Arc<Texture> is gone, without being one of the descriptor slots above? Possible places I haven't been able to check:

  • the index map;
  • descriptor bytes the title writes directly;
  • an alias that shares the image.

I tried vkd3d-proton's descriptor QA (-Denable_descriptor_qa=true, VKD3D_CONFIG=descriptor_qa_checks). It needed a local fix in vkd3d-proton to start at all: a CPU sampler heap carries an invalid QA heap-info pointer. Its instrumented shaders then miss the driver cache, so I stopped before reaching the cutscene.

Logs and the local diagnostic commits are available if useful.

<!-- greyfinch-sync:brcly/TuxBox:issue:6708170130 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603). Originally posted by [Kayotic1337](https://github.com/Kayotic1337) on 2026-11-30T23:03:56Z. --- On an RX 9070 XT (`1002:7550`, RDNA 4, RADV, Mesa 26.3.1, GE-Proton11-15, Linux 7.3.6) I made 13 ProjectScarlett runs on main (`d00006b2`, later `40a69c3f`), most with @Jerkin42's `fix/heap-index-clamp` and local diagnostics. All 13 ended on a GPUVM read fault from TCP (`RW: 0`). With `VKD3D_CONFIG=fault`, vkd3d-proton's address tracker placed the address inside the sparse `VkImage` of a placed texture that TuxBox had already destroyed in 8 of them: 2 to 97 seconds earlier. In the other 5, all before #389, it found no entry for the address, and the nearest allocation was a 64 KiB buffer. ### How I matched the fault to a texture I added a local log line to `placement::Texture::drop` with the time on QPC, the same clock vkd3d's tracker uses, plus the texture's address, size and description. The tracker's `UNBIND` time for the faulting `VkImage` then names the texture: | Run | Texture dropped | vkd3d `UNBIND` | Fault reported | Texture | | --- | --- | --- | --- | --- | | 2129 | 13194.448855 s | 13194.448870 s | 13278.32 s (84 s later) | `0xd98424000`, 1024×1024, BC1, 9 mips | | 2143 | 14065.237892 s | 14065.238127 s | 14067.70 s (2.5 s later) | `0xded0ed000`, 512×512, BC1, 8 mips | | 2241 | 17545.980577 s | 17545.980588 s | 17590.13 s (44 s later) | `0xd6c2d9d00`, 16×4, R16G16B16A16_FLOAT, 1 mip | | 2303 | 18865.859927 s | 18865.860046 s | 18962.61 s (97 s later) | `0xda7dc0000`, 512×512×6 cube, BC6H_UF16, 10 mips | In 2129, 2143 and 2241 the drop is the last one before the `UNBIND` (11–235 µs), and the tracker's image size fits it: 0xb0000, 0x30000 and 0x10000. In 2143 the tracker also names the image as 512×512, 8 levels, BC1. In 2303, three cube textures were dropped within 0.4 ms. This is the last of them and the largest, which fits the 2.25 MiB image best, but it is the least certain row. All are `flags 0x300000` placed textures that TuxBox backs with a reserved image (`placement/residency.rs`). Runs 2109 and 2119 showed the same use-after-free, but had no drop log. In 2241, by the time of the read a new 64 KiB `VkDeviceMemory` had been bound at the destroyed image's VA. Run 2329, on `40a69c3f` (with #389) plus the clamp, ended the same way. Ten 1024×1024 textures of that size were released together there, so I can't say which one it was. The out-of-bounds reads past 64 KiB buffers that I saw before #389 didn't happen in that run (one run only). ### What I ruled out - **GPU work in flight when the texture was dropped.** I kept a dropped texture's image and residency backing alive until every queue in `queue_trace::pending_fences()` passed the value it had at the drop, released by a worker thread. The fault still came, 2.3 to 2.6 s after that delayed release (2155, 2329). So the read comes from work submitted after the drop, or from a queue that isn't tracked there. - **The 3 s `RETIRE_GRACE` on replaced descriptors** (`placement/descriptors.rs`). With 60 s instead, the image was still destroyed and read 2.2 s later (2119). - **Descriptors TuxBox tracks.** With `TUXBOX_TRACE_RASTER_INPUTS=1`, I looked up which slots in `diagnostics::display`'s view registry still named the image at drop time. For the faulting textures in 2143 and 2303, **none did**. Nulling every slot that did name a dropped image (2303), and nulling evicted visible slots (below), did not stop the fault. ### Something that looks wrong, but isn't proven to be this fault `descriptor_paging`'s `release_slots` → `clear_host_tracking` clears the tracking of an evicted table's visible slots. That releases their `DescriptorBacking::Placed` after `RETIRE_GRACE`. It leaves the native descriptors in the visible heap until the slots are reused. In three runs, 2.1–2.5% of dropped placed textures still had registry slots naming them at drop time: - in the history ring - in the staging heap - in the visible heap In run 2251 that was 147 of 6957 drops, with 129 slots in the history ring, 122 in staging and 88 in the visible heap. Writing null SRVs into evicted slots (local experiment) didn't stop the faults: runs 2241, 2303 and 2329 had it on. ### Open question What still names a placed texture's image after the last `Arc<Texture>` is gone, without being one of the descriptor slots above? Possible places I haven't been able to check: - the index map; - descriptor bytes the title writes directly; - an alias that shares the image. I tried vkd3d-proton's descriptor QA (`-Denable_descriptor_qa=true`, `VKD3D_CONFIG=descriptor_qa_checks`). It needed a local fix in vkd3d-proton to start at all: a CPU sampler heap carries an invalid QA heap-info pointer. Its instrumented shaders then miss the driver cache, so I stopped before reaching the cutscene. Logs and the local diagnostic commits are available if useful.
brcly commented 2026-11-30 23:18:32 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T23:18:32Z.


@Kayotic1337 thanks, this is a careful trace. One change on main since your runs affects how this fault shows up.

34be158b (after 40a69c3f) added a tile pool, on by default. A placed texture under 2 MiB no longer gets an ID3D12Heap of its own: its reserved image maps 64 KiB tiles from shared 32 MiB heaps (placement/tile_pool.rs). When the texture drops, its tiles go back to the pool once the last Held copy is gone, and the next small texture can be given them.

So on main, a read after the image is destroyed may no longer fault where it did for you. If the stale read goes through a view of the destroyed image, it should still fault, because the VkImage and its sparse binding are gone. But if it reaches the memory any other way, it now finds another live texture's data, not an unbound page. That would show as wrong texels instead of a GPUVM fault, so the pool could hide this bug, not fix it.

If you rerun on current main, could you do one run with TUXBOX_TILE_POOL=0 (one heap per texture, as before) next to one with the default? If the fault goes away only with the pool on, that points to the second case. Your drop log with QPC times would still name the texture either way.

We haven't reproduced this on NVIDIA (RTX 4070); our losses there are the Xid 13 in #232.

<!-- greyfinch-sync:brcly/TuxBox:comment:7294963469 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7294963469). Originally posted by [brcly](https://github.com/brcly) on 2026-11-30T23:18:32Z. --- @Kayotic1337 thanks, this is a careful trace. One change on main since your runs affects how this fault shows up. 34be158b (after `40a69c3f`) added a tile pool, on by default. A placed texture under 2 MiB no longer gets an `ID3D12Heap` of its own: its reserved image maps 64 KiB tiles from shared 32 MiB heaps (`placement/tile_pool.rs`). When the texture drops, its tiles go back to the pool once the last `Held` copy is gone, and the next small texture can be given them. So on main, a read after the image is destroyed may no longer fault where it did for you. If the stale read goes through a view of the destroyed image, it should still fault, because the `VkImage` and its sparse binding are gone. But if it reaches the memory any other way, it now finds another live texture's data, not an unbound page. That would show as wrong texels instead of a GPUVM fault, so the pool could hide this bug, not fix it. If you rerun on current main, could you do one run with `TUXBOX_TILE_POOL=0` (one heap per texture, as before) next to one with the default? If the fault goes away only with the pool on, that points to the second case. Your drop log with QPC times would still name the texture either way. We haven't reproduced this on NVIDIA (RTX 4070); our losses there are the Xid 13 in #232.
NickStallman commented 2026-11-30 23:19:29 +00:00 (Migrated from github.com)
Author
Contributor

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


@Kayotic1337 thank you, this is the clearest trace of it so far. NVIDIA data points from an RTX 5090 (620.70.10, GE-Proton11-14 with a trace-built vkd3d-proton of the same commit), three losses of this shape, all before our newest main:

Run Fault address vkd3d's range Last UNBIND before the loss
83a 0xdcf6068000 a freed VkImage 846 s
86a 0xdb21d75000 a freed VkImage (22 tiles) 288 s
91c 0xdae994a000 a freed VkImage, 0xb0000 long 228 s
  • All three are in the last 64 KiB tile of the freed image. Your table's sizes (0xb0000, 0x30000) look the same; do yours fall in the last tile too? It would say the read is an address in a mip tail or an edge tile rather than anywhere in the image.
  • Different from yours: the gap is minutes rather than seconds, and 91c was lost with #572's null view on and seven raw-index pixel programs left out.
  • #567 (a shadow of the host descriptors TuxBox writes) named 0 ended images at 86a's loss (83a ran before it). In two later losses it named 2 and 1, whose ranges did not match the fault. In 91b/91c those were "Resident evicted" slots, like your evicted visible slots (129/122/88 in 2251), so I think we're looking at the same residue from two sides.
  • The padding and the clamp: 184 world minutes without either kind of loss on our card (5 runs), but your 13 with the clamp all ended this way, so it doesn't cure it, and on our card I can't separate "fewer losses" from "a different card".
  • brcly's note about the tile pool (34be158b) is fair: we'll run our next build with and without TUXBOX_TILE_POOL=0 and report, and I'd like to run your drop log if you can share the commit.
<!-- greyfinch-sync:brcly/TuxBox:comment:7294982033 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7294982033). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T23:19:29Z. --- @Kayotic1337 thank you, this is the clearest trace of it so far. NVIDIA data points from an RTX 5090 (620.70.10, GE-Proton11-14 with a trace-built vkd3d-proton of the same commit), three losses of this shape, all before our newest main: | Run | Fault address | vkd3d's range | Last `UNBIND` before the loss | |---|---|---|---| | 83a | 0xdcf6068000 | a freed `VkImage` | 846 s | | 86a | 0xdb21d75000 | a freed `VkImage` (22 tiles) | 288 s | | 91c | 0xdae994a000 | a freed `VkImage`, 0xb0000 long | 228 s | - **All three are in the last 64 KiB tile of the freed image.** Your table's sizes (0xb0000, 0x30000) look the same; do yours fall in the last tile too? It would say the read is an address in a mip tail or an edge tile rather than anywhere in the image. - Different from yours: the gap is minutes rather than seconds, and 91c was lost with #572's null view on and seven raw-index pixel programs left out. - `#567` (a shadow of the host descriptors TuxBox writes) named 0 ended images at 86a's loss (83a ran before it). In two later losses it named 2 and 1, whose ranges did not match the fault. In 91b/91c those were "Resident evicted" slots, like your evicted visible slots (129/122/88 in 2251), so I think we're looking at the same residue from two sides. - The padding and the clamp: 184 world minutes without either kind of loss on our card (5 runs), but your 13 with the clamp all ended this way, so it doesn't cure it, and on our card I can't separate "fewer losses" from "a different card". - brcly's note about the tile pool (34be158b) is fair: we'll run our next build with and without `TUXBOX_TILE_POOL=0` and report, and I'd like to run your drop log if you can share the commit.
Kayotic1337 commented 2026-11-30 23:24:46 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by Kayotic1337 on 2026-11-30T23:24:46Z.


@NickStallman @brcly thanks.

Last tile: not on this card. Here is where each fault fell in the freed image, counting 64 KiB tiles from the image's start in vkd3d's tracker:

Run Image Fault offset Tile
2109 0x10000 0x4000 1 of 1
2119 0x10000 0x1000 1 of 1
2155 0x10000 0x1000 1 of 1
2241 0x10000 0x0 1 of 1
2129 0xb0000 0xa2000 11 of 11 (last)
2143 0x30000 0x0 1 of 3
2303 0x240000 0x192000 26 of 36
2329 0x160000 0x4000 1 of 22

Four images were a single tile, so those say nothing about edges. Of the four with more than one tile, one fault was in the last tile and three weren't. So here the read isn't limited to a mip tail or edge tile. 2329's image is 22 tiles, like your 86a.

Drop log: it's one commit on current main, diag/placed-texture-drop-log (b997abbf). With TUXBOX_LOG_TEXTURE_DROPS=1 and TUXBOX_LOG=1, Texture::drop logs placed texture dropped at <QPC s>: address … size … WxHxD format … mips … flags …. The time is on the clock vkd3d's tracker prints, so the drop right before a faulting image's UNBIND names the texture. It logs every drop, 7,000–16,000 per run here.

Tile pool: I'll do the two runs on current main as brcly suggested: TUXBOX_TILE_POOL=0 and the default, both with VKD3D_CONFIG=fault and the drop log. I'll post both.

<!-- greyfinch-sync:brcly/TuxBox:comment:7295086677 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7295086677). Originally posted by [Kayotic1337](https://github.com/Kayotic1337) on 2026-11-30T23:24:46Z. --- @NickStallman @brcly thanks. **Last tile:** not on this card. Here is where each fault fell in the freed image, counting 64 KiB tiles from the image's start in vkd3d's tracker: | Run | Image | Fault offset | Tile | | --- | ---: | ---: | --- | | 2109 | 0x10000 | 0x4000 | 1 of 1 | | 2119 | 0x10000 | 0x1000 | 1 of 1 | | 2155 | 0x10000 | 0x1000 | 1 of 1 | | 2241 | 0x10000 | 0x0 | 1 of 1 | | 2129 | 0xb0000 | 0xa2000 | 11 of 11 (last) | | 2143 | 0x30000 | 0x0 | 1 of 3 | | 2303 | 0x240000 | 0x192000 | 26 of 36 | | 2329 | 0x160000 | 0x4000 | 1 of 22 | Four images were a single tile, so those say nothing about edges. Of the four with more than one tile, one fault was in the last tile and three weren't. So here the read isn't limited to a mip tail or edge tile. 2329's image is 22 tiles, like your 86a. **Drop log:** it's one commit on current main, [`diag/placed-texture-drop-log`](https://github.com/Kayotic1337/TuxBox/tree/diag/placed-texture-drop-log) (b997abbf). With `TUXBOX_LOG_TEXTURE_DROPS=1` and `TUXBOX_LOG=1`, `Texture::drop` logs `placed texture dropped at <QPC s>: address … size … WxHxD format … mips … flags …`. The time is on the clock vkd3d's tracker prints, so the drop right before a faulting image's `UNBIND` names the texture. It logs every drop, 7,000–16,000 per run here. **Tile pool:** I'll do the two runs on current main as brcly suggested: `TUXBOX_TILE_POOL=0` and the default, both with `VKD3D_CONFIG=fault` and the drop log. I'll post both.
Kayotic1337 commented 2026-11-30 23:54:55 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by Kayotic1337 on 2026-11-30T23:54:55Z.


@brcly @NickStallman the two runs, on main 2104bfcf plus the drop log (b997abbf) and the clamp, VKD3D_CONFIG=fault, otherwise the same settings as before. One run each.

TUXBOX_TILE_POOL=0 Default (pool on)
Length 465 s 445 s
GPUVM fault none (no vkd3d fault report, no DEVICE_LOST, nothing in the kernel log) TCP read, 0x0050113B
How it ended access violation in the game on the CPU (game_scarlett_master.exe +0x4DA6315, +0x794894) gfx ring reset, DEVICE_LOST
Placed textures dropped 29,864 23,861

With the pool on, the fault is the same use-after-free, and the drop log names the texture again:

  • 0xdfbf68000, 512×256, BC1, 7 mips, dropped at 25038.608661 s;
  • vkd3d's UNBIND of that sparse image followed at 25038.608671 s, and the tracker names it as 512×256, 7 levels, BC1;
  • the fault was reported at 25041.587 s, about 3 s later, at offset 0x2000: tile 1 of the image's 2.

So with the pool on, the stale read still goes through a view of the destroyed image and still faults, as you expected.

With the pool off I can't draw a conclusion from one run. It didn't fault on the GPU, but it ended on a CPU access violation in the title. That may simply have come before the use-after-free could happen. I can repeat both if that helps.

<!-- greyfinch-sync:brcly/TuxBox:comment:7295675324 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7295675324). Originally posted by [Kayotic1337](https://github.com/Kayotic1337) on 2026-11-30T23:54:55Z. --- @brcly @NickStallman the two runs, on main `2104bfcf` plus the drop log (`b997abbf`) and the clamp, `VKD3D_CONFIG=fault`, otherwise the same settings as before. One run each. | | `TUXBOX_TILE_POOL=0` | Default (pool on) | | --- | --- | --- | | Length | 465 s | 445 s | | GPUVM fault | none (no vkd3d fault report, no `DEVICE_LOST`, nothing in the kernel log) | TCP read, `0x0050113B` | | How it ended | access violation in the game on the CPU (`game_scarlett_master.exe` +0x4DA6315, +0x794894) | gfx ring reset, `DEVICE_LOST` | | Placed textures dropped | 29,864 | 23,861 | With the pool on, the fault is the same use-after-free, and the drop log names the texture again: - `0xdfbf68000`, 512×256, BC1, 7 mips, dropped at 25038.608661 s; - vkd3d's `UNBIND` of that sparse image followed at 25038.608671 s, and the tracker names it as 512×256, 7 levels, BC1; - the fault was reported at 25041.587 s, about 3 s later, at offset 0x2000: tile 1 of the image's 2. So with the pool on, the stale read still goes through a view of the destroyed image and still faults, as you expected. With the pool off I can't draw a conclusion from one run. It didn't fault on the GPU, but it ended on a CPU access violation in the title. That may simply have come before the use-after-free could happen. I can repeat both if that helps.
NickStallman commented 2026-12-01 01:50:10 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-01T01:50:10Z.


@Kayotic1337 a possible pointer for your pool-off run, not a finding: its CPU access violation is at +0x4DA6315, the same offset @DrArroway gives in #608 (opened today, 0x80000003 at +0x4DA6315 / +0x9DFC18, streaming placement under TUXBOX_XMEM_PRIVATE_VIEWS=1). Your second frame differs (+0x794894) and so does the exception, so it may be unrelated. If that run had private views on, #608 might change how it ends. Our own pool-on and pool-off pair on the 5090 (default views, no private views) is running now; I'll post both.

<!-- greyfinch-sync:brcly/TuxBox:comment:7297947921 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7297947921). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-01T01:50:10Z. --- @Kayotic1337 a possible pointer for your pool-off run, not a finding: its CPU access violation is at `+0x4DA6315`, the same offset @DrArroway gives in #608 (opened today, `0x80000003` at `+0x4DA6315` / `+0x9DFC18`, streaming placement under `TUXBOX_XMEM_PRIVATE_VIEWS=1`). Your second frame differs (`+0x794894`) and so does the exception, so it may be unrelated. If that run had private views on, #608 might change how it ends. Our own pool-on and pool-off pair on the 5090 (default views, no private views) is running now; I'll post both.
NickStallman commented 2026-12-01 01:57:24 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-01T01:57:24Z.


The pair on an RTX 5090 (620.70.10, GE-Proton11-15 and its own vkd3d-proton), one run of each, 20 minutes, main 82109205 in an integration build with the clamp, #572 with its stride fix and your drop log (b997abbf), thanks. The only difference is TUXBOX_TILE_POOL (0 confirmed in the run manifest of the second).

Default (pool on) TUXBOX_TILE_POOL=0
GPU loss / Xid none none
Placed textures dropped 50,597 53,397
Memory ledger at the end card 14,010 MiB, textures 6,601 MiB card 13,989 MiB, textures 6,596 MiB
Frames in the slow phase 648, 1.71 s each (placement 1.10 s) 454, 2.44 s each (placement 0.92 s)
  • This doesn't reproduce your fault on NVIDIA, and one clean run of each can't say whether the pool hides it. We have had no GPU loss of any kind in the last several 5090 runs, with the clamp on.
  • Memory: no difference I can see in the ledgers. The 1.0–1.25 GiB brcly mentions isn't visible in this pair's "card" figures (14.0 GiB both), though that counter may not be the one it changes.
  • Frame times are not evidence about the pool. Single runs of this build vary by up to about a second a frame in our repeats (2.64, 1.59 and 2.03 s for the same settings).
  • The CPU access violation you saw with the pool off didn't occur here (views are default, no TUXBOX_XMEM_PRIVATE_VIEWS).
<!-- greyfinch-sync:brcly/TuxBox:comment:7298077793 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7298077793). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-01T01:57:24Z. --- The pair on an RTX 5090 (620.70.10, GE-Proton11-15 and its own vkd3d-proton), one run of each, 20 minutes, main 82109205 in an integration build with the clamp, #572 with its stride fix and your drop log (b997abbf), thanks. The only difference is `TUXBOX_TILE_POOL` (0 confirmed in the run manifest of the second). | | Default (pool on) | `TUXBOX_TILE_POOL=0` | | --- | --- | --- | | GPU loss / Xid | none | none | | Placed textures dropped | 50,597 | 53,397 | | Memory ledger at the end | card 14,010 MiB, textures 6,601 MiB | card 13,989 MiB, textures 6,596 MiB | | Frames in the slow phase | 648, 1.71 s each (placement 1.10 s) | 454, 2.44 s each (placement 0.92 s) | - **This doesn't reproduce your fault on NVIDIA,** and one clean run of each can't say whether the pool hides it. We have had no GPU loss of any kind in the last several 5090 runs, with the clamp on. - **Memory:** no difference I can see in the ledgers. The 1.0–1.25 GiB brcly mentions isn't visible in this pair's "card" figures (14.0 GiB both), though that counter may not be the one it changes. - **Frame times are not evidence about the pool.** Single runs of this build vary by up to about a second a frame in our repeats (2.64, 1.59 and 2.03 s for the same settings). - The CPU access violation you saw with the pool off didn't occur here (views are default, no `TUXBOX_XMEM_PRIVATE_VIEWS`).
1093i3511 commented 2026-12-01 05:35:36 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-12-01T05:35:36Z.


The same fault on RDNA2, from one run last night with RADV_DEBUG=hang. RADV's hang report also names the pipeline that read the destroyed image.

Setup: RX 6600 (1002:73ff, 8 GB, RDNA2), Mesa 26.3.1 RADV, GE-Proton11-15, main ee38dcf0, Series S profile, TUXBOX_XMEM_PRIVATE_VIEWS=1. That build is before #389 and before the tile pool (34be158b). With RADV_DEBUG=hang (it includes syncshaders), the run still reached the world: mission at frame 1,191, device lost at frame 1,199, 756 s.

Fault (vm_fault.log): page 0x800299c41000, GCVM_L2_PROTECTION_FAULT_STATUS 0x701031, TCP, PERMISSION_FAULTS 3, MAPPING_ERROR 0, RW 0. RADV's address binding check reports "Potential use-after-free". The range had these events:

Time (s) Event VA range
20501.968 bind 0x800299c40000–0x800299c70000 (sparse VkImage, 0x30000)
20623.573 bind, first 64 KiB only 0x800299c40000–0x800299c50000
20949.371 unbind (image destroyed) 0x800299c40000–0x800299c70000
≈20950.8 fault (the last event in the report is at 20950.804 s) page at offset 0x1000
  • The fault is in tile 1 of 3, at offset 0x1000. The image is 0x30000, the same size as your run 2143 (512×512 BC1, 8 mips).
  • The fault came about 1.4 s after the unbind.
  • In the second row, 26 images (this one included) were bound again at the same moment, each to its first 64 KiB only. That looks like a residency step that keeps only the small mips. The faulting page is inside the tile that was kept.

Pipeline: a graphics pipeline, vkd3d hash bb6974b27dcaa748, NGG vertex stage and a pixel stage. The dumped SPIR-V names its DXIL as c9595851250afba4.dxil (vertex) and c38906d24755082e.dxil (pixel). Matched against the runtime cache by vkd3d-proton's hash of the .cso files, these are VS 281b4977 and PS 96e8aaaa. That is the distant-lights pair that @3kynox, @TheLore64 and @DrArroway saw in their losses (#533, #232). So at least one "distant-lights" loss is this use-after-free: the draw reads a placed texture whose sparse image TuxBox had destroyed. It was not an out-of-bounds read past a root descriptor.

For anyone without a trace build of vkd3d-proton: RADV_DEBUG=hang gives the binding history and the faulting pipeline's SPIR-V on a stock Proton build. The dump goes to ~/radv_dumps_*. It slows every frame, but on this card it still reached the world.

Next on this card: current main (717a74c4, with #389 and the tile pool), Series S. If it faults again, I'll do a TUXBOX_TILE_POOL=0 pair as brcly asked, and repeat RADV_DEBUG=hang on the faulting setting. I can share the SPIR-V of both stages and the hang report (about 40 MB) if they help.

<!-- greyfinch-sync:brcly/TuxBox:comment:7301931791 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7301931791). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-12-01T05:35:36Z. --- The same fault on RDNA2, from one run last night with `RADV_DEBUG=hang`. RADV's hang report also names the pipeline that read the destroyed image. **Setup:** RX 6600 (`1002:73ff`, 8 GB, RDNA2), Mesa 26.3.1 RADV, GE-Proton11-15, main `ee38dcf0`, Series S profile, `TUXBOX_XMEM_PRIVATE_VIEWS=1`. That build is before #389 and before the tile pool (34be158b). With `RADV_DEBUG=hang` (it includes `syncshaders`), the run still reached the world: mission at frame 1,191, device lost at frame 1,199, 756 s. **Fault** (`vm_fault.log`): page `0x800299c41000`, `GCVM_L2_PROTECTION_FAULT_STATUS 0x701031`, TCP, `PERMISSION_FAULTS 3`, `MAPPING_ERROR 0`, `RW 0`. RADV's address binding check reports "Potential use-after-free". The range had these events: | Time (s) | Event | VA range | | --- | --- | --- | | 20501.968 | bind | `0x800299c40000`–`0x800299c70000` (sparse `VkImage`, 0x30000) | | 20623.573 | bind, first 64 KiB only | `0x800299c40000`–`0x800299c50000` | | 20949.371 | unbind (image destroyed) | `0x800299c40000`–`0x800299c70000` | | ≈20950.8 | fault (the last event in the report is at 20950.804 s) | page at offset 0x1000 | - The fault is in tile 1 of 3, at offset 0x1000. The image is 0x30000, the same size as your run 2143 (512×512 BC1, 8 mips). - The fault came about 1.4 s after the unbind. - In the second row, 26 images (this one included) were bound again at the same moment, each to its first 64 KiB only. That looks like a residency step that keeps only the small mips. The faulting page is inside the tile that was kept. **Pipeline:** a graphics pipeline, vkd3d hash `bb6974b27dcaa748`, NGG vertex stage and a pixel stage. The dumped SPIR-V names its DXIL as `c9595851250afba4.dxil` (vertex) and `c38906d24755082e.dxil` (pixel). Matched against the runtime cache by vkd3d-proton's hash of the `.cso` files, these are **`VS 281b4977` and `PS 96e8aaaa`**. That is the distant-lights pair that @3kynox, @TheLore64 and @DrArroway saw in their losses (#533, #232). So at least one "distant-lights" loss is this use-after-free: the draw reads a placed texture whose sparse image TuxBox had destroyed. It was not an out-of-bounds read past a root descriptor. For anyone without a trace build of vkd3d-proton: `RADV_DEBUG=hang` gives the binding history and the faulting pipeline's SPIR-V on a stock Proton build. The dump goes to `~/radv_dumps_*`. It slows every frame, but on this card it still reached the world. **Next on this card:** current main (717a74c4, with #389 and the tile pool), Series S. If it faults again, I'll do a `TUXBOX_TILE_POOL=0` pair as brcly asked, and repeat `RADV_DEBUG=hang` on the faulting setting. I can share the SPIR-V of both stages and the hang report (about 40 MB) if they help.
1093i3511 commented 2026-12-01 07:19:43 +00:00 (Migrated from github.com)
Author
Contributor

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


A first data point from current main on the RX 6600 (1002:73ff, RDNA2, Mesa 26.3.1, GE-Proton11-15, Series S), main 717a74c4, so with the tile pool on and #389 in. One run with default settings.

  • At about 600 s (most likely in the world), the game's vkd3d_queue faulted on two adjacent host pages, 0x800602d14000 (6 reports) and 0x800602d15000 (4). TCP read, GCVM_L2_PROTECTION_FAULT_STATUS 0x00501031, PERMISSION_FAULTS 3. That's the same shape as the fault I posted above from ee38dcf0, there at offset 0x1000 of a destroyed 0x30000 image. This run had no RADV_DEBUG=hang, so I can't show the binding history for it yet.
  • After it the compositor's ring timed out. The ring reset failed, the kernel did a MODE1 reset and the desktop went down. With pool on, this card still faults.
  • A run with TUXBOX_XMEM_PRIVATE_VIEWS=1 on the same build had no GPU fault (one run).
<!-- greyfinch-sync:brcly/TuxBox:comment:7303923834 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7303923834). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-12-01T07:19:43Z. --- A first data point from current main on the RX 6600 (`1002:73ff`, RDNA2, Mesa 26.3.1, GE-Proton11-15, Series S), main `717a74c4`, so with the tile pool on and #389 in. One run with default settings. - At about 600 s (most likely in the world), the game's `vkd3d_queue` faulted on two adjacent host pages, `0x800602d14000` (6 reports) and `0x800602d15000` (4). TCP read, `GCVM_L2_PROTECTION_FAULT_STATUS 0x00501031`, `PERMISSION_FAULTS 3`. That's the same shape as the fault I posted above from `ee38dcf0`, there at offset 0x1000 of a destroyed 0x30000 image. This run had no `RADV_DEBUG=hang`, so I can't show the binding history for it yet. - After it the compositor's ring timed out. The ring reset failed, the kernel did a MODE1 reset and the desktop went down. With pool on, this card still faults. - A run with `TUXBOX_XMEM_PRIVATE_VIEWS=1` on the same build had no GPU fault (one run).
brcly commented 2026-12-01 15:14:24 +00:00 (Migrated from github.com)
Author
Contributor

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


@1093i3511 @Kayotic1337 thanks for the RDNA2 data, and for the RADV binding history: a read of an image TuxBox already destroyed, on RDNA2 as on RDNA4.

Today's main changes when placed textures get memory, so it's worth a run on it before going further (after e40d8052, default settings):

  • read residency is now on by default: a bindless batch backs only the textures its programs read in the last 120 frames, instead of every texture with a view in the heap;
  • lazy publication now also covers bound render targets;
  • index map lookups past the map now read slot 0 instead of past the buffer (56627188).

None of these is aimed at a use after destroy, and I don't expect them to fix it. But they change the backing and timing enough that the fault may move, or show more clearly. If it still reproduces, the run with RADV_DEBUG=hang and its binding history would be the one to post.

<!-- greyfinch-sync:brcly/TuxBox:comment:7315578366 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7315578366). Originally posted by [brcly](https://github.com/brcly) on 2026-12-01T15:14:24Z. --- @1093i3511 @Kayotic1337 thanks for the RDNA2 data, and for the RADV binding history: a read of an image TuxBox already destroyed, on RDNA2 as on RDNA4. Today's main changes when placed textures get memory, so it's worth a run on it before going further (after e40d8052, default settings): - read residency is now on by default: a bindless batch backs only the textures its programs read in the last 120 frames, instead of every texture with a view in the heap; - lazy publication now also covers bound render targets; - index map lookups past the map now read slot 0 instead of past the buffer (56627188). None of these is aimed at a use after destroy, and I don't expect them to fix it. But they change the backing and timing enough that the fault may move, or show more clearly. If it still reproduces, the run with `RADV_DEBUG=hang` and its binding history would be the one to post.
Kayotic1337 commented 2026-12-01 20:19:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by Kayotic1337 on 2026-12-01T20:19:29Z.


@brcly two runs on current main after e40d8052, RX 9070 XT (1002:7550), Mesa 26.3.1 RADV, GE-Proton11-15 with its own vkd3d-proton. The use-after-free is still there in the normal run; the second run, with RADV_DEBUG=hang, didn't fault.

Build: main 712fb960 + #630, plus the drop log (b997abbf). Settings: defaults, tile pool on, VKD3D_CONFIG=fault, with one exception. With the full defaults, all three runs I made with #630 stopped at the first indirect dispatch with the CS rejection from #634 (details there), before the world. Both runs below have TUXBOX_LAZY_PUBLICATION=0; read residency and check-once-per-frame stay on.

Run 1: defaults

Result: 807 s, then a GPUVM fault and device lost. TCP read, GCVM_L2_PROTECTION_FAULT_STATUS 0x0070113B, PERMISSION_FAULTS 3, at 0x800366722000.

vkd3d's address history for that page, with the drop log:

Time (s) Event
6628.725 sparse VkImage reserved, 0x70000
6631.315 its first 64 KiB tile bound: 512x1024, 8 levels, VK format 133 (BC1)
6726.490973 drop log: placed texture 0x99784c000 512x1024 BC1 (DXGI 71), 8 mips, size 0x57000
6726.490985 that image unbound and destroyed (12 µs after the drop)
6729.841 a new sparse image, 0x30000, reserved at the same VA (no tile bound to it yet)
6731.840 fault at offset 0x2000, in tile 0 of 7
  • The read came 5.35 s after the image was destroyed. vkd3d says "currently mapped" only because of the new reservation 2 s before the fault.
  • That drop was part of a burst: 233 placed textures were dropped between 6726.48 and 6726.51 s, 21 of them 512x1024. Several have the same size and format, so the match rests on timing: the drop logged 12 µs before the unbind, the same gap as in the earlier runs.
  • Caveat: I can't rule out that the new image, which had no tile bound yet, was read rather than the destroyed one. This run didn't have RADV_DEBUG=hang, so I can't name the pipeline.

Run 2: same, plus RADV_DEBUG=hang

Same build and settings, plus RADV_DEBUG=hang (with a separate Mesa cache dir). No fault in 2,577 s (43 min): nothing in the kernel log, no vkd3d fault report, no device lost, no RADV dump. I stopped it myself. 75,823 placed texture drops were logged, against 22,250 before run 1's fault. It also got the furthest of any run here: into the playable prison section, where an NPC could be interacted with, though most near surfaces drew black or as noise.

RADV_DEBUG=hang turns on syncshaders (Mesa's hang-debugging notes), which waits for the GPU after every draw and dispatch. A read that races the image's destruction may simply not happen with it on, so I read this run as consistent with a timing race. It doesn't show that the bug is gone, and it couldn't name the pipeline this time.

Memory

From TuxBox's memory ledger, with times taken from the 10 s present lines (RX 9070 XT with 16 GB; host with 64 GB RAM):

3 min 6 min 9 min 12 min last sample
Run 1: process commit 5.3 GiB 5.6 GiB 11.6 GiB 12.1 GiB 12.2 GiB (13.2 min)
Run 1: card (game) 1,231 MiB 1,383 MiB 6,936 MiB 9,509 MiB 9,674 MiB
Run 2 (RADV_DEBUG=hang): process commit 10.4 GiB 16.3 GiB 25.5 GiB 27.0 GiB 30.2 GiB (42.9 min)
Run 2: card (game) 1,223 MiB 1,351 MiB 6,091 MiB 9,288 MiB 12,030 MiB
  • Host RAM, run 2: sampled over its last 10 minutes, the game's resident set was about 35,200 MiB, the system used up to 47,764 of 61,918 MiB, and swap reached 903 MiB.
  • Most of that is probably RADV_DEBUG=hang, not TuxBox. Run 2's commit is about three times run 1's at 6 min (16.3 against 5.6 GiB), before the world loads. Without it, run 1 reached 12.2 GiB. I didn't sample the host in run 1.
  • Card: both runs follow the same curve to about 9.5 GB at 12 min. Run 2 then kept rising slowly to 12,030 MiB. The whole card, from amdgpu's sysfs counter over run 2's last 10 minutes, peaked at 13,288 MiB. After the game exited the card held 1,274 MiB, mostly the desktop, which leaves the game's share at the ledger's figure.
  • Textures: placed textures on the card stayed at about 3,000 MiB from 12 min on in run 2, with none in system memory (read residency, default VRAM reserve). So most of the later growth is outside placed textures.
<!-- greyfinch-sync:brcly/TuxBox:comment:7324482976 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7324482976). Originally posted by [Kayotic1337](https://github.com/Kayotic1337) on 2026-12-01T20:19:29Z. --- @brcly two runs on current main after e40d8052, RX 9070 XT (`1002:7550`), Mesa 26.3.1 RADV, GE-Proton11-15 with its own vkd3d-proton. The use-after-free is still there in the normal run; the second run, with `RADV_DEBUG=hang`, didn't fault. **Build:** main `712fb960` + #630, plus the drop log (`b997abbf`). **Settings:** defaults, tile pool on, `VKD3D_CONFIG=fault`, with one exception. With the full defaults, all three runs I made with #630 stopped at the first indirect dispatch with the CS rejection from #634 (details there), before the world. Both runs below have `TUXBOX_LAZY_PUBLICATION=0`; read residency and check-once-per-frame stay on. ### Run 1: defaults **Result:** 807 s, then a GPUVM fault and device lost. TCP read, `GCVM_L2_PROTECTION_FAULT_STATUS 0x0070113B`, `PERMISSION_FAULTS 3`, at `0x800366722000`. vkd3d's address history for that page, with the drop log: | Time (s) | Event | | --- | --- | | 6628.725 | sparse `VkImage` reserved, `0x70000` | | 6631.315 | its first 64 KiB tile bound: 512x1024, 8 levels, VK format 133 (BC1) | | 6726.490973 | drop log: placed texture `0x99784c000` 512x1024 BC1 (DXGI 71), 8 mips, size `0x57000` | | 6726.490985 | that image unbound and destroyed (12 µs after the drop) | | 6729.841 | a new sparse image, `0x30000`, reserved at the same VA (no tile bound to it yet) | | 6731.840 | fault at offset `0x2000`, in tile 0 of 7 | - The read came 5.35 s after the image was destroyed. vkd3d says "currently mapped" only because of the new reservation 2 s before the fault. - That drop was part of a burst: 233 placed textures were dropped between 6726.48 and 6726.51 s, 21 of them 512x1024. Several have the same size and format, so the match rests on timing: the drop logged 12 µs before the unbind, the same gap as in the earlier runs. - **Caveat:** I can't rule out that the new image, which had no tile bound yet, was read rather than the destroyed one. This run didn't have `RADV_DEBUG=hang`, so I can't name the pipeline. ### Run 2: same, plus `RADV_DEBUG=hang` Same build and settings, plus `RADV_DEBUG=hang` (with a separate Mesa cache dir). **No fault in 2,577 s (43 min):** nothing in the kernel log, no vkd3d fault report, no device lost, no RADV dump. I stopped it myself. 75,823 placed texture drops were logged, against 22,250 before run 1's fault. It also got the furthest of any run here: into the playable prison section, where an NPC could be interacted with, though most near surfaces drew black or as noise. `RADV_DEBUG=hang` turns on `syncshaders` ([Mesa's hang-debugging notes](https://docs.mesa3d.org/drivers/amd/hang-debugging.html)), which waits for the GPU after every draw and dispatch. A read that races the image's destruction may simply not happen with it on, so I read this run as consistent with a timing race. It doesn't show that the bug is gone, and it couldn't name the pipeline this time. ### Memory From TuxBox's memory ledger, with times taken from the 10 s present lines (RX 9070 XT with 16 GB; host with 64 GB RAM): | | 3 min | 6 min | 9 min | 12 min | last sample | | --- | --- | --- | --- | --- | --- | | Run 1: process commit | 5.3 GiB | 5.6 GiB | 11.6 GiB | 12.1 GiB | 12.2 GiB (13.2 min) | | Run 1: card (game) | 1,231 MiB | 1,383 MiB | 6,936 MiB | 9,509 MiB | 9,674 MiB | | Run 2 (`RADV_DEBUG=hang`): process commit | 10.4 GiB | 16.3 GiB | 25.5 GiB | 27.0 GiB | 30.2 GiB (42.9 min) | | Run 2: card (game) | 1,223 MiB | 1,351 MiB | 6,091 MiB | 9,288 MiB | 12,030 MiB | - **Host RAM, run 2:** sampled over its last 10 minutes, the game's resident set was about 35,200 MiB, the system used up to 47,764 of 61,918 MiB, and swap reached 903 MiB. - **Most of that is probably `RADV_DEBUG=hang`, not TuxBox.** Run 2's commit is about three times run 1's at 6 min (16.3 against 5.6 GiB), before the world loads. Without it, run 1 reached 12.2 GiB. I didn't sample the host in run 1. - **Card:** both runs follow the same curve to about 9.5 GB at 12 min. Run 2 then kept rising slowly to 12,030 MiB. The whole card, from amdgpu's sysfs counter over run 2's last 10 minutes, peaked at 13,288 MiB. After the game exited the card held 1,274 MiB, mostly the desktop, which leaves the game's share at the ledger's figure. - **Textures:** placed textures on the card stayed at about 3,000 MiB from 12 min on in run 2, with none in system memory (read residency, default VRAM reserve). So most of the later growth is outside placed textures.
1093i3511 commented 2026-12-01 20:54:32 +00:00 (Migrated from github.com)
Author
Contributor

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


RX 6600 (1002:73ff, RDNA2, 8 GB), Mesa 26.3.1 RADV, GE-Proton11-15, after e40d8052. Build: fb17e160 with #519 reverted locally (instead of #630, so it gets past the slot 133 assert). All runs with TUXBOX_LAZY_PUBLICATION=0 (#634); the first three also with TUXBOX_READ_RESIDENCY=0.

Run Profile Result
1 Series S TCP read fault at 894 s (intro), page 0x0000800265604000, status 0x00501030/0x00501031; gfx ring timeout, reset failed, MODE1
2 packaged world (mission frame 1328), TCP read fault at 430 s, page 0x00008003cc662000, status 0x00501030/0x00501031; ring reset succeeded
3 Series S TCP read fault at 494 s (intro), page 0x000080021cc04000, status 0x00501030; reset failed, MODE1
4 Series S, TUXBOX_RUNTIME_SHADER_JOBS=3 TUXBOX_LARGE_COMPILES=2, read residency still off world (mission frame 949 to 1046), no fault; the title aborted after 786 s with card memory at 7,337 of 7,497 MiB

All three faults are PERMISSION_FAULTS 0x3, client TCP, a read, from the vkd3d_queue thread: the same family as my dump earlier on this issue. So on this card the fault hasn't moved with today's main. Two of the three failed ring resets took the desktop with them, which is why there is no RADV_DEBUG=hang repeat yet; I have the kernel devcoredumps of runs 1 and 3 if they help.

Run 4 is one fault-free run, not a pattern. It had fewer compiles running beside the game; Kayotic1337's RADV_DEBUG=hang run, which serialises GPU work, didn't fault either. So timing may matter.

<!-- greyfinch-sync:brcly/TuxBox:comment:7325455021 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7325455021). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-12-01T20:54:32Z. --- RX 6600 (`1002:73ff`, RDNA2, 8 GB), Mesa 26.3.1 RADV, GE-Proton11-15, after e40d8052. Build: fb17e160 with #519 reverted locally (instead of #630, so it gets past the slot 133 assert). All runs with `TUXBOX_LAZY_PUBLICATION=0` (#634); the first three also with `TUXBOX_READ_RESIDENCY=0`. | Run | Profile | Result | | --- | --- | --- | | 1 | Series S | TCP read fault at 894 s (intro), page `0x0000800265604000`, status `0x00501030`/`0x00501031`; gfx ring timeout, reset failed, MODE1 | | 2 | packaged | world (mission frame 1328), TCP read fault at 430 s, page `0x00008003cc662000`, status `0x00501030`/`0x00501031`; ring reset succeeded | | 3 | Series S | TCP read fault at 494 s (intro), page `0x000080021cc04000`, status `0x00501030`; reset failed, MODE1 | | 4 | Series S, `TUXBOX_RUNTIME_SHADER_JOBS=3 TUXBOX_LARGE_COMPILES=2`, read residency still off | world (mission frame 949 to 1046), **no fault**; the title aborted after 786 s with card memory at 7,337 of 7,497 MiB | All three faults are `PERMISSION_FAULTS 0x3`, client TCP, a read, from the `vkd3d_queue` thread: the same family as my dump earlier on this issue. So on this card the fault hasn't moved with today's main. Two of the three failed ring resets took the desktop with them, which is why there is no `RADV_DEBUG=hang` repeat yet; I have the kernel devcoredumps of runs 1 and 3 if they help. Run 4 is one fault-free run, not a pattern. It had fewer compiles running beside the game; Kayotic1337's `RADV_DEBUG=hang` run, which serialises GPU work, didn't fault either. So timing may matter.
Kayotic1337 commented 2026-12-01 20:57:41 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by Kayotic1337 on 2026-12-01T20:57:41Z.


One more run on the RX 9070 XT, and a correction to the memory figures in my last comment.

Run 3: same build and settings as run 1 above (main 712fb960 + #630 + drop log, defaults, TUXBOX_LAZY_PUBLICATION=0, VKD3D_CONFIG=fault), no RADV_DEBUG. No fault in 1,521 s (25 min): nothing in the kernel log and no vkd3d fault report. I stopped it myself. 56,565 placed texture drops were logged, against 22,250 before run 1's fault.

On shader compiles during play: run 1 compiled 655 (120–180 a minute from 19:09 to 19:12 UTC, the last ones seconds before the fault at 19:14:22), run 2 compiled 243 and run 3 only 11. That looked like support for @1093i3511's point that timing may matter (their run 4, with TUXBOX_RUNTIME_SHADER_JOBS=3 TUXBOX_LARGE_COMPILES=2, didn't fault). But compile load isn't needed for the fault: my seven use-after-free runs on 30 Nov and 1 Dec (older main, before e40d8052) compiled no shaders during play, and still faulted after 6–8 minutes. So I can't say what made runs 2 and 3 clean. On today's main it's 1 fault in 3 runs here.

Memory, corrected. As I guessed, most of run 2's host memory came from RADV_DEBUG=hang itself. Run 3, sampled every 10 s from the start, in the world (12–25 min):

Average Peak
Game resident set 18,324 MiB 18,921 MiB
System RAM in use 30,258 MiB 30,974 MiB
Whole card (amdgpu sysfs) 11,722 MiB 12,164 MiB
GPU busy 40 % 78 %
Game CPU, share of 16 threads 35 % 39 %
  • Process commit from TuxBox's ledger: 5.3 GiB at 3 min, 11.9 at 9 min, 12.3 at 12 min, 14.4 at 25 min.
  • Card (game) from the same ledger: 1,226 MiB at 3 min, 6,181 at 9, 10,124 at 12, 11,035 at 25.
  • Placed textures on the card peaked at 2,773 MiB, none in system memory.
<!-- greyfinch-sync:brcly/TuxBox:comment:7325533627 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7325533627). Originally posted by [Kayotic1337](https://github.com/Kayotic1337) on 2026-12-01T20:57:41Z. --- One more run on the RX 9070 XT, and a correction to the memory figures in my last comment. **Run 3:** same build and settings as run 1 above (main `712fb960` + #630 + drop log, defaults, `TUXBOX_LAZY_PUBLICATION=0`, `VKD3D_CONFIG=fault`), no `RADV_DEBUG`. **No fault in 1,521 s (25 min):** nothing in the kernel log and no vkd3d fault report. I stopped it myself. 56,565 placed texture drops were logged, against 22,250 before run 1's fault. On shader compiles during play: run 1 compiled 655 (120–180 a minute from 19:09 to 19:12 UTC, the last ones seconds before the fault at 19:14:22), run 2 compiled 243 and run 3 only 11. That looked like support for @1093i3511's point that timing may matter (their run 4, with `TUXBOX_RUNTIME_SHADER_JOBS=3 TUXBOX_LARGE_COMPILES=2`, didn't fault). But compile load isn't needed for the fault: my seven use-after-free runs on 30 Nov and 1 Dec (older main, before e40d8052) compiled no shaders during play, and still faulted after 6–8 minutes. So I can't say what made runs 2 and 3 clean. On today's main it's 1 fault in 3 runs here. **Memory, corrected.** As I guessed, most of run 2's host memory came from `RADV_DEBUG=hang` itself. Run 3, sampled every 10 s from the start, in the world (12–25 min): | | Average | Peak | | --- | --- | --- | | Game resident set | 18,324 MiB | 18,921 MiB | | System RAM in use | 30,258 MiB | 30,974 MiB | | Whole card (amdgpu sysfs) | 11,722 MiB | 12,164 MiB | | GPU busy | 40 % | 78 % | | Game CPU, share of 16 threads | 35 % | 39 % | - Process commit from TuxBox's ledger: 5.3 GiB at 3 min, 11.9 at 9 min, 12.3 at 12 min, 14.4 at 25 min. - Card (game) from the same ledger: 1,226 MiB at 3 min, 6,181 at 9, 10,124 at 12, 11,035 at 25. - Placed textures on the card peaked at 2,773 MiB, none in system memory.
Kayotic1337 commented 2026-12-01 21:34:13 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by Kayotic1337 on 2026-12-01T21:34:13Z.


Opened #639: an optional PR with the drop log I've been using here (TUXBOX_LOG_TEXTURE_DROPS=1; an earlier copy is b997abbf). It logs each released placed texture with its time on vkd3d's clock, so anyone chasing this fault can tie it to a texture the same way. It doesn't change behaviour.

<!-- greyfinch-sync:brcly/TuxBox:comment:7326462122 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7326462122). Originally posted by [Kayotic1337](https://github.com/Kayotic1337) on 2026-12-01T21:34:13Z. --- Opened #639: an optional PR with the drop log I've been using here (`TUXBOX_LOG_TEXTURE_DROPS=1`; an earlier copy is `b997abbf`). It logs each released placed texture with its time on vkd3d's clock, so anyone chasing this fault can tie it to a texture the same way. It doesn't change behaviour.
1093i3511 commented 2026-12-01 21:37:07 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-12-01T21:37:07Z.


Follow-up: a RADV_DEBUG=hang repeat of run 2 (packaged, the one that faulted at 430 s) ran 1,630 s into the world without a fault, like Kayotic1337's hang run on RDNA4. It ended on the title's watchdog after host memory ran out, not on the GPU. One caveat for the comparison: with RADV waiting after every submission, compiles were slow enough that the overlay showed about 730 empty stand-in pipelines (28-31 in the other runs), so less GPU work ran than in run 2.

<!-- greyfinch-sync:brcly/TuxBox:comment:7326532567 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7326532567). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-12-01T21:37:07Z. --- Follow-up: a `RADV_DEBUG=hang` repeat of run 2 (packaged, the one that faulted at 430 s) ran 1,630 s into the world without a fault, like Kayotic1337's hang run on RDNA4. It ended on the title's watchdog after host memory ran out, not on the GPU. One caveat for the comparison: with RADV waiting after every submission, compiles were slow enough that the overlay showed about 730 empty stand-in pipelines (28-31 in the other runs), so less GPU work ran than in run 2.
Kayotic1337 commented 2026-12-01 23:15:32 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by Kayotic1337 on 2026-12-01T23:15:32Z.


@brcly a correction to my comment above, and two more runs that point somewhere else.

Correction: I opened that comment with "the use-after-free is still there". That was stronger than the run showed. Since e40d8052 I haven't seen the shape this issue describes, a read of an address that only a destroyed image had. In all three TCP faults I've had since, the address belonged to a live image that had just been reserved.

The three faults

RX 9070 XT, main after e40d8052, TUXBOX_LAZY_PUBLICATION=0, VKD3D_CONFIG=fault, drop log on. Run 5 is the one above (712fb960 + #630); runs 9 and 10 are on 2a850114 + #639.

One thing first: the time vkd3d prints with the fault is when it noticed the device loss, which here was the gfx ring timeout, about 2 s after the fault. The kernel logs the page fault itself. Its timestamps run on CLOCK_MONOTONIC and vkd3d's on QPC (CLOCK_MONOTONIC_RAW under Wine), about 10 ppm apart on this machine (0.21 s after 5.8 h of uptime). Corrected for that, the ring timeout lands within 3 ms before vkd3d's DEVICE_LOST in runs 9 and 10, so the times below are on vkd3d's clock and good to a few ms.

Run 5 Run 9 Run 10
Earlier owner of the VA 512x1024 BC1 placed texture, destroyed 6726.491 s a buffer heap, freed 19913.303 s 1024x1024 BC1 sRGB placed texture (0xebeff4000, 9 mips), destroyed 20974.382 s
New sparse VkImage reserved at the VA 0x30000, 6729.841 s 0x30000, 19961.807 s 0xb0000, 20974.440 s
Page fault (kernel, converted) ~6729.91 s ~19961.82 s ~20974.44 s
Fault after the new reservation ~70 ms ~15 ms ~4 ms
Offset in the reservation 0x2000 0x2000 0x4000
Tile bound to the new image before the fault none none none

All three are TCP reads (RW: 0, MAPPING_ERROR: 0x1), and vkd3d says "currently mapped" each time.

So in 3 of 3 the fault comes within milliseconds of a new placed-texture image being reserved at that VA, before any tile is bound to it. Run 9 is the clearest: the earlier owner had been gone for 48 s, and the VA had nothing mapped in that time. A read of the old content in that window would have faulted then, not 15 ms after the reservation. In run 10 the old image was destroyed 62 ms before the fault, so on its own that run can't tell the two apart.

That makes me think a draw reads the new texture's image before its tiles are bound. I haven't checked in placement/residency.rs when the first tiles of a reserved image are bound, or what can reach the image before that.

What was running

Both newer runs had TUXBOX_TRACE_GPU_FAULT=1. Each reported 15 draws started and not finished, all mesh draws in one list. One pipeline is in both:

Pipeline Run 9 Run 10
PS b374992a MS 4db9a403 5 6
PS ec60ebf6 MS 144764f5 3
PS 03bb6d31 MS 8ff74fc0 3
PS f3d66f7b MS 44638b1a 2
PS 39918bab MS 4dfd380b 2
PS 8593c32f MS e3e80f76 2
PS 1b227abb MS e5972aa2 2
PS 7740adb9 / 3cd8734c MS c767b670, PS 749581e4 MS 840087a3, PS 5a4007aa MS f8bb5ad7, PS 1281b254 MS 9b0bdf4e 1 each

Both reports came from the trace's device-loss check, which I had changed locally to poll every 250 ms instead of every second (and its quiet window from 8 s to 2 s). In run 8, with the defaults, there was no report at all. The log ends 62 ms after vkd3d marked the device lost, between two of the 1 s polls, and the 8 s quiet window hadn't ended. The submit-path flush from #424 didn't fire either: vkd3d's own submission thread got the error, and TuxBox's call didn't.

Logs, the kernel dumps and the local diagnostic commit are available.

<!-- greyfinch-sync:brcly/TuxBox:comment:7329112455 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7329112455). Originally posted by [Kayotic1337](https://github.com/Kayotic1337) on 2026-12-01T23:15:32Z. --- @brcly a correction to my comment above, and two more runs that point somewhere else. **Correction:** I opened that comment with "the use-after-free is still there". That was stronger than the run showed. Since e40d8052 I haven't seen the shape this issue describes, a read of an address that only a destroyed image had. In all three TCP faults I've had since, the address belonged to a live image that had just been reserved. ### The three faults RX 9070 XT, main after e40d8052, `TUXBOX_LAZY_PUBLICATION=0`, `VKD3D_CONFIG=fault`, drop log on. Run 5 is the one above (`712fb960` + #630); runs 9 and 10 are on `2a850114` + #639. One thing first: the time vkd3d prints with the fault is when it noticed the device loss, which here was the gfx ring timeout, about 2 s after the fault. The kernel logs the page fault itself. Its timestamps run on `CLOCK_MONOTONIC` and vkd3d's on QPC (`CLOCK_MONOTONIC_RAW` under Wine), about 10 ppm apart on this machine (0.21 s after 5.8 h of uptime). Corrected for that, the ring timeout lands within 3 ms before vkd3d's `DEVICE_LOST` in runs 9 and 10, so the times below are on vkd3d's clock and good to a few ms. | | Run 5 | Run 9 | Run 10 | | --- | --- | --- | --- | | Earlier owner of the VA | 512x1024 BC1 placed texture, destroyed 6726.491 s | a buffer heap, freed 19913.303 s | 1024x1024 BC1 sRGB placed texture (`0xebeff4000`, 9 mips), destroyed 20974.382 s | | New sparse `VkImage` reserved at the VA | `0x30000`, 6729.841 s | `0x30000`, 19961.807 s | `0xb0000`, 20974.440 s | | Page fault (kernel, converted) | ~6729.91 s | ~19961.82 s | ~20974.44 s | | Fault after the new reservation | ~70 ms | ~15 ms | ~4 ms | | Offset in the reservation | `0x2000` | `0x2000` | `0x4000` | | Tile bound to the new image before the fault | none | none | none | All three are TCP reads (`RW: 0`, `MAPPING_ERROR: 0x1`), and vkd3d says "currently mapped" each time. So in 3 of 3 the fault comes within milliseconds of a new placed-texture image being reserved at that VA, before any tile is bound to it. Run 9 is the clearest: the earlier owner had been gone for 48 s, and the VA had nothing mapped in that time. A read of the old content in that window would have faulted then, not 15 ms after the reservation. In run 10 the old image was destroyed 62 ms before the fault, so on its own that run can't tell the two apart. That makes me think a draw reads the new texture's image before its tiles are bound. I haven't checked in `placement/residency.rs` when the first tiles of a reserved image are bound, or what can reach the image before that. ### What was running Both newer runs had `TUXBOX_TRACE_GPU_FAULT=1`. Each reported 15 draws started and not finished, all mesh draws in one list. One pipeline is in both: | Pipeline | Run 9 | Run 10 | | --- | --- | --- | | PS `b374992a` MS `4db9a403` | 5 | 6 | | PS `ec60ebf6` MS `144764f5` | 3 | | | PS `03bb6d31` MS `8ff74fc0` | 3 | | | PS `f3d66f7b` MS `44638b1a` | 2 | | | PS `39918bab` MS `4dfd380b` | 2 | | | PS `8593c32f` MS `e3e80f76` | | 2 | | PS `1b227abb` MS `e5972aa2` | | 2 | | PS `7740adb9` / `3cd8734c` MS `c767b670`, PS `749581e4` MS `840087a3`, PS `5a4007aa` MS `f8bb5ad7`, PS `1281b254` MS `9b0bdf4e` | | 1 each | Both reports came from the trace's device-loss check, which I had changed locally to poll every 250 ms instead of every second (and its quiet window from 8 s to 2 s). In run 8, with the defaults, there was no report at all. The log ends 62 ms after vkd3d marked the device lost, between two of the 1 s polls, and the 8 s quiet window hadn't ended. The submit-path flush from #424 didn't fire either: vkd3d's own submission thread got the error, and TuxBox's call didn't. Logs, the kernel dumps and the local diagnostic commit are available.
NickStallman commented 2026-12-01 23:19:33 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-01T23:19:33Z.


Matching data from an RTX 5090 (10de:2b85, driver 620.70.10, GE-Proton11-15), main-23 (712fb960-era main + our then-open PRs), TUXBOX_TRACE_GPU_FAULT=1, VKD3D_CONFIG=fault. NVIDIA gives no data address for these (Xid 13, "Graphics SM Warp Exception … MMU Fault"), so I can't tie them to a VA. But the draws in flight overlap yours:

Run Loss Unfinished commands (mesh programs)
139r2 Xid 13 at ~2 min MS b91b86fc (17), MS 91b16a4f (12), MS 84798173 (6), MS 4db9a403 (6), MS 0bc3511b (2)
140l2 (TUXBOX_LAZY_PUBLICATION=0) Xid 13 at ~2.4 min MS 9e6ae248 (15), MS 4db9a403 (13), MS e3e80f76 (3), MS 3a1f39d1 (2)
136t Xid 13 at ~3 min MS 0e904b85 (18), MS ea7e5195 (2), plus particle VS/PS
138c Xid 13 at ~12.5 min MS 5f6ec27e (7), MS ef79b57e (4)

What we ruled out on this card:

  • A destroyed image still named: with #567's descriptor shadow plus a drop-time log, 0 of 31,037 ended images were named by any descriptor at the loss in 138c, and bursts of up to 334 ends had 0 still named.
  • Lazy publication: off in 140l2, which still lost.
  • A wider root-view reach (64 MiB) still lost.
  • Out-of-range offsets, heap slots past the title heap, runaway loops: a shader-side bounds log on every raw buffer access, dynamic cbuffer index and heap index logged nothing before 138c's loss.

So your "read of a just-reserved image before any tile is bound" fits our losses too: the read is in range of a valid descriptor, which is why none of those checks saw it. We're now reading when a reserved image's first tiles are bound against when a descriptor or draw can reach it, and will report what we find.

Separately, there's a second family here: Xid 109 hangs with only one ray-traced shadow dispatch unfinished. That looks unrelated.

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:comment:7329205458 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7329205458). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-01T23:19:33Z. --- Matching data from an RTX 5090 (`10de:2b85`, driver 620.70.10, GE-Proton11-15), main-23 (`712fb960`-era main + our then-open PRs), `TUXBOX_TRACE_GPU_FAULT=1`, `VKD3D_CONFIG=fault`. NVIDIA gives no data address for these (`Xid 13`, "Graphics SM Warp Exception … MMU Fault"), so I can't tie them to a VA. But the draws in flight overlap yours: | Run | Loss | Unfinished commands (mesh programs) | | --- | --- | --- | | 139r2 | Xid 13 at ~2 min | MS `b91b86fc` (17), MS `91b16a4f` (12), MS `84798173` (6), MS `4db9a403` (6), MS `0bc3511b` (2) | | 140l2 (`TUXBOX_LAZY_PUBLICATION=0`) | Xid 13 at ~2.4 min | MS `9e6ae248` (15), MS `4db9a403` (13), MS `e3e80f76` (3), MS `3a1f39d1` (2) | | 136t | Xid 13 at ~3 min | MS `0e904b85` (18), MS `ea7e5195` (2), plus particle VS/PS | | 138c | Xid 13 at ~12.5 min | MS `5f6ec27e` (7), MS `ef79b57e` (4) | What we ruled out on this card: - **A destroyed image still named:** with #567's descriptor shadow plus a drop-time log, 0 of 31,037 ended images were named by any descriptor at the loss in 138c, and bursts of up to 334 ends had 0 still named. - **Lazy publication:** off in 140l2, which still lost. - **A wider root-view reach** (64 MiB) still lost. - **Out-of-range offsets, heap slots past the title heap, runaway loops:** a shader-side bounds log on every raw buffer access, dynamic cbuffer index and heap index logged nothing before 138c's loss. So your "read of a just-reserved image before any tile is bound" fits our losses too: the read is in range of a valid descriptor, which is why none of those checks saw it. We're now reading when a reserved image's first tiles are bound against when a descriptor or draw can reach it, and will report what we find. Separately, there's a second family here: Xid 109 hangs with only one ray-traced shadow dispatch unfinished. That looks unrelated. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
DrArroway commented 2026-12-01 23:48:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-12-01T23:48:40Z.


Matching RDNA2 data on AMD Radeon RX 6900 XT (1002:73bf) (Mesa 26.3.1-5 RADV, kernel 7.3.7-1-cachyos, GE-Proton11-15, build cb4631ba = b279360a + #640, TUXBOX_LAZY_PUBLICATION=1, TUXBOX_TRACE_GPU_FAULT=1):

  • Run summary: 1,733.9s (14,454 presents — past intro & cinematic into prison gameplay), 0 -EPERM CS rejections, 64+ clean lazy-publication recoveries.
  • Ledgers right before the fault:
    • memory ledger: card 13819/15530 MiB, adapter system memory 2952/31555 MiB, upload staging 0 MiB, title pages 7131 MiB, process commit 12015 MiB
    • texture ledger: unbacked 18273 (3729 MiB), card 6395 (4240 MiB) (title ranges 4573 MiB, 4095 MiB distinct), system 0 (0 MiB), committed 3064 (2 MiB)
  • Kernel fault (journalctl -k): [gfxhub] page fault, TCP (0x8), PERMISSION_FAULTS: 0x3, MAPPING_ERROR: 0x0, RW: 0x0 (read) on pages 0x000080051ada0000–0x000080051ada2000, followed by ring gfx_0.1.0 timeout → MODE1 reset → VK_ERROR_DEVICE_LOST.
  • Unfinished commands (TUXBOX_TRACE_GPU_FAULT=1): 9 commands started and not finished of 2,973,180 recorded, all mesh draws on command list 0x76433480 — overlapping directly with @Kayotic1337's RDNA4 runs 9–10 (PS b374992a / MS 4db9a403 and PS 39918bab / MS 4dfd380b) and @NickStallman's RTX 5090 runs 139r2 / 140l2 (MS 4db9a403):
    • PS b374992a / MS 4db9a403: 5 draws (#2965817, #2965827, #2965838, #2965865, #2965877)
    • PS 39918bab / MS 4dfd380b: 3 draws (#2965811, #2965856, #2965872)
    • PS 3ec2480e / MS 4e23ed80: 1 draw (#2965882)
<!-- greyfinch-sync:brcly/TuxBox:comment:7329799852 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7329799852). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-12-01T23:48:40Z. --- Matching RDNA2 data on `AMD Radeon RX 6900 XT (1002:73bf)` (Mesa `26.3.1-5` RADV, kernel `7.3.7-1-cachyos`, `GE-Proton11-15`, build `cb4631ba` = `b279360a` + #640, `TUXBOX_LAZY_PUBLICATION=1`, `TUXBOX_TRACE_GPU_FAULT=1`): - **Run summary:** `1,733.9s` (`14,454` presents — past intro & cinematic into prison gameplay), `0` `-EPERM` CS rejections, `64+` clean lazy-publication recoveries. - **Ledgers right before the fault:** - `memory ledger: card 13819/15530 MiB, adapter system memory 2952/31555 MiB, upload staging 0 MiB, title pages 7131 MiB, process commit 12015 MiB` - `texture ledger: unbacked 18273 (3729 MiB), card 6395 (4240 MiB) (title ranges 4573 MiB, 4095 MiB distinct), system 0 (0 MiB), committed 3064 (2 MiB)` - **Kernel fault (`journalctl -k`):** `[gfxhub] page fault`, `TCP (0x8)`, `PERMISSION_FAULTS: 0x3`, `MAPPING_ERROR: 0x0`, `RW: 0x0` (read) on pages `0x000080051ada0000`–`0x000080051ada2000`, followed by `ring gfx_0.1.0 timeout` → `MODE1` reset → `VK_ERROR_DEVICE_LOST`. - **Unfinished commands (`TUXBOX_TRACE_GPU_FAULT=1`):** `9` commands started and not finished of `2,973,180` recorded, all mesh draws on command list `0x76433480` — overlapping directly with `@Kayotic1337`'s RDNA4 runs 9–10 (`PS b374992a / MS 4db9a403` and `PS 39918bab / MS 4dfd380b`) and `@NickStallman`'s RTX 5090 runs `139r2` / `140l2` (`MS 4db9a403`): - `PS b374992a` / `MS 4db9a403`: 5 draws (`#2965817`, `#2965827`, `#2965838`, `#2965865`, `#2965877`) - `PS 39918bab` / `MS 4dfd380b`: 3 draws (`#2965811`, `#2965856`, `#2965872`) - `PS 3ec2480e` / `MS 4e23ed80`: 1 draw (`#2965882`)
NickStallman commented 2026-12-02 00:56:49 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-02T00:56:49Z.


A measurement that fits your "read before its tiles are bound" finding, from the RTX 5090 (10de:2b85, 620.70.10, GE-Proton11-15). The run used current main (ca7d1bc9: #623, #640, #644, #639 and #645 in) plus two local diagnostics, and default settings (read residency on, lazy publication on).

The diagnostic. When Transfer::back maps tiles of a reserved placed texture on the provider's upload queue, it checks whether that texture is being read by GPU work not yet finished. It counts two cases: a batch that recorded a read of it whose fence hasn't completed, or a read through the heap in the last 3 frames.

Result. The device was lost about 8 minutes into the story (Xid 13, SM MMU fault). By then the check had fired more than 4,096 times (it logs at powers of two), for example:

reserved bind over read #2048: 1024x1024x1 format=98 mips=9 flags=0x300000 mapped while read through the heap in frame 81903 (now 81903)
reserved bind over read #4096: 512x512x1 format=71 mips=8 flags=0x300000 mapped while read through the heap in frame 81926 (now 81926)

So tile mappings of reserved textures routinely change while the same frame's draws read those textures through the heap. Nothing orders the upload queue's UpdateTileMappings after those reads. As I read the Vulkan spec, changing a sparse binding while another queue accesses the same region is undefined.

What was in flight at the loss. 129 unfinished commands, the mesh draws you saw: MS 4db9a403 (23), MS 44638b1a (10), MS 4dfd380b (4), MS 86410da3 (3). The provider's own readbacks and one upload were pending behind them, which is consistent with a stuck guest batch rather than a fault in our copies.

Where it comes from. With read residency, a texture reached only through the heap isn't gathered for the batch that first reads it (read_residency.rs says that read "finds the image unbacked"). The next submit maps its tiles on the upload queue while the earlier batch may still be reading it.

The mapping should wait until the batches that may read the texture have finished. A cheaper alternative: map every tile of a new reserved image to a shared zero tile at reservation, so there is never a NULL-to-tile transition under a read. We're working on a change along those lines and will post it with A/B numbers.

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:comment:7331136967 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7331136967). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-02T00:56:49Z. --- A measurement that fits your "read before its tiles are bound" finding, from the RTX 5090 (`10de:2b85`, 620.70.10, GE-Proton11-15). The run used current main (`ca7d1bc9`: #623, #640, #644, #639 and #645 in) plus two local diagnostics, and default settings (read residency on, lazy publication on). **The diagnostic.** When `Transfer::back` maps tiles of a reserved placed texture on the provider's upload queue, it checks whether that texture is being read by GPU work not yet finished. It counts two cases: a batch that recorded a read of it whose fence hasn't completed, or a read through the heap in the last 3 frames. **Result.** The device was lost about 8 minutes into the story (Xid 13, SM MMU fault). By then the check had fired more than 4,096 times (it logs at powers of two), for example: ``` reserved bind over read #2048: 1024x1024x1 format=98 mips=9 flags=0x300000 mapped while read through the heap in frame 81903 (now 81903) reserved bind over read #4096: 512x512x1 format=71 mips=8 flags=0x300000 mapped while read through the heap in frame 81926 (now 81926) ``` So tile mappings of reserved textures routinely change while the same frame's draws read those textures through the heap. Nothing orders the upload queue's `UpdateTileMappings` after those reads. As I read the Vulkan spec, changing a sparse binding while another queue accesses the same region is undefined. **What was in flight at the loss.** 129 unfinished commands, the mesh draws you saw: MS `4db9a403` (23), MS `44638b1a` (10), MS `4dfd380b` (4), MS `86410da3` (3). The provider's own readbacks and one upload were pending behind them, which is consistent with a stuck guest batch rather than a fault in our copies. **Where it comes from.** With read residency, a texture reached only through the heap isn't gathered for the batch that first reads it (`read_residency.rs` says that read "finds the image unbacked"). The next submit maps its tiles on the upload queue while the earlier batch may still be reading it. The mapping should wait until the batches that may read the texture have finished. A cheaper alternative: map every tile of a new reserved image to a shared zero tile at reservation, so there is never a NULL-to-tile transition under a read. We're working on a change along those lines and will post it with A/B numbers. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Kayotic1337 commented 2026-12-02 01:28:38 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by Kayotic1337 on 2026-12-02T01:28:38Z.


@NickStallman thanks, I missed this before opening #646. I think we're looking at two sides of the same thing: a sparse image's binding changing while work that reads it is still queued or running.

Mine looks like the destroy side, not the mapping side. In all five faults (runs 5 and 9–12 above), vkd3d's history for the faulting page has no BIND SPARSE after the new reservation. What it has is the previous owner released and a new image reserved at the same VA, with the fault within milliseconds of that reservation. In runs 11 and 12 the unfinished draws were recorded 0.6–1.7 s before the previous owner was released. That fits an image destroyed under a read better than a tile mapped under one.

#646 doesn't cover your case, and only part of mine. It holds the textures submit gathers until the batch's fence passes. Read residency is on in my runs too, so a heap texture it leaves out of the batch isn't held, and can still be destroyed while that batch reads it. The same gap you describe for mapping.

So I don't think the two changes exclude each other. A zero tile at reservation would stop NULL-to-tile under a read, but not a destroy and VA reuse under one, as far as I can tell. #646 does the reverse, for gathered textures only. If you post A/B numbers, a run with both would show whether anything is left.

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:comment:7331747693 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7331747693). Originally posted by [Kayotic1337](https://github.com/Kayotic1337) on 2026-12-02T01:28:38Z. --- @NickStallman thanks, I missed this before opening #646. I think we're looking at two sides of the same thing: a sparse image's binding changing while work that reads it is still queued or running. **Mine looks like the destroy side, not the mapping side.** In all five faults (runs 5 and 9–12 above), vkd3d's history for the faulting page has no `BIND SPARSE` after the new reservation. What it has is the previous owner released and a new image reserved at the same VA, with the fault within milliseconds of that reservation. In runs 11 and 12 the unfinished draws were recorded 0.6–1.7 s before the previous owner was released. That fits an image destroyed under a read better than a tile mapped under one. **#646 doesn't cover your case, and only part of mine.** It holds the textures `submit` gathers until the batch's fence passes. Read residency is on in my runs too, so a heap texture it leaves out of the batch isn't held, and can still be destroyed while that batch reads it. The same gap you describe for mapping. So I don't think the two changes exclude each other. A zero tile at reservation would stop NULL-to-tile under a read, but not a destroy and VA reuse under one, as far as I can tell. #646 does the reverse, for gathered textures only. If you post A/B numbers, a run with both would show whether anything is left. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
NickStallman commented 2026-12-02 05:36:31 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-02T05:36:31Z.


An A/B on the RTX 5090 (10de:2b85, 620.70.10, GE-Proton11-15). It points at the defaults e40d8052 turned on, and at no single one of them.

All runs on current main (ca7d1bc9) used the same warm caches and the same scripted start presses, which reach gameplay about 2 minutes after launch. Each run was 8-20 minutes of play. "Lost" means a device loss: Xid 13 SM MMU fault, Xid 109 context-switch timeout, or occasionally Xid 32 on a copy engine. Almost all of them came at or just after the cutscene-to-gameplay switch.

Configuration Runs Lost
Defaults (read residency, lazy publication and once-per-frame checks on) ~20 ~20
TUXBOX_READ_RESIDENCY=0 only 1 (+ ~8 earlier on an older main) all
TUXBOX_LAZY_PUBLICATION=0 only 1 (+ 1 earlier) all
TUXBOX_CHECK_ONCE_PER_FRAME=0 only 1 1
LAZY_PUBLICATION=0 + CHECK_ONCE_PER_FRAME=0 (read residency on) 1 1
READ_RESIDENCY=0 + LAZY_PUBLICATION=0 2 0
READ_RESIDENCY=0 + CHECK_ONCE_PER_FRAME=0 2 0
All three =0 3 1 (only a hair compute dispatch in flight, not the mesh draws)
Defaults + #646 3 3
Defaults with ntsync off (verified on the live process) 3 3
Control: integration build 43a1fd5d on 717a74c4 (before e40d8052), cold, same day and conditions 1 (36 min) 0

So on this card the losses need read residency on, plus lazy publication or once-per-frame checks on. Turning off read residency and either one of the others was clean in 4 of 4 runs, and anything less lost.

The counts are small. Two clean runs per pair against about 20 losses for the defaults is a strong contrast, but not a rate.

That fits what this issue describes. With read residency, a texture reached only through the heap isn't gathered for the batch that first reads it, so it is neither backed nor held for that batch. It is then bound, or released and its VA reused, while that batch may still read it. #646 holds only gathered textures, which would explain why it doesn't help here with read residency on. The other two switches change when textures are published and checked, which plausibly widens the window. That part is a guess.

For anyone else hitting this on NVIDIA, TUXBOX_READ_RESIDENCY=0 TUXBOX_LAZY_PUBLICATION=0 is a workaround that runs reliably here, at the cost of more texture memory.

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:comment:7336108656 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7336108656). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-02T05:36:31Z. --- An A/B on the RTX 5090 (`10de:2b85`, 620.70.10, GE-Proton11-15). It points at the defaults `e40d8052` turned on, and at no single one of them. All runs on current main (`ca7d1bc9`) used the same warm caches and the same scripted start presses, which reach gameplay about 2 minutes after launch. Each run was 8-20 minutes of play. "Lost" means a device loss: Xid 13 SM MMU fault, Xid 109 context-switch timeout, or occasionally Xid 32 on a copy engine. Almost all of them came at or just after the cutscene-to-gameplay switch. | Configuration | Runs | Lost | | --- | ---: | ---: | | Defaults (read residency, lazy publication and once-per-frame checks on) | ~20 | ~20 | | `TUXBOX_READ_RESIDENCY=0` only | 1 (+ ~8 earlier on an older main) | all | | `TUXBOX_LAZY_PUBLICATION=0` only | 1 (+ 1 earlier) | all | | `TUXBOX_CHECK_ONCE_PER_FRAME=0` only | 1 | 1 | | `LAZY_PUBLICATION=0` + `CHECK_ONCE_PER_FRAME=0` (read residency on) | 1 | 1 | | **`READ_RESIDENCY=0` + `LAZY_PUBLICATION=0`** | **2** | **0** | | **`READ_RESIDENCY=0` + `CHECK_ONCE_PER_FRAME=0`** | **2** | **0** | | All three `=0` | 3 | 1 (only a hair compute dispatch in flight, not the mesh draws) | | Defaults + #646 | 3 | 3 | | Defaults with ntsync off (verified on the live process) | 3 | 3 | | Control: integration build `43a1fd5d` on `717a74c4` (before `e40d8052`), cold, same day and conditions | 1 (36 min) | 0 | So on this card the losses need read residency on, plus lazy publication or once-per-frame checks on. Turning off read residency and either one of the others was clean in 4 of 4 runs, and anything less lost. The counts are small. Two clean runs per pair against about 20 losses for the defaults is a strong contrast, but not a rate. That fits what this issue describes. With read residency, a texture reached only through the heap isn't gathered for the batch that first reads it, so it is neither backed nor held for that batch. It is then bound, or released and its VA reused, while that batch may still read it. #646 holds only gathered textures, which would explain why it doesn't help here with read residency on. The other two switches change when textures are published and checked, which plausibly widens the window. That part is a guess. For anyone else hitting this on NVIDIA, `TUXBOX_READ_RESIDENCY=0 TUXBOX_LAZY_PUBLICATION=0` is a workaround that runs reliably here, at the cost of more texture memory. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
NickStallman commented 2026-12-02 06:24:19 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-02T06:24:19Z.


A correction to the workaround in my last comment.

The clean pair runs in that table all had VKD3D_CONFIG=fault set, along with two TuxBox diagnostics. Isolated on the same build and settings (TUXBOX_READ_RESIDENCY=0 TUXBOX_LAZY_PUBLICATION=0, ntsync on, 8 minutes each):

Also set Runs Lost
VKD3D_CONFIG=fault (alone, or with the diagnostics) 4 0
nothing 2 2
TUXBOX_TRACE_GPU_FAULT=1 only 2 2
TuxBox's reserved-texture trace only 2 2

So on the 5090 the configuration that holds is TUXBOX_READ_RESIDENCY=0 TUXBOX_LAZY_PUBLICATION=0 VKD3D_CONFIG=fault. The two switches alone are not enough. With read residency on, VKD3D_CONFIG=fault doesn't help either: the default-settings runs in the earlier table had it set and still lost.

That vkd3d's fault mode changes the outcome suggests the losses depend on something it alters, such as device-fault or address-binding tracking that changes when memory or VA ranges are released or reused. We're reading vkd3d-proton's source to find which, and will report back.

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:comment:7336975869 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7336975869). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-02T06:24:19Z. --- A correction to the workaround in my last comment. The clean pair runs in that table all had `VKD3D_CONFIG=fault` set, along with two TuxBox diagnostics. Isolated on the same build and settings (`TUXBOX_READ_RESIDENCY=0 TUXBOX_LAZY_PUBLICATION=0`, ntsync on, 8 minutes each): | Also set | Runs | Lost | | --- | ---: | ---: | | `VKD3D_CONFIG=fault` (alone, or with the diagnostics) | 4 | 0 | | nothing | 2 | 2 | | `TUXBOX_TRACE_GPU_FAULT=1` only | 2 | 2 | | TuxBox's reserved-texture trace only | 2 | 2 | So on the 5090 the configuration that holds is `TUXBOX_READ_RESIDENCY=0 TUXBOX_LAZY_PUBLICATION=0 VKD3D_CONFIG=fault`. The two switches alone are not enough. With read residency on, `VKD3D_CONFIG=fault` doesn't help either: the default-settings runs in the earlier table had it set and still lost. That vkd3d's fault mode changes the outcome suggests the losses depend on something it alters, such as device-fault or address-binding tracking that changes when memory or VA ranges are released or reused. We're reading vkd3d-proton's source to find which, and will report back. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1093i3511 commented 2026-12-02 06:56:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-12-02T06:56:21Z.


@Kayotic1337 a second data point for the SQC fault you mention in #646, from RDNA2. It isn't the same signature as yours, so it may be a separate problem.

RX 6600 (1002:73ff), Mesa 26.3.1 RADV, GE-Proton11-15, Series S profile, default settings (read residency and lazy publication on). Build: main 2a850114 + #640 + the #625 fix (now #647).

  • The run reached the world (mission frame 1035) and ended after 610 s on a GPU fault from SQC instruction fetch, not TCP:
    • [gfxhub] client SQC (inst), status 0x004012B1, PERMISSION_FAULTS: 0xb, RW: 0x0
    • addresses 0x00000700137ff000 and 0x00003f00137ff000, thread vkd3d_queue, compute ring
    • the ring reset succeeded, then VK_ERROR_DEVICE_LOST
  • Yours was a scalar data read of address 0 from CS a8ffc289. Mine is an instruction fetch. Its two addresses share their low bits (…137ff000) and differ only in the high part.
  • I didn't have TUXBOX_TRACE_GPU_FAULT on, so I can't name the dispatch.
  • I had it once in one run. The same run on main 3e2839b1 without the #625 change ended after 446 s on the usual TCP read fault, with no SQC fault. So I can't tie it to either change.
<!-- greyfinch-sync:brcly/TuxBox:comment:7337581570 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7337581570). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-12-02T06:56:21Z. --- @Kayotic1337 a second data point for the SQC fault you mention in #646, from RDNA2. It isn't the same signature as yours, so it may be a separate problem. RX 6600 (`1002:73ff`), Mesa 26.3.1 RADV, GE-Proton11-15, Series S profile, default settings (read residency and lazy publication on). Build: main 2a850114 + #640 + the #625 fix (now #647). - The run reached the world (mission frame 1035) and ended after 610 s on a GPU fault from **SQC instruction fetch**, not TCP: - `[gfxhub]` client `SQC (inst)`, status `0x004012B1`, `PERMISSION_FAULTS: 0xb`, `RW: 0x0` - addresses `0x00000700137ff000` and `0x00003f00137ff000`, thread `vkd3d_queue`, compute ring - the ring reset succeeded, then `VK_ERROR_DEVICE_LOST` - Yours was a scalar data read of address 0 from `CS a8ffc289`. Mine is an instruction fetch. Its two addresses share their low bits (`…137ff000`) and differ only in the high part. - I didn't have `TUXBOX_TRACE_GPU_FAULT` on, so I can't name the dispatch. - I had it once in one run. The same run on main 3e2839b1 without the #625 change ended after 446 s on the usual TCP read fault, with no SQC fault. So I can't tie it to either change.
NickStallman commented 2026-12-02 12:12:59 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-02T12:12:59Z.


A narrower result on the RTX 5090: the losses that need read residency come from the read notes the translation adds to shaders, not from read residency's runtime residency.

Setup. All runs are on 6d4f1cd7-era main with two local diagnostic switches, TUXBOX_LAZY_PUBLICATION=0 and VKD3D_CONFIG=fault (which removed the other part of the losses earlier). Runs were 8-30 minutes.

  • TUXBOX_DIAG_NO_NARROW=1: read residency stays on, but every heap-read texture is gathered, so nothing is left out or read unbacked.
  • TUXBOX_DIAG_NO_HEAP_NOTES: the translator emits no tb_note_heap_read (=1), or also leaves the bitmap root UAV out of the root (=root).
Shader form, read residency on, no narrowing Runs Lost
Normal: bitmap root UAV plus tb_note_heap_read at each image heap bind 2 2 (Xid 13)
Root UAV kept, no read notes 2 0
No root UAV and no read notes (roots as with read residency off) 2 0

So keeping the UAV in the root is harmless here. What brings the losses back is the read notes themselves: the Load plus InterlockedOr into the bitmap at each image heap bind, which now sits in every heap-indexing program, pixel shaders included.

Statically the writes look bounded and safe: the slot is clamped, the bit is under 2^20, and the buffer is bound and held. I don't have a mechanism yet. The candidates we're looking at:

  • How the NVIDIA driver compiles atomics or UAV writes in pixel shaders of mesh pipelines that otherwise have none (early depth, helper lanes).
  • A race on the per-list bitmap buffer when the same list is submitted on more than one queue, or overlaps its own readback copy.

We'll follow up with one of these tested, or a way to collect reads that keeps the notes out of the shaders.

(The early-exit regression since 9c3cf86f is a separate thing, reported on #533.)

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:comment:7345007967 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7345007967). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-02T12:12:59Z. --- A narrower result on the RTX 5090: the losses that need read residency come from the read notes the translation adds to shaders, not from read residency's runtime residency. **Setup.** All runs are on `6d4f1cd7`-era main with two local diagnostic switches, `TUXBOX_LAZY_PUBLICATION=0` and `VKD3D_CONFIG=fault` (which removed the other part of the losses earlier). Runs were 8-30 minutes. - `TUXBOX_DIAG_NO_NARROW=1`: read residency stays on, but every heap-read texture is gathered, so nothing is left out or read unbacked. - `TUXBOX_DIAG_NO_HEAP_NOTES`: the translator emits no `tb_note_heap_read` (`=1`), or also leaves the bitmap root UAV out of the root (`=root`). | Shader form, read residency on, no narrowing | Runs | Lost | | --- | ---: | ---: | | Normal: bitmap root UAV plus `tb_note_heap_read` at each image heap bind | 2 | 2 (Xid 13) | | Root UAV kept, no read notes | 2 | 0 | | No root UAV and no read notes (roots as with read residency off) | 2 | 0 | So keeping the UAV in the root is harmless here. What brings the losses back is the read notes themselves: the `Load` plus `InterlockedOr` into the bitmap at each image heap bind, which now sits in every heap-indexing program, pixel shaders included. Statically the writes look bounded and safe: the slot is clamped, the bit is under 2^20, and the buffer is bound and held. I don't have a mechanism yet. The candidates we're looking at: - How the NVIDIA driver compiles atomics or UAV writes in pixel shaders of mesh pipelines that otherwise have none (early depth, helper lanes). - A race on the per-list bitmap buffer when the same list is submitted on more than one queue, or overlaps its own readback copy. We'll follow up with one of these tested, or a way to collect reads that keeps the notes out of the shaders. (The early-exit regression since `9c3cf86f` is a separate thing, reported on #533.) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
NickStallman commented 2026-12-02 16:43:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-02T16:43:17Z.


A correction to my comment about the read notes. A review of all our runs showed that the clean results in the "no notes" arms came mostly from cold first runs. Those take a different start-up timeline, and cold runs here never show the world-entry hang. Counting warm runs only, the arms are 0/2 (normal), 1/1, 2/5, 0/1 and 1/2, and no pair is distinguishable.

What the data does support on the RTX 5090:

  • Read residency on raises the loss rate at world entry. With LAZY_PUBLICATION=0 and VKD3D_CONFIG=fault, warm runs were 9/11 clean with it off and 0/5 with it on.
  • Which part of read residency does this is not separated. The read notes are not shown to be the trigger.

There also seem to be two separate failures here, which our earlier tables pooled:

  • An Xid 109 hang at world entry. Where the fault trace names a command, it is a single ray-query shadow dispatch. It is present in builds before e40d8052 at roughly 20%, and close to 100% on current defaults.
  • The time-distributed MMU fault described in this issue.

We're re-running the comparisons warm, interleaved and with more runs per arm, and will post those numbers instead.

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:comment:7352360351 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7352360351). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-02T16:43:17Z. --- A correction to my comment about the read notes. A review of all our runs showed that the clean results in the "no notes" arms came mostly from cold first runs. Those take a different start-up timeline, and cold runs here never show the world-entry hang. Counting warm runs only, the arms are 0/2 (normal), 1/1, 2/5, 0/1 and 1/2, and no pair is distinguishable. What the data does support on the RTX 5090: - Read residency on raises the loss rate at world entry. With `LAZY_PUBLICATION=0` and `VKD3D_CONFIG=fault`, warm runs were 9/11 clean with it off and 0/5 with it on. - Which part of read residency does this is not separated. The read notes are not shown to be the trigger. There also seem to be two separate failures here, which our earlier tables pooled: - An Xid 109 hang at world entry. Where the fault trace names a command, it is a single ray-query shadow dispatch. It is present in builds before e40d8052 at roughly 20%, and close to 100% on current defaults. - The time-distributed MMU fault described in this issue. We're re-running the comparisons warm, interleaved and with more runs per arm, and will post those numbers instead. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Kayotic1337 commented 2026-12-02 19:28:11 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by Kayotic1337 on 2026-12-02T19:28:11Z.


Run 14 (RX 9070 XT, the run 13 build with #646, same settings as runs 9–13) ended on the TCP read fault after 1224 s, so #646 is closed. Its timeline doesn't fit my "image destroyed under a read" reading from earlier in this thread. It fits @NickStallman's read of a newly reserved image before its tiles are bound better.

Fault: TCP read, ring 157, MAPPING_ERROR 0x1, WALKER_ERROR 0x5, VA 0x8004ae9d5000, which is offset 0x5000 of the range below. vkd3d: "Fault address is currently mapped". The devcoredump names the same page.

vkd3d's history for that VA (QPC seconds):

Time Event
14148.955 sparse image 0x30000 reserved
14195.483 destroyed
14196.293 sparse image 0x10000 reserved
14315.306 destroyed
14319.376 sparse image 0x160000 reserved
14352.398 destroyed. Nothing owns the VA for the next 56.5 s
14408.939 new sparse image 0x10000 reserved. No tile bind follows in the history
~14408.948 kernel fault, about 9 ms later (printk time converted to QPC, calibrated on the ring timeout against vkd3d's DEVICE_LOST)

What was in flight: 65 commands started and not finished, 48 of them printed. They are all mesh draws in one list (0x766c7ec0): 36× PS f025a107/MS 83a29e9f and 12× PS 927f7231/MS f1e47dde. Every printed draw was recorded at 14408.078 and submitted at 14408.703. That is 56 s after the previous owner was destroyed and 0.24 s before the new image was reserved. Null root views: 0. Unset root descriptors: 0.

What this changes:

  • In runs 11 and 12 the draws were recorded before the previous owner was released, which is why I read those as an image destroyed under a read. Here the previous owner had been gone for almost a minute when the list was recorded. A read of the address before 14408.939 would have hit an unmapped VA and faulted then, and nothing faulted. So the read is most likely of the new image, reserved after the list was submitted. That means a heap descriptor written after submission, with the image never backed for this batch.
  • That is the path Nick described: with read residency on, a texture reached only through the heap isn't gathered for the batch that first reads it. Holding textures longer (#646, and the hold I tried before opening this issue) can't help with that, which matches both results.
  • The timing pattern is now 6 of 6 (runs 5, 9, 10, 11, 12, 14): the fault comes 2–72 ms after a new sparse reservation at that VA.
  • This time the draws are not MS 4db9a403. That shader is in runs 9, 10 and 12 but not here.

Logs and the devcoredump are available.

<!-- greyfinch-sync:brcly/TuxBox:comment:7356224160 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7356224160). Originally posted by [Kayotic1337](https://github.com/Kayotic1337) on 2026-12-02T19:28:11Z. --- Run 14 (RX 9070 XT, the run 13 build with #646, same settings as runs 9–13) ended on the TCP read fault after 1224 s, so #646 is closed. Its timeline doesn't fit my "image destroyed under a read" reading from earlier in this thread. It fits @NickStallman's read of a newly reserved image before its tiles are bound better. **Fault:** TCP read, ring 157, `MAPPING_ERROR 0x1`, `WALKER_ERROR 0x5`, VA `0x8004ae9d5000`, which is offset `0x5000` of the range below. vkd3d: "Fault address is currently mapped". The devcoredump names the same page. **vkd3d's history for that VA (QPC seconds):** | Time | Event | | ---: | --- | | 14148.955 | sparse image `0x30000` reserved | | 14195.483 | destroyed | | 14196.293 | sparse image `0x10000` reserved | | 14315.306 | destroyed | | 14319.376 | sparse image `0x160000` reserved | | 14352.398 | destroyed. **Nothing owns the VA for the next 56.5 s** | | 14408.939 | new sparse image `0x10000` reserved. No tile bind follows in the history | | ~14408.948 | **kernel fault**, about 9 ms later (printk time converted to QPC, calibrated on the ring timeout against vkd3d's `DEVICE_LOST`) | **What was in flight:** 65 commands started and not finished, 48 of them printed. They are all mesh draws in one list (`0x766c7ec0`): 36× PS `f025a107`/MS `83a29e9f` and 12× PS `927f7231`/MS `f1e47dde`. Every printed draw was **recorded at 14408.078 and submitted at 14408.703**. That is 56 s after the previous owner was destroyed and 0.24 s before the new image was reserved. Null root views: 0. Unset root descriptors: 0. What this changes: - In runs 11 and 12 the draws were recorded before the previous owner was released, which is why I read those as an image destroyed under a read. Here the previous owner had been gone for almost a minute when the list was recorded. A read of the address before 14408.939 would have hit an unmapped VA and faulted then, and nothing faulted. So the read is most likely of the **new** image, reserved after the list was submitted. That means a heap descriptor written after submission, with the image never backed for this batch. - That is the path Nick described: with read residency on, a texture reached only through the heap isn't gathered for the batch that first reads it. Holding textures longer (#646, and the hold I tried before opening this issue) can't help with that, which matches both results. - The timing pattern is now 6 of 6 (runs 5, 9, 10, 11, 12, 14): the fault comes 2–72 ms after a new sparse reservation at that VA. - This time the draws are not MS `4db9a403`. That shader is in runs 9, 10 and 12 but not here. Logs and the devcoredump are available.
3kynox commented 2026-12-03 17:06:37 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-12-03T17:06:37Z.


@Kayotic1337 @NickStallman one measurement that may help here, from my RTX 4070 Ti SUPER with the console structures on and a local diagnostic. In four of the five losses where I could tell which heap slot the lost program was reading, the title had rewritten that slot 0.12 to 7 s after the provider took the submission, to an image made after it. The faulting page was in another image, which had already ended, so I can't say it's the same fault.

A question for the AMD side, which I can't test on my card: could a reserved image created after a submit have no page-table entries at all until the work already in flight is done, because amdgpu runs a process's page-table updates behind it? I've read that it can, and I haven't checked it in the kernel source. It would fit the 2–72 ms. A zero tile bound at reservation would then come too late as well, and images reserved ahead of time might not.

<!-- greyfinch-sync:brcly/TuxBox:comment:7385975886 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/603#issuecomment-7385975886). Originally posted by [3kynox](https://github.com/3kynox) on 2026-12-03T17:06:37Z. --- @Kayotic1337 @NickStallman one measurement that may help here, from my RTX 4070 Ti SUPER with the console structures on and a local diagnostic. In four of the five losses where I could tell which heap slot the lost program was reading, the title had rewritten that slot 0.12 to 7 s after the provider took the submission, to an image made after it. The faulting page was in another image, which had already ended, so I can't say it's the same fault. A question for the AMD side, which I can't test on my card: could a reserved image created after a submit have no page-table entries at all until the work already in flight is done, because amdgpu runs a process's page-table updates behind it? I've read that it can, and I haven't checked it in the kernel source. It would fit the 2–72 ms. A zero tile bound at reservation would then come too late as well, and images reserved ahead of time might not.
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#603
No description provided.