Who's working on what (read before starting) #533

Open
opened 2026-11-29 20:17:06 +00:00 by brcly · 85 comments
brcly commented 2026-11-29 20:17:06 +00:00 (Migrated from github.com)
Contributor

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-29T20:17:06Z.


A lot is happening at once, so this issue keeps track of who is working on what. Before starting on something, comment here (or on the issue it belongs to) so two people don't build the same piece. Comment again when you stop or hand over.

Current focus, in order

  1. Every shader compiles and binds, and compile time and shader size come down (#293, #509).
  2. Frame times. ProjectScarlett's story intro is now GPU-bound at about 2 fps on an RTX 4070 Ti SUPER (from 0.2-1 fps, CPU-bound, on 30 Nov). TUXBOX_GPU_TIMING=1 (#532) names the pipelines that take the GPU's time; TUXBOX_SUBMIT_PROFILE=1 and TUXBOX_LOCK_STATS=1 cover the CPU side.
  3. TuxBox's own overhead: memory and CPU.

PRs inside the focus get reviewed first. Others are labelled later: they aren't rejected, but they wait.

Who is working on what

Area Who Where
Compile time and shader size @brcly, @JeffreyBytes (DXC pass lists) #293, #509
Frame times at the story intro (GPU work per frame) @brcly #533
Console BVH: static bottom-level structures (rehydrated), their buffer and wiring @3kynox #382, #536, #586, #596
Console BVH: structures the title builds while it runs @3kynox #382, #623
Console BVH: top-level scenes and instance records @NickStallman #382
Root constants of rooted programs (vertex, pixel, compute) @NickStallman #611, #619
Mesh output budget; depth-only streams @NickStallman #612, #597
Entry-live reads through a destination @NickStallman #624
Paged heap indices without a slot @NickStallman #572
Draws and dispatches still skipped under descriptor paging @s3rius #610 (merged), follow-ups
Waiting for a stand-in's compile at first bind @ReverendOzmund #587
Title watchdog through waits and loads @csj0oe #621
XMem section watch and private views on 8 GB cards @1093i3511, @DrArroway #472, #608 (merged)
GPU reads of destroyed placed textures (RDNA2-4) @Kayotic1337, @1093i3511 #603
A console reference (native RDNA2) @JeffreyBytes, @JohnVonWells #412
Audits: tools/docs, tests/CI @NickStallman, @snoozedDev #359, #369

Done since the last update: XG on the 26100 ABI (#476), root SRV/UAV reach (#389), the game runtime services (#510, #511, #513, #528, #529, #531), XMem private-view fixes (#600, #608), stage-aware loop guards (#522), the ray-walk node test (#520), mesh stages with the index map (#617).

If you're working on something that isn't listed, or a line is wrong, comment and I'll update the table.

PR labels

Every open PR carries one state label:

  • needs-review: not reviewed yet.
  • needs-check: reviewed; waiting on a GPU check or a game run.
  • waiting-on-author: changes or answers asked for on the PR.
  • ready-to-merge: reviewed and checked.
  • later: outside the current focus.

Making PRs easy to review

  • One change per PR. Unrelated changes in one PR wait for the slowest of them.
  • Agree large changes in an issue first, especially anything over a few hundred lines or anything that changes the translated HLSL of many programs (every cached shader then recompiles).
  • Say whether the game ran with it, on which card, and what you saw. Checks passing isn't the same as the game working.
  • Keep a few PRs open at a time until they're reviewed, rather than many at once.

See CONTRIBUTING for the full rules.

<!-- greyfinch-sync:brcly/TuxBox:issue:6683626816 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533). Originally posted by [brcly](https://github.com/brcly) on 2026-11-29T20:17:06Z. --- A lot is happening at once, so this issue keeps track of who is working on what. **Before starting on something, comment here** (or on the issue it belongs to) so two people don't build the same piece. Comment again when you stop or hand over. ## Current focus, in order 1. **Every shader compiles and binds**, and compile time and shader size come down (#293, #509). 2. **Frame times.** ProjectScarlett's story intro is now GPU-bound at about 2 fps on an RTX 4070 Ti SUPER (from 0.2-1 fps, CPU-bound, on 30 Nov). `TUXBOX_GPU_TIMING=1` (#532) names the pipelines that take the GPU's time; `TUXBOX_SUBMIT_PROFILE=1` and `TUXBOX_LOCK_STATS=1` cover the CPU side. 3. **TuxBox's own overhead**: memory and CPU. PRs inside the focus get reviewed first. Others are labelled `later`: they aren't rejected, but they wait. ## Who is working on what | Area | Who | Where | |---|---|---| | Compile time and shader size | @brcly, @JeffreyBytes (DXC pass lists) | #293, #509 | | Frame times at the story intro (GPU work per frame) | @brcly | #533 | | Console BVH: static bottom-level structures (rehydrated), their buffer and wiring | @3kynox | #382, #536, #586, #596 | | Console BVH: structures the title builds while it runs | @3kynox | #382, #623 | | Console BVH: top-level scenes and instance records | @NickStallman | #382 | | Root constants of rooted programs (vertex, pixel, compute) | @NickStallman | #611, #619 | | Mesh output budget; depth-only streams | @NickStallman | #612, #597 | | Entry-live reads through a destination | @NickStallman | #624 | | Paged heap indices without a slot | @NickStallman | #572 | | Draws and dispatches still skipped under descriptor paging | @s3rius | #610 (merged), follow-ups | | Waiting for a stand-in's compile at first bind | @ReverendOzmund | #587 | | Title watchdog through waits and loads | @csj0oe | #621 | | XMem section watch and private views on 8 GB cards | @1093i3511, @DrArroway | #472, #608 (merged) | | GPU reads of destroyed placed textures (RDNA2-4) | @Kayotic1337, @1093i3511 | #603 | | A console reference (native RDNA2) | @JeffreyBytes, @JohnVonWells | #412 | | Audits: tools/docs, tests/CI | @NickStallman, @snoozedDev | #359, #369 | Done since the last update: XG on the 26100 ABI (#476), root SRV/UAV reach (#389), the game runtime services (#510, #511, #513, #528, #529, #531), XMem private-view fixes (#600, #608), stage-aware loop guards (#522), the ray-walk node test (#520), mesh stages with the index map (#617). If you're working on something that isn't listed, or a line is wrong, comment and I'll update the table. ## PR labels Every open PR carries one state label: - `needs-review`: not reviewed yet. - `needs-check`: reviewed; waiting on a GPU check or a game run. - `waiting-on-author`: changes or answers asked for on the PR. - `ready-to-merge`: reviewed and checked. - `later`: outside the current focus. ## Making PRs easy to review - **One change per PR.** Unrelated changes in one PR wait for the slowest of them. - **Agree large changes in an issue first**, especially anything over a few hundred lines or anything that changes the translated HLSL of many programs (every cached shader then recompiles). - **Say whether the game ran with it**, on which card, and what you saw. Checks passing isn't the same as the game working. - **Keep a few PRs open at a time** until they're reviewed, rather than many at once. See [CONTRIBUTING](CONTRIBUTING.md) for the full rules.
NickStallman commented 2026-11-29 20:19:44 +00:00 (Migrated from github.com)
Author
Contributor

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


My current work, kept up to date here:

Area State
CS_ScreenProbes_ActivateRays (dxil-spirv stack overflow from #479's -O0 helper, #472) #535, checks passed on both cards, compiles in the game. Making the program smaller isn't started
Console BVH: top-level encoder #525 (merged), for 3kynox's wiring; #534 (held until the runtime half exists)
Recorder for lost GPUs on NVIDIA (#232) branch diag/lost-gpu-recorder, not for merging
16-byte CBV offsets inside TuxBox (#251) controls #552 merged; #561 (driver probe) held until the piece that uses it exists, to come in one PR; recompile to be agreed first
Inline ray scene refused at submission, which drops its queue #566 merged; @3kynox's runs with it are clean
The submit profile's "flush" step in ProjectScarlett is the title's Unmap of one texture, not a cache flush (I said otherwise; wrong) no performance claim; a profile split to find the ~2.9 s that is in no step is being prepared
BCPack requests that fail (about 55 per run, Stalled, always the same) not a decoder fault: each is a whole chunk asked into 4 KiB, a read past a small texture whose size our layer may report too large (small_texture, #198). A run with TUXBOX_TRACE_ALLOCATION_BYTES will say; no missing texels
Depth-only pipelines (no pixel shader) are never translated against the pipeline's root, so cascade-shadow programs are stand-ins in every run draft #597: 10 of 11 translate against their captured roots, checks pass on both cards; a device test, a Lanes scenario and a game run to come
A loading-screen slide missing a layer the first time it is shown looking; not #572; trying TUXBOX_LAZY_TEXTURES=0, TUXBOX_PLACEMENT_WATCH=0, TUXBOX_PARTIAL_MIPS=0
Size and compile time of the large volumetrics programs (#546's follow-up) draft #593 (tb_f64_unpack: they now pass validation on the fast route); the size is the two-halves wrapper, measured (about 42% of the text), a change is HLSL-wide and agreed first
Refused shader programs, lighting families first census on e5d2e913: 1,528 of 47,526 requests refused, none of the 92 exposure, bloom and AO programs among them, so they don't explain the washed-out picture. 26 compute programs are stand-ins in every run (shadow rays 8, SSS 3, ...). #577 merged (1 program); the pixel wave ops turned out to be #542's (an idea left there)
Pixel programs refused for complete waves (the deferred material families) #604 merged. #604, #606, #607 merged
Compute programs refused as "compute swizzle inside a loop" (a 32-lane sequential solver, 2 programs, about 46 dispatches a frame in ProjectScarlett's world) #609 merged
Pixel light loops refused as a wave reduction in divergent control flow (a VS/PS pair ProjectScarlett's world draws about 6 times a frame) Reading done, nothing written. The compute lone_lane model fits (each pixel its own wave, visiting its own lights); it is limited to compute by one condition. A local try translates both requests and two more and passes dxv; no GPU check. @brcly, is widening it to pixel programs, with helper pixels and implicit-derivative samples kept refused and a GPU check, something you'd take? Not starting until you say
An index-map entry nobody wrote reads visible slot 0 draft #572 (null view), stride bug of the first version fixed; full checks pass on both cards on an old base, needs a rebase; no claim about #232
Device loss on an RTX 5090 (Xid 13; 1 to 19 minutes into the world, once while loading; @Jerkin42 has it on AMD, #472) not the indirect mesh records (#568, 393,498 clean) and not an unmapped index-map slot (#572). Two of three traced faults read the last 64 KiB tile of a texture destroyed minutes earlier that no followed descriptor names; diagnostics #567, #568. No fix yet New: @Jerkin42 found translated shaders don't bound the heap index (#472; the fix is theirs). Our earlier exclusion covered only indices inside the map; a padding test and a control are prepared for our card, not run. Disabling VK_NV_raw_access_chains didn't stop a loss (one untraced run, 13.7 min in the world)
Distant impostor models with wind, refused at the mesh stage (about 33 draws a frame in ProjectScarlett's world) Started: (1) translator: the live-in scan counts unused operand fields as reads of the launch register; (2) provider: mesh stages never get the heap stride table that compute and vertex+pixel get. Separate branches; the second may be larger
Root constants of a vertex program are lost when it is paired with its root: they start as literal 0, with no refusal Started. Read in the code: sampler_heap::constants has no vertex arm, and rootless_constants gives up once a root is attached. In a title we traced, the lighting draws take a material index this way and depth-test EQUAL against it, so every draw can only match material 0 and the light buffer keeps its old picture (seen in a capture of one run). Draft #611: 12,878 of 21,051 recorded rooted translations change, 0 newly refused or accepted; one run with it fills the surface-colour targets that were black (albedo exactly zero on 22% of the pixels drawn with a surface, 76–85% before); the lighting still reaches only one or two materials, which is being traced. GPU checks on both cards and a Lanes scenario are being finished; it changes the HLSL of rooted vertex programs and of rooted pixel programs whose constants follow more than one table. @brcly, is that all right?
64-lane compute translated for 32-lane waves: a compare whose mask destination is also its scalar source reads zero instead of the source Draft #613 (314 of 5,366 recorded compute requests change, 0 newly refused; all compile and validate; mostly NVIDIA, but 32 of them take the paired form on every host). GPU checks on both cards and a control on the old translator to come. One run with #611 and #612 too shows a lit, textured, recognisable room; not claimed for any one of them
Mesh programs whose outputs are near 32 KiB drop whole meshlets Draft #612: the budget counted 16 bytes an element, DXC charges 4 a component. 1,051 of 1,101 recorded mesh programs that were capped below 128 vertices are complete now; GPU case fails before, passes after; game not run with it yet

Not mine: node buffer allocator, wiring, static and dynamic bottom-level structures (@3kynox, #382), SSSResolve (#515), loop guards (#522; my prototype is dropped). @brcly, the two #382 lines in the table can move to @3kynox.

<!-- greyfinch-sync:brcly/TuxBox:comment:7261990932 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7261990932). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T20:19:44Z. --- My current work, kept up to date here: | Area | State | |---|---| | `CS_ScreenProbes_ActivateRays` (dxil-spirv stack overflow from #479's `-O0` helper, #472) | #535, checks passed on both cards, compiles in the game. Making the program smaller isn't started | | Console BVH: top-level encoder | #525 (merged), for 3kynox's wiring; #534 (held until the runtime half exists) | | Recorder for lost GPUs on NVIDIA (#232) | branch `diag/lost-gpu-recorder`, not for merging | | 16-byte CBV offsets inside TuxBox (#251) | controls #552 merged; #561 (driver probe) held until the piece that uses it exists, to come in one PR; recompile to be agreed first | | Inline ray scene refused at submission, which drops its queue | #566 merged; @3kynox's runs with it are clean | | The submit profile's "flush" step in ProjectScarlett is the title's Unmap of one texture, not a cache flush (I said otherwise; wrong) | no performance claim; a profile split to find the ~2.9 s that is in no step is being prepared | | BCPack requests that fail (about 55 per run, `Stalled`, always the same) | not a decoder fault: each is a whole chunk asked into 4 KiB, a read past a small texture whose size our layer may report too large (`small_texture`, #198). A run with `TUXBOX_TRACE_ALLOCATION_BYTES` will say; no missing texels | | Depth-only pipelines (no pixel shader) are never translated against the pipeline's root, so cascade-shadow programs are stand-ins in every run | draft #597: 10 of 11 translate against their captured roots, checks pass on both cards; a device test, a Lanes scenario and a game run to come | | A loading-screen slide missing a layer the first time it is shown | looking; not #572; trying `TUXBOX_LAZY_TEXTURES=0`, `TUXBOX_PLACEMENT_WATCH=0`, `TUXBOX_PARTIAL_MIPS=0` | | Size and compile time of the large volumetrics programs (#546's follow-up) | draft #593 (`tb_f64_unpack`: they now pass validation on the fast route); the size is the two-halves wrapper, measured (about 42% of the text), a change is HLSL-wide and agreed first | | Refused shader programs, lighting families first | census on e5d2e913: 1,528 of 47,526 requests refused, none of the 92 exposure, bloom and AO programs among them, so they don't explain the washed-out picture. 26 compute programs are stand-ins in every run (shadow rays 8, SSS 3, ...). #577 merged (1 program); the pixel wave ops turned out to be #542's (an idea left there) | | Pixel programs refused for complete waves (the deferred material families) | #604 merged. #604, #606, #607 merged | | Compute programs refused as "compute swizzle inside a loop" (a 32-lane sequential solver, 2 programs, about 46 dispatches a frame in ProjectScarlett's world) | #609 merged | | Pixel light loops refused as a wave reduction in divergent control flow (a VS/PS pair ProjectScarlett's world draws about 6 times a frame) | Reading done, nothing written. The compute `lone_lane` model fits (each pixel its own wave, visiting its own lights); it is limited to compute by one condition. A local try translates both requests and two more and passes dxv; no GPU check. @brcly, is widening it to pixel programs, with helper pixels and implicit-derivative samples kept refused and a GPU check, something you'd take? Not starting until you say | | An index-map entry nobody wrote reads visible slot 0 | draft #572 (null view), stride bug of the first version fixed; full checks pass on both cards on an old base, needs a rebase; no claim about #232 | | Device loss on an RTX 5090 (Xid 13; 1 to 19 minutes into the world, once while loading; @Jerkin42 has it on AMD, #472) | not the indirect mesh records (#568, 393,498 clean) and not an unmapped index-map slot (#572). Two of three traced faults read the last 64 KiB tile of a texture destroyed minutes earlier that no followed descriptor names; diagnostics #567, #568. No fix yet New: @Jerkin42 found translated shaders don't bound the heap index (#472; the fix is theirs). Our earlier exclusion covered only indices inside the map; a padding test and a control are prepared for our card, not run. Disabling `VK_NV_raw_access_chains` didn't stop a loss (one untraced run, 13.7 min in the world) | | Distant impostor models with wind, refused at the mesh stage (about 33 draws a frame in ProjectScarlett's world) | Started: (1) translator: the live-in scan counts unused operand fields as reads of the launch register; (2) provider: mesh stages never get the heap stride table that compute and vertex+pixel get. Separate branches; the second may be larger | | Root constants of a vertex program are lost when it is paired with its root: they start as literal 0, with no refusal | Started. Read in the code: `sampler_heap::constants` has no vertex arm, and `rootless_constants` gives up once a root is attached. In a title we traced, the lighting draws take a material index this way and depth-test EQUAL against it, so every draw can only match material 0 and the light buffer keeps its old picture (seen in a capture of one run). Draft #611: 12,878 of 21,051 recorded rooted translations change, 0 newly refused or accepted; one run with it fills the surface-colour targets that were black (albedo exactly zero on 22% of the pixels drawn with a surface, 76–85% before); the lighting still reaches only one or two materials, which is being traced. GPU checks on both cards and a Lanes scenario are being finished; it changes the HLSL of rooted vertex programs and of rooted pixel programs whose constants follow more than one table. @brcly, is that all right? | | 64-lane compute translated for 32-lane waves: a compare whose mask destination is also its scalar source reads zero instead of the source | Draft #613 (314 of 5,366 recorded compute requests change, 0 newly refused; all compile and validate; mostly NVIDIA, but 32 of them take the paired form on every host). GPU checks on both cards and a control on the old translator to come. One run with #611 and #612 too shows a lit, textured, recognisable room; not claimed for any one of them | | Mesh programs whose outputs are near 32 KiB drop whole meshlets | Draft #612: the budget counted 16 bytes an element, DXC charges 4 a component. 1,051 of 1,101 recorded mesh programs that were capped below 128 vertices are complete now; GPU case fails before, passes after; game not run with it yet | Not mine: node buffer allocator, wiring, static and **dynamic** bottom-level structures (@3kynox, #382), `SSSResolve` (#515), loop guards (#522; my prototype is dropped). @brcly, the two #382 lines in the table can move to @3kynox.
DrArroway commented 2026-11-29 20:23:59 +00:00 (Migrated from github.com)
Author
Contributor

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


Adding my active work so nobody duplicates it:

  • XMem private views (#501, #472): #501 is rebased onto main (2d6dc338, CI green, awaiting NVIDIA check). Once it lands, I plan to follow up on sibling-page PrivateSpan import holds for write=true secondary-alias faults (#456, confirmed by @1093i3511's page_import_held=false, span_import_held=true trace on #472).
  • #495 placement run-cache follow-up (main 2d6dc338, currently in live testing): Fixes check_sequential clearing WRITTEN in Watch::rearm before watch_cacheable() checks it, skips the wasted speculative in-place digest on first mip upload in check_mips_speculative, and fixes the 4 tuxbox-d3d12 hardware placement unit tests currently failing on main (noted in #512/#514/#518) — 435/435 passing locally on RX 6900 XT; finishing a live run + dual-GPU check before opening the PR.
<!-- greyfinch-sync:brcly/TuxBox:comment:7262048336 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7262048336). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-11-29T20:23:59Z. --- Adding my active work so nobody duplicates it: - **XMem private views (#501, #472):** `#501` is rebased onto `main` (`2d6dc338`, CI green, awaiting NVIDIA check). Once it lands, I plan to follow up on sibling-page `PrivateSpan` import holds for `write=true` secondary-alias faults (`#456`, confirmed by `@1093i3511`'s `page_import_held=false, span_import_held=true` trace on `#472`). - **`#495` placement run-cache follow-up (`main` `2d6dc338`, currently in live testing):** Fixes `check_sequential` clearing `WRITTEN` in `Watch::rearm` before `watch_cacheable()` checks it, skips the wasted speculative in-place digest on first mip upload in `check_mips_speculative`, and fixes the 4 `tuxbox-d3d12` hardware placement unit tests currently failing on `main` (noted in `#512`/`#514`/`#518`) — **435/435** passing locally on RX 6900 XT; finishing a live run + dual-GPU check before opening the PR.
DrArroway commented 2026-11-29 21:41:18 +00:00 (Migrated from github.com)
Author
Contributor

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


Update: posted #550 for the #495 placement run-cache follow-up (verified on RX 6900 XT 1002:73bf and AMD Raphael iGPU 1002:164e + live ProjectScarlett runs; awaiting NVIDIA check).

<!-- greyfinch-sync:brcly/TuxBox:comment:7263071280 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7263071280). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-11-29T21:41:18Z. --- Update: posted `#550` for the `#495` placement run-cache follow-up (verified on RX 6900 XT `1002:73bf` and AMD Raphael iGPU `1002:164e` + live ProjectScarlett runs; awaiting NVIDIA check).
DrArroway commented 2026-11-29 21:44:02 +00:00 (Migrated from github.com)
Author
Contributor

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


Signing off for tonight — handing over status and tonight's findings so anyone picking them up has everything in one place:

Ready PRs

  • #501 (XMem private views, rebased onto 2d6dc338 at cbb6a2df): CI green (Python 3.10, Python 3.12, Rust all passed); verified on RX 6900 XT (1002:73bf), AMD Raphael iGPU (1002:164e), and RTX 5090 (@NickStallman, 192/192 pass).
  • #550 (#495 placement run-cache follow-up, 3d12a893): Open and MERGEABLE (Rust tests & Python 3.12 tests passed, Python 3.10 tests running); verified on RX 6900 XT (1002:73bf, 435/435 tuxbox-d3d12 --lib, full tuxbox.py check exit 0), AMD Raphael iGPU (1002:164e, 435/435 tuxbox-d3d12 --lib, full tuxbox.py check exit 0), and live ProjectScarlett runs; awaiting NVIDIA check.

Finding & hand-off (open for anyone overnight): #456 write=true under TUXBOX_XMEM_PRIVATE_VIEWS=1

In a 584.7s offline ProjectScarlett run on RX 6900 XT (#501 cbb6a2df + #389 + #550, TUXBOX_XMEM_PRIVATE_VIEWS=1, 15,653 presents, 0 GPUVM faults, 0 shadows), our new blocker= diagnostic captured the exact cause of the remaining write=true secondary-alias ERROR_BUSY fault:

TuxBox xmem: secondary alias 0x878580000 read mirrored as PAGE_READONLY (token=0x74610, [email protected](page_imp=false,span_imp=true,span_held=true,def=0))
TuxBox xmem: secondary alias 0x878580000 fault not promoted (err=170, write=true, token=0x74610, span=0x878540000..0x878800000, page_import_held=false, span_import_held=false, page_held=false, span_held=false, deferred=0, [email protected](page_imp=false,span_imp=true,span_held=true,def=0))
  • Root cause: map_private_contiguous (runtime/xmem/src/physical_pages/private_views.rs) passes an entire contiguous mapping range straight to private_span_bounds without splitting multi-chunk ranges into PRIVATE_SPAN_CHUNK (4 MiB) spans. Here that produced a single 6.09 GiB PrivateSpan (0xf00200000..0x1085e00000). Any single GPU-imported 64 KiB page anywhere inside those 6.09 GiB marks span_imp=true, preventing detach_private_slot / promote_token_to_section from promoting an unheld page (page_imp=false) at 0xf3c900000 when a secondary alias takes a CPU write.
  • Hand-off: Feel free for anyone to pick up chunking map_private_contiguous into PRIVATE_SPAN_CHUNK (4 MiB) spans (plus handling page_imp=true if a canonical page itself is import-held) as a follow-up once #501 lands.
<!-- greyfinch-sync:brcly/TuxBox:comment:7263107591 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7263107591). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-11-29T21:44:02Z. --- Signing off for tonight — handing over status and tonight's findings so anyone picking them up has everything in one place: ### Ready PRs - **`#501` (`XMem private views`, rebased onto `2d6dc338` at `cbb6a2df`):** CI green (`Python 3.10`, `Python 3.12`, `Rust` all passed); verified on RX 6900 XT (`1002:73bf`), AMD Raphael iGPU (`1002:164e`), and RTX 5090 (`@NickStallman`, 192/192 pass). - **`#550` (`#495` placement run-cache follow-up, `3d12a893`):** Open and `MERGEABLE` (`Rust tests` & `Python 3.12 tests` passed, `Python 3.10 tests` running); verified on RX 6900 XT (`1002:73bf`, 435/435 `tuxbox-d3d12 --lib`, full `tuxbox.py check` exit 0), AMD Raphael iGPU (`1002:164e`, 435/435 `tuxbox-d3d12 --lib`, full `tuxbox.py check` exit 0), and live ProjectScarlett runs; awaiting NVIDIA check. ### Finding & hand-off (open for anyone overnight): `#456` `write=true` under `TUXBOX_XMEM_PRIVATE_VIEWS=1` In a 584.7s offline ProjectScarlett run on RX 6900 XT (`#501` `cbb6a2df` + `#389` + `#550`, `TUXBOX_XMEM_PRIVATE_VIEWS=1`, `15,653` presents, `0` GPUVM faults, `0` shadows), our new `blocker=` diagnostic captured the exact cause of the remaining `write=true` secondary-alias `ERROR_BUSY` fault: ```text TuxBox xmem: secondary alias 0x878580000 read mirrored as PAGE_READONLY (token=0x74610, [email protected](page_imp=false,span_imp=true,span_held=true,def=0)) TuxBox xmem: secondary alias 0x878580000 fault not promoted (err=170, write=true, token=0x74610, span=0x878540000..0x878800000, page_import_held=false, span_import_held=false, page_held=false, span_held=false, deferred=0, [email protected](page_imp=false,span_imp=true,span_held=true,def=0)) ``` - **Root cause:** `map_private_contiguous` (`runtime/xmem/src/physical_pages/private_views.rs`) passes an entire contiguous mapping range straight to `private_span_bounds` without splitting multi-chunk ranges into `PRIVATE_SPAN_CHUNK` (4 MiB) spans. Here that produced a single **6.09 GiB** `PrivateSpan` (`0xf00200000..0x1085e00000`). Any single GPU-imported 64 KiB page anywhere inside those 6.09 GiB marks `span_imp=true`, preventing `detach_private_slot` / `promote_token_to_section` from promoting an unheld page (`page_imp=false`) at `0xf3c900000` when a secondary alias takes a CPU write. - **Hand-off:** Feel free for anyone to pick up chunking `map_private_contiguous` into `PRIVATE_SPAN_CHUNK` (4 MiB) spans (plus handling `page_imp=true` if a canonical page itself is import-held) as a follow-up once `#501` lands.
glovepost commented 2026-11-29 22:37:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by glovepost on 2026-11-29T22:37:43Z.


@brcly Updating my status on #533 after today's main (f360038d) splits and #523 bisect:

Active PRs (rebased onto main, 9/9 host checks green; GPU checks & live ProjectScarlett runs pending unless noted)

Area Where State
Stage-aware loop guards + parented nested loop budget (tb_nested_guard) #522 Split out #547 (merged) and #549; added tb_nested_guard + sample.json DXC benchmark; awaiting preference on 4,096 graphics cap vs 65,536 default
Exec-masked CbDyn and tbuf_uint vector MUBUF loads #549 Split from #522, rebased onto main, 9/9 host checks green
Wave32 clear_size (SSSResolve*), v_interp_*_f16 unused field, mesh bounds #515 Fixed one_word_vector_mask() + added vcc_hi regression test per @NickStallman, dropped guessed-stride count, 9/9 host checks green
Opt-in GPU timing (TUXBOX_GPU_TIMING) and AS compaction handshake trace #532 Rebased onto main preserving #541 PIX markers & #512 consume_tables, 9/9 host checks green
Multi-slice R16/R32 depth-UAV pairing #519 Narrowed to depth-UAV pairing only on main, 9/9 host checks green; opt-in memory-wait release parked on fork branch until ProjectScarlett TUXBOX_FRAME_LOG / watchdog evidence
Launch-prep phase timing + tools/boot_timeline.py (Part 1 of #485) #485 Narrowed onto main (74e18049), 9/9 host checks green (740 Python tests); Parts 2–6 parked on glovepost/TuxBox:backup/pr485-full
3-bank page_waves ballots & double-buffered reads #555 Split from #523 onto main, 9/9 host checks green, 213/213 recorded Scarlett requests compile cleanly with DXC 1.9 -fnew-inlining-behavior
Uniform scc_from_mask scalar arithmetic & bitcount elision #558 Split from #523 onto main, 9/9 host checks green, 213/213 DXC -fnew-inlining-behavior pass, 89/89 sample.json byte-identical DXIL
HLSL codegen optimizations (dead exec_hi/vcc_hi, stride tb_sbw_*, tb_mullc, constant folds, branchless 64-bit) #523 Bisected DXC 1.9 -fnew-inlining-behavior SIGSEGV to tb_f32_relation / tb_f32_relation_ftz in compare.rs (143/213 crashes -> 0/213 crashes once dropped); rebased onto main (2bb24112), 9/9 host checks green (-3.659% HLSL bytes, -0.861% DXIL bytes, -6.49% median DXC CPU time on pre-final sample.json run)

Parked (later)

  • #517 (gameinput scripted input, profile auto-select, game harness) — rebased onto main.

Locally I have both NVIDIA RTX 2070 SUPER (10de:1e84) and AMD iGPU (1002:13c0) for dual-GPU checks and live ProjectScarlett runs. Not touching #382, #389, #501/#550, or @NickStallman's lane-read/permute PRs.

<!-- greyfinch-sync:brcly/TuxBox:comment:7263824610 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7263824610). Originally posted by [glovepost](https://github.com/glovepost) on 2026-11-29T22:37:43Z. --- @brcly Updating my status on #533 after today's `main` (`f360038d`) splits and #523 bisect: ### Active PRs (rebased onto `main`, `9/9` host checks green; GPU checks & live ProjectScarlett runs pending unless noted) | Area | Where | State | |---|---|---| | Stage-aware loop guards + parented nested loop budget (`tb_nested_guard`) | #522 | Split out #547 (merged) and #549; added `tb_nested_guard` + `sample.json` DXC benchmark; awaiting preference on `4,096` graphics cap vs `65,536` default | | Exec-masked `CbDyn` and `tbuf_uint` vector MUBUF loads | #549 | Split from #522, rebased onto `main`, `9/9` host checks green | | Wave32 `clear_size` (`SSSResolve*`), `v_interp_*_f16` unused field, mesh bounds | #515 | Fixed `one_word_vector_mask()` + added `vcc_hi` regression test per @NickStallman, dropped guessed-stride count, `9/9` host checks green | | Opt-in GPU timing (`TUXBOX_GPU_TIMING`) and AS compaction handshake trace | #532 | Rebased onto `main` preserving #541 PIX markers & #512 `consume_tables`, `9/9` host checks green | | Multi-slice `R16`/`R32` depth-UAV pairing | #519 | Narrowed to depth-UAV pairing only on `main`, `9/9` host checks green; opt-in memory-wait release parked on fork branch until ProjectScarlett `TUXBOX_FRAME_LOG` / watchdog evidence | | Launch-prep phase timing + `tools/boot_timeline.py` (Part 1 of #485) | #485 | Narrowed onto `main` (`74e18049`), `9/9` host checks green (740 Python tests); Parts 2–6 parked on `glovepost/TuxBox:backup/pr485-full` | | 3-bank `page_waves` ballots & double-buffered reads | #555 | Split from #523 onto `main`, `9/9` host checks green, `213/213` recorded Scarlett requests compile cleanly with DXC 1.9 `-fnew-inlining-behavior` | | Uniform `scc_from_mask` scalar arithmetic & bitcount elision | #558 | Split from #523 onto `main`, `9/9` host checks green, `213/213` DXC `-fnew-inlining-behavior` pass, `89/89` `sample.json` byte-identical DXIL | | HLSL codegen optimizations (dead `exec_hi`/`vcc_hi`, stride `tb_sbw_*`, `tb_mullc`, constant folds, branchless 64-bit) | #523 | Bisected DXC 1.9 `-fnew-inlining-behavior` SIGSEGV to `tb_f32_relation` / `tb_f32_relation_ftz` in `compare.rs` (`143/213` crashes -> `0/213` crashes once dropped); rebased onto `main` (`2bb24112`), `9/9` host checks green (`-3.659%` HLSL bytes, `-0.861%` DXIL bytes, `-6.49%` median DXC CPU time on pre-final `sample.json` run) | ### Parked (`later`) - #517 (`gameinput` scripted input, profile auto-select, game harness) — rebased onto `main`. Locally I have both NVIDIA RTX 2070 SUPER (`10de:1e84`) and AMD iGPU (`1002:13c0`) for dual-GPU checks and live ProjectScarlett runs. Not touching #382, #389, #501/#550, or @NickStallman's lane-read/permute PRs.
NickStallman commented 2026-11-29 22:50:16 +00:00 (Migrated from github.com)
Author
Contributor

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


Starting on #251 (16-byte CBV offsets inside TuxBox), as asked: an implementation on a branch, tables only, in small pieces (probe, translator variant, provider, preparation, Lanes scenario), so each can be reviewed alone. The controls are #552. Nothing changes on hosts that read CBVs at their exact offset. On hosts that round it changes about 85–91% of translated programs, so @brcly, please say if you'd rather not have that recompile; until then I'm only preparing it, the layer stays, and I won't open the HLSL-changing piece without your go-ahead.

<!-- greyfinch-sync:brcly/TuxBox:comment:7263988316 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7263988316). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-29T22:50:16Z. --- Starting on #251 (16-byte CBV offsets inside TuxBox), as asked: an implementation on a branch, tables only, in small pieces (probe, translator variant, provider, preparation, Lanes scenario), so each can be reviewed alone. The controls are #552. Nothing changes on hosts that read CBVs at their exact offset. On hosts that round it changes about 85–91% of translated programs, so @brcly, **please say if you'd rather not have that recompile**; until then I'm only preparing it, the layer stays, and I won't open the HLSL-changing piece without your go-ahead.
snoozedDev commented 2026-11-29 23:36:49 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by snoozedDev on 2026-11-29T23:36:49Z.


I'm taking a small fix in runtime/xgameruntime. services::tests::package_progress_writes_the_full_32_byte_layout fails on main (10 of 10 runs with --test-threads=1 under Wine): package_progress zeroes the record and then writes the struct by value, so the struct's six padding bytes come back as whatever was on the stack. captions_get_properties has the same gap in its last three bytes. The PR touches only those two structs and the caption test.

This contribution was written by an AI agent (Claude Opus 5.5) operating under my supervision. I am accountable for it and will respond to review.

<!-- greyfinch-sync:brcly/TuxBox:comment:7264592602 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7264592602). Originally posted by [snoozedDev](https://github.com/snoozedDev) on 2026-11-29T23:36:49Z. --- I'm taking a small fix in `runtime/xgameruntime`. `services::tests::package_progress_writes_the_full_32_byte_layout` fails on `main` (10 of 10 runs with `--test-threads=1` under Wine): `package_progress` zeroes the record and then writes the struct by value, so the struct's six padding bytes come back as whatever was on the stack. `captions_get_properties` has the same gap in its last three bytes. The PR touches only those two structs and the caption test. This contribution was written by an AI agent (Claude Opus 5.5) operating under my supervision. I am accountable for it and will respond to review.
s3rius commented 2026-11-30 01:16:05 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by s3rius on 2026-11-30T01:16:05Z.


I’m trying to debug and fix the root cause of a memory violation error that started occurring after today’s PRs. It seems something changed the way initial resources are loaded into memory, and for some unknown reason, the resources are being copied to a null memory address.

I’m investigating now.

<!-- greyfinch-sync:brcly/TuxBox:comment:7265990606 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7265990606). Originally posted by [s3rius](https://github.com/s3rius) on 2026-11-30T01:16:05Z. --- I’m trying to debug and fix the root cause of a memory violation error that started occurring after today’s PRs. It seems something changed the way initial resources are loaded into memory, and for some unknown reason, the resources are being copied to a null memory address. I’m investigating now.
s3rius commented 2026-11-30 01:18:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by s3rius on 2026-11-30T01:18:27Z.


@snoozedDev, could your current work be related to the broken startup or are you focusing on tests only? Is it possible we’re debugging the same issue?

<!-- greyfinch-sync:brcly/TuxBox:comment:7266025204 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7266025204). Originally posted by [s3rius](https://github.com/s3rius) on 2026-11-30T01:18:27Z. --- @snoozedDev, could your current work be related to the broken startup or are you focusing on tests only? Is it possible we’re debugging the same issue?
NickStallman commented 2026-11-30 01:20:17 +00:00 (Migrated from github.com)
Author
Contributor

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


@s3rius that looks like #554: since #527, ProjectScarlett asks for a non-cached APU heap that is 0x1800 bytes too small for the contexts it also takes, ApuAlloc fails, and the title clears a null block at start-up (VCRUNTIME140.dll+0x1989, called from game_scarlett_master.exe+0x43AED60). @glovepost confirmed the chain by disassembly. If that's your stack, the fix is in #557; it works on an RTX 5090, an RX 6600 (an earlier version of it) and an RX 9070 XT, so please check before starting another. If your stack is different, it's a new one and worth its own issue.

<!-- greyfinch-sync:brcly/TuxBox:comment:7266051431 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7266051431). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T01:20:17Z. --- @s3rius that looks like #554: since #527, ProjectScarlett asks for a non-cached APU heap that is 0x1800 bytes too small for the contexts it also takes, `ApuAlloc` fails, and the title clears a null block at start-up (`VCRUNTIME140.dll+0x1989`, called from `game_scarlett_master.exe+0x43AED60`). @glovepost confirmed the chain by disassembly. If that's your stack, the fix is in #557; it works on an RTX 5090, an RX 6600 (an earlier version of it) and an RX 9070 XT, so please check before starting another. If your stack is different, it's a new one and worth its own issue.
s3rius commented 2026-11-30 01:26:37 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by s3rius on 2026-11-30T01:26:37Z.


@NickStallman, thanks for your highlight. Yes, that seems the exact reason. I didn't see it previously. Thanks for highlighting. That'd be great to fix it soon.

<!-- greyfinch-sync:brcly/TuxBox:comment:7266140012 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7266140012). Originally posted by [s3rius](https://github.com/s3rius) on 2026-11-30T01:26:37Z. --- @NickStallman, thanks for your highlight. Yes, that seems the exact reason. I didn't see it previously. Thanks for highlighting. That'd be great to fix it soon.
gtb-sbe commented 2026-11-30 02:07:43 +00:00 (Migrated from github.com)
Author
Contributor

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


I'm taking the driver crash while compiling ProjectScarlett's largest compute programs (35af8e6d, e5fbc632: Syscall stack overrun in vkCreateComputePipelines, reported by @1093i3511 on #472). The cause is Mesa's recursive SPIR-V control-flow walk running on Wine's 1 MiB syscall stack. A PR follows: the launcher sets Proton's WINE_KERNEL_STACK_SIZE and a Lanes scenario covers it. I'm also opening a Mesa issue for the recursion itself.

<!-- greyfinch-sync:brcly/TuxBox:comment:7266729202 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7266729202). Originally posted by [gtb-sbe](https://github.com/gtb-sbe) on 2026-11-30T02:07:43Z. --- I'm taking the driver crash while compiling ProjectScarlett's largest compute programs (`35af8e6d`, `e5fbc632`: `Syscall stack overrun` in `vkCreateComputePipelines`, reported by @1093i3511 on #472). The cause is Mesa's recursive SPIR-V control-flow walk running on Wine's 1 MiB syscall stack. A PR follows: the launcher sets Proton's `WINE_KERNEL_STACK_SIZE` and a Lanes scenario covers it. I'm also opening a Mesa issue for the recursion itself.
Claudineijoseprill commented 2026-11-30 02:31:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by Claudineijoseprill on 2026-11-30T02:31:43Z.


I'd like to send a small docs fix for the Lanes README: the console-shader self-test scenarios need the shader translator (build.py all, not build.py lanes) and dxv on PATH, and neither is in the build requirements. Without them, 36 of the verify gates fail with stand-in pipelines. PR coming shortly.

<!-- greyfinch-sync:brcly/TuxBox:comment:7267085006 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7267085006). Originally posted by [Claudineijoseprill](https://github.com/Claudineijoseprill) on 2026-11-30T02:31:43Z. --- I'd like to send a small docs fix for the Lanes README: the console-shader self-test scenarios need the shader translator (`build.py all`, not `build.py lanes`) and `dxv` on PATH, and neither is in the build requirements. Without them, 36 of the verify gates fail with stand-in pipelines. PR coming shortly.
csj0oe commented 2026-11-30 07:07:57 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by csj0oe on 2026-11-30T07:07:57Z.


Agent 1 here. This is our single current list; I am the only one opening PRs from our sessions, and if something of ours overlaps yours, say so here and I will drop or fold it.

Merged

  • #578 d3d12: bind a console ray walk that declares only its node buffer — landed as ce3632c2. Thanks to @NickStallman for the NVIDIA check and the corpus count (28 of 126 space-901 requests hit exactly that case).

Closed, because the effect could not be shown

  • #542 xshader — 0 newly translated, 0 lost, 0 changed over 46,664 requests, which is @brcly's own measurement; the four candidates need a DPP-aware proof, which is a different change.
  • #583 d3d12 — the reflected-table skip is gone on current main (0 occurrences in our live log; the last ones are in our 27–29 November logs).
  • #580 d3d12 console unbounded sampler heap, #581 dxbc VS/PS signature naming, #582 d3d12 compute stand-in counts — diagnostics alone, and each belongs in the PR that fixes the fault it observes.
  • #584 d3d12 console depth format 118 — with the translated depth description our card still answers UINT64_MAX, so the premise was unproven. Branch kept for when a trace shows it.

Open, 5/5 green

  • #511 acphal — six SHAPE contexts and an in-tree ABI declaration; the header, comments and README are in our own words now. The one missing fact is an audio-started line, and @brcly said he would take that boot.
  • #553 xmem — TUXBOX_TRACE_XMEM prints the title budget once. Awaiting review.
  • #576 d3d12 — commit only the guest pages that are still reserved, retry once, keep the watchdog pause across it. The decommit is gone: it re-opened the retry loop and could drop a title write. @NickStallman ran 200 passed, 0 failed on an RTX 5090.

How we work now: our PRs are driven by run logs from our measurement session. Nothing new opens from us without a logged run that shows the fault and the effect; that rule is why the six above were closed rather than argued for.

Our measurement session holds the card while it runs; the rest of us stay off it then. It is instrumented for allocation sizes, present samples, frame logs, GPU faults and the pipeline deadline, and it reports counts rather than theories.

Overlap to note: #587 (wait for a stand-in's compile at first bind instead of skipping its dispatches) is the closest thing to our own black-frame suspect. We are not touching it; if our run shows dispatches skipped to stand-ins, the count goes there rather than a duplicate patch.

We stay out of the areas this issue lists: #293/#509 compile time and shader size, #382/#525 console BVH, #389 root SRV/UAV, #501 XMem private views, #522 loop guards.

One note for anyone still chasing the frame-0 null clear: #557's APU non-cached headroom is in main, so the VCRUNTIME140.dll path from #554 is closed. A remaining frame-0 fault is a different cause.

<!-- greyfinch-sync:brcly/TuxBox:comment:7271390321 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7271390321). Originally posted by [csj0oe](https://github.com/csj0oe) on 2026-11-30T07:07:57Z. --- Agent 1 here. This is our single current list; I am the only one opening PRs from our sessions, and if something of ours overlaps yours, say so here and I will drop or fold it. **Merged** - **#578** `d3d12: bind a console ray walk that declares only its node buffer` — landed as `ce3632c2`. Thanks to @NickStallman for the NVIDIA check and the corpus count (28 of 126 space-901 requests hit exactly that case). **Closed, because the effect could not be shown** - **#542** `xshader` — 0 newly translated, 0 lost, 0 changed over 46,664 requests, which is @brcly's own measurement; the four candidates need a DPP-aware proof, which is a different change. - **#583** `d3d12` — the reflected-table skip is gone on current main (0 occurrences in our live log; the last ones are in our 27–29 November logs). - **#580** `d3d12` console unbounded sampler heap, **#581** `dxbc` VS/PS signature naming, **#582** `d3d12` compute stand-in counts — diagnostics alone, and each belongs in the PR that fixes the fault it observes. - **#584** `d3d12` console depth format 118 — with the translated depth description our card still answers `UINT64_MAX`, so the premise was unproven. Branch kept for when a trace shows it. **Open, 5/5 green** - **#511** `acphal` — six SHAPE contexts and an in-tree ABI declaration; the header, comments and README are in our own words now. The one missing fact is an audio-started line, and @brcly said he would take that boot. - **#553** `xmem` — `TUXBOX_TRACE_XMEM` prints the title budget once. Awaiting review. - **#576** `d3d12` — commit only the guest pages that are still reserved, retry once, keep the watchdog pause across it. The decommit is gone: it re-opened the retry loop and could drop a title write. @NickStallman ran 200 passed, 0 failed on an RTX 5090. **How we work now:** our PRs are driven by run logs from our measurement session. Nothing new opens from us without a logged run that shows the fault and the effect; that rule is why the six above were closed rather than argued for. **Our measurement session** holds the card while it runs; the rest of us stay off it then. It is instrumented for allocation sizes, present samples, frame logs, GPU faults and the pipeline deadline, and it reports counts rather than theories. **Overlap to note:** #587 (wait for a stand-in's compile at first bind instead of skipping its dispatches) is the closest thing to our own black-frame suspect. We are not touching it; if our run shows dispatches skipped to stand-ins, the count goes there rather than a duplicate patch. We stay out of the areas this issue lists: #293/#509 compile time and shader size, #382/#525 console BVH, #389 root SRV/UAV, #501 XMem private views, #522 loop guards. One note for anyone still chasing the frame-0 null clear: #557's APU non-cached headroom is in `main`, so the `VCRUNTIME140.dll` path from #554 is closed. A remaining frame-0 fault is a different cause.
NickStallman commented 2026-11-30 07:19:36 +00:00 (Migrated from github.com)
Author
Contributor

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


@csj0oe answering your question: as far as I know it's open, and yours to take. #525 is the encoder crate only, with no provider wiring and no binding code, and I haven't touched compute_scene.rs; on main I also see only the exact t0 + b0 pair, so your reading is right. I should have checked before writing this: that line ("Failed to remap SRV 901:0") is in none of eight ProjectScarlett logs of ours I searched (75c to 88a), so your 48 a run isn't something we see here. @3kynox owns the wiring around it (#382), so please get their word as well; #534 (ours) changes how scenes are numbered in the translator and doesn't overlap with your file either. I'll give #578 and #576 an RTX 5090 check, since NVIDIA hasn't run.

<!-- greyfinch-sync:brcly/TuxBox:comment:7271606930 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7271606930). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T07:19:36Z. --- @csj0oe answering your question: as far as I know it's open, and yours to take. #525 is the encoder crate only, with no provider wiring and no binding code, and I haven't touched `compute_scene.rs`; on main I also see only the exact `t0` + `b0` pair, so your reading is right. I should have checked before writing this: that line ("Failed to remap SRV 901:0") is in none of eight ProjectScarlett logs of ours I searched (75c to 88a), so your 48 a run isn't something we see here. @3kynox owns the wiring around it (#382), so please get their word as well; #534 (ours) changes how scenes are numbered in the translator and doesn't overlap with your file either. I'll give #578 and #576 an RTX 5090 check, since NVIDIA hasn't run.
ReverendOzmund commented 2026-11-30 08:11:44 +00:00 (Migrated from github.com)
Author
Contributor

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


Working on (ReverendOzmund, RTX 3080 Ti, NVIDIA 620.73.04, GE-Proton11-14, Bazzite):

NVIDIA test runs of ProjectScarlett for open PRs that need a second card:

  • #390 (mesh index map, Nick's rebase f172e33): running now, reporting whether the VS 281b4977 / PS 96e8aaaa distant-lights fault changes.
  • Already reported: #501 private views (#472), #564 stack size (8ae931bd 210 s), #567 stale images (no stale descriptor at the loss, #232).

Experiment inside @DrArroway's XMem claim (#472), not a claim of my own: TUXBOX_SECTION_GUARD=1 makes the CPU views of a watched section-backed page read-only and catches the first store, so clean section pages skip the placement digest. About 150 lines in xmem, off by default. Testing it on the 3080 Ti; I've asked on #472 whether DrArroway wants it as a PR, folded into #550, or dropped.

Not working on: stage-aware loop guards (@glovepost, #522/#549). I've only used raster loop caps in local runs.

I'll comment here when I stop or hand anything over.

<!-- greyfinch-sync:brcly/TuxBox:comment:7272598453 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7272598453). Originally posted by [ReverendOzmund](https://github.com/ReverendOzmund) on 2026-11-30T08:11:44Z. --- Working on (ReverendOzmund, RTX 3080 Ti, NVIDIA 620.73.04, GE-Proton11-14, Bazzite): **NVIDIA test runs of ProjectScarlett** for open PRs that need a second card: - #390 (mesh index map, Nick's rebase f172e33): running now, reporting whether the VS 281b4977 / PS 96e8aaaa distant-lights fault changes. - Already reported: #501 private views (#472), #564 stack size (8ae931bd 210 s), #567 stale images (no stale descriptor at the loss, #232). **Experiment inside @DrArroway's XMem claim (#472), not a claim of my own:** TUXBOX_SECTION_GUARD=1 makes the CPU views of a watched section-backed page read-only and catches the first store, so clean section pages skip the placement digest. About 150 lines in xmem, off by default. Testing it on the 3080 Ti; I've asked on #472 whether DrArroway wants it as a PR, folded into #550, or dropped. **Not working on:** stage-aware loop guards (@glovepost, #522/#549). I've only used raster loop caps in local runs. I'll comment here when I stop or hand anything over.
3kynox commented 2026-11-30 09:26:36 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-11-30T09:26:36Z.


@brcly could you update two lines of the table? @NickStallman and I agreed the split on #382 last night, and he asked for the same change there:

  • Node buffer and its places: from Nick to me, with the static bottom-level structures (#536) and the wiring to the builds and the walk dispatches.
  • Dynamic bottom-level structures: from open to me.

Nick keeps the top-level encoder (#525); the wiring calls it once #525 is in and carries a provisional one until then.

It comes as three PRs: #536 (the expansion; its rebase onto main is ready and goes up next), the buffer, then the wiring as a draft stacked on those two. The wiring is about 2,000 lines, most of it new files and tests; if that is too much for one review I can split it into the build side and the dispatch side. All of it is behind TUXBOX_CONSOLE_STRUCTURES=1, off by default.

@csj0oe on your question: #578 is yours. Nothing of mine accepts a walk that declares only its node buffer, and that line (Failed to remap SRV 901:0) is in none of the four ProjectScarlett logs I searched here either (RTX 4070 Ti SUPER). My wiring binds the buffer at the walk root's node slot and the block of scene offsets at the next one. On top of #578 it will bind the buffer alone for a node-only walk. The two touch the same lines of compute_scene.rs, so whichever lands second needs a small rebase; if it is mine I'll do it.

<!-- greyfinch-sync:brcly/TuxBox:comment:7274213708 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7274213708). Originally posted by [3kynox](https://github.com/3kynox) on 2026-11-30T09:26:36Z. --- @brcly could you update two lines of the table? @NickStallman and I agreed the split on #382 last night, and he asked for the same change there: - **Node buffer and its places:** from Nick to me, with the static bottom-level structures (#536) and the wiring to the builds and the walk dispatches. - **Dynamic bottom-level structures:** from open to me. Nick keeps the top-level encoder (#525); the wiring calls it once #525 is in and carries a provisional one until then. It comes as three PRs: #536 (the expansion; its rebase onto main is ready and goes up next), the buffer, then the wiring as a draft stacked on those two. The wiring is about 2,000 lines, most of it new files and tests; if that is too much for one review I can split it into the build side and the dispatch side. All of it is behind `TUXBOX_CONSOLE_STRUCTURES=1`, off by default. @csj0oe on your question: #578 is yours. Nothing of mine accepts a walk that declares only its node buffer, and that line (`Failed to remap SRV 901:0`) is in none of the four ProjectScarlett logs I searched here either (RTX 4070 Ti SUPER). My wiring binds the buffer at the walk root's node slot and the block of scene offsets at the next one. On top of #578 it will bind the buffer alone for a node-only walk. The two touch the same lines of `compute_scene.rs`, so whichever lands second needs a small rebase; if it is mine I'll do it.
Jerkin42 commented 2026-11-30 09:26:39 +00:00 (Migrated from github.com)
Author
Contributor

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


Taking the SQC device loss in the world (#472, #232): a guest resource-heap index that isn't clamped before the index-map load. Evidence and the diagnostic run are in my #472 comments. @NickStallman is checking it on an RTX 5090 with the diagnostic branch.

  • The fix: fix/heap-index-clamp (61580565, on e5d2e913).
    • Word 0 of the map holds count, still nonzero when paged.
    • One word after the last index holds what an unwritten index reads.
    • tb_heap_index clamps with min(i, n).
    • It's 10 lines plus a test change.
  • @brcly, the recompile: this changes the translated HLSL of every program that reads the index map, so all of those recompile (about 45 min of on-demand compiles on my machine). A runtime-only version is possible without it: pad the map to every 27-bit index. That costs 512 MiB of host memory, and it's the diagnostic that already ran clean for 23 min in the world on an RX 9060 XT. Which do you prefer? I'll hold the PR until you say. My run of the clamped version is in progress.

Next, inside focus 3 (TuxBox's own overhead), not claimed yet: once the world runs, the frame is limited by vkd3d's submit thread.

  • In perf, 93% of that thread is in RADV's per-submit buffer-list walk (radv_amdgpu_add_cs_array_to_bo_list, radv_amdgpu_winsys_cs_submit).
  • The cause is about 59,000 live buffers, most under 1 MiB, from guest-memory imports and their sparse wrappers.
  • I'm measuring how much merging imports into larger pieces gains before proposing anything. If someone already has this, say so and I'll leave it.
<!-- greyfinch-sync:brcly/TuxBox:comment:7274214730 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7274214730). Originally posted by [Jerkin42](https://github.com/Jerkin42) on 2026-11-30T09:26:39Z. --- Taking the **SQC device loss in the world** (#472, #232): a guest resource-heap index that isn't clamped before the index-map load. Evidence and the diagnostic run are in my #472 comments. @NickStallman is checking it on an RTX 5090 with the diagnostic branch. - **The fix:** [`fix/heap-index-clamp`](https://github.com/Jerkin42/TuxBox/tree/fix/heap-index-clamp) (61580565, on e5d2e913). - Word 0 of the map holds `count`, still nonzero when paged. - One word after the last index holds what an unwritten index reads. - `tb_heap_index` clamps with `min(i, n)`. - It's 10 lines plus a test change. - **@brcly, the recompile:** this changes the translated HLSL of every program that reads the index map, so all of those recompile (about 45 min of on-demand compiles on my machine). A runtime-only version is possible without it: pad the map to every 27-bit index. That costs 512 MiB of host memory, and it's the diagnostic that already ran clean for 23 min in the world on an RX 9060 XT. **Which do you prefer?** I'll hold the PR until you say. My run of the clamped version is in progress. **Next, inside focus 3 (TuxBox's own overhead), not claimed yet:** once the world runs, the frame is limited by vkd3d's submit thread. - In perf, 93% of that thread is in RADV's per-submit buffer-list walk (`radv_amdgpu_add_cs_array_to_bo_list`, `radv_amdgpu_winsys_cs_submit`). - The cause is about 59,000 live buffers, most under 1 MiB, from guest-memory imports and their sparse wrappers. - I'm measuring how much merging imports into larger pieces gains before proposing anything. If someone already has this, say so and I'll leave it.
snoozedDev commented 2026-11-30 10:36:03 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by snoozedDev on 2026-11-30T10:36:03Z.


I'd like to take BCPack decode speed in runtime/xcrdapi/codec, under focus 3.

Measured at 8ece312f (the codec is unchanged on main since) on the 57 texture stores of my own copy of ProjectScarlett 1.0.2.1, against bcpack-rs c23cf5c:

  • Output is right. All 108,337 BC1, BC3, BC4, BC5 and BC7 chunks (15.5 GiB of blocks) decode to the same bytes as bcpack-rs, once the two codebook pairs gen_tables.py swaps (229/235, 247/248) are swapped there too. All 268 BC6H chunks decode without error; bcpack-rs has no BC6H rebuild to compare with.
  • It is slow. One pinned core of a Ryzen 7 7700X, MB/s of blocks out, every 150th chunk, best of three:
TuxBox bcpack-rs TuxBox lanes only bcpack-rs lanes only
BC1 38.1 101.1 43.8 153.6
BC5 36.2 110.2 40.1 160.7
BC7 20.4 46.9 25.8 91.3

The lane decoder is 87% of our BC1 time. lanes.rs was ported from bcpack-rs's clock-by-clock decode_lanes at 5bf5cc5; upstream added decode_lanes_fast after that (577bf3d, then c23cf5c).

Plan: port the fast lane decoder with the same attribution, keep the current one as the oracle in the tests, and show every retail chunk decodes to the same bytes before and after. It is about 400 to 500 lines, mostly a new file, in one PR. Say if you'd rather have it another way, or not at all.

Not measured: how many BCPack bytes a play session decodes. I have not run the game with this. If someone has TUXBOX_XCRD_LOG=1 totals from a run, they would say how much this matters in play.

This contribution was written by an AI agent (Claude Opus 5.5) operating under my supervision. I am accountable for it and will respond to review.

<!-- greyfinch-sync:brcly/TuxBox:comment:7275823240 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7275823240). Originally posted by [snoozedDev](https://github.com/snoozedDev) on 2026-11-30T10:36:03Z. --- I'd like to take BCPack decode speed in `runtime/xcrdapi/codec`, under focus 3. Measured at 8ece312f (the codec is unchanged on main since) on the 57 texture stores of my own copy of ProjectScarlett 1.0.2.1, against bcpack-rs c23cf5c: - Output is right. All 108,337 BC1, BC3, BC4, BC5 and BC7 chunks (15.5 GiB of blocks) decode to the same bytes as bcpack-rs, once the two codebook pairs `gen_tables.py` swaps (229/235, 247/248) are swapped there too. All 268 BC6H chunks decode without error; bcpack-rs has no BC6H rebuild to compare with. - It is slow. One pinned core of a Ryzen 7 7700X, MB/s of blocks out, every 150th chunk, best of three: | | TuxBox | bcpack-rs | TuxBox lanes only | bcpack-rs lanes only | |---|---|---|---|---| | BC1 | 38.1 | 101.1 | 43.8 | 153.6 | | BC5 | 36.2 | 110.2 | 40.1 | 160.7 | | BC7 | 20.4 | 46.9 | 25.8 | 91.3 | The lane decoder is 87% of our BC1 time. `lanes.rs` was ported from bcpack-rs's clock-by-clock `decode_lanes` at 5bf5cc5; upstream added `decode_lanes_fast` after that (577bf3d, then c23cf5c). Plan: port the fast lane decoder with the same attribution, keep the current one as the oracle in the tests, and show every retail chunk decodes to the same bytes before and after. It is about 400 to 500 lines, mostly a new file, in one PR. Say if you'd rather have it another way, or not at all. Not measured: how many BCPack bytes a play session decodes. I have not run the game with this. If someone has `TUXBOX_XCRD_LOG=1` totals from a run, they would say how much this matters in play. This contribution was written by an AI agent (Claude Opus 5.5) operating under my supervision. I am accountable for it and will respond to review.
ReverendOzmund commented 2026-11-30 10:54:36 +00:00 (Migrated from github.com)
Author
Contributor

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


New: proposed waiting for a stand-in's compile at its first bind instead of skipping its dispatches (#587). I have an opt-in prototype (TUXBOX_LATE_BIND_WAIT) and will test it on the RTX 3080 Ti, but I won't open a PR until it's agreed in #587.

<!-- greyfinch-sync:brcly/TuxBox:comment:7276253434 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7276253434). Originally posted by [ReverendOzmund](https://github.com/ReverendOzmund) on 2026-11-30T10:54:36Z. --- New: proposed waiting for a stand-in's compile at its first bind instead of skipping its dispatches (#587). I have an opt-in prototype (TUXBOX_LATE_BIND_WAIT) and will test it on the RTX 3080 Ti, but I won't open a PR until it's agreed in #587.
brcly commented 2026-11-30 11:37:32 +00:00 (Migrated from github.com)
Author
Contributor

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


@snoozedDev yes, please go ahead, as you describe:

  • port the fast lane decoder with the same attribution (bcpack-rs is MIT/Apache-2.0, which fits);
  • keep the current decoder as the oracle in the tests;
  • show that every retail chunk decodes to the same bytes before and after (keep no retail data in the repository, only the counts and hashes).

One addition: please give the PR a measurement of how much this matters in play. A run with TUXBOX_XCRD_LOG=1 gives the totals per option word every five seconds. Report the bytes decoded and the time spent from device creation to the world, before and after. If you can't run the game, say so in the PR, and one of us will do that run.

<!-- greyfinch-sync:brcly/TuxBox:comment:7277289631 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7277289631). Originally posted by [brcly](https://github.com/brcly) on 2026-11-30T11:37:32Z. --- @snoozedDev yes, please go ahead, as you describe: - port the fast lane decoder with the same attribution (bcpack-rs is MIT/Apache-2.0, which fits); - keep the current decoder as the oracle in the tests; - show that every retail chunk decodes to the same bytes before and after (keep no retail data in the repository, only the counts and hashes). One addition: please give the PR a measurement of how much this matters in play. A run with `TUXBOX_XCRD_LOG=1` gives the totals per option word every five seconds. Report the bytes decoded and the time spent from device creation to the world, before and after. If you can't run the game, say so in the PR, and one of us will do that run.
Jerkin42 commented 2026-11-30 12:45:20 +00:00 (Migrated from github.com)
Author
Contributor

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


Focus 3: opened #590, an opt-in TUXBOX_CHECK_ONCE_PER_FRAME that checks placed textures which keep coming back unchanged once per frame instead of before every batch. Runtime only, no HLSL change. On the RX 9060 XT, ProjectScarlett in the world: digest went from about 16.5 s to about 1 s per minute, placement from about 1.1 s to 0.5 s per frame, fps up about 10% (0.27 to 0.30). The rest of the frame is mostly memory-wait holds. The heap-index clamp PR is still held for your call on the clamp vs the padding.

<!-- greyfinch-sync:brcly/TuxBox:comment:7278877125 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7278877125). Originally posted by [Jerkin42](https://github.com/Jerkin42) on 2026-11-30T12:45:20Z. --- Focus 3: opened #590, an opt-in `TUXBOX_CHECK_ONCE_PER_FRAME` that checks placed textures which keep coming back unchanged once per frame instead of before every batch. Runtime only, no HLSL change. On the RX 9060 XT, ProjectScarlett in the world: digest went from about 16.5 s to about 1 s per minute, placement from about 1.1 s to 0.5 s per frame, fps up about 10% (0.27 to 0.30). The rest of the frame is mostly memory-wait holds. The heap-index clamp PR is still held for your call on the clamp vs the padding.
gtb-sbe commented 2026-11-30 12:46:01 +00:00 (Migrated from github.com)
Author
Contributor

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


I'd like to take the title watchdog end with compute label waits nobody writes: the exe+0x23CF683 ending with Unsignaled CrossQueueBarrier in the title's crash log. @JeffreyBytes hit it on #292, and @brcly suggested looking at it there.

What I have (one run, RX 9060 XT, f482572a + #557 + #389, private views, 16 MiB kernel stack): it ended after 700 s at game time 3:00, with 29.0 s since the last heartbeat. For those 30 s the title's submitting thread wasn't inside ExecuteCommandLists at all. Meanwhile eight compute-queue waits on labels at 0x518f9..-0x518fb.. were held, and each was released after 5 s without reaching its target. Seven of the labels had no submitted or rejected list writes it; the eighth (0x518fa78 >= 0x1dad) had a direct list that writes it, already submitted, and the wait still didn't see the value. The texture_readback worker fence stalled too. My guess is that the title thread waits on work behind those labels whose writer it hasn't submitted yet, but I haven't tested that.

Plan: find what the title thread is blocked on during the stall (the minidump's stacks first, then a diagnostic on current main that lists held waits beside recorded writers that haven't been submitted), then a Lanes scenario if the cause is on our side. Diagnostics only until then. @ReverendOzmund's NVIDIA run on #472 looks like the same state; I've answered him there.

<!-- greyfinch-sync:brcly/TuxBox:comment:7278893315 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7278893315). Originally posted by [gtb-sbe](https://github.com/gtb-sbe) on 2026-11-30T12:46:01Z. --- I'd like to take the **title watchdog end with compute label waits nobody writes**: the `exe+0x23CF683` ending with `Unsignaled CrossQueueBarrier` in the title's crash log. @JeffreyBytes hit it on #292, and @brcly suggested looking at it there. **What I have (one run, RX 9060 XT, `f482572a` + #557 + #389, private views, 16 MiB kernel stack):** it ended after 700 s at game time 3:00, with 29.0 s since the last heartbeat. For those 30 s the title's submitting thread wasn't inside `ExecuteCommandLists` at all. Meanwhile eight compute-queue waits on labels at `0x518f9..`-`0x518fb..` were held, and each was released after 5 s without reaching its target. Seven of the labels had `no submitted or rejected list writes it`; the eighth (`0x518fa78 >= 0x1dad`) had a direct list that writes it, already submitted, and the wait still didn't see the value. The `texture_readback` worker fence stalled too. My guess is that the title thread waits on work behind those labels whose writer it hasn't submitted yet, but I haven't tested that. **Plan:** find what the title thread is blocked on during the stall (the minidump's stacks first, then a diagnostic on current `main` that lists held waits beside recorded writers that haven't been submitted), then a Lanes scenario if the cause is on our side. Diagnostics only until then. @ReverendOzmund's NVIDIA run on #472 looks like the same state; I've answered him there.
gtb-sbe commented 2026-11-30 13:41:48 +00:00 (Migrated from github.com)
Author
Contributor

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


Withdrawing my claim on the watchdog end above: it's the crash @NickStallman fixed in #566. A repeat run on my RX 9060 XT (same f482572a-based build, which doesn't have #566) ended the same way, and both logs have inline ray scene or geometry changed after recording, rejecting submission, then direct queue rejected a guest command-list batch (0x80070057); its later batches are dropped. The compute label waits with no writer were only the direct lists that never ran after that. I missed that line the first time. Sorry for the noise; I'll check whether main gets past it here and say so on #566 only if it doesn't.

<!-- greyfinch-sync:brcly/TuxBox:comment:7280220992 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7280220992). Originally posted by [gtb-sbe](https://github.com/gtb-sbe) on 2026-11-30T13:41:48Z. --- Withdrawing my claim on the watchdog end above: it's the crash @NickStallman fixed in #566. A repeat run on my RX 9060 XT (same `f482572a`-based build, which doesn't have #566) ended the same way, and both logs have `inline ray scene or geometry changed after recording, rejecting submission`, then `direct queue rejected a guest command-list batch (0x80070057); its later batches are dropped`. The compute label waits with no writer were only the direct lists that never ran after that. I missed that line the first time. Sorry for the noise; I'll check whether `main` gets past it here and say so on #566 only if it doesn't.
Jerkin42 commented 2026-11-30 14:23:31 +00:00 (Migrated from github.com)
Author
Contributor

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


Proposal (focus 1, a translator change, so asking before a PR): the black picture in ProjectScarlett is the FSR4 post pass.

  • The 1080p frame is written by CS 3727a000 (fsr4_model_v07_fp8_no_scale_postpass, FSPX config ending 0x12039c, 256x1x1).
  • main's translator refuses it: "unsupported FSPX compute register layout". So it's dispatched as a stand-in over 60x34 groups, and the frame stays zero.
  • Tone mapping and PS_CopyDithering then present that zero: I dumped the frame going into the copy, and it held only dither values (0–4 of 1023).
  • The change: a fspx/resolve.rs that routes this config through the prepass binding check.
    • It keeps the pass's plain per-lane load path and drops the whole-wave shared-load path that duplicates it.
    • The prepass check gains the scalar ops and branches the pass uses.
    • The guest LDS size comes from the FSPX config.
  • Tested on the RX 9060 XT, main e5d2e913 + #390/#572/#567 + the clamp: the first presented frames are lit (lit=0.919 against 0.000 on every run before), with sky, aircraft and silhouettes in the opening. Surfaces are still dark, which I take to be the ray-traced lighting passes that are still stand-ins.
  • About 250 lines, translator only.

@brcly OK to open it as a PR? Nobody else seems to be on FSR4 here; say if I missed someone.

<!-- greyfinch-sync:brcly/TuxBox:comment:7281299405 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7281299405). Originally posted by [Jerkin42](https://github.com/Jerkin42) on 2026-11-30T14:23:31Z. --- Proposal (focus 1, a translator change, so asking before a PR): **the black picture in ProjectScarlett is the FSR4 post pass.** - The 1080p frame is written by `CS 3727a000` (`fsr4_model_v07_fp8_no_scale_postpass`, FSPX config ending `0x12039c`, 256x1x1). - main's translator refuses it: "unsupported FSPX compute register layout". So it's dispatched as a stand-in over 60x34 groups, and the frame stays zero. - Tone mapping and `PS_CopyDithering` then present that zero: I dumped the frame going into the copy, and it held only dither values (0–4 of 1023). - **The change:** a `fspx/resolve.rs` that routes this config through the prepass binding check. - It keeps the pass's plain per-lane load path and drops the whole-wave shared-load path that duplicates it. - The prepass check gains the scalar ops and branches the pass uses. - The guest LDS size comes from the FSPX config. - **Tested** on the RX 9060 XT, main e5d2e913 + #390/#572/#567 + the clamp: the first presented frames are lit (`lit=0.919` against `0.000` on every run before), with sky, aircraft and silhouettes in the opening. Surfaces are still dark, which I take to be the ray-traced lighting passes that are still stand-ins. - About 250 lines, translator only. @brcly OK to open it as a PR? Nobody else seems to be on FSR4 here; say if I missed someone.
KainanP commented 2026-11-30 16:11:38 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by KainanP on 2026-11-30T16:11:38Z.


Small translator fix, focus 1: v_cvt_flr_i32_f32 and v_cvt_rpi_i32_f32 cast with an unsaturated (int), which is undefined in DXIL out of range; a constant source even fails DXC validation. #591, CPU-tested only; it needs someone to run the GPU translator checks.

<!-- greyfinch-sync:brcly/TuxBox:comment:7284266815 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7284266815). Originally posted by [KainanP](https://github.com/KainanP) on 2026-11-30T16:11:38Z. --- Small translator fix, focus 1: `v_cvt_flr_i32_f32` and `v_cvt_rpi_i32_f32` cast with an unsaturated `(int)`, which is undefined in DXIL out of range; a constant source even fails DXC validation. #591, CPU-tested only; it needs someone to run the GPU translator checks.
DrArroway commented 2026-11-30 17:59:16 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-30T17:59:16Z.


Claiming a Focus 1 (xshader) fix for unguarded inactive-lane and invalid-pointer loads on tb_bvh_heap (and vector pointer_words loads in general).

What we observed (RX 6900 XT, RADV_DEBUG=hang, ProjectScarlett 1.0.2.1 offline, 87298944 + #389/#589/#590, both section mode and TUXBOX_XMEM_PRIVATE_VIEWS=1):

  • Two separate RADV_DEBUG=hang captures faulted identically in compute shader 571d96cad08597a9.dxil (DISPATCH_INDIRECT, CLIENT_ID: TCP, RW: 0, PERMISSION_FAULTS: 3).
  • In the dumped SPIR-V (OpAccessChain into %tb_bvh_heap / descriptor set 103 binding 3 + OpLoad), an inactive lane ((exec_lo & 1u) == 0) retains a stale float in its address VGPR (e.g. -0.00829f = 0xbc07e000), adding ~3 GiB to tb_bvh_heap (0x800126b80000 -> 0x8001e2bfe000) well past the 64 KiB root SRV and triggering the GPUVM read fault before the result is discarded by OpSelect.
  • Checking tools/shader-compiler/src/hlsl:
    1. emitter/scalar_memory.rs (pointer_words, when !scalar) computes the byte offset and emits tb_bvh_heap.Load(...) / buffer .Load(...) unconditionally on all lanes, only guarding the destination write in wv(...).
    2. bvh_node.rs (emit) calls tb_bvh_intersect(...) unconditionally on all lanes (only guarding destination writes with wv), and tb_bvh_intersect issues nodes.Load4(...) before rejecting invalid node type values (type > 1u && type != 4u && type != 5u).

Plan: keep the PR focused to tools/shader-compiler + unit tests (descriptor_address.rs), mask/branch vector pointer_words and bvh_node::emit on (exec_lo & 1u), move the invalid-type early return above nodes.Load4 in tb_bvh_intersect, and verify with unit tests, --no-gpu, dual-GPU checks (RX 6900 XT + Raphael iGPU), and live ProjectScarlett runs.

<!-- greyfinch-sync:brcly/TuxBox:comment:7287144879 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7287144879). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-11-30T17:59:16Z. --- Claiming a Focus 1 (`xshader`) fix for **unguarded inactive-lane and invalid-pointer loads on `tb_bvh_heap` (and vector `pointer_words` loads in general)**. **What we observed (RX 6900 XT, `RADV_DEBUG=hang`, ProjectScarlett 1.0.2.1 offline, `87298944` + `#389`/`#589`/`#590`, both section mode and `TUXBOX_XMEM_PRIVATE_VIEWS=1`):** - Two separate `RADV_DEBUG=hang` captures faulted identically in compute shader `571d96cad08597a9.dxil` (`DISPATCH_INDIRECT`, `CLIENT_ID: TCP`, `RW: 0`, `PERMISSION_FAULTS: 3`). - In the dumped SPIR-V (`OpAccessChain` into `%tb_bvh_heap` / descriptor set 103 binding 3 + `OpLoad`), an inactive lane (`(exec_lo & 1u) == 0`) retains a stale float in its address VGPR (e.g. `-0.00829f` = `0xbc07e000`), adding ~3 GiB to `tb_bvh_heap` (`0x800126b80000` -> `0x8001e2bfe000`) well past the 64 KiB root SRV and triggering the GPUVM read fault before the result is discarded by `OpSelect`. - Checking `tools/shader-compiler/src/hlsl`: 1. `emitter/scalar_memory.rs` (`pointer_words`, when `!scalar`) computes the byte offset and emits `tb_bvh_heap.Load(...)` / buffer `.Load(...)` unconditionally on all lanes, only guarding the destination write in `wv(...)`. 2. `bvh_node.rs` (`emit`) calls `tb_bvh_intersect(...)` unconditionally on all lanes (only guarding destination writes with `wv`), and `tb_bvh_intersect` issues `nodes.Load4(...)` before rejecting invalid node `type` values (`type > 1u && type != 4u && type != 5u`). **Plan:** keep the PR focused to `tools/shader-compiler` + unit tests (`descriptor_address.rs`), mask/branch vector `pointer_words` and `bvh_node::emit` on `(exec_lo & 1u)`, move the invalid-`type` early return above `nodes.Load4` in `tb_bvh_intersect`, and verify with unit tests, `--no-gpu`, dual-GPU checks (RX 6900 XT + Raphael iGPU), and live ProjectScarlett runs.
1093i3511 commented 2026-11-30 18:26:49 +00:00 (Migrated from github.com)
Author
Contributor

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


@DrArroway this matches the fault that ends every run on my RX 6600 (RDNA 2, 8 GB, 1002:73ff, RADV / Mesa 26.3.1, GE-Proton11-14, descriptor-bytes=64/16), so I'd like to test your branch as soon as it's up.

Same signature:

  • The faults come from the game's vkd3d_queue on ring 24.
  • Client TCP, PERMISSION_FAULTS 0x3, MAPPING_ERROR 0, RW 0, GCVM status 0x00701030.
  • It happens a few frames after the first mission is set.

Same address range: 8 runs today on e5d2e913 and 87298944, Series S and packaged, all faulted in 0x8001e5…–0x8001ed…, mostly the last pages below a 2 MiB boundary. Some of them: 0x8001e94ff000, 0x8001e99fd000, 0x8001e91ff000, 0x8001e7ffc000, 0x8001e9dfd000. One run that waited at the account picker faulted at 0x8002344b0000. Details are in my last comment on #472. Your 0x8001e2bfe000 fits that pattern.

What hasn't helped: @Jerkin42's index-map padding made no difference here (3 of 3 runs faulted with it, 3 of 3 without). That fits a different cause, such as the inactive-lane loads you found.

On #389: on an older base (fd636d09 + #501 + #389, private views), #389 removed this fault on this card in 3 of 3 runs. Your build had #389 and still faulted. Maybe the wider mapping only catches some of the stray addresses, and on this card they happened to land inside it.

I can run your branch on current main in Series S and packaged mode, with and without private views, and report the fault pages or how long it runs in the world.

<!-- greyfinch-sync:brcly/TuxBox:comment:7287861552 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7287861552). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-11-30T18:26:49Z. --- @DrArroway this matches the fault that ends every run on my RX 6600 (RDNA 2, 8 GB, `1002:73ff`, RADV / Mesa 26.3.1, GE-Proton11-14, `descriptor-bytes=64/16`), so I'd like to test your branch as soon as it's up. **Same signature:** - The faults come from the game's `vkd3d_queue` on ring 24. - Client TCP, `PERMISSION_FAULTS 0x3`, `MAPPING_ERROR 0`, `RW 0`, GCVM status `0x00701030`. - It happens a few frames after the first mission is set. **Same address range:** 8 runs today on `e5d2e913` and `87298944`, Series S and packaged, all faulted in `0x8001e5…`–`0x8001ed…`, mostly the last pages below a 2 MiB boundary. Some of them: `0x8001e94ff000`, `0x8001e99fd000`, `0x8001e91ff000`, `0x8001e7ffc000`, `0x8001e9dfd000`. One run that waited at the account picker faulted at `0x8002344b0000`. Details are in my last comment on #472. Your `0x8001e2bfe000` fits that pattern. **What hasn't helped:** @Jerkin42's index-map padding made no difference here (3 of 3 runs faulted with it, 3 of 3 without). That fits a different cause, such as the inactive-lane loads you found. **On #389:** on an older base (`fd636d09` + #501 + #389, private views), #389 removed this fault on this card in 3 of 3 runs. Your build had #389 and still faulted. Maybe the wider mapping only catches some of the stray addresses, and on this card they happened to land inside it. I can run your branch on current `main` in Series S and packaged mode, with and without private views, and report the fault pages or how long it runs in the world.
DrArroway commented 2026-11-30 19:02:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-30T19:02:44Z.


@1093i3511 The PR is up now: https://github.com/brcly/TuxBox/pull/594 (fix/xshader-bvh-inactive-lane-load on DrArroway/TuxBox, rebased on bbc26254).

Quick summary of our before/after runs on RX 6900 XT (RADV / GE-Proton11-14, TUXBOX_XMEM_PRIVATE_VIEWS=1 + #389/#589/#590):

  • Before (5/5 runs): all 5 runs hit TCP PERMISSION_FAULTS: 3 read faults in 0x8001e...–0x8001f... within 3–36 demo frames (571d96cad08597a9.dxil in 2/2 RADV_DEBUG=hang dumps).
  • After (2/3 runs had 0 GPUVM faults; 1/3 hit a separate VA range):
    • With RADV_DEBUG=hang: ran 1,036.8s (21,969 frames, 50+ 3D demo frames) with 0 GPUVM faults, exiting on the unrelated 6.09 GiB map_private_contiguous PrivateSpan alias fault (blocker=...).
    • Without RADV_DEBUG=hang (VKD3D_CONFIG=no_upload_hvv,breadcrumbs): 385.2s (9,616 frames, 49 3D demo frames) with 0 GPUVM faults, again hitting that same PrivateSpan alias fault; one earlier run hit a separate TCP read fault at 0x80033d962000 (sparse image region, not 0x8001...).

Interested to hear how it behaves on your RX 6600 (1002:73ff) in Series S / packaged and both memory modes!

<!-- greyfinch-sync:brcly/TuxBox:comment:7288757712 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7288757712). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-11-30T19:02:44Z. --- @1093i3511 The PR is up now: https://github.com/brcly/TuxBox/pull/594 (`fix/xshader-bvh-inactive-lane-load` on `DrArroway/TuxBox`, rebased on `bbc26254`). **Quick summary of our before/after runs on RX 6900 XT (RADV / GE-Proton11-14, `TUXBOX_XMEM_PRIVATE_VIEWS=1` + `#389`/`#589`/`#590`):** - **Before (5/5 runs):** all 5 runs hit `TCP PERMISSION_FAULTS: 3` read faults in `0x8001e...`–`0x8001f...` within 3–36 demo frames (`571d96cad08597a9.dxil` in 2/2 `RADV_DEBUG=hang` dumps). - **After (2/3 runs had 0 GPUVM faults; 1/3 hit a separate VA range):** - With `RADV_DEBUG=hang`: ran **1,036.8s (21,969 frames, 50+ 3D demo frames)** with **0 GPUVM faults**, exiting on the unrelated 6.09 GiB `map_private_contiguous` `PrivateSpan` alias fault (`blocker=...`). - Without `RADV_DEBUG=hang` (`VKD3D_CONFIG=no_upload_hvv,breadcrumbs`): **385.2s (9,616 frames, 49 3D demo frames)** with **0 GPUVM faults**, again hitting that same `PrivateSpan` alias fault; one earlier run hit a separate `TCP` read fault at `0x80033d962000` (sparse image region, not `0x8001...`). Interested to hear how it behaves on your RX 6600 (`1002:73ff`) in Series S / packaged and both memory modes!
DrArroway commented 2026-11-30 19:12:46 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-30T19:12:46Z.


Claiming the #501 follow-up in runtime/xmem (physical_pages/private_views.rs): chunking map_private_contiguous at PRIVATE_SPAN_CHUNK (4 MiB) and adding multi-span fast-path support to unmap_private_view_range.

Why: In live ProjectScarlett runs with TUXBOX_XMEM_PRIVATE_VIEWS=1 on top of #594 (0 GPUVM faults after 1,036.8s / RADV_DEBUG=hang and 385.2s / 49 3D demo frames with breadcrumbs), runs consistently hit:
secondary alias ... fault not promoted (err=170, write=true, ..., blocker=<va>@0xf00200000..0x1085e00000(page_imp=false,span_imp=true,span_held=true,def=0))

0xf00200000..0x1085e00000 (99,776 pages, 6.09 GiB) is the contiguous Xbox GPU page pool mapped in a single map_private_contiguous call without splitting at PRIVATE_SPAN_CHUNK (4 MiB), so one GPU import hold anywhere inside that 6.09 GiB pool locks the entire PrivateSpan and blocks secondary-alias write promotion on unrelated pages (page_imp=false, span_imp=true).

Plan:

  • Split multi-chunk map_private_contiguous mappings at PRIVATE_SPAN_CHUNK boundaries with full atomic rollback and preserve Ok(false) fallback for plain VirtualAlloc reservations.
  • Update unmap_private_view_range to unmap contiguous ranges spanning multiple 4 MiB PrivateSpans cleanly.
  • Add unit tests covering multi-chunk mapping/unmapping, cross-boundary BackingRun splitting, and independent promotion of an unheld chunk while another chunk holds a GPU import pin, then verify live + dual-GPU before opening the PR.
<!-- greyfinch-sync:brcly/TuxBox:comment:7289022443 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7289022443). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-11-30T19:12:46Z. --- Claiming the `#501` follow-up in `runtime/xmem` (`physical_pages/private_views.rs`): chunking `map_private_contiguous` at `PRIVATE_SPAN_CHUNK` (4 MiB) and adding multi-span fast-path support to `unmap_private_view_range`. **Why:** In live ProjectScarlett runs with `TUXBOX_XMEM_PRIVATE_VIEWS=1` on top of `#594` (0 GPUVM faults after 1,036.8s / `RADV_DEBUG=hang` and 385.2s / 49 3D demo frames with `breadcrumbs`), runs consistently hit: `secondary alias ... fault not promoted (err=170, write=true, ..., blocker=<va>@0xf00200000..0x1085e00000(page_imp=false,span_imp=true,span_held=true,def=0))` `0xf00200000..0x1085e00000` (99,776 pages, 6.09 GiB) is the contiguous Xbox GPU page pool mapped in a single `map_private_contiguous` call without splitting at `PRIVATE_SPAN_CHUNK` (4 MiB), so one GPU import hold anywhere inside that 6.09 GiB pool locks the entire `PrivateSpan` and blocks secondary-alias write promotion on unrelated pages (`page_imp=false, span_imp=true`). **Plan:** - Split multi-chunk `map_private_contiguous` mappings at `PRIVATE_SPAN_CHUNK` boundaries with full atomic rollback and preserve `Ok(false)` fallback for plain `VirtualAlloc` reservations. - Update `unmap_private_view_range` to unmap contiguous ranges spanning multiple 4 MiB `PrivateSpan`s cleanly. - Add unit tests covering multi-chunk mapping/unmapping, cross-boundary `BackingRun` splitting, and independent promotion of an unheld chunk while another chunk holds a GPU import pin, then verify live + dual-GPU before opening the PR.
3kynox commented 2026-11-30 19:22:23 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-11-30T19:22:23Z.


Status for the console BVH rows, to keep the table current:

  • Static bottom-level structures: #536, review comments answered.
  • Node buffer and its places: #586, review comments answered.
  • Wiring to the builds and the walk dispatches: #596, draft, stacked on those two and off by default. With the switch on, the runs on a2650681 still lose the GPU; the numbers are in this comment on #586. Next: the same runs on main, which has #594 and #595 since.
  • Dynamic bottom-level structures: no PR yet.
<!-- greyfinch-sync:brcly/TuxBox:comment:7289284736 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7289284736). Originally posted by [3kynox](https://github.com/3kynox) on 2026-11-30T19:22:23Z. --- Status for the console BVH rows, to keep the table current: - **Static bottom-level structures**: #536, review comments answered. - **Node buffer and its places**: #586, review comments answered. - **Wiring to the builds and the walk dispatches**: #596, draft, stacked on those two and off by default. With the switch on, the runs on `a2650681` still lose the GPU; the numbers are in [this comment on #586](https://github.com/brcly/TuxBox/pull/586#issuecomment-7289284084). Next: the same runs on main, which has #594 and #595 since. - **Dynamic bottom-level structures**: no PR yet.
NickStallman commented 2026-11-30 21:05:16 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T21:05:16Z.


@brcly @csj0oe a question before we build anything on the deferred material programs refused for "complete waves" (the family #542 was about; 13 pipelines in ProjectScarlett's failure table, and we think the flat surfaces are the main reason the picture is wrong). From reading the instruction streams:

  • The construct in the main ones is a guard that asks "does my quad have a helper lane?" (a per-lane flag summed over the quad with two quad_perm DPP moves), then picks between two versions of one coverage test: the pixel's own value, or the sum over the quad. On the console that branch is wave-wide: if any quad in the wave has a helper, every lane takes the own-value arm. Which quads share a wave is the console rasteriser's packing, so no host can reproduce it exactly.
  • The flag's compare can be proved uniform within the quad by a small integer abstract interpretation (the two sides differ by a form every quad permutation leaves alone). That is the part csj0oe said was missing.
  • With it, #542's admission runs both arms per quad. Every quad then gets a result the console itself produces for that quad under some packing: a quad with a helper takes the own-value arm in both, a complete quad takes the sum (on the console, unless it shares a wave with an incomplete one).

The question: is "a result the console can produce for that quad" good enough to admit, knowing it isn't bit-identical to a given console frame? If not, only the two programs where both arms are provably the same can come in, and the rest stay refused. We'd build on csj0oe's kept branch with credit; csj0oe, please say if you'd rather do it yourself.

<!-- greyfinch-sync:brcly/TuxBox:comment:7291896587 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7291896587). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T21:05:16Z. --- @brcly @csj0oe a question before we build anything on the deferred material programs refused for "complete waves" (the family #542 was about; 13 pipelines in ProjectScarlett's failure table, and we think the flat surfaces are the main reason the picture is wrong). From reading the instruction streams: - The construct in the main ones is a guard that asks "does my quad have a helper lane?" (a per-lane flag summed over the quad with two `quad_perm` DPP moves), then picks between two versions of one coverage test: the pixel's own value, or the sum over the quad. On the console that branch is wave-wide: if any quad in the wave has a helper, every lane takes the own-value arm. Which quads share a wave is the console rasteriser's packing, so no host can reproduce it exactly. - The flag's compare can be proved uniform **within the quad** by a small integer abstract interpretation (the two sides differ by a form every quad permutation leaves alone). That is the part csj0oe said was missing. - With it, #542's admission runs both arms per quad. Every quad then gets a result the console itself produces for that quad under some packing: a quad with a helper takes the own-value arm in both, a complete quad takes the sum (on the console, unless it shares a wave with an incomplete one). **The question:** is "a result the console can produce for that quad" good enough to admit, knowing it isn't bit-identical to a given console frame? If not, only the two programs where both arms are provably the same can come in, and the rest stay refused. We'd build on csj0oe's kept branch with credit; csj0oe, please say if you'd rather do it yourself.
DrArroway commented 2026-11-30 21:19:37 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-30T21:19:37Z.


Follow-up PR for the #501 xmem private-views follow-up claimed above is up at #600:

  • Chunked map_private_contiguous at PRIVATE_SPAN_CHUNK (4 MiB) boundaries with atomic rollback + multi-span unmap_private_view_range.
  • Added Pool::handoff_private_backing in secondary_alias_veh before read-only mirroring for both unheld PrivateView and (unheld or held) PrivateArena backings inside held 4 MiB spans (notifying backing_invalidation_callback when handing off a held PrivateArena).
  • Skipped eager dual-CPU promotion inside held/deferred spans and reset recycled aliases == 0 SharedSection tokens back to Unbacked under private-views mode.
  • Verified with dual-GPU tuxbox.py check on AMD Radeon RX 6900 XT (1002:73bf) (17 passed, 0 failed) and AMD Raphael Radeon 610M iGPU (1002:164e) (17 passed, 0 failed), tuxbox-xmem Windows unit tests (40 passed, 0 failed, 1 ignored), explicit TUXBOX_XMEM_PRIVATE_VIEWS=1 dual-GPU xmem + d3d12-buffer-import checks on both GPUs, and 3 live ProjectScarlett runs on RX 6900 XT (0 err=170, 0 XMemMapPhysicalPages failures, 0 GPUVM faults).
<!-- greyfinch-sync:brcly/TuxBox:comment:7292243310 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7292243310). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-11-30T21:19:37Z. --- Follow-up PR for the `#501` `xmem` private-views follow-up claimed above is up at #600: - Chunked `map_private_contiguous` at `PRIVATE_SPAN_CHUNK` (4 MiB) boundaries with atomic rollback + multi-span `unmap_private_view_range`. - Added `Pool::handoff_private_backing` in `secondary_alias_veh` before read-only mirroring for both unheld `PrivateView` and (unheld or held) `PrivateArena` backings inside held 4 MiB spans (notifying `backing_invalidation_callback` when handing off a held `PrivateArena`). - Skipped eager dual-CPU promotion inside held/deferred spans and reset recycled `aliases == 0` `SharedSection` tokens back to `Unbacked` under private-views mode. - Verified with dual-GPU `tuxbox.py check` on **AMD Radeon RX 6900 XT (1002:73bf)** (`17 passed, 0 failed`) and **AMD Raphael Radeon 610M iGPU (1002:164e)** (`17 passed, 0 failed`), `tuxbox-xmem` Windows unit tests (`40 passed, 0 failed, 1 ignored`), explicit `TUXBOX_XMEM_PRIVATE_VIEWS=1` dual-GPU `xmem` + `d3d12-buffer-import` checks on both GPUs, and 3 live ProjectScarlett runs on RX 6900 XT (`0` `err=170`, `0` `XMemMapPhysicalPages` failures, `0` GPUVM faults).
brcly commented 2026-11-30 21:25:02 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-30T21:25:02Z.


@NickStallman yes, admit it. A result the console can produce for that quad under some packing is the right standard here, since no host can reproduce the console rasteriser's packing anyway. Build on csj0oe's kept branch with credit, and include a GPU check that the both-arms result matches each arm's quad case.

@Jerkin42 yes, please open the FSR4 PR. Nobody else is on it.

<!-- greyfinch-sync:brcly/TuxBox:comment:7292371559 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7292371559). Originally posted by [brcly](https://github.com/brcly) on 2026-11-30T21:25:02Z. --- @NickStallman yes, admit it. A result the console can produce for that quad under some packing is the right standard here, since no host can reproduce the console rasteriser's packing anyway. Build on csj0oe's kept branch with credit, and include a GPU check that the both-arms result matches each arm's quad case. @Jerkin42 yes, please open the FSR4 PR. Nobody else is on it.
3kynox commented 2026-11-30 21:40:52 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-11-30T21:40:52Z.


Update on the console BVH rows. The wiring (#596, draft) is blocked on two things outside it, written here so nobody repeats the hunt:

  • #389. Without it, #596's runs end in the distant-lights draws (VS 281b4977 / PS 96e8aaaa) within three minutes, two runs of two. With it, never in those draws. It is open and conflicts with main; I have it ported cleanly onto 0b889d74 and can pass that to its author.
  • Main on this card. On 0b889d74 a run without the console structures lost the GPU after nine minutes of the world (one run, RTX 4070 Ti SUPER; a2650681 went 25 and 35 minutes). So I cannot measure the switch against main for now. The report is in the comment on #586.

One question is open for @brcly on #586: where the node buffer should live on a card that is already full. Until these move I am not starting the dynamic structures.

<!-- greyfinch-sync:brcly/TuxBox:comment:7292744398 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7292744398). Originally posted by [3kynox](https://github.com/3kynox) on 2026-11-30T21:40:52Z. --- Update on the console BVH rows. The wiring (#596, draft) is blocked on two things outside it, written here so nobody repeats the hunt: - **#389.** Without it, #596's runs end in the distant-lights draws (`VS 281b4977` / `PS 96e8aaaa`) within three minutes, two runs of two. With it, never in those draws. It is open and conflicts with main; I have it ported cleanly onto `0b889d74` and can pass that to its author. - **Main on this card.** On `0b889d74` a run without the console structures lost the GPU after nine minutes of the world (one run, RTX 4070 Ti SUPER; `a2650681` went 25 and 35 minutes). So I cannot measure the switch against main for now. The report is in [the comment on #586](https://github.com/brcly/TuxBox/pull/586#issuecomment-7291321187). One question is open for @brcly on #586: where the node buffer should live on a card that is already full. Until these move I am not starting the dynamic structures.
DrArroway commented 2026-11-30 21:53:31 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-30T21:53:31Z.


Claiming the ProjectScarlett 0x80000003 (EXCEPTION_BREAKPOINT) investigation on the streaming resource-placement worker (game_scarlett_master.exe + 0x4DA6315 and sibling +0x9DFC18, both under +0x2593E91), seen on both shared-section and TUXBOX_XMEM_PRIVATE_VIEWS=1 runs on AMD Radeon RX 6900 XT (1002:73bf).

What we found so far:

  • Across 5 +0x4DA6315 minidumps (datResource::PointerFixup), RSI is always chunk[0] + 0x08 (0x50000000 virtual chunk mapped in the 0x300000000..0x8ffff0000 XMem aperture) and [RSI] holds invalid non-0x50000000 bytes; a 6th run hit sibling +0x9DFC18 on the same placement worker checking chunk[0] = 0x377980000 (0x2c1f0 bytes) with hash values on the stack.
  • Instrumented runtime/xcrdapi on 40a69c3f (145,190 requests / ~11.1 GB decoded; 2 known BC6H TO_PAGES refusals logged at enqueue, failed=0, cancelled=0) and ruled out xcrdapi queue races: all 17 fiDeviceDirectStorage queues use manual=true (auto_submit=0), TO_PAGES changed submit->run = 0, TO_PAGES zero token at run = 0, zlib_continuation = 0, inflate_partial_file_chunk = 0, cancel_in_flight = 0.
  • Next: Running a crash-time forensics build capturing the exact corrupted bytes in chunk[0], live XMem token/backing state, recent XMem page/token history (write_pages, note_write, map, unmap, free, handoff), and any d3d12_xs publish_mip writes into low aperture space (< 0x10_0000_0000).
<!-- greyfinch-sync:brcly/TuxBox:comment:7293050568 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7293050568). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-11-30T21:53:31Z. --- Claiming the ProjectScarlett `0x80000003` (`EXCEPTION_BREAKPOINT`) investigation on the streaming resource-placement worker (`game_scarlett_master.exe + 0x4DA6315` and sibling `+0x9DFC18`, both under `+0x2593E91`), seen on both shared-section and `TUXBOX_XMEM_PRIVATE_VIEWS=1` runs on **AMD Radeon RX 6900 XT (1002:73bf)**. **What we found so far:** - Across 5 `+0x4DA6315` minidumps (`datResource::PointerFixup`), `RSI` is always `chunk[0] + 0x08` (`0x50000000` virtual chunk mapped in the `0x300000000..0x8ffff0000` XMem aperture) and `[RSI]` holds invalid non-`0x50000000` bytes; a 6th run hit sibling `+0x9DFC18` on the same placement worker checking `chunk[0] = 0x377980000` (`0x2c1f0` bytes) with hash values on the stack. - Instrumented `runtime/xcrdapi` on `40a69c3f` (145,190 requests / ~11.1 GB decoded; 2 known BC6H `TO_PAGES` refusals logged at enqueue, `failed=0`, `cancelled=0`) and ruled out `xcrdapi` queue races: all 17 `fiDeviceDirectStorage` queues use `manual=true` (`auto_submit=0`), `TO_PAGES changed submit->run = 0`, `TO_PAGES zero token at run = 0`, `zlib_continuation = 0`, `inflate_partial_file_chunk = 0`, `cancel_in_flight = 0`. - **Next:** Running a crash-time forensics build capturing the exact corrupted bytes in `chunk[0]`, live XMem token/backing state, recent XMem page/token history (`write_pages`, `note_write`, `map`, `unmap`, `free`, `handoff`), and any `d3d12_xs` `publish_mip` writes into low aperture space (`< 0x10_0000_0000`).
NickStallman commented 2026-11-30 22:19:46 +00:00 (Migrated from github.com)
Author
Contributor

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


@DrArroway one observation that may or may not connect with yours. On an RTX 5090 (GE-Proton11-15 and 11-14, main d00006b2 and e5d2e913 plus PRs) we get 63 failed BCPack requests in every run (61 BC1, 2 BC7, decode error 0x8007000d "Stalled"), always the same ones. They are to-pages requests with a destination of 4,096 bytes and a source of more than that (for example 8,449, 8,441 and 7,154 bytes). You report failed=0 on an RX 6900 XT, so it looks host-dependent.

Earlier we compared the decoder with bcpack-rs on 7,280 chunks and found it equal, so we think the request is short for the chunk the title asks for: the title reads a whole chunk into one page just past a small texture. Our guess (not shown) is a texture size the title was told by a TuxBox answer that differs by host; we have traced the sizes answered with 8,192 and 16,384 bytes at align=4096 (they look like small_texture's answers: 128×128 BC1, 256×32 BC3, 64×64 R8G8B8A8 and similar) and found none that is wrong by itself. We hadn't linked it to a crash, and I have no evidence it is one. If your corrupted chunk[0] is near the end of a mapped page range after such a request, the list of our failing file offsets is easy to give.

<!-- greyfinch-sync:brcly/TuxBox:comment:7293698475 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7293698475). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T22:19:46Z. --- @DrArroway one observation that may or may not connect with yours. On an RTX 5090 (GE-Proton11-15 and 11-14, main d00006b2 and e5d2e913 plus PRs) we get **63 failed BCPack requests in every run** (61 BC1, 2 BC7, decode error `0x8007000d` "Stalled"), always the same ones. They are `to-pages` requests with a destination of 4,096 bytes and a source of more than that (for example 8,449, 8,441 and 7,154 bytes). You report `failed=0` on an RX 6900 XT, so it looks host-dependent. Earlier we compared the decoder with bcpack-rs on 7,280 chunks and found it equal, so we think the request is short for the chunk the title asks for: the title reads a whole chunk into one page just past a small texture. Our guess (not shown) is a texture size the title was told by a TuxBox answer that differs by host; we have traced the sizes answered with 8,192 and 16,384 bytes at `align=4096` (they look like `small_texture`'s answers: 128×128 BC1, 256×32 BC3, 64×64 R8G8B8A8 and similar) and found none that is wrong by itself. We hadn't linked it to a crash, and I have no evidence it is one. If your corrupted `chunk[0]` is near the end of a mapped page range after such a request, the list of our failing file offsets is easy to give.
DrArroway commented 2026-11-30 22:42:14 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-11-30T22:42:14Z.


@NickStallman Thanks for flagging that! Across all our AMD Radeon RX 6900 XT (1002:73bf) runs (including the 395s xcrdapi trace with 4,967 BC1 and 536 BC7 to-pages requests), we had failed = 0 and refused = 0 across every request type (correction to my earlier post: the 2 BC6H requests on 40a69c3f also ran with refused = 0, failed = 0). So those 63 0x8007000d failures on RTX 5090 definitely look host-dependent — likely a driver/alignment difference around GetResourceAllocationInfo / small_texture() in runtime/d3d12/src/device/allocation.rs.

Good news on our side: our crash-time forensics run just caught the exact root cause of the 0x80000003 (+0x4DA6315) crash, and it is independent of xcrdapi/BCPack — it's an xmem split-brain bug in runtime/xmem/src/physical_pages/private_views.rs (map_private_page / map_private_contiguous):

  • When a physical token backed by a held PrivateArena (active in both SharedSection and TUXBOX_XMEM_PRIVATE_VIEWS=1 modes) is mapped into a held deferred PrivatePlaceholder slot (has_hold(at) == true), classify_private_slot returned SlotRole::SecondaryAlias.
  • mask_slot then evaluated to false because of !self.has_hold(at, at + PAGE), so map_private_page left the slot PAGE_READWRITE, skipped populate_page_bytes, and did not register it in secondary_aliases.
  • xcrdapi's acquire_physical_access wrote the freshly decompressed bytes into the PrivateArena, while the CPU read ancient stale bytes left at the mapped VA with no page fault — hitting datResource::PointerFixup 0x80000003 at +0x4DA6315.

Implementing and testing the fix now (also covering the sibling held-old_va SlotRole::Upgrade gap and a concurrent-fault race in secondary_alias_veh we caught during forensics).

<!-- greyfinch-sync:brcly/TuxBox:comment:7294195004 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7294195004). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-11-30T22:42:14Z. --- @NickStallman Thanks for flagging that! Across all our **AMD Radeon RX 6900 XT (1002:73bf)** runs (including the 395s `xcrdapi` trace with `4,967` BC1 and `536` BC7 `to-pages` requests), we had **`failed = 0` and `refused = 0`** across every request type (correction to my earlier post: the 2 BC6H requests on `40a69c3f` also ran with `refused = 0, failed = 0`). So those 63 `0x8007000d` failures on RTX 5090 definitely look host-dependent — likely a driver/alignment difference around `GetResourceAllocationInfo` / `small_texture()` in `runtime/d3d12/src/device/allocation.rs`. Good news on our side: our crash-time forensics run just caught the exact root cause of the `0x80000003` (`+0x4DA6315`) crash, and it is independent of `xcrdapi`/BCPack — it's an `xmem` split-brain bug in `runtime/xmem/src/physical_pages/private_views.rs` (`map_private_page` / `map_private_contiguous`): - When a physical token backed by a held `PrivateArena` (active in both `SharedSection` and `TUXBOX_XMEM_PRIVATE_VIEWS=1` modes) is mapped into a held deferred `PrivatePlaceholder` slot (`has_hold(at) == true`), `classify_private_slot` returned `SlotRole::SecondaryAlias`. - `mask_slot` then evaluated to `false` because of `!self.has_hold(at, at + PAGE)`, so `map_private_page` left the slot `PAGE_READWRITE`, skipped `populate_page_bytes`, and did not register it in `secondary_aliases`. - `xcrdapi`'s `acquire_physical_access` wrote the freshly decompressed bytes into the `PrivateArena`, while the CPU read ancient stale bytes left at the mapped VA with no page fault — hitting `datResource::PointerFixup` `0x80000003` at `+0x4DA6315`. Implementing and testing the fix now (also covering the sibling held-`old_va` `SlotRole::Upgrade` gap and a concurrent-fault race in `secondary_alias_veh` we caught during forensics).
DrArroway commented 2026-12-01 01:21:24 +00:00 (Migrated from github.com)
Author
Contributor

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


Update on the 0x80000003 (+0x4DA6315 / +0x9DFC18) streaming-placement crash under TUXBOX_XMEM_PRIVATE_VIEWS=1: opened #608 (https://github.com/brcly/TuxBox/pull/608).

Root cause confirmed & fixed in #608:

  • When mapping a physical page into a held deferred PrivatePlaceholder slot while its token already had a held PrivateArena or unheld PrivateView, classify_private_slot previously returned SlotRole::SecondaryAlias while mask_slot stayed false (leaving the slot PAGE_READWRITE without calling populate_page_bytes or inserting into secondary_aliases), causing silent split-brain reads against xcrdapi DMA writes into the PrivateArena.
  • Also handles the two companion coherence paths: invalidating held non-CPU PrivateViews on CPU upgrade and masking them once release_hold drops their last view_hold (mask_released_secondary_alias), plus retrying concurrent secondary_alias_veh faults when another thread has already removed fault_page from secondary_aliases with compatible committed protection.

Verification:

  • Dual-GPU tuxbox.py check (17 passed, 0 failed), explicit TUXBOX_XMEM_PRIVATE_VIEWS=1 xmem guest suite (12/12), synthetic D3D12 regression controls (5/5), and tuxbox-xmem Windows unit tests (44 passed, 0 failed) all passed on both AMD Radeon RX 6900 XT (1002:73bf) and AMD Raphael Radeon 610M iGPU (1002:164e).
  • 3 consecutive real-world ProjectScarlett runs (222.4s, 324.5s, 427.8s; 5/5 runs total) on AMD Radeon RX 6900 XT (1002:73bf) had 0 0x80000003 (+0x4DA6315 / +0x9DFC18) crashes, 0 err=170, and 0 unhandled 0xc0000005.
<!-- greyfinch-sync:brcly/TuxBox:comment:7297405211 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7297405211). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-12-01T01:21:24Z. --- Update on the `0x80000003` (`+0x4DA6315` / `+0x9DFC18`) streaming-placement crash under `TUXBOX_XMEM_PRIVATE_VIEWS=1`: opened #608 (https://github.com/brcly/TuxBox/pull/608). **Root cause confirmed & fixed in #608:** - When mapping a physical page into a held deferred `PrivatePlaceholder` slot while its token already had a held `PrivateArena` or unheld `PrivateView`, `classify_private_slot` previously returned `SlotRole::SecondaryAlias` while `mask_slot` stayed `false` (leaving the slot `PAGE_READWRITE` without calling `populate_page_bytes` or inserting into `secondary_aliases`), causing silent split-brain reads against `xcrdapi` DMA writes into the `PrivateArena`. - Also handles the two companion coherence paths: invalidating held non-CPU `PrivateView`s on CPU upgrade and masking them once `release_hold` drops their last `view_hold` (`mask_released_secondary_alias`), plus retrying concurrent `secondary_alias_veh` faults when another thread has already removed `fault_page` from `secondary_aliases` with compatible committed protection. **Verification:** - Dual-GPU `tuxbox.py check` (`17 passed, 0 failed`), explicit `TUXBOX_XMEM_PRIVATE_VIEWS=1` `xmem` guest suite (`12/12`), synthetic D3D12 regression controls (`5/5`), and `tuxbox-xmem` Windows unit tests (`44 passed, 0 failed`) all passed on both **AMD Radeon RX 6900 XT (1002:73bf)** and **AMD Raphael Radeon 610M iGPU (1002:164e)**. - 3 consecutive real-world ProjectScarlett runs (`222.4s`, `324.5s`, `427.8s`; `5/5` runs total) on **AMD Radeon RX 6900 XT (1002:73bf)** had **0** `0x80000003` (`+0x4DA6315` / `+0x9DFC18`) crashes, **0** `err=170`, and **0** unhandled `0xc0000005`.
s3rius commented 2026-12-01 03:07:58 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by s3rius on 2026-12-01T03:07:58Z.


I could load into the first mission, and audio plays. There were some drawing problems at the start because of lots of skipped draw calls. Wwhich was investigated and mostly fixed. The PR is https://github.com/brcly/TuxBox/pull/610. Few things are still missing:

  • skipped draw: descriptor table refresh
  • skipped compute dispatch: pipeline has no paged descriptor layout

I will continue on that tomorrow.

<!-- greyfinch-sync:brcly/TuxBox:comment:7299359539 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7299359539). Originally posted by [s3rius](https://github.com/s3rius) on 2026-12-01T03:07:58Z. --- I could load into the first mission, and audio plays. There were some drawing problems at the start because of lots of skipped draw calls. Wwhich was investigated and mostly fixed. The PR is https://github.com/brcly/TuxBox/pull/610. Few things are still missing: * skipped draw: descriptor table refresh * skipped compute dispatch: pipeline has no paged descriptor layout I will continue on that tomorrow.
s3rius commented 2026-12-01 03:17:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by s3rius on 2026-12-01T03:17:40Z.


Also, I just noticed that tests use GE-Proton11-14, but runtime uses GE-Proton11-15. And few hours ago GE-Proton11-16 was released. We can upgrade proton version to 11-16 and set this version in all places (tests included).

<!-- greyfinch-sync:brcly/TuxBox:comment:7299551793 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7299551793). Originally posted by [s3rius](https://github.com/s3rius) on 2026-12-01T03:17:40Z. --- Also, I just noticed that tests use GE-Proton11-14, but runtime uses GE-Proton11-15. And few hours ago [GE-Proton11-16](https://github.com/GloriousEggroll/proton-ge-custom/releases/tag/GE-Proton11-16) was released. We can upgrade proton version to 11-16 and set this version in all places (tests included).
brcly commented 2026-12-01 03:24:48 +00:00 (Migrated from github.com)
Author
Contributor

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


What stalls ProjectScarlett at the story intro (RTX 4070 Ti SUPER, 16 GB, GE-Proton11-15, main). Measured over several runs tonight. The order of events matters, because most of what we had been chasing turned out to be downstream of it.

  1. At the FBK_STRY000_INTRO prestream, the number of placed textures TuxBox backs with video memory jumps from about 3 GB to 8.6 GB within seconds (32,768 backed, of 40,281 reserved). With bindless, "first use" means that a texture's view is in a heap a shader could index, so the scene's whole texture set gets backed whether a frame samples it or not.
  2. The card fills (render heaps about 3.3 GB, plus the driver and the desktop). The log then shows video memory is nearly full: placed texture … put in system memory, reaching 3.3 GB in system memory.
  3. Within seconds, frames go from about 40–60 ms to 1–12 s. GPU queues sit on labels for seconds at a time. The title's crash log names an unsignalled CrossQueueBarrier, its watchdog fires, and one run also had Xid 109 (context-switch timeout).

Downstream, not causes (each one measured, then checked against the timeline):

  • The publication storm (2–3.7 GB per 5 s).
  • Placement at 600+ ms per frame.
  • Slow gpu_table calls under the arena's write lock.
  • Descriptor evictions.

All of these start after the spill. With frames lasting seconds, each frame simply covers far more GPU work. @NickStallman's 5090 slow phase (card at about 14 GB, 1.7–2.4 s frames) looks like the same thing.

What I plan to work on next (claiming it here): back and keep resident only the textures the GPU actually samples. The first step is a heap read bitmap, the mirror of the write bitmap: translated shaders mark the heap slots they sample, once per wave. That gives the real per-frame count. After that comes residency and eviction by last use under a VRAM budget, using the reserved images' tile mappings.

Also on main tonight, both opt-in: TUXBOX_XMEM_SECTION_WATCH (#573) and TUXBOX_LAZY_PUBLICATION. The latter publishes heap-written textures only when something touches their title memory. It cuts publication by about 80%, but it does not fix the stall, and it hasn't yet been checked on a device for correctness.

<!-- greyfinch-sync:brcly/TuxBox:comment:7299678708 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7299678708). Originally posted by [brcly](https://github.com/brcly) on 2026-12-01T03:24:48Z. --- **What stalls ProjectScarlett at the story intro (RTX 4070 Ti SUPER, 16 GB, GE-Proton11-15, main).** Measured over several runs tonight. The order of events matters, because most of what we had been chasing turned out to be downstream of it. 1. At the `FBK_STRY000_INTRO` prestream, the number of placed textures TuxBox backs with video memory jumps from about 3 GB to 8.6 GB within seconds (32,768 backed, of 40,281 reserved). With bindless, "first use" means that a texture's view is in a heap a shader could index, so the scene's whole texture set gets backed whether a frame samples it or not. 2. The card fills (render heaps about 3.3 GB, plus the driver and the desktop). The log then shows `video memory is nearly full: placed texture … put in system memory`, reaching 3.3 GB in system memory. 3. Within seconds, frames go from about 40–60 ms to 1–12 s. GPU queues sit on labels for seconds at a time. The title's crash log names an unsignalled `CrossQueueBarrier`, its watchdog fires, and one run also had Xid 109 (context-switch timeout). **Downstream, not causes** (each one measured, then checked against the timeline): - The publication storm (2–3.7 GB per 5 s). - Placement at 600+ ms per frame. - Slow `gpu_table` calls under the arena's write lock. - Descriptor evictions. All of these start *after* the spill. With frames lasting seconds, each frame simply covers far more GPU work. @NickStallman's 5090 slow phase (card at about 14 GB, 1.7–2.4 s frames) looks like the same thing. **What I plan to work on next** (claiming it here): back and keep resident only the textures the GPU actually samples. The first step is a heap *read* bitmap, the mirror of the write bitmap: translated shaders mark the heap slots they sample, once per wave. That gives the real per-frame count. After that comes residency and eviction by last use under a VRAM budget, using the reserved images' tile mappings. Also on main tonight, both opt-in: `TUXBOX_XMEM_SECTION_WATCH` (#573) and `TUXBOX_LAZY_PUBLICATION`. The latter publishes heap-written textures only when something touches their title memory. It cuts publication by about 80%, but it does not fix the stall, and it hasn't yet been checked on a device for correctness.
NickStallman commented 2026-12-01 03:49:32 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-01T03:49:32Z.


@brcly thanks, that's a careful timeline. Two things from the 5090, so the plan doesn't rest on us.

Our slow phase isn't the spill. Our integration builds on main 82109205 to b3873ec4, ProjectScarlett's world, 20-minute runs, 1.4–1.7 s a frame on a 5090 (32 GB):

  • video memory is nearly full / put in system memory: 0 lines in three runs. Ledgers at the end: card 13.8–14.0 of 27 GiB in use, textures 6.6 GiB on the card (24,200), 0 in system memory.
  • Placement is about 1.05 s of it, as a median after the first 300 s. A run without our tracing reads about the same (1,191 ms median frame, 995 ms placement, one run; with it 1,212 and 1,049). Edited: I first gave 1,142 and 1,010 as that run, but that one still had three of our diagnostics on. TUXBOX_CHECK_ONCE_PER_FRAME=1 takes placement to 386 ms a frame and the frame to 911 ms (one run each). With TUXBOX_XMEM_PRIVATE_VIEWS=1 (on our integration build with #608) the game stopped at the start of the world, with a GPU wait that never finished and no GPU error; the same build without it ran 20 minutes. One run each.
  • So here it is "every frame re-checks section-backed pages", not residency.

For the heap read bitmap, a picture finding that may be the same table. We can now read back the G-buffer (one run, RTX 5090). In the world, normals and material targets hold the real scene, but the colour target is exactly zero for the world's surfaces (walls, buildings, tables; 65% of the screen), while character skin and clothes are textured. In every run unmapped indices hold about 1,050,000 records of the title's 1,245,184-entry heap. #572's draft says why that could matter: the map gives an index a slot only when the API writes it, and a record the title copies there by ordinary stores at an index the API never wrote stays unmapped, so a shader reads the null view. Edited twice: I first downgraded this, because the first capture could save a target partway through a frame. A corrected capture (each copy read after its batch ran) now confirms it: in one frame the world's draws write colour exactly (0, 0, 0) with alpha 5 over 59% of the screen, with normals and material right. The same capture shows the light buffer nearly static between two frames (an older shot, mean level 10.69 to 10.67) while the surface buffers change, so there are at least two faults. I also haven't shown that's what those surfaces read. An experiment that maps those records is being written. If your read bitmap records reads of unmapped indices too, it would answer it directly; that would be worth a counter.

<!-- greyfinch-sync:brcly/TuxBox:comment:7300100877 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7300100877). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-01T03:49:32Z. --- @brcly thanks, that's a careful timeline. Two things from the 5090, so the plan doesn't rest on us. **Our slow phase isn't the spill.** Our integration builds on main 82109205 to b3873ec4, ProjectScarlett's world, 20-minute runs, 1.4–1.7 s a frame on a 5090 (32 GB): - `video memory is nearly full` / `put in system memory`: 0 lines in three runs. Ledgers at the end: card 13.8–14.0 of 27 GiB in use, textures 6.6 GiB on the card (24,200), **0 in system memory**. - Placement is about 1.05 s of it, as a median after the first 300 s. A run without our tracing reads about the same (1,191 ms median frame, 995 ms placement, one run; with it 1,212 and 1,049). Edited: I first gave 1,142 and 1,010 as that run, but that one still had three of our diagnostics on. `TUXBOX_CHECK_ONCE_PER_FRAME=1` takes placement to 386 ms a frame and the frame to 911 ms (one run each). With `TUXBOX_XMEM_PRIVATE_VIEWS=1` (on our integration build with #608) the game stopped at the start of the world, with a GPU wait that never finished and no GPU error; the same build without it ran 20 minutes. One run each. - So here it is "every frame re-checks section-backed pages", not residency. **For the heap read bitmap, a picture finding that may be the same table.** We can now read back the G-buffer (one run, RTX 5090). In the world, `normals` and material targets hold the real scene, but the colour target is **exactly zero for the world's surfaces** (walls, buildings, tables; 65% of the screen), while character skin and clothes are textured. In every run `unmapped indices hold` about 1,050,000 records of the title's 1,245,184-entry heap. #572's draft says why that could matter: the map gives an index a slot only when the API writes it, and a record the title copies there by ordinary stores at an index the API never wrote stays unmapped, so a shader reads the null view. **Edited twice:** I first downgraded this, because the first capture could save a target partway through a frame. A corrected capture (each copy read after its batch ran) now confirms it: in one frame the world's draws write colour exactly (0, 0, 0) with alpha 5 over 59% of the screen, with normals and material right. The same capture shows the light buffer nearly static between two frames (an older shot, mean level 10.69 to 10.67) while the surface buffers change, so there are at least two faults. **I also haven't shown that's what those surfaces read.** An experiment that maps those records is being written. If your read bitmap records reads of unmapped indices too, it would answer it directly; that would be worth a counter.
NickStallman commented 2026-12-01 11:04:25 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-01T11:04:25Z.


Claiming the mesh stages of #610's mapped root: #617 (draft) translates mesh and amplification stages with the resource index map appended, so under descriptor paging they no longer read heap indices as slots of the smaller visible heap. Lanes mesh-heap-read fails on main on both our cards and passes with the change on the AMD one; the full checks are still to run.

<!-- greyfinch-sync:brcly/TuxBox:comment:7309129597 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7309129597). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-01T11:04:25Z. --- Claiming the mesh stages of #610's mapped root: #617 (draft) translates mesh and amplification stages with the resource index map appended, so under descriptor paging they no longer read heap indices as slots of the smaller visible heap. Lanes `mesh-heap-read` fails on main on both our cards and passes with the change on the AMD one; the full checks are still to run.
NickStallman commented 2026-12-01 11:57:05 +00:00 (Migrated from github.com)
Author
Contributor

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


Claiming rooted compute constants as a follow-up to #611: #619 (draft, stacked on #611) places a compute program's root constants from its records, so constants behind three tables and a root SRV no longer read zero (81 recorded requests on each host). Lanes compute-root-constants fails on #611's head and passes with the change on our AMD card; the RTX 5090 run is still to come.

<!-- greyfinch-sync:brcly/TuxBox:comment:7310404977 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7310404977). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-01T11:57:05Z. --- Claiming rooted compute constants as a follow-up to #611: #619 (draft, stacked on #611) places a compute program's root constants from its records, so constants behind three tables and a root SRV no longer read zero (81 recorded requests on each host). Lanes `compute-root-constants` fails on #611's head and passes with the change on our AMD card; the RTX 5090 run is still to come.
NickStallman commented 2026-12-01 12:14:34 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-01T12:14:34Z.


Claiming a preparation count fix: #620 (draft). A request that compiles only through the stride-table retry was counted compiled when fresh and unsupported when cached, so the same build reported 1,193 or 1,452 unsupported depending on the cache. Launcher-side only; tests fail on main.

<!-- greyfinch-sync:brcly/TuxBox:comment:7310853163 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7310853163). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-01T12:14:34Z. --- Claiming a preparation count fix: #620 (draft). A request that compiles only through the stride-table retry was counted compiled when fresh and unsupported when cached, so the same build reported 1,193 or 1,452 unsupported depending on the cache. Launcher-side only; tests fail on main.
3kynox commented 2026-12-01 12:26:51 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-12-01T12:26:51Z.


Unstopable Nick :)

<!-- greyfinch-sync:brcly/TuxBox:comment:7311143980 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7311143980). Originally posted by [3kynox](https://github.com/3kynox) on 2026-12-01T12:26:51Z. --- Unstopable Nick :)
NickStallman commented 2026-12-01 14:57:10 +00:00 (Migrated from github.com)
Author
Contributor

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


Opened #622 after #618: the Series S trial cuts its network with the launcher's own offline wrapper instead of Bubblewrap, so the registry step works on hosts where a namespace can't be nested inside bwrap's (it failed there on every launch).

<!-- greyfinch-sync:brcly/TuxBox:comment:7315095851 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7315095851). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-01T14:57:10Z. --- Opened #622 after #618: the Series S trial cuts its network with the launcher's own offline wrapper instead of Bubblewrap, so the registry step works on hosts where a namespace can't be nested inside bwrap's (it failed there on every launch).
NickStallman commented 2026-12-01 15:08:56 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-01T15:08:56Z.


Claiming the entry-live reads through a destination: #624 (draft). Accumulators and partial writes read their destination, so a launch register first used that way kept its declared 0; in one title 1,385 pixel programs read the fragment position that way and got x = y = 0. Like #611 it changes many translations (mostly the entry-live comment line), so it waits for agreement here. AMD passes, and the control fails with the position at 0; the RTX 5090 is still to come.

<!-- greyfinch-sync:brcly/TuxBox:comment:7315425721 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7315425721). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-01T15:08:56Z. --- Claiming the entry-live reads through a destination: #624 (draft). Accumulators and partial writes read their destination, so a launch register first used that way kept its declared 0; in one title 1,385 pixel programs read the fragment position that way and got x = y = 0. Like #611 it changes many translations (mostly the entry-live comment line), so it waits for agreement here. AMD passes, and the control fails with the position at 0; the RTX 5090 is still to come.
brcly commented 2026-12-01 15:13:33 +00:00 (Migrated from github.com)
Author
Contributor

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


Main today (up to 61a64d31), and what changed for everyone.

At ProjectScarlett's story intro (RTX 4070 Ti SUPER, 16 GB) frames went from about 0.2-1 fps with the GPU 9-20% busy to about 2 fps with it 88% busy. The causes, measured with the submit profiler and a new lock counter:

  1. Descriptor table eviction held the arena's write lock about 4 s of every 5: each new table walked past the ~10,000 tables still pinned by GPU work. A full heap now evicts until 1/16 of it is free (738d082e, with a unit test that took 44.8 s before).
  2. Three settings are now on by default (e40d8052; each turns off with 0):
    • TUXBOX_READ_RESIDENCY: a bindless batch backs only the textures its programs read in the last 120 frames. Card memory at the intro stays at 7.3-8.7 GB instead of 13 GB plus spill. A texture no program has read yet reads zeros for one batch. It changes the roots of programs that index the heap, so they translate again.
    • TUXBOX_LAZY_PUBLICATION: now also covers bound render targets, and publishes at once a texture that shares a page with another image. Publication went from about 3 GB to 1.1 GB per 5 s.
    • TUXBOX_CHECK_ONCE_PER_FRAME (#590): digest time went from about 1.2 s to 0.2 s per 5 s. A CPU write between two batches of one frame is uploaded a frame late.
  3. The index map lookup is bounded (56627188): an index past the map now reads slot 0 instead of past the buffer. That was one cause of the Xid 13 at the prestream here; it didn't recur in two runs since.

The intro is now GPU-bound, with the time spread over many pipelines (none over ~9% of samples). TUXBOX_GPU_TIMING=1 from #532 is the next tool for that. New opt-in diagnostics are in docs/ENVIRONMENT.md: TUXBOX_LOCK_STATS, TUXBOX_STACK_SAMPLE, TUXBOX_STALL_DUMP, TUXBOX_GPU_SAMPLE, TUXBOX_REPLAY_TIMES.

Also merged today: #535, #549, #515, #522, #558, #519, #555 and #523 (rebased onto main), #613, #614-#616, #608, #617, #618. #523 and the translator changes mean one more full shader recompile.

If you report a result from now on, please say whether it is before or after e40d8052, since the defaults changed.

@s3rius on the Proton version: agreed, one version everywhere is better. A PR that sets it in one place, for the launcher and the checks, is welcome; the full check should pass on it on an NVIDIA and an AMD card before it switches.

Right now I'm targeting GE-Proton11-15; it uses the latest VKD3D, which includes major updates to things like DXIL-> SPIR-V compile time, which is a bottleneck on Proton-Experimental, but is not with GE-Proton11-5.

<!-- greyfinch-sync:brcly/TuxBox:comment:7315555136 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7315555136). Originally posted by [brcly](https://github.com/brcly) on 2026-12-01T15:13:33Z. --- **Main today (up to 61a64d31), and what changed for everyone.** At ProjectScarlett's story intro (RTX 4070 Ti SUPER, 16 GB) frames went from about 0.2-1 fps with the GPU 9-20% busy to about 2 fps with it 88% busy. The causes, measured with the submit profiler and a new lock counter: 1. **Descriptor table eviction** held the arena's write lock about 4 s of every 5: each new table walked past the ~10,000 tables still pinned by GPU work. A full heap now evicts until 1/16 of it is free (738d082e, with a unit test that took 44.8 s before). 2. **Three settings are now on by default** (e40d8052; each turns off with `0`): - `TUXBOX_READ_RESIDENCY`: a bindless batch backs only the textures its programs read in the last 120 frames. Card memory at the intro stays at 7.3-8.7 GB instead of 13 GB plus spill. A texture no program has read yet reads zeros for one batch. It changes the roots of programs that index the heap, so they translate again. - `TUXBOX_LAZY_PUBLICATION`: now also covers bound render targets, and publishes at once a texture that shares a page with another image. Publication went from about 3 GB to 1.1 GB per 5 s. - `TUXBOX_CHECK_ONCE_PER_FRAME` (#590): digest time went from about 1.2 s to 0.2 s per 5 s. A CPU write between two batches of one frame is uploaded a frame late. 3. **The index map lookup is bounded** (56627188): an index past the map now reads slot 0 instead of past the buffer. That was one cause of the Xid 13 at the prestream here; it didn't recur in two runs since. The intro is now GPU-bound, with the time spread over many pipelines (none over ~9% of samples). `TUXBOX_GPU_TIMING=1` from #532 is the next tool for that. New opt-in diagnostics are in `docs/ENVIRONMENT.md`: `TUXBOX_LOCK_STATS`, `TUXBOX_STACK_SAMPLE`, `TUXBOX_STALL_DUMP`, `TUXBOX_GPU_SAMPLE`, `TUXBOX_REPLAY_TIMES`. Also merged today: #535, #549, #515, #522, #558, #519, #555 and #523 (rebased onto main), #613, #614-#616, #608, #617, #618. #523 and the translator changes mean one more full shader recompile. If you report a result from now on, please say whether it is before or after e40d8052, since the defaults changed. @s3rius on the Proton version: agreed, one version everywhere is better. A PR that sets it in one place, for the launcher and the checks, is welcome; the full check should pass on it on an NVIDIA and an AMD card before it switches. Right now I'm targeting GE-Proton11-15; it uses the latest VKD3D, which includes major updates to things like DXIL-> SPIR-V compile time, which is a bottleneck on Proton-Experimental, but is not with GE-Proton11-5.
NickStallman commented 2026-12-01 16:05:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-01T16:05:42Z.


Claiming three small mesh fixes, filed together as drafts: #627 (the stride-table root builder handles a root whose parameter headers come last), #628 (a flat load's data field isn't a launch register read), and #629, stacked on #627 (mesh pipelines retry with the heap's stride table, as compute and vertex/pixel already do). Together they translate 5 refused impostor mesh requests in one title; nothing newly refused.

<!-- greyfinch-sync:brcly/TuxBox:comment:7317024863 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7317024863). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-01T16:05:42Z. --- Claiming three small mesh fixes, filed together as drafts: #627 (the stride-table root builder handles a root whose parameter headers come last), #628 (a flat load's data field isn't a launch register read), and #629, stacked on #627 (mesh pipelines retry with the heap's stride table, as compute and vertex/pixel already do). Together they translate 5 refused impostor mesh requests in one title; nothing newly refused.
1093i3511 commented 2026-12-01 16:09:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-12-01T16:09:29Z.


Status from the RX 6600 (8 GB, RDNA2), all on current main after e40d8052:

  • #625 (new, claimed): lazy publication gave back a page's protection from deferral time and undid a title's later VirtualProtect, which crashes Lanes texture-publication. The fix with a unit test is ready on a local branch; the PR follows a ProjectScarlett run with it.
  • #603: building fb17e160 now. Next is a default-settings Series S run, and RADV_DEBUG=hang with the binding history if it still faults.
  • #472: then one run with each opt-in alone, for the write fault.

Order: #603 defaults run, then the same run with the #625 fix as its comparison, then the #472 runs.

<!-- greyfinch-sync:brcly/TuxBox:comment:7317130502 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7317130502). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-12-01T16:09:29Z. --- Status from the RX 6600 (8 GB, RDNA2), all on current main after e40d8052: - **#625** (new, claimed): lazy publication gave back a page's protection from deferral time and undid a title's later `VirtualProtect`, which crashes Lanes `texture-publication`. The fix with a unit test is ready on a local branch; the PR follows a ProjectScarlett run with it. - **#603**: building fb17e160 now. Next is a default-settings Series S run, and `RADV_DEBUG=hang` with the binding history if it still faults. - **#472**: then one run with each opt-in alone, for the write fault. Order: #603 defaults run, then the same run with the #625 fix as its comparison, then the #472 runs.
NickStallman commented 2026-12-01 17:13:31 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-01T17:13:31Z.


Opened #630 (draft): the placed path refused a paired depth image that starts in UNORDERED_ACCESS with E_NOTIMPL, and ProjectScarlett asserts on it while loading (a 768x768 R16 cube). It now parks the depth surface in COPY_SOURCE, as the committed path already does since #519. A run on current main is going now; I'll take it out of draft once it gets past that point.

<!-- greyfinch-sync:brcly/TuxBox:comment:7318956917 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7318956917). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-01T17:13:31Z. --- Opened #630 (draft): the placed path refused a paired depth image that starts in UNORDERED_ACCESS with E_NOTIMPL, and ProjectScarlett asserts on it while loading (a 768x768 R16 cube). It now parks the depth surface in COPY_SOURCE, as the committed path already does since #519. A run on current main is going now; I'll take it out of draft once it gets past that point.
brcly commented 2026-12-01 17:45:33 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by brcly on 2026-12-01T17:45:33Z.


@NickStallman a quick check on your drafts before we go further: which of these are ready for review, and which are still in progress?

  • #611 and #619: root constants of rooted vertex, pixel and compute programs
  • #612: components, not elements, in a mesh's output budget
  • #624: launch registers an instruction reads through its destination
  • #627: the stride table on a root whose parameters run out
  • #628: a flat load's data field at launch
  • #629: the heap's stride table for mesh pipelines
  • #630: placing a single-plane paired depth image
  • #597, #620, #572: still drafts from before

Mark the ones you consider ready, or say here, and I'll review them in that order. No rush on the rest.

For context, main changed a lot today (summary above), including three translator fixes of ours for refused compute programs (6010fc88, 93324a2b, 218ee6ec, e50b77de) and #523's codegen rewrite, so a rebase may be needed.

<!-- greyfinch-sync:brcly/TuxBox:comment:7319804125 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7319804125). Originally posted by [brcly](https://github.com/brcly) on 2026-12-01T17:45:33Z. --- @NickStallman a quick check on your drafts before we go further: which of these are ready for review, and which are still in progress? - #611 and #619: root constants of rooted vertex, pixel and compute programs - #612: components, not elements, in a mesh's output budget - #624: launch registers an instruction reads through its destination - #627: the stride table on a root whose parameters run out - #628: a flat load's data field at launch - #629: the heap's stride table for mesh pipelines - #630: placing a single-plane paired depth image - #597, #620, #572: still drafts from before Mark the ones you consider ready, or say here, and I'll review them in that order. No rush on the rest. For context, main changed a lot today (summary above), including three translator fixes of ours for refused compute programs (6010fc88, 93324a2b, 218ee6ec, e50b77de) and #523's codegen rewrite, so a rebase may be needed.
NickStallman commented 2026-12-01 17:49:49 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-01T17:49:49Z.


Thanks. Ready for review now (marked), in this order:

  • #611 (root constants, vertex and pixel): both cards, Lanes control fails on main, re-surveyed and DXC/dxv-checked on fb17e160.
  • #612 (mesh output budget): both cards, including a case at the 32 KiB limit.
  • #624 (launch registers read through the destination): both cards, control fails on both, re-surveyed on 833e1217.
  • #620 (cached count of stride-retried requests): launcher only.
  • #627 and #628 (stride-table root order; flat-load data field): full checks pass on both cards; rebased since with the same survey results.

Still drafts:

  • #619 waits for its RTX 5090 run (AMD passes, control fails).
  • #629 is stacked on #627 and hasn't run in a title yet.
  • #630 (placed depth pair in UNORDERED_ACCESS) waits for a run that gets past the point where the title asserted.
  • #572 and #597 need a fresh GPU run on current main before I'd ask for review.

All of them merge cleanly on current main.

<!-- greyfinch-sync:brcly/TuxBox:comment:7319915064 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7319915064). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-01T17:49:49Z. --- Thanks. Ready for review now (marked), in this order: - #611 (root constants, vertex and pixel): both cards, Lanes control fails on main, re-surveyed and DXC/dxv-checked on fb17e160. - #612 (mesh output budget): both cards, including a case at the 32 KiB limit. - #624 (launch registers read through the destination): both cards, control fails on both, re-surveyed on 833e1217. - #620 (cached count of stride-retried requests): launcher only. - #627 and #628 (stride-table root order; flat-load data field): full checks pass on both cards; rebased since with the same survey results. Still drafts: - #619 waits for its RTX 5090 run (AMD passes, control fails). - #629 is stacked on #627 and hasn't run in a title yet. - #630 (placed depth pair in UNORDERED_ACCESS) waits for a run that gets past the point where the title asserted. - #572 and #597 need a fresh GPU run on current main before I'd ask for review. All of them merge cleanly on current main.
NickStallman commented 2026-12-01 17:57:43 +00:00 (Migrated from github.com)
Author
Contributor

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


Opened #632 (draft): read residency can't keep a texture read at a host heap index past the heap bitmaps (1,048,575). That happens where vkd3d-proton reports a 16,000,000-descriptor heap (descriptor heap extension with resizable BAR). The change gives such a heap no more host slots than the bitmaps name. Shown by a unit test that fails on main; no card here reports the large limit, so it isn't seen in a run. Full checks are running.

<!-- greyfinch-sync:brcly/TuxBox:comment:7320147050 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7320147050). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-01T17:57:43Z. --- Opened #632 (draft): read residency can't keep a texture read at a host heap index past the heap bitmaps (1,048,575). That happens where vkd3d-proton reports a 16,000,000-descriptor heap (descriptor heap extension with resizable BAR). The change gives such a heap no more host slots than the bitmaps name. Shown by a unit test that fails on main; no card here reports the large limit, so it isn't seen in a run. Full checks are running.
NickStallman commented 2026-12-01 18:09:10 +00:00 (Migrated from github.com)
Author
Contributor

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


Opened #633 (draft): compute programs now declare the console's group-memory size instead of the full 32 KiB, which limits how many groups an SM holds. 783 recorded programs change, only in that line; 8.7% faster on a latency-bound microbenchmark on an RTX 5090. Full checks on both cards are running.

<!-- greyfinch-sync:brcly/TuxBox:comment:7320485410 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7320485410). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-01T18:09:10Z. --- Opened #633 (draft): compute programs now declare the console's group-memory size instead of the full 32 KiB, which limits how many groups an SM holds. 783 recorded programs change, only in that line; 8.7% faster on a latency-bound microbenchmark on an RTX 5090. Full checks on both cards are running.
NickStallman commented 2026-12-01 18:57:21 +00:00 (Migrated from github.com)
Author
Contributor

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


Opened #636 (draft): each distinct SetSampleMaskX quad mask that has no desktop equivalent is now logged with a count, instead of only the first one per process. Logging only; checks on both cards are running.

<!-- greyfinch-sync:brcly/TuxBox:comment:7321879627 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7321879627). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-01T18:57:21Z. --- Opened #636 (draft): each distinct SetSampleMaskX quad mask that has no desktop equivalent is now logged with a count, instead of only the first one per process. Logging only; checks on both cards are running.
DrArroway commented 2026-12-01 19:42:50 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-12-01T19:42:50Z.


Claiming #634 (AMDGPU -EPERM (-1) CS rejection under default TUXBOX_LAZY_PUBLICATION): tracking live OpenExistingHeapFromAddress* userptr ranges against lazy::defer and releasing/publishing any overlapping deferred textures before opening a userptr heap (keeping Pages::protect/Pages::release untouched so it stays independent of #625).

<!-- greyfinch-sync:brcly/TuxBox:comment:7323283390 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7323283390). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-12-01T19:42:50Z. --- Claiming **#634** (AMDGPU `-EPERM (-1)` CS rejection under default `TUXBOX_LAZY_PUBLICATION`): tracking live `OpenExistingHeapFromAddress*` userptr ranges against `lazy::defer` and releasing/publishing any overlapping deferred textures before opening a userptr heap (keeping `Pages::protect`/`Pages::release` untouched so it stays independent of `#625`).
1093i3511 commented 2026-12-01 20:54:31 +00:00 (Migrated from github.com)
Author
Contributor

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


Evening update from the RX 6600 (8 GB, RDNA2), all after e40d8052. The plan from my last comment didn't survive contact:

  • #603: stock fb17e160 stopped at the slot 133 assert in Series S (#519, fixed by #630), so I ran fb17e160 with #519 reverted locally. Default lazy publication can't be used on RADV here (#634, now claimed by DrArroway), so every run has TUXBOX_LAZY_PUBLICATION=0. Results are on #603: the TCP read fault in three of four runs, Series S and packaged, 430 to 894 s.
  • #625: the fix is ready, but its game run needs lazy publication on, which hits #634 first. I'll wait for DrArroway's #634 fix and then run both together; the two fixes touch different parts of lazy.rs.
  • #472: not run yet.
<!-- greyfinch-sync:brcly/TuxBox:comment:7325454422 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7325454422). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-12-01T20:54:31Z. --- Evening update from the RX 6600 (8 GB, RDNA2), all after e40d8052. The plan from my last comment didn't survive contact: - **#603:** stock fb17e160 stopped at the slot 133 assert in Series S (#519, fixed by #630), so I ran fb17e160 with #519 reverted locally. Default lazy publication can't be used on RADV here (#634, now claimed by DrArroway), so every run has `TUXBOX_LAZY_PUBLICATION=0`. Results are on #603: the TCP read fault in three of four runs, Series S and packaged, 430 to 894 s. - **#625:** the fix is ready, but its game run needs lazy publication on, which hits #634 first. I'll wait for DrArroway's #634 fix and then run both together; the two fixes touch different parts of `lazy.rs`. - **#472:** not run yet.
NickStallman commented 2026-12-01 23:38:00 +00:00 (Migrated from github.com)
Author
Contributor

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


A measurement on 16a95a61 (single-pass descriptor waterfalls), in case it helps decide its scope.

It applies under resolve_wave32 only. Ordinary compute translations keep their loops. On upstream 066b6bbe, four ProjectScarlett skinning and hair compute programs that we had found expensive still translate with their waterfalls, in the ordinary form and with --wave32-host alike:

Program Descriptor waterfall loops NonUniformResourceIndex GPU time a frame (RTX 5090, earlier run)
00fed6ad 18 0 64 ms
25fa6dd2 1 0 14 ms
468ede4b 1 0 24 ms
f8a81289 1 0 23 ms

The loops have the shape your rule accepts: s_load_dwordx4/x8 from the heap, then only buffer loads and waits. Wave64 programs also have s_andn2_wrexec_b64/s_mov_b64.

A microbenchmark of the same loop shape ran about 25% faster single-pass, so that's the most it could give the 64 ms program.

Would widening the gate to ordinary compute translations be sound with your liveness rule, or is there a reason it's limited to the one-lane-per-thread forms? If it's wanted, we can do it as a follow-up with your GPU check.

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:comment:7329586388 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7329586388). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-01T23:38:00Z. --- A measurement on 16a95a61 (single-pass descriptor waterfalls), in case it helps decide its scope. It applies under `resolve_wave32` only. Ordinary compute translations keep their loops. On upstream `066b6bbe`, four ProjectScarlett skinning and hair compute programs that we had found expensive still translate with their waterfalls, in the ordinary form and with `--wave32-host` alike: | Program | Descriptor waterfall loops | `NonUniformResourceIndex` | GPU time a frame (RTX 5090, earlier run) | | --- | ---: | ---: | ---: | | `00fed6ad` | 18 | 0 | 64 ms | | `25fa6dd2` | 1 | 0 | 14 ms | | `468ede4b` | 1 | 0 | 24 ms | | `f8a81289` | 1 | 0 | 23 ms | The loops have the shape your rule accepts: `s_load_dwordx4`/`x8` from the heap, then only buffer loads and waits. Wave64 programs also have `s_andn2_wrexec_b64`/`s_mov_b64`. A microbenchmark of the same loop shape ran about 25% faster single-pass, so that's the most it could give the 64 ms program. Would widening the gate to ordinary compute translations be sound with your liveness rule, or is there a reason it's limited to the one-lane-per-thread forms? If it's wanted, we can do it as a follow-up with your GPU check. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
brcly commented 2026-12-01 23:45:22 +00:00 (Migrated from github.com)
Author
Contributor

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


@NickStallman thanks, that's a useful measurement, and 64 ms a frame on 00fed6ad is worth going after.

The gate is resolve_wave32 only because that's the one mode where I could be sure the read goes through the per-lane template. The rewrite removes the compare and the back branch from the instruction list, so a mode that handles v_readfirstlane_b32 itself would give every lane the first lane's index and nothing would refuse it. The liveness rule doesn't depend on the mode.

Widening it to the ordinary forms is sound where each host thread is one console lane and scalars are per-thread variables, with three conditions:

  • The wave64 forms: accept s_andn2_wrexec_b64 and the 64-bit EXEC save/restore. The "mask starts as EXEC" check has to look at both words.
  • Paired mode stays out: two lanes share a thread there, so a per-lane scalar can't exist. It never reaches this rewrite today, but please keep it that way.
  • Proof the template was used: after emission, refuse the translation if any marked read wasn't written by emit_own_lane_read, then retry without the rewrite. Lockstep, indexed-lane and lone-lane each handle first-lane reads their own way. A wrong guess there should cost a refusal, not a wrong result.

NonUniformResourceIndex already comes from the marked descriptor loads, so bind_heap needs nothing new. For the GPU check, please add cases to check_descriptor_waterfall.py in the forms you widen to (ordinary wave32, and wave64 on a wave64 host), with lanes outside EXEC and a key per lane, as the resolve cases have. A follow-up PR from you is welcome.

<!-- greyfinch-sync:brcly/TuxBox:comment:7329735252 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7329735252). Originally posted by [brcly](https://github.com/brcly) on 2026-12-01T23:45:22Z. --- @NickStallman thanks, that's a useful measurement, and 64 ms a frame on `00fed6ad` is worth going after. The gate is `resolve_wave32` only because that's the one mode where I could be sure the read goes through the per-lane template. The rewrite removes the compare and the back branch from the instruction list, so a mode that handles `v_readfirstlane_b32` itself would give every lane the first lane's index and nothing would refuse it. The liveness rule doesn't depend on the mode. Widening it to the ordinary forms is sound where each host thread is one console lane and scalars are per-thread variables, with three conditions: - **The wave64 forms:** accept `s_andn2_wrexec_b64` and the 64-bit EXEC save/restore. The "mask starts as EXEC" check has to look at both words. - **Paired mode stays out:** two lanes share a thread there, so a per-lane scalar can't exist. It never reaches this rewrite today, but please keep it that way. - **Proof the template was used:** after emission, refuse the translation if any marked read wasn't written by `emit_own_lane_read`, then retry without the rewrite. Lockstep, indexed-lane and lone-lane each handle first-lane reads their own way. A wrong guess there should cost a refusal, not a wrong result. `NonUniformResourceIndex` already comes from the marked descriptor loads, so `bind_heap` needs nothing new. For the GPU check, please add cases to `check_descriptor_waterfall.py` in the forms you widen to (ordinary wave32, and wave64 on a wave64 host), with lanes outside EXEC and a key per lane, as the resolve cases have. A follow-up PR from you is welcome.
DrArroway commented 2026-12-01 23:48:37 +00:00 (Migrated from github.com)
Author
Contributor

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


Closing out our #634 claim: PR #640 merged at 124b97e29efc24010df27ab2e2df0536d288b837 and #634 is closed.

Quick AMD boot-to-gameplay report for tracking:

  • Hardware / stack: AMD Radeon RX 6900 XT (1002:73bf), Mesa 26.3.1-5 (RADV), kernel 7.3.7-1-cachyos, GE-Proton11-15
  • Build / settings: cb4631ba (b279360a + #640), TUXBOX_LAZY_PUBLICATION=1, TUXBOX_TRACE_GPU_FAULT=1 (no TUXBOX_XMEM_PRIVATE_VIEWS)
  • Result: 1,733.9s (~28.9 min), 14,454 presents — cleanly passed intro and cinematic into playable prison gameplay with controller input; 0 -EPERM CS rejections, 64+ clean lazy-publication published on access VEH recoveries, and 0 MiB texture system spill (card 13,819 / 15,530 MiB). Eventually hit #603 (fault trace posted there).
<!-- greyfinch-sync:brcly/TuxBox:comment:7329799033 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7329799033). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-12-01T23:48:37Z. --- Closing out our **#634** claim: PR #640 merged at `124b97e29efc24010df27ab2e2df0536d288b837` and #634 is closed. Quick AMD boot-to-gameplay report for tracking: - **Hardware / stack:** `AMD Radeon RX 6900 XT (1002:73bf)`, Mesa `26.3.1-5` (RADV), kernel `7.3.7-1-cachyos`, `GE-Proton11-15` - **Build / settings:** `cb4631ba` (`b279360a` + #640), `TUXBOX_LAZY_PUBLICATION=1`, `TUXBOX_TRACE_GPU_FAULT=1` (no `TUXBOX_XMEM_PRIVATE_VIEWS`) - **Result:** `1,733.9s` (~28.9 min), `14,454` presents — cleanly passed intro and cinematic into playable prison gameplay with controller input; `0` `-EPERM` CS rejections, `64+` clean lazy-publication `published on access` VEH recoveries, and `0 MiB` texture system spill (`card 13,819 / 15,530 MiB`). Eventually hit **#603** (fault trace posted there).
Kayotic1337 commented 2026-12-02 01:20:30 +00:00 (Migrated from github.com)
Author
Contributor

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


Update on "GPU reads of destroyed placed textures" (#603):

  • Draft PR #646, a possible fix. Placed textures that a batch reaches through a descriptor heap were held only during placement::submit, so a title release could destroy one while that work was still on the GPU. The PR keeps them until the queue's fence passes the batch. On my RX 9070 XT, the TCP read fault came in all five runs without it (11–27 min). With it, one run went 43.7 min without it. That's one run, and NVIDIA is untested. Confirmation runs on other cards (@NickStallman, @DrArroway, @1093i3511) would help most. Details are in the PR and #603.
  • Separate fault found on the way: an SQC read of address 0 on the compute ring, from one dispatch, CS a8ffc289 (request 0edf3abb…). It ended that run. The same kind of fault ended an earlier run without the change, which had no trace. I haven't looked into it yet.

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:comment:7331586244 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7331586244). Originally posted by [Kayotic1337](https://github.com/Kayotic1337) on 2026-12-02T01:20:30Z. --- Update on "GPU reads of destroyed placed textures" (#603): - **Draft PR #646**, a possible fix. Placed textures that a batch reaches through a descriptor heap were held only during `placement::submit`, so a title release could destroy one while that work was still on the GPU. The PR keeps them until the queue's fence passes the batch. On my RX 9070 XT, the TCP read fault came in all five runs without it (11–27 min). With it, one run went 43.7 min without it. That's one run, and NVIDIA is untested. Confirmation runs on other cards (@NickStallman, @DrArroway, @1093i3511) would help most. Details are in the PR and #603. - **Separate fault found on the way:** an SQC read of address 0 on the compute ring, from one dispatch, `CS a8ffc289` (request `0edf3abb…`). It ended that run. The same kind of fault ended an earlier run without the change, which had no trace. I haven't looked into it yet. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1093i3511 commented 2026-12-02 06:45:57 +00:00 (Migrated from github.com)
Author
Contributor

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


Update for our rows (after e40d8052, RX 6600, Series S):

  • #625: fix is up as #647, on main 3e2839b1 (includes #640). Lanes 31/31 with lazy publication on.
  • #603: main 3e2839b1 with defaults reached the world and hit the TCP read fault again after 446 s (ring reset succeeded).
  • #472: not run yet.
<!-- greyfinch-sync:brcly/TuxBox:comment:7337382899 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7337382899). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-12-02T06:45:57Z. --- Update for our rows (after e40d8052, RX 6600, Series S): - #625: fix is up as #647, on main 3e2839b1 (includes #640). Lanes 31/31 with lazy publication on. - #603: main 3e2839b1 with defaults reached the world and hit the TCP read fault again after 446 s (ring reset succeeded). - #472: not run yet.
revonateB0T commented 2026-12-02 09:14:08 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by revonateB0T on 2026-12-02T09:14:08Z.


https://github.com/brcly/TuxBox/issues/649 Working on UMA Host memory optimization.

<!-- greyfinch-sync:brcly/TuxBox:comment:7340580780 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7340580780). Originally posted by [revonateB0T](https://github.com/revonateB0T) on 2026-12-02T09:14:08Z. --- https://github.com/brcly/TuxBox/issues/649 Working on UMA Host memory optimization.
NickStallman commented 2026-12-02 11:08:07 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-02T11:08:07Z.


A regression report: since 9c3cf86f ("Correcting D3D12 and XMem Behaviour"), ProjectScarlett exits with code 5 at the title/menu on an RTX 5090 (620.70.10, GE-Proton11-15, default settings, warm caches). The title's crash handler fires, and there is no GPU error.

Bisect, one run per commit, which is enough because the failure is deterministic: 6d4f1cd7 ran 5 minutes clean. 9c3cf86f, 8f5bb16c, 68f5a433, d2985fb3 and 1ce50737 each exited at 77–81 s.

First failure: a CBV at an address nothing resolves. The fatal access violation is a NULL dereference in vkd3d-proton's d3d12_desc_create_cbv, called from CreateConstantBufferView in views/mirrors.rs (cbv()).

  • buffer_at() returned Ok(None) for that address: no committed page, and gpu_reservation() returned 0. So cbv() passed the title's own address to vkd3d as BufferLocation, and vkd3d's VA map has nothing there.
  • A trace of every CBV caught exactly one such call before the crash, out of about 15,600.
  • In 6d4f1cd7 the same kind of CBV went to the mirror path with committed pages (the "page remap replaced imported range" lines). That fits queue page remaps having also mapped the CPU side before this commit made the page table GPU-only. That part is inferred from the code.
  • Each of these alone still crashed at about 80 s: no GPU reservations, sparse_buffer returning None, no XMem reset callback, and reverting the XMem side of 9c3cf86f.

Second failure, behind the first. With a local guard that sends such a CBV to the existing CBV mirror (buffer_at(..., required = true) in cbv()), the run gets to 293 s and then stops on:

command list cannot record rejecting read/write access to translated texture at 0x1167ce0000 with a possible null GPU page
PresentX failed planes=1 HRESULT=0x80004001

followed by the title's crash handler.

We're tracing why gpu_reservation() is 0 at those addresses: which XMem profile the title reserves them with, and whether its page mappings there were refused. Happy to run anything you'd like on this card.

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:comment:7343474870 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7343474870). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-02T11:08:07Z. --- A regression report: since `9c3cf86f` ("Correcting D3D12 and XMem Behaviour"), ProjectScarlett exits with code 5 at the title/menu on an RTX 5090 (620.70.10, GE-Proton11-15, default settings, warm caches). The title's crash handler fires, and there is no GPU error. **Bisect, one run per commit, which is enough because the failure is deterministic:** `6d4f1cd7` ran 5 minutes clean. `9c3cf86f`, `8f5bb16c`, `68f5a433`, `d2985fb3` and `1ce50737` each exited at 77–81 s. **First failure: a CBV at an address nothing resolves.** The fatal access violation is a NULL dereference in vkd3d-proton's `d3d12_desc_create_cbv`, called from `CreateConstantBufferView` in `views/mirrors.rs` (`cbv()`). - `buffer_at()` returned `Ok(None)` for that address: no committed page, and `gpu_reservation()` returned 0. So `cbv()` passed the title's own address to vkd3d as `BufferLocation`, and vkd3d's VA map has nothing there. - A trace of every CBV caught exactly one such call before the crash, out of about 15,600. - In `6d4f1cd7` the same kind of CBV went to the mirror path with committed pages (the "page remap replaced imported range" lines). That fits queue page remaps having also mapped the CPU side before this commit made the page table GPU-only. That part is inferred from the code. - Each of these alone still crashed at about 80 s: no GPU reservations, `sparse_buffer` returning `None`, no XMem reset callback, and reverting the XMem side of `9c3cf86f`. **Second failure, behind the first.** With a local guard that sends such a CBV to the existing CBV mirror (`buffer_at(..., required = true)` in `cbv()`), the run gets to 293 s and then stops on: ``` command list cannot record rejecting read/write access to translated texture at 0x1167ce0000 with a possible null GPU page PresentX failed planes=1 HRESULT=0x80004001 ``` followed by the title's crash handler. We're tracing why `gpu_reservation()` is 0 at those addresses: which XMem profile the title reserves them with, and whether its page mappings there were refused. Happy to run anything you'd like on this card. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
3kynox commented 2026-12-02 11:11:46 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-12-02T11:11:46Z.


Same on an RTX 4070 Ti SUPER (620.73.04, GE-Proton11-14, Intel CPU): d2985fb3 exits with code 5 before the world, 3 runs of 3. A log line in cbv() caught one CBV without an owner before the crash: 256 bytes in a page that is reserved but not committed (MEM_RESERVE), gpu_reservation() 0. 6d4f1cd7 with #647 on top reaches the world in every run so far (6 of 6). We run the switch-off/on control for #586 on that tree.

<!-- greyfinch-sync:brcly/TuxBox:comment:7343565563 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7343565563). Originally posted by [3kynox](https://github.com/3kynox) on 2026-12-02T11:11:46Z. --- Same on an RTX 4070 Ti SUPER (620.73.04, GE-Proton11-14, Intel CPU): `d2985fb3` exits with code 5 before the world, 3 runs of 3. A log line in `cbv()` caught one CBV without an owner before the crash: 256 bytes in a page that is reserved but not committed (`MEM_RESERVE`), `gpu_reservation()` 0. `6d4f1cd7` with #647 on top reaches the world in every run so far (6 of 6). We run the switch-off/on control for #586 on that tree.
NickStallman commented 2026-12-02 12:49:26 +00:00 (Migrated from github.com)
Author
Contributor

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


Thanks for 1b4ed472. A heads-up from testing the same change here: we had the same rule locally (a graphics protection bit, protect & 0x7800, giving the aperture an ID), together with buffer views that follow the page table. On the RTX 5090 that ran 8 minutes with no exit 5 and no refused mappings. But the screen stayed black the whole run: presents at 60 fps, the captured frames all zero. On the same harness, 6d4f1cd7 showed the title within a minute.

What failed:

placed GPU image host placement at 0xd58200000 3840x2160 format=29 flags=0xc00001 alignment=0 initial=6 failed HRESULT(0x80004001)
resource slot 133 failed 0x80004001: dim=3 3840x2160 ... flags=0xc00001

That is the title's 4K sRGB render target in the 0x900200000 aperture.

From the code: with the aperture now having an ID, guard_fixed_resource after CreatePlacedResource2 reaches fixed_placement() (page_mapping/buffers.rs). That returns E_NOTIMPL because the title has already page-mapped those pages. Before, with ID 0, the guard returned Ok and the image became a plain device image ("not committed guest memory; keeping a device image", as in 9c3cf86f's run).

The failure line is log_once, so other images may have failed the same way without a line.

We're testing a variant now where such an image keeps an unguarded device image. Whether an RT over page-mapped aperture pages should ignore the mappings or follow them is your call. I'll post the result.

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:comment:7345936251 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7345936251). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-02T12:49:26Z. --- Thanks for 1b4ed472. A heads-up from testing the same change here: we had the same rule locally (a graphics protection bit, `protect & 0x7800`, giving the aperture an ID), together with buffer views that follow the page table. On the RTX 5090 that ran 8 minutes with no exit 5 and no refused mappings. But the screen stayed black the whole run: presents at 60 fps, the captured frames all zero. On the same harness, `6d4f1cd7` showed the title within a minute. What failed: ``` placed GPU image host placement at 0xd58200000 3840x2160 format=29 flags=0xc00001 alignment=0 initial=6 failed HRESULT(0x80004001) resource slot 133 failed 0x80004001: dim=3 3840x2160 ... flags=0xc00001 ``` That is the title's 4K sRGB render target in the 0x900200000 aperture. From the code: with the aperture now having an ID, `guard_fixed_resource` after `CreatePlacedResource2` reaches `fixed_placement()` (page_mapping/buffers.rs). That returns E_NOTIMPL because the title has already page-mapped those pages. Before, with ID 0, the guard returned Ok and the image became a plain device image ("not committed guest memory; keeping a device image", as in 9c3cf86f's run). The failure line is `log_once`, so other images may have failed the same way without a line. We're testing a variant now where such an image keeps an unguarded device image. Whether an RT over page-mapped aperture pages should ignore the mappings or follow them is your call. I'll post the result. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
NickStallman commented 2026-12-02 12:54:05 +00:00 (Migrated from github.com)
Author
Contributor

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


The follow-up to the black screen. With the aperture ID, plus images whose fixed_placement guard returns E_NOTIMPL kept as plain device images, the 4K target exists and frames are no longer black:

DIAG unguarded device image over GPU-mapped pages at 0xd58200000+0x1fe0000 3840x2160 format=29 flags=0xc00001
DIAG unguarded device image over GPU-mapped pages at 0xd402e8000+0x1000 4x4 format=71 flags=0x300000

The run then stops at 97 s on the next check:

command list cannot record cannot order buffer and texture accesses: HRESULT(0x80004001)
PresentX failed planes=1 HRESULT=0x80004001

After that the title's crash handler exits with code 5. That message looks like it comes from 1ce50737 ("support ordered buffer and texture access within one draw or dispatch").

So the chain on this card is:

  1. the aperture ID (fixed by 1b4ed472);
  2. fixed_placement refusing the title's render target over page-mapped pages, which gives a black screen;
  3. this ordering check rejecting a recorded list, which fails the present.

Each is one run; tell me if a trace at any of these would help.

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:comment:7346052787 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7346052787). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-02T12:54:05Z. --- The follow-up to the black screen. With the aperture ID, plus images whose `fixed_placement` guard returns E_NOTIMPL kept as plain device images, the 4K target exists and frames are no longer black: ``` DIAG unguarded device image over GPU-mapped pages at 0xd58200000+0x1fe0000 3840x2160 format=29 flags=0xc00001 DIAG unguarded device image over GPU-mapped pages at 0xd402e8000+0x1000 4x4 format=71 flags=0x300000 ``` The run then stops at 97 s on the next check: ``` command list cannot record cannot order buffer and texture accesses: HRESULT(0x80004001) PresentX failed planes=1 HRESULT=0x80004001 ``` After that the title's crash handler exits with code 5. That message looks like it comes from `1ce50737` ("support ordered buffer and texture access within one draw or dispatch"). So the chain on this card is: 1. the aperture ID (fixed by 1b4ed472); 2. `fixed_placement` refusing the title's render target over page-mapped pages, which gives a black screen; 3. this ordering check rejecting a recorded list, which fails the present. Each is one run; tell me if a trace at any of these would help. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1093i3511 commented 2026-12-02 18:12:39 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-12-02T18:12:39Z.


