xshader: fill the root constants of rooted compute programs #619

Merged
NickStallman merged 2 commits from upstream-pr/619 into main 2026-12-01 20:51:42 +00:00
NickStallman commented 2026-12-01 11:56:51 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-12-01T11:56:51Z.


Stacked on #611; review that first. Until it merges, this branch also holds #611's commits; the change here is the last two.

A rooted compute program's root constants were bound only when the root is one or two tables followed by them, at most four. Behind other parameters, such as three tables and a root SRV, the registers they fill started at zero, with no refusal.

#611 places a vertex or pixel program's constants from the program's own records. Those records now place a compute program's constants too, with the parameter visible to all stages. A rooted compute program whose constants are read and not found is refused, as #611 does for vertex and pixel programs. Mesh, amplification and packed roots are unchanged.

Refs #533.

Not run in a title.

Measured

  • Recorded compute requests from one title (5,366), translated for 32-lane and 64-lane hosts: 81 change on each. 507 are refused before and after; none is newly refused or newly accepted. The 81 have roots of three tables, a root SRV and three constants (with or without the index map), plus one of two tables, a root SRV and two constants. Before this change their constants read as zero.
  • All 162 changed translations compile and validate (DXC with the runtime's compute flags, and dxv).
  • A unit test for constants after a root descriptor, another parameter in their place (refused), and a root visible to one stage only fails without the change; each of the three conditions, when mutated, fails a test.
  • Lanes compute-root-constants: the compute-root-srv program and root with three constants at b502 after the root SRV, which the program XORs into the word it stores.
    • With this change, on an AMD iGPU (1002:13c0, RADV, GE-Proton11-15): lanes-compute-root-constants and lanes-compute-root-srv pass.
    • Control, #611's head plus only the scenario: fails on the AMD iGPU and on the RTX 5090 with view 10 holds 0x7ab1e002: the root constants read 0.
  • Rebased onto #611's new head (on fb17e160): the same 81 changes per host, none newly refused or accepted; DXC and dxv pass for all 162 changed translations.
  • Full python tuxbox.py check of 890f35ed (GE-Proton11-15): RTX 5090 (10de:2b85, 620.70.10) 212 pass, AMD iGPU (1002:13c0, RADV) 211 pass, lanes-compute-root-constants included. The one failure on each is lanes-selftest-texture-publication, which is #625 and fails on main too.
  • Evidence: TuxBox check of 890f35ed2fa0, no uncommitted changes, no GPU checks: 13 passed, 0 failed, 0 not run

Not covered

  • The header line naming unresolved constants still relies on the translator's list of registers read, which can miss some reads.

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:issue:5585189432 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/619). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-12-01T11:56:51Z. --- Stacked on #611; review that first. Until it merges, this branch also holds #611's commits; the change here is the last two. A rooted compute program's root constants were bound only when the root is one or two tables followed by them, at most four. Behind other parameters, such as three tables and a root SRV, the registers they fill started at zero, with no refusal. #611 places a vertex or pixel program's constants from the program's own records. Those records now place a compute program's constants too, with the parameter visible to all stages. A rooted compute program whose constants are read and not found is refused, as #611 does for vertex and pixel programs. Mesh, amplification and packed roots are unchanged. Refs #533. Not run in a title. ## Measured - Recorded compute requests from one title (5,366), translated for 32-lane and 64-lane hosts: 81 change on each. 507 are refused before and after; none is newly refused or newly accepted. The 81 have roots of three tables, a root SRV and three constants (with or without the index map), plus one of two tables, a root SRV and two constants. Before this change their constants read as zero. - All 162 changed translations compile and validate (DXC with the runtime's compute flags, and dxv). - A unit test for constants after a root descriptor, another parameter in their place (refused), and a root visible to one stage only fails without the change; each of the three conditions, when mutated, fails a test. - Lanes `compute-root-constants`: the `compute-root-srv` program and root with three constants at b502 after the root SRV, which the program XORs into the word it stores. - With this change, on an AMD iGPU (`1002:13c0`, RADV, GE-Proton11-15): `lanes-compute-root-constants` and `lanes-compute-root-srv` pass. - Control, #611's head plus only the scenario: fails on the AMD iGPU and on the RTX 5090 with `view 10 holds 0x7ab1e002: the root constants read 0`. - Rebased onto #611's new head (on fb17e160): the same 81 changes per host, none newly refused or accepted; DXC and dxv pass for all 162 changed translations. - Full `python tuxbox.py check` of 890f35ed (GE-Proton11-15): RTX 5090 (`10de:2b85`, 620.70.10) 212 pass, AMD iGPU (`1002:13c0`, RADV) 211 pass, `lanes-compute-root-constants` included. The one failure on each is `lanes-selftest-texture-publication`, which is #625 and fails on main too. - `Evidence: TuxBox check of 890f35ed2fa0, no uncommitted changes, no GPU checks: 13 passed, 0 failed, 0 not run` ## Not covered - The header line naming unresolved constants still relies on the translator's list of registers read, which can miss some reads. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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!619
No description provided.