feat(agc): capture graphics shader requests without address selectors #14794

Merged
JJenkx merged 3 commits from upstream-pr/14794 into main 2026-11-08 18:07:08 +00:00
JJenkx commented 2026-11-01 17:58:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-11-01T17:58:44Z.


What

Adds opt-in APS5_DUMP_GRAPHICS_SHADERS=1 to save graphics-stage requests during draw capture, using the existing shader_<address>.req serialization, address filter and once-per-process deduplication. Existing draw-entry reuse and asynchronous finishing are disabled only while this capture option is enabled, matching the targeted diagnostic options. Normal runs keep their existing behavior.

While profiling Overcooked AYCE (PPSA01528), the dominant fragment shader took roughly 11 ms per frame, but its guest code address changed between launches. A target address from the previous run therefore captured nothing. This option captures requests without needing a previous launch's addresses; APS5_DUMP_SHADERS can still narrow them if addresses are already known. It is a developer diagnostic, not a performance optimization.

Overlap: tools/pr_overlap.py --branch checked 1,960 open PRs. #12478 independently changes the same useDrawEntries condition: preserve both !bypassed and !dumpGraphics when combining them. No dependency is required. The tool could not integrate 47 older branches already conflicting with main; shared-file diffs were retained and screened for graphics-dump changes. Existing dump code in the heap/refactor stacks remains the address-targeted/failed-request path; none adds this all-graphics option. These combined stacks are not qualified here.

Tested

Main integration (2026-11-05): exact merge head e88fd6e41f265a30336bc3387de0905968690b83, parents previous public head 6b7d6d8b195b40c7f34e634cdc8778d81e13963f and main 6d173c1a19788ff69d43b3d0ca62833e312ef939. The branch push was a normal fast-forward, retaining all prior history. Stable topic patch ID and every authored added/deleted line are unchanged. Main supplies the already-merged #15375 wrapper-owner build-selection fix and #15855 sampled-depth allocation call correction; all 26 independent dependency clones match prescribed gitlinks.

Linux Release, GCC 16.2.1, bundled SPIRV-Tools: rebuilt libSceAgcDriver and the real agc_driver_draw_cache_reuse_tests fixture. Both the fixture and its CMake registrations are byte-identical to the previous public head. The generated CMake graph resolves avplayer_http_patched_modules to its own wrapper target, not a guest client. The 25 owner-selection and 33 target-resolution fixture tests pass, as do conventions and whitespace checks. No GPU fixture was executed for this main integration.

Shared main check still failing: the public-header audit on pinned main and this unchanged header tree reports five missing WKSecurityOrigin declarations. Separate repair #16010 restores them and passes its own full audit and targeted GCC/MinGW header checks. It is awaiting maintainer merge/rerun; its WebKit change is not included here. This report does not claim all required CI is green.

Source/patch continuity, provider pins, actual builds, CPU/helper logs, generated owner resolution and retained check failure, SHA-256 ac1a304b209e3c15d2564b490ca286f95fa19ddd151a840ae322ad232574ac30; downloaded bytes and all 33 manifest files verified. The archive also pins the existing shared-fix Windows receipts to their own sources. No new final-head Windows, GPU, title, performance or full-suite result is claimed.

Historical qualification (original source pins):

Test-precision follow-up 6b7d6d8b195b (production source unchanged from 4c8c5de482): the repeated-request guard now compares with the timestamp read back from the filesystem after setting the sentinel, and checks that it is at least 30 seconds old. This preserves rewrite detection on filesystems/APIs that round the requested timestamp.

  • An actual Windows/GCC15.2 UCRT r7 CPU filesystem probe reproduces the mismatch in 32/32 requested-vs-stored timestamp comparisons; stored readbacks are stable in 32/32. The corrected backdate/readback check succeeds32/32 and detects32/32 forced identical-content rewrites. This is a filesystem probe, not a Windows GPU fixture run.
  • Linux/RADV: the revised fixture rebuilt against the exact-parent headers and immutable 4c8c5de482 production SDK passes four invocations (default draw-cache, dump disabled, all graphics, filtered). 0 skipped invocations,0 VUIDs,actual validation insertion in two instances per invocation; executable/library hashes and loader bindings unchanged.
  • Both whole-branch and follow-up conventions checks pass, as does diff-check.
  • Independent Windows/NVIDIA report for parent 4c8c5de482 found the two enabled dump tests failing the timestamp comparison. Actual corrected-head Windows qualification now passes the default DrawCacheReuse group plus the three dump groups three times each (12/12, zero skips/VUIDs), with actual Khronos instance/device insertion on Windows 11/RX 6700 XT. This is not a NVIDIA retest, new paired-main baseline, title/speed or full-suite claim.

Timestamp probe, patch, exact build/run commands and Linux fixture logs, SHA-256 e6dd4467d0db634031b3e91f45f6807a8d7ad290f3b5fc1cffb4890f2f2421f6.

Linux, AMD Radeon RX 6650 XT, RADV Mesa 26.2.6, kernel 7.2.11, Khronos validation 1.4.363.

Same focused CTest selection on main f2d874c1fdcc and main plus this change, with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, and actual VK_LAYER_KHRONOS_validation insertion:

  • Main production plus the new fixtures: existing draw-cache and failed-capture tests plus disabled-capture case pass; the two enabled-capture cases fail because requests are absent.
  • Change: 5/5 pass, zero skipped tests, zero VUIDs. Both logs confirm instance/device layer insertion and no missing-layer warning.
  • Synthetic native draws verify target output, deserialization and recompilation of vertex/fragment requests, optional address filtering, disabled behavior, and no rewrite on repeated draws.
  • Full library build, SDK patched/unpatched-pair validation, conventions and git diff --check pass.

Download synthetic test evidence, SHA-256 f959e02f9478df76ff7a7ed586a99b5d8b6721d5ba4d25d76aafe552cb0180ae; downloaded again and verified all 11 inner files. No proprietary game requests/assets are published.

Native diagnostic: Overcooked AYCE PPSA01528 01.015.000 reached the first kitchen; 265s/310s compositor and X11 screenshots directly reviewed. Scheduled ordinary close, native/observer/harness exit 0 after 333.7s, 540 request files (8.53 MB), original inputs/saves and 799-file SDK bank unchanged, kernel import limit restored and no private game processes remain. The dominant fragment request passes both direct recompilation and prepared resource capture/materialization offline. Requests remain private. This run is not an FPS comparison because capture deliberately disables draw fast paths.

