Repository navigation
fix(agc): release a parked REWIND in frame replay with its whole memory group, and write REWIND control words last - #12318
Conversation
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
The focused replay evidence is thorough, including the same-machine main/change validation-layer runs and a negative control. I did find one remaining integration item in the PR's own overlap disclosure: #11435 and #11436 are both still open, and this change overlaps their argument-mode handling in |
MarcZX10
left a comment
There was a problem hiding this comment.
The focused replay evidence is thorough, including the same-machine main/change validation-layer runs and a negative control. I did find one remaining integration item in the PR's own overlap disclosure: #11435 and #11436 are both still open, and this change overlaps their argument-mode handling in tests/FrameReplay.cpp; the description says whichever merges second must add its mode to the other. CONTRIBUTING asks authors to agree on overlap order and record that order with Depends on where needed. Could you coordinate with Sam-mon7 and update the checklist to show the agreed order (or explain why no dependency is needed)? I have not independently run the GPU tests reported in the description.
|
Checked the overlap report by hand:
AI-assisted: yes (Claude Code) |
|
Thanks for checking the overlap scope. That confirms the overlapping change is limited to the test-mode argument check, but I still cannot see an agreed merge order with Sam-mon7 in the thread or a dependency in this PR's checklist. CONTRIBUTING asks authors to agree which overlapping PR goes first and record the order. Please add the coordination/selected order when you have it; I will keep the review request open until then. |
|
Windows + NVIDIA result for head This PR's own tests: the 12 Host: Windows 11 26300, Intel i7-12700K, NVIDIA GeForce RTX 2070 SUPER (vendor 0x10de, device 0x1e84; Vulkan loader 1.4.357 from the NVIDIA driver 621.01), Khronos Validation Layers nightly 1.4.366 through Same focused run on The tree also carried the open PRs #12322, #12306, #12302, #12200, #12191, all merged cleanly, so the run is a joint one. Not run on a PS5. AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
adriadam10
left a comment
There was a problem hiding this comment.
Checked the diff: the parked-REWIND release through restoreGroup (FrameReplay.cpp:445, :476, :557) and the held valid control words look correct, the lock is already held by releaseAwaited, and agc_driver_frame_replay_rewind fails with main's tool. maskym's Windows/NVIDIA run also passes.
- The only open point is the overlap order with #11435/#11436 requested by @MarcZX10 (all three add a mode to the check in
tests/FrameReplay.cppmain()). Please record the agreed order inDepends ononce Sam-mon7 confirms, or rebase onto them and list them there.
Once that is recorded this is ready to merge.
|
@MarcZX10 @adriadam10 Sam-mon7 agreed to the order on #11435 (comment): #11435, then #11436, then this PR. The checklist now says AI-assisted: yes (Claude Code) |
|
@Tehshortbus #12567 builds on this rather than replacing it. Its breaker releases a parked REWIND through your AI-assisted: yes (Claude Code) |
…e title A memory delta was read only once every accepted submission completed, so a capture stopped after 10 s whenever a queue waited on a REWIND control word or a label a later call stores, as in the two-queue reproducer on boykopovar#11157 and the Ghost of Yotei capture on boykopovar#11197. The driver gains a settled hold: AgcDriverHoldSettled succeeds once every queue has finished or is parked on a REWIND or WAIT_REG_MEM value the title has not stored, with no queued draw, unrecorded label or pending label write, and keeps submissions and parked queues where they are until AgcDriverReleaseSettled. The recorder reads each delta under that hold through the coherent path. The replay restores each delta under the same hold. Its breaker, built on boykopovar#12318, releases a parked REWIND by applying the first later memory group that sets its control word, only under a settled probe, one wait per pass, and no longer writes a value from a later delta for any other wait, which applied a later CPU store early. Pacing counts a running queue as progress and gives up after --pace-timeout-ms only once no queue runs, or after the busy timeout. The drain also ends after 10 s without a completion once no queue runs, and the busy timeout, ten minutes, is shared by pacing, the settled hold and the drain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MarcZX10
left a comment
There was a problem hiding this comment.
Re-checked — changes requested for current-main integration
The overlap sequence is now documented with the relevant authors, but this branch is still based on an older main and needs the required current-base check before approval.
What I ran
- Reviewed head
8e6bcba04d2247a75bb546c6c7e1a7410f133ca3; currentmainis3a2b91981651569163768854a1fcdc7193b6667b. git merge-tree --write-tree upstream/main upstream/pr-12318— clean preview, treeae3ed04466737f3d256c07745fe8803c972e8a7d.python3 tools/check_conventions.py --base upstream/main --head upstream/pr-12318— passed.git diff --check upstream/main...upstream/pr-12318— passed.- I did not rerun the GPU replay tests. The PR reports focused Vulkan-validation runs on its earlier tested base.
Results
| Check | Result |
|---|---|
| Current-main merge preview | Clean |
| Convention and whitespace checks | Passed |
Focused Vulkan replay tests on current main |
Not verified by me |
| PR branch base | 284a487cd978824f442955918ec0f99ab9c556d3, behind current main |
Findings
The previously requested overlap order is now clear: #11435, then #11436, then this PR. The linked confirmation with Sam-mon7 and the Depends on: #11436 entry document that sequence; #12567 also now records its dependency on this PR. I consider that blocker resolved.
The remaining integration item is the base. CONTRIBUTING.md says to keep the branch up to date with main. Since the tested head predates current main, and core/libs/prx/libSceAgcDriver/CMakeLists.txt changed on both sides after the merge base, please rebase onto 3a2b91981651569163768854a1fcdc7193b6667b and rerun the focused agc_driver_frame_replay suite on the updated tree. The merge preview is clean, but that does not replace testing the current merged tree.
Sources
- Current PR head
- Documented order confirmation with Sam-mon7
- Contribution rule on keeping branches current
Not verified
I did not run Vulkan/GPU tests on this host, run GTA V, or verify behavior on another GPU. The PR's reported GPU tests apply to its earlier tested base, not current main.
To get this to a good state
Rebase onto current main, rerun the focused replay tests with the validation layer enabled, and attach the exact head and output. I can then complete the re-review.
|
A data point for the "write REWIND control words last" part, from GTA V (PPSA04263) frame replays on Windows with an RTX 3080:
0 in 30 against about 1 in 20 is suggestive rather than proof. The mechanism matches what this PR fixes, though, and I haven't seen the failure since. AI-assisted: yes (Claude Code) |
…ry group, and write REWIND control words last A title that parks a queue on a REWIND writes the tail's command buffers and only then sets the control word valid. agc_frame_replay released such a wait by copying the recorded control word alone, so the tail ran with its INDIRECT_BUFFER still unwritten, and applying a memory group restored chunks in address order, so a control word could become valid before the buffers it chains to. A parked REWIND is now released by applying the first later memory group whose recorded control word is valid, and every group publishes valid REWIND control words, and the control words of parked REWINDs, only after the rest of the group is written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8e6bcba to
6ed6c2b
Compare
|
@adriadam10 @MarcZX10 Rebased onto current Focused replay tests with
@chitters2004 thanks for the GTA V replay numbers on the control-word order. AI-assisted: yes (Claude Code) |
MarcZX10
left a comment
There was a problem hiding this comment.
Re-reviewed exact head 6ed6c2ba2a65e1873101267f40f409d9179956b0 against current upstream/main 4c7d275bef89d309313d16bc2bc05d37a1b50be2. The author reports all 11 focused frame-replay tests passing on the exact head, including the new REWIND regression; the test fails with the prior main implementation, and the validation-layer log has no VUID or missing-layer message. The declared order through #11435 and #11436 is recorded. My current-main merge preview is clean; git diff --check and python3 tools/check_conventions.py --base upstream/main --head refs/review/upstream-12318 pass. I did not run the GPU tests locally.
✅ NVIDIA GPU test: passedPR head
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (2, not counted against this PR)Validated but not compared (1, not in the main baseline's validation pass)Validation IDs already present on main (4 IDs in 425 tests)Skipped (42)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
The overlap bot now also lists #12696 in AI-assisted: yes (Claude Code) |
main moved the frame replay test registrations into tests/cmake/agc_driver_frame_replay_tests.cmake, so the rewind test is registered there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The PR conflicted with Focused tests, same build (CachyOS, GCC 16.2.1, Release, RTX 4070 SUPER, driver 615.78.08), with
AI-assisted: yes (Claude Code) |
✅ NVIDIA GPU test: passedPR head
Failing on main too (4, not counted against this PR)Validation IDs already present on main (5 IDs in 341 tests)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
MarcZX10
left a comment
There was a problem hiding this comment.
Re-checked — new head, looks good
I reviewed head d3faa75d4aa9e44196409cdbbe524b0ce81d56a9; the replay implementation and regression assertions are unchanged from the previously reviewed head, and the current-main preview is clean.
What I ran
GitHub records PR base 613f9b8edf056318b14ff96fe3aceda59a419323; current main is cf79276fee2f042feb6a7c71d0d6a27e9cfe2592. The no-build precheck reports a clean preview against current main. Environment: Debian 12 x86-64, Python 3.11.2, GCC 12.2.0.
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 12318
gh pr checks 12318
gh api repos/boykopovar/AnyPS5/pulls/12318/files --paginate --jq '.[] | [.filename,.additions,.deletions]|@tsv'Results
| Check | Result |
|---|---|
| Diff and conventions | Passed in the precheck and hosted conventions job. |
| Current-main merge preview | Clean against cf79276fee2f042feb6a7c71d0d6a27e9cfe2592. |
| Changed files | Three: replay test, its CMake registration, and FrameReplay.cpp; implementation and test source match the previously reviewed head. |
| Hosted checks | Windows, conventions, labels, report, eligibility, and library portability passed. Linux and specialized jobs were skipped. |
| Latest NVIDIA report | The author reports 1,360 passes, four failures also present on main, and no new validation IDs on head d3faa75d; the attached broad-run logs do not include agc_driver_frame_replay_rewind. |
| Focused REWIND test | A prior author-reported 11/11 focused run on head 6ed6c2ba2a65e1873101267f40f409d9179956b0 included the REWIND regression and reported that it fails with the prior replay implementation. Test and implementation source are unchanged since that head; I did not reproduce the run. |
Selected unedited output
All conventions checks passed.
PR #12318: clean against current base; head `d3faa75d4aa9e44196409cdbbe524b0ce81d56a9`
windows pass 4m37s https://github.com/boykopovar/AnyPS5/actions/runs/41235472555/job/124638864849
linux skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41235472555/job/124638865928
Negative control
| Assertion | Change to code under test | Did the new test fail? |
|---|---|---|
| A parked REWIND must release only after its full memory group is restored | The prior author report says the focused regression fails with the prior FrameReplay.cpp implementation. |
Author-reported on head 6ed6c2ba2a65e1873101267f40f409d9179956b0; not independently repeated on d3faa75d. |
Sources
- Replay implementation and regression test at the current head
- Declared landing sequence and current dependency state
Not verified
No local build, CTest, or GPU run. The latest broad NVIDIA run did not list the new CTest by name; the focused REWIND result is author-reported from the unchanged source on the earlier reviewed head. The current #11436 dependency head is not included yet; the PR records that it will be rebased and integrated after the dependency lands.
main now has the pipelines and reservation_error modes in the frame replay test's argument check; rewind is added next to them, and its CTest entry gets the SKIP_RETURN_CODE and free-space settings the other replay tests now have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The PR conflicted with
Focused tests, same build (CachyOS, GCC 16.2.1, Release, RTX 4070 SUPER, driver 615.78.08), with
AI-assisted: yes (Claude Code) |
✅ NVIDIA GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (4, not counted against this PR)Validation IDs already present on main (9 IDs in 532 tests)Skipped (4)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
Re-checked: the new head only merges |
What
A title that parks a queue on a REWIND writes the tail's command buffers while the queue waits, and only then sets the control word's valid bit. GTA V does this for every submission: each one chains through REWIND-linked segments that the CPU fills in.
agc_frame_replaymishandled this in two ways:--release-after-ms, the replay copies the awaited dword from a later memory group. For a REWIND that sets the valid bit while the tail'sINDIRECT_BUFFERis still null in replay memory, so the tail fails withnull or misaligned address.The change in
tools/FrameReplay.cpp:releaseRewind: a REWIND wait (AwaitedWaitwithfunction == 0andbytes == 0;WaitMemoryalways sets a shape, and a function-0 WAIT_REG_MEM never blocks) is released by applying the first later memory group whose recorded control word hasPm4::RewindValidset, throughrestoreGroup. Other waits are released as before.restoreGroup: theMemorycall andreleaseRewindboth apply a group through it. It holds back a valid REWIND control word, writes the rest of the group, then publishes the held words with release stores. A word is held back when the word before it in the recorded chunk is a REWIND header, or when it is the address of a REWIND a queue is parked on. Holding a word back only changes the order of the writes, so a data word that happens to follow a REWIND-looking header still gets its recorded value.Tested
CachyOS Linux (kernel 7.3.0-4-cachyos), GCC 16.2.1, Release, NVIDIA GeForce RTX 4070 SUPER (615.78.08). Author-reported GPU tests (hosted CI does not run them).
agc_driver_frame_replay_rewind(new):INDIRECT_BUFFERwith a null target. It waits untilAgcDriverAwaitedWaitsreports the queue parked on that control word.INDIRECT_BUFFERat it, and sets the valid bit.--strictand compares the copy target.main'stools/FrameReplay.cppit fails as GTA V did:[gpu] driver failure: AGC driver: null or misaligned address, then a pacing timeout. With this change it passes.maine322066f82and this change merged with it (head748c64ea17), in the same build, withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build-tests -V -R '^agc_driver_frame_replay'. The 21 existing replay tests pass on both,_rewindfails only withmain's tool, and neither log has aVUID-line or a missing-layer message.releaseRewindand the held-word path ofrestoreGroupfor a parked REWIND. Its control word follows the header in the same chunk, so both conditions hold.maina capture does not start in GTA V gameplay (AGC frame capture: flips from REWIND tails are not frame boundaries, so APS5_FRAME_CAPTURE never starts in GTA V (PPSA04264) gameplay #12235); this one was recorded with local, unsubmitted recorder changes, which chitters2004's announced PRs on AGC frame capture: flips from REWIND tails are not frame boundaries, so APS5_FRAME_CAPTURE never starts in GTA V (PPSA04264) gameplay #12235 cover.agc_frame_replayfailed on its first submission with the samenull or misaligned address.python3 tools/check_conventions.py --base origin/mainandgit diff --checkpass.Overlap:
752958c135intomain.748c64ea17resolves the argument-check conflict intests/FrameReplay.cppby addingrewindbesidemain'spipelinesandreservation_error. feat(agc): replay full titles with repeated passes and the title's pipeline cache #11435 and feat(agc): list a capture's shaders and submissions and trace replay serials #11436 are still open with later commits. Against their current heads (ce3b9a8bf6,a110d7694a), this branch conflicts in the same filesmaindoes and in no others.mainand add itsrewindmode to their argument check intests/FrameReplay.cpp.tools/pr_overlap.pylists feat(agc): replay full titles with repeated passes and the title's pipeline cache #11435 and feat(agc): list a capture's shaders and submissions and trace replay serials #11436 (Sam-mon7), which conflict with this PR only inmain()oftests/FrameReplay.cpp(L263–273). All three add a mode to its argument check, so whichever merges second adds its mode to the other's.752958c135, and itstests/FrameReplay.cppis feat(agc): list a capture's shaders and submissions and trace replay serials #11436's unchanged. Its own commits (df74f29c46,89db2b5ae2) add a relaunch check aboverun()intools/FrameReplay.cppand a line indocs/dev/ENVIRONMENT.md, away from the wait release and the group restore. Its conflict is feat(agc): list a capture's shaders and submissions and trace replay serials #11436's, and the rebase onto feat(agc): list a capture's shaders and submissions and trace replay serials #11436 resolves it.Depends on.tools/FrameReplay.cpptheir changes do not touch the wait release or the restore of memory groups:CapturedMemory::Applyserves its new shader-listing mode;AgcDriverAwaitedWaitscall only describes blocked waits in the progress line.core/libs/prx/libSceAgcDriver/CMakeLists.txt. I checked their hunks there (feat(aot): consolidate native ARM64 compiler, runtime and consumers #5021's through the files API): none touches the frame replay tests.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code