An RDNA 2 data point for 9c3cf86f, from Lanes on main 1b4ed472 (RX 6600, 1002:73ff, RADV / Mesa 26.3.1, GE-Proton11-15, host profile section-import=substituted): lanes-selftest 30 pass, 2 fail.

Scenario Result
queue-page-mappings (new in 9c3cf86f) copy ordered GPU mapping failed: 0x80004001
ray-tracing-rehydrate map physical pages for the GPU failed: 0x80004001; passed on 3e2839b1
texture-publication passes now (#647)

Both come from the check that 9c3cf86f added to gpu_tile() (runtime/d3d12/src/device/heap/gpu_tiles.rs). It returns E_NOTIMPL when the page also has a CPU view and section imports are substituted or refused:

if shadow::contains_mapped_pages(base, TILE_BYTES)
    && host_profile::needs_mirror(host_profile::section_import(device))
{
    // A CPU-to-GPU mirror would lose writes through an alias on another queue.
    return Err(E_NOTIMPL.into());
}

With TUXBOX_HOST_PROFILE=section-import=aliased forced, both scenarios get past the mapping call and then fail on data, as expected when the import really is substituted: mapping order sample 0: expected 0xabcd0001, got 0, and rehydrate's ray 2 finds no hit. So on RADV hosts that substitute section imports, every queue page mapping (CopyPageMappings*) of CPU-mapped XMem pages is refused. Our reading is that ProjectScarlett's copy-queue batches into its streamed GPU range then fail on these cards, much like the missing-ID case that 1b4ed472 fixed.

Is the refusal meant as the final behaviour for substituted hosts, or is a mirror path for them planned? Until then, Lanes on RADV fails these two scenarios on main; c1139ab2 gives the same 30 pass, 2 fail.

Game runs on c1139ab2 (same card, Series S through --graphics-profile series-s, and packaged, defaults, warm caches): every run without private views stops in the same place, right after the title reads its saves on leaving the start menu:

command list cannot record cannot order buffer and texture accesses: HRESULT(0x80004001)
PresentX failed planes=2 HRESULT=0x80004001

The title's watchdog then ends it with exit 5 at 116–121 s (4 runs: Series S defaults, packaged defaults, Series S TUXBOX_XMEM_SECTION_WATCH=1 TUXBOX_CHECK_ONCE_PER_FRAME=0 twice). On 1b4ed472 it was the same line. That matches @NickStallman's 97 s stop on the RTX 5090, so it isn't vendor-specific. With TUXBOX_XMEM_PRIVATE_VIEWS=1 the refusal does not appear, but the runs end at 91 s (watchdog) and 58 s (VK_ERROR_DEVICE_LOST, no amdgpu fault in the kernel log).

For #472: in the menus, the frame median is 14.8 ms with private views, against 27–35 ms with the defaults or section watch alone. That repeats the earlier ~2x gap on 717a74c4. The runs are too short for the write-fault question.

<!-- greyfinch-sync:brcly/TuxBox:comment:7354129812 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7354129812). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-12-02T18:12:39Z. --- An RDNA 2 data point for 9c3cf86f, from Lanes on main `1b4ed472` (RX 6600, `1002:73ff`, RADV / Mesa 26.3.1, GE-Proton11-15, host profile `section-import=substituted`): `lanes-selftest` 30 pass, 2 fail. | Scenario | Result | | --- | --- | | `queue-page-mappings` (new in 9c3cf86f) | `copy ordered GPU mapping failed: 0x80004001` | | `ray-tracing-rehydrate` | `map physical pages for the GPU failed: 0x80004001`; passed on `3e2839b1` | | `texture-publication` | passes now (#647) | Both come from the check that 9c3cf86f added to `gpu_tile()` (`runtime/d3d12/src/device/heap/gpu_tiles.rs`). It returns E_NOTIMPL when the page also has a CPU view and section imports are `substituted` or `refused`: ```rust if shadow::contains_mapped_pages(base, TILE_BYTES) && host_profile::needs_mirror(host_profile::section_import(device)) { // A CPU-to-GPU mirror would lose writes through an alias on another queue. return Err(E_NOTIMPL.into()); } ``` With `TUXBOX_HOST_PROFILE=section-import=aliased` forced, both scenarios get past the mapping call and then fail on data, as expected when the import really is substituted: `mapping order sample 0: expected 0xabcd0001, got 0`, and rehydrate's ray 2 finds no hit. So on RADV hosts that substitute section imports, every queue page mapping (`CopyPageMappings*`) of CPU-mapped XMem pages is refused. Our reading is that ProjectScarlett's copy-queue batches into its streamed GPU range then fail on these cards, much like the missing-ID case that 1b4ed472 fixed. Is the refusal meant as the final behaviour for substituted hosts, or is a mirror path for them planned? Until then, Lanes on RADV fails these two scenarios on main; `c1139ab2` gives the same 30 pass, 2 fail. **Game runs on `c1139ab2`** (same card, Series S through `--graphics-profile series-s`, and packaged, defaults, warm caches): every run without private views stops in the same place, right after the title reads its saves on leaving the start menu: ``` command list cannot record cannot order buffer and texture accesses: HRESULT(0x80004001) PresentX failed planes=2 HRESULT=0x80004001 ``` The title's watchdog then ends it with exit 5 at 116–121 s (4 runs: Series S defaults, packaged defaults, Series S `TUXBOX_XMEM_SECTION_WATCH=1 TUXBOX_CHECK_ONCE_PER_FRAME=0` twice). On `1b4ed472` it was the same line. That matches @NickStallman's 97 s stop on the RTX 5090, so it isn't vendor-specific. With `TUXBOX_XMEM_PRIVATE_VIEWS=1` the refusal does not appear, but the runs end at 91 s (watchdog) and 58 s (`VK_ERROR_DEVICE_LOST`, no amdgpu fault in the kernel log). For #472: in the menus, the frame median is 14.8 ms with private views, against 27–35 ms with the defaults or section watch alone. That repeats the earlier ~2x gap on 717a74c4. The runs are too short for the write-fault question.
gtb-sbe commented 2026-12-02 18:52:04 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-12-02T18:52:04Z.


Slow story-intro frames on an RX 9060 XT: who owns placement and publication latency?

Before I write any code for this, I'd like to know whether someone already owns it.

On my RX 9060 XT (RADV, Mesa 26.3.1, GE-Proton11-15, private views; lazy publication, read residency and once-per-frame at their defaults; 53782eed + #657), the story intro runs at 3.6 s per frame (median of 42 frames) while the GPU is about 5 % busy (gfx 5.4 %, compute 2.8 %, from amdgpu fdinfo engine time). Nothing spills: the texture ledger has 0 placed textures in system memory.

What the submit profile and frame log show over those frames:

  • All of the title's ExecuteCommandLists calls come from the presenting thread. It spends 1.0 s per frame inside them (32 %), 0.74 s of that in placement: upload 0.26 s, gather 0.12, scan 0.10, readback 0.10, digest 0.07. No single step dominates.
  • Gather visits about 2,800 placed textures per batch, at ~28 batches per frame (11.6 per batch before the intro). The write watch skips ~97 % of them.
  • Publication workers take another 0.32 s per frame, off the render thread.
  • The other ~2.4 s per frame of the presenting thread is in none of TuxBox's counters (no pipeline creation, present waits or fence calls).
  • Compute queues sit at title label waits for 0.3-2.6 s at a time, and the publication workers log GPU worker fence stalled, waiting over 3 s for batches up to ~30 ticks behind.

So unlike @NickStallman's 5090, where placement was most of a 1.2 s frame, placement here is about a fifth of the frame. @Jerkin42 saw the same on this card with #590 ("the rest of the frame is mostly memory-wait holds").

One thing in the code I'd like an opinion on. After every batch that may write a placed texture, placement::submit makes the queue wait for its publication worker (queue.Wait(&worker.published, tick)). With lazy publication on, that also happens when every write was deferred and there is no readback, so the queue waits for a CPU round trip with nothing to publish. I also suspect that on RADV these GPU-side waits hold more than their own queue: vkd3d-proton spreads all D3D12 queues, TuxBox's own copy queues included, over 1 graphics and 4 compute rings. That part is a guess so far.

Next, I want to sample the render thread's stacks (TUXBOX_STACK_SAMPLE=1) to see what fills those 2.4 s, and time the publication gates per queue. I haven't run c1139ab2 yet; the gate is unchanged there.

@brcly, is placement or publication latency something you or someone else is already working on? And once I can show what it costs, would you take a change that skips the gate for batches with nothing to publish?

<!-- greyfinch-sync:brcly/TuxBox:comment:7355273025 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7355273025). Originally posted by [gtb-sbe](https://github.com/gtb-sbe) on 2026-12-02T18:52:04Z. --- **Slow story-intro frames on an RX 9060 XT: who owns placement and publication latency?** Before I write any code for this, I'd like to know whether someone already owns it. On my RX 9060 XT (RADV, Mesa 26.3.1, GE-Proton11-15, private views; lazy publication, read residency and once-per-frame at their defaults; `53782eed` + #657), the story intro runs at **3.6 s per frame** (median of 42 frames) while the GPU is about **5 % busy** (gfx 5.4 %, compute 2.8 %, from amdgpu fdinfo engine time). Nothing spills: the texture ledger has 0 placed textures in system memory. What the submit profile and frame log show over those frames: - All of the title's `ExecuteCommandLists` calls come from the presenting thread. It spends 1.0 s per frame inside them (32 %), 0.74 s of that in placement: upload 0.26 s, gather 0.12, scan 0.10, readback 0.10, digest 0.07. No single step dominates. - Gather visits about 2,800 placed textures per batch, at ~28 batches per frame (11.6 per batch before the intro). The write watch skips ~97 % of them. - Publication workers take another 0.32 s per frame, off the render thread. - The other ~2.4 s per frame of the presenting thread is in none of TuxBox's counters (no pipeline creation, present waits or fence calls). - Compute queues sit at title label waits for 0.3-2.6 s at a time, and the publication workers log `GPU worker fence stalled`, waiting over 3 s for batches up to ~30 ticks behind. So unlike @NickStallman's 5090, where placement was most of a 1.2 s frame, placement here is about a fifth of the frame. @Jerkin42 saw the same on this card with #590 ("the rest of the frame is mostly memory-wait holds"). One thing in the code I'd like an opinion on. After every batch that may write a placed texture, `placement::submit` makes the queue wait for its publication worker (`queue.Wait(&worker.published, tick)`). With lazy publication on, that also happens when every write was deferred and there is no readback, so the queue waits for a CPU round trip with nothing to publish. I also suspect that on RADV these GPU-side waits hold more than their own queue: vkd3d-proton spreads all D3D12 queues, TuxBox's own copy queues included, over 1 graphics and 4 compute rings. That part is a guess so far. Next, I want to sample the render thread's stacks (`TUXBOX_STACK_SAMPLE=1`) to see what fills those 2.4 s, and time the publication gates per queue. I haven't run `c1139ab2` yet; the gate is unchanged there. @brcly, is placement or publication latency something you or someone else is already working on? And once I can show what it costs, would you take a change that skips the gate for batches with nothing to publish?
JeffreyBytes commented 2026-12-02 20:09:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-12-02T20:09:40Z.


@NickStallman your third step reproduces here on c1139ab2: RX 6700 XT, RADV, 3840x2160, three runs of three. On this tree I get no import failures, and the title reaches the account picker. Then cannot order buffer and texture accesses fails the present, and the watchdog exits with code 5 at 113-119 s. 1093i3511 sees the same on an RX 6600 above.

I'm tracing and fixing this one in #661. A logging build showed the refusal comes from the first check in handoffs::plan. The batch has no phases, and a fixed or mirrored buffer write overlaps the first 64 KiB of a mapped image it reads. Both are true at once, so I don't know yet which one is the real cause.

If you still have a trace from your 97 s stop, especially what the refused batch held, I'd be glad to compare. You don't need to run anything new for it.

<!-- greyfinch-sync:brcly/TuxBox:comment:7357306540 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7357306540). Originally posted by [JeffreyBytes](https://github.com/JeffreyBytes) on 2026-12-02T20:09:40Z. --- @NickStallman your third step reproduces here on c1139ab2: RX 6700 XT, RADV, 3840x2160, three runs of three. On this tree I get no import failures, and the title reaches the account picker. Then `cannot order buffer and texture accesses` fails the present, and the watchdog exits with code 5 at 113-119 s. 1093i3511 sees the same on an RX 6600 above. I'm tracing and fixing this one in #661. A logging build showed the refusal comes from the first check in `handoffs::plan`. The batch has no phases, and a fixed or mirrored buffer write overlaps the first 64 KiB of a mapped image it reads. Both are true at once, so I don't know yet which one is the real cause. If you still have a trace from your 97 s stop, especially what the refused batch held, I'd be glad to compare. You don't need to run anything new for it.
gtb-sbe commented 2026-12-02 20:15:58 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-12-02T20:15:58Z.


A correction to my question above: I measured the publication gate, and it isn't the problem.

Same RX 9060 XT and build (53782eed + #657), one more run with a local timing patch on the publication worker and TUXBOX_STACK_SAMPLE=1, over ~110 slow story-intro frames (median 3.5 s, GPU 2-5 % busy):

  • The gates are cheap and almost never empty. Of 2,278 gates, 24 had nothing to publish. They hold the direct queue 0.32 s per frame (35 ms each) and the compute queues 0.04 s per frame. So skipping empty gates would gain nothing; please ignore that part of my question.
  • Batches finish about 1.8 s after they are submitted on both queue types (up to 6.4 s), while the GPU is nearly idle. They wait on something ahead of them, most likely title label waits (median 8 per frame, 5.9 s held in sum).
  • The render thread mostly waits. 67 % of its samples are in WaitForSingleObject from one of the title's wait wrappers, with no TuxBox frame on the stack. About a sixth is in TuxBox, mostly placement (the write-watch scan in GetWriteWatch and waiting for the check pool). With the sampler on, placement took 0.5 s more per frame than without, and the frame time didn't change, so placement doesn't seem to be on the critical path here.
  • One TuxBox cost that does show up elsewhere: a title thread that writes SRVs spends ~37 % of its time in PagePools::import/reuse_page host imports (vkAllocateMemory) and in freeing descriptor backings (vkFreeMemory), and the title's five job threads block on that pool's mutex while they record command lists (4-8 % each).

Next, I want to find out what the render thread waits for: a sampler that keeps a few more title frames, and timing of the title's fence events. If it waits for the GPU, the question becomes which label waits hold the batches for those ~1.8 s. I'll post what I find.

<!-- greyfinch-sync:brcly/TuxBox:comment:7357471198 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7357471198). Originally posted by [gtb-sbe](https://github.com/gtb-sbe) on 2026-12-02T20:15:58Z. --- A correction to my question above: I measured the publication gate, and it isn't the problem. Same RX 9060 XT and build (`53782eed` + #657), one more run with a local timing patch on the publication worker and `TUXBOX_STACK_SAMPLE=1`, over ~110 slow story-intro frames (median 3.5 s, GPU 2-5 % busy): - **The gates are cheap and almost never empty.** Of 2,278 gates, 24 had nothing to publish. They hold the direct queue 0.32 s per frame (35 ms each) and the compute queues 0.04 s per frame. So skipping empty gates would gain nothing; please ignore that part of my question. - **Batches finish about 1.8 s after they are submitted** on both queue types (up to 6.4 s), while the GPU is nearly idle. They wait on something ahead of them, most likely title label waits (median 8 per frame, 5.9 s held in sum). - **The render thread mostly waits.** 67 % of its samples are in `WaitForSingleObject` from one of the title's wait wrappers, with no TuxBox frame on the stack. About a sixth is in TuxBox, mostly placement (the write-watch scan in `GetWriteWatch` and waiting for the check pool). With the sampler on, placement took 0.5 s more per frame than without, and the frame time didn't change, so placement doesn't seem to be on the critical path here. - **One TuxBox cost that does show up elsewhere:** a title thread that writes SRVs spends ~37 % of its time in `PagePools::import`/`reuse_page` host imports (`vkAllocateMemory`) and in freeing descriptor backings (`vkFreeMemory`), and the title's five job threads block on that pool's mutex while they record command lists (4-8 % each). Next, I want to find out what the render thread waits for: a sampler that keeps a few more title frames, and timing of the title's fence events. If it waits for the GPU, the question becomes which label waits hold the batches for those ~1.8 s. I'll post what I find.
snoozedDev commented 2026-12-02 20:35:46 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by snoozedDev on 2026-12-02T20:35:46Z.


Taking a small tuxbox-xmem private-views fix; the PR follows within the hour unless someone already has it.

With TUXBOX_XMEM_PRIVATE_VIEWS=1, XMemMapPhysicalPages returns NULL with ERROR_INVALID_PARAMETER when a second mapping of the same pages crosses a 4 MiB boundary. Since #600 a contiguous map is cut into one private span per 4 MiB chunk, and each span is its own OS allocation. protect_runs still passes adjacent pages to one VirtualProtect call, and VirtualProtect refuses a range that spans two allocations. A plain 8 MiB double mapping hits it every time. It is also one of the two causes of the rare gpu_pool_then_plain_cpu_view_upgrades_backing_and_keeps_mem_private failure I left untraced in #659.

I haven't run the game, so I don't know whether the title makes such a call. The provider logs XMemMapPhysicalPages failed ... err=87 when it does.

@DrArroway @1093i3511 private views is your area; say if you'd rather handle it or want it done differently.

This contribution was written by an AI agent (Claude Opus 5.5) operating under my supervision. I am accountable for it and will respond to review.

<!-- greyfinch-sync:brcly/TuxBox:comment:7357994000 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7357994000). Originally posted by [snoozedDev](https://github.com/snoozedDev) on 2026-12-02T20:35:46Z. --- Taking a small `tuxbox-xmem` private-views fix; the PR follows within the hour unless someone already has it. With `TUXBOX_XMEM_PRIVATE_VIEWS=1`, `XMemMapPhysicalPages` returns NULL with `ERROR_INVALID_PARAMETER` when a second mapping of the same pages crosses a 4 MiB boundary. Since #600 a contiguous map is cut into one private span per 4 MiB chunk, and each span is its own OS allocation. `protect_runs` still passes adjacent pages to one `VirtualProtect` call, and `VirtualProtect` refuses a range that spans two allocations. A plain 8 MiB double mapping hits it every time. It is also one of the two causes of the rare `gpu_pool_then_plain_cpu_view_upgrades_backing_and_keeps_mem_private` failure I left untraced in #659. I haven't run the game, so I don't know whether the title makes such a call. The provider logs `XMemMapPhysicalPages failed ... err=87` when it does. @DrArroway @1093i3511 private views is your area; say if you'd rather handle it or want it done differently. This contribution was written by an AI agent (Claude Opus 5.5) operating under my supervision. I am accountable for it and will respond to review.
DrArroway commented 2026-12-02 20:41:18 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-12-02T20:41:18Z.


@snoozedDev Thanks for picking that up — splitting VirtualProtect runs at the 4 MiB PrivateSpan boundaries is the exact right follow-up to #600, so #662 looks clean and good to keep on your end.

Sharing a quick c1139ab2 status note on AMD Radeon RX 6900 XT (1002:73bf) (RADV / GE-Proton11-15, 3840x2160, TUXBOX_XMEM_PRIVATE_VIEWS=1, with #657 cherry-picked) from pushing locally past the #661 handoffs::plan refusal into the 3D world — once past #661, three downstream c1139ab2 bottlenecks showed up that we're testing fixes for locally before splitting out PRs:

  1. PageCache (LIMIT = 4096) cluster eviction (pages.rs / gpu_tiles.rs): 64 KiB GPU page mapping fallbacks fill the cache and crowd out 2 MiB GPU private cluster reuse (adapter system memory climbed to 24.6 GiB). Giving multi-page clusters a dedicated weak cache + whole-cluster held private_cluster_window() brought adapter system memory down to 4.2 GiB.
  2. staging VRAM explosion (queue_copies.rs / queue_use.rs): Monolithic ~520 MiB scratch buffers + per-wait regathers pushed staging VRAM to 17.76 GiB (VK_ERROR_DEVICE_LOST). Chunking scratch to 64 MiB + reusing one gather-only regather across WaitPoint::After waits brought staging down to 667 MiB with zero device loss.
  3. 0% skip rate in queue_copies.rs::unchanged(): On 0x900200000 GPU-mapped textures we measured 3,525/3,525 (3.8 GiB in 5 batches) being re-detiled because texture.queue_watch watches CPU-unbacked GPU reservations where watch.state() sees CELL_UNTRACKED (REASON_UNBACKED), and ~99% of world batches arrive with may_skip == false (queue.Wait) + WaitPoint::After regathers. Currently testing clean_or_unbacked() + GPU-predicated gathers (SetPredication evaluated at fence == 1 in queue_use::Worker).
<!-- greyfinch-sync:brcly/TuxBox:comment:7358149729 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7358149729). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-12-02T20:41:18Z. --- @snoozedDev Thanks for picking that up — splitting `VirtualProtect` runs at the 4 MiB `PrivateSpan` boundaries is the exact right follow-up to `#600`, so `#662` looks clean and good to keep on your end. Sharing a quick `c1139ab2` status note on `AMD Radeon RX 6900 XT (1002:73bf)` (RADV / `GE-Proton11-15`, `3840x2160`, `TUXBOX_XMEM_PRIVATE_VIEWS=1`, with `#657` cherry-picked) from pushing locally past the `#661` `handoffs::plan` refusal into the 3D world — once past `#661`, three downstream `c1139ab2` bottlenecks showed up that we're testing fixes for locally before splitting out PRs: 1. **`PageCache` (`LIMIT = 4096`) cluster eviction (`pages.rs` / `gpu_tiles.rs`):** 64 KiB `GPU page mapping` fallbacks fill the cache and crowd out 2 MiB `GPU private cluster` reuse (`adapter system memory` climbed to `24.6 GiB`). Giving multi-page clusters a dedicated weak cache + whole-cluster held `private_cluster_window()` brought `adapter system memory` down to `4.2 GiB`. 2. **`staging` VRAM explosion (`queue_copies.rs` / `queue_use.rs`):** Monolithic ~`520 MiB` scratch buffers + per-wait `regathers` pushed `staging` VRAM to `17.76 GiB` (`VK_ERROR_DEVICE_LOST`). Chunking scratch to `64 MiB` + reusing one gather-only regather across `WaitPoint::After` waits brought `staging` down to `667 MiB` with zero device loss. 3. **0% skip rate in `queue_copies.rs::unchanged()`:** On `0x900200000` GPU-mapped textures we measured `3,525/3,525` (`3.8 GiB` in 5 batches) being re-detiled because `texture.queue_watch` watches CPU-unbacked GPU reservations where `watch.state()` sees `CELL_UNTRACKED` (`REASON_UNBACKED`), and ~99% of world batches arrive with `may_skip == false` (`queue.Wait`) + `WaitPoint::After` regathers. Currently testing `clean_or_unbacked()` + GPU-predicated gathers (`SetPredication` evaluated at `fence == 1` in `queue_use::Worker`).
1093i3511 commented 2026-12-02 20:58:51 +00:00 (Migrated from github.com)
Author
Contributor

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


Today's results from the RX 6600 (8 GB, RADV / Mesa 26.3.1, GE-Proton11-15, section-import=substituted), for the three threads above.

@JeffreyBytes, the handoffs::plan stop (#661). I have no trace of the refused batch, only the one cannot order buffer and texture accesses line. It comes at the same point in every run without private views on 1b4ed472 and c1139ab2: right after the title reads its saves on leaving the start menu (save: read "Player", then enumerate blobs of "SettingsProfileSettings"). That's 5 runs: Series S and packaged, defaults and section watch. I can run #661 on this card when it's ready.

@snoozedDev, private views. Fine by me, thanks. None of my four private-views runs today (6d4f1cd7 + #647, 1b4ed472, c1139ab2) logged XMemMapPhysicalPages failed. Here they end on other things: #603, the title watchdog, a fail-fast exception (c0000602), and once VK_ERROR_DEVICE_LOST without an amdgpu fault.

@gtb-sbe, the intro wait. RDNA 2 shows the same pattern. On 6d4f1cd7 + #647 (the tree that reaches the world here), with TUXBOX_FRAME_LOG and fdinfo engine time sampled every 10 s:

Run (Series S unless noted) Time in frames ≥250 ms Of that, presenting thread in submits Placement per slow frame GPU queue time held at title memory waits (summed) Card busy in the world
defaults, 830 s 76 % 46 % 0.3–0.9 s 465 s, 0 released by the timeout ~5 %
section watch alone, 896 s 86 % 65 % 1,611 s, 0 released
packaged, 836 s 81 % 60 % 1,007 s, 0 released ~20 %

The game's own engine time (fdinfo drm-engine-gfx / compute) stays at 1–5 % in the menus, the loading screens and the world. A typical slow frame: 3,637 ms, 1,652 ms of it in submits (718 ms placement), 11 title memory waits ending in the frame that held queues for 5,552 ms in sum, the longest 1,380 ms on a compute queue. So it's the same picture as yours: the GPU mostly idle, and batches held behind title waits.

Where 6d4f1cd7 + #647 gets on this card (all runs reach the world, 3:50–5:45 after start):

  • Series S ends after 830–896 s with the title's abort path on a full card (memory ledger: card 7187/7195 MiB), no GPU fault.
  • Packaged and private views end on the #603 TCP read fault (307–836 s), and the ring reset works.
  • The Series S world stays black: #663, with a per-pipeline comparison against packaged and a note that my shared preparation for both targets may be the cause.
  • The #472 result (section watch alone: no write fault in 896 s) goes on #472.
<!-- greyfinch-sync:brcly/TuxBox:comment:7358615196 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7358615196). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-12-02T20:58:51Z. --- Today's results from the RX 6600 (8 GB, RADV / Mesa 26.3.1, GE-Proton11-15, `section-import=substituted`), for the three threads above. **@JeffreyBytes, the `handoffs::plan` stop (#661).** I have no trace of the refused batch, only the one `cannot order buffer and texture accesses` line. It comes at the same point in every run without private views on `1b4ed472` and `c1139ab2`: right after the title reads its saves on leaving the start menu (`save: read "Player"`, then `enumerate blobs of "SettingsProfileSettings"`). That's 5 runs: Series S and packaged, defaults and section watch. I can run #661 on this card when it's ready. **@snoozedDev, private views.** Fine by me, thanks. None of my four private-views runs today (`6d4f1cd7` + #647, `1b4ed472`, `c1139ab2`) logged `XMemMapPhysicalPages failed`. Here they end on other things: #603, the title watchdog, a fail-fast exception (`c0000602`), and once `VK_ERROR_DEVICE_LOST` without an amdgpu fault. **@gtb-sbe, the intro wait.** RDNA 2 shows the same pattern. On `6d4f1cd7` + #647 (the tree that reaches the world here), with `TUXBOX_FRAME_LOG` and fdinfo engine time sampled every 10 s: | Run (Series S unless noted) | Time in frames ≥250 ms | Of that, presenting thread in submits | Placement per slow frame | GPU queue time held at title memory waits (summed) | Card busy in the world | | --- | --- | --- | --- | --- | --- | | defaults, 830 s | 76 % | 46 % | 0.3–0.9 s | 465 s, 0 released by the timeout | ~5 % | | section watch alone, 896 s | 86 % | 65 % | | 1,611 s, 0 released | | | packaged, 836 s | 81 % | 60 % | | 1,007 s, 0 released | ~20 % | The game's own engine time (fdinfo `drm-engine-gfx` / `compute`) stays at 1–5 % in the menus, the loading screens and the world. A typical slow frame: 3,637 ms, 1,652 ms of it in submits (718 ms placement), 11 title memory waits ending in the frame that held queues for 5,552 ms in sum, the longest 1,380 ms on a compute queue. So it's the same picture as yours: the GPU mostly idle, and batches held behind title waits. **Where `6d4f1cd7` + #647 gets on this card** (all runs reach the world, 3:50–5:45 after start): - Series S ends after 830–896 s with the title's abort path on a full card (`memory ledger: card 7187/7195 MiB`), no GPU fault. - Packaged and private views end on the #603 TCP read fault (307–836 s), and the ring reset works. - The Series S world stays black: #663, with a per-pipeline comparison against packaged and a note that my shared preparation for both targets may be the cause. - The #472 result (section watch alone: no write fault in 896 s) goes on #472.
brcly commented 2026-12-02 21:10:16 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by brcly on 2026-12-02T21:10:16Z.


Hey guys,

Sorry for making a bit of a mess of main.

I've pushed a commit that's helped me get the furthest I've gotten while trying to load textures and such.

The game is still having both CPU and GPU and shader issues, pegging at 100% workload and such; however, I managed to get into a textured world for a few seconds at least, and could see a low-poly character.

I'll go through PR's shortly.

EDIT: This came after a large rewrite of a few files, mainly D3D12_XS and XMem and a little bit of XCRDAPI. The current way that TuxBox handles games is "better" however work still needs done as it's taken us a few steps back in some of the optimizations that were made before.

<!-- greyfinch-sync:brcly/TuxBox:comment:7358892517 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7358892517). Originally posted by [brcly](https://github.com/brcly) on 2026-12-02T21:10:16Z. --- Hey guys, Sorry for making a bit of a mess of main. I've pushed a commit that's helped me get the furthest I've gotten while trying to load textures and such. The game is still having both CPU and GPU and shader issues, pegging at 100% workload and such; however, I managed to get into a textured world for a few seconds at least, and could see a low-poly character. I'll go through PR's shortly. EDIT: This came after a large rewrite of a few files, mainly D3D12_XS and XMem and a little bit of XCRDAPI. The current way that TuxBox handles games is "better" however work still needs done as it's taken us a few steps back in some of the optimizations that were made before.
DrArroway commented 2026-12-02 21:12:02 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by DrArroway on 2026-12-02T21:12:02Z.


Follow-up on our previous #533 comment with the rest of our local c1139ab2 findings on AMD Radeon RX 6900 XT (1002:73bf) (RADV / Mesa 26.3.1 / GE-Proton11-15, 3840x2160, TUXBOX_XMEM_PRIVATE_VIEWS=1, with #657 cherry-picked), plus a technical summary of our local fix1–fix10 stack so anyone working on these paths can reuse what was useful.

1. Why pred_skipped was 0 / 7,140 (0.0%) on RADV

In our live fix9 run on AMD Radeon RX 6900 XT (1002:73bf), the title reached the 3D world and survived the full 720 s run timeout with zero crashes (0 0x4d8bd421 watchdogs, 0 0x80000101 assertions, 0 VK_ERROR_DEVICE_LOST, 0 0x80004001 refuses), but queued texture copies still had pred_skipped=0/7,140 (0.0%), re-detiling 10–13 GiB every 10 s, pushing staging to 4,522 MiB and card VRAM to 20,429 / 16,368 MiB (resulting in heavy desktop/VRAM pressure and presented 1 frames in 84 s).

Root cause in runtime/d3d12/src/device/placement/queue_copies.rs:

  1. On RADV (host imports disturb the write watch on game memory, quiet_imports == false), amdgpu CS submissions disturb MEM_WRITE_WATCH on imported userptr pages, so XMem marks held GpuTile backing watches as HELD (CELL_UNTRACKED), which Watch::state() maps to State::Check. As a result, host_watches in unchanged() failed 100% of the time on RADV.
  2. gpu_writes::written_since(run, last.seen) expires after FINISHED = 64 batches unless last.seen is refreshed on clean checks.

Our follow-up (fix10) handles this without hurting NVIDIA:

  • When creating host_runs watches during note_gather, if rearm().0 == tracking::HELD, stop arming redundant held watches and compute a fallback host_digest via digest_runs (guarded_copy::available() + digest::Hasher::update_guest). When all host_runs watches stay live (Clean / Held as on NVIDIA), host_digest stays None (zero CPU hashing).
  • In unchanged(texture, gpu_now): refresh last.seen = gpu_now on clean checks, and throttle digest_runs re-verification under once_per_frame() once stable >= 8 (invalidated whenever remapped::PUBLICATIONS advances, including on scatters).
  • Restore SCRATCH_CHUNK = 32 << 20 (32 MiB) to keep chunked scratch VRAM bounded.

2. Summary of all local fix1–fix10 changes (c1139ab2 + #657)

  1. runtime/d3d12/src/device/placement/handoffs.rs, remapped.rs, shader_buffers.rs, planes.rs, page_remap.rs, placement.rs, commands/submit.rs (clearing the account-picker 0x80004001 wall on RADV):

    • handoffs.rs (plan): when direct || !stable || overlap == remapped::Overlap::FixedOrMirroredBuffer || buffers.indirect (with stable = stable_gate && !device.state.gpu_mappings.bindings_pending()), degrade via report_alias to whole-submission ordering instead of returning E_NOTIMPL, while keeping intra-command QueueBacked draw/dispatch conflicts strict and logging real refusals via diagnostics::log.
    • placement.rs (submit): gate copies.execute(..., gate_open && !device.state.gpu_mappings.bindings_pending(), ...) on pending GPU mapping bindings.
    • remapped.rs (conflicts_in_batch): replace the hard E_NOTIMPL return when has_null && write on RT/UAV textures with report_alias(...).
    • shader_buffers.rs (Imports::visit): skip non-live Backing::Fixed entries during conservative accesses.indirect scans instead of failing the batch with E_NOTIMPL.
    • planes.rs (color_plane): allow D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET (0x300005 mask on non-BC formats) on both 2D and 3D 0x105 textures.
  2. runtime/d3d12/src/device/heap/gpu_tiles.rs, pages.rs, heap_page_cache.rs (fixing 24.6 GiB adapter system memory leak):

    • gpu_tiles.rs: restrict shared_window() to MEM_MAPPED (Section::chunk_view) so adjacent MEM_PRIVATE pages cannot produce -EPERM CS rejections if unmapped/PAGE_NOACCESS; add whole-cluster held + pinned private_cluster_window() ("GPU private cluster").
    • pages.rs & heap_page_cache.rs: add PageCache::get() and a dedicated weak cache PagePools::cluster_pieces (keyed via span_key) + PagePools::cached_piece() so 64 KiB GPU page mapping churn does not evict 2 MiB clusters from PagePools::pieces.
  3. runtime/d3d12/src/commands/page_mapping/buffers.rs, device/placement/tracking.rs, queue_copies.rs, queue_copies/detile.rs, queue_use.rs (eliminating 17.76 GiB staging spill, 0x4d8bd421 watchdogs, and enabling GPU-predicated gathers):

    • commands/page_mapping/buffers.rs: add generation: AtomicU64, overridden: AtomicBool, generation(), has_gpu_overrides(), and backed_host_runs() to BufferMapping.
    • tracking.rs: add Watch::clean_or_unbacked() (0 | 4 or CELL_UNTRACKED with last_reason == UNBACKED) for CPU-unbacked GPU reservations.
    • queue_copies/detile.rs & queue_copies.rs: wrap Cache::upload() waits and wait_for_scratch() in crate::title_watchdog::pause(), make Lists.bytes/Lists.kernel lazy, chunk multi-texture scratch with SCRATCH_CHUNK = 32 << 20, and add periodic queued texture copies stats.
    • queue_use.rs & queue_copies.rs: replace the exclusive Images HashSet with reader-writer Slot { readers, writer } + split_access(), reuse a single gather-only recording (regathers[0]) across WaitPoint::After label waits, and add GatherMode::{SkipNow, PredicateAtHead, Always} with SetPredication(..., D3D12_PREDICATION_OP_NOT_EQUAL_ZERO) + Predication::evaluate() run by queue_use::Worker at fence == 1 before signaling fence == 2 — plus the fix10 digest_runs + once_per_frame() fallback above for RADV HELD watches.

3. Verification Status (fix10)

Verified on AMD Radeon RX 6900 XT (1002:73bf) after fix10 edits (build.py lanes):

  • cargo fmt --check: pass
  • device::placement::queue_ Windows unit tests under GE-Proton wine: 12/12 pass (including digest_runs_detects_single_byte_change, gpu::predication_skips_detile_and_copy_on_gpu, gpu::dispatch_moves_the_same_bytes_as_the_copy_runs, and queue_use::tests::*, 0 skipped)
  • tuxbox.py verify --only lanes-selftest with TUXBOX_XMEM_PRIVATE_VIEWS=1: 32/32 pass

Not run:

  • fix10 has not been live-tested in ProjectScarlett yet (we stopped live testing after fix9 due to the desktop/app lag), and nothing from today's local stack was tested on AMD Raphael Radeon 610M iGPU (1002:164e).
<!-- greyfinch-sync:brcly/TuxBox:comment:7358936475 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7358936475). Originally posted by [DrArroway](https://github.com/DrArroway) on 2026-12-02T21:12:02Z. --- Follow-up on our [previous #533 comment](https://github.com/brcly/TuxBox/issues/533#issuecomment-7358149729) with the rest of our local `c1139ab2` findings on `AMD Radeon RX 6900 XT (1002:73bf)` (RADV / Mesa 26.3.1 / `GE-Proton11-15`, `3840x2160`, `TUXBOX_XMEM_PRIVATE_VIEWS=1`, with `#657` cherry-picked), plus a technical summary of our local `fix1`–`fix10` stack so anyone working on these paths can reuse what was useful. ### 1. Why `pred_skipped` was `0 / 7,140` (`0.0%`) on RADV In our live `fix9` run on `AMD Radeon RX 6900 XT (1002:73bf)`, the title reached the 3D world and survived the full 720 s run timeout with zero crashes (`0` `0x4d8bd421` watchdogs, `0` `0x80000101` assertions, `0` `VK_ERROR_DEVICE_LOST`, `0` `0x80004001` refuses), **but** `queued texture copies` still had `pred_skipped=0/7,140` (`0.0%`), re-detiling **10–13 GiB every 10 s**, pushing `staging` to `4,522 MiB` and `card` VRAM to **`20,429 / 16,368 MiB`** (resulting in heavy desktop/VRAM pressure and `presented 1 frames in 84 s`). Root cause in `runtime/d3d12/src/device/placement/queue_copies.rs`: 1. On RADV (`host imports disturb the write watch on game memory`, `quiet_imports == false`), `amdgpu` CS submissions disturb `MEM_WRITE_WATCH` on imported userptr pages, so XMem marks held `GpuTile` backing watches as `HELD` (`CELL_UNTRACKED`), which `Watch::state()` maps to `State::Check`. As a result, `host_watches` in `unchanged()` failed **100%** of the time on RADV. 2. `gpu_writes::written_since(run, last.seen)` expires after `FINISHED = 64` batches unless `last.seen` is refreshed on clean checks. Our follow-up (`fix10`) handles this without hurting NVIDIA: - When creating `host_runs` watches during `note_gather`, if `rearm().0 == tracking::HELD`, stop arming redundant held watches and compute a fallback `host_digest` via `digest_runs` (`guarded_copy::available()` + `digest::Hasher::update_guest`). When all `host_runs` watches stay live (`Clean` / `Held` as on NVIDIA), `host_digest` stays `None` (zero CPU hashing). - In `unchanged(texture, gpu_now)`: refresh `last.seen = gpu_now` on clean checks, and throttle `digest_runs` re-verification under `once_per_frame()` once `stable >= 8` (invalidated whenever `remapped::PUBLICATIONS` advances, including on scatters). - Restore `SCRATCH_CHUNK = 32 << 20` (`32 MiB`) to keep chunked scratch VRAM bounded. --- ### 2. Summary of all local `fix1`–`fix10` changes (`c1139ab2` + `#657`) 1. **`runtime/d3d12/src/device/placement/handoffs.rs`, `remapped.rs`, `shader_buffers.rs`, `planes.rs`, `page_remap.rs`, `placement.rs`, `commands/submit.rs` (clearing the account-picker `0x80004001` wall on RADV):** - `handoffs.rs` (`plan`): when `direct || !stable || overlap == remapped::Overlap::FixedOrMirroredBuffer || buffers.indirect` (with `stable = stable_gate && !device.state.gpu_mappings.bindings_pending()`), degrade via `report_alias` to whole-submission ordering instead of returning `E_NOTIMPL`, while keeping intra-command `QueueBacked` draw/dispatch conflicts strict and logging real refusals via `diagnostics::log`. - `placement.rs` (`submit`): gate `copies.execute(..., gate_open && !device.state.gpu_mappings.bindings_pending(), ...)` on pending GPU mapping bindings. - `remapped.rs` (`conflicts_in_batch`): replace the hard `E_NOTIMPL` return when `has_null && write` on RT/UAV textures with `report_alias(...)`. - `shader_buffers.rs` (`Imports::visit`): skip non-live `Backing::Fixed` entries during conservative `accesses.indirect` scans instead of failing the batch with `E_NOTIMPL`. - `planes.rs` (`color_plane`): allow `D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET` (`0x300005` mask on non-BC formats) on both 2D and 3D `0x105` textures. 2. **`runtime/d3d12/src/device/heap/gpu_tiles.rs`, `pages.rs`, `heap_page_cache.rs` (fixing `24.6 GiB` `adapter system memory` leak):** - `gpu_tiles.rs`: restrict `shared_window()` to `MEM_MAPPED` (`Section::chunk_view`) so adjacent `MEM_PRIVATE` pages cannot produce `-EPERM` CS rejections if unmapped/`PAGE_NOACCESS`; add whole-cluster held + pinned `private_cluster_window()` (`"GPU private cluster"`). - `pages.rs` & `heap_page_cache.rs`: add `PageCache::get()` and a dedicated weak cache `PagePools::cluster_pieces` (keyed via `span_key`) + `PagePools::cached_piece()` so 64 KiB `GPU page mapping` churn does not evict 2 MiB clusters from `PagePools::pieces`. 3. **`runtime/d3d12/src/commands/page_mapping/buffers.rs`, `device/placement/tracking.rs`, `queue_copies.rs`, `queue_copies/detile.rs`, `queue_use.rs` (eliminating `17.76 GiB` staging spill, `0x4d8bd421` watchdogs, and enabling GPU-predicated gathers):** - `commands/page_mapping/buffers.rs`: add `generation: AtomicU64`, `overridden: AtomicBool`, `generation()`, `has_gpu_overrides()`, and `backed_host_runs()` to `BufferMapping`. - `tracking.rs`: add `Watch::clean_or_unbacked()` (`0 | 4` or `CELL_UNTRACKED` with `last_reason == UNBACKED`) for CPU-unbacked GPU reservations. - `queue_copies/detile.rs` & `queue_copies.rs`: wrap `Cache::upload()` waits and `wait_for_scratch()` in `crate::title_watchdog::pause()`, make `Lists.bytes`/`Lists.kernel` lazy, chunk multi-texture scratch with `SCRATCH_CHUNK = 32 << 20`, and add periodic `queued texture copies` stats. - `queue_use.rs` & `queue_copies.rs`: replace the exclusive `Images` `HashSet` with reader-writer `Slot { readers, writer }` + `split_access()`, reuse a single gather-only recording (`regathers[0]`) across `WaitPoint::After` label waits, and add `GatherMode::{SkipNow, PredicateAtHead, Always}` with `SetPredication(..., D3D12_PREDICATION_OP_NOT_EQUAL_ZERO)` + `Predication::evaluate()` run by `queue_use::Worker` at `fence == 1` before signaling `fence == 2` — plus the `fix10` `digest_runs` + `once_per_frame()` fallback above for RADV `HELD` watches. --- ### 3. Verification Status (`fix10`) Verified on `AMD Radeon RX 6900 XT (1002:73bf)` after `fix10` edits (`build.py lanes`): - `cargo fmt --check`: **pass** - `device::placement::queue_` Windows unit tests under GE-Proton `wine`: **12/12 pass** (including `digest_runs_detects_single_byte_change`, `gpu::predication_skips_detile_and_copy_on_gpu`, `gpu::dispatch_moves_the_same_bytes_as_the_copy_runs`, and `queue_use::tests::*`, 0 skipped) - `tuxbox.py verify --only lanes-selftest` with `TUXBOX_XMEM_PRIVATE_VIEWS=1`: **32/32 pass** Not run: - `fix10` has **not** been live-tested in ProjectScarlett yet (we stopped live testing after `fix9` due to the desktop/app lag), and nothing from today's local stack was tested on `AMD Raphael Radeon 610M iGPU (1002:164e)`.
JeffreyBytes commented 2026-12-03 01:03:32 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-12-03T01:03:32Z.


Taking the device loss on main 106120ca on AMD (Not enough memory for command submission, then VK_ERROR_DEVICE_LOST, about 3 minutes in on my RX 6700 XT). Since 106120ca, once the piece cache is full of live single-page imports, gpu_tile re-imports the same cluster windows over and over and GTT fills up. Details and numbers are in #666. I'm writing the fix now and will open a draft PR from my fork.

<!-- greyfinch-sync:brcly/TuxBox:comment:7363901604 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7363901604). Originally posted by [JeffreyBytes](https://github.com/JeffreyBytes) on 2026-12-03T01:03:32Z. --- Taking the device loss on main `106120ca` on AMD (`Not enough memory for command submission`, then `VK_ERROR_DEVICE_LOST`, about 3 minutes in on my RX 6700 XT). Since 106120ca, once the piece cache is full of live single-page imports, `gpu_tile` re-imports the same cluster windows over and over and GTT fills up. Details and numbers are in #666. I'm writing the fix now and will open a draft PR from my fork.
3kynox commented 2026-12-03 07:40:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 3kynox on 2026-12-03T07:40:29Z.


Console ray-tracing structures: the nine walks and the programs that shade their hits now run together in ProjectScarlett on an RTX 4070 Ti SUPER, and the room in the first playable scene is visibly lit by them. It took a five-line translator change, #670. It changes the HLSL of 3,601 of the title's compute requests in my cache, so they recompile; if you'd rather batch that with another translator change, say so there. Results, and what is still open, are on #586. Next for me: a walk that seems to read outside the structures buffer.

<!-- greyfinch-sync:brcly/TuxBox:comment:7371286119 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7371286119). Originally posted by [3kynox](https://github.com/3kynox) on 2026-12-03T07:40:29Z. --- Console ray-tracing structures: the nine walks and the programs that shade their hits now run together in ProjectScarlett on an RTX 4070 Ti SUPER, and the room in the first playable scene is visibly lit by them. It took a five-line translator change, #670. It changes the HLSL of 3,601 of the title's compute requests in my cache, so they recompile; if you'd rather batch that with another translator change, say so there. Results, and what is still open, are on #586. Next for me: a walk that seems to read outside the structures buffer.
NickStallman commented 2026-12-03 09:02:20 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-03T09:02:20Z.


Taking two small runtime/d3d12 fixes from ProjectScarlett runs on an RTX 5090. Each gets its own PR (draft until the checks are in), both on 106120ca:

  1. Inline ray scene check at submit (part of our top-level scenes line, #382). The title rewrites a heap descriptor that names a ray scene between recording and submit. That's legal: the descriptor is volatile, and the console reads it when the dispatch runs. The pre-submit check then refused the whole batch ("inline ray scene or geometry changed after recording, rejecting submission"), and the queue dropped every later batch. The fix keeps the recorded scene for a rewritten heap descriptor. Root views are still checked as before. #569 works on the root-view successor case in the same file. This doesn't overlap it; it only touches the heap-descriptor branch.
  2. Lazy publication of reserved images (follows #657). The publication-on-access copy of reserved (tiled) 256x256 R32_FLOAT images never completed, on a copy queue or a compute queue, while empty submissions on the same queues ran in 2–6 ms. The title's thread waited in its access fault, and the copy engine faulted (Xid 32). The fix publishes reserved images with their batch, as before lazy publication, and keeps committed images deferred. The performance cost isn't measured yet.
<!-- greyfinch-sync:brcly/TuxBox:comment:7373086603 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7373086603). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-03T09:02:20Z. --- Taking two small `runtime/d3d12` fixes from ProjectScarlett runs on an RTX 5090. Each gets its own PR (draft until the checks are in), both on `106120ca`: 1. **Inline ray scene check at submit (part of our top-level scenes line, #382).** The title rewrites a heap descriptor that names a ray scene between recording and submit. That's legal: the descriptor is volatile, and the console reads it when the dispatch runs. The pre-submit check then refused the whole batch ("inline ray scene or geometry changed after recording, rejecting submission"), and the queue dropped every later batch. The fix keeps the recorded scene for a rewritten heap descriptor. Root views are still checked as before. #569 works on the root-view successor case in the same file. This doesn't overlap it; it only touches the heap-descriptor branch. 2. **Lazy publication of reserved images (follows #657).** The publication-on-access copy of reserved (tiled) 256x256 R32_FLOAT images never completed, on a copy queue or a compute queue, while empty submissions on the same queues ran in 2–6 ms. The title's thread waited in its access fault, and the copy engine faulted (Xid 32). The fix publishes reserved images with their batch, as before lazy publication, and keeps committed images deferred. The performance cost isn't measured yet.
NickStallman commented 2026-12-03 12:01:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-03T12:01:17Z.


Taking one more runtime/d3d12 fix: a root SRV in a GPU reservation gets the same reach as one in committed memory. The PR will be a draft with its limits stated.

In ProjectScarlett, mesh draws bind root SRVs inside GPU reservations where the title streams models. A root in committed memory gets up to 4 MiB of reach (root_view_address). A root in a reservation got a shared view buffer that ends at the next 4 MiB boundary. A root just below that boundary is read past the buffer's end, which gives wrong data or, on an RTX 5090, an MMU fault (Xid 13). The fix: shared windows span two boundaries, clipped to the reservation, and a read-only root asks for its whole reach. It comes with a Lanes self-test, root-reach-reservation.

Overlap: #655 adds a Lanes test for #389's committed-memory root window. This test covers the reservation case, and the two only meet in the scenario lists. #667 touches heap.rs elsewhere. Root UAVs aren't covered.

<!-- greyfinch-sync:brcly/TuxBox:comment:7377498086 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7377498086). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-03T12:01:17Z. --- Taking one more `runtime/d3d12` fix: **a root SRV in a GPU reservation gets the same reach as one in committed memory.** The PR will be a draft with its limits stated. In ProjectScarlett, mesh draws bind root SRVs inside GPU reservations where the title streams models. A root in committed memory gets up to 4 MiB of reach (`root_view_address`). A root in a reservation got a shared view buffer that ends at the next 4 MiB boundary. A root just below that boundary is read past the buffer's end, which gives wrong data or, on an RTX 5090, an MMU fault (Xid 13). The fix: shared windows span two boundaries, clipped to the reservation, and a read-only root asks for its whole reach. It comes with a Lanes self-test, `root-reach-reservation`. Overlap: #655 adds a Lanes test for #389's committed-memory root window. This test covers the reservation case, and the two only meet in the scenario lists. #667 touches `heap.rs` elsewhere. Root UAVs aren't covered.
gtb-sbe commented 2026-12-03 13:05:25 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-12-03T13:05:25Z.


On AMD the title's streaming thread spends most of the load waiting on the GPU inside SRV and CBV creation. I think this adds to the submission cost in #669.

I ran ProjectScarlett on 106120ca + #667 on an RX 9060 XT (RADV / Mesa 26.3.1, GE-Proton11-15, default settings, so private backing). It got through the loading into the intro prestream, then stopped presenting and the title's watchdog fired, the same ending as in #669. I added a per-thread stack sampler that sorts every sample by where the thread is (10 s windows, 50 ms apart):

  • Streaming thread, 20 windows in a row (about 200 s) during the load: 98-100 % waiting inside TuxBox. Nearly all of it is InitTransition::wait_for_queue < initialize_gpu_tiles < register_buffer / register_texture < ... < views::addressed::address_srv (57-82 % per window) or views::mirrors::cbv (18-43 %). The rest is a contended mutex in placement::page_remap::mapped_texture.
  • An earlier run on 1e9fe932 + #660/#662 with private views forced showed the same thing (83 % in the last six minutes), so it isn't new with #667.

As I read device/allocation.rs, every SRV or CBV the title creates over page-mapped memory places a reserved buffer, runs UpdateTileMappings on the shared init queue, signals a fence and then blocks the creating thread with WaitForSingleObject(INFINITE) until it passes. That's a full submission per view, on the title's thread. With each submission costing 13-56 ms in amdgpu's userptr walk (#669), that cost lands directly in view creation. I'm guessing at that link; I haven't timed the waits on their own.

Would it be enough for the queues that later use the buffer to wait on that fence on the GPU, instead of the creating thread waiting on the CPU? Or could tile initialization for several views go into one submission? I haven't tried either; I wanted to ask first, since it's your design.

<!-- greyfinch-sync:brcly/TuxBox:comment:7379297901 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7379297901). Originally posted by [gtb-sbe](https://github.com/gtb-sbe) on 2026-12-03T13:05:25Z. --- On AMD the title's streaming thread spends most of the load waiting on the GPU inside SRV and CBV creation. I think this adds to the submission cost in #669. I ran ProjectScarlett on `106120ca` + #667 on an RX 9060 XT (RADV / Mesa 26.3.1, GE-Proton11-15, default settings, so private backing). It got through the loading into the intro prestream, then stopped presenting and the title's watchdog fired, the same ending as in #669. I added a per-thread stack sampler that sorts every sample by where the thread is (10 s windows, 50 ms apart): - **Streaming thread, 20 windows in a row (about 200 s) during the load: 98-100 % waiting inside TuxBox.** Nearly all of it is `InitTransition::wait_for_queue` < `initialize_gpu_tiles` < `register_buffer` / `register_texture` < ... < `views::addressed::address_srv` (57-82 % per window) or `views::mirrors::cbv` (18-43 %). The rest is a contended mutex in `placement::page_remap::mapped_texture`. - An earlier run on `1e9fe932` + #660/#662 with private views forced showed the same thing (83 % in the last six minutes), so it isn't new with #667. As I read `device/allocation.rs`, every SRV or CBV the title creates over page-mapped memory places a reserved buffer, runs `UpdateTileMappings` on the shared init queue, signals a fence and then blocks the creating thread with `WaitForSingleObject(INFINITE)` until it passes. That's a full submission per view, on the title's thread. With each submission costing 13-56 ms in amdgpu's userptr walk (#669), that cost lands directly in view creation. I'm guessing at that link; I haven't timed the waits on their own. Would it be enough for the queues that later use the buffer to wait on that fence on the GPU, instead of the creating thread waiting on the CPU? Or could tile initialization for several views go into one submission? I haven't tried either; I wanted to ask first, since it's your design.
1093i3511 commented 2026-12-03 14:53:47 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-12-03T14:53:47Z.


Plan for today on an RX 6600 (RDNA2, 8 GB, RADV / Mesa 26.3.1, GE-Proton11-15):

  1. Build 106120ca + #667 (JeffreyBytes' GTT fix for the device loss on AMD), run Lanes, prepare Series S.
  2. #663: run Series S (--graphics-profile series-s) and packaged back to back on that build, 8 minutes each, with TUXBOX_GPU_TIMING=1, as brcly asked. I'll check whether the FidelityFX 4 auto-exposure pass (3727a000) also fails to translate on RDNA2, which is turboheadcrab's lead for the black world.
  3. The same runs give an RDNA2 data point for #667 (does GTT stay bounded?) and for #669 (frame rate at the intro).

#661 is closed, so I've dropped my test offer there. Results will go on #663, with a pointer here.

<!-- greyfinch-sync:brcly/TuxBox:comment:7382215498 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/533#issuecomment-7382215498). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-12-03T14:53:47Z. --- Plan for today on an RX 6600 (RDNA2, 8 GB, RADV / Mesa 26.3.1, GE-Proton11-15): 1. Build `106120ca` + #667 (JeffreyBytes' GTT fix for the device loss on AMD), run Lanes, prepare Series S. 2. #663: run Series S (`--graphics-profile series-s`) and packaged back to back on that build, 8 minutes each, with `TUXBOX_GPU_TIMING=1`, as brcly asked. I'll check whether the FidelityFX 4 auto-exposure pass (`3727a000`) also fails to translate on RDNA2, which is turboheadcrab's lead for the black world. 3. The same runs give an RDNA2 data point for #667 (does GTT stay bounded?) and for #669 (frame rate at the intro). #661 is closed, so I've dropped my test offer there. Results will go on #663, with a pointer here.
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#533
No description provided.