feat(agc): accept graphics programs without an AGC shader header #1732

Merged
TheAggie merged 5 commits from upstream-pr/1732 into main 2026-10-11 05:33:47 +00:00
TheAggie commented 2026-10-08 17:51:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TheAggie on 2026-10-08T17:51:29Z.


What

A draw resolves each stage's program address (SPI_SHADER_PGM_LO/HI_*) against the shaders registered through sceAgcDriverRegisterShader. An address outside every registration threw graphics program does not belong to a compatible registered shader. Dispatches already fall back to reading the code from guest memory (ReadRawComputeShader).

RADV on the PS5 (mihawk-99/PS5_Mesa) never registers its shaders. It uploads ACO's code to GPU memory and programs the registers directly, as on Linux. Every RADV draw was dropped: ccleste (PPSA59322) presented only black frames.

Rule (from review). An empty shader registry is known before the draw, so it is the reason a graphics program may be read without registration:

  • ProgramSnapshot(registry, address, types) returns the registered program of a compatible type.
    • If there is none and the registry is empty, it reads the code from guest memory (ReadRawComputeShader, renamed ReadRawShader).
    • With any shader registered, an unregistered address still throws as on main.
  • A draw that uses such a raw program is noted. After that, RegisterShader throws a shader was registered after graphics programs were drawn without registration. A title that registers shaders after drawing unregistered programs isn't understood yet, so it stops where that happens.
  • Dispatches keep main's own compute fallback (RegisteredProgram, then ReadRawShader).

Header-less programs:

  • The binary-type check is skipped, because the type only says which AGC binary kind a registration holds.
  • On the geometry path such a front program counts as a single-stage program (type 2), so the merged user-data pointer is optional.
  • Draw leaves out empty memory regions, so no empty header region reaches RequestMemoryView.
  • DecodeVertexStageInfo returns no embedded fetch for an empty header. RADV vertex shaders load their own attributes.

Preparation. ReportPreparedAtUse accepts an unregistered graphics program and prepares it at first use, as main does for unregistered compute programs. For a rect-list draw whose programs are unregistered, Draw calls ResolvePreparedGraphics(front, fragment, 17, …) before PreparedRectangle. Registration would otherwise have prepared the rectangle shaders.

Draw cache. The register draw key identifies an unregistered program only by its address, and a key hit reused the entry's decode without reading the program again. A key hit now re-reads each raw program (DecodeProgramsCurrent, through ReadRawShader's by-value check) and drops the entry when one changed. Registered programs are not checked.

Tests:

  • agc_driver (testProgramSnapshots):
    • A registered entry resolves to its registration, also from inside its code.
    • With shaders registered, an unregistered address throws.
    • With an empty registry, the same address reads raw code with an empty header, with the same snapshot for unchanged code.
    • An unmapped address throws.
    • The draw-cache cases: a decode stays current while its programs are unchanged, becomes stale when its raw program is rewritten, and is current again with the new snapshot.
  • agc_driver_graphics (HeaderlessVertexStageTests): a header-less vertex program gets no fetch table, and a truncated non-empty header still throws.
  • New GPU test agc_driver_prepared_unregistered_graphics:
    • A vertex and a fragment program in memory, with an empty registry, decode as raw code.
    • The draw is noted, and a later RegisterShader throws.
    • InvocationFor prepares each stage once and reuses it, also for a relocated push-constant block.
    • PreparedRectangle finds the rectangle shaders after ResolvePreparedGraphics.
    • With the RegisterShader check removed, it fails.
  • agc_driver_prepared_graphics: a registry that holds other shaders but not this program still rejects the decode with "registered".

Tested

Windows 11 Pro (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, NVIDIA GeForce RTX 5070 Ti. Rebased onto main e28fbc27.

  • agc|shader|recompiler|guest: 589 passed, 1 skipped, 5 failed. Those five fail the same way on main here:
    • guest_memory (dlopen) and guest_filesystem (creating a symbolic link needs Developer Mode on this machine);
    • agc_driver_cmask_fast_clear, agc_driver_conservative_rasterization and agc_driver_ngg_vertex_wave_info (vkWaitForFences timeouts on this machine).
  • ccleste:
    • Earlier result: it rendered its title screen with an earlier version of this PR, on a branch that also carried the RADV fixes it needs.
    • What changed: the rule only changes what happens while shaders are registered, and RADV registers none.
    • Not re-run end to end: on current main ccleste now stops earlier, at _umtx_op (#1482), then pthread_set_name_np (#3031) and pthread_attr_getscope.

Not tested on AMD, Intel or Linux.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4790742823 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1732). Originally posted by [TheAggie](https://github.com/TheAggie) on 2026-10-08T17:51:29Z. --- ### What A draw resolves each stage's program address (`SPI_SHADER_PGM_LO/HI_*`) against the shaders registered through `sceAgcDriverRegisterShader`. An address outside every registration threw `graphics program does not belong to a compatible registered shader`. Dispatches already fall back to reading the code from guest memory (`ReadRawComputeShader`). RADV on the PS5 ([mihawk-99/PS5_Mesa](https://github.com/mihawk-99/PS5_Mesa)) never registers its shaders. It uploads ACO's code to GPU memory and programs the registers directly, as on Linux. Every RADV draw was dropped: ccleste (PPSA59322) presented only black frames. **Rule (from review).** An empty shader registry is known before the draw, so it is the reason a graphics program may be read without registration: - `ProgramSnapshot(registry, address, types)` returns the registered program of a compatible type. - If there is none and the registry is **empty**, it reads the code from guest memory (`ReadRawComputeShader`, renamed `ReadRawShader`). - With any shader registered, an unregistered address still throws as on `main`. - A draw that uses such a raw program is noted. After that, `RegisterShader` throws `a shader was registered after graphics programs were drawn without registration`. A title that registers shaders after drawing unregistered programs isn't understood yet, so it stops where that happens. - Dispatches keep `main`'s own compute fallback (`RegisteredProgram`, then `ReadRawShader`). **Header-less programs:** - The binary-type check is skipped, because the type only says which AGC binary kind a registration holds. - On the geometry path such a front program counts as a single-stage program (type 2), so the merged user-data pointer is optional. - `Draw` leaves out empty memory regions, so no empty header region reaches `RequestMemoryView`. - `DecodeVertexStageInfo` returns no embedded fetch for an empty header. RADV vertex shaders load their own attributes. **Preparation.** `ReportPreparedAtUse` accepts an unregistered graphics program and prepares it at first use, as `main` does for unregistered compute programs. For a rect-list draw whose programs are unregistered, `Draw` calls `ResolvePreparedGraphics(front, fragment, 17, …)` before `PreparedRectangle`. Registration would otherwise have prepared the rectangle shaders. **Draw cache.** The register draw key identifies an unregistered program only by its address, and a key hit reused the entry's decode without reading the program again. A key hit now re-reads each raw program (`DecodeProgramsCurrent`, through `ReadRawShader`'s by-value check) and drops the entry when one changed. Registered programs are not checked. **Tests:** - **`agc_driver` (`testProgramSnapshots`):** - A registered entry resolves to its registration, also from inside its code. - With shaders registered, an unregistered address throws. - With an empty registry, the same address reads raw code with an empty header, with the same snapshot for unchanged code. - An unmapped address throws. - The draw-cache cases: a decode stays current while its programs are unchanged, becomes stale when its raw program is rewritten, and is current again with the new snapshot. - **`agc_driver_graphics` (`HeaderlessVertexStageTests`):** a header-less vertex program gets no fetch table, and a truncated non-empty header still throws. - **New GPU test `agc_driver_prepared_unregistered_graphics`:** - A vertex and a fragment program in memory, with an empty registry, decode as raw code. - The draw is noted, and a later `RegisterShader` throws. - `InvocationFor` prepares each stage once and reuses it, also for a relocated push-constant block. - `PreparedRectangle` finds the rectangle shaders after `ResolvePreparedGraphics`. - With the `RegisterShader` check removed, it fails. - **`agc_driver_prepared_graphics`:** a registry that holds other shaders but not this program still rejects the decode with "registered". ### Tested Windows 11 Pro (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, NVIDIA GeForce RTX 5070 Ti. Rebased onto `main` e28fbc27. - **`agc|shader|recompiler|guest`:** 589 passed, 1 skipped, 5 failed. Those five fail the same way on `main` here: - `guest_memory` (`dlopen`) and `guest_filesystem` (creating a symbolic link needs Developer Mode on this machine); - `agc_driver_cmask_fast_clear`, `agc_driver_conservative_rasterization` and `agc_driver_ngg_vertex_wave_info` (`vkWaitForFences` timeouts on this machine). - **ccleste:** - **Earlier result:** it rendered its title screen with an earlier version of this PR, on a branch that also carried the RADV fixes it needs. - **What changed:** the rule only changes what happens while shaders are registered, and RADV registers none. - **Not re-run end to end:** on current `main` ccleste now stops earlier, at `_umtx_op` (#1482), then `pthread_set_name_np` (#3031) and `pthread_attr_getscope`. Not tested on AMD, Intel or Linux. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
TheAggie commented 2026-10-08 19:49:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TheAggie on 2026-10-08T19:49:29Z.


Heads-up: since #639, graphics programs are prepared at registration and only unregistered compute programs fall back to preparing at dispatch, so this PR as it stands would now stop at unregistered program is not a compute shader. I'm reworking it to give unregistered graphics programs the same fallback (including the rect-list path) and will update the branch and description when it's tested; no need to review the current version.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6067814983 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1732#issuecomment-6067814983). Originally posted by [TheAggie](https://github.com/TheAggie) on 2026-10-08T19:49:29Z. --- Heads-up: since #639, graphics programs are prepared at registration and only unregistered compute programs fall back to preparing at dispatch, so this PR as it stands would now stop at `unregistered program is not a compute shader`. I'm reworking it to give unregistered graphics programs the same fallback (including the rect-list path) and will update the branch and description when it's tested; no need to review the current version.
TheAggie commented 2026-10-08 20:08:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TheAggie on 2026-10-08T20:08:51Z.


Updated for #639: unregistered graphics programs are now prepared at first use (and their rect-list shaders resolved before PreparedRectangle), while the registration-time static-ABI decode still requires registered programs. New GPU test agc_driver_prepared_unregistered_graphics; the description is updated. Ready for review.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6068130016 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1732#issuecomment-6068130016). Originally posted by [TheAggie](https://github.com/TheAggie) on 2026-10-08T20:08:51Z. --- Updated for #639: unregistered graphics programs are now prepared at first use (and their rect-list shaders resolved before `PreparedRectangle`), while the registration-time static-ABI decode still requires registered programs. New GPU test `agc_driver_prepared_unregistered_graphics`; the description is updated. Ready for review.
fisherjoey commented 2026-10-09 01:22:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-09T01:22:26Z.


Linux results, since this was tested on Windows only. Everything passes here.

Nobara 44 (Linux 7.2), GCC 16.2.1, Release, BUILD_TESTING=ON. This PR merged onto main 29e533ac.

main 29e533ac main + this PR
RTX 5070 Ti, driver 595.91.07, ctest -R agc_driver -j1 183 / 183 199 / 199
RADV, Ryzen 5 7600X iGPU (gfx1036), Mesa 26.2.1, same 183 / 183 199 / 199
CPU tests (-E agc_driver) 279 / 280 284 / 285

The CPU failure is guest_dynamic_loader, which fails the same way on main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6072325399 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1732#issuecomment-6072325399). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-09T01:22:26Z. --- Linux results, since this was tested on Windows only. Everything passes here. Nobara 44 (Linux 7.2), GCC 16.2.1, Release, `BUILD_TESTING=ON`. This PR merged onto `main` 29e533ac. | | `main` 29e533ac | `main` + this PR | |---|---|---| | RTX 5070 Ti, driver 595.91.07, `ctest -R agc_driver -j1` | 183 / 183 | 199 / 199 | | RADV, Ryzen 5 7600X iGPU (gfx1036), Mesa 26.2.1, same | 183 / 183 | 199 / 199 | | CPU tests (`-E agc_driver`) | 279 / 280 | 284 / 285 | The CPU failure is `guest_dynamic_loader`, which fails the same way on `main`.
MarcZX10 commented 2026-10-09 06:32:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T06:32:47Z.

Review: APPROVED


Reviewed the current head and full diff, including unregistered program resolution, cache invalidation, the headerless vertex path, and the new GPU regression. The issue raised after #639 is addressed in this revision. The reported Linux results from fisherjoey cover NVIDIA and RADV; upstream check rollup is still empty, so CI has not reported on this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5466568270 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1732#pullrequestreview-5466568270). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T06:32:47Z. **Review:** APPROVED --- Reviewed the current head and full diff, including unregistered program resolution, cache invalidation, the headerless vertex path, and the new GPU regression. The issue raised after #639 is addressed in this revision. The reported Linux results from fisherjoey cover NVIDIA and RADV; upstream check rollup is still empty, so CI has not reported on this head.
oneandonlydean commented 2026-10-09 22:31:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T22:31:05Z.


Could this decide up front which programs are deferred, the way #1836 does (a header that is missing for a known reason), instead of compiling whatever wasn't registered at the first draw? Anything else should still throw at registration.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6090338283 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1732#issuecomment-6090338283). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T22:31:05Z. --- Could this decide up front which programs are deferred, the way #1836 does (a header that is missing for a known reason), instead of compiling whatever wasn't registered at the first draw? Anything else should still throw at registration.
TheAggie commented 2026-10-10 07:50:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TheAggie on 2026-10-10T07:50:19Z.


@oneandonlydean thanks for the pointer to #1836. Before I change the code, here's the rule I'd like to use. Please say if it isn't what you meant.

Where this stands. At draw time DecodeGraphicsPrograms is called with staticAbi false, so as written this PR prepares any unregistered graphics program at its first draw. That's the behaviour you objected to.

Proposed known reason: the title registers no shaders at all. RADV on the PS5 builds and places its own programs and never calls RegisterShader. AGC titles register every program before drawing it. I logged both on Windows (local build, logging not committed):

  • RetroArch (PPSA99169) running Dolphin: 0 registered shaders; every graphics program is read raw.
  • ccleste (PPSA59322): 0 registered shaders, 192 raw program reads, renders at 60 FPS.

So a draw would read an unregistered graphics program raw only while the registry is empty. As soon as any shader has been registered, an unregistered program throws graphics program does not belong to a registered shader as it does today. A title that registers shaders and then draws one it didn't register still stops there.

The decision is made at the draw, before any preparation, from the registry state. The raw path stays the one unregistered compute shaders already take. Compute itself wouldn't change: unregistered compute shaders on main are prepared at dispatch whatever the registry holds. I can apply the same rule there too if you prefer, but that would be a behaviour change for compute, so I'd keep it out of this PR.

Two questions:

  1. Is "no shader registered" an acceptable known reason, or would you rather key it on something narrower?
  2. Should registration after raw draws have started (a mixed title) throw, or only make later unregistered programs throw?

Once you're happy with the rule I'll implement it, with tests for both sides, and update #1825 on top.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095296573 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1732#issuecomment-6095296573). Originally posted by [TheAggie](https://github.com/TheAggie) on 2026-10-10T07:50:19Z. --- @oneandonlydean thanks for the pointer to #1836. Before I change the code, here's the rule I'd like to use. Please say if it isn't what you meant. **Where this stands.** At draw time `DecodeGraphicsPrograms` is called with `staticAbi` false, so as written this PR prepares any unregistered graphics program at its first draw. That's the behaviour you objected to. **Proposed known reason: the title registers no shaders at all.** RADV on the PS5 builds and places its own programs and never calls `RegisterShader`. AGC titles register every program before drawing it. I logged both on Windows (local build, logging not committed): - RetroArch (PPSA99169) running Dolphin: 0 registered shaders; every graphics program is read raw. - ccleste (PPSA59322): 0 registered shaders, 192 raw program reads, renders at 60 FPS. So a draw would read an unregistered graphics program raw only while the registry is empty. As soon as any shader has been registered, an unregistered program throws `graphics program does not belong to a registered shader` as it does today. A title that registers shaders and then draws one it didn't register still stops there. The decision is made at the draw, before any preparation, from the registry state. The raw path stays the one unregistered compute shaders already take. Compute itself wouldn't change: unregistered compute shaders on `main` are prepared at dispatch whatever the registry holds. I can apply the same rule there too if you prefer, but that would be a behaviour change for compute, so I'd keep it out of this PR. Two questions: 1. Is "no shader registered" an acceptable known reason, or would you rather key it on something narrower? 2. Should registration after raw draws have started (a mixed title) throw, or only make later unregistered programs throw? Once you're happy with the rule I'll implement it, with tests for both sides, and update #1825 on top. AI-assisted (Claude Code).
oneandonlydean commented 2026-10-10 08:06:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T08:06:34Z.


  1. Yes: a registry with no shaders in it is known before the draw, so it works as the reason.
  2. Throw at the registration. A title that registers shaders after drawing raw programs isn't understood yet, and it should stop where that happens.

It also conflicts with main in DrawDecode.cpp and ShaderRegistry.cpp; please rebase with the change.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095516860 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1732#issuecomment-6095516860). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T08:06:34Z. --- 1. Yes: a registry with no shaders in it is known before the draw, so it works as the reason. 2. Throw at the registration. A title that registers shaders after drawing raw programs isn't understood yet, and it should stop where that happens. It also conflicts with main in `DrawDecode.cpp` and `ShaderRegistry.cpp`; please rebase with the change.
oneandonlydean commented 2026-10-10 18:08:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T18:08:36Z.


The rebase is in, but not the rule from my answer above: ProgramSnapshot (DrawDecode.cpp) still reads any unregistered graphics program raw, and testProgramSnapshots expects that with shaders registered. Please read raw only while the registry is empty, throw at RegisterShader once raw draws have happened, and update the description to match.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6100606990 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1732#issuecomment-6100606990). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T18:08:36Z. --- The rebase is in, but not the rule from my answer above: `ProgramSnapshot` (`DrawDecode.cpp`) still reads any unregistered graphics program raw, and `testProgramSnapshots` expects that with shaders registered. Please read raw only while the registry is empty, throw at `RegisterShader` once raw draws have happened, and update the description to match.
Amoenus commented 2026-10-10 18:26:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-10T18:26:51Z.


Additional empty-registry title evidence: PPSA99902

Sonic Unleashed Recompiled (PPSA99902, 01.003.000) reaches the existing graphics-program refusal after local startup-library validation. This report checks the registry at that refusal; it does not claim to have tested this PR's head or fixed rendering.

Windows 11 Enterprise 26200, RTX 5080, WinLibs r7 GCC 15.2.0, Release, BUILD_TESTING=ON. The conditional local stack is based on 57f96fd2, commit f61e0d7768005504fc70ea385534182a2061ebfb; the executable uses the main relinker at that snapshot with unused-filter=2. Main's AGC/AGC-driver source did not change between that snapshot and freshly fetched bf6e25a1. Unmodified-main startup still stops earlier at dup.

Program-name validation and the controlled comparison explain the prerequisites. With the native getprogname implementation, five runs reached RTX 5080 Vulkan device readiness and swapchain creation, then stopped at:

AGC driver: graphics program does not belong to a registered shader

To identify the exact registry state, temporarily added this diagnostic immediately before the unchanged require(it != registry.begin(), ...) in DecodeGraphicsPrograms:

if (it == registry.begin()) std::fprintf(stderr, "[diagnostic-raw-draw] address=0x%llx registrySize=%zu staticAbi=%u stage=%u requestedType=%u\n", static_cast<unsigned long long>(address), registry.size(), staticAbi ? 1u : 0u, static_cast<unsigned>(stage), static_cast<unsigned>(type));

Two startup runs agreed:

[diagnostic-raw-draw] address=0x205830e00 registrySize=0 staticAbi=0 stage=1 requestedType=2
[videoout] presentation failed: AGC driver: graphics program does not belong to a registered shader

Both exited 0xC0000409 after 6.545 and 6.657 seconds. The immutable diagnostic runtime profile changed only libSceAgcDriver.prx from the program-name comparison profile. The logging leaves the throwing guard and all decoding/preparation behavior intact. Source was restored; full system libraries rebuilt. agc_driver, agc_driver_graphics and agc_driver_prepared_graphics passed 5/5 each both with the diagnostic and after restoration, with no skips and every test below 30 seconds (largest about 4 seconds).

This title's observed failing draw has an empty registry and staticAbi=false, so it supplies another measured case relevant to the agreed empty-registry policy. It does not validate accepting missing programs when registered shaders exist, or registration after raw draws. Those remain the separate refusal cases required by the review.

Original unwrapped executable SHA256 c34f5b0848ef49e96a855076d8254254047e966e4fe56589d0e504fe13828479; baseline libraries and guest libc preserved. No rendering/gameplay, Linux or console claim. Logs, manifests and temporary patch retained locally outside the repository. AI-assisted investigation: Codex. No new PR or branch push.

Current-main confirmation: refreshed the local diagnostic stack onto main bf6e25a1ddc009eb232fdfdb3e6ff58b962df006 (local commit 1c2b72a0941314b063e0993f4c74b05dc67d72df) and rebuilt full libraries plus the relinker. All 30 TLS coverage groups and five relevant library tests passed 5/5 each; conventions and test registration passed. Reconverted the original title in both filter modes in an isolated output directory. Five strict-filter startup runs again reached the RTX 5080 Vulkan device/swapchain and the same shader-registration refusal; the default-filter stop remains missing pathconf (oc98+zOImus). The new strict executable and guest libc are bit-for-bit identical to their earlier-main conversion, so the recent TLS change does not change these particular artifacts. Baseline runtime-library and original-source hashes verified after all runs. No rendering/gameplay or standalone-current-main compatibility claim; other local prerequisites remain in this stack.

Follow-up: exact-head tests, policy correction and controlled title comparison

Now tested #1732 head 00fcac677eda65daa66e8498364a71f3e57e8d08: replayed its four exclusive commits onto pinned main 1476f76941a789690fd0f9c84c1cc929bb6fe262, with full libraries and the four existing relevant AGC test groups passing 5/5 each on Windows 11 Enterprise 26200, RTX 5080, WinLibs r7 GCC 15.2.0, Release, BUILD_TESTING=ON.

Additional behavioral probes confirm the two gaps in the agreed review policy:

  • In 5/5 runs, DecodeGraphicsPrograms accepted a raw program with an unrelated registered shader present. Empty-registry raw decoding succeeded too. Existing tests passing did not cover this refusal.
  • A PM4 submission through sceAgcDriverSubmitDcb, followed by AgcDriverWaitIdle, completed a raw vertex/pixel draw; a subsequent valid compute-shader registration succeeded. This is a real driver-path probe, not only a registry helper call.

An unpublished local correction (7c2a34b64099e597403e80c182c422056992dd24) restricts raw graphics to !staticAbi && registry.empty(), tracks entry into the raw draw path after prechecks, and refuses later registration under the driver mutex. It also checks the live registry when an earlier submission captured an empty registry, and rechecks registration at publication. Compute raw lookup remains available with a nonempty registry. No console or instruction semantics were added.

New behavioral tests cover nonempty/static-ABI refusal, supported registered lookup, preserved compute lookup, two completed raw draws followed by registration refusal, zero-count draws followed by successful registration, a registered-first raw draw refusal, and a wait-gated submission whose captured empty registry becomes stale before execution. All 15 relevant test groups passed five repetitions before and after mutation testing, with no skips and a largest restored test of 4.03 seconds. Four deliberate changes were caught by the intended assertions: broadening the fallback, removing the draw marker, removing the live-registry check, and removing the early registration check. The final publication guard remains in place; its narrow concurrent-preparation race was not separately mutation-tested. Full libraries restored; conventions and test registration passed. An initial new-test teardown failure was fixed by using the existing availability-probe scope and explicit driver shutdown pattern; its failing log is retained locally.

For PPSA99902, copied the preserved 120-PRX diagnostic profile at 1c2b72a0941314b063e0993f4c74b05dc67d72df and changed only libSceAgcDriver.prx to the independently built proposal plus correction above. The executable and guest libc remain the verified bf6-main conversion, whose relinker source is unchanged at main1476. This is a conditional runtime with other local prerequisites, not standalone current-main compatibility.

Five strict-filter runs (6.834, 6.781, 6.856, 6.752, 6.702 seconds) passed the previous registration refusal, prepared raw vertex 0x205830e00, pixel programs 0x205831000/0x205831200, and rectangle variants, then stopped at AGC graphics: unsupported color tile mode (0xC0000409). Restoring the earlier profile both before and after reproduced the original registration refusal. Default filtering still stops at pathconf (oc98+zOImus). No rendering, gameplay or physical-audio result is claimed.

Fresh unmodified main1476 has merged dup; its first stop in both filter modes is now unresolved fork (cjt-4ySmYTs) before entry. The earlier first-stop observations in this thread are pinned historical results.

Baseline integrity after the comparisons: all 123 original runtime-library files and guest libc match preserved copies; original eboot.bin remains SHA256 c34f5b0848ef49e96a855076d8254254047e966e4fe56589d0e504fe13828479. Title-generated cache/configuration files are outside that claim. Reports, test logs, probes, manifests and temporary diagnostic patches are retained outside the repository. No new PR or branch push. AI-assisted investigation and local correction: Codex.

Color-target follow-up: the rejected descriptor is confirmed as COLOR_SW_MODE=0x1a (SW_64KB_D_X); exact fields and independent decoder controls are now reported in #2970. This is a separate explicit unsupported color-target mode, with no speculative layout change included.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6100779322 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1732#issuecomment-6100779322). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-10T18:26:51Z. --- ### Additional empty-registry title evidence: PPSA99902 Sonic Unleashed Recompiled (PPSA99902, 01.003.000) reaches the existing graphics-program refusal after local startup-library validation. This report checks the registry at that refusal; it does not claim to have tested this PR's head or fixed rendering. Windows 11 Enterprise 26200, RTX 5080, WinLibs r7 GCC 15.2.0, Release, `BUILD_TESTING=ON`. The conditional local stack is based on `57f96fd2`, commit `f61e0d7768005504fc70ea385534182a2061ebfb`; the executable uses the main relinker at that snapshot with `unused-filter=2`. Main's AGC/AGC-driver source did not change between that snapshot and freshly fetched `bf6e25a1`. Unmodified-main startup still stops earlier at `dup`. [Program-name validation and the controlled comparison](https://github.com/boykopovar/AnyPS5/pull/2218#issuecomment-6100753851) explain the prerequisites. With the native `getprogname` implementation, five runs reached RTX 5080 Vulkan device readiness and swapchain creation, then stopped at: ```text AGC driver: graphics program does not belong to a registered shader ``` To identify the exact registry state, temporarily added this diagnostic immediately before the unchanged `require(it != registry.begin(), ...)` in `DecodeGraphicsPrograms`: ```cpp if (it == registry.begin()) std::fprintf(stderr, "[diagnostic-raw-draw] address=0x%llx registrySize=%zu staticAbi=%u stage=%u requestedType=%u\n", static_cast<unsigned long long>(address), registry.size(), staticAbi ? 1u : 0u, static_cast<unsigned>(stage), static_cast<unsigned>(type)); ``` Two startup runs agreed: ```text [diagnostic-raw-draw] address=0x205830e00 registrySize=0 staticAbi=0 stage=1 requestedType=2 [videoout] presentation failed: AGC driver: graphics program does not belong to a registered shader ``` Both exited `0xC0000409` after 6.545 and 6.657 seconds. The immutable diagnostic runtime profile changed only `libSceAgcDriver.prx` from the program-name comparison profile. The logging leaves the throwing guard and all decoding/preparation behavior intact. Source was restored; full system libraries rebuilt. `agc_driver`, `agc_driver_graphics` and `agc_driver_prepared_graphics` passed 5/5 each both with the diagnostic and after restoration, with no skips and every test below 30 seconds (largest about 4 seconds). This title's observed failing draw has an empty registry and `staticAbi=false`, so it supplies another measured case relevant to [the agreed empty-registry policy](https://github.com/boykopovar/AnyPS5/pull/1732#issuecomment-6095516860). It does not validate accepting missing programs when registered shaders exist, or registration after raw draws. Those remain the separate refusal cases required by the review. Original unwrapped executable SHA256 `c34f5b0848ef49e96a855076d8254254047e966e4fe56589d0e504fe13828479`; baseline libraries and guest libc preserved. No rendering/gameplay, Linux or console claim. Logs, manifests and temporary patch retained locally outside the repository. AI-assisted investigation: Codex. No new PR or branch push. Current-main confirmation: refreshed the local diagnostic stack onto main `bf6e25a1ddc009eb232fdfdb3e6ff58b962df006` (local commit `1c2b72a0941314b063e0993f4c74b05dc67d72df`) and rebuilt full libraries plus the relinker. All 30 TLS coverage groups and five relevant library tests passed 5/5 each; conventions and test registration passed. Reconverted the original title in both filter modes in an isolated output directory. Five strict-filter startup runs again reached the RTX 5080 Vulkan device/swapchain and the same shader-registration refusal; the default-filter stop remains missing `pathconf` (`oc98+zOImus`). The new strict executable and guest libc are bit-for-bit identical to their earlier-main conversion, so the recent TLS change does not change these particular artifacts. Baseline runtime-library and original-source hashes verified after all runs. No rendering/gameplay or standalone-current-main compatibility claim; other local prerequisites remain in this stack. ### Follow-up: exact-head tests, policy correction and controlled title comparison Now tested #1732 head `00fcac677eda65daa66e8498364a71f3e57e8d08`: replayed its four exclusive commits onto pinned main `1476f76941a789690fd0f9c84c1cc929bb6fe262`, with full libraries and the four existing relevant AGC test groups passing 5/5 each on Windows 11 Enterprise 26200, RTX 5080, WinLibs r7 GCC 15.2.0, Release, `BUILD_TESTING=ON`. Additional behavioral probes confirm the two gaps in the [agreed review policy](https://github.com/boykopovar/AnyPS5/pull/1732#issuecomment-6095516860): - In 5/5 runs, `DecodeGraphicsPrograms` accepted a raw program with an unrelated registered shader present. Empty-registry raw decoding succeeded too. Existing tests passing did not cover this refusal. - A PM4 submission through `sceAgcDriverSubmitDcb`, followed by `AgcDriverWaitIdle`, completed a raw vertex/pixel draw; a subsequent valid compute-shader registration succeeded. This is a real driver-path probe, not only a registry helper call. An unpublished local correction (`7c2a34b64099e597403e80c182c422056992dd24`) restricts raw graphics to `!staticAbi && registry.empty()`, tracks entry into the raw draw path after prechecks, and refuses later registration under the driver mutex. It also checks the live registry when an earlier submission captured an empty registry, and rechecks registration at publication. Compute raw lookup remains available with a nonempty registry. No console or instruction semantics were added. New behavioral tests cover nonempty/static-ABI refusal, supported registered lookup, preserved compute lookup, two completed raw draws followed by registration refusal, zero-count draws followed by successful registration, a registered-first raw draw refusal, and a wait-gated submission whose captured empty registry becomes stale before execution. All 15 relevant test groups passed five repetitions before and after mutation testing, with no skips and a largest restored test of 4.03 seconds. Four deliberate changes were caught by the intended assertions: broadening the fallback, removing the draw marker, removing the live-registry check, and removing the early registration check. The final publication guard remains in place; its narrow concurrent-preparation race was not separately mutation-tested. Full libraries restored; conventions and test registration passed. An initial new-test teardown failure was fixed by using the existing availability-probe scope and explicit driver shutdown pattern; its failing log is retained locally. For PPSA99902, copied the preserved 120-PRX diagnostic profile at `1c2b72a0941314b063e0993f4c74b05dc67d72df` and changed **only `libSceAgcDriver.prx`** to the independently built proposal plus correction above. The executable and guest libc remain the verified bf6-main conversion, whose relinker source is unchanged at main1476. This is a conditional runtime with other local prerequisites, not standalone current-main compatibility. Five strict-filter runs (6.834, 6.781, 6.856, 6.752, 6.702 seconds) passed the previous registration refusal, prepared raw vertex `0x205830e00`, pixel programs `0x205831000`/`0x205831200`, and rectangle variants, then stopped at `AGC graphics: unsupported color tile mode` (`0xC0000409`). Restoring the earlier profile both before and after reproduced the original registration refusal. Default filtering still stops at `pathconf` (`oc98+zOImus`). No rendering, gameplay or physical-audio result is claimed. Fresh unmodified main1476 has merged `dup`; its first stop in both filter modes is now unresolved `fork` (`cjt-4ySmYTs`) before entry. The earlier first-stop observations in this thread are pinned historical results. Baseline integrity after the comparisons: all 123 original runtime-library files and guest libc match preserved copies; original `eboot.bin` remains SHA256 `c34f5b0848ef49e96a855076d8254254047e966e4fe56589d0e504fe13828479`. Title-generated cache/configuration files are outside that claim. Reports, test logs, probes, manifests and temporary diagnostic patches are retained outside the repository. No new PR or branch push. AI-assisted investigation and local correction: Codex. Color-target follow-up: the rejected descriptor is confirmed as `COLOR_SW_MODE=0x1a` (`SW_64KB_D_X`); exact fields and independent decoder controls are now reported in [#2970](https://github.com/boykopovar/AnyPS5/issues/2970). This is a separate explicit unsupported color-target mode, with no speculative layout change included.
adriadam10 commented 2026-10-10 23:59:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T23:59:05Z.

Review: DISMISSED


Checked against the head (00fcac677) and the thread. Dean's rule from the comments above is not in this head yet, and it conflicts with main:

  • ProgramSnapshot (DrawDecode.cpp:106) still falls back to ReadRawShader for any unregistered address, with shaders registered. Per the agreed rule: read raw only while the registry is empty, and throw at RegisterShader once raw draws have happened. testProgramSnapshots (tests/Submit.cpp) currently pins the opposite and needs to change with it.
  • Rebase onto current main (conflicts in DrawDecode.cpp and ShaderRegistry.cpp), then rerun agc_driver, agc_driver_graphics and agc_driver_prepared_unregistered_graphics.
  • Update the description (Decode / Behaviour change sections) to the empty-registry rule.

Linux results from @fisherjoey and the approval from @MarcZX100 are for the previous head, so they will need repeating after the change.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5481254363 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1732#pullrequestreview-5481254363). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T23:59:05Z. **Review:** DISMISSED --- Checked against the head (`00fcac677`) and the thread. Dean's rule from the comments above is not in this head yet, and it conflicts with `main`: - `ProgramSnapshot` (`DrawDecode.cpp:106`) still falls back to `ReadRawShader` for any unregistered address, with shaders registered. Per the agreed rule: read raw only while the registry is empty, and throw at `RegisterShader` once raw draws have happened. `testProgramSnapshots` (`tests/Submit.cpp`) currently pins the opposite and needs to change with it. - Rebase onto current `main` (conflicts in `DrawDecode.cpp` and `ShaderRegistry.cpp`), then rerun `agc_driver`, `agc_driver_graphics` and `agc_driver_prepared_unregistered_graphics`. - Update the description (Decode / Behaviour change sections) to the empty-registry rule. Linux results from @fisherjoey and the approval from @MarcZX100 are for the previous head, so they will need repeating after the change.
TheAggie commented 2026-10-11 00:18:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TheAggie on 2026-10-11T00:18:42Z.


@oneandonlydean done, in 39fdc48b on top of a rebase onto main e28fbc27:

  • Raw reads: ProgramSnapshot reads an unregistered graphics program raw only while the registry is empty. With any shader registered it throws as main does (graphics program does not belong to a compatible registered shader).
  • RegisterShader: a draw that uses a raw program is noted, and RegisterShader throws once that has happened.
  • testProgramSnapshots: now expects the throw with shaders registered, and raw reads only with an empty registry.
    • agc_driver_prepared_unregistered_graphics checks the RegisterShader refusal after a raw draw, and fails without it.
    • agc_driver_prepared_graphics rejects a decode against a registry that holds other shaders.
  • Rebase:
    • Dispatches now keep main's own compute fallback.
    • ReportPreparedAtUse accepts an unregistered graphics program, where it only accepted compute before.
  • Description: updated to match.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6103683304 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1732#issuecomment-6103683304). Originally posted by [TheAggie](https://github.com/TheAggie) on 2026-10-11T00:18:42Z. --- @oneandonlydean done, in 39fdc48b on top of a rebase onto `main` e28fbc27: - **Raw reads:** `ProgramSnapshot` reads an unregistered graphics program raw only while the registry is empty. With any shader registered it throws as `main` does (`graphics program does not belong to a compatible registered shader`). - **`RegisterShader`:** a draw that uses a raw program is noted, and `RegisterShader` throws once that has happened. - **`testProgramSnapshots`:** now expects the throw with shaders registered, and raw reads only with an empty registry. - `agc_driver_prepared_unregistered_graphics` checks the `RegisterShader` refusal after a raw draw, and fails without it. - `agc_driver_prepared_graphics` rejects a decode against a registry that holds other shaders. - **Rebase:** - Dispatches now keep `main`'s own compute fallback. - `ReportPreparedAtUse` accepts an unregistered graphics program, where it only accepted compute before. - **Description:** updated to match. AI-assisted (Claude Code).
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!1732
No description provided.