Skip to content

fix(shader): accept cube output modifiers - #2463

Closed
Scramblrrrr wants to merge 1 commit into
boykopovar:mainfrom
Scramblrrrr:codex/cube-output-modifiers
Closed

Scramblrrrr wants to merge 1 commit into
boykopovar:mainfrom
Scramblrrrr:codex/cube-output-modifiers

Conversation

@Scramblrrrr

@Scramblrrrr Scramblrrrr commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

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

@github-actions github-actions Bot added the intake paused Closed while PR intake is limited to authors with at least 10 PRs merged into main label Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor Author

Coordination update: SleglJan#21 is the canonical hardware-table-backed cube implementation. Rebased head 6a0488c, based on be40308 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.

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

Labels

intake paused Closed while PR intake is limited to authors with at least 10 PRs merged into main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant