xshader: resolve inline compute root SRVs by the actual root parameter #252

Merged
Valdi320 merged 1 commit from upstream-pr/252 into main 2026-11-26 21:27:17 +00:00
Valdi320 commented 2026-11-26 17:16:18 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by Valdi320 on 2026-11-26T17:16:18Z.


Candidate for the t5 space3 vs t1 space3 mismatch reported by @gtb-sbe in #233. The inline raw SRV path previously took the register from FSSM/PSV, even when the pipeline root assigned the same physical parameter to a different register. The complete local descriptor construction also selected the single PSV resource without checking the actual root.

For compute with an explicit root, resolve the physical argument only when a unique FSSM used-resource row, independent user-data record and raw PSV row corroborate the root parameter and SGPR. Use the actual root SRV register and space. Do not overwrite another resource's name when spaces differ. Root-less and other-stage paths are unchanged. Missing or conflicting metadata cannot justify a remap.

Validation (base cfc56eb):

  • New synthetic regression reproduces Raw(5,false) before the patch; after it emits t1, space3 and the eight expected individual loads.
  • Eight invalid metadata variants refuse translation (missing/ambiguous records, wrong class or visibility, etc.).
  • New root-srv-remap translator GPU control binds a real root SRV at t1 space3; existing raw-index control remains intact. Both executed with rebuilt provider on RTX 4080 / GE-Proton11-14: 16 total cases, 6144 words, zero mismatches (including untouched guards).
  • All six no-GPU groups passed. Lanes rebuild attempted but stopped at the unrelated copy_resource_guest.cpp compile with exit 137 while another application was active. Full GPU suite and AMD validation outstanding; not marked as passed.

I do not have the two recorded shader/root pairs from #233. This fixes a reproduced mechanism matching their reported register discrepancy, not proof that those title shaders now work. If convenient, please test this patch against those two local captured pairs, particularly whether the emitted SRV matches the actual root and DXC/vkd3d accept it. No title files needed in the PR. Independent of provider selection-order work and #241/#246 sampler changes. Draft pending review and additional validation.

