Skip to content

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

Open
gtb-sbe wants to merge 1 commit into
brcly:mainfrom
gtb-sbe:d3d12-compute-root-first
Open

gtb-sbe wants to merge 1 commit into
brcly:mainfrom
gtb-sbe:d3d12-compute-root-first

Conversation

@gtb-sbe

@gtb-sbe gtb-sbe commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

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.

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.

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.

… cannot describe

For a pipeline root that compute_table::reflected cannot describe, a
program without an embedded root took its root-less translation first.
Its registers come from the program's own reflection, which that root
need not declare, so the host rejected the pipeline (vkd3d-proton:
"Failed to remap"). Translate such a program only against the pipeline
root, and give it a stand-in when that translation is refused, as the
reflected arm does. Programs with an embedded root keep the old order.

Lanes: compute-root scenario and lanes-compute-root verify suite.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant