xshader: accept any equivalent mesh launch calculation #544

Merged
csj0oe merged 1 commit from upstream-pr/544 into main 2026-11-29 21:27:38 +00:00
csj0oe commented 2026-11-29 21:08:36 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by csj0oe on 2026-11-29T21:08:36Z.


What

The mesh launch validator accepted only one literal instruction chain. It now also accepts a calculation that is equivalent: it replays the program to its first branch with the emitter's own per-instruction model, requires some instruction to produce the group identifier for every group value (exhaustive over 65536, filtered by an 18-value bit basis), requires that value to be uniform over the group, and requires the exported lane register to hold the logical lane for every lane.

The literal chain is still tried first, so every currently accepted program emits identical HLSL. The recognizer costs about 20 ms per program and only runs for programs the literal match refuses.

Tests cover four equivalent families (shift instead of bitfield, v_bfe+shift+add instead of v_lshl_add, group shift before the read-first-lane, a nop between steps) and three refusals.

Not verified

No GPU run and no corpus run: the 15 recorded pipelines that hit the literal matcher are not in the repository, so the fixtures prove the instruction families, not those bytes.

<!-- greyfinch-sync:brcly/TuxBox:issue:5555140208 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/544). Originally posted by [csj0oe](https://github.com/csj0oe) on 2026-11-29T21:08:36Z. --- ## What The mesh launch validator accepted only one literal instruction chain. It now also accepts a calculation that is equivalent: it replays the program to its first branch with the emitter's own per-instruction model, requires some instruction to produce the group identifier for every group value (exhaustive over 65536, filtered by an 18-value bit basis), requires that value to be uniform over the group, and requires the exported lane register to hold the logical lane for every lane. The literal chain is still tried first, so every currently accepted program emits identical HLSL. The recognizer costs about 20 ms per program and only runs for programs the literal match refuses. Tests cover four equivalent families (shift instead of bitfield, `v_bfe`+shift+add instead of `v_lshl_add`, group shift before the read-first-lane, a `nop` between steps) and three refusals. ## Not verified No GPU run and no corpus run: the 15 recorded pipelines that hit the literal matcher are not in the repository, so the fixtures prove the instruction families, not those bytes.
brcly commented 2026-11-29 21:11:53 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by brcly on 2026-11-29T21:11:53Z.


Thanks. This is in our current focus. You noted no GPU checks were run, so we're running the full check on an NVIDIA and an AMD card here, and measuring how many recorded programs' translations change. We'll merge it if that passes.

<!-- greyfinch-sync:brcly/TuxBox:comment:7262682629 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/544#issuecomment-7262682629). Originally posted by [brcly](https://github.com/brcly) on 2026-11-29T21:11:53Z. --- Thanks. This is in our current focus. You noted no GPU checks were run, so we're running the full check on an NVIDIA and an AMD card here, and measuring how many recorded programs' translations change. We'll merge it if that passes.
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!544
No description provided.