Skip to content

xshader: admit proven pixel spill lifetimes and partial attribute layouts - #257

Draft
Valdi320 wants to merge 1 commit into
brcly:mainfrom
Valdi320:work/pixel-remaining-20261126
Draft

Valdi320 wants to merge 1 commit into
brcly:mainfrom
Valdi320:work/pixel-remaining-20261126

Conversation

@Valdi320

Copy link
Copy Markdown
Contributor

Two narrow demonstrated refusal mechanisms matching the mixed spill VGPR and missing pixel attribute categories in #227.

  • Permit a mixed spill/vector register only when a straight-line, fixed-EXEC sequence has exact operand footprints, no ordinary accesses during the saved-lane lifetime, and a fresh whole-register definition before any subsequent vector read. Only simple direct moves, scalar lane ops, exports and waits/nops are admitted by the new proof; general VALU, memory, control flow and implicit wide operands still refuse. Existing pure-spill path is unchanged.
  • For full-register pixel signatures, when the existing layouts fail to carry the requested interpolation components, try a bounded ordered-layout proof that preserves every read signature register, agrees with the recorded hardware interpolant count, and admits exactly one complete layout. Ambiguous layouts and half-packed inputs do not take the new path.

Both fixtures reproduce their refusal on base 5c5677b. Negative tests reject overlapping spill writes, missing whole-word redefinition, branch boundaries, ambiguous layouts, incompatible counts or channels and half layouts. Six no-GPU groups passed. The new GPU control ran unmodified translated pixel HLSL through DXC/DXV and two full/two clipped draws on RTX 4080 / GE-Proton11-14: 1024 pixels, 4096 uint components, zero discrepancies. Initially the auxiliary VS output register order did not match the PS input; corrected the fixture's order after checking DXC signature dumps. Used the previously built D3D12 provider for the isolated raster control. Not a game or mesh-pipeline replay.

The captured 48 mixed-spill and 40 attribute refusals are not locally available. These are conservative candidate fixes, not a claim that those 88 programs now translate. Full GPU and AMD validation outstanding. Draft for review.

@Valdi320

Copy link
Copy Markdown
Contributor Author

Combined validation (not a new upstream merge request): https://github.com/Valdi320/TuxBox/tree/0b860781d820dd95547e12e8fabaf61f1fe87be3

Integrated #249, #252, #254, #255, #256 and #257 on 5c5677b. Kept all individual controls and both diagnostics/documentation sections. Six no-GPU groups passed, including 70 DXBC tests. Rebuilt D3D12 from this exact tree. Five isolated GPU controls (root-srv-remap, third-table-atomic, pixel-code-offset, pixel-lifetimes, raw-index) passed on RTX 4080/GE-Proton11-14: 32 cases, 17,408 compared words, zero mismatches. The pixel-code-offset control has entry-input instrumentation; the pixel-lifetimes control uses unmodified generated PS HLSL. The atomic root is manually reconstructed by the test.

Rebuilt Lanes and its providers from the exact integration tree (initial build needed the separately built BVH DLL), then passed 10/10 selected gates including wave-alloc and raster-samplers. Used the opt-in headless display helper from corrected #228 in the local test harness only; it is not part of this branch.

This verifies the combined candidates, not retail capture coverage. The captured programs from #227 and #233, full GPU suite, AMD and the original NVIDIA device-loss/watchdog reproduction remain outstanding. Individual PRs remain separately reviewable.

@NickStallman

Copy link
Copy Markdown
Contributor

Two results for this PR's head (ae0126c), since the description lists both as outstanding:

AMD run of python tuxbox.py check: AMD Raphael iGPU (1002:13c0), RADV, Linux 7.0.0, GE-Proton11-14. All groups passed, 113 gates, including Lanes and fixtures on the GPU, the D3D12 regression controls and the translator GPU checks.

Replay against the recorded ProjectScarlett requests: I ran tools/triage_scarlett_shaders.py --aggregate-only --baseline over all 24,834 recorded requests from a 1.0.2.1 session, comparing this PR's xshader with main's (5c5677b). This is emitter only, offline.

translated refused failed
main 22,792 1,959 83
this PR 22,792 1,959 83

There are no transitions in either direction, and none of the targeted refusals are recovered. On main the same set has 88 vN is used both as a lane spill area and as a vector, and about 70 PS attrN has no signature register (attr11 24, attr1 18, attr3, attr5 12 each, attr9 3) plus 16 N-bit read of half-float PS attrN. So the new proofs are safe, with no regressions, but as written they don't yet admit any of the real programs. One caveat: the replay translates each request with the root recorded with it, so a path that depends on runtime pipeline context (for example a mesh pipeline's pixel layout) wouldn't show up here. I can share request digests from either bucket if they'd help shape the proofs; I won't attach shader files.

@Valdi320

Copy link
Copy Markdown
Contributor Author

Additional integration evidence: combined branch 0b86078 (#249, #252, #254, #255, #256, #257), based on 5c5677b, passed all 19 isolated D3D12 regression cases on RTX 4080 (10de:2704), GE-Proton11-14. Cases: root-cbv-window, tables, heaps, alias-deferred, copy-resource, placement, stream, mesh, frame, indirect, indirect-scarlett, null-usage, null-disabled, buffer-remap, buffer-layout, buffer-import, buffer-import-reject, buffer-unmap-alive, buffer-unmap-released. Null fallback was disabled except in the explicit null-usage control. This is synthetic regression evidence, not confirmation of the original retail issue or AMD behavior. #259 and #261 are separate PRs and are not included in this integration commit.

@Valdi320

Copy link
Copy Markdown
Contributor Author

@NickStallman thank you for the AMD 113/113 and the much more important negative 24,834-request result. I agree there is no evidence that #257 recovers real title programs. I have not broadened the proof or changed the tested PR head.

I prepared a separate diagnostic-only branch based on ae0126c: https://github.com/Valdi320/TuxBox/tree/43d1971920e653bf42c6bbf22f2d8016f7903e9b. The opt-in audit distinguishes the first failed spill proof condition (control flow, scalar/vector operation, overlapping vector access, missing whole definition, etc.) and attribute proof condition (count exceeds signature, packed half layout, attribute outside count, no layout, ambiguity, etc.). It retains the original refusal and emitted HLSL. It also incorporates the two .wave32 replay fixes from #261: the previous paired replay did not strip the _w32 suffix when verifying the digest and triage omitted --wave32-host. I cannot tell how many of the 83 inconclusive requests that explains.

If you can run a CPU-only audit on that corpus with xshader built from this diagnostic branch:

python tools/audit_pixel_proofs.py REQUESTS --xshader XSHADER --json proof-summary.json --jobs 4

Only aggregate fixed reason counts and the tool fingerprint are written, no request digests, raw diagnostics or title data. The command returns nonzero if any input/tool errors occur but still writes the report. That would be more actionable than request digests alone and help choose which proof to fix rather than extending synthetic cases blindly.

Validation on the diagnostic branch: all six no-GPU groups; 383 Python tests and 376 shader compiler unit tests (plus two integration tests). Five actual xshader synthetic requests confirmed four distinct failure markers and identical original outcomes; the valid program's HLSL was byte-identical. No GPU rerun on this diagnostic-only branch. No new upstream PR for tracing; #257 remains at the reviewed revision. No claim of retail recovery until the corpus shows one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants