feat(shader): support scalar 64-bit reverse and arithmetic shift #96
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/96"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by SamG-Coder on 2026-09-28T18:10:46Z.
Shaders using S_BREV_B64 or S_ASHR_I64 currently fail decoding with unsupported SOP1 opcode 12 or SOP2 opcode 35. Decode both as two-dword scalar destinations and translate them through existing integer IR and SPIR-V operations.
S_BREV_B64 reverses and exchanges the two 32-bit halves while preserving SCC. S_ASHR_I64 uses the existing signed 64-bit shift, six-bit count masking, and nonzero-result SCC update. The change is 17 added lines across four files.
Validation
External demos assemble gfx1030/wave64 shaders, build PS5 ELF executables with the public homebrew toolchain, convert them with AnyPS5, and run the resulting Windows executables. Runtime buffer inputs are checked against independently calculated Python references; shaders check both output words and SCC before rendering a pixel-checkable result.
libsNID-patching target, and all 54 registered CTests passed.8ccfbb9sources rejects both instructions; the patched decoder accepts both and verifies destination width.Screenshots and the detailed evidence report are attached in the PR conversation. Demos and results remain outside Git.
Validation limits
Converted Windows execution on an RTX 5080; no physical PS5, full-game, or performance claim. SPIR-V Tools was disabled. The harness terminates each demo after its capture-complete marker, so normal teardown is not covered. Final graphics results use explicitly rebuilt NID-patched libraries; the exact-upstream baseline proof is the separate decoder test.
Rebase validation (2026-09-29)
Rebased onto upstream
dee7ecb; head86401fe. The exact rebased shader branch builds and all 54 CTests pass. The 55-case graphics sweep passed 54 cases initially;ashr_alias_sign1_3had a pixel mismatch alongside "guest memory changed while GPU results were pending" warnings. An isolated rerun of the same case passed both captures with maximum error 1/255. The original failure and rerun are preserved in the external evidence folder. This is an intermittent validation failure, not a clean 55/55 sweep; no root-cause claim is made.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-09-28T18:11:09Z.
Progress report (
dee7ecb→86401fe)📈 GPU shader instructions: 50.0% (+0.17%, +2 implemented instructions)
✅ 2 implemented
S_BREV_B64S_ASHR_I64Imported from boykopovar/AnyPS5. Originally posted by SamG-Coder on 2026-09-28T18:11:44Z.
Screenshots and reproducible evidence
Validated commit:
a12ea6b. The full matrix passed 55/55 cases, covering 110 captures and 24,640 pixel samples, with maximum channel error 1/255. All 54 CTests passed.Passing shader — signed 64-bit shift, runtime boundary counts. Each triangle uses the brighter 0.75-scaled gradient only when all eight rows match the independently calculated low word, high word, and SCC.
Deliberately incorrect control — signed shift replaced with logical shift. The darker 0.25-scaled output indicates failed arithmetic checks. The pixel oracle rejected it with maximum error 109/255. This is a negative control, not the unpatched upstream output. All five wrong-shader controls were rejected.
Download report, test sources, generated assembly, input rows, results, hashes, and logs
The archive includes reproduction instructions and baseline provenance in
REPORT.md. Host validation was Windows Release on an RTX 5080. Physical PS5 execution, performance, independent SPIR-V validation, and normal teardown are not claimed. Screenshots and demo files remain outside the Git changes.