<!-- greyfinch-sync:brcly/TuxBox:issue:5514359611 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/252). Originally posted by [Valdi320](https://github.com/Valdi320) on 2026-11-26T17:16:18Z. --- Candidate for the t5 space3 vs t1 space3 mismatch reported by @gtb-sbe in #233. The inline raw SRV path previously took the register from FSSM/PSV, even when the pipeline root assigned the same physical parameter to a different register. The complete local descriptor construction also selected the single PSV resource without checking the actual root. For compute with an explicit root, resolve the physical argument only when a unique FSSM used-resource row, independent user-data record and raw PSV row corroborate the root parameter and SGPR. Use the actual root SRV register and space. Do not overwrite another resource's name when spaces differ. Root-less and other-stage paths are unchanged. Missing or conflicting metadata cannot justify a remap. Validation (base cfc56eb): - New synthetic regression reproduces Raw(5,false) before the patch; after it emits t1, space3 and the eight expected individual loads. - Eight invalid metadata variants refuse translation (missing/ambiguous records, wrong class or visibility, etc.). - New root-srv-remap translator GPU control binds a real root SRV at t1 space3; existing raw-index control remains intact. Both executed with rebuilt provider on RTX 4080 / GE-Proton11-14: 16 total cases, 6144 words, zero mismatches (including untouched guards). - All six no-GPU groups passed. Lanes rebuild attempted but stopped at the unrelated copy_resource_guest.cpp compile with exit 137 while another application was active. Full GPU suite and AMD validation outstanding; not marked as passed. I do not have the two recorded shader/root pairs from #233. This fixes a reproduced mechanism matching their reported register discrepancy, not proof that those title shaders now work. If convenient, please test this patch against those two local captured pairs, particularly whether the emitted SRV matches the actual root and DXC/vkd3d accept it. No title files needed in the PR. Independent of provider selection-order work and #241/#246 sampler changes. Draft pending review and additional validation.
gtb-sbe commented 2026-11-26 19:39:27 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-11-26T19:39:27Z.


@Valdi320 I tested #252 offline against the two captured pairs from #233.

Result:

both programs (081be2a8 and 6b9780f3, root 7e366593) now declare the root SRV as t1, space3 instead of t5, space3. Every register they declare is now in their captured root. Before the patch, t5, space3 was the only register missing from the root, which matches the Failed to remap SRV 3:5 vkd3d reported in our run 12. The result is the same at b141cbd, with the patch applied to main f0ffa49, and on your combined branch 0b86078.

  • DXC and DXV accept both (cs_6_0, using the runtime's compile_dxil flags; nixpkgs DXC 1.10.2605.37 on Linux).
  • dxil-spirv 34f0ff8 (the version vkd3d-proton pins in GE-Proton11-14) converts both, and the SPIR-V validates. It does not apply root bindings, so the remap half of the check is the register comparison above.
  • 081be2a8 changes one more name. The t5 (space 0) StructuredBuffer had the alias sbuf65541 because the root SRV had taken name 5; it now keeps sbuf5. No other register changes.
  • Across all 223 captured compute pairs, no other pair changes status or refusal text. 7/223 translate with the captured root before and after, and 20/223 with #241's samplers.

In game this needs #260. Neither program carries an RTS0, and the provider's reflection gives Unsupported for this root, so both take the last arm of create_pipeline_x_inner. On main that arm uses the root-less translation first and never requests the root-keyed one this PR fixes. #260 makes that arm request it. 0b86078 does not include #260, so a game run of it would still use the root-less translations for these two.

Not run: GPU, a game run, root-srv-remap on AMD, vkd3d with real bindings.

Host: RX 9060 XT, Mesa 26.2.6 RADV, GE-Proton11-14. This only sets the dxil-spirv version; nothing ran on the GPU. Baseline xshader from f0ffa49.

The offline runs and this write-up were done with an AI coding agent (Claude Code) on this machine.

<!-- greyfinch-sync:brcly/TuxBox:comment:7201823668 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/252#issuecomment-7201823668). Originally posted by [gtb-sbe](https://github.com/gtb-sbe) on 2026-11-26T19:39:27Z. --- @Valdi320 I tested #252 offline against the two captured pairs from #233. **Result:** both programs (`081be2a8` and `6b9780f3`, root `7e366593`) now declare the root SRV as `t1, space3` instead of `t5, space3`. Every register they declare is now in their captured root. Before the patch, `t5, space3` was the only register missing from the root, which matches the `Failed to remap SRV 3:5` vkd3d reported in our run 12. The result is the same at `b141cbd`, with the patch applied to `main` `f0ffa49`, and on your combined branch `0b86078`. - DXC and DXV accept both (`cs_6_0`, using the runtime's `compile_dxil` flags; nixpkgs DXC 1.10.2605.37 on Linux). - dxil-spirv `34f0ff8` (the version vkd3d-proton pins in GE-Proton11-14) converts both, and the SPIR-V validates. It does not apply root bindings, so the remap half of the check is the register comparison above. - `081be2a8` changes one more name. The `t5` (space 0) `StructuredBuffer` had the alias `sbuf65541` because the root SRV had taken name 5; it now keeps `sbuf5`. No other register changes. - Across all 223 captured compute pairs, no other pair changes status or refusal text. 7/223 translate with the captured root before and after, and 20/223 with #241's samplers. **In game this needs #260.** Neither program carries an RTS0, and the provider's reflection gives `Unsupported` for this root, so both take the last arm of `create_pipeline_x_inner`. On `main` that arm uses the root-less translation first and never requests the root-keyed one this PR fixes. #260 makes that arm request it. `0b86078` does not include #260, so a game run of it would still use the root-less translations for these two. **Not run:** GPU, a game run, `root-srv-remap` on AMD, vkd3d with real bindings. **Host:** RX 9060 XT, Mesa 26.2.6 RADV, GE-Proton11-14. This only sets the dxil-spirv version; nothing ran on the GPU. Baseline `xshader` from `f0ffa49`. _The offline runs and this write-up were done with an AI coding agent (Claude Code) on this machine._
gtb-sbe commented 2026-11-26 20:08:39 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by gtb-sbe on 2026-11-26T20:08:39Z.


@Valdi320 Follow-up with the AMD run of the GPU controls at b141cbd.

Result: the full translator stage passes, 41/41, including root-srv-remap (PASS: 8 cases, 3072 words, 0 mismatches) and raw-index, which this PR changes (same counts).

Setup: RX 9060 XT (1002:7590), Mesa 26.2.6 RADV, GE-Proton11-14, Windows DXC 2026-09-29. The adapter was selected by UUID; all 42 guest logs show the RX 9060 XT. The provider DLL was an earlier local build, not one from this branch. These control guests use Proton's D3D12 and only copy it.

Not run: the rest of check (guest checks, D3D12 regression controls, Lanes) on this head.

Run with an AI coding agent (Claude Code) on this machine.

<!-- greyfinch-sync:brcly/TuxBox:comment:7202348130 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/252#issuecomment-7202348130). Originally posted by [gtb-sbe](https://github.com/gtb-sbe) on 2026-11-26T20:08:39Z. --- @Valdi320 Follow-up with the AMD run of the GPU controls at `b141cbd`. **Result:** the full translator stage passes, 41/41, including `root-srv-remap` (`PASS: 8 cases, 3072 words, 0 mismatches`) and `raw-index`, which this PR changes (same counts). **Setup:** RX 9060 XT (`1002:7590`), Mesa 26.2.6 RADV, GE-Proton11-14, Windows DXC 2026-09-29. The adapter was selected by UUID; all 42 guest logs show the RX 9060 XT. The provider DLL was an earlier local build, not one from this branch. These control guests use Proton's D3D12 and only copy it. **Not run:** the rest of `check` (guest checks, D3D12 regression controls, Lanes) on this head. _Run with an AI coding agent (Claude Code) on this machine._
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!252
No description provided.