Shader: MUBUF/MTBUF buffer descriptor s104/s105/VCC is refused #5630

Closed
opened 2026-10-14 02:25:16 +00:00 by Amoenus · 0 comments
Amoenus commented 2026-10-14 02:25:16 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-14T02:25:16Z.


Observed decoder refusal

MUBUF/MTBUF refuses the valid four-dword buffer descriptor at s104, comprising s104, s105, vcc_lo and vcc_hi. This is separate from the MIMG sampler boundary in #4991, fixed by merged #4996.

The original memory decoder is unchanged on checked main a14ae8e232b100eab53c6cdce0676ff167fd137b (Git blob 77ea8f03223bfc5c04afd214b41d48273892a888). Its scalarDescriptorBase guard rejects the last two words because they lie past the normal SGPR range.

Public reproduction

const std::array<std::uint32_t, 2> code{
    0xe8b00000u,
    (128u << 24u) | (26u << 16u)
};
ShaderRecompiler::DecodeRdnaMtbuf(0u, code, 0u);

This GFX10 format-22 tbuffer_load_format_x control throws:

MTBUF resource descriptor register range overflow

Using resource25/s100 instead decodes. MUBUF has the same buffer-descriptor boundary.

Source evidence and proposed solution

LLVM defines SGPR104_128 as a mixed VCC tuple, included in SReg_128_XNULL used by buffer operands. Existing AnyPS5 buffer-resource translation already maps scalar codes106/107 to the raw VCC words.

Upstream PR #5648, tested fork source943d362d2: three production lines admit only this four-word s104 tuple. The normal SGPR bound and higher-base refusals remain unchanged. No MIMG implementation is copied; no functional PR dependency.

Validation

Windows11 Enterprise26200 / WinLibs GCC15.2r7 / Release / SPIR-V validation enabled.

  • Current main433 candidate943d362d2 passes full build/libs, conventions, registration and branch whitespace checks. All five original topic patches are range-equivalent after rebase; a style-only commit removes two trailing blank lines. The previous tested b4f head is preserved on the fork.
  • Exact original decoder plus identical fixtures fails CPU/native cases at the MTBUF refusal on both vendors. Controls ran on main a5; the decoder is identical on a14, whose intervening change is libkernel fcntl only.
  • Three groups ×5 under NVIDIA RTX5080 (610.62) and AMD integrated Radeon (32.0.21036.18) selection pass without skips; maximum1.40763s /1.21538s. Native selection logs confirm both devices; CPU decoder/shader-memory controls are not hardware measurements. Main4f618 merge preview is clean but unbuilt. No fresh unchanged-main negative control, title replay or full-suite claim; historical controls retain the pins above.
  • CPU:160 opcode/base combinations, exact higher-base refusals and operand/format preservation.
  • Native:22 configurations ×64 lanes, wave32/wave64 single-dword raw/formatted loads/stores, VCC_LO record bounds, VCC_HI format interpretation and output guards.

Title connection and limitations

Matched Sonic Unleashed Recompiled/PPSA99902 comparison, main1978 plus retained local prerequisites: control86df4c5ad stops at the MTBUF refusal after649.304s; candidate2bd6889f5 passes that boundary and stops after797.332s at:

AGC graphics: guest writes to a resident multisample target or its metadata are not implemented

Only libSceAgcDriver differs in the installed profiles; all other bytes, converted executable/guest libc and input schedule match. Seven metadata-only rebuilt PE outputs retain their control bytes. Both exit0xC0000409 without harness timeout; originals/runtime/user data restore exactly, cleanup errors empty. Input consumption is unlogged. This validates decoder-frontier progress in the conditional integration, not unchanged-main startup, menus, gameplay or speed.

The next guard is maintained in #3036 and bring-up #4443. The title's instruction fields were not inspected. These are public synthetic/emulated tests, not raw gfx10/gfx1013 measurements; no game assets or captured shaders are attached.

AI-assisted: Codex; author responsible.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5840859807 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5630). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-14T02:25:16Z. --- ### Observed decoder refusal MUBUF/MTBUF refuses the valid four-dword buffer descriptor at s104, comprising s104, s105, vcc_lo and vcc_hi. This is separate from the MIMG sampler boundary in #4991, fixed by merged #4996. The original memory decoder is unchanged on checked main `a14ae8e232b100eab53c6cdce0676ff167fd137b` (Git blob `77ea8f03223bfc5c04afd214b41d48273892a888`). Its `scalarDescriptorBase` guard rejects the last two words because they lie past the normal SGPR range. ### Public reproduction ```cpp const std::array<std::uint32_t, 2> code{ 0xe8b00000u, (128u << 24u) | (26u << 16u) }; ShaderRecompiler::DecodeRdnaMtbuf(0u, code, 0u); ``` This GFX10 format-22 `tbuffer_load_format_x` control throws: ```text MTBUF resource descriptor register range overflow ``` Using resource25/s100 instead decodes. MUBUF has the same buffer-descriptor boundary. ### Source evidence and proposed solution LLVM defines [SGPR104_128 as a mixed VCC tuple](https://github.com/llvm/llvm-project/blob/d8219b47422f7322db252ad29ca8ea87993fb433/llvm/lib/Target/AMDGPU/SIRegisterInfo.td#L422), included in SReg_128_XNULL used by [buffer operands](https://github.com/llvm/llvm-project/blob/d8219b47422f7322db252ad29ca8ea87993fb433/llvm/lib/Target/AMDGPU/BUFInstructions.td). Existing AnyPS5 buffer-resource translation already maps scalar codes106/107 to the raw VCC words. [Upstream PR #5648](https://github.com/boykopovar/AnyPS5/pull/5648), [tested fork source943d362d2](https://github.com/Amoenus/AnyPS5/commit/943d362d2d426cde90e937f54c9af1ecbef79e66): three production lines admit only this four-word s104 tuple. The normal SGPR bound and higher-base refusals remain unchanged. No MIMG implementation is copied; no functional PR dependency. ### Validation Windows11 Enterprise26200 / WinLibs GCC15.2r7 / Release / SPIR-V validation enabled. - Current main433 candidate943d362d2 passes full build/libs, conventions, registration and branch whitespace checks. All five original topic patches are range-equivalent after rebase; a style-only commit removes two trailing blank lines. The previous tested b4f head is preserved on the fork. - Exact original decoder plus identical fixtures fails CPU/native cases at the MTBUF refusal on both vendors. Controls ran on main a5; the decoder is identical on a14, whose intervening change is libkernel fcntl only. - Three groups ×5 under NVIDIA RTX5080 (610.62) and AMD integrated Radeon (32.0.21036.18) selection pass without skips; maximum1.40763s /1.21538s. Native selection logs confirm both devices; CPU decoder/shader-memory controls are not hardware measurements. Main4f618 merge preview is clean but unbuilt. No fresh unchanged-main negative control, title replay or full-suite claim; historical controls retain the pins above. - CPU:160 opcode/base combinations, exact higher-base refusals and operand/format preservation. - Native:22 configurations ×64 lanes, wave32/wave64 single-dword raw/formatted loads/stores, VCC_LO record bounds, VCC_HI format interpretation and output guards. ### Title connection and limitations Matched Sonic Unleashed Recompiled/PPSA99902 comparison, main1978 plus retained local prerequisites: [control86df4c5ad](https://github.com/Amoenus/AnyPS5/commit/86df4c5ad1b42c9b02ea3416b9bab832fda9f812) stops at the MTBUF refusal after649.304s; [candidate2bd6889f5](https://github.com/Amoenus/AnyPS5/commit/2bd6889f5614ab1f9b919bc45dd13144a4ef04c5) passes that boundary and stops after797.332s at: ```text AGC graphics: guest writes to a resident multisample target or its metadata are not implemented ``` Only libSceAgcDriver differs in the installed profiles; all other bytes, converted executable/guest libc and input schedule match. Seven metadata-only rebuilt PE outputs retain their control bytes. Both exit0xC0000409 without harness timeout; originals/runtime/user data restore exactly, cleanup errors empty. Input consumption is unlogged. This validates decoder-frontier progress in the conditional integration, not unchanged-main startup, menus, gameplay or speed. The next guard is maintained in [#3036](https://github.com/boykopovar/AnyPS5/issues/3036) and [bring-up #4443](https://github.com/boykopovar/AnyPS5/discussions/4443). The title's instruction fields were not inspected. These are public synthetic/emulated tests, not raw gfx10/gfx1013 measurements; no game assets or captured shaders are attached. AI-assisted: Codex; author responsible.
Sign in to join this conversation.
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#5630
No description provided.