Skip to content

fix(agc): release a parked REWIND in frame replay with its whole memory group, and write REWIND control words last - #12318

Merged
adriadam10 merged 3 commits into
boykopovar:mainfrom
Tehshortbus:fix/agc-frame-replay-rewind-release
Nov 6, 2026
Merged

adriadam10 merged 3 commits into
boykopovar:mainfrom
Tehshortbus:fix/agc-frame-replay-rewind-release

Conversation

@Tehshortbus

@Tehshortbus Tehshortbus commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

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_replay mishandled this in two ways:

  • The breaker released the wait with the control word alone. When the driver makes no progress for --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's INDIRECT_BUFFER is still null in replay memory, so the tail fails with null or misaligned address.
  • A memory group was restored in chunk order. A valid control word could become visible to a parked worker before the buffers its tail chains to were written.

The change in tools/FrameReplay.cpp:

  • releaseRewind: a REWIND wait (AwaitedWait with function == 0 and bytes == 0; WaitMemory always 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 has Pm4::RewindValid set, through restoreGroup. Other waits are released as before.
  • restoreGroup: the Memory call and releaseRewind both 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):
    • The test starts a capture at the first flip and submits a DCB of a REWIND whose control word is 0, followed by a chained INDIRECT_BUFFER with a null target. It waits until AgcDriverAwaitedWaits reports the queue parked on that control word.
    • Then, like the title, it writes a DMA copy plus label segment 64 KiB away, points the INDIRECT_BUFFER at it, and sets the valid bit.
    • It replays the capture with --strict and compares the copy target.
    • With main's tools/FrameReplay.cpp it fails as GTA V did: [gpu] driver failure: AGC driver: null or misaligned address, then a pacing timeout. With this change it passes.
  • Focused tests: main e322066f82 and this change merged with it (head 748c64ea17), in the same build, with ANYPS5_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, _rewind fails only with main's tool, and neither log has a VUID- line or a missing-layer message.
  • What the test reaches:
    • The new test reaches releaseRewind and the held-word path of restoreGroup for a parked REWIND. Its control word follows the header in the same chunk, so both conditions hold.
    • No test reaches a valid REWIND that is not yet parked when its group is applied (header condition only), or a control word at the first dword of a chunk (parked condition only).
  • GTA V (PPSA04264 01.011.001):
  • python3 tools/check_conventions.py --base origin/main and git diff --check pass.

Overlap:

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: feat(agc): list a capture's shaders and submissions and trace replay serials #11436
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 4070 SUPER, driver 615.78.08, CachyOS Linux (kernel 7.3.0-4-cachyos)
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 14137 core/libs/prx/libSceAgcDriver/tools/FrameReplay.cpp

@MarcZX10

Copy link
Copy Markdown
Contributor

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.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Tehshortbus

Copy link
Copy Markdown
Contributor Author

Checked the overlap report by hand:

AI-assisted: yes (Claude Code)

@MarcZX10

Copy link
Copy Markdown
Contributor

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.

@Tehshortbus

Copy link
Copy Markdown
Contributor Author

@MarcZX10 Thanks. I've proposed the order to Sam-mon7 on #11435: #11435, then #11436 (stacked on it), then this PR, which will rebase onto them and add its mode to their argument check. I'll set Depends on: #11436 here once Sam confirms.

AI-assisted: yes (Claude Code)

@maskym

maskym commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Windows + NVIDIA result for head 8e6bcba04d, merged into main 16e1b95117 (the PR's GPUs tested line names no NVIDIA run on Windows).

This PR's own tests: the 12 agc_driver_frame_replay* tests, including agc_driver_frame_replay_rewind (0.20 s), all passed.

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 VK_ADD_LAYER_PATH, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, BUILD_TESTING=ON, Ninja. Build clean.

Same focused run on main 16e1b95117 and on this tree, same machine and GPU: 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 -R '^(agc|guest_video_out|video_out)' --parallel 4 -V: main 1150/1151, this tree 1151/1152, the one failure in both being agc_driver_mesh_barycentric_emulation (#12121, fixed by the open #12062). The loader inserted VK_LAYER_KHRONOS_validation in every test (1012 insertions in each log), neither log contains was not found but was requested by env var VK_INSTANCE_LAYERS, and both report exactly one VUID, VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 18 times (pre-existing on main, #11990 / #6782): this PR adds no new VUID- error.

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 adriadam10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.cpp main()). Please record the agreed order in Depends on once Sam-mon7 confirms, or rebase onto them and list them there.

Once that is recorded this is ready to merge.

@Tehshortbus

Copy link
Copy Markdown
Contributor Author

@MarcZX10 @adriadam10 Sam-mon7 agreed to the order on #11435 (comment): #11435, then #11436, then this PR. The checklist now says Depends on: #11436, and the overlap section records the order. I'll rebase this PR and add its rewind mode to their argument check once theirs merge.

AI-assisted: yes (Claude Code)

@chitters2004

Copy link
Copy Markdown
Contributor

@Tehshortbus #12567 builds on this rather than replacing it. Its breaker releases a parked REWIND through your restoreGroup under a settled probe. It carries this commit until it merges, with the rewind mode added to #11435/#11436's argument check the way you planned. I'll drop the copy once this is in.

AI-assisted: yes (Claude Code)

chitters2004 added a commit to chitters2004/AnyPS5 that referenced this pull request Oct 28, 2026
…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 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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; current main is 3a2b91981651569163768854a1fcdc7193b6667b.
  • git merge-tree --write-tree upstream/main upstream/pr-12318 — clean preview, tree ae3ed04466737f3d256c07745fe8803c972e8a7d.
  • 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

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.

@chitters2004

Copy link
Copy Markdown
Contributor

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>
@Tehshortbus
Tehshortbus force-pushed the fix/agc-frame-replay-rewind-release branch from 8e6bcba to 6ed6c2b Compare October 29, 2026 08:10
@Tehshortbus

Copy link
Copy Markdown
Contributor Author

@adriadam10 @MarcZX10 Rebased onto current main 4c7d275bef. The head is now 6ed6c2ba2a, and range-diff shows the commit unchanged (=). The description's test line names the new base and head.

Focused replay tests with ANYPS5_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', on main and on this head (CachyOS Linux, RTX 4070 SUPER, NVIDIA 615.78.08):

Test main 4c7d275bef 6ed6c2ba2a
agc_driver_frame_replay_order passed passed
agc_driver_frame_replay_tokens passed passed
agc_driver_frame_replay_blocking passed passed
agc_driver_frame_replay_zero passed passed
agc_driver_frame_replay_shader passed passed
agc_driver_frame_replay_shader_host passed passed
agc_driver_frame_replay_unwatched passed passed
agc_driver_frame_replay_shared_page passed passed
agc_driver_frame_replay_host_neighbors passed passed
agc_driver_frame_replay passed passed
agc_driver_frame_replay_concurrent passed passed
agc_driver_frame_replay_rewind (new) — passed
  • Neither log has a VUID- line or a missing-layer message.
  • Negative control on this head: with main's tools/FrameReplay.cpp, agc_driver_frame_replay_rewind fails as before, with [gpu] driver failure: AGC driver: null or misaligned address and then call 7 waited longer than the pacing timeout.
  • python3 tools/check_conventions.py --base origin/main and git diff --check origin/main...HEAD pass.

@chitters2004 thanks for the GTA V replay numbers on the control-word order.

AI-assisted: yes (Claude Code)

@Tehshortbus
Tehshortbus requested a review from MarcZX10 October 29, 2026 08:22

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@TechLevelZero

TechLevelZero commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 6ed6c2b merged onto main 9f748f4 · tested 2026-10-30 22:18 UTC · 18 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,394 passed · 5 failed (0 new, 2 also fail on main, 3 unstable on main) · 42 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,441 of 3,021 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (911 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_bda_device 37.5 s, ⚠️ agc_driver_graphics_maps_fallback 32.9 s, ⚠️ agc_driver_graphics 31.5 s, ⚠️ agc_driver_lazy_resolved_abi_switch_set 31.5 s
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_submit_progress: failed in 5 of the last 9 main runs
agc_submit_progress: failed in 5 of the last 9 main runs
agc_submit_progress_no_timeline: failed in 7 of the last 9 main runs
Failing on main too (2, not counted against this PR)
guest_mmap_executable
guest_socket_options_multicast
Validated but not compared (1, not in the main baseline's validation pass)
agc_driver_frame_replay_rewind
Validation IDs already present on main (4 IDs in 425 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (425 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_array_layer_target_cpu, agc_driver_bda_span_reads_draw_pipeline, agc_driver_bitfield_mask, agc_driver_buffer_atomic_csub, and 417 more
VUID-vkCmdCopyImage-srcImage-01548 (13 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_sampling, and 5 more
VUID-vkCmdCopyImage-srcImage-01551 (13 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_sampling, and 5 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
Skipped (42)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_msaa_dcc_compared_import_2: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_4: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_8: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fresh: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or plat
Reproduce
git fetch origin 6ed6c2ba2a65e1873101267f40f409d9179956b0 9f748f4d8e36ce3714f3b95f3386316e110a9b22
git checkout 9f748f4d8e36ce3714f3b95f3386316e110a9b22 && git merge --no-ff 6ed6c2ba2a65e1873101267f40f409d9179956b0
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated 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.

@Tehshortbus

Copy link
Copy Markdown
Contributor Author

The overlap bot now also lists #12696 in main() of tests/FrameReplay.cpp. I added it to the Overlap section. #12696 merges in #11436 at 752958c135, and its tests/FrameReplay.cpp is #11436's unchanged, so this is the same conflict, handled by the order recorded in Depends on (#11435, #11436, then this PR). #12696's own commits don't touch the wait release or the group restore. There are no code changes, and the head is still 6ed6c2ba2a.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 31, 2026
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>
@Tehshortbus

Copy link
Copy Markdown
Contributor Author

The PR conflicted with main after #12862 moved the frame replay test registrations into tests/cmake/agc_driver_frame_replay_tests.cmake. I merged main (613f9b8edf) into the branch and registered agc_driver_frame_replay_rewind in that fragment, following its per-test if(WIN32) pattern. CMakeLists.txt now matches main. The new head is d3faa75d4a. Its tree is identical to this commit rebased onto 613f9b8edf, and the changed lines in tests/FrameReplay.cpp and tools/FrameReplay.cpp are unchanged.

Focused tests, same build (CachyOS, GCC 16.2.1, Release, RTX 4070 SUPER, driver 615.78.08), with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build-tests -R '^agc_driver_frame_replay' -V:

  • main 613f9b8edf: 11 tests, all passed.
  • Head d3faa75d4a: 12 tests, all passed, including _rewind (released_waits 1).
  • Negative control, this test with main's tools/FrameReplay.cpp: _rewind fails with AGC driver: null or misaligned address.
  • Neither log has a VUID- line or a missing-layer message.

python3 tools/check_conventions.py --base origin/main passes.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 31, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head d3faa75 merged onto main 0836dfd · tested 2026-11-01 02:19 UTC · 12 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 1,360 passed · 4 failed (0 new, 4 also fail on main) · 0 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 1,364 of 3,087 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (399 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 55.9 s
Failing on main too (4, not counted against this PR)
agc_driver_idle_store_yields
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (5 IDs in 341 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (341 tests): agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, agc_driver_bindless_images, and 333 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_prepared_exports
VUID-VkShaderModuleCreateInfo-pCode-08737 (1 test): agc_driver_image_sample_derivatives
Reproduce
git fetch origin d3faa75d4aa9e44196409cdbbe524b0ce81d56a9 0836dfdf4fecb1e0326100c490476e15d3a74da5
git checkout 0836dfdf4fecb1e0326100c490476e15d3a74da5 && git merge --no-ff d3faa75d4aa9e44196409cdbbe524b0ce81d56a9
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated 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 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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>
@Tehshortbus

Copy link
Copy Markdown
Contributor Author

The PR conflicted with main again after #12696 merged and brought #11436 at 752958c135 into main. I merged main (e322066f82) into the branch. The new head is 748c64ea17:

  • tests/FrameReplay.cpp: kept both testReservationError and testParkedRewindReplays, and added rewind to main's argument check beside pipelines and reservation_error, after the OpenVulkanTestDevice() skip.
  • tests/cmake/agc_driver_frame_replay_tests.cmake: agc_driver_frame_replay_rewind now has APS5_FRAME_CAPTURE_MIN_FREE_BYTES=0 and SKIP_RETURN_CODE 77, like the other replay tests on main.
  • tools/FrameReplay.cpp merged cleanly. Its changed lines are the same as before, except the Pm4.hpp include, which main already has.

Focused tests, same build (CachyOS, GCC 16.2.1, Release, RTX 4070 SUPER, driver 615.78.08), with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build-tests -R '^agc_driver_frame_replay' -V:

  • main e322066f82: 21 tests, all passed.
  • Head 748c64ea17: 22 tests, all passed, including _rewind (released_waits 1).
  • Negative control, this test with main's tools/FrameReplay.cpp: _rewind fails with AGC driver: null or misaligned address.
  • Neither log has a VUID- line or a missing-layer message.

python3 tools/check_conventions.py --base origin/main passes.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 6, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 748c64e merged onto main 5299939 · tested 2026-11-06 11:52 UTC · 31 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 1,962 passed · 5 failed (0 new, 4 also fail on main, 1 unstable on main) · 4 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 1,971 of 4,210 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (619 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 1 of the last 10 main runs
Failing on main too (4, not counted against this PR)
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
web_library_assets
Validation IDs already present on main (9 IDs in 532 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (532 tests): agc_driver_address_draw_space_reuse, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, and 524 more
VUID-VkShaderModuleCreateInfo-pCode-08737 (14 tests): agc_driver_dpp16_operands, agc_driver_dpp8_pk_fmac, agc_driver_dx10_clamp, agc_driver_f16_fma_denormal_modes, agc_driver_f16_fma_invalid_nan, agc_driver_float16_fma_rounding, agc_driver_float16_modifiers, agc_driver_float16_native, and 6 more
VUID-VkShaderModuleCreateInfo-pCode-08739 (14 tests): agc_driver_dpp16_operands, agc_driver_dpp8_pk_fmac, agc_driver_dx10_clamp, agc_driver_f16_fma_denormal_modes, agc_driver_f16_fma_invalid_nan, agc_driver_float16_fma_rounding, agc_driver_float16_modifiers, agc_driver_float16_native, and 6 more
VUID-VkShaderModuleCreateInfo-pCode-08741 (14 tests): agc_driver_dpp16_operands, agc_driver_dpp8_pk_fmac, agc_driver_dx10_clamp, agc_driver_f16_fma_denormal_modes, agc_driver_f16_fma_invalid_nan, agc_driver_float16_fma_rounding, agc_driver_float16_modifiers, agc_driver_float16_native, and 6 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_prepared_exports
VUID-VkPipelineShaderStageCreateInfo-module-parameter (1 test): agc_driver_float16_unused_nan_payloads
VUID-VkPipelineShaderStageCreateInfo-pSpecializationInfo-06849 (1 test): agc_driver_float16_unused_nan_payloads
Skipped (4)
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
Reproduce
git fetch origin 748c64ea177f2aa95cc8f8d3f4a6161f75042d4f 5299939ecfa9e186e1eb457c6f4bd133bdb087c7
git checkout 5299939ecfa9e186e1eb457c6f4bd133bdb087c7 && git merge --no-ff 748c64ea177f2aa95cc8f8d3f4a6161f75042d4f
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated 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.

@adriadam10
adriadam10 merged commit e3a14a8 into boykopovar:main Nov 6, 2026
14 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Re-checked: the new head only merges main after #11436 landed (rewind added to the argument check in tests/FrameReplay.cpp, APS5_FRAME_CAPTURE_MIN_FREE_BYTES=0 and SKIP_RETURN_CODE 77 on the test like its siblings); the tools/FrameReplay.cpp change is the one reviewed before. The overlap order is satisfied; merged.

oneandonlydean added a commit that referenced this pull request Nov 9, 2026
Resolve the conflicts with #12318 as proposed by chitters2004 (7712fa2):
replay memory groups go through main restoreGroup, which prepares each chunk
for a command write before the copy as this branch did inline; keep both the
store_window_stopped and the environment test env.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants