fix(shader): accept cube output modifiers #2463

Closed
Scramblrrrr wants to merge 1 commit from upstream-pr/2463 into main
Scramblrrrr commented 2026-10-09 22:08:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-09T22:08:11Z.


What

Accept VOP3 output modifiers on v_cubeid_f32, v_cubesc_f32, v_cubetc_f32 and v_cubema_f32, routing them through the existing f32 result modifier implementation. Previously these instructions rejected any nonzero omod as VOP3 source modifiers are not implemented.

A diagnostic run of PPSA11386 (007 First Light) encountered v_cubeid_f32 with div:2 and negated sources. Its complete captured 3,120-word shader reproduces the decoder rejection before this change and decodes into 1,886 instructions afterward. No title code, assets, serialized requests or dump files are included in this PR.

The LLVM 18.1.6 GFX10 instruction reference lists both clamp and omod on all four cube instructions. Scaling, IEEE-mode gating and output-denormal gating reuse the existing f32 modifier path; this PR does not introduce another arithmetic implementation.

Replace the former refusal test with Vulkan execution coverage for all four instructions and scales 1, 2, 4 and 0.5, with and without clamp. Expected finite results start from existing hardware-measured unmodified cube fixtures and independently apply power-of-two scaling. Cases cover IEEE off/output denormals flushed (scaling applies), IEEE off/output denormals retained (scaling ignored), and IEEE on/output denormals flushed (scaling ignored). Existing cube clamp/source-modifier fixtures still execute.

Cube-specific output modifiers have not been measured on AMD or PS5 hardware. NaN propagation and underflow remain unverified and are explicitly recorded in technical debt. An AMD hardware-oracle review is requested.

Tested

Windows 11, Ryzen 7 7800X3D, NVIDIA RTX 5070 Ti; Release GCC 15.2 build. ANYPS5_REQUIRE_VULKAN=1 requires GPU execution rather than a skip.

  • agc_driver_vop3_cube_clamp: passed (0.60 s).
  • agc_driver_f32_output_modifier: passed (0.59 s).
  • agc_driver_division_output_modifiers: passed (0.42 s).
  • Complete captured title shader: decoder passes, 3,120 words / 1,886 instructions.
  • Actual diagnostic game: passed the previous decoder failure at roughly 220 shader writes and continued to 247 cache writes with no exception or first frame submission at that checkpoint.
  • Conventions and git diff --check: passed on the isolated PR branch.

Runtime tests were run in the local integration checkout, which also contains separate startup/display fixes and upstream shader dependencies; a clean full build of this isolated PR and Linux/lavapipe have not been tested locally. Game startup testing requires a debugger-only Share Play bypass, and playable gameplay remains unverified. Those unrelated changes are excluded from this PR.

Checklist

  • Based on current main (b2714175); no open PR found for cube output modifiers
  • One topic per PR
  • No new code comments
  • No new silent stubs; unverified hardware coverage recorded in TechnicalDebt
  • No investigation files, logs, title code or images added to the repository
  • No new third-party code
  • Generic instruction behavior
  • Depends on: none for this decoder change
  • AI-assisted: yes, implementation, tests and investigation prepared with Codex; author is responsible for review
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4806379765 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2463). Originally posted by [Scramblrrrr](https://github.com/Scramblrrrr) on 2026-10-09T22:08:11Z. --- ### What Accept VOP3 output modifiers on `v_cubeid_f32`, `v_cubesc_f32`, `v_cubetc_f32` and `v_cubema_f32`, routing them through the existing f32 result modifier implementation. Previously these instructions rejected any nonzero `omod` as `VOP3 source modifiers are not implemented`. A diagnostic run of PPSA11386 (007 First Light) encountered `v_cubeid_f32` with `div:2` and negated sources. Its complete captured 3,120-word shader reproduces the decoder rejection before this change and decodes into 1,886 instructions afterward. No title code, assets, serialized requests or dump files are included in this PR. The [LLVM 18.1.6 GFX10 instruction reference](https://releases.llvm.org/18.1.6/docs/AMDGPU/AMDGPUAsmGFX10.html) lists both `clamp` and `omod` on all four cube instructions. Scaling, IEEE-mode gating and output-denormal gating reuse the existing f32 modifier path; this PR does not introduce another arithmetic implementation. Replace the former refusal test with Vulkan execution coverage for all four instructions and scales 1, 2, 4 and 0.5, with and without clamp. Expected finite results start from existing hardware-measured unmodified cube fixtures and independently apply power-of-two scaling. Cases cover IEEE off/output denormals flushed (scaling applies), IEEE off/output denormals retained (scaling ignored), and IEEE on/output denormals flushed (scaling ignored). Existing cube clamp/source-modifier fixtures still execute. Cube-specific output modifiers have not been measured on AMD or PS5 hardware. NaN propagation and underflow remain unverified and are explicitly recorded in technical debt. An AMD hardware-oracle review is requested. ### Tested Windows 11, Ryzen 7 7800X3D, NVIDIA RTX 5070 Ti; Release GCC 15.2 build. `ANYPS5_REQUIRE_VULKAN=1` requires GPU execution rather than a skip. - `agc_driver_vop3_cube_clamp`: passed (0.60 s). - `agc_driver_f32_output_modifier`: passed (0.59 s). - `agc_driver_division_output_modifiers`: passed (0.42 s). - Complete captured title shader: decoder passes, 3,120 words / 1,886 instructions. - Actual diagnostic game: passed the previous decoder failure at roughly 220 shader writes and continued to 247 cache writes with no exception or first frame submission at that checkpoint. - Conventions and `git diff --check`: passed on the isolated PR branch. Runtime tests were run in the local integration checkout, which also contains separate startup/display fixes and upstream shader dependencies; a clean full build of this isolated PR and Linux/lavapipe have not been tested locally. Game startup testing requires a debugger-only Share Play bypass, and playable gameplay remains unverified. Those unrelated changes are excluded from this PR. ### Checklist - [x] Based on current `main` (`b2714175`); no open PR found for cube output modifiers - [x] One topic per PR - [x] No new code comments - [x] No new silent stubs; unverified hardware coverage recorded in TechnicalDebt - [x] No investigation files, logs, title code or images added to the repository - [x] No new third-party code - [x] Generic instruction behavior - [x] Depends on: none for this decoder change - [x] AI-assisted: yes, implementation, tests and investigation prepared with Codex; author is responsible for review
github-actions[bot] commented 2026-10-09 22:22:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T22:22:35Z.


Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6090234408 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2463#issuecomment-6090234408). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-09T22:22:35Z. --- Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
Scramblrrrr commented 2026-10-10 10:48:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-10T10:48:40Z.


Coordination update: SleglJan/AnyPS5#21 is the canonical hardware-table-backed cube implementation. Rebased head 6a0488c487db8c4a538a5345b493d8687df4f58f, based on be403084 and layered on merged #2043, passed agc_driver_vop3_cube_clamp on Windows Vulkan / RTX 5070 Ti (0.53 s). It applies omod with IEEE off, including kept f32 denormals; IEEE-on NaN quieting belongs to #2043. Our earlier generic path did not settle that distinction, so I am keeping this overlapping PR closed. These results validate the supplied fixtures on NVIDIA, not a new RDNA2 oracle sweep.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6096713909 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2463#issuecomment-6096713909). Originally posted by [Scramblrrrr](https://github.com/Scramblrrrr) on 2026-10-10T10:48:40Z. --- Coordination update: SleglJan/AnyPS5#21 is the canonical hardware-table-backed cube implementation. Rebased head 6a0488c487db8c4a538a5345b493d8687df4f58f, based on be403084 and layered on merged #2043, passed agc_driver_vop3_cube_clamp on Windows Vulkan / RTX 5070 Ti (0.53 s). It applies omod with IEEE off, including kept f32 denormals; IEEE-on NaN quieting belongs to #2043. Our earlier generic path did not settle that distinction, so I am keeping this overlapping PR closed. These results validate the supplied fixtures on NVIDIA, not a new RDNA2 oracle sweep.

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
boykopovar/AnyPS5!2463
No description provided.