d3d12: bind a console ray walk that declares only its node buffer #578

Closed
csj0oe wants to merge 1 commit from upstream-pr/578 into main
csj0oe commented 2026-11-30 07:17:25 +00:00 (Migrated from github.com)

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


What

A translated console ray walk that declares only its node buffer — t0, space 901 — was refused by the private-root matcher, which required exactly t0 + b0. The shader then ran on the title's root with no space-901 binding and vkd3d/dxil-spirv failed the compile with Failed to remap SRV 901:0; the title logs that 48 times a run.

  • BvhPlan replaces the boolean: Nodes accepts a raw SRV at (space 901, register 0) and appends only that root SRV; NodesAndOffsets keeps the t0+b0 path byte-for-byte.
  • BvhHeap.bases is optional and created only for the offsets case; anything else in space 901 (only the cbuffer, extra registers, a typed SRV, title use) is still refused.

Evidence

The emitter always writes both declarations, but the cbuffer is read only from bvh_node::scene_base, which a plain raw-buffer walk never calls. Compiling the emitted shape with an unread b0 gives PSV0 class=4 space=901 reg=0 kind=11 and no CBV entry — the same list as a shader with only t0.

Tests

  • Failing first: with the old exact-pair match, the new SRV-only test fails (left: None, right: Some(Nodes)).
  • compute_scene suite 4/4; full D3D12 unit binary 461 passed on an RX 7600; the two GPU scene-publication tests included.
  • NVIDIA: check 200 passed, 0 failed on an RTX 5090 (620.70.10, GE-Proton11-14) at head 5f2c0f23, reported by @NickStallman. The current head differs from it only by one line in tests/compile_gate.rs, which has not been run on NVIDIA.

Overlap

#525 writes console-format scene data in a separate crate and does not touch this binding; asked on #533 whether #382/#525 intended to cover it; @NickStallman confirmed the t0-only binding is ours to take, and #525 landed without touching it, so this is the tested part we own. Happy to fold it into another change if it belongs there.

<!-- greyfinch-sync:brcly/TuxBox:issue:5560818008 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/578). Originally posted by [csj0oe](https://github.com/csj0oe) on 2026-11-30T07:17:25Z. --- ## What A translated console ray walk that declares only its node buffer — `t0, space 901` — was refused by the private-root matcher, which required exactly `t0` + `b0`. The shader then ran on the title's root with no space-901 binding and vkd3d/dxil-spirv failed the compile with `Failed to remap SRV 901:0`; the title logs that 48 times a run. - `BvhPlan` replaces the boolean: `Nodes` accepts a raw SRV at `(space 901, register 0)` and appends only that root SRV; `NodesAndOffsets` keeps the `t0`+`b0` path byte-for-byte. - `BvhHeap.bases` is optional and created only for the offsets case; anything else in space 901 (only the cbuffer, extra registers, a typed SRV, title use) is still refused. ## Evidence The emitter always writes both declarations, but the cbuffer is read only from `bvh_node::scene_base`, which a plain raw-buffer walk never calls. Compiling the emitted shape with an unread `b0` gives PSV0 `class=4 space=901 reg=0 kind=11` and no CBV entry — the same list as a shader with only `t0`. ## Tests - Failing first: with the old exact-pair match, the new SRV-only test fails (`left: None, right: Some(Nodes)`). - `compute_scene` suite 4/4; full D3D12 unit binary 461 passed on an RX 7600; the two GPU scene-publication tests included. - NVIDIA: `check` 200 passed, 0 failed on an RTX 5090 (620.70.10, GE-Proton11-14) at head `5f2c0f23`, reported by @NickStallman. The current head differs from it only by one line in `tests/compile_gate.rs`, which has not been run on NVIDIA. ## Overlap #525 writes console-format scene data in a separate crate and does not touch this binding; asked on #533 whether #382/#525 intended to cover it; @NickStallman confirmed the `t0`-only binding is ours to take, and #525 landed without touching it, so this is the tested part we own. Happy to fold it into another change if it belongs there.
NickStallman commented 2026-11-30 09:56:31 +00:00 (Migrated from github.com)

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


@csj0oe NVIDIA check, RTX 5090 (10de:2b85, 620.70.10, GE-Proton11-14), full python tuxbox.py check, no uncommitted changes, at 5f2c0f23 (your earlier head, on e5d2e913): 200 pass, 0 fail. The current head 98b45f78 differs from it only by one line in tests/compile_gate.rs, and I haven't run that one. AMD wasn't run here. None of our eight ProjectScarlett logs has a "Failed to remap SRV 901:0" line, so the game says nothing about this on our card.

Evidence: TuxBox check of 5f2c0f239d, no uncommitted changes, GPU 10de:2b85: 16 passed, 0 failed, 0 not run

<!-- greyfinch-sync:brcly/TuxBox:comment:7274893896 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/578#issuecomment-7274893896). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T09:56:31Z. --- @csj0oe NVIDIA check, RTX 5090 (`10de:2b85`, 620.70.10, GE-Proton11-14), full `python tuxbox.py check`, no uncommitted changes, at 5f2c0f23 (your earlier head, on e5d2e913): **200 pass, 0 fail**. The current head 98b45f78 differs from it only by one line in `tests/compile_gate.rs`, and I haven't run that one. AMD wasn't run here. None of our eight ProjectScarlett logs has a "Failed to remap SRV 901:0" line, so the game says nothing about this on our card. Evidence: TuxBox check of 5f2c0f239d4f, no uncommitted changes, GPU 10de:2b85: 16 passed, 0 failed, 0 not run
brcly commented 2026-11-30 10:02:46 +00:00 (Migrated from github.com)

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


Merged into main as ce3632c2 (squashed and credited to you). Thanks.

I checked the claim on our recorded corpus before merging. Of the 126 requests that declare space 901, main's translator plus DXC leaves 28 with only t0, space901, which is exactly the case main refused. The compute-scene tests pass under Wine.

I dropped the compile_gate.rs hunk, because main already has a Miri marker on that test.

<!-- greyfinch-sync:brcly/TuxBox:comment:7275039385 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/578#issuecomment-7275039385). Originally posted by [brcly](https://github.com/brcly) on 2026-11-30T10:02:46Z. --- Merged into main as ce3632c2 (squashed and credited to you). Thanks. I checked the claim on our recorded corpus before merging. Of the 126 requests that declare space 901, main's translator plus DXC leaves **28** with only `t0, space901`, which is exactly the case main refused. The compute-scene tests pass under Wine. I dropped the `compile_gate.rs` hunk, because main already has a Miri marker on that test.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
brcly/TuxBox!578
No description provided.