d3d12: translate root-less compute programs against a root reflection cannot describe #260

Merged
gtb-sbe merged 1 commit from upstream-pr/260 into main 2026-11-26 21:27:17 +00:00
gtb-sbe commented 2026-11-26 18:46:40 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-11-26T18:46:40Z.


Follow-up to #233 (options (a) and (b) there).

Change

create_pipeline_x_inner, last arm: a root compute_table::reflected cannot describe, with no literal samplers to add. An Xbox compute program without an embedded RTS0 is now translated only against the pipeline root. If there is no such translation, the pipeline gets a stand-in, as the reflected arm already does.

Before, the root-less translation came first. A program the translator refused for the root got it as well, and when the host rejected that, the provider passed the raw Xbox shader to the driver.

Programs with an embedded root, portable DXIL and pipelines without a root keep the old order.

Why

Without an embedded root, only the pipeline root says which register each descriptor binds to. The root-less translation takes its registers from the program's own FSSM and PSV reflection, and in this arm nothing checks them against the root. The console binds by table slot, so the root usually declares other registers, and vkd3d-proton cannot remap them (dxil-spirv: Failed to remap ..., vkd3d -3). Even where the root happens to declare such a register, it need not be at the slot the program reads.

compute_for_original_root states the same rule for the Original arm ("a rootless program must use the actual pipeline root").

Why not programs with an embedded root

A first version also moved those to the pipeline root (via compute_for_original_root). Two existing Lanes checks failed on it:

  • lanes-wave-shader-narrow loaded a root-keyed variant instead of the source translation it expects.
  • lanes-shader-cache-wave-alloc dispatched a stand-in. Its program embeds a UAV-table root and runs under a root UAV descriptor. The embedded-root translation binds there because both say u0, space0, but no translation exists for the pipeline root.

So existing programs do rely on the old order for embedded roots. #233's evidence covers only root-less programs, which is what the ProjectScarlett failures are.

ProjectScarlett

