xshader: admit a pixel guard that counts over the quad #604

Merged
NickStallman merged 7 commits from upstream-pr/604 into main 2026-11-30 23:16:40 +00:00
NickStallman commented 2026-11-30 23:04:03 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-30T23:04:03Z.


Builds on @csj0oe's kept branch from #542; the first four commits are theirs, unchanged: 494fff69 (per-quad lowering), 2a6a5ee3 (elections kept out), 8e8e44c4 (refuse a guarded exchange), ea4196b3 (admit behind a proven-uniform guard). Agreed with @brcly on #533: "a result the console can produce for that quad under some packing is the right standard here".

Under whole-quad mode the console compiler counts a quad's helper pixels with two quad moves and integer adds, compares, and branches: a complete quad uses a value summed over the quad, an incomplete one the pixel's own. The compare's operands differ between the four pixels, so the uniform-guard rule refused it. It is uniform all the same, and quad_forms proves it: each register is a wrapping linear form over one per-pixel value at the quad's four positions, and an equality whose sides differ by a form that weighs the positions alike gives one answer per quad.

Each quad gets a result the console produces for that quad under some packing of quads into waves: a quad with a helper pixel takes the own-value arm, exactly as on the console; a complete quad always takes the quad arm. For the count to be the console's, such a program's EXEC starts as the pixel's coverage (IsHelperLane) and whole-quad mode is a vote over the quad; nothing else changes text. A first-lane read of a value built only from scalars and constants is emitted as the pixel's own; any other first-lane read still keeps a program out.

Measured

  • Recorded ProjectScarlett requests (47,526 containers, compute for both hosts, linked pairs): 16 pixel programs newly accepted in four deferred material families (5, 5, 3 and 3 requests), 0 changed, 0 newly refused. All 16 compile with DXC 1.9.2609 and pass dxv.
  • Unit tests and mutations: 695 unit tests; 17 mutations of the proof and its wiring, each caught.
  • New GPU check quad-guard: slanted triangles leave quads with one, two and three helper pixels; each quad is classified from the coverage the same draw reads back (not predicted), and each covered pixel must hold the quad's sum if its quad is complete and its own value otherwise. 12 draws, 3,072 pixels: 436 pixels in complete quads and 63 / 52 / 24 in quads missing one, two and three, 0 failures on both cards; a program whose guard differs within a quad must be refused, and is.
  • Controls: the same check on two deliberately broken translators fails: with the coverage flag off 5 of the draws fail; with the proof unhooked the program is refused.
  • Full python tuxbox.py check of 534cc3f6 (GE-Proton11-15): RTX 5090 (10de:2b85, 620.70.10) 206 pass, 0 fail; AMD iGPU (1002:13c0, RADV) 205 pass, 0 fail.

Evidence: TuxBox check of 534cc3f6b7, no uncommitted changes, GPU 10de:2b85: 17 passed, 0 failed, 0 not run
Evidence: TuxBox check of 534cc3f6b7, no uncommitted changes, GPU 1002:13c0: 17 passed, 0 failed, 0 not run

Not covered

  • The game has not been run with this. In our runs' pipeline failure tables 10 rows (16 pipeline creations per run) have one of these as their pixel stage: 4 vertex+pixel stand-ins and 6 failed mesh+pixel pipelines. Whether those pipelines then build and draw is not shown.
  • The proof doesn't follow float sums, diagonal or masked quad moves, ordered compares or loops. Two other refused pixel groups (7 requests) use other constructs and stay refused.

🤖 Generated with Claude Code

<!-- greyfinch-sync:brcly/TuxBox:issue:5575385855 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/604). Originally posted by [NickStallman](https://github.com/NickStallman) on 2026-11-30T23:04:03Z. --- Builds on @csj0oe's kept branch from #542; the first four commits are theirs, unchanged: 494fff69 (per-quad lowering), 2a6a5ee3 (elections kept out), 8e8e44c4 (refuse a guarded exchange), ea4196b3 (admit behind a proven-uniform guard). Agreed with @brcly on #533: "a result the console can produce for that quad under some packing is the right standard here". Under whole-quad mode the console compiler counts a quad's helper pixels with two quad moves and integer adds, compares, and branches: a complete quad uses a value summed over the quad, an incomplete one the pixel's own. The compare's operands differ between the four pixels, so the uniform-guard rule refused it. It is uniform all the same, and `quad_forms` proves it: each register is a wrapping linear form over one per-pixel value at the quad's four positions, and an equality whose sides differ by a form that weighs the positions alike gives one answer per quad. Each quad gets a result the console produces for that quad under some packing of quads into waves: a quad with a helper pixel takes the own-value arm, exactly as on the console; a complete quad always takes the quad arm. For the count to be the console's, such a program's EXEC starts as the pixel's coverage (`IsHelperLane`) and whole-quad mode is a vote over the quad; nothing else changes text. A first-lane read of a value built only from scalars and constants is emitted as the pixel's own; any other first-lane read still keeps a program out. ## Measured - **Recorded ProjectScarlett requests** (47,526 containers, compute for both hosts, linked pairs): 16 pixel programs newly accepted in four deferred material families (5, 5, 3 and 3 requests), 0 changed, 0 newly refused. All 16 compile with DXC 1.9.2609 and pass dxv. - **Unit tests and mutations:** 695 unit tests; 17 mutations of the proof and its wiring, each caught. - **New GPU check `quad-guard`:** slanted triangles leave quads with one, two and three helper pixels; each quad is classified from the coverage the same draw reads back (not predicted), and each covered pixel must hold the quad's sum if its quad is complete and its own value otherwise. 12 draws, 3,072 pixels: 436 pixels in complete quads and 63 / 52 / 24 in quads missing one, two and three, **0 failures on both cards**; a program whose guard differs within a quad must be refused, and is. - **Controls:** the same check on two deliberately broken translators fails: with the coverage flag off 5 of the draws fail; with the proof unhooked the program is refused. - Full `python tuxbox.py check` of 534cc3f6 (GE-Proton11-15): RTX 5090 (`10de:2b85`, 620.70.10) 206 pass, 0 fail; AMD iGPU (`1002:13c0`, RADV) 205 pass, 0 fail. Evidence: TuxBox check of 534cc3f6b7a3, no uncommitted changes, GPU 10de:2b85: 17 passed, 0 failed, 0 not run Evidence: TuxBox check of 534cc3f6b7a3, no uncommitted changes, GPU 1002:13c0: 17 passed, 0 failed, 0 not run ## Not covered - The game has not been run with this. In our runs' pipeline failure tables 10 rows (16 pipeline creations per run) have one of these as their pixel stage: 4 vertex+pixel stand-ins and 6 failed mesh+pixel pipelines. Whether those pipelines then build and draw is not shown. - The proof doesn't follow float sums, diagonal or masked quad moves, ordered compares or loops. Two other refused pixel groups (7 requests) use other constructs and stay refused. 🤖 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!604
No description provided.