fix(agc): copy GPU-side indirect draw records when the packet is processed #15327

Merged
XatiX merged 2 commits from upstream-pr/15327 into main 2026-11-14 11:42:39 +00:00
XatiX commented 2026-11-03 00:04:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XatiX on 2026-11-03T00:04:42Z.


What

A GPU-side indirect draw read its records in place from the host import when its batch ran, so a record the guest changed after the packet was processed reached the draw. The console's CP fetches the records when it reaches the packet. recordIndirectArguments now copies the records into a buffer when the packet is processed, applies the constant vertex and instance rules to the copy, and draws from it. Records stay in place, read when the batch runs as before, when:

  • the draw has a draw count;
  • a pending write of an unfinished batch overlaps them (Recorder::SnapshotWriteOverlaps);
  • an address-based lease of an unfinished batch covers them (PendingLeaseSerial), since those stores are not pending writes.

PPSA18653 resets the pool holding its records (a 0xEE fill) after submitting the command buffer and before the GPU runs it. The draw then read 0xEEEEEEEE (about 4e9 vertices times 4e9 instances), hung the GPU and ended in VK_ERROR_DEVICE_LOST 16-30 s after start. APS5_NO_HOST_IMPORT=1 and APS5_NO_GPU_INDIRECT_DRAW=1 avoided it. When the console's CP fetch happens relative to such a reset is not measured, which is recorded in technical debt.

agc_driver_indirect_argument_snapshot covers both sides:

  • a draw whose record is zeroed after processing, with its batch held by HoldNextSubmit, must draw the original record (fails on main);
  • a draw whose record an address-based store ahead of it writes must draw the written record (fails without the lease check).

Tested

  • Windows 11 Pro 26300, NVIDIA GeForce RTX 5080, driver 617.42.
  • ctest -V -R "indirect|label|readback|video_out_flip|pending_producer" with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1 on main and on this change, same machine:
    • change: 94/94 passed;
    • main: 93/94, only agc_driver_indirect_argument_snapshot fails;
    • neither log reports the layer as not found, and neither has a VUID- error. Logs attached.
  • New test, 6 runs each: 6/6 pass with the change, 6/6 fail on main, 3/3 fail without the lease check.
  • PPSA18653 (Age of Mythology: Retold v01.043): with the change the game presents frames and runs to the next stop at about 50 s, clock_gettime: unsupported clock_id 20 from Party.prx (not addressed here).
  • tools/check_conventions.py passes; tools/pr_overlap.py --branch finds no line overlaps.

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: PPSA18653 #15328 (GPU hang; the next stop is clock_gettime clock_id 20)
  • GPUs tested: NVIDIA GeForce RTX 5080, driver 617.42, Windows 11 Pro 26300
  • AI-assisted: yes

🤖 Generated with Claude Code

change.log
main.log

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5129449394 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15327). Originally posted by [XatiX](https://github.com/XatiX) on 2026-11-03T00:04:42Z. --- ### What A GPU-side indirect draw read its records in place from the host import when its batch ran, so a record the guest changed after the packet was processed reached the draw. The console's CP fetches the records when it reaches the packet. `recordIndirectArguments` now copies the records into a buffer when the packet is processed, applies the constant vertex and instance rules to the copy, and draws from it. Records stay in place, read when the batch runs as before, when: - the draw has a draw count; - a pending write of an unfinished batch overlaps them (`Recorder::SnapshotWriteOverlaps`); - an address-based lease of an unfinished batch covers them (`PendingLeaseSerial`), since those stores are not pending writes. PPSA18653 resets the pool holding its records (a 0xEE fill) after submitting the command buffer and before the GPU runs it. The draw then read 0xEEEEEEEE (about 4e9 vertices times 4e9 instances), hung the GPU and ended in `VK_ERROR_DEVICE_LOST` 16-30 s after start. `APS5_NO_HOST_IMPORT=1` and `APS5_NO_GPU_INDIRECT_DRAW=1` avoided it. When the console's CP fetch happens relative to such a reset is not measured, which is recorded in technical debt. `agc_driver_indirect_argument_snapshot` covers both sides: - a draw whose record is zeroed after processing, with its batch held by `HoldNextSubmit`, must draw the original record (fails on `main`); - a draw whose record an address-based store ahead of it writes must draw the written record (fails without the lease check). ### Tested - Windows 11 Pro 26300, NVIDIA GeForce RTX 5080, driver 617.42. - `ctest -V -R "indirect|label|readback|video_out_flip|pending_producer"` with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1` on `main` and on this change, same machine: - change: 94/94 passed; - `main`: 93/94, only `agc_driver_indirect_argument_snapshot` fails; - neither log reports the layer as not found, and neither has a `VUID-` error. Logs attached. - New test, 6 runs each: 6/6 pass with the change, 6/6 fail on `main`, 3/3 fail without the lease check. - PPSA18653 (Age of Mythology: Retold v01.043): with the change the game presents frames and runs to the next stop at about 50 s, `clock_gettime: unsupported clock_id 20` from Party.prx (not addressed here). - `tools/check_conventions.py` passes; `tools/pr_overlap.py --branch` finds no line overlaps. ### 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 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: PPSA18653 #15328 (GPU hang; the next stop is `clock_gettime` clock_id 20) - [x] GPUs tested: NVIDIA GeForce RTX 5080, driver 617.42, Windows 11 Pro 26300 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code) [change.log](https://github.com/user-attachments/files/34296759/change.log) [main.log](https://github.com/user-attachments/files/34296767/main.log)
MarcZX10 commented 2026-11-03 00:10:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-03T00:10:10Z.

Review: COMMENTED


Reviewed — no blocking findings

I reviewed all three changed files at head 7282713477b717cb9ea1197fc1d13ce88820bcac; I found no blocking source defect, but the required hosted checks are still queued, so this is a COMMENTED result rather than an approval.

What I ran

Reviewed head 7282713477b717cb9ea1197fc1d13ce88820bcac against PR base 5cb015caaaaf83f8ee431414ee6a457b5b307d49. The stack check reports a clean merge preview against that base. Environment: Debian 12, Linux x86_64, Python 3.11.2, Git 2.39.5, GCC 12.2.0; I did not compile with GCC.

git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...7282713477b717cb9ea1197fc1d13ce88820bcac
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15327 --output-dir /tmp/anyps5-pr-precheck/15327-session-20261103
python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head 7282713477b717cb9ea1197fc1d13ce88820bcac --json
git archive 7282713477b717cb9ea1197fc1d13ce88820bcac core/libs/prx/libSceAgcDriver/tests/execution/IndirectArgumentSnapshot.cpp core/libs/prx/libSceAgcDriver/CMakeLists.txt | tar -x -C /tmp/anyps5-pr15327-files
python3 tools/pr_test_quality.py --root /tmp/anyps5-pr15327-files --json core/libs/prx/libSceAgcDriver/tests/execution/IndirectArgumentSnapshot.cpp
gh pr checks 15327 --repo boykopovar/AnyPS5

The PR itself reports matching Windows/NVIDIA RTX 5080 tests on main and this change, including a negative control. These are author-reported results, not runs I performed. I could not retrieve the claimed attached raw logs from the PR body or its comments.

Results

Check Result Note
Diff and conventions passed Whitespace check and repository convention/template check passed.
Current-base merge preview passed Exact PR head previews cleanly on the exact base.
Test registration passed CMake glob discovers the new execution source and the default test path registers it; the heuristic warning is a false positive.
ABI audit not applicable No exports or ABI declarations changed.
Precheck helper coverage failed The isolated snapshot does not contain the workspace-only ABI and test-quality helper scripts; I ran the ABI audit directly and inspected test registration manually.
Hosted PR checks not run Six required checks are still queued.
Local build, CTest, GPU comparison not run No build was run; GPU evidence below is author-reported.
Precheck results and helper output
| Check | Status | Command / reason |
|---|---|---|
| build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` |
| diff_check | passed | `git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...7282713477b717cb9ea1197fc1d13ce88820bcac` |
| conventions_and_pr_template | passed | `/usr/bin/python3 tools/check_conventions.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head 7282713477b717cb9ea1197fc1d13ce88820bcac --title fix(agc): copy GPU-side indirect draw records when the packet is processed --body /tmp/anyps5-pr-precheck/15327-session-20261103/pr-body.md` |
| changed_export_abi_audit | failed | `/usr/bin/python3 tools/pr_abi_audit.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head 7282713477b717cb9ea1197fc1d13ce88820bcac --json` |
| python_syntax | not_applicable | `No changed Python implementation files.` |
| related_python_unit_tests | not_applicable | `No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.` |
| python_test_registration | not_applicable | `No changed test_*.py files.` |
| live_dependency_and_mergeability_check | passed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 15327 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/15327-session-20261103/stack` |
| build_dependent_cpp_tests | not_applicable | `Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.` |
| test_quality_heuristics | failed | `/usr/bin/python3 /tmp/anyps5-pr-precheck/15327-session-20261103/head-7282713477b7-a1de5fac/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/15327-session-20261103/head-7282713477b7-a1de5fac --json core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp core/libs/prx/libSceAgcDriver/tests/execution/IndirectArgumentSnapshot.cpp docs/dev/debt/libSceAgcDriver.md` |
| negative_controls | not_applicable | `No changed Python test module in tools/ can be run as a no-build base-source control.` |

The two failed helper rows above mean those workspace-only scripts are absent in the isolated PR snapshot, not that source checks failed. The direct ABI audit output was:

{
  "status": "not_applicable",
  "symbols": [],
  "findings": [],
  "limitations": [
    "No changed APS5_VABI declaration/definition or APS5_EXPORT alias was recognized in the PR diff."
  ]
}

The exact-head test-quality heuristic output was:

{
  "findings": [
    {
      "path": "core/libs/prx/libSceAgcDriver/tests/execution/IndirectArgumentSnapshot.cpp",
      "line": 1,
      "kind": "possible-unregistered-cpp-test",
      "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
    }
  ],
  "negative_control_candidates": [],
  "limits": [
    "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
    "A test that passes against base is not by itself proof that the PR test is inadequate.",
    "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
  ]
}

Negative control

Assertion Change to code under test Did the new test fail?
Reusing a GPU-side indirect record after packet processing must not change the draw result; a preceding address-based GPU write must still reach the draw. No mutation run by me. The author reports 6/6 failures on main and 3/3 failures when the lease check is removed. Author-reported only; I did not independently run it.

Findings

Blocking

None found in the three changed files.

Non-blocking

  • The PR reports passing matched GPU/Vulkan runs and says the logs are attached, but I could not retrieve raw logs from the PR body or comment endpoints. I therefore could not independently verify the VK_LAYER_KHRONOS_validation availability messages or compare the raw VUID output. If those files are not visible to reviewers in the PR, please add direct links.
  • The six hosted PR checks are still queued; I will recheck them before approval.

Sources

Not verified

No local build, CTest, Vulkan run, hardware test, PS5 console behavior, or negative control was run. The PR author reports the matched RTX 5080 tests and mutation results; their raw logs were not retrievable in the PR content I inspected. Hosted checks were queued at the final status check.

To get this to a good state

Let the six hosted checks complete and make the raw matched GPU logs accessible in the PR if they are not already visible. I will refresh the head and rerun the no-build checks before deciding whether approval is warranted.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5745240153 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15327#pullrequestreview-5745240153). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-03T00:10:10Z. **Review:** COMMENTED --- # Reviewed — no blocking findings I reviewed all three changed files at head `7282713477b717cb9ea1197fc1d13ce88820bcac`; I found no blocking source defect, but the required hosted checks are still queued, so this is a COMMENTED result rather than an approval. ## What I ran Reviewed head `7282713477b717cb9ea1197fc1d13ce88820bcac` against PR base `5cb015caaaaf83f8ee431414ee6a457b5b307d49`. The stack check reports a clean merge preview against that base. Environment: Debian 12, Linux x86_64, Python 3.11.2, Git 2.39.5, GCC 12.2.0; I did not compile with GCC. ```sh git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...7282713477b717cb9ea1197fc1d13ce88820bcac python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15327 --output-dir /tmp/anyps5-pr-precheck/15327-session-20261103 python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head 7282713477b717cb9ea1197fc1d13ce88820bcac --json git archive 7282713477b717cb9ea1197fc1d13ce88820bcac core/libs/prx/libSceAgcDriver/tests/execution/IndirectArgumentSnapshot.cpp core/libs/prx/libSceAgcDriver/CMakeLists.txt | tar -x -C /tmp/anyps5-pr15327-files python3 tools/pr_test_quality.py --root /tmp/anyps5-pr15327-files --json core/libs/prx/libSceAgcDriver/tests/execution/IndirectArgumentSnapshot.cpp gh pr checks 15327 --repo boykopovar/AnyPS5 ``` The PR itself reports matching Windows/NVIDIA RTX 5080 tests on `main` and this change, including a negative control. These are author-reported results, not runs I performed. I could not retrieve the claimed attached raw logs from the PR body or its comments. ## Results | Check | Result | Note | |---|---|---| | Diff and conventions | passed | Whitespace check and repository convention/template check passed. | | Current-base merge preview | passed | Exact PR head previews cleanly on the exact base. | | Test registration | passed | CMake glob discovers the new execution source and the default test path registers it; the heuristic warning is a false positive. | | ABI audit | not applicable | No exports or ABI declarations changed. | | Precheck helper coverage | failed | The isolated snapshot does not contain the workspace-only ABI and test-quality helper scripts; I ran the ABI audit directly and inspected test registration manually. | | Hosted PR checks | not run | Six required checks are still queued. | | Local build, CTest, GPU comparison | not run | No build was run; GPU evidence below is author-reported. | <details> <summary>Precheck results and helper output</summary> ```text | Check | Status | Command / reason | |---|---|---| | build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` | | diff_check | passed | `git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...7282713477b717cb9ea1197fc1d13ce88820bcac` | | conventions_and_pr_template | passed | `/usr/bin/python3 tools/check_conventions.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head 7282713477b717cb9ea1197fc1d13ce88820bcac --title fix(agc): copy GPU-side indirect draw records when the packet is processed --body /tmp/anyps5-pr-precheck/15327-session-20261103/pr-body.md` | | changed_export_abi_audit | failed | `/usr/bin/python3 tools/pr_abi_audit.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 --head 7282713477b717cb9ea1197fc1d13ce88820bcac --json` | | python_syntax | not_applicable | `No changed Python implementation files.` | | related_python_unit_tests | not_applicable | `No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.` | | python_test_registration | not_applicable | `No changed test_*.py files.` | | live_dependency_and_mergeability_check | passed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 15327 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/15327-session-20261103/stack` | | build_dependent_cpp_tests | not_applicable | `Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.` | | test_quality_heuristics | failed | `/usr/bin/python3 /tmp/anyps5-pr-precheck/15327-session-20261103/head-7282713477b7-a1de5fac/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/15327-session-20261103/head-7282713477b7-a1de5fac --json core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp core/libs/prx/libSceAgcDriver/tests/execution/IndirectArgumentSnapshot.cpp docs/dev/debt/libSceAgcDriver.md` | | negative_controls | not_applicable | `No changed Python test module in tools/ can be run as a no-build base-source control.` | ``` The two failed helper rows above mean those workspace-only scripts are absent in the isolated PR snapshot, not that source checks failed. The direct ABI audit output was: ```json { "status": "not_applicable", "symbols": [], "findings": [], "limitations": [ "No changed APS5_VABI declaration/definition or APS5_EXPORT alias was recognized in the PR diff." ] } ``` The exact-head test-quality heuristic output was: ```json { "findings": [ { "path": "core/libs/prx/libSceAgcDriver/tests/execution/IndirectArgumentSnapshot.cpp", "line": 1, "kind": "possible-unregistered-cpp-test", "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage." } ], "negative_control_candidates": [], "limits": [ "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.", "A test that passes against base is not by itself proof that the PR test is inadequate.", "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error." ] } ``` </details> ## Negative control | Assertion | Change to code under test | Did the new test fail? | |---|---|---| | Reusing a GPU-side indirect record after packet processing must not change the draw result; a preceding address-based GPU write must still reach the draw. | No mutation run by me. The author reports 6/6 failures on `main` and 3/3 failures when the lease check is removed. | Author-reported only; I did not independently run it. | ## Findings ### Blocking None found in the three changed files. ### Non-blocking - The PR reports passing matched GPU/Vulkan runs and says the logs are attached, but I could not retrieve raw logs from the PR body or comment endpoints. I therefore could not independently verify the `VK_LAYER_KHRONOS_validation` availability messages or compare the raw VUID output. If those files are not visible to reviewers in the PR, please add direct links. - The six hosted PR checks are still queued; I will recheck them before approval. ## Sources - [Indirect argument snapshot implementation at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/7282713477b717cb9ea1197fc1d13ce88820bcac/core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp#L2041-L2068) - [Regression tests at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/7282713477b717cb9ea1197fc1d13ce88820bcac/core/libs/prx/libSceAgcDriver/tests/execution/IndirectArgumentSnapshot.cpp) - [Execution-test discovery and registration at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/7282713477b717cb9ea1197fc1d13ce88820bcac/core/libs/prx/libSceAgcDriver/CMakeLists.txt#L545-L580) - [AGC test evidence requirements at the reviewed base](https://github.com/boykopovar/AnyPS5/blob/5cb015caaaaf83f8ee431414ee6a457b5b307d49/CONTRIBUTING.md#L72-L76) ## Not verified No local build, CTest, Vulkan run, hardware test, PS5 console behavior, or negative control was run. The PR author reports the matched RTX 5080 tests and mutation results; their raw logs were not retrievable in the PR content I inspected. Hosted checks were queued at the final status check. ## To get this to a good state Let the six hosted checks complete and make the raw matched GPU logs accessible in the PR if they are not already visible. I will refresh the head and rerun the no-build checks before deciding whether approval is warranted.
XairRrR commented 2026-11-03 07:33:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T07:33:54Z.

Review: APPROVED


Reviewed — approved

When the packet is processed, the draw now copies its GPU-side indirect records into a pooled host-visible buffer, applies the constant rules to the copy and draws from it. The new test passes on this tree. It fails on main and fails with the lease check removed. I found nothing blocking.

What I ran

PR head 7282713477b717cb9ea1197fc1d13ce88820bcac, merged with --no-ff into main d1ae628bc2f62459cce1e9872ba5632c938c71f2 (merged tree 637575784f7c6e71a55ddd3a29d3392805b27852). Machine: Debian 13 VM, 32 vCPU (2× Xeon Gold 6136), GCC 14.2.0, Release/Ninja, Vulkan on lavapipe (Mesa 26.1.6, LLVM 19), no GPU.

git diff --check d1ae628bc2f62459cce1e9872ba5632c938c71f2...7282713477b717cb9ea1197fc1d13ce88820bcac
python3 tools/check_conventions.py --base d1ae628bc2f62459cce1e9872ba5632c938c71f2
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "indirect_argument|gpu_indirect|indirect_draw"
# negative control 1: Draw.cpp from main
git show d1ae628bc2f62459cce1e9872ba5632c938c71f2:core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
ninja -C build -j32 -l32 agc_driver_indirect_argument_snapshot_tests
ctest --test-dir build --output-on-failure -R "^agc_driver_indirect_argument_snapshot$"   # 3 runs
# negative control 2: merged Draw.cpp without the PendingLeaseSerial condition (sed)
ninja -C build -j32 -l32 agc_driver_indirect_argument_snapshot_tests
ctest --test-dir build --output-on-failure -R "^agc_driver_indirect_argument_snapshot$"   # 3 runs
# restore
git show 637575784f7c6e71a55ddd3a29d3392805b27852:core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
ninja -C build -j32 -l32 agc_driver_indirect_argument_snapshot_tests libs
git status --porcelain
env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer ctest --test-dir build -V -R "^agc_driver_indirect_argument_snapshot$"

Results

Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Configure / build / libs (script) ok
Selected tests (script, 2133 run) 0 new failures, 0 timeouts; 7 known failures that also fail on main (denormal/division tests, one unwrap test)
Validation comparison with main (script, 768 tests) 0 tests with new VUID- lines; layer loaded in all compared tests
Focused indirect tests (6) 6/6 passed, slowest 2.29 s (agc_driver_indirect_arguments_pending_producer)
agc_driver_indirect_argument_snapshot passed in 0.38–0.83 s
Same test under the validation layer (not in main's baseline because it is new) passed, layer loaded, 0 VUID- lines, no "was not found" message
Worktree after the controls git status --porcelain empty
Focused run
1/6 Test #1382: agc_driver_pipelined_indirect_draw ..........................   Passed    0.29 sec
2/6 Test #1275: agc_driver_indirect_arguments_written_ahead .................   Passed    0.46 sec
3/6 Test #1197: agc_driver_gpu_indirect_arguments_misaligned_writer_ahead ...   Passed    0.28 sec
4/6 Test #1273: agc_driver_indirect_argument_snapshot .......................   Passed    0.83 sec
5/6 Test #1198: agc_driver_gpu_indirect_arguments_written_ahead .............   Passed    0.26 sec
6/6 Test #1274: agc_driver_indirect_arguments_pending_producer ..............   Passed    2.29 sec
100% tests passed, 0 tests failed out of 6

Negative control

  • Draw.cpp restored from main: agc_driver_indirect_argument_snapshot failed 3/3 with byte 0 of the indirect draw whose record the guest reused after the command processor passed it is 64, the record it was given draws 255.
  • Merged Draw.cpp without the PendingLeaseSerial condition: the test failed 3/3 with byte 0 of the indirect draw whose record an address-based store ahead of it wrote is 64, the record it wrote draws 255.
  • Restore: I put the merged file back, rebuilt and confirmed the test passes again. The worktree matches the merged tree.

These runs confirm the author's 6/6-on-main and 3/3-without-lease claims on lavapipe. They also cover the negative control that MarcZX10's review could not run.

Findings

Blocking

None.

Non-blocking

  • The debt entry describes the behaviour before the gap (docs/dev/debt/libSceAgcDriver.md:219). CONTRIBUTING asks that "an entry states the gap first". This entry opens with what the driver now does ("copies its records when the packet is processed"). The gap comes second: a record written after processing, by the CPU or by untracked GPU work ahead of the packet, is read before that write, and the console timing is not measured. The neighbouring SET_*_REG_INDIRECT entry has the same layout, so this is only wording. Suggested fix: lead with the difference from the console. The - after (libSceAgcDriver) is also unlike the other entries.
  • Unmentioned in-place fallback (core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp:2059). When GuestMemory::Accessible(source, bytes, false) fails, the draw silently uses the old in-place path. The description and the debt entry list only the draw-count, pending-write and lease cases. Consider naming this case in the debt entry, so its list of the cases that still read in place is complete.

Code notes from reading the change; none of these is a problem:

  • Same checks as the main path: at prepare time, decide() already sends records with pending storage-image results, labels or copied writes off the GPU path (Draw.cpp at head, L3148-L3161). The snapshot adds the published pending-write ranges (which include the open batch) and address-based leases. The other packet-time CPU reads also check AnyShadowedOverlaps. Unpublished unit-shadow contents would be just as stale in the import that main read in place, so leaving that check out is not a regression.
  • Buffer lifetime: on the recorded path, recorder->Keep keeps the snapshot alive. The non-recorded path submits and waits inside recordPreparedDraw, so the local shared_ptr outlives the GPU read, as meshArguments already does.
  • Buffer allocation: Buffer comes from the BufferPool, so there is no vkAllocateMemory per draw. RangeBytes() is (count-1)*stride + recordBytes, so the constant-rule writes at VertexDwordOffset/InstanceDwordOffset stay inside the copy.
  • Test registration: the new test is registered by the tests/execution/*.cpp glob through agc_add_default_test. That is correct, because it needs no extra environment variants.

Not verified

  • I did not test on a hardware GPU; everything here ran on lavapipe. The author's RTX 5080 run and the NVIDIA CI comment (RTX 2000 Ada, no new failures, no new validation IDs) are the only hardware evidence. I could not open the attached change.log/main.log.
  • I did not run PPSA18653. The claim that the game now presents frames until the clock_gettime clock_id 20 stop is the author's.
  • I did not measure on a console when the CP fetches the records relative to a CPU write after submission; the debt entry records this.
  • I ran only the focused indirect tests and the script's selected set, not the full suite.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5748579588 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15327#pullrequestreview-5748579588). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T07:33:54Z. **Review:** APPROVED --- # Reviewed — approved When the packet is processed, the draw now copies its GPU-side indirect records into a pooled host-visible buffer, applies the constant rules to the copy and draws from it. The new test passes on this tree. It fails on `main` and fails with the lease check removed. I found nothing blocking. ## What I ran PR head `7282713477b717cb9ea1197fc1d13ce88820bcac`, merged with `--no-ff` into `main` `d1ae628bc2f62459cce1e9872ba5632c938c71f2` (merged tree `637575784f7c6e71a55ddd3a29d3392805b27852`). Machine: Debian 13 VM, 32 vCPU (2× Xeon Gold 6136), GCC 14.2.0, Release/Ninja, Vulkan on lavapipe (Mesa 26.1.6, LLVM 19), no GPU. ```sh git diff --check d1ae628bc2f62459cce1e9872ba5632c938c71f2...7282713477b717cb9ea1197fc1d13ce88820bcac python3 tools/check_conventions.py --base d1ae628bc2f62459cce1e9872ba5632c938c71f2 ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "indirect_argument|gpu_indirect|indirect_draw" # negative control 1: Draw.cpp from main git show d1ae628bc2f62459cce1e9872ba5632c938c71f2:core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp ninja -C build -j32 -l32 agc_driver_indirect_argument_snapshot_tests ctest --test-dir build --output-on-failure -R "^agc_driver_indirect_argument_snapshot$" # 3 runs # negative control 2: merged Draw.cpp without the PendingLeaseSerial condition (sed) ninja -C build -j32 -l32 agc_driver_indirect_argument_snapshot_tests ctest --test-dir build --output-on-failure -R "^agc_driver_indirect_argument_snapshot$" # 3 runs # restore git show 637575784f7c6e71a55ddd3a29d3392805b27852:core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp > core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp ninja -C build -j32 -l32 agc_driver_indirect_argument_snapshot_tests libs git status --porcelain env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer ctest --test-dir build -V -R "^agc_driver_indirect_argument_snapshot$" ``` ## Results | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | All conventions checks passed | | Configure / build / `libs` (script) | ok | | Selected tests (script, 2133 run) | 0 new failures, 0 timeouts; 7 known failures that also fail on `main` (denormal/division tests, one unwrap test) | | Validation comparison with `main` (script, 768 tests) | 0 tests with new `VUID-` lines; layer loaded in all compared tests | | Focused indirect tests (6) | 6/6 passed, slowest 2.29 s (`agc_driver_indirect_arguments_pending_producer`) | | `agc_driver_indirect_argument_snapshot` | passed in 0.38–0.83 s | | Same test under the validation layer (not in `main`'s baseline because it is new) | passed, layer loaded, 0 `VUID-` lines, no "was not found" message | | Worktree after the controls | `git status --porcelain` empty | <details><summary>Focused run</summary> ``` 1/6 Test #1382: agc_driver_pipelined_indirect_draw .......................... Passed 0.29 sec 2/6 Test #1275: agc_driver_indirect_arguments_written_ahead ................. Passed 0.46 sec 3/6 Test #1197: agc_driver_gpu_indirect_arguments_misaligned_writer_ahead ... Passed 0.28 sec 4/6 Test #1273: agc_driver_indirect_argument_snapshot ....................... Passed 0.83 sec 5/6 Test #1198: agc_driver_gpu_indirect_arguments_written_ahead ............. Passed 0.26 sec 6/6 Test #1274: agc_driver_indirect_arguments_pending_producer .............. Passed 2.29 sec 100% tests passed, 0 tests failed out of 6 ``` </details> ## Negative control - **`Draw.cpp` restored from `main`:** `agc_driver_indirect_argument_snapshot` failed 3/3 with `byte 0 of the indirect draw whose record the guest reused after the command processor passed it is 64, the record it was given draws 255`. - **Merged `Draw.cpp` without the `PendingLeaseSerial` condition:** the test failed 3/3 with `byte 0 of the indirect draw whose record an address-based store ahead of it wrote is 64, the record it wrote draws 255`. - **Restore:** I put the merged file back, rebuilt and confirmed the test passes again. The worktree matches the merged tree. These runs confirm the author's 6/6-on-`main` and 3/3-without-lease claims on lavapipe. They also cover the negative control that MarcZX10's review could not run. ## Findings ### Blocking None. ### Non-blocking - **The debt entry describes the behaviour before the gap** (`docs/dev/debt/libSceAgcDriver.md:219`). CONTRIBUTING asks that "an entry states the gap first". This entry opens with what the driver now does ("copies its records when the packet is processed"). The gap comes second: a record written after processing, by the CPU or by untracked GPU work ahead of the packet, is read before that write, and the console timing is not measured. The neighbouring `SET_*_REG_INDIRECT` entry has the same layout, so this is only wording. Suggested fix: lead with the difference from the console. The ` - ` after `(libSceAgcDriver)` is also unlike the other entries. - **Unmentioned in-place fallback** (`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp:2059`). When `GuestMemory::Accessible(source, bytes, false)` fails, the draw silently uses the old in-place path. The description and the debt entry list only the draw-count, pending-write and lease cases. Consider naming this case in the debt entry, so its list of the cases that still read in place is complete. Code notes from reading the change; none of these is a problem: - **Same checks as the `main` path:** at prepare time, `decide()` already sends records with pending storage-image results, labels or copied writes off the GPU path ([Draw.cpp at head, L3148-L3161](https://github.com/boykopovar/AnyPS5/blob/7282713477b717cb9ea1197fc1d13ce88820bcac/core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp#L3148-L3161)). The snapshot adds the published pending-write ranges (which include the open batch) and address-based leases. The other packet-time CPU reads also check `AnyShadowedOverlaps`. Unpublished unit-shadow contents would be just as stale in the import that `main` read in place, so leaving that check out is not a regression. - **Buffer lifetime:** on the recorded path, `recorder->Keep` keeps the snapshot alive. The non-recorded path submits and waits inside `recordPreparedDraw`, so the local `shared_ptr` outlives the GPU read, as `meshArguments` already does. - **Buffer allocation:** `Buffer` comes from the `BufferPool`, so there is no `vkAllocateMemory` per draw. `RangeBytes()` is `(count-1)*stride + recordBytes`, so the constant-rule writes at `VertexDwordOffset`/`InstanceDwordOffset` stay inside the copy. - **Test registration:** the new test is registered by the `tests/execution/*.cpp` glob through `agc_add_default_test`. That is correct, because it needs no extra environment variants. ## Not verified - I did not test on a hardware GPU; everything here ran on lavapipe. The author's RTX 5080 run and the NVIDIA CI comment (RTX 2000 Ada, no new failures, no new validation IDs) are the only hardware evidence. I could not open the attached `change.log`/`main.log`. - I did not run PPSA18653. The claim that the game now presents frames until the `clock_gettime` clock_id 20 stop is the author's. - I did not measure on a console when the CP fetches the records relative to a CPU write after submission; the debt entry records this. - I ran only the focused indirect tests and the script's selected set, not the full suite. <!-- anyps5-bots job=2903 head=7282713477b717cb9ea1197fc1d13ce88820bcac -->
MarcZX10 commented 2026-11-03 07:58:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-03T07:58:38Z.

Review: APPROVED


Re-checked — same head, approved

Correction to my earlier review: the attached main.log and change.log are available, and they show the new snapshot test failing on the baseline and passing on the PR run.

What I ran

Re-checked open PR #15327 at head 7282713477b717cb9ea1197fc1d13ce88820bcac, against PR base 5cb015caaaaf83f8ee431414ee6a457b5b307d49; the source head has not changed since my review. I downloaded and inspected the paired logs linked from the PR description and ran the log comparison script. Review workstation: Debian Linux x86_64. The PR description reports the runs used Windows 11 Pro 26300 and an NVIDIA GeForce RTX 5080 with driver 617.42; the raw logs show the Windows test paths and RTX 5080 but do not themselves record the full commit SHA, OS version or driver version. No local build, CTest or GPU test was run.

curl -L --fail --silent --show-error 'https://github.com/user-attachments/files/34296759/change.log' -o /tmp/anyps5-15327-change.log
curl -L --fail --silent --show-error 'https://github.com/user-attachments/files/34296767/main.log' -o /tmp/anyps5-15327-main.log
python3 /root/.codex/skills/anyps5-pr-review/scripts/compare_vulkan_logs.py /tmp/anyps5-15327-main.log /tmp/anyps5-15327-change.log
gh pr checks 15327 --repo boykopovar/AnyPS5

Results

Check Result Note
Previously reviewed source diff passed No blocking source defect was found.
Paired GPU test logs passed Snapshot test passes on the PR run and fails on the baseline run.
Vulkan log comparison passed No layer-not-found marker or new/increased VUID IDs found.
Applicable hosted checks passed Windows and policy checks passed; specialized jobs were skipped.
Local build and GPU test not run The supplied logs are author-provided; I did not reproduce them.
Unedited log and comparison excerpts

change.log:

 9/94 Test #1283: agc_driver_indirect_argument_snapshot ..........................   Passed    0.47 sec
100% tests passed out of 94

main.log:

1283: AGC graphics: byte 0 of the indirect draw whose record the guest reused after the command processor passed it is 64, the record it was given draws 255
 9/94 Test #1283: agc_driver_indirect_argument_snapshot ..........................***Failed    0.43 sec
99% tests passed, 1 tests failed out of 94
The following tests FAILED:
	1283 - agc_driver_indirect_argument_snapshot (Failed)

compare_vulkan_logs.py:

Vulkan validation log comparison (derived from supplied logs; does not verify how they were produced).

- Layer-not-found error marker present in baseline: no.
- Layer-not-found error marker present in candidate: no.
- VUID IDs newly present or more frequent in candidate: 0.

| VUID | Baseline occurrences | Candidate occurrences | Result |
|---|---:|---:|---|
| (none found) | 0 | 0 | no VUID IDs in either log |

Outcome: **no new or increased VUID IDs detected** in these logs.

The comparison script checks log contents; it cannot establish from the files alone whether VK_INSTANCE_LAYERS was active. The PR description reports that the required validation-layer environment was used.

Negative control

Assertion Change to code under test Did the test fail?
The indirect draw must consume the record captured when the packet was processed, even if the guest reuses the memory afterward. The paired baseline log is from main; the PR log uses the snapshot implementation. Yes on the baseline (the assertion reports byte 0 as 64 instead of 255); passed on the PR run.

Findings

Blocking

None found in the previously reviewed source diff. The paired logs support the reported regression fix.

Non-blocking

The raw logs do not include the full tested commit SHA or the VK_INSTANCE_LAYERS environment value; those details are stated in the PR description rather than recorded in the files.

Sources

Not verified

I did not reproduce the Windows/NVIDIA build, CTest run, validation-layer setup or console behavior. The supplied logs and machine details are author-reported evidence; the log comparison only analyzes their contents.

To get this to a good state

No code change is needed for this head. If the head changes, I will review the new diff and rerun the applicable checks.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5748797458 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15327#pullrequestreview-5748797458). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-03T07:58:38Z. **Review:** APPROVED --- # Re-checked — same head, approved Correction to my earlier review: the attached `main.log` and `change.log` are available, and they show the new snapshot test failing on the baseline and passing on the PR run. ## What I ran Re-checked open PR #15327 at head `7282713477b717cb9ea1197fc1d13ce88820bcac`, against PR base `5cb015caaaaf83f8ee431414ee6a457b5b307d49`; the source head has not changed since my review. I downloaded and inspected the paired logs linked from the PR description and ran the log comparison script. Review workstation: Debian Linux x86_64. The PR description reports the runs used Windows 11 Pro 26300 and an NVIDIA GeForce RTX 5080 with driver 617.42; the raw logs show the Windows test paths and RTX 5080 but do not themselves record the full commit SHA, OS version or driver version. No local build, CTest or GPU test was run. ```sh curl -L --fail --silent --show-error 'https://github.com/user-attachments/files/34296759/change.log' -o /tmp/anyps5-15327-change.log curl -L --fail --silent --show-error 'https://github.com/user-attachments/files/34296767/main.log' -o /tmp/anyps5-15327-main.log python3 /root/.codex/skills/anyps5-pr-review/scripts/compare_vulkan_logs.py /tmp/anyps5-15327-main.log /tmp/anyps5-15327-change.log gh pr checks 15327 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | Note | |---|---|---| | Previously reviewed source diff | passed | No blocking source defect was found. | | Paired GPU test logs | passed | Snapshot test passes on the PR run and fails on the baseline run. | | Vulkan log comparison | passed | No layer-not-found marker or new/increased VUID IDs found. | | Applicable hosted checks | passed | Windows and policy checks passed; specialized jobs were skipped. | | Local build and GPU test | not run | The supplied logs are author-provided; I did not reproduce them. | <details> <summary>Unedited log and comparison excerpts</summary> `change.log`: ```text 9/94 Test #1283: agc_driver_indirect_argument_snapshot .......................... Passed 0.47 sec 100% tests passed out of 94 ``` `main.log`: ```text 1283: AGC graphics: byte 0 of the indirect draw whose record the guest reused after the command processor passed it is 64, the record it was given draws 255 9/94 Test #1283: agc_driver_indirect_argument_snapshot ..........................***Failed 0.43 sec 99% tests passed, 1 tests failed out of 94 The following tests FAILED: 1283 - agc_driver_indirect_argument_snapshot (Failed) ``` `compare_vulkan_logs.py`: ```text Vulkan validation log comparison (derived from supplied logs; does not verify how they were produced). - Layer-not-found error marker present in baseline: no. - Layer-not-found error marker present in candidate: no. - VUID IDs newly present or more frequent in candidate: 0. | VUID | Baseline occurrences | Candidate occurrences | Result | |---|---:|---:|---| | (none found) | 0 | 0 | no VUID IDs in either log | Outcome: **no new or increased VUID IDs detected** in these logs. ``` The comparison script checks log contents; it cannot establish from the files alone whether `VK_INSTANCE_LAYERS` was active. The PR description reports that the required validation-layer environment was used. </details> ## Negative control | Assertion | Change to code under test | Did the test fail? | |---|---|---| | The indirect draw must consume the record captured when the packet was processed, even if the guest reuses the memory afterward. | The paired baseline log is from `main`; the PR log uses the snapshot implementation. | Yes on the baseline (the assertion reports byte 0 as 64 instead of 255); passed on the PR run. | ## Findings ### Blocking None found in the previously reviewed source diff. The paired logs support the reported regression fix. ### Non-blocking The raw logs do not include the full tested commit SHA or the `VK_INSTANCE_LAYERS` environment value; those details are stated in the PR description rather than recorded in the files. ## Sources - [Indirect-record snapshot implementation at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/7282713477b717cb9ea1197fc1d13ce88820bcac/core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp#L2043-L2084) - [Snapshot and guest-memory reuse test at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/7282713477b717cb9ea1197fc1d13ce88820bcac/core/libs/prx/libSceAgcDriver/tests/execution/IndirectArgumentSnapshot.cpp#L203-L224) - [PR-attached `main.log`](https://github.com/user-attachments/files/34296767/main.log) and [PR-attached `change.log`](https://github.com/user-attachments/files/34296759/change.log) ## Not verified I did not reproduce the Windows/NVIDIA build, CTest run, validation-layer setup or console behavior. The supplied logs and machine details are author-reported evidence; the log comparison only analyzes their contents. ## To get this to a good state No code change is needed for this head. If the head changes, I will review the new diff and rerun the applicable checks.
XairRrR commented 2026-11-03 19:54:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T19:54:58Z.

Review: APPROVED


Re-checked — approved

The only new commit, e4f570a7cf, changes docs alone. The debt entry now starts with the difference from the console, and it lists records the CPU cannot read among the cases still read in place. That resolves both non-blocking points from my last review. Draw.cpp and the test are the same as in the commit I approved.

What changed since my last review

  • New commit e4f570a7cf84caf901b99a121d6c68a338eb3bc5 docs(agc): lead the indirect record debt entry with the console difference. It changes one line in docs/dev/debt/libSceAgcDriver.md.
  • 7282713477 is unchanged (the range-diff shows it as =), so Draw.cpp and IndirectArgumentSnapshot.cpp are identical to what I reviewed.
  • The author replied that the tested commit and the VK_INSTANCE_LAYERS value appear only in the description, not in the attached logs, and that later paired runs will record both in the log files.

What I ran

PR head e4f570a7cf84caf901b99a121d6c68a338eb3bc5, merged with --no-ff into main 086c0686c8adff3ee648fdbe34e0b0b647e1d511 (merged tree 8fe940addd3a787d017c8f108b0aef3ad756b86a). Machine: Debian 13 VM, 32 vCPU (2× Xeon Gold 6136), GCC 14.2.0, Release/Ninja, Vulkan on lavapipe (Mesa 26.1.6, LLVM 19), no GPU.

git diff --check 086c0686c8adff3ee648fdbe34e0b0b647e1d511...e4f570a7cf84caf901b99a121d6c68a338eb3bc5
python3 tools/check_conventions.py --base 086c0686c8adff3ee648fdbe34e0b0b647e1d511
git show e4f570a7cf84caf901b99a121d6c68a338eb3bc5
env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer ctest --test-dir build -V -R "^agc_driver_indirect_argument_snapshot$"
git status --porcelain
Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Configure / build / libs (script) ok
Selected tests (script, 2173 run) 0 new failures, 0 timeouts. The 7 known failures (denormal and division tests, one unwrap test) also fail on main
Validation comparison (script, 784 tests) Layer loaded in 783 tests and missing in none. Only agc_driver_image_gather_volume reports VUIDs, marked "test not run on main"
agc_driver_indirect_argument_snapshot under the validation layer Passed in 0.67 s. The layer was inserted twice, there are 0 VUID- lines and no "was not found" message
Worktree git status --porcelain is empty

About agc_driver_image_gather_volume: the script's baseline (1e658521a0) is older than main. Since then, main has changed that test and the 3D-gather recompiler in several commits (for example e92ec413c9 and 27d9dc2e4e). This PR touches neither samplers nor shaders, so I do not attribute those VkSamplerCreateInfo VUIDs to it.

Negative control: the test and the production code are unchanged since my last review. There, Draw.cpp restored from main failed the test 3/3, and the merged Draw.cpp without the PendingLeaseSerial condition also failed it 3/3. I did not run either control again.

Previous findings

  • The debt entry describes the behaviour before the gap. Resolved. The entry now opens with "a record written after the packet is processed … is not seen by the draw; the console's CP fetches the records when it reaches the packet", and only then describes the copy. The - separator after (libSceAgcDriver) is still there. That is cosmetic and I am not pursuing it.
  • The in-place fallback is not mentioned. Resolved. The entry now lists "records the CPU cannot read (GuestMemory::Accessible fails)" among the cases read in place, which matches the condition at core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp:2059.

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • I did not test on a hardware GPU; everything here ran on lavapipe. The RTX 5080, RTX 2000 Ada, RTX 2080 Ti, RX 9060 XT, RX 9070 XT and RX 6300 results come from comments on this PR.
  • I did not run PPSA18653. I did not measure on a console when the CP fetches the records; the debt entry records that this is not measured.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5758622433 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15327#pullrequestreview-5758622433). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T19:54:58Z. **Review:** APPROVED --- # Re-checked — approved The only new commit, `e4f570a7cf`, changes docs alone. The debt entry now starts with the difference from the console, and it lists records the CPU cannot read among the cases still read in place. That resolves both non-blocking points from my last review. `Draw.cpp` and the test are the same as in the commit I approved. ## What changed since my last review - New commit `e4f570a7cf84caf901b99a121d6c68a338eb3bc5` `docs(agc): lead the indirect record debt entry with the console difference`. It changes one line in `docs/dev/debt/libSceAgcDriver.md`. - `7282713477` is unchanged (the range-diff shows it as `=`), so `Draw.cpp` and `IndirectArgumentSnapshot.cpp` are identical to what I reviewed. - The author replied that the tested commit and the `VK_INSTANCE_LAYERS` value appear only in the description, not in the attached logs, and that later paired runs will record both in the log files. ## What I ran PR head `e4f570a7cf84caf901b99a121d6c68a338eb3bc5`, merged with `--no-ff` into `main` `086c0686c8adff3ee648fdbe34e0b0b647e1d511` (merged tree `8fe940addd3a787d017c8f108b0aef3ad756b86a`). Machine: Debian 13 VM, 32 vCPU (2× Xeon Gold 6136), GCC 14.2.0, Release/Ninja, Vulkan on lavapipe (Mesa 26.1.6, LLVM 19), no GPU. ```sh git diff --check 086c0686c8adff3ee648fdbe34e0b0b647e1d511...e4f570a7cf84caf901b99a121d6c68a338eb3bc5 python3 tools/check_conventions.py --base 086c0686c8adff3ee648fdbe34e0b0b647e1d511 git show e4f570a7cf84caf901b99a121d6c68a338eb3bc5 env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer ctest --test-dir build -V -R "^agc_driver_indirect_argument_snapshot$" git status --porcelain ``` | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | All conventions checks passed | | Configure / build / `libs` (script) | ok | | Selected tests (script, 2173 run) | 0 new failures, 0 timeouts. The 7 known failures (denormal and division tests, one unwrap test) also fail on `main` | | Validation comparison (script, 784 tests) | Layer loaded in 783 tests and missing in none. Only `agc_driver_image_gather_volume` reports VUIDs, marked "test not run on main" | | `agc_driver_indirect_argument_snapshot` under the validation layer | Passed in 0.67 s. The layer was inserted twice, there are 0 `VUID-` lines and no "was not found" message | | Worktree | `git status --porcelain` is empty | About `agc_driver_image_gather_volume`: the script's baseline (`1e658521a0`) is older than `main`. Since then, `main` has changed that test and the 3D-gather recompiler in several commits (for example `e92ec413c9` and `27d9dc2e4e`). This PR touches neither samplers nor shaders, so I do not attribute those `VkSamplerCreateInfo` VUIDs to it. Negative control: the test and the production code are unchanged since my last review. There, `Draw.cpp` restored from `main` failed the test 3/3, and the merged `Draw.cpp` without the `PendingLeaseSerial` condition also failed it 3/3. I did not run either control again. ## Previous findings - **The debt entry describes the behaviour before the gap.** Resolved. The entry now opens with "a record written after the packet is processed … is not seen by the draw; the console's CP fetches the records when it reaches the packet", and only then describes the copy. The ` - ` separator after `(libSceAgcDriver)` is still there. That is cosmetic and I am not pursuing it. - **The in-place fallback is not mentioned.** Resolved. The entry now lists "records the CPU cannot read (`GuestMemory::Accessible` fails)" among the cases read in place, which matches the condition at `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp:2059`. ## New findings ### Blocking None. ### Non-blocking None. ## Not verified - I did not test on a hardware GPU; everything here ran on lavapipe. The RTX 5080, RTX 2000 Ada, RTX 2080 Ti, RX 9060 XT, RX 9070 XT and RX 6300 results come from comments on this PR. - I did not run PPSA18653. I did not measure on a console when the CP fetches the records; the debt entry records that this is not measured. <!-- anyps5-bots job=3564 head=e4f570a7cf84caf901b99a121d6c68a338eb3bc5 -->
gabichuuuuu commented 2026-11-08 15:28:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-08T15:28:30Z.

Review: COMMENTED


Ran e4f570a7cf merged on main 302864d48c on Windows 11 x64 (WinLibs GCC 15.2), on an NVIDIA laptop GPU (Turing, driver 621) and an Intel iGPU (driver 101.70xx), with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (Khronos validation layer 1.4.368), ctest -R '^agc_driver_indirect_argument' -V:

main main + only this PR's IndirectArgumentSnapshot.cpp change, 2 runs each
NVIDIA 2/2 2/3 3/3
Intel 2/2 2/3 3/3
  • Without the driver change, the new agc_driver_indirect_argument_snapshot fails on both GPUs with "byte 0 of the indirect draw whose record the guest reused after the command processor passed it is 64, the record it was given draws 255". With the change, it passes every time.
  • The two existing indirect_argument tests pass in all three builds.
  • The layer was inserted in every test. No log has was not found but was requested by env var VK_INSTANCE_LAYERS, and no log on either side has a VUID-. To be sure validation messages reach these logs, the same layer with best practices on printed 28 BestPractices- warnings into an agc_driver_recorder log on each GPU.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5818452326 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15327#pullrequestreview-5818452326). Originally posted by [gabichuuuuu](https://github.com/gabichuuuuu) on 2026-11-08T15:28:30Z. **Review:** COMMENTED --- Ran `e4f570a7cf` merged on `main` 302864d48c on Windows 11 x64 (WinLibs GCC 15.2), on an NVIDIA laptop GPU (Turing, driver 621) and an Intel iGPU (driver 101.70xx), with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` (Khronos validation layer 1.4.368), `ctest -R '^agc_driver_indirect_argument' -V`: | | `main` | `main` + only this PR's `IndirectArgumentSnapshot.cpp` | change, 2 runs each | |---|---|---|---| | NVIDIA | 2/2 | 2/3 | 3/3 | | Intel | 2/2 | 2/3 | 3/3 | - Without the driver change, the new `agc_driver_indirect_argument_snapshot` fails on both GPUs with "byte 0 of the indirect draw whose record the guest reused after the command processor passed it is 64, the record it was given draws 255". With the change, it passes every time. - The two existing `indirect_argument` tests pass in all three builds. - The layer was inserted in every test. No log has `was not found but was requested by env var VK_INSTANCE_LAYERS`, and no log on either side has a `VUID-`. To be sure validation messages reach these logs, the same layer with best practices on printed 28 `BestPractices-` warnings into an `agc_driver_recorder` log on each GPU. AI-assisted: yes.
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!15327
No description provided.