Title 1.0.2.1, from the run behind #233. RX 9060 XT, Mesa 26.2.6 RADV, GE-Proton11-14.

  • A run with (a) only (root-keyed first, root-less still as fallback): the 3 programs whose root-keyed translation is fully covered by their root were translated for it and are no longer in the failure record. In the earlier run all 3 had used the root-less translation and failed with -3.
  • The 4 that still failed are the ones whose root-keyed translation declares registers the root lacks. vkd3d names them: SRV 3:5 (the t5, space3 pair, see #252) and sampler 0:66 (2, cause open).
  • 25 programs were refused for their root and fell back to the root-less translation, which failed with -3. With (b) they become stand-ins, and the failure record keeps the refusal (unmapped descriptor at s6 + ..., mubuf ... atomic on a non-UAV buffer, see #254) instead of a driver failure. (b) delivers no more pipelines. Not run in the title yet.
  • #252 and #254 change what the root-keyed translation emits or accepts. For programs in this arm whose root-less translation exists, that translation is requested only with this change.

Test

New Lanes scenario compute-root (verify suite lanes-compute-root). It uses two hand-written root-less compute programs (shader_fixture.py, not from any game) under a v1.0 root with three descriptor tables. There are no user-data records, so the provider cannot reflect the root. Both programs store through table 1, and their FSSM record and PSV binding name the UAV u3, space2, which the root does not declare.

  • The first stores through slot 2, which the root declares as u2, space1. It must write its word to that view.
  • The second stores through slot 5, past the table. The translator refuses it for the root (unmapped descriptor at s5 + 0xa0), and it must get a stand-in.
  • verify also fails if either program was translated without its root, or if anything but that one stand-in was substituted.
  • Without the change: FAIL lanes-compute-root, view 10 kept its decoy: a stand-in pipeline or a skipped dispatch, two stand-ins. With it: PASS.

What can now become a stand-in

A root-less program in this arm with no translation for its root (refused, no reply within 90 s, or no host worker) gets a stand-in instead of the root-less translation. Programs with an embedded root are unchanged. I have no Frosty package and could not check whether a title relied on the root-less translation for a program without an embedded root here.

Checks

RX 9060 XT (RDNA4), Mesa 26.2.6 RADV, kernel 6.18, GE-Proton11-14.

  • python tuxbox.py check --no-gpu: all six groups pass.
  • python tuxbox.py check --backend proton --adapter 1002:7590 --proton <GE-Proton11-14> --prefix <prefix> --windows-dxc <DXC 2026-09-29> on 5c5677b with this change: all checks pass (113, translator 18/18 cases).
Summary
  passed   Build the shader compiler (0s)
  passed   Python tests (5s)
  passed   Shader compiler tests (1s)
  passed   DXBC tests (0s)
  passed   XG layout tests (1s)
  passed   D3D12 Windows typecheck (0s)
  passed   Build (49s)
  passed   Lanes and fixtures on the GPU (393s)
  passed   D3D12 regression controls (119s)
  passed   Shader translator on the GPU (379s)
  • NVIDIA run still missing.

brcly's first point on #235 asks the same of the reflected arm (require the rooted translation rather than fall back to prepared). This change leaves that arm alone.

AI use

This branch was made with an AI coding agent (Claude Opus 5.5 via Claude Code, following AGENTS.md). The agent did the analysis of the run data behind #233, the provider change, the Lanes scenario, the unit tests and this description. The game runs, the Lanes runs and the full check above ran on my machine.

No title files, shader bytes or logs included.

<!-- greyfinch-sync:brcly/TuxBox:issue:5515497780 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/260). Originally posted by [gtb-sbe](https://github.com/gtb-sbe) on 2026-11-26T18:46:40Z. --- Follow-up to #233 (options (a) and (b) there). ## Change `create_pipeline_x_inner`, last arm: a root `compute_table::reflected` cannot describe, with no literal samplers to add. An Xbox compute program **without an embedded RTS0** is now translated only against the pipeline root. If there is no such translation, the pipeline gets a stand-in, as the reflected arm already does. Before, the root-less translation came first. A program the translator refused for the root got it as well, and when the host rejected that, the provider passed the raw Xbox shader to the driver. Programs with an embedded root, portable DXIL and pipelines without a root keep the old order. ## Why Without an embedded root, only the pipeline root says which register each descriptor binds to. The root-less translation takes its registers from the program's own FSSM and PSV reflection, and in this arm nothing checks them against the root. The console binds by table slot, so the root usually declares other registers, and vkd3d-proton cannot remap them (`dxil-spirv: Failed to remap ...`, vkd3d `-3`). Even where the root happens to declare such a register, it need not be at the slot the program reads. `compute_for_original_root` states the same rule for the `Original` arm ("a rootless program must use the actual pipeline root"). ## Why not programs with an embedded root A first version also moved those to the pipeline root (via `compute_for_original_root`). Two existing Lanes checks failed on it: - `lanes-wave-shader-narrow` loaded a root-keyed variant instead of the source translation it expects. - `lanes-shader-cache-wave-alloc` dispatched a stand-in. Its program embeds a UAV-table root and runs under a root UAV descriptor. The embedded-root translation binds there because both say `u0, space0`, but no translation exists for the pipeline root. So existing programs do rely on the old order for embedded roots. #233's evidence covers only root-less programs, which is what the ProjectScarlett failures are. ## ProjectScarlett Title 1.0.2.1, from the run behind #233. RX 9060 XT, Mesa 26.2.6 RADV, GE-Proton11-14. - A run with (a) only (root-keyed first, root-less still as fallback): the 3 programs whose root-keyed translation is fully covered by their root were translated for it and are no longer in the failure record. In the earlier run all 3 had used the root-less translation and failed with `-3`. - The 4 that still failed are the ones whose root-keyed translation declares registers the root lacks. vkd3d names them: `SRV 3:5` (the `t5, space3` pair, see #252) and `sampler 0:66` (2, cause open). - 25 programs were refused for their root and fell back to the root-less translation, which failed with `-3`. With (b) they become stand-ins, and the failure record keeps the refusal (`unmapped descriptor at s6 + ...`, `mubuf ... atomic on a non-UAV buffer`, see #254) instead of a driver failure. (b) delivers no more pipelines. Not run in the title yet. - #252 and #254 change what the root-keyed translation emits or accepts. For programs in this arm whose root-less translation exists, that translation is requested only with this change. ## Test New Lanes scenario `compute-root` (verify suite `lanes-compute-root`). It uses two hand-written root-less compute programs (`shader_fixture.py`, not from any game) under a v1.0 root with three descriptor tables. There are no user-data records, so the provider cannot reflect the root. Both programs store through table 1, and their FSSM record and PSV binding name the UAV `u3, space2`, which the root does not declare. - The first stores through slot 2, which the root declares as `u2, space1`. It must write its word to that view. - The second stores through slot 5, past the table. The translator refuses it for the root (`unmapped descriptor at s5 + 0xa0`), and it must get a stand-in. - `verify` also fails if either program was translated without its root, or if anything but that one stand-in was substituted. - Without the change: `FAIL lanes-compute-root`, `view 10 kept its decoy: a stand-in pipeline or a skipped dispatch`, two stand-ins. With it: `PASS`. ## What can now become a stand-in A root-less program in this arm with no translation for its root (refused, no reply within 90 s, or no host worker) gets a stand-in instead of the root-less translation. Programs with an embedded root are unchanged. I have no Frosty package and could not check whether a title relied on the root-less translation for a program without an embedded root here. ## Checks RX 9060 XT (RDNA4), Mesa 26.2.6 RADV, kernel 6.18, GE-Proton11-14. - `python tuxbox.py check --no-gpu`: all six groups pass. - `python tuxbox.py check --backend proton --adapter 1002:7590 --proton <GE-Proton11-14> --prefix <prefix> --windows-dxc <DXC 2026-09-29>` on `5c5677b` with this change: all checks pass (113, translator 18/18 cases). ```text Summary passed Build the shader compiler (0s) passed Python tests (5s) passed Shader compiler tests (1s) passed DXBC tests (0s) passed XG layout tests (1s) passed D3D12 Windows typecheck (0s) passed Build (49s) passed Lanes and fixtures on the GPU (393s) passed D3D12 regression controls (119s) passed Shader translator on the GPU (379s) ``` - NVIDIA run still missing. ## Related brcly's first point on #235 asks the same of the reflected arm (require the rooted translation rather than fall back to `prepared`). This change leaves that arm alone. ## AI use This branch was made with an AI coding agent (Claude Opus 5.5 via Claude Code, following `AGENTS.md`). The agent did the analysis of the run data behind #233, the provider change, the Lanes scenario, the unit tests and this description. The game runs, the Lanes runs and the full `check` above ran on my machine. No title files, shader bytes or logs included.
Valdi320 commented 2026-11-26 20:06:59 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by Valdi320 on 2026-11-26T20:06:59Z.


Combined NVIDIA validation with #252 and #254 on b3184d3: github.com/Valdi320/TuxBox@d0e7b7e2ef. The new lanes-compute-root gate passes, plus eleven other selected Lanes gates (including new compute-root-recovery). Found and fixed a separate append-root descriptor bookkeeping bug in that integration branch; details in #254. This is not a standalone #260 GPU run or a retail test. Thank you for the root selection fix.

<!-- greyfinch-sync:brcly/TuxBox:comment:7202315418 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/260#issuecomment-7202315418). Originally posted by [Valdi320](https://github.com/Valdi320) on 2026-11-26T20:06:59Z. --- Combined NVIDIA validation with #252 and #254 on b3184d3: https://github.com/Valdi320/TuxBox/tree/d0e7b7e2ef4128e7fc9933172f03deac2ad78907. The new lanes-compute-root gate passes, plus eleven other selected Lanes gates (including new compute-root-recovery). Found and fixed a separate append-root descriptor bookkeeping bug in that integration branch; details in #254. This is not a standalone #260 GPU run or a retail test. Thank you for the root selection fix.
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!260
No description provided.