Independent reports on this head:

  • @TechLevelZero's NVIDIA CI (report), NVIDIA RTX 2000 Ada Generation, head 6b7d6d8b19 merged onto main 1d91f29: 2,681 passed · 3 failed (0 new, 3 also fail on main) · 45 skipped (ANYPS5_REQUIRE_VULKAN=1); validation: ✅ no new validation IDs vs main (986 tests run on the GPU).

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 under Silent stubs in their library's technical debt file
  • 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
  • Fixes: none
  • Unblocks: none; enables diagnosis, no title behavior fix claimed
  • GPUs tested: AMD Radeon RX 6650 XT, RADV Mesa 26.2.6, Linux 7.2.11
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5110028444 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14794). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-11-01T17:58:44Z. --- ### What Adds opt-in `APS5_DUMP_GRAPHICS_SHADERS=1` to save graphics-stage requests during draw capture, using the existing `shader_<address>.req` serialization, address filter and once-per-process deduplication. Existing draw-entry reuse and asynchronous finishing are disabled only while this capture option is enabled, matching the targeted diagnostic options. Normal runs keep their existing behavior. While profiling Overcooked AYCE (PPSA01528), the dominant fragment shader took roughly 11 ms per frame, but its guest code address changed between launches. A target address from the previous run therefore captured nothing. This option captures requests without needing a previous launch's addresses; `APS5_DUMP_SHADERS` can still narrow them if addresses are already known. It is a developer diagnostic, not a performance optimization. Overlap: `tools/pr_overlap.py --branch` checked 1,960 open PRs. #12478 independently changes the same `useDrawEntries` condition: preserve both `!bypassed` and `!dumpGraphics` when combining them. No dependency is required. The tool could not integrate 47 older branches already conflicting with main; shared-file diffs were retained and screened for graphics-dump changes. Existing dump code in the heap/refactor stacks remains the address-targeted/failed-request path; none adds this all-graphics option. These combined stacks are not qualified here. ### Tested **Main integration (2026-11-05):** exact merge head `e88fd6e41f265a30336bc3387de0905968690b83`, parents previous public head `6b7d6d8b195b40c7f34e634cdc8778d81e13963f` and main `6d173c1a19788ff69d43b3d0ca62833e312ef939`. The branch push was a normal fast-forward, retaining all prior history. Stable topic patch ID and every authored added/deleted line are unchanged. Main supplies the already-merged #15375 wrapper-owner build-selection fix and #15855 sampled-depth allocation call correction; all 26 independent dependency clones match prescribed gitlinks. Linux Release, GCC 16.2.1, bundled SPIRV-Tools: rebuilt `libSceAgcDriver` and the real `agc_driver_draw_cache_reuse_tests` fixture. Both the fixture and its CMake registrations are byte-identical to the previous public head. The generated CMake graph resolves `avplayer_http_patched_modules` to its own wrapper target, not a guest client. The 25 owner-selection and 33 target-resolution fixture tests pass, as do conventions and whitespace checks. No GPU fixture was executed for this main integration. **Shared main check still failing:** the public-header audit on pinned main and this unchanged header tree reports five missing `WKSecurityOrigin` declarations. [Separate repair #16010](https://github.com/boykopovar/AnyPS5/pull/16010) restores them and passes its own full audit and targeted GCC/MinGW header checks. It is awaiting maintainer merge/rerun; its WebKit change is not included here. This report does **not** claim all required CI is green. [Source/patch continuity, provider pins, actual builds, CPU/helper logs, generated owner resolution and retained check failure](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/pr14794-e88fd6e4-main6d173c-history-linux-20261105.tar.gz), SHA-256 `ac1a304b209e3c15d2564b490ca286f95fa19ddd151a840ae322ad232574ac30`; downloaded bytes and all 33 manifest files verified. The archive also pins the existing shared-fix Windows receipts to their own sources. No new final-head Windows, GPU, title, performance or full-suite result is claimed. **Historical qualification (original source pins):** Test-precision follow-up `6b7d6d8b195b` (production source unchanged from `4c8c5de482`): the repeated-request guard now compares with the timestamp read back from the filesystem after setting the sentinel, and checks that it is at least 30 seconds old. This preserves rewrite detection on filesystems/APIs that round the requested timestamp. - An actual Windows/GCC15.2 UCRT r7 CPU filesystem probe reproduces the mismatch in 32/32 requested-vs-stored timestamp comparisons; stored readbacks are stable in 32/32. The corrected backdate/readback check succeeds32/32 and detects32/32 forced identical-content rewrites. This is a filesystem probe, not a Windows GPU fixture run. - Linux/RADV: the revised fixture rebuilt against the exact-parent headers and immutable `4c8c5de482` production SDK passes four invocations (default draw-cache, dump disabled, all graphics, filtered). 0 skipped invocations,0 VUIDs,actual validation insertion in two instances per invocation; executable/library hashes and loader bindings unchanged. - Both whole-branch and follow-up conventions checks pass, as does diff-check. - [Independent Windows/NVIDIA report for parent `4c8c5de482`](https://github.com/boykopovar/AnyPS5/pull/14794#issuecomment-6585970697) found the two enabled dump tests failing the timestamp comparison. [Actual corrected-head Windows qualification](https://github.com/boykopovar/AnyPS5/pull/14794#issuecomment-6594138520) now passes the default DrawCacheReuse group plus the three dump groups three times each (12/12, zero skips/VUIDs), with actual Khronos instance/device insertion on Windows 11/RX 6700 XT. This is not a NVIDIA retest, new paired-main baseline, title/speed or full-suite claim. [Timestamp probe, patch, exact build/run commands and Linux fixture logs](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/pr14794-filesystem-timestamp-qualification-20261102.tar.gz), SHA-256 `e6dd4467d0db634031b3e91f45f6807a8d7ad290f3b5fc1cffb4890f2f2421f6`. Linux, AMD Radeon RX 6650 XT, RADV Mesa 26.2.6, kernel 7.2.11, Khronos validation 1.4.363. Same focused CTest selection on main `f2d874c1fdcc` and main plus this change, with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, and actual `VK_LAYER_KHRONOS_validation` insertion: - Main production plus the new fixtures: existing draw-cache and failed-capture tests plus disabled-capture case pass; the two enabled-capture cases fail because requests are absent. - Change: 5/5 pass, zero skipped tests, zero VUIDs. Both logs confirm instance/device layer insertion and no missing-layer warning. - Synthetic native draws verify target output, deserialization and recompilation of vertex/fragment requests, optional address filtering, disabled behavior, and no rewrite on repeated draws. - Full library build, SDK patched/unpatched-pair validation, conventions and `git diff --check` pass. [Download synthetic test evidence](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/graphics-shader-request-dumps-linux-20261101.tar.gz), SHA-256 `f959e02f9478df76ff7a7ed586a99b5d8b6721d5ba4d25d76aafe552cb0180ae`; downloaded again and verified all 11 inner files. No proprietary game requests/assets are published. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Native diagnostic: Overcooked AYCE PPSA01528 01.015.000 reached the first kitchen; 265s/310s compositor and X11 screenshots directly reviewed. Scheduled ordinary close, native/observer/harness exit 0 after 333.7s, 540 request files (8.53 MB), original inputs/saves and 799-file SDK bank unchanged, kernel import limit restored and no private game processes remain. The dominant fragment request passes both direct recompilation and prepared resource capture/materialization offline. Requests remain private. This run is **not** an FPS comparison because capture deliberately disables draw fast paths. **Independent reports** on this head: - @TechLevelZero's NVIDIA CI ([report](https://github.com/boykopovar/AnyPS5/pull/14794#issuecomment-6588781119)), NVIDIA RTX 2000 Ada Generation, head `6b7d6d8b19` merged onto `main` `1d91f29`: 2,681 passed · 3 failed (**0 new**, 3 also fail on main) · 45 skipped (`ANYPS5_REQUIRE_VULKAN=1`); validation: ✅ no new validation IDs vs main (986 tests run on the GPU). ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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] Fixes: none - [x] Unblocks: none; enables diagnosis, no title behavior fix claimed - [x] GPUs tested: AMD Radeon RX 6650 XT, RADV Mesa 26.2.6, Linux 7.2.11 - [x] AI-assisted: yes
MarcZX10 commented 2026-11-01 18:01:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T18:01:13Z.

