dxil-spirv Failed to remap in ProjectScarlett: which bindings cause them (RX 9060 XT) #233
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-11-26T14:39:37Z.
This is the
Failed to remapitem fromdocs/FOCUS.md, measured on an RX 9060 XT (1002:7590, Mesa 26.2.6 RADV, GE-Proton11-14),mainat9b31fd8, ProjectScarlett 1.0.2.1 offline. It also answers my question on #216.Summary: All 108
vkd3d result -3in a run up to the player selection aredxil-spirv: Failed to remap ...: about 56 compute pipelines and about 52 raster pipelines. On the compute side, the cause is mostly in the provider's choice of translation, not in dxil-spirv:create_pipeline_x_inneruses the program's root-less translation.Compute, root by root. From the pipeline failure record, the runtime cache and roots captured with
TUXBOX_CAPTURE_RASTER_ROOTS/TUXBOX_CAPTURE_SHADER_INPUTS:missing, used the root-less onemimg … not a sampler descriptor (InlineWord(N)), 9×unmapped descriptor at s6 + …sampler_root); never asked for a root-keyed oneunmapped descriptor at s6 + …, 10×mubuf … atomic on a non-UAV buffer, 7 translatemissingmeant refused, not "not ready yet". That was my question on #216.t1, space3, three root constants atb502, flags0xc00or0x400.t126,t63, space1,b503and similar. These are exactly the most frequent remap failures (SRV0:12617×, SRV1:639×). The root-keyed translations use the root's own registers.Trying the root-keyed translation first. I ran a local change: in the last arm,
compute_with_rootbeforeprepared. Of the 7, only 1 is then fully covered by its root:s21, space1;s66): the #227 case.t5, space3while the root's SRV is att1, space3. That looks like a separate translator issue.So the order change only pays off together with #227's literal samplers.
What's left, as far as I can tell:
InlineWordrefusals and the missing literal samplers. This likely accounts for part of the compute drop JeffreyBytes measured there (127 to 112); not checked against his counts.compute_for_original_rootalready does; (b) when the root-keyed translation is refused, record that refusal instead of falling back to the root-less one. (b) doesn't deliver more pipelines, but the failure record would then name the real cause instead of "driver compile failed". I can make this change with a Lanes scenario once #227 is in, unless someone prefers to fold it in there.unmapped descriptor at s6 + …(24 compute programs),mubuf … atomic on a non-UAV buffer(10), and thet5, space3root-SRV mismatch (2).-3): not analysed yet. The raster roots are captured, so I can do the same breakdown if it helps.I'm happy to run the #227 PR on this card once it's open.
Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-11-26T16:53:25Z.
Update: the literal-sampler part of #227 is now #241. I checked it offline against the run behind this issue, and I also have a correction to the post above.
#241 against the captured compute pairs. These are the 223 compute (program, root) pairs captured in that run. Each one went through #241's
xshader(3870ac3) against three roots: the captured root alone, the root plus the samplersmainwould append (missing_literal_samplers, orprivatefor a root without static samplers), and the root plus the samplers #241 appends (literal_samplers->inline_sampler::unmatched). For the samplers I called the PR'stuxbox-dxbcdirectly. The test is CPU only, translation to HLSL only: no DXC, no GPU.mainappendsInlineWord(the same count as in the first row of the table above). All 15 have two tables, flags0xc00and 23 static samplers.mainappends nothing to them because of 0x800. #241 appends one or two samplers in space 32765 (s23,s24) above the root's own.image_store to a non-UAV table.b27, space1, which the root lacks (Open).unmapped descriptor at s6andatomic on a non-UAV bufferrefusals are unchanged, as expected.Correction: Above I wrote that 3 of the 7 root-keyed translations still lack a literal sampler (
s21, space1;s66), "the #227 case". That was wrong, because my register-coverage script read the wrong field of the static samplers. With that fixed:s21, space1is one of the root's static samplers.t5, space3against the root SRV att1, space3, as before.s66in a root with flag 0x800 that has nos66. That is not a literal state: neitherinline_sampler::privatenorunmatchedfinds one, and #241 appends nothing there. Cause still open.So the provider change I described (root-keyed translation before the root-less one, and keeping the refusal) doesn't depend on #241 after all. It would make 3 of these 7 fully covered on its own, though whether vkd3d accepts them is still untested on the GPU. #241's samplers apply to the other arm, the 2-table reflected roots.
Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-11-27T01:16:53Z.
@Valdi320 This is the reproduction material you asked for on #254. It contains only digests, binding metadata (FSSM, user-data and PSV rows, root ranges) and refusal text; no title bytes, ISA, HLSL or DXIL.
Tools and results
Everything is on a branch of my fork,
tools-capture-replay, atgithub.com/gtb-sbe/TuxBox@8534b11029. It has two commits onmainab644f0: the tools (1d8a5ee) and the results (8534b11), so either can be taken alone.tools/capture-replay/is a small Rust tool. For a captured (program, root) pair it rebuilds the root the provider translates against in its pipeline arm, writes the translator request, and prints the program's binding evidence.tools/replay_captures.pyruns it,xshaderand optionally DXC, DXV and dxil-spirv over a whole capture directory. Usage, capture steps and limits are intools/capture-replay/README.md.evidence/projectscarlett-compute-captures/holds my results:main;The scripts behind my earlier numbers were rough local helpers. I rebuilt them properly for this branch and checked that the rebuilt tool reproduces the earlier per-pair results exactly. It also reproduces one variant digest of the launch (
f5d8bc6c->43ab2740). If something doesn't build, doesn't match what you see, or is unclear, please ask.The root choice in
capture-replayis a copy of the compute half ofruntime/d3d12/src/device/compute_table.rsatab644f0. The provider code serializes roots through D3D12 and only builds for Windows, so the tool cannot call it directly. If the tool proves useful, it could become a PR. That would mean moving that logic intotuxbox-dxbcand sharing it, which is a larger change, so I'd like your view first, also because #249 covers nearby ground.Baseline on
mainab644f0The captures are the ones from #233: 223 compute pairs from one offline launch on 2026-11-26 (title 1.0.2.1,
main9b31fd8, GE-Proton11-14).34f0ff8. 40 have every register covered;6900aba9andf5d8bc6clacks66, space0.v_readlane_b32in a non-uniform loop 24,mubuf ... atomic on a non-UAV buffer16, raw BVH node intersection 15, compute swizzle in a loop 15.The atomic pairs: FSSM, user data and PSV agree on a UAV; only the root disagrees
24 compute pairs read or write a UAV at a slot the root covers with an SRV or CBV range. For each such slot, three independent records name the same UAV:
0x303, slot = byte offset / 8;uav-typedoruav-structwith that register.Mismatches like this are common. 192 of the 223 pairs have at least one descriptor slot whose FSSM class differs from the root's range type (714 rows in
mismatches.tsv). Most never show: the translator refuses only writes and atomics to slots it sees as non-UAV.On
main, 8 of the 24 are already handled. For two-table roots,reflected_rootrewrites each table from the user-data-verified bindings, and each range takes the type of its binding:ed8f3a88,17e1f58e,1b98915banda640d8aatranslate.310219f6,e5fbc632,1b1f74adandb649cf1fget past the type check and then refuse for other reasons: a wave reduction after an early exit, the 8 MiB HLSL budget, and mixed access widths on a raster image.My earlier counts replayed this arm against the captured root and so overstated the class.
The remaining 16 all have a three-table root (
7e366593orc78d33d8: three tables, a root SRVt1, space3, three root constants, flags0xc00or0x400). For these,compute_root_bindingsreturns nothing, so the rewrite never runs.read_bindingsmaps FSSM class0x100(a root SRV) only for raster stages (raster_root_srvrequiresstage <= 1). Every program under these roots has one, thet5, space3record #252 renames, soread_bindingsreturns None at that row. The provider then takesappend_corroborated_rangesor the last arm, and neither changes the type of a covered range.Experiment (
root-srv-experiment.patch; offline only, not a PR):The existing root-SRV user-data check passes for these programs. It requires a user-data row
[1, 0, 2, register, location >> 8], offset 0, and an SRV descriptor as the root parameter. Result:eb54f26alackss66.tuxbox-dxbctests pass with the line.So the class may not need a new SRV-to-UAV rule. The line would move it onto the binding check
mainalready applies to two-table roots. It also moves 25 working pairs from the append or last arm to the rewrite, so it needs a Lanes scenario and GPU runs before it could be a fix.The slot layouts come in families
This addresses your binding-proof question, but it does not settle it. Table 0 of the captured roots has 126, 197 or 261 slots. Within each length, every root that declares
u7/u6places them at the same slot pair:u7/u6at slotsd3c8fca47e366593,58a4776e,4e7092f6,3ccadccfc78d33d8,b6e7e31dEach program's FSSM uses one of the three positions:
7e366593(197 slots): 9 programs useu7/u6at 119/120 (refused), 12 at 186/187 (matching the root's own UAV range), and 10 at 235/236. Those 10 are past the table end and are the pairsappend_corroborated_rangesalready recovers.c78d33d8(261 slots): 3 programs at 119/120 and 4 at 186/187 (refused), 3 at 235/236 (matching).So each atomic program carries the slot layout of one family, and its pipeline root belongs to another. Every program appears with exactly one root in the captures, so they cannot tell the two explanations apart:
The evidence that would decide it needs a game run. Per compute pipeline, log the guest root pointer, a creation serial and the root digest. Per dispatch, log the view type the title wrote into the heap slots the table argument covers at those offsets (
CreateUnorderedAccessVieworCreateShaderResourceView). I can write that trace and run it on an RX 9060 XT if it helps. I have not started on it.The rows
Digests are the first 8 hex digits of the SHA-256 of the stage bytes and of the RTS0 payload, as in the capture file names. "With the root-SRV line" is the experiment.
capture-replay recordsprints these rows for any pair.mainmain0d0cb96d-7e3665930x303, offset 952, reg 7t112, space00d0cb96d-7e3665930x303, offset 960, reg 6t379, space017e1f58e-2cde983e0x303, offset 176, reg 22b18, space11b1f74ad-b4b9b3430x303, offset 0, reg 10t14, space11b98915b-2cde983e0x303, offset 176, reg 22b18, space12580c6c3-7e3665930x303, offset 952, reg 7t112, space02580c6c3-7e3665930x303, offset 960, reg 6t379, space0310219f6-462cddf00x303, offset 8, reg 43t355, space1310219f6-462cddf00x303, offset 16, reg 52t16, space1310219f6-462cddf00x303, offset 24, reg 62t331, space13cbf356b-c78d33d80x303, offset 952, reg 7t109, space03cbf356b-c78d33d80x303, offset 960, reg 6t28, space05a8fc834-7e3665930x303, offset 952, reg 7t112, space05a8fc834-7e3665930x303, offset 960, reg 6t379, space05c555885-7e3665930x303, offset 952, reg 7t112, space05c555885-7e3665930x303, offset 960, reg 6t379, space05c934f6c-c78d33d80x303, offset 952, reg 7t109, space05c934f6c-c78d33d80x303, offset 960, reg 6t28, space093d5cec6-c78d33d80x303, offset 1488, reg 7t76, space093d5cec6-c78d33d80x303, offset 1496, reg 6t331, space0a640d8aa-c4e003780x303, offset 480, reg 17t47, space0a640d8aa-c4e003780x303, offset 496, reg 31t286, space0a640d8aa-c4e003780x303, offset 504, reg 30t55, space0b649cf1f-b4b9b3430x303, offset 0, reg 10t14, space1b6860255-c78d33d80x303, offset 1488, reg 7t76, space0b6860255-c78d33d80x303, offset 1496, reg 6t331, space0c517fce0-c78d33d80x303, offset 1488, reg 7t76, space0c517fce0-c78d33d80x303, offset 1496, reg 6t331, space0cf85ed51-7e3665930x303, offset 952, reg 7t112, space0cf85ed51-7e3665930x303, offset 960, reg 6t379, space0d52f30e0-7e3665930x303, offset 952, reg 7t112, space0d52f30e0-7e3665930x303, offset 960, reg 6t379, space0d7e11860-c78d33d80x303, offset 1488, reg 7t76, space0d7e11860-c78d33d80x303, offset 1496, reg 6t331, space0db4ce27b-7e3665930x303, offset 952, reg 7t112, space0db4ce27b-7e3665930x303, offset 960, reg 6t379, space0e5fbc632-030389c60x303, offset 16, reg 50t236, space1e74749b5-c78d33d80x303, offset 952, reg 7t109, space0e74749b5-c78d33d80x303, offset 960, reg 6t28, space0eb54f26a-7e3665930x303, offset 952, reg 7t112, space0eb54f26a-7e3665930x303, offset 960, reg 6t379, space0ed8f3a88-931cdd4d0x303, offset 16, reg 13t269, space1f038ad55-7e3665930x303, offset 952, reg 7t112, space0f038ad55-7e3665930x303, offset 960, reg 6t379, space0Generating the captures from your copy
The capture is upstream code (
compute_table::capture_stage_root):TUXBOX_CAPTURE_SHADER_INPUTS=<dir>writes<sha256>.dxbc, the stage bytes as passed to pipeline creation.TUXBOX_CAPTURE_RASTER_ROOTS=<dir>writes<stage sha256>-<RTS0 sha256>.rootsig, the serialized root. It captures compute roots too.main, compute pairs are written when theReflectedarm finds no translation, when the last arm refuses a root-less program (#260), and when the driver rejects the pipeline.My captures came from such a launch on
main9b31fd8. It reached a state with 22 draws per frame after about 46 minutes and was stopped after 51 minutes. On currentmainthe same variables should capture at least these compute pairs: two of the three capture points above already existed at9b31fd8, and #260 added the third. Inferred, not run. The captures contain title code, so keep them local.Then:
What I cannot share
The captures, and ISA, HLSL or DXIL of the title. In place of ISA excerpts, a hand-written reproduction of the binding shape could be built:
u7/u6at those slots and which runs a buffer atomic on them.That would also be the Lanes scenario for the line above.
Not run
GPU, a game run, vkd3d-proton with real bindings, raster pairs, the line in the provider.
capture-replaydoes not rebuild the bindless index map, the heap stride retry or programs with an embedded root.Host: RX 9060 XT, Mesa 26.2.6 RADV, GE-Proton11-14.
The analysis, the tools on the branch, the offline runs and this write-up were done with an AI coding agent (Claude Code) on this machine.
Imported from brcly/TuxBox. Originally posted by brcly on 2026-12-02T21:35:44Z.
Closing as stale. The literal-sampler part became #241, and the capture tools and results are on your fork. If any of the remap failures still show up on current main, please open a new issue with a fresh run. Thanks for the detailed work.