feat(agc): run unregistered NGG vertex programs that need a workgroup on the mesh path #1825

Merged
TheAggie merged 4 commits from upstream-pr/1825 into main 2026-10-11 07:35:20 +00:00
TheAggie commented 2026-10-08 20:37:36 +00:00 (Migrated from github.com)

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


What

RADV on the PS5 (mihawk-99/PS5_Mesa) enables NGG culling by default on GFX10 and GFX10.3 (radv_physical_device.c, use_ngg_culling). Its vertex shaders are then ACO's NGG culling programs:

  • They share vertex data through LDS with s_barrier.
  • They count surviving vertices with v_mbcnt and a prefix sum, and read the wave's total with v_readlane_b32 of lane 63.
  • They allocate and export their own primitives (s_sendmsg GS_ALLOC_REQ, prim export).

AnyPS5 runs a PRIMGEN draw without GS on the vertex path, a Vulkan vertex shader with one guest lane per invocation. It has no workgroup memory or barrier, and on a 32-lane host it cannot read lanes 32-63. Every such draw failed with v_readlane_b32 of lane 63 is outside the 32-lane host subgroup. ccleste (PPSA59322) only rendered with RADV_DEBUG=nonggc.

The geometry path already provides what these programs need:

  • A mesh workgroup with LDS.
  • Two guest lanes per invocation for wave64 on a 32-lane host (SpirvEmitter.cpp, laneCount).
  • GS_ALLOC_REQ and primitive exports.

This PR sends such a draw there.

  • decodeDraw routes a draw to the geometry path when all of these hold:

    • VGT_SHADER_STAGES_EN has PRIMGEN_EN without GS_EN, PRIMGEN_PASSTHRU_EN or HS_EN.
    • The vertex program is unregistered (no AGC header).
    • The program uses LDS or s_barrier.

    Passthrough programs and every program that works today stay on the vertex path. RADV's own blits are passthrough, as are ps5-opengl's vertex shaders.

  • ProgramUsesWorkgroup decodes the program once per snapshot (DS instructions or s_barrier) and caches the answer on it.

  • DecodeShaderStages(queue, vertexWorkgroup) builds the mesh configuration from the NGG registers for such a program:

    • The subgroup is bounded by the vertex budget (GE_MAX_OUTPUT_PER_SUBGROUP) instead of the GS output budget.
    • Each input primitive yields at most one output primitive.
    • The GS and ES VGPR count checks are skipped. The merged inputs keep their positions whatever the counts, and the mesh entry loads v0-v8 either way. vkQuake's (PPSA99010) culling vertex shaders load only the vertex ID (ES_VGPR_COMP_CNT 0); ccleste's load all.
    • Asking for this with GS_EN, passthrough or tessellation throws.
  • Registered programs keep today's routing. Routing them would also change registration-time preparation (PrepareRegistered, ResolveGraphicsStagesAbi), so I left that for a follow-up.

  • Tests:

    • agc_driver_graphics (NggVertexWorkgroupTests), using ccleste's culling-draw registers (VGT_SHADER_STAGES_EN 0x00012010, GE_NGG_SUBGRP_CNTL 0x10080, GE_MAX_OUTPUT_PER_SUBGROUP 0x80, VGT_ESGS_RING_ITEMSIZE 1):
      • Without the flag, the draw stays on the vertex path.
      • With it, a triangle list becomes a mesh configuration of 42 primitives, 126 vertices and 128 threads.
      • A strip becomes 126 primitives over 128 vertices.
      • A program with vkQuake's SPI_SHADER_PGM_RSRC1_GS/RSRC2_GS (0x222c0005, 0x00400030) takes the mesh path.
      • A vertex budget below one primitive, GS_EN, passthrough and tessellation are rejected.
    • agc_driver (testProgramWorkgroupUse): an LDS write and an s_barrier need a workgroup, a plain program does not, the result is cached, and the check starts at the program's entry.

There is no GPU execution test of a culling program on the mesh path; ccleste exercises it, below.

Tested

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

  • The full suite (478 tests) passes on this branch. It was run from the generated CTestTestfile.cmake commands because antivirus blocks ctest.exe on this machine.
  • ccleste renders its title screen and levels with RADV's NGG culling on (no RADV_DEBUG), on current main with this PR, #1819 and my other pending changes on a local branch. Earlier, on an older main, it was also play-tested this way.

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: #1732 (unregistered graphics programs); its five commits, including the empty-registry rule from its review, come first here; the last commit (ES VGPR count) was added after this PR opened
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4792506112 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1825). Originally posted by [TheAggie](https://github.com/TheAggie) on 2026-10-08T20:37:36Z. --- ### What RADV on the PS5 ([mihawk-99/PS5_Mesa](https://github.com/mihawk-99/PS5_Mesa)) enables NGG culling by default on GFX10 and GFX10.3 (`radv_physical_device.c`, `use_ngg_culling`). Its vertex shaders are then ACO's NGG culling programs: - They share vertex data through LDS with `s_barrier`. - They count surviving vertices with `v_mbcnt` and a prefix sum, and read the wave's total with `v_readlane_b32` of lane 63. - They allocate and export their own primitives (`s_sendmsg` `GS_ALLOC_REQ`, prim export). AnyPS5 runs a PRIMGEN draw without GS on the vertex path, a Vulkan vertex shader with one guest lane per invocation. It has no workgroup memory or barrier, and on a 32-lane host it cannot read lanes 32-63. Every such draw failed with `v_readlane_b32 of lane 63 is outside the 32-lane host subgroup`. ccleste (PPSA59322) only rendered with `RADV_DEBUG=nonggc`. The geometry path already provides what these programs need: - A mesh workgroup with LDS. - Two guest lanes per invocation for wave64 on a 32-lane host (`SpirvEmitter.cpp`, `laneCount`). - `GS_ALLOC_REQ` and primitive exports. This PR sends such a draw there. - `decodeDraw` routes a draw to the geometry path when all of these hold: - `VGT_SHADER_STAGES_EN` has `PRIMGEN_EN` without `GS_EN`, `PRIMGEN_PASSTHRU_EN` or `HS_EN`. - The vertex program is unregistered (no AGC header). - The program uses LDS or `s_barrier`. Passthrough programs and every program that works today stay on the vertex path. RADV's own blits are passthrough, as are ps5-opengl's vertex shaders. - `ProgramUsesWorkgroup` decodes the program once per snapshot (DS instructions or `s_barrier`) and caches the answer on it. - `DecodeShaderStages(queue, vertexWorkgroup)` builds the mesh configuration from the NGG registers for such a program: - The subgroup is bounded by the vertex budget (`GE_MAX_OUTPUT_PER_SUBGROUP`) instead of the GS output budget. - Each input primitive yields at most one output primitive. - The GS and ES VGPR count checks are skipped. The merged inputs keep their positions whatever the counts, and the mesh entry loads v0-v8 either way. vkQuake's (PPSA99010) culling vertex shaders load only the vertex ID (`ES_VGPR_COMP_CNT` 0); ccleste's load all. - Asking for this with `GS_EN`, passthrough or tessellation throws. - Registered programs keep today's routing. Routing them would also change registration-time preparation (`PrepareRegistered`, `ResolveGraphicsStagesAbi`), so I left that for a follow-up. - Tests: - `agc_driver_graphics` (`NggVertexWorkgroupTests`), using ccleste's culling-draw registers (`VGT_SHADER_STAGES_EN` 0x00012010, `GE_NGG_SUBGRP_CNTL` 0x10080, `GE_MAX_OUTPUT_PER_SUBGROUP` 0x80, `VGT_ESGS_RING_ITEMSIZE` 1): - Without the flag, the draw stays on the vertex path. - With it, a triangle list becomes a mesh configuration of 42 primitives, 126 vertices and 128 threads. - A strip becomes 126 primitives over 128 vertices. - A program with vkQuake's `SPI_SHADER_PGM_RSRC1_GS`/`RSRC2_GS` (`0x222c0005`, `0x00400030`) takes the mesh path. - A vertex budget below one primitive, `GS_EN`, passthrough and tessellation are rejected. - `agc_driver` (`testProgramWorkgroupUse`): an LDS write and an `s_barrier` need a workgroup, a plain program does not, the result is cached, and the check starts at the program's entry. There is no GPU execution test of a culling program on the mesh path; ccleste exercises it, below. ### Tested Windows 11 Pro (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, NVIDIA GeForce RTX 5070 Ti. - The full suite (478 tests) passes on this branch. It was run from the generated `CTestTestfile.cmake` commands because antivirus blocks `ctest.exe` on this machine. - ccleste renders its title screen and levels with RADV's NGG culling on (no `RADV_DEBUG`), on current `main` with this PR, #1819 and my other pending changes on a local branch. Earlier, on an older `main`, it was also play-tested this way. 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: #1732 (unregistered graphics programs); its five commits, including the empty-registry rule from its review, come first here; the last commit (ES VGPR count) was added after this PR opened - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tv7 commented 2026-10-09 11:49:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tv7 on 2026-10-09T11:49:01Z.


Title evidence: a registered (AGC header) vertex program in Marvel's Wolverine (PPSA03671, v01.001.005) has the same shape, so the front->header.empty() condition currently leaves it on the vertex path.

Windows 11, MinGW, RTX 3070 (32-lane subgroups), main d70b89989 plus #1339. The title creates its swapchain, then stops at its first draw:

SPIR-V emission failed: hash=0x76504910848 stage=1 opcode=ReadLane reason=v_readlane_b32 of lane 63 is outside the 32-lane host subgroup that runs this wave64 program at one lane per invocation

The program (wave64, 828 dwords) is NGG culling code like the one you describe:

  • s_mov_b32 exec_lo, -1, lane id from v_mbcnt_lo/hi(-1), then v_cmpx_lt_u32 of the lane id against s3.
  • Later, under EXEC -1, it builds a 64-bit mask of surviving lanes: v_cndmask of each lane's bit with the same lane id < s3 compare, then an OR scan with DPP row_shr 1/2/4/8, v_permlanex16_b32, and v_readlane_b32 of lanes 31 and 63, OR'd together.
  • Then it compacts with v_mbcnt over that mask, writes through LDS (10 DS instructions, no s_barrier), and allocates its primitives with s_sendmsg GS_ALLOC_REQ (25 exports).

Two details that may matter if registered programs take the mesh path too:

  1. The DPP steps of the OR scan have bound_ctrl set. MatchHalfWaveScan (951370324) only accepts it clear. For reductions whose identity is 0 (OR, IAdd, UMax) the result is the same either way, since the step then writes op(0, own) = own at the lanes without a source. Locally, accepting it for those three lets all four steps and the v_permlanex16_b32 match.
  2. After that, EntryLaneWalk rejects the keys: their mask comes from v_cmp_lt_u32(lane id, s3) rather than a ballot, and the vertex path sets s3 to 64 | 64 << 8.

I can test a revision of this PR on this title if that helps.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6080256908 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1825#issuecomment-6080256908). Originally posted by [tv7](https://github.com/tv7) on 2026-10-09T11:49:01Z. --- Title evidence: a registered (AGC header) vertex program in Marvel's Wolverine (PPSA03671, v01.001.005) has the same shape, so the `front->header.empty()` condition currently leaves it on the vertex path. Windows 11, MinGW, RTX 3070 (32-lane subgroups), `main` d70b89989 plus #1339. The title creates its swapchain, then stops at its first draw: ``` SPIR-V emission failed: hash=0x76504910848 stage=1 opcode=ReadLane reason=v_readlane_b32 of lane 63 is outside the 32-lane host subgroup that runs this wave64 program at one lane per invocation ``` The program (wave64, 828 dwords) is NGG culling code like the one you describe: - `s_mov_b32 exec_lo, -1`, lane id from `v_mbcnt_lo/hi(-1)`, then `v_cmpx_lt_u32` of the lane id against `s3`. - Later, under EXEC -1, it builds a 64-bit mask of surviving lanes: `v_cndmask` of each lane's bit with the same `lane id < s3` compare, then an OR scan with DPP `row_shr` 1/2/4/8, `v_permlanex16_b32`, and `v_readlane_b32` of lanes 31 and 63, OR'd together. - Then it compacts with `v_mbcnt` over that mask, writes through LDS (10 DS instructions, no `s_barrier`), and allocates its primitives with `s_sendmsg` GS_ALLOC_REQ (25 exports). Two details that may matter if registered programs take the mesh path too: 1. The DPP steps of the OR scan have `bound_ctrl` set. `MatchHalfWaveScan` (951370324) only accepts it clear. For reductions whose identity is 0 (OR, IAdd, UMax) the result is the same either way, since the step then writes `op(0, own)` = `own` at the lanes without a source. Locally, accepting it for those three lets all four steps and the `v_permlanex16_b32` match. 2. After that, `EntryLaneWalk` rejects the keys: their mask comes from `v_cmp_lt_u32(lane id, s3)` rather than a ballot, and the vertex path sets `s3` to `64 | 64 << 8`. I can test a revision of this PR on this title if that helps.
adriadam10 commented 2026-10-10 05:58:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T05:58:04Z.

Review: CHANGES_REQUESTED


This PR carries the four commits of #1732, which is still open and has an unanswered design request from @oneandonlydean (decide up front which programs are deferred, as #1836 does, instead of compiling whatever isn't registered at the first draw). Whatever shape #1732 ends up with changes the routing here (decodeDraw, ShaderRegistry, PrepareRegistered), so this can't land first.

  • It also conflicts with main in core/libs/prx/libSceAgcDriver/tests/Submit.cpp.
  • Please rebase once #1732 has settled, so the diff only holds the last three commits (NGG vertex routing, its tests, the ES VGPR count fix), and keep "Depends on: #1732" in the body.
  • Wolverine (PPSA03671, per @tv7) has the same culling shape as a registered program; once the deferral rule is decided, say in the body whether registered programs are expected to follow in a follow-up.

I haven't built or run it yet for that reason; I'll review the NGG-specific part on the rebased branch.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5477875667 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1825#pullrequestreview-5477875667). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T05:58:04Z. **Review:** CHANGES_REQUESTED --- This PR carries the four commits of #1732, which is still open and has an unanswered design request from @oneandonlydean (decide up front which programs are deferred, as #1836 does, instead of compiling whatever isn't registered at the first draw). Whatever shape #1732 ends up with changes the routing here (`decodeDraw`, `ShaderRegistry`, `PrepareRegistered`), so this can't land first. - It also conflicts with `main` in `core/libs/prx/libSceAgcDriver/tests/Submit.cpp`. - Please rebase once #1732 has settled, so the diff only holds the last three commits (NGG vertex routing, its tests, the ES VGPR count fix), and keep "Depends on: #1732" in the body. - Wolverine (PPSA03671, per @tv7) has the same culling shape as a registered program; once the deferral rule is decided, say in the body whether registered programs are expected to follow in a follow-up. I haven't built or run it yet for that reason; I'll review the NGG-specific part on the rebased branch.
Mouhand-Kaddo commented 2026-10-10 10:15:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Mouhand-Kaddo on 2026-10-10T10:15:40Z.


Additional platform validation on standalone PR head 70afd4995b968b175f1e0dddc5906c04200a4c48:

Linux: passed — Arch Linux in WSL2 (kernel 6.6.87.2), GCC 16.2.1 20260810; CMake 4.3.1 / Ninja.

Release / BUILD_TESTING=ON: built the selected test targets; 9 CTest cases, 0 failures, 0 CTest skips.

Tests: agc_driver, agc_driver_graphics, agc_driver_prepared_shaders, agc_driver_prepared_unregistered_graphics, agc_driver_prepared_shaders_indirect, agc_driver_prepared_shaders_uncached, agc_driver_prepared_shaders_debug, agc_driver_prepared_shaders_debug_failure, agc_driver_prepared_shaders_deferred.

Reproduce after building the test targets: ctest --test-dir <build> --verbose --no-tests=error --timeout 30 -R "^agc_driver($|_graphics$|_prepared_unregistered_graphics|_prepared_shaders)".

Vulkan: Mesa lavapipe 26.2.4 software Vulkan; no native Linux GPU/retail-title validation.

Internal limitation: write-watched guest-heap mirror subcases returned early because WSL userfaultfd async write protection is unavailable. The other graphics assertions ran; zero CTest skips does not include this internal early return.

Integration limitation: a local merge against main 948a526c2 has source conflicts; these results validate the standalone PR head, not a resolved merge.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6096472473 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1825#issuecomment-6096472473). Originally posted by [Mouhand-Kaddo](https://github.com/Mouhand-Kaddo) on 2026-10-10T10:15:40Z. --- <!-- anyps5-platform-validation:70afd4995b968b175f1e0dddc5906c04200a4c48 --> Additional platform validation on standalone PR head `70afd4995b968b175f1e0dddc5906c04200a4c48`: **Linux: passed** — Arch Linux in WSL2 (kernel 6.6.87.2), GCC 16.2.1 20260810; CMake 4.3.1 / Ninja. Release / `BUILD_TESTING=ON`: built the selected test targets; 9 CTest cases, 0 failures, 0 CTest skips. Tests: `agc_driver`, `agc_driver_graphics`, `agc_driver_prepared_shaders`, `agc_driver_prepared_unregistered_graphics`, `agc_driver_prepared_shaders_indirect`, `agc_driver_prepared_shaders_uncached`, `agc_driver_prepared_shaders_debug`, `agc_driver_prepared_shaders_debug_failure`, `agc_driver_prepared_shaders_deferred`. Reproduce after building the test targets: `ctest --test-dir <build> --verbose --no-tests=error --timeout 30 -R "^agc_driver($|_graphics$|_prepared_unregistered_graphics|_prepared_shaders)"`. Vulkan: Mesa lavapipe 26.2.4 software Vulkan; no native Linux GPU/retail-title validation. Internal limitation: write-watched guest-heap mirror subcases returned early because WSL userfaultfd async write protection is unavailable. The other graphics assertions ran; zero CTest skips does not include this internal early return. Integration limitation: a local merge against main `948a526c2` has source conflicts; these results validate the standalone PR head, not a resolved merge.
Silverash-i8 commented 2026-10-10 16:36:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Silverash-i8 on 2026-10-10T16:36:34Z.


Native Windows platform run on NVIDIA and Intel, for the mesh side of this.

Windows 11 Home (26200), WinLibs GCC 15.2.0 r7, Release. RTX 5060 Laptop GPU (32.0.16.1742) and an Arrow Lake iGPU (Core Ultra 9 275HX, 32.0.101.8991). All seven commits (ade03f85 to 62a87e4e) cherry-picked onto main 57f96fd2 without conflicts. Mesh draws render nothing on Intel on main (#2815), so I added that fix (377829ec) to be able to exercise the mesh path there; on NVIDIA it changes nothing. Both GPUs ran with APS5_NO_PIPELINE_LTO=1 to keep the #2777 race out of it.

  • agc_driver_prepared_unregistered_graphics, agc_driver_graphics and agc_driver_mesh: 3/3 on both GPUs.
  • Full ctest (--parallel 6): 710/710 on the RTX 5060. On the iGPU the only failures are the five that also fail on main and have their own fixes (f64_fma_subnormals, fp16_overflow, vop1_float_unary, vopc_compare (#2114, #2822) and lds_beyond_device_limit (#2805)).

Possibly related: #2783 is the same v_readlane_b32 of lane 63 in a wave64 NGG culling vertex program, on NVIDIA in Taxi Chaos 2, but there the program is registered, which @tv7 notes above keeps it on the vertex path with this PR as it stands.

AI-assisted (Claude Code); the numbers above are from runs on this machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6099768390 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1825#issuecomment-6099768390). Originally posted by [Silverash-i8](https://github.com/Silverash-i8) on 2026-10-10T16:36:34Z. --- Native Windows platform run on NVIDIA and Intel, for the mesh side of this. Windows 11 Home (26200), WinLibs GCC 15.2.0 r7, Release. RTX 5060 Laptop GPU (32.0.16.1742) and an Arrow Lake iGPU (Core Ultra 9 275HX, 32.0.101.8991). All seven commits (ade03f85 to 62a87e4e) cherry-picked onto `main` 57f96fd2 without conflicts. Mesh draws render nothing on Intel on `main` (#2815), so I added that fix (377829ec) to be able to exercise the mesh path there; on NVIDIA it changes nothing. Both GPUs ran with `APS5_NO_PIPELINE_LTO=1` to keep the #2777 race out of it. - `agc_driver_prepared_unregistered_graphics`, `agc_driver_graphics` and `agc_driver_mesh`: 3/3 on both GPUs. - Full ctest (`--parallel 6`): 710/710 on the RTX 5060. On the iGPU the only failures are the five that also fail on `main` and have their own fixes (`f64_fma_subnormals`, `fp16_overflow`, `vop1_float_unary`, `vopc_compare` (#2114, #2822) and `lds_beyond_device_limit` (#2805)). Possibly related: #2783 is the same `v_readlane_b32` of lane 63 in a wave64 NGG culling vertex program, on NVIDIA in Taxi Chaos 2, but there the program is registered, which @tv7 notes above keeps it on the vertex path with this PR as it stands. AI-assisted (Claude Code); the numbers above are from runs on this machine.
Amoenus commented 2026-10-10 20:31:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-10T20:31:27Z.


Independent conditional startup validation of 62a87e4e

Validated the three NGG commits above #1732 at your pinned head 62a87e4e9a4df647708c97582fe77ea87de41663, with the local empty-registry raw-graphics policy required in the #1732 review. This is an unpublished diagnostic stack, not unmodified-main compatibility.

Title: PPSA99902, Sonic Unleashed Recompiled 01.003.000. After the local SW_64KB_D_X color change described in #2970, the vertex path refused ReadLane lane 63 for a wave64 program on the RTX 5080's subgroup32. Captured program: 308 words, 24 DS instructions, 4 s_barrier instructions, no AGC header; code SHA256 9c26bcbae52a22f13c79c6ae7375052017088abc857a09f44fba7e9e7881dfa7.

The program is now confirmed, not inferred just from the error text: temporary instrumentation on the main 43d2a7c4 prerequisite stack captured the exact same code as stage Mesh, with mesh/workgroup context, wave64 and host subgroup32. The instrumentation was then removed byte-for-byte and full libraries rebuilt. With the disk shader cache disabled, five CPU preparation attempts of the original Vertex/subgroup32 request reproduce the lane63 guard; five of the captured Mesh/subgroup32 request prepare. Subgroup64 controls prepare for both requests. These are preparation controls, not measurements of console culling or rendered geometry. Private shader/request files were not uploaded.

Behavioral tests: Windows 11 Enterprise 26200, RTX 5080, WinLibs r7 GCC 15.2.0, Release, BUILD_TESTING=ON. Full libraries built. On main 4a747c48, the proposal plus corrected raw policy passed 17 relevant groups five times; after the additional classification guard below,18 groups passed five times, no skips, maximum 4.18 s. The integrated color/NGG stack passed 22 groups five times. Conventions/test-registration checks passed; full suite and Linux were not tested.

Policy integration finding: the proposal's new front-program classification calls ProgramSnapshot before the registered-only draw lookup. In a registered-workgroup fixture, that can classify forbidden raw code as Mesh and fail at a missing user-config 0x25b rather than the registered-shader refusal. This does not prove a mixed raw draw was accepted. Locally I gate classification on an empty registry, reject reserved address bits, and use ReadRawShader there. The new registered-workgroup case then gets the registered-shader refusal; removing the empty-registry gate makes it fail again. Sources restored byte-for-byte, full libraries rebuilt, all18 groups passed five repetitions. Local adapter commit 2a9d5f8e; no new PR.

Controlled title runs: on the preserved main4a prerequisite profile, changing only libSceAgcDriver.prx removes the ReadLane stop in all five runs, then refuses DISPATCH_DIRECT at DWORD 656: dispatch modifiers 0x2047 are not implemented (42.905, 43.397, 40.552, 41.649, 40.869s). Restored-driver controls reproduce ReadLane. The first earlier exploratory NGG attempt timed out and initially hit a library lock during restoration; it is retained separately and excluded from those five repetitions. Subsequent baseline restoration/hash checks passed.

The next packet is covered by #2756, which is being independently validated. Similar #2783 concerns registered NGG work; this title uses unregistered workgroups, so I have not claimed its shader/reduction is identical. Default filtering still misses pathconf. No gameplay, presented-frame or console-semantics claim; original dump, 123 baseline library files and guest libc preserved/hash checked. No branch push or new PR. AI-assisted validation/local adapter: Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6101880920 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1825#issuecomment-6101880920). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-10T20:31:27Z. --- ### Independent conditional startup validation of 62a87e4e Validated the three NGG commits above #1732 at your pinned head `62a87e4e9a4df647708c97582fe77ea87de41663`, with the local empty-registry raw-graphics policy required in [the #1732 review](https://github.com/boykopovar/AnyPS5/pull/1732#issuecomment-6095516860). This is an unpublished diagnostic stack, not unmodified-main compatibility. **Title:** PPSA99902, Sonic Unleashed Recompiled 01.003.000. After the local SW_64KB_D_X color change described in #2970, the vertex path refused `ReadLane` lane 63 for a wave64 program on the RTX 5080's subgroup32. Captured program: 308 words, 24 DS instructions, 4 s_barrier instructions, no AGC header; code SHA256 `9c26bcbae52a22f13c79c6ae7375052017088abc857a09f44fba7e9e7881dfa7`. The program is now **confirmed**, not inferred just from the error text: temporary instrumentation on the main `43d2a7c4` prerequisite stack captured the exact same code as stage Mesh, with mesh/workgroup context, wave64 and host subgroup32. The instrumentation was then removed byte-for-byte and full libraries rebuilt. With the disk shader cache disabled, five CPU preparation attempts of the original Vertex/subgroup32 request reproduce the lane63 guard; five of the captured Mesh/subgroup32 request prepare. Subgroup64 controls prepare for both requests. These are preparation controls, not measurements of console culling or rendered geometry. Private shader/request files were not uploaded. **Behavioral tests:** Windows 11 Enterprise 26200, RTX 5080, WinLibs r7 GCC 15.2.0, Release, BUILD_TESTING=ON. Full libraries built. On main `4a747c48`, the proposal plus corrected raw policy passed 17 relevant groups five times; after the additional classification guard below,18 groups passed five times, no skips, maximum 4.18 s. The integrated color/NGG stack passed 22 groups five times. Conventions/test-registration checks passed; full suite and Linux were not tested. **Policy integration finding:** the proposal's new front-program classification calls ProgramSnapshot before the registered-only draw lookup. In a registered-workgroup fixture, that can classify forbidden raw code as Mesh and fail at a missing user-config 0x25b rather than the registered-shader refusal. This does not prove a mixed raw draw was accepted. Locally I gate classification on an empty registry, reject reserved address bits, and use ReadRawShader there. The new registered-workgroup case then gets the registered-shader refusal; removing the empty-registry gate makes it fail again. Sources restored byte-for-byte, full libraries rebuilt, all18 groups passed five repetitions. Local adapter commit `2a9d5f8e`; no new PR. **Controlled title runs:** on the preserved main4a prerequisite profile, changing only libSceAgcDriver.prx removes the ReadLane stop in all five runs, then refuses `DISPATCH_DIRECT at DWORD 656: dispatch modifiers 0x2047 are not implemented` (42.905, 43.397, 40.552, 41.649, 40.869s). Restored-driver controls reproduce ReadLane. The first earlier exploratory NGG attempt timed out and initially hit a library lock during restoration; it is retained separately and excluded from those five repetitions. Subsequent baseline restoration/hash checks passed. The next packet is covered by #2756, which is being independently validated. Similar #2783 concerns registered NGG work; this title uses unregistered workgroups, so I have not claimed its shader/reduction is identical. Default filtering still misses pathconf. No gameplay, presented-frame or console-semantics claim; original dump, 123 baseline library files and guest libc preserved/hash checked. No branch push or new PR. AI-assisted validation/local adapter: Codex.
TheAggie commented 2026-10-11 00:32:49 +00:00 (Migrated from github.com)

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


@adriadam10 #1732 now has the rule @oneandonlydean asked for: an unregistered graphics program is read raw only while the registry is empty, and RegisterShader throws after raw draws. I've rebased this PR onto that head (39fdc48b), so its three commits now sit on top of it (head e5507ddf).

The vertex-program check this PR adds, which decides whether an unregistered NGG vertex program needs a workgroup, goes through the same ProgramSnapshot. So it follows the same rule: with any shader registered, an unregistered vertex program still throws.

  • Tests: agc_driver_mesh, agc_driver_graphics, the agc_driver_prepared_* tests and agc_driver_prepared_unregistered_graphics pass on Windows 11 / RTX 5070 Ti.
  • Failure: agc_driver_ngg_vertex_wave_info times out in vkWaitForFences here, as it does on main.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6103790921 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1825#issuecomment-6103790921). Originally posted by [TheAggie](https://github.com/TheAggie) on 2026-10-11T00:32:49Z. --- @adriadam10 #1732 now has the rule @oneandonlydean asked for: an unregistered graphics program is read raw only while the registry is empty, and `RegisterShader` throws after raw draws. I've rebased this PR onto that head (39fdc48b), so its three commits now sit on top of it (head e5507ddf). The vertex-program check this PR adds, which decides whether an unregistered NGG vertex program needs a workgroup, goes through the same `ProgramSnapshot`. So it follows the same rule: with any shader registered, an unregistered vertex program still throws. - **Tests:** `agc_driver_mesh`, `agc_driver_graphics`, the `agc_driver_prepared_*` tests and `agc_driver_prepared_unregistered_graphics` pass on Windows 11 / RTX 5070 Ti. - **Failure:** `agc_driver_ngg_vertex_wave_info` times out in `vkWaitForFences` here, as it does on `main`. AI-assisted (Claude Code).
adriadam10 commented 2026-10-11 07:27:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T07:27:33Z.

Review: APPROVED


Rebased onto current main and added one commit: a TechnicalDebt line (Unknown function info) for the assumptions of the mesh routing (one output primitive per input, vertex budget from GE_MAX_OUTPUT_PER_SUBGROUP, GS/ES VGPR checks skipped), since they come from ACO output and not from hardware.

Checked: libSceAgcDriver build and ctest (agc_driver, agc_driver_graphics, agc_driver_prepared_graphics, agc_driver_prepared_unregistered_graphics) green; the new tests don't build/fail without the change. Platform runs by @Mouhand-Kaddo, @Silverash-i8 and @Amoenus cover Linux lavapipe, NVIDIA, Intel and a captured Sonic Unleashed program. Merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5482357994 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1825#pullrequestreview-5482357994). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T07:27:33Z. **Review:** APPROVED --- Rebased onto current `main` and added one commit: a TechnicalDebt line (Unknown function info) for the assumptions of the mesh routing (one output primitive per input, vertex budget from `GE_MAX_OUTPUT_PER_SUBGROUP`, GS/ES VGPR checks skipped), since they come from ACO output and not from hardware. Checked: libSceAgcDriver build and ctest (`agc_driver`, `agc_driver_graphics`, `agc_driver_prepared_graphics`, `agc_driver_prepared_unregistered_graphics`) green; the new tests don't build/fail without the change. Platform runs by @Mouhand-Kaddo, @Silverash-i8 and @Amoenus cover Linux lavapipe, NVIDIA, Intel and a captured Sonic Unleashed program. Merging once CI is green.
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!1825
No description provided.