Review: COMMENTED


Reviewed — no blocking findings

The opt-in capture path is connected to draw-stage materialization, preserves the existing address filter, and has focused registered tests; I found no source-level blocker.

What I ran

Reviewed head 4c8c5de4826433db6eac5f121cde2242de570acb against base f2d874c1fdccf781c0fa5d86619bb5dd8894b958; its merge preview against current main is clean. Environment: Linux x86-64, GCC 12.2.0, Python 3.11.2. I reviewed all changed hunks and test registration. I did not build or run the GPU tests; the runs in the PR description are author-reported.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14794
git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...4c8c5de4826433db6eac5f121cde2242de570acb
git merge-tree --write-tree refs/review/12478/overlap refs/review/14794/current

Results

Check Result Note
Diff and conventions passed No whitespace or convention findings.
Focused test review passed Three graphics-dump modes are registered in CTest.
Main merge preview passed Clean against current main.
Hosted CI not run Six checks are queued for this head.
GPU tests not run The author reports 5/5 passing with validation enabled; I did not reproduce them.
Combined preview with #12478 failed The two open PR heads conflict textually in Draw.cpp; their current main-based previews are clean.
Raw check output

git diff --check exited successfully and printed nothing. The precheck convention result was:

All conventions checks passed.

The precheck could not launch the workspace-only ABI and test-quality helpers from its isolated checkout (tools/pr_abi_audit.py and tools/pr_test_quality.py are absent from this PR tree). Its diff, convention and main merge-preview checks passed; it reported the helper launch errors separately.

The pairwise merge preview reported:

CONFLICT (content): Merge conflict in core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp

The PR’s CTest registrations set ANYPS5_NO_SHADER_CACHE=1; graphics and filtered modes also set APS5_DUMP_GRAPHICS_SHADERS=1. The separate disabled mode does not set that option.

Negative control

Not run locally: the new assertions require a compiled Vulkan test executable. The PR reports that both enabled-capture tests fail on main because requests are absent and pass on this head; I did not reproduce that control.

Findings

Blocking

None found in the reviewed changes.

Non-blocking

  • If #12478 merges first, its !bypassed guard conflicts with this PR’s !dumpGraphics guard on the same Draw.cpp condition. The PR description already identifies the overlap; when resolving it, retain both conditions. No update is needed while both PRs remain based on the same main.

Sources

Not verified

I did not compile or run the C++/Vulkan tests, verify the reported request archive independently, or run on other GPUs or a console. Hosted checks remain queued.

To get this to a good state

No change is requested for this head. Once the hosted checks finish, I can recheck them; if #12478 lands first, I will verify that the combined guard retains both conditions.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729470720 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14794#pullrequestreview-5729470720). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T18:01:13Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The opt-in capture path is connected to draw-stage materialization, preserves the existing address filter, and has focused registered tests; I found no source-level blocker. ## What I ran Reviewed head `4c8c5de4826433db6eac5f121cde2242de570acb` against base `f2d874c1fdccf781c0fa5d86619bb5dd8894b958`; its merge preview against current `main` is clean. Environment: Linux x86-64, GCC 12.2.0, Python 3.11.2. I reviewed all changed hunks and test registration. I did not build or run the GPU tests; the runs in the PR description are author-reported. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14794 git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...4c8c5de4826433db6eac5f121cde2242de570acb git merge-tree --write-tree refs/review/12478/overlap refs/review/14794/current ``` ## Results | Check | Result | Note | |---|---|---| | Diff and conventions | passed | No whitespace or convention findings. | | Focused test review | passed | Three graphics-dump modes are registered in CTest. | | Main merge preview | passed | Clean against current `main`. | | Hosted CI | not run | Six checks are queued for this head. | | GPU tests | not run | The author reports 5/5 passing with validation enabled; I did not reproduce them. | | Combined preview with #12478 | failed | The two open PR heads conflict textually in `Draw.cpp`; their current main-based previews are clean. | <details><summary>Raw check output</summary> `git diff --check` exited successfully and printed nothing. The precheck convention result was: ```text All conventions checks passed. ``` The precheck could not launch the workspace-only ABI and test-quality helpers from its isolated checkout (`tools/pr_abi_audit.py` and `tools/pr_test_quality.py` are absent from this PR tree). Its diff, convention and main merge-preview checks passed; it reported the helper launch errors separately. The pairwise merge preview reported: ```text CONFLICT (content): Merge conflict in core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp ``` The PR’s CTest registrations set `ANYPS5_NO_SHADER_CACHE=1`; graphics and filtered modes also set `APS5_DUMP_GRAPHICS_SHADERS=1`. The separate disabled mode does not set that option. </details> ## Negative control Not run locally: the new assertions require a compiled Vulkan test executable. The PR reports that both enabled-capture tests fail on `main` because requests are absent and pass on this head; I did not reproduce that control. ## Findings ### Blocking None found in the reviewed changes. ### Non-blocking - If #12478 merges first, its `!bypassed` guard conflicts with this PR’s `!dumpGraphics` guard on the same `Draw.cpp` condition. The PR description already identifies the overlap; when resolving it, retain both conditions. No update is needed while both PRs remain based on the same `main`. ## Sources - [`dumpGraphics` disables draw-entry reuse at this head](https://github.com/boykopovar/AnyPS5/blob/4c8c5de4826433db6eac5f121cde2242de570acb/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp#L390) - [Captured requests pass through the existing `dumpRequest` path](https://github.com/boykopovar/AnyPS5/blob/4c8c5de4826433db6eac5f121cde2242de570acb/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp#L127) - [Graphics, filtered and disabled CTest registrations](https://github.com/boykopovar/AnyPS5/blob/4c8c5de4826433db6eac5f121cde2242de570acb/core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_draw_cache_reuse_tests.cmake#L30) - [The other PR’s `!bypassed` guard](https://github.com/boykopovar/AnyPS5/blob/da441e01cc5dbc850799b21b26275b504762aec2/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp#L389) ## Not verified I did not compile or run the C++/Vulkan tests, verify the reported request archive independently, or run on other GPUs or a console. Hosted checks remain queued. ## To get this to a good state No change is requested for this head. Once the hosted checks finish, I can recheck them; if #12478 lands first, I will verify that the combined guard retains both conditions.
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!14794
No description provided.