tools: replay Wave32 variants exactly and audit compute loop guards #261

Closed
Valdi320 wants to merge 0 commits from upstream-pr/261 into main
Valdi320 commented 2026-11-26 18:53:15 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by Valdi320 on 2026-11-26T18:53:15Z.


Two reproducible offline replay bugs relevant to #232: the emitter-only triage omitted --wave32-host for .wave32 requests, and the digest-verified snapshot compared the SHA-256 against the _w32-suffixed key. Both regression tests fail before the fix. Preserve variant identity and verify the underlying source digest.

Add tools/audit_shader_guards.py to compare actual emitted HLSL guard sites for identical, privately snapshotted requests across pinned xshader binaries. Separate structured guards, guarded dispatchers and other dispatcher sites, report newly admitted compute programs and how many have generic guards. Static counts are NOT iteration counts, timings or proof of a fault. Aggregate only by default; optional per-request keys stay local. No change to emitted HLSL, guard bounds, execution or game caches.

Validation: 385 Python tests (27 skipped), six no-GPU groups. Actual compiler comparison of 10 synthetic requests: 9 compiled on both, 1 deterministic refusal, no failures, both .wave32 variants compiled with DXC/DXV. Extended guard census of 12 synthetic requests with 2 emitted generic structured guard sites, 0 inconclusive. No retail data or raw HLSL included. CPU-only diagnostic change; full GPU and AMD validation not run for this branch. Draft.

<!-- greyfinch-sync:brcly/TuxBox:issue:5515577709 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/261). Originally posted by [Valdi320](https://github.com/Valdi320) on 2026-11-26T18:53:15Z. --- Two reproducible offline replay bugs relevant to #232: the emitter-only triage omitted --wave32-host for .wave32 requests, and the digest-verified snapshot compared the SHA-256 against the _w32-suffixed key. Both regression tests fail before the fix. Preserve variant identity and verify the underlying source digest. Add tools/audit_shader_guards.py to compare actual emitted HLSL guard sites for identical, privately snapshotted requests across pinned xshader binaries. Separate structured guards, guarded dispatchers and other dispatcher sites, report newly admitted compute programs and how many have generic guards. Static counts are NOT iteration counts, timings or proof of a fault. Aggregate only by default; optional per-request keys stay local. No change to emitted HLSL, guard bounds, execution or game caches. Validation: 385 Python tests (27 skipped), six no-GPU groups. Actual compiler comparison of 10 synthetic requests: 9 compiled on both, 1 deterministic refusal, no failures, both .wave32 variants compiled with DXC/DXV. Extended guard census of 12 synthetic requests with 2 emitted generic structured guard sites, 0 inconclusive. No retail data or raw HLSL included. CPU-only diagnostic change; full GPU and AMD validation not run for this branch. Draft.
Valdi320 commented 2026-11-26 21:42:12 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by Valdi320 on 2026-11-26T21:42:12Z.


Updated to 4d7fba0344 on upstream e76ff6a; resolved documentation conflict preserving the provider-provenance section. Guard audit now distinguishes generic structured/dispatcher guards from persistent PC-range dispatchers, and reports paired shape transitions and retained compute translations gaining/losing guards. The range check is NOT a bound on loop iterations. Default report remains aggregate-only. All six no-GPU groups and five audit unit tests passed. Real xshader A/B of 12 synthetic archived requests (including .wave32): both 11 compute, one refused, two structured guards, no inconclusive outcomes; transition counts reconcile. Persistent and changed-shape classifications tested with synthetic HLSL/unit inputs; no claim of retail corpus coverage or device-loss reproduction. No runtime changes.

<!-- greyfinch-sync:brcly/TuxBox:comment:7203979350 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/261#issuecomment-7203979350). Originally posted by [Valdi320](https://github.com/Valdi320) on 2026-11-26T21:42:12Z. --- Updated to 4d7fba034425804893b966381e8cb228340385de on upstream e76ff6a; resolved documentation conflict preserving the provider-provenance section. Guard audit now distinguishes generic structured/dispatcher guards from persistent PC-range dispatchers, and reports paired shape transitions and retained compute translations gaining/losing guards. The range check is NOT a bound on loop iterations. Default report remains aggregate-only. All six no-GPU groups and five audit unit tests passed. Real xshader A/B of 12 synthetic archived requests (including .wave32): both 11 compute, one refused, two structured guards, no inconclusive outcomes; transition counts reconcile. Persistent and changed-shape classifications tested with synthetic HLSL/unit inputs; no claim of retail corpus coverage or device-loss reproduction. No runtime changes.
Valdi320 commented 2026-11-26 23:20:46 +00:00 (Migrated from github.com)

Imported from brcly/TuxBox. Originally posted by Valdi320 on 2026-11-26T23:20:46Z.


Consolidated into #249 (d5b8516); the replay fixes and guard census are preserved and tested there. Closing this draft to make the review queue manageable, per the maintainer's request. The branch and history remain intact at 4d7fba0; no branch deleted.

<!-- greyfinch-sync:brcly/TuxBox:comment:7205462907 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/pull/261#issuecomment-7205462907). Originally posted by [Valdi320](https://github.com/Valdi320) on 2026-11-26T23:20:46Z. --- Consolidated into #249 (d5b8516); the replay fixes and guard census are preserved and tested there. Closing this draft to make the review queue manageable, per the maintainer's request. The branch and history remain intact at `4d7fba0`; no branch deleted.

Pull request closed

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!261
No description provided.