feat(agc): read frame capture deltas with the title's work in flight #15136

Open
thuanquang wants to merge 52 commits from upstream-pr/15136 into main
thuanquang commented 2026-11-02 17:54:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-11-02T17:54:16Z.


Commits to review, oldest first. Only these 11 commits are this PR. 4cd4bc371a and everything below it is #12568 as its branch carries it, with its merges of main (#11435 and #11436 are not below it; #12318, #12567 and #14137 have merged into main); the head merges into main 6711907d65 without conflicts. The diff of the 11 commits alone: 4cd4bc371a...7028c55d7e.

  1. 2e523f3de0 fix(agc): record a frame capture call with the serials it was made at
  2. fcf7c96a3e feat(agc): attribute driver stores into guest memory to the submission that makes them
  3. 5b2c3473fa feat(agc): read a frame capture delta with the title's work in flight when nothing in flight can store into it
  4. 5d89819712 feat(agc): hold a frame capture delta for unwatched memory only after a driver store into it
  5. 97a7cd7099 fix(agc): keep a frame replay from applying a later memory delta early to release a REWIND
  6. bbbf52881e feat(agc): split frame capture hold reasons by wait kind and store age
  7. 96602bde14 fix(agc): record the serial each frame capture call took and check it in the replay
  8. f76854fd53 fix(agc): hold a frame capture delta that a driver store reached between its hold check and its arm
  9. b3754e8c4a fix(agc): forget a frame capture's record of an unwatched page once a delta lists it while watched
  10. 12da997d2f test(agc): pin frame capture reads in flight, held re-collects, store owners and the last thread
  11. 7028c55d7e fix(agc): release the waits a frame replay still parks on at a delta its capture read with nothing in flight

4cd4bc371a is #12568's head: its commits 7d87265d66 (an unchanged delta stored once, with the test section_once), 87111995ec and cf368d991c, then merges of main up to 2f8c843691, which bring b3dcad85ac (guest calls pass a frame recorder waiting for its trigger). At e0df5b76d8 chitters2004 took our parked-wait compare (8fe56be720, which made #12568's calls format 3) and merged main dff7484fd1. Format 3 being taken, this PR's calls format is now 4 (see Format version). The 11 commits add about 830 lines to the driver, 260 to the replay tool and 2,870 lines of tests. BUILD.md and the debt file are complete only at commit 7: commits 4, 5 and 7 also document parts of commits 2 and 3. This stays a draft until #12568 settles; I restack whenever its head moves and update this list each time.

This push (since 4c25e67185).

  • A restack onto #12568's new head 4cd4bc371a, replacing the previous push's own merge of main. Its merge of main brings b3dcad85ac, which also changes FrameRecorder::record: commit 7 now keeps that change's early path (a call made while the recorder waits for its trigger accepts without the lock) and adds its accepted-serial check after it. Commits 2 and 3 differ from the previous push only in hunk context; the others are the same patches.
  • Checked on the RX 6700 XT at the head 7028c55d7e: build; main's new agc_driver_frame_capture_waiting and agc_driver_frame_capture_startup 10 of 10 runs each at commit 7 and at the head; the four held_* modes, wait_unwatched_reset, section_once, unwatched_in_flight, wait_before_read and the recorder rows agc_bda_staging, agc_bda_staging_bound, agc_recorder_title_call_closure, agc_recorder_storage_writer, agc_recorder_completion_labels 3 of 3 runs (14 tests); the frame set 117/117, and the same set under the validation layer 117/117 with the layer inserted and 0 VUID- lines.
  • Linux: as before, our WSL2 lavapipe build cannot run the capture and replay tests (no asynchronous userfaultfd write protection); the Linux CI job runs them.
  • Merge note: if #18914 merges first, its recorded-packet scan in reserveOutputs must also visit MEM_SEMAPHORE (0x39), which this PR's noteHeldAtSubmit registers; semaphore_after_read fails otherwise.
  • The previous push's list is in this description's edit history.

What

Frame captures from #12568's stack read each memory delta only after the submissions already accepted have completed, or every busy queue is parked on a wait for a title store. A paced replay therefore runs the captured frames with nothing in flight at those points. This PR lets the recorder read a delta while submissions are still in flight when none of the hold reasons below applies. Before it restores such a delta, the replay waits until the submissions that had started at the read have completed. To make this checkable, each recorded call carries the serials the driver had when the call entered it. Each submission, flip and suspend point also records the serial it took, and driver stores into guest memory carry the serial of the submission that made them. A driver store reported into such a delta's page after the read stops the capture when it comes from a submission accepted by the time of the read, or has no serial. The replay refuses a capture whose deltas read in flight were not checked.

Persona 5 Royal (PPSA05110): no change yet. A 20-frame gameplay capture made with an earlier revision of these changes (02132ba69e) read no delta in flight. It recorded 120 submits: 100 with one submission in flight and 20 with none (submit_depths), so no submit was made with more than one submission in flight. All 120 deltas made with work in flight were held. Each was held for an unfinished label and for a dword in the delta that a submission waits on (wait_dword_in_delta), and 119 also for a page the driver had stored into. The capture also counted 56,540 driver stores with no serial (unattributed_stores). Any of them that lands in a page of a delta read in flight would stop the capture. A paced --strict replay of that capture on the same build matched its reference images exactly (pixels_identical 1.000000, max_channel_diff 0, no pacing timeout). So this PR is the correctness layer that later timing work needs; it does not make replays faster or deeper on this title. A later 10-frame capture of the casino escape, made with the previous push plus nine local commits that port #14137's tracker change and other capture fixes (b18ca951c1), read 1 delta in flight and held 59, with stale_delta 0, unverified_deltas 0 and 10 unattributed_stores. No capture has been made with this head yet.

Capture

  • Driver stores into guest memory carry the serial of the submission that made them (GuestMemory::StoreSerialScope):

    • the queue worker's, under the submission it executes; a label it defers keeps the serial of the submission that queued it, also when a later submission stores it;
    • the draw committer's and finisher's, under the serial their work was queued with;
    • recorder completions registered while a capture runs, under the serial that registered them;
    • a storage image's write-back, under the oldest serial among the pending units it stores.

    A title call's own stores carry a reserved title-call serial. A completion that a title call registered, a write-back that includes a unit a title call marked, and a store on a thread where none of these scopes is set report 0, which the recorder treats as unknown. While a capture runs, an observer passes each store and its serial to the recorder.

  • Each recorded submission, flip, suspend point and EOP flip reservation carries the accepted and completed serials the driver had when the call entered it, before its delta. A submission, flip or suspend point also records the serial it took (0 for a CPU flip that took none). A submission or suspend point that does not move the accepted serial by exactly one, or a flip that moves it by more than one, stops the capture. capture.json counts the submissions in flight at each recorded submit (submit_depths) and at each delta read in flight (read_depths).

  • A delta is read with submissions in flight unless one of these holds it. A held delta is read as before, after the queues settle.

    • A second thread has made recorded calls; the thread that ends the capture counts.
    • It has a range added since the snapshot, or shader host pages.
    • A queue is parked on a WAIT_REG_MEM, WAIT_REG_MEM_64 or REWIND wait. A MEM_SEMAPHORE wait never counts as parked.
    • A submission is still queued (so at a read in flight, every submission in flight has started).
    • An unfinished label, a pending snapshot, storage-image or shadow write, or a queue-0 draw write overlaps it. The draw finisher's held writes count from any thread (DrawFinisher::AnyPendingOverlaps): the recorder asks from the title's thread, and before this push only a thread that hands the finisher work saw them.
    • The driver stored into one of its pages since the capture started. A store reported after this check and before the delta's pages are armed for the read holds the delta too (commit 8).
    • An unwatched block in it took a reported driver store since its last record.
    • A submission in flight still has to pass a WAIT_REG_MEM, WAIT_REG_MEM_64, MEM_SEMAPHORE or REWIND wait on title memory that no unfinished label satisfies: its own last label ahead of the wait, else the last label on that dword of the newest unfinished submission before it on its queue that has one, or a label on another queue, with a value fixed at submit that the wait accepts. A MEM_SEMAPHORE counts no label, and a REWIND only another queue's label that sets its valid bit. The rule is applied when the delta is read.
    • It holds a dword that a submission in flight, or one finished since the last full delta, waits on.

    These reasons do not cover every store a started submission can still make, such as a copy queued behind its labels. A reported store of that kind is caught by the stop below, as in_flight_store tests. The label rule does not see a store over a counted label before the wait reads it (debt [Title waits in frame capture deltas]); a delta read in flight on such a wait makes the paced replay throw at its gate, or the capture counts it in unverified_deltas. Waits are registered at submit while a capture runs. With work in flight, an unwatched block whose bytes still equal its last record, and that took no reported driver store since, is left out of the delta; one whose bytes changed is judged like a watched page. A shader delta that writes a host page updates that record too. capture.json counts each reason that applied (hold_reasons, hold_masks, with four keys that split parked waits, driver stores and title waits further), and per unwatched block how often it changed or took a driver store (unwatched_blocks).

  • The record of a delta read in flight carries InFlightDeltaFlag and lists the submissions that had started. Such a read is recorded even when it wrote no bytes.

  • While it records a call, the recorder holds the queue worker at its next packet and the draw committer and finisher at their next item. So the driver's threads start no new packet or item while the delta is collected, read and compressed. GPU work already submitted, a packet already executing and completions keep running. A delta that has to wait for the queues releases them first. The last delta of the capture is read the same way.

  • A store the driver reports into a page of a delta read in flight, from a submission accepted by the time of that read or with no serial, stops the capture (stale_delta). The check starts when the delta's pages are armed, right before the read; a store reported between the hold check and the arm holds the delta instead (above). A title call's own stores land before the call returns and are exempt.

  • After the last frame, and at any stop that is not such a store, the recorder waits up to 10 s for the submissions those deltas depend on to complete, waits for the GPU, flushes pending GPU writes over their pages and checks them the same way. If that wait times out, capture.json counts the deltas it could not check (unverified_deltas).

  • capture.json also adds in_flight_deltas, held_deltas and unattributed_stores. Its magic becomes aps5-frame-capture 2; nothing checks that magic.

  • Two driver exports are added: AgcDriverSerialDone_nid_postfix, which the replay's gate uses, and AgcDriverQueuedSerials_nid_postfix, which only the tests call.

Replay

  • A capture of the current calls format (4) is refused without capture.json or with a nonzero stale_delta. This includes a capture with no delta read in flight: one cut short by a kill or a crash has no capture.json, so it is refused where the stack's tool replays its complete records. The tool still prints its "replaying the complete records" notice first. A capture with deltas read in flight is also refused when stale_delta or unverified_deltas is missing, or unverified_deltas is nonzero. A capture of the previous format without capture.json is still accepted.
  • With pacing on, the replay refuses before any restore a capture in which a submission, flip or suspend point between the frame start and the last delta read in flight recorded no serial.
  • With pacing on, a delta read in flight waits until the replay's submissions that match the ones that had started at the read have completed. It is then restored while the queues run.
    • Before that, every submission and suspend point since the frame start must have taken the serial its recorded one maps to, counted from the frame start, and the replay's accepted serial must map to the capture's at the read.
    • A CPU flip may take a serial in only one of the two runs. When only the replay's flip took one, the replay waits until that flip presents before its next call, as the title's flip presented within its call, and counts the serial in the offset. When only the title's flip took one and it was the next serial, the map records that serial with no replay serial, the offset drops it, and the gate skips it among the submissions that had started. Each started serial maps through the serials the calls took, not by its distance from the accepted one.
    • The wait throws on a driver failure, once no queue runs and the serials have not moved for --pace-timeout-ms, or after 10 minutes. A serial that differs from the capture's in any other way also throws, as does such a delta after a second thread's first call, or one that lists a serial no call since the frame start recorded.
    • Submissions the capture had already completed at the read are not waited for. With work on more than one queue, one of them can still run during the restore (debt [Frame replay pacing]).
  • When the capture's frame start had accepted a submission, the first pass starts with an empty graphics command buffer, submitted from a thread of its own, so that a CPU flip takes no serial where the title's took none. This applies to every replay of such a capture, with or without pacing and in any calls format; the replay's absolute serials then start one higher.
  • In every capture of the current calls format, with or without deltas read in flight, the wait breaker no longer applies a later memory delta early to release a REWIND, since that delta may have been read in flight. So every capture this recorder writes loses #12567's early REWIND release (97284fe586); a capture of the previous format keeps it. A REWIND whose control word only a later delta sets stays blocked until that delta's own call. The first call paced behind it waits out --pace-timeout-ms, which releases nothing, and with --strict the replay fails. Other waits are still released with an earlier recorded value, or with a value derived from the reference, which #12567's fence_reuse needs.
  • The "pacing gave up" warning lists the waits the queues are blocked on again. 4ef54b694c in #12567 took that list out to keep the warning's earlier text. This PR puts it back because it shows which wait a stalled replay of the current format is blocked on, such as a REWIND above. The text before it is unchanged.
  • The JSON line adds memory_held_wait_s and memory_in_flight_wait_s (both inside pace_wait_s), restore_s, and in_flight_max and in_flight_mean: the submissions in flight after each submit's pacing gate, from passes 2 to n with --repeat n.
  • main's concurrent test (#11197) now also accepts a memory delta flagged as read in flight: before the copier thread's first call, such a delta can be read while the copies run.

Format version. Calls format 4 (aps5-frame-calls 4, InFlightCallsVersion) changes three things against format 3. A call's accepted and completed serials are read when it enters, before its delta. A submission, flip or suspend point appends the serial it took. A delta read in flight carries InFlightDeltaFlag and lists, after its group, the serials of the submissions that had started, in place of the parked waits a held delta lists. The replay compares a capture's format with InFlightCallsVersion at its checks. Formats 2 (#14137) and 3 (#12568's parked-wait records) keep their replay rules, apart from the empty command buffer described under Replay, and a format 2 or 3 capture that marks a delta read in flight is refused before any restore. Format 1 is still refused.

Outside a capture these hooks stay on; their cost was not measured:

  • per packet, one load of the recorder hold;
  • per draw committer item and finisher job, a hold check and a store-serial scope;
  • per draw committer item, finisher job and deferred label, a read of the thread's store serial when it is queued, kept with it (the finisher keeps these in a deque beside its jobs, pushed and popped under the lock it already takes);
  • per submission, a scope, one node inserted into and erased from a set under the lock the worker already holds, and two relaxed loads of the wait-tracking flag;
  • per completed submission, an erase from one empty map and a lookup in another, under the driver lock it already holds;
  • per wait packet, one call with a relaxed load;
  • per title call and deferred label, one scope;
  • per completion registration, a read of the current serial, and for OnComplete and AfterRecordedWork with a nonzero serial, one load of the store observer;
  • per AfterCompletions action and per batch finish, one scope;
  • per reported driver store, one load of the store observer, which is null;
  • per storage-image mark and write-back, a loop over its units, and per write-back one scope.

No new lock is taken.

Docs and debt. BUILD.md describes the in-flight read, its hold reasons and which unfinished labels satisfy a title wait, the stops, the replay's gate with its CPU-flip rules and the empty first command buffer, and the refusals. The debt file updates [Frame capture deltas] and [Frame replay pacing]. It adds [REWIND waits in frame replays], [Title waits in frame capture deltas], [Unwatched blocks in frame capture deltas], [Stores into frame capture deltas read in flight] and [Serials of frame replay calls]. The [Title waits ...] entry names the stores over a counted label that the rule does not see. The [Stores into ...] entry names the kinds of driver store for which it has not been checked whether they are reported with their writer. One that is not reported at all, and lands in a page of a delta read in flight after the read, is overwritten by the replay's restore. The longest new entry, [Serials ...], has 998 characters.

New tests. Each is agc_driver_frame_replay_<mode> unless named otherwise. There are 44.

Capture modes record frames through the driver, then replay them, except the two that say they run no replay. The title's work runs behind a long run of WRITE_DATA labels, so that it is still in flight at the title's next call.

  • in_flight_delta: while the busy submission runs, the title stores a page and submits a copy of it. The delta of that call must be flagged as read in flight and counted at depth 1 in read_depths. The test takes a suspend point right after the flip that starts the capture; each submission and the suspend point must record the serial after the accepted one, both recorded flips must record the serial they took, and the replay must copy the stored page.

  • in_flight_store: a copy queued behind the busy labels stores into a page that the title then writes and a delta reads in flight. The capture must stop on that page (stale_delta), and the replay must refuse it.

  • in_flight_gate: a submission copies X to Y between two runs of labels and writes a label after the copy. The title waits for that label, overwrites X and makes a call. The delta must list the submission as started, and the replay must dump the old X from Y, so a gate that waits for the wrong submission, or for none, fails.

  • late_store: in a one-frame capture, the last copy, behind the busy labels, lands after the last flip in a page of a delta read in flight. The end of the capture must find it (stale_delta or unverified_deltas), and the replay must refuse the capture. It skips as inconclusive unless the capture recorded its end with the copy still pending, so only the end check can find the store.

  • late_wait: in a one-frame capture, the last submission, accepted after a delta read in flight, waits on a title dword that the title stores only after its last flip returns. The end-of-capture check must still verify that delta (unverified_deltas 0), and the replay must accept the capture.

  • wait_after_read, wait64_after_read, rewind_after_read: a started submission still has to pass a WAIT_REG_MEM, WAIT_REG_MEM_64 or REWIND wait on a title flag when the title writes the copy's source and makes its next call. No delta may be read in flight with that submission listed, awaits_title and title_wait_unpassed must be counted, and a replay with --no-release must copy the title's store.

  • wait_labelled_after, wait_labelled_before, wait_labelled_skipped, wait_labelled_elsewhere: the same, but the flag also gets a label that must not count: behind the wait, ahead of it with a value the wait rejects, ahead of it under a COND_EXEC that skips it, or in a compute submission in flight with a value the wait rejects. The delta of the title's next call must still be held and counted as title_wait_unpassed. wait_labelled_after replays with the default release, since its label rewrites the flag before the next delta reads it.

  • wait_labelled_rewind, wait_labelled_rewind_chain: the wait sits in a REWIND tail, and the flag's newest label ahead of it stores a value the wait rejects: in wait_labelled_rewind the submission's label before its REWIND, in wait_labelled_rewind_chain (wait in the second tail) the first tail's label, which follows the submission's label of an accepted value. The queue's previous submission, which stored the accepted value, keeps its label record until the title's next call has returned. The delta read at that call must count title_wait_unpassed, and the strict replay must copy the title's store only after the wait passes.

  • semaphore_after_read: the same with MEM_SEMAPHORE, signalled by a second thread once the submission has reached its wait. No delta may be read in flight with that submission listed and awaits_title must be counted, but not title_wait_unpassed, since the signal may come before that read. The capture must not stop. This mode runs no replay.

  • wait_before_read: the submission has passed its wait on the title's flag but is still running when the title makes its next call. The delta holds the flag's page, so it must be held (awaits_title), and the replay must copy the title's store.

  • unwatched_in_flight: an unwatched block that nothing changed and that holds no awaited dword does not hold a delta read with the busy submission in flight: that delta is read in flight, no unwatched hold is counted, the block's counters show no change and no driver store, and the replay must restore the page the title wrote.

  • unwatched_restored: the busy submission stores into an unwatched block, and the title writes the recorded bytes back. The call must be recorded with the busy submission in flight, its delta must be held for unwatched, and the replay must keep the title's bytes.

  • wait_unwatched_reset: a submission waits on a flag in an unwatched block; the title stores the release value, the submission passes, the title writes the recorded value back and makes its next call while the submission still runs. The block's counters must show no change and no driver store, no delta may be read in flight with that submission listed, awaits_title must be counted, and the replay (with release on: no delta holds the release value) must copy the title's store.

  • unwatched_rewatched (registered on Windows only; elsewhere Rewatch notes nothing, so a block cannot return to the write watch): an unwatched block is recorded with A, rewatched, stored B and listed, then, with a busy submission running, stored A again and unwatched. The next delta read in flight must hold A at the block; the test skips as inconclusive when that delta was held.

  • host_page_restored: while a submission waits on the title's flag, a shader delta writes a host-range page that the title changed, and the title then writes back the bytes that the full delta before the shader delta recorded. The capture must hold those bytes at the next full delta, made with the submission in flight. It has no timing precondition and no inconclusive skip. This mode runs no replay; it checks the captured chunks.

  • hold_diagnostics: deltas are read while a queue parks on a title gate, a submission queues behind it, and a compute queue parks on a label that a graphics submission writes. Each reason must be counted (parked, queued, parked_on_title, driver_page with and without driver_page_since_full, title_wait_unpassed, wait_dword_in_delta), along with the unwatched block counters and the replay's in_flight_max.

  • flip_serial_start (in a build without the timing log; it skips in one with it): two CPU flips from a thread without graphics submissions after the driver accepted submissions, so the second takes no serial, then a delta read in flight behind a busy submission. The replay must reproduce the copy and, by the driver's accepted-serial trace (APS5_TRACE_GPU), take as many serials for CPU flips as the capture's flips did.

  • in_flight_once: the title stores page x while the busy submission runs and makes a call, whose delta is read in flight; after the driver went idle it stores page y and makes another call. x must be in that in-flight delta's group only and y only in the idle delta read before the call that copies it, with stale_delta 0 and unverified_deltas 0, and the replay must copy both pages. Pins that a read in flight moves its ranges' marks past what it read.

  • held_concurrent_store: a submission queued behind the busy one holds the delta at the title's call (queued); the title stores a watched page w before the call, and a second thread that makes no driver calls stores page z once the title's call waits for the queues to settle (seen through the driver's idle-waiter count). w and z must both be in the held delta's group and z in no later group. Pins the second collect after the settle (commit 3).

  • owner_lifetime: a page read in flight by delta D, then an idle delta that does not list it, then a driver store with no serial into it: the capture must stop with stale_delta = D. owner_lifetime_rewritten: the title stores the page again before the idle delta, which lists it and frees D's owner, so the same store leaves stale_delta 0. Pins the owner release rule; the base mode pins the stricter contract that a store with no serial long after D's work still stops the capture.

  • empty_in_flight_read: every word of the page a delta reads in flight already holds a noted GPU word, so the read writes no bytes; the delta must still be recorded (flagged, no chunk for its group), and a later store into the page by the submission in flight must stop the capture naming that group. The GPU words are noted through the driver's label-store note (DriverTestAccess::NoteLabelStore), since no real store sequence reaches this read without a driver page store holding the delta first.

  • shader_in_flight: a shader registration while the busy submission runs, with a page of the shader's 64 KiB block stored before it: its shader delta is read in flight (flagged, with the started submission) and holds the page; a second registration with nothing stored records no memory delta; the next full delta lists the page once more (shader deltas do not move the ranges' marks) and the page beside it, and no other delta holds them.

  • last_thread_hold: a submission whose REWIND tail is released before it is submitted flips the capture's last frame while 20,000 labels behind it still run, and a second thread that has made no recorded call reaches that frame boundary first (its submit calls RewindTailFlips before the recorder records it), so finish() runs on that thread with work in flight. The last delta must be held (threads counted), not read in flight, and the replay must accept the capture. Pins finish() counting its own thread (commit 3).
    Most capture modes skip as inconclusive (exit 77) when the title's work finishes, or reaches its wait, before the title's next call.

Without a capture:

  • carried_label (with APS5_PIPELINED_DRAWS=0) installs a driver-store observer of its own. A queue-0 label that a submission queued, and that the next, already queued submission stores because the first one's end flush was skipped, must be reported under the serial of the submission that queued it, and the next submission's own label under that submission's serial.
  • agc_driver_draw_finisher_overlap (with APS5_DRAW_PIPELINE=1): a thread that hands the draw finisher no work must see, through DrawPipeline::OverlapsAny, a write the finisher still holds, and not a range beside it.

Replay modes run the replay in-process on synthetic captures:

  • gate_failure: a driver failure reported once a submission parked on an unwritten label, while the gate of a delta read in flight waits for it, must end the gate with that error, and shutdown must rethrow it.
  • gate_settled: the same gate with no failure must end with the "no queue runs" error before its time limit, and must not restore the delta.
  • held_drained_release: a submission parked on a flag that a held delta records as 0, the delta's record showing as many submissions completed as accepted, a submission queued behind the waiter, and a delta read in flight listing that one. The replay must finish; the waiter must copy the source the held delta restored (released after the first apply), the delta must be applied again (out 3, flag 0), and of_them_at_deltas, of_them_synthesized and park_restores must each be 1.
  • held_parked_no_release: the same, but the held delta's record shows the waiter in flight, parked on a value the replay never parks on, so only that record keeps the replay from releasing: the gate must end with the "no queue runs" error and restore nothing.
  • held_drained_no_release: the first mode with --no-release: the gate must end as before.
  • held_shader_no_release: no release at a delta followed by a shader registration or any of the three ABI resolutions, at one made after a second thread's first call, or in a calls format 3 capture; a release at a delta that ends the window.
  • gate_no_frame_start: a delta read in flight in a capture without a frame start must make the gate throw instead of mapping its started serials by their distance from the accepted one.
  • unverified: a capture of the current calls format without capture.json is refused, also one with no delta read in flight. One with a delta read in flight is also refused without stale_delta or unverified_deltas, with a non-numeric or nonzero unverified_deltas, or with a stale delta. A verified one (also one that stopped for low disk space), one without such deltas, and a capture of the previous calls format without capture.json are not refused. A capture of the previous calls format with a delta marked as read in flight (flagged_previous) is refused. The mode calls the tool's restoreMemory directly, which checks each capture and restores the ones it accepts; it replays no calls.
  • depth_submits: the replay samples the in-flight depth at submits only, as submit_depths does, not at an EOP flip reservation.
  • depth_passes: with two passes, the depth counters hold only the second pass's samples.
  • in_flight_breaker: a queue parks at a REWIND whose valid bit only a later delta read in flight holds. The replay must release nothing, give up pacing once, and run the tail after that delta's own restore.
  • previous_breaker: the same window from a capture rewritten to the calls format before InFlightCallsVersion, with the delta not flagged. The breaker must apply that later delta early to release the REWIND before pacing gives up (5 s), and the tail must run.
  • serial_diverged: before a delta read in flight, each of these must make the replay throw: a submission or a suspend point recorded as taking the second serial after the frame start; a CPU flip recorded as taking the third serial after a submission that took the first (in a build without the timing log); a submission with no recorded serial; a delta read in flight at a serial that no call before it in the window took; one that lists a serial no call since the frame start took; and one after a second thread's first call. The tool's run() must refuse, before its restore, a capture whose submission or suspend point before a delta read in flight recorded no serial. A window whose calls took the recorded serials replays.
  • serial_flip_in_order (with APS5_CPU_FLIP_IN_ORDER=1): a CPU flip that took no serial in the capture takes one in the replay. The replay must restore the delta read in flight behind it, and only after that flip presented.
  • flip_serial_neutral (in a build without the timing log): a compute submission, a CPU flip recorded as taking the next serial and a graphics submission, where the replay's flip takes none. The delta read in flight behind them must be restored. With the graphics submission parked, the gate must skip the flip's serial and name that submission at the replay serial it took. With the compute submission before the flip parked instead, the gate must wait for it at the replay serial it took, and restore nothing.

serial_diverged, flip_serial_start and flip_serial_neutral fail with a message when APS5_CPU_FLIP_IN_ORDER or APS5_SYNC_FLIP is set or APS5_DUMP_SUBMITS is not empty, since a CPU flip would then take a serial. Their CTest registrations set none of these, so only a run that sets one for every test makes them fail.

Recorder tests:

  • agc_recorder_title_call_closure: completions registered through OnComplete, AfterCompletions and AfterRecordedWork under the title-call serial must reach the store observer with serial 0, and under submission 141 with 141.
  • agc_recorder_storage_writer: a storage image marked pending under serial 100 (or 0), dropped without a write-back and marked again under 141 must report its write-back under 141. One marked under 141 and again under a title call must report 0.

Changed: main's concurrent (above), and #12568's gpu_restore_cached now also checks the serials each recorded call took. It expects its CPU flip to record 0 only in a build without the timing log, with neither APS5_CPU_FLIP_IN_ORDER nor APS5_SYNC_FLIP set and APS5_DUMP_SUBMITS unset or empty.

Open before ready for review

  • Merge order: this PR merges after #12568.
  • No test fails today when any of these is dropped: the hold terms late_or_host, label, snapshot, storage, shadow and queue0 (agc_driver_draw_finisher_overlap tests the query behind queue0, not the term), the recorder's queue hold, commit 8's hold when the arm finds a newer driver store, and, at this head, the host-page loop's update of the unwatched record (commit 4): forget (commit 9) now drops the record first, so a page without the update counts as changed and is listed anyway; the update only lets a later delta read in flight leave an unchanged host page out (no committed test reaches that window; only the local injection d-t2a shows it). The recorder's stop when a recorded call moves the driver's accepted serial by anything but one (none or one for a flip) is an invariant check, not an untested behaviour: no input reaches it through the driver's entry points, since every submission, flip and suspend point enters the driver through the recorder, the recorder holds its mutex across each call's accept, and a submission or suspend point moves the accepted serial by exactly one or throws.
  • Commit 3's subject says a delta is read in flight "when nothing in flight can store into it". A started submission can still store into it, and that stops the capture; reword it.
  • #13021's native multisample depth publication: attribute it to the draw that wrote the samples, as commit 2 does for storage-image write-backs, with a capture test built on NativeMultisampleDepth; until then debt [Stores into frame capture deltas read in flight] names it. A miss needs the HTILE plane to share a 4 KiB page with title data written between the draw's submission and the delta read; the replay then fails at the publication's same-value check rather than replaying wrong bytes. From code reading; not seen on P5R.
  • Not this PR's, noted for #12568 and main: with frame capture on, a command-buffer flip waits in #7978's flip hold while the recorder holds its lock across the call (#12568's design, which commit 7's accepted-serial check also relies on). If the previous flip submission waits after its flip on a queue-0 MEM_SEMAPHORE that another thread signals with a later submission, that thread blocks on the lock and the run hangs. The root is that the flip hold does not count a MEM_SEMAPHORE wait as a wait on the title, as it does WAIT_REG_MEM; without the recorder the same hang needs the signal to come after the title's next flip. From code reading, not reproduced; P5R's captures record calls from one thread.
  • A nit from the review, not changed yet: a queue-0 label carried past its submission's completion is not an unfinished label for the hold, so such a delta stops the capture instead of being held.
  • Recapture P5R with this head: the hold-reason mix, the share of deltas read in flight, stale_delta and unverified_deltas have not been measured at this head (the latest capture, b18ca951c1 above, carries an earlier push).
  • Linux: run the new tests on the Linux job, which runs on a push to main or a dispatch, not on a pull request. There, tools/check_skips.py fails any skip that does not report a device limitation, and the capture modes' inconclusive skips do not.

Tested

Windows 11 26200, AMD Radeon RX 6700 XT (gfx1031), driver 32.0.21045.16010, WinLibs GCC 15.2.0 r7, Release. Each arm is a full build (cmake --build build) after git submodule update --init --recursive. The focused set is ctest -R "frame_(replay|capture)|agc_recorder_(title_call_closure|storage_writer|completion_labels)|draw_finisher_overlap|queued_constant_ram_dump|dumped_constant_capture|draw_pipeline_retired_items|agc_recorder_stored_bytes|agc_driver_(present_mode|flip_compute|eop_interrupts)" -V --timeout 120 with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1. Validation runs add VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (a local build of the layer), VK_LOADER_LAYERS_DISABLE=~implicit~ and VK_LOADER_DEBUG=layer, so their logs show whether the layer loaded. The focused-set rows below ran at 236795e85c, the previous push's tree but for one skip message in late_store. At this head the frame set passed 103/103 under the layer (0 VUID- lines, layer loaded), the gate modes (gate_failure, gate_settled, gate_no_frame_start, serial_diverged, flip_serial_neutral) and three of the new capture modes passed 3 of 3 runs, and commits 7 to 10 each built and passed ctest -R "frame_(replay|capture)" (95, 95, 96 and 103 tests). Rows for earlier heads are in this description's edit history.

Focused set, base and head:

Commit Run Passed Failed VUID- lines Layer
base e0df5b76d8 without the layer 70/70 none – –
base e0df5b76d8 with the layer 70/70 none 0 loaded (73 Inserted device layer "VK_LAYER_KHRONOS_validation" lines); 0 missing-layer lines
236795e85c without the layer, run 1 113/113 none – –
236795e85c without the layer, run 2 113/113 none – –
236795e85c without the layer, run 3 113/113 none – –
236795e85c with the layer 113/113 none 0 loaded (155 Inserted device layer "VK_LAYER_KHRONOS_validation" lines); 0 missing-layer lines
  • No test skipped in these runs. The seven new modes and late_store also passed 3 of 3 runs each at 236795e85c with --repeat until-fail:3, with no skip.
  • reservation_error (#11435's), which timed out at 30 s in all our earlier Windows runs, passes at the base and the head: #14100 is in main below e0df5b76d8, so a replay error now exits instead of hanging the tool on Windows.

Every commit built at its earlier revisions, and from commit 3 on passed the frame tests (ctest -R "frame_(replay|capture)", ANYPS5_REQUIRE_VULKAN=1). This push is a restack checked at its head only (above); at the previous push (f99e62f0bb, on e0df5b76d8) commits 7, 8, 9 and 10 built and passed 95/95, 95/95, 96/96 and 103/103. Commits 3 to 6 passed 67/67, 86/86, 87/87 and 89/89 (commits 4 and 5 at 236795e85c's series, 3 and 6 on trees identical to them). Commits 1 and 2 were built only. The recorder and draw-pipeline test targets were built at the previous push's head only.

Flakes, not from this PR. #12568's rewind_store and store_second_wait restore a delta again once the queue parks as captured; each failed now and then in our runs, on the base as well as the head: in 30 runs each, rewind_store failed 0 at the head and 2 at the base ("the replay applied the CPU store before the copy that preceded it"), store_second_wait 1 at each ("the replay ran the copy behind the gate's first wait after restoring the CPU store ..."). rewind_store also failed once in a validation run of the frame set at 236795e85c. I will look into them on #12568.

Full suite not rerun for this push; the last run (at e4dfa4b069) and its reruns are in this description's edit history.

Red checks. Each patch undoes one piece of this PR and must turn the named test red; the other tests its regex matches must pass. d-t2a instead injects the store that commit 8 handles. The patched tree is built, the test executables relinked (their copy of the driver checked by hash), then the tests run with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1. The rows that say 236795e85c ran there; the others ran on the previous pushes' series on #12568's da47027017 and f21b60440d (e4dfa4b069 had this push's commits 1 to 8 as trees before the restack; 58d76317c6, 7c7333675d, 9cac8e2692 and 0191553a68 are earlier heads of this PR) and were not rerun at this head.

Red patch: what it undoes Test Earlier Last run: the commit named (236795e85c is the previous push's tree but for a skip message)
title-call-closure: a completion a title call registers keeps the title-call serial agc_recorder_title_call_closure 58d76317c6: failed failed
storage-writer-d1: one writer serial per storage image instead of one per unit agc_recorder_storage_writer 3366c145f6, patch fixed by hand: failed 3 of 3 runs failed
storage-writer-title-call: a unit a title call marks keeps the title-call serial agc_recorder_storage_writer 58d76317c6: failed failed
unwatched-restored-l6: a call's serials are read after its delta, not when it enters unwatched_restored 58d76317c6: failed 236795e85c: failed
in-flight-store-hazard: no stop on a driver store into a delta read in flight in_flight_store 58d76317c6: failed 236795e85c: failed
late-store-end-check: no check at the end of the capture late_store 58d76317c6: failed 236795e85c: failed
late-wait-c1: the end check waits for the driver to go idle, not for the deltas' submissions late_wait 58d76317c6: failed 236795e85c (re-anchored: only awaitLateStores changed): failed
mask-awaits-title: no awaits_title hold wait_after_read, wait64_after_read, rewind_after_read, wait_before_read, semaphore_after_read 58d76317c6: failed, 5/5 236795e85c: failed, 5/5
mask-queued: every delta made with work in flight is held as queued in_flight_delta, late_store, unwatched_in_flight 58d76317c6: failed, 3/3 236795e85c: failed, 3/3
in-flight-gate: no wait for the started submissions in_flight_gate 58d76317c6: failed does not apply; 0191553a68: failed
gate-failure-rethrow: SerialDone does not rethrow a driver failure gate_failure 58d76317c6: failed failed (the test's form before this push; not rerun on its new form)
gate-settled-r1: the gate does not end when no queue runs; only its time limit ends it gate_settled 58d76317c6: failed does not apply; 0191553a68: failed after 20.20 s (the test's form before this push; not rerun on its new form)
unverified-r3: a capture that stopped early is refused although its end check passed unverified 58d76317c6: failed does not apply; 0191553a68: failed
depth-submits-r5: depth is sampled at every paced call, not only at submits depth_submits 58d76317c6: failed failed
depth-passes-r5b: with --repeat, the first pass's depth samples are kept depth_passes 58d76317c6: failed failed
a-t2-overlap: OverlapsAny asks the finisher's producer-only query again agc_driver_draw_finisher_overlap tree of ef6a91568d: failed failed
a-t8g, 3 patches: the serial scope of the OnComplete, AfterCompletions or AfterRecordedWork wrap is removed agc_recorder_title_call_closure tree of ef6a91568d: failed, 3/3 failed, 3/3
a-t8h-capture: a deferred label does not take its submission's serial carried_label tree of ef6a91568d: failed failed
a-t8h-restore: a deferred label's store does not run under that serial carried_label tree of ef6a91568d: failed failed
b-u1-head-driver: the driver's title-wait rule back to the previous push's the 4 wait_labelled_* modes final code of 9fc6d89504, before it was committed: failed, 4/4 failed, 4/4
b-wait-labelled-after: a label behind the wait on the waiter's own queue counts wait_labelled_after same: failed failed
b-wait-labelled-before: the value check accepts every value wait_labelled_before, wait_labelled_elsewhere same: failed, 2/2 failed, 2/2
b-wait-labelled-skipped: a label under a COND_EXEC counts as fixed at submit wait_labelled_skipped same: failed failed
b-wait-labelled-elsewhere: another queue's label counts whatever its value wait_labelled_elsewhere same: failed failed
c-unlined: no accepted-serial check at the gate serial_diverged d6fa1cb409: failed does not apply; 0191553a68: failed
c-threaded: no second-thread check at the gate serial_diverged d6fa1cb409: failed does not apply; 0191553a68: failed
c-early: no refusal in run() before the restore serial_diverged d6fa1cb409: failed failed
c-suspendtraced: no serial check of a suspend point serial_diverged d6fa1cb409: failed failed
c-suspendkind: the early refusal ignores suspend points serial_diverged d6fa1cb409: failed failed
c-inflightbreaker: the breaker may apply a later delta early in a replay of the current calls format in_flight_breaker tree of abc85ff056: failed failed
c-prevbreaker: the breaker never applies a later delta early previous_breaker tree of abc85ff056: failed after 5.09 s failed after 5.09 s
c-unheadedprev: a capture of the previous format also needs capture.json unverified d6fa1cb409: failed failed
c-v1branch: the reader's previous-format branch unverified, previous_breaker d6fa1cb409: failed, 2/2 failed, 2/2
c-flipzero: the recorder writes 0 for every flip in_flight_delta d6fa1cb409: failed failed
c-suspendunaccepted: a suspend point is recorded without its accept in_flight_delta d6fa1cb409: failed failed
c-u7env, with APS5_CPU_FLIP_IN_ORDER=1: gpu_restore_cached always expects a CPU flip without a serial gpu_restore_cached tree of abc85ff056: failed not rerun
d-t2a (an injection): the first started submission reports a store into the delta's first page right after the hold check in_flight_delta (the delta must be held, not read in flight) 7c7333675d with commit 8's change: failed 236795e85c: failed ("the delta read while the busy submission ran was held, not read in flight" is the injected store's hold)
d-t3red: the host-page loop does not update the unwatched record host_page_restored 9cac8e2692 with the fix uncommitted: failed 236795e85c: passed: commit 9's forget now drops the record first (see Open)
u13-red0: the replay tool back to the previous push's flip_serial_start 27408f2a32: the replay refused the capture ("call 5 (flip) took replay serial 1 where the capture's call took none") and the test timed out at 120 s (Known, above); flip_serial_neutral and serial_flip_in_order failed not rerun
u13-red1: no empty command buffer before the first pass flip_serial_start 27408f2a32: failed does not apply; 0191553a68: failed
u13-red2: neither CPU-flip case of the serial check flip_serial_neutral, serial_flip_in_order 27408f2a32: failed, 2/2 failed, 2/2
u13-red3: the replay does not wait for a CPU flip that only it gave a serial to present serial_flip_in_order 27408f2a32: failed failed
rt-seed: executeRewindTail adds no labels ahead of a REWIND tail's waits wait_labelled_rewind, wait_labelled_rewind_chain 36551c543c (the fix on 4daf1dbd66, whose driver and tool are 0191553a68's): failed, 2/2, in 3 of 3 runs 3d1e020f44: failed, 2/2, in 3 of 3 runs
rt-record-only: a tail's waits see only the labels its submission's record kept, not the earlier tails' wait_labelled_rewind_chain (wait_labelled_rewind must pass) same: failed in 3 of 3 runs, wait_labelled_rewind passed 3d1e020f44: failed in 3 of 3 runs, wait_labelled_rewind passed
flagged-prev: no refusal of a format 2 or 3 capture that marks a delta read in flight unverified (flagged_previous) new 1f77916e75: failed, 1 of 1 ("the replay did not refuse capture flagged_previous ...")
t5-forget: forget keeps the per-page records of unwatched pages unwatched_rewatched fix round of the previous push (before the in-flight assert): failed 1f77916e75: failed, 1 of 1 ("... left out the unwatched block whose bytes the title wrote back ...")
T1-0: a read in flight does not move its ranges' marks in_flight_once new 236795e85c: failed
he-0: no second collect after the settle held_concurrent_store new 236795e85c: failed
he-1: the second collect does not move the marks held_concurrent_store new 236795e85c: failed
T3-0: any later delta frees a page's store owner owner_lifetime new 236795e85c: failed
T3-1: no owner is freed by a later settled delta owner_lifetime_rewritten new 236795e85c: failed
T6-0: a delta read in flight that writes no bytes is not recorded empty_in_flight_read new 236795e85c: failed
T4-0: a shader delta does not keep its marks shader_in_flight new 236795e85c: failed
T4-1: a delta that collected nothing still takes the in-flight decision shader_in_flight new 236795e85c: failed
T5-0: finish() does not count its own thread last_thread_hold new 236795e85c: failed
no-frame-start: the gate maps started serials by distance when the capture has no frame start gate_no_frame_start new this push's tree: failed
u13-red4: the gate maps a started serial by its distance from the accepted one flip_serial_neutral, serial_diverged new 0191553a68: failed, 2/2

Each failure in the table printed the message its test gives for that defect, except u13-red0's flip_serial_start (the tool's refusal, then the exit hang) and c-v1branch (the reader's "is not a frame capture file"). With commit 8 reverted as well as injected (t2b, on 7c7333675d), in_flight_delta passes: the delta is read in flight and the capture is accepted with stale_delta 0, which is the silent case commit 8 closes. 41 of the 43 new tests have a red row at this head or the previous pushes; hold_diagnostics has none, and host_page_restored's (d-t3red) no longer turns it red at this head.

Not tested:

  • Linux. A WSL2 lavapipe build (kernel 5.15) at 58d76317c6 passed 26 of 63 tests. The 37 frame-capture tests stop at "frame capture: the guest write watch is unavailable", because asynchronous userfaultfd write protection fails there. That is not the CI path, and the pull request build does not run the Linux job. None of this push's new or changed tests has run on Linux. Third-party Linux runs so far cover only the stack, without this PR's code: TechLevelZero ran this PR's base f21b60440d merged onto main 4f41f4c375 on an NVIDIA RTX 2000 Ada and on an AMD RX 6300 (RADV); both runs passed with 0 new failures and no new validation IDs against main.
  • A -DAPS5_ENABLE_TIMING_LOG=ON build of this head. By the code, in such a build flip_serial_start skips, flip_serial_neutral returns at once, serial_diverged leaves out its CPU-flip row, and gpu_restore_cached accepts 0 or the next serial for its CPU flip. Such a build of 4daf1dbd66 ran (an earlier push: its driver and tool are 0191553a68's, not this head's), and its tests lack the assembled-head review's changes (the flip_serial_start guard, flip_serial_neutral's third window and serial_diverged's listed-serial row). There flip_serial_start failed 3 of 3 runs ("the first CPU flip after the frame start, from a thread without graphics submissions, took a serial in the capture"), the case its guard now skips, and serial_diverged, serial_flip_in_order, flip_serial_neutral, gpu_restore_cached and in_flight_delta passed 3 of 3. The same tree built without the timing log passed all six, 3 of 3. The environment side ran: gpu_restore_cached passed 3 of 3 runs with APS5_CPU_FLIP_IN_ORDER=1 on the tree of abc85ff056, and failed with its guard forced (the c-u7env row).
  • An empty APS5_DUMP_SUBMITS: Windows removes a variable set to empty, so the empty-is-unset terms rest on code reading.
  • The draw finisher's store serial (taken in DrawFinisher::Enqueue, applied around each job in DrawFinisher::run): the finisher runs only with APS5_DRAW_PIPELINE, and none of the tests that install a driver-store observer sets it. Without that scope a finisher store reports serial 0. Into a page of a delta read in flight, that stops the capture (stale_delta), so a good capture is refused, loudly. Anywhere else it only adds to unattributed_stores and, like any reported store, holds later deltas over its page. It cannot make a replay silently wrong.
  • Branches of the title-wait rule that no test or red row pins: the predicated-packet and RELEASE_MEM timestamp terms of a label's fixed value, predicated INDIRECT_BUFFER ranges, the newest earlier submission on the waiter's own queue, the pairing of a 64-bit wait's two dwords, RewindValid on another queue's label, the MEM_SEMAPHORE early return, and the erase of a completed submission's labels.
  • A P5R capture with this head. The P5R numbers above come from 02132ba69e and b18ca951c1.
  • Linux for the two REWIND-tail modes, like the rest of this push's tests (above).
  • The cost outside a capture of the hooks listed above.
  • Cold times on llvmpipe. On the RX 6700 XT in run 1 of the focused set at 236795e85c the slowest test took 4.8 s (rewind_release) and the seven new modes of this push 2.0-3.1 s each.

Checklist

  • Based on current main; no other open PR implements the same functions (these commits sit on #12568's 4cd4bc371a; git merge-tree of the head into main 6711907d65 is clean)
  • 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: #12568 at 4cd4bc371a (merge order: this PR after it)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 6700 XT (gfx1031), driver 32.0.21045.16010, Windows 11 26200
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5124901912 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15136). Originally posted by [thuanquang](https://github.com/thuanquang) on 2026-11-02T17:54:16Z. --- **Commits to review**, oldest first. Only these 11 commits are this PR. `4cd4bc371a` and everything below it is #12568 as its branch carries it, with its merges of `main` (#11435 and #11436 are not below it; #12318, #12567 and #14137 have merged into `main`); the head merges into `main` `6711907d65` without conflicts. The diff of the 11 commits alone: [`4cd4bc371a...7028c55d7e`](https://github.com/thuanquang/AnyPS5/compare/4cd4bc371a...7028c55d7e). 1. `2e523f3de0` fix(agc): record a frame capture call with the serials it was made at 2. `fcf7c96a3e` feat(agc): attribute driver stores into guest memory to the submission that makes them 3. `5b2c3473fa` feat(agc): read a frame capture delta with the title's work in flight when nothing in flight can store into it 4. `5d89819712` feat(agc): hold a frame capture delta for unwatched memory only after a driver store into it 5. `97a7cd7099` fix(agc): keep a frame replay from applying a later memory delta early to release a REWIND 6. `bbbf52881e` feat(agc): split frame capture hold reasons by wait kind and store age 7. `96602bde14` fix(agc): record the serial each frame capture call took and check it in the replay 8. `f76854fd53` fix(agc): hold a frame capture delta that a driver store reached between its hold check and its arm 9. `b3754e8c4a` fix(agc): forget a frame capture's record of an unwatched page once a delta lists it while watched 10. `12da997d2f` test(agc): pin frame capture reads in flight, held re-collects, store owners and the last thread 11. `7028c55d7e` fix(agc): release the waits a frame replay still parks on at a delta its capture read with nothing in flight `4cd4bc371a` is #12568's head: its commits `7d87265d66` (an unchanged delta stored once, with the test `section_once`), `87111995ec` and `cf368d991c`, then merges of `main` up to `2f8c843691`, which bring `b3dcad85ac` (guest calls pass a frame recorder waiting for its trigger). At `e0df5b76d8` chitters2004 took our parked-wait compare (`8fe56be720`, which made #12568's calls format 3) and merged `main` `dff7484fd1`. Format 3 being taken, this PR's calls format is now 4 (see **Format version**). The 11 commits add about 830 lines to the driver, 260 to the replay tool and 2,870 lines of tests. BUILD.md and the debt file are complete only at commit 7: commits 4, 5 and 7 also document parts of commits 2 and 3. This stays a draft until #12568 settles; I restack whenever its head moves and update this list each time. **This push** (since `4c25e67185`). - A restack onto #12568's new head `4cd4bc371a`, replacing the previous push's own merge of `main`. Its merge of `main` brings `b3dcad85ac`, which also changes `FrameRecorder::record`: commit 7 now keeps that change's early path (a call made while the recorder waits for its trigger accepts without the lock) and adds its accepted-serial check after it. Commits 2 and 3 differ from the previous push only in hunk context; the others are the same patches. - Checked on the RX 6700 XT at the head `7028c55d7e`: build; `main`'s new `agc_driver_frame_capture_waiting` and `agc_driver_frame_capture_startup` 10 of 10 runs each at commit 7 and at the head; the four `held_*` modes, `wait_unwatched_reset`, `section_once`, `unwatched_in_flight`, `wait_before_read` and the recorder rows `agc_bda_staging`, `agc_bda_staging_bound`, `agc_recorder_title_call_closure`, `agc_recorder_storage_writer`, `agc_recorder_completion_labels` 3 of 3 runs (14 tests); the frame set 117/117, and the same set under the validation layer 117/117 with the layer inserted and 0 `VUID-` lines. - Linux: as before, our WSL2 lavapipe build cannot run the capture and replay tests (no asynchronous userfaultfd write protection); the Linux CI job runs them. - Merge note: if #18914 merges first, its recorded-packet scan in `reserveOutputs` must also visit `MEM_SEMAPHORE` (`0x39`), which this PR's `noteHeldAtSubmit` registers; `semaphore_after_read` fails otherwise. - The previous push's list is in this description's edit history. ### What Frame captures from #12568's stack read each memory delta only after the submissions already accepted have completed, or every busy queue is parked on a wait for a title store. A paced replay therefore runs the captured frames with nothing in flight at those points. This PR lets the recorder read a delta while submissions are still in flight when none of the hold reasons below applies. Before it restores such a delta, the replay waits until the submissions that had started at the read have completed. To make this checkable, each recorded call carries the serials the driver had when the call entered it. Each submission, flip and suspend point also records the serial it took, and driver stores into guest memory carry the serial of the submission that made them. A driver store reported into such a delta's page after the read stops the capture when it comes from a submission accepted by the time of the read, or has no serial. The replay refuses a capture whose deltas read in flight were not checked. **Persona 5 Royal (PPSA05110): no change yet.** A 20-frame gameplay capture made with an earlier revision of these changes (`02132ba69e`) read no delta in flight. It recorded 120 submits: 100 with one submission in flight and 20 with none (`submit_depths`), so no submit was made with more than one submission in flight. All 120 deltas made with work in flight were held. Each was held for an unfinished label and for a dword in the delta that a submission waits on (`wait_dword_in_delta`), and 119 also for a page the driver had stored into. The capture also counted 56,540 driver stores with no serial (`unattributed_stores`). Any of them that lands in a page of a delta read in flight would stop the capture. A paced `--strict` replay of that capture on the same build matched its reference images exactly (`pixels_identical` 1.000000, `max_channel_diff` 0, no pacing timeout). So this PR is the correctness layer that later timing work needs; it does not make replays faster or deeper on this title. A later 10-frame capture of the casino escape, made with the previous push plus nine local commits that port #14137's tracker change and other capture fixes (`b18ca951c1`), read 1 delta in flight and held 59, with `stale_delta` 0, `unverified_deltas` 0 and 10 `unattributed_stores`. No capture has been made with this head yet. **Capture** - Driver stores into guest memory carry the serial of the submission that made them (`GuestMemory::StoreSerialScope`): - the queue worker's, under the submission it executes; a label it defers keeps the serial of the submission that queued it, also when a later submission stores it; - the draw committer's and finisher's, under the serial their work was queued with; - recorder completions registered while a capture runs, under the serial that registered them; - a storage image's write-back, under the oldest serial among the pending units it stores. A title call's own stores carry a reserved title-call serial. A completion that a title call registered, a write-back that includes a unit a title call marked, and a store on a thread where none of these scopes is set report 0, which the recorder treats as unknown. While a capture runs, an observer passes each store and its serial to the recorder. - Each recorded submission, flip, suspend point and EOP flip reservation carries the accepted and completed serials the driver had when the call entered it, before its delta. A submission, flip or suspend point also records the serial it took (0 for a CPU flip that took none). A submission or suspend point that does not move the accepted serial by exactly one, or a flip that moves it by more than one, stops the capture. `capture.json` counts the submissions in flight at each recorded submit (`submit_depths`) and at each delta read in flight (`read_depths`). - A delta is read with submissions in flight unless one of these holds it. A held delta is read as before, after the queues settle. - A second thread has made recorded calls; the thread that ends the capture counts. - It has a range added since the snapshot, or shader host pages. - A queue is parked on a `WAIT_REG_MEM`, `WAIT_REG_MEM_64` or REWIND wait. A `MEM_SEMAPHORE` wait never counts as parked. - A submission is still queued (so at a read in flight, every submission in flight has started). - An unfinished label, a pending snapshot, storage-image or shadow write, or a queue-0 draw write overlaps it. The draw finisher's held writes count from any thread (`DrawFinisher::AnyPendingOverlaps`): the recorder asks from the title's thread, and before this push only a thread that hands the finisher work saw them. - The driver stored into one of its pages since the capture started. A store reported after this check and before the delta's pages are armed for the read holds the delta too (commit 8). - An unwatched block in it took a reported driver store since its last record. - A submission in flight still has to pass a `WAIT_REG_MEM`, `WAIT_REG_MEM_64`, `MEM_SEMAPHORE` or REWIND wait on title memory that no unfinished label satisfies: its own last label ahead of the wait, else the last label on that dword of the newest unfinished submission before it on its queue that has one, or a label on another queue, with a value fixed at submit that the wait accepts. A `MEM_SEMAPHORE` counts no label, and a REWIND only another queue's label that sets its valid bit. The rule is applied when the delta is read. - It holds a dword that a submission in flight, or one finished since the last full delta, waits on. These reasons do not cover every store a started submission can still make, such as a copy queued behind its labels. A reported store of that kind is caught by the stop below, as `in_flight_store` tests. The label rule does not see a store over a counted label before the wait reads it (debt [Title waits in frame capture deltas]); a delta read in flight on such a wait makes the paced replay throw at its gate, or the capture counts it in `unverified_deltas`. Waits are registered at submit while a capture runs. With work in flight, an unwatched block whose bytes still equal its last record, and that took no reported driver store since, is left out of the delta; one whose bytes changed is judged like a watched page. A shader delta that writes a host page updates that record too. `capture.json` counts each reason that applied (`hold_reasons`, `hold_masks`, with four keys that split parked waits, driver stores and title waits further), and per unwatched block how often it changed or took a driver store (`unwatched_blocks`). - The record of a delta read in flight carries `InFlightDeltaFlag` and lists the submissions that had started. Such a read is recorded even when it wrote no bytes. - While it records a call, the recorder holds the queue worker at its next packet and the draw committer and finisher at their next item. So the driver's threads start no new packet or item while the delta is collected, read and compressed. GPU work already submitted, a packet already executing and completions keep running. A delta that has to wait for the queues releases them first. The last delta of the capture is read the same way. - A store the driver reports into a page of a delta read in flight, from a submission accepted by the time of that read or with no serial, stops the capture (`stale_delta`). The check starts when the delta's pages are armed, right before the read; a store reported between the hold check and the arm holds the delta instead (above). A title call's own stores land before the call returns and are exempt. - After the last frame, and at any stop that is not such a store, the recorder waits up to 10 s for the submissions those deltas depend on to complete, waits for the GPU, flushes pending GPU writes over their pages and checks them the same way. If that wait times out, `capture.json` counts the deltas it could not check (`unverified_deltas`). - `capture.json` also adds `in_flight_deltas`, `held_deltas` and `unattributed_stores`. Its magic becomes `aps5-frame-capture 2`; nothing checks that magic. - Two driver exports are added: `AgcDriverSerialDone_nid_postfix`, which the replay's gate uses, and `AgcDriverQueuedSerials_nid_postfix`, which only the tests call. **Replay** - A capture of the current calls format (4) is refused without `capture.json` or with a nonzero `stale_delta`. This includes a capture with no delta read in flight: one cut short by a kill or a crash has no `capture.json`, so it is refused where the stack's tool replays its complete records. The tool still prints its "replaying the complete records" notice first. A capture with deltas read in flight is also refused when `stale_delta` or `unverified_deltas` is missing, or `unverified_deltas` is nonzero. A capture of the previous format without `capture.json` is still accepted. - With pacing on, the replay refuses before any restore a capture in which a submission, flip or suspend point between the frame start and the last delta read in flight recorded no serial. - With pacing on, a delta read in flight waits until the replay's submissions that match the ones that had started at the read have completed. It is then restored while the queues run. - Before that, every submission and suspend point since the frame start must have taken the serial its recorded one maps to, counted from the frame start, and the replay's accepted serial must map to the capture's at the read. - A CPU flip may take a serial in only one of the two runs. When only the replay's flip took one, the replay waits until that flip presents before its next call, as the title's flip presented within its call, and counts the serial in the offset. When only the title's flip took one and it was the next serial, the map records that serial with no replay serial, the offset drops it, and the gate skips it among the submissions that had started. Each started serial maps through the serials the calls took, not by its distance from the accepted one. - The wait throws on a driver failure, once no queue runs and the serials have not moved for `--pace-timeout-ms`, or after 10 minutes. A serial that differs from the capture's in any other way also throws, as does such a delta after a second thread's first call, or one that lists a serial no call since the frame start recorded. - Submissions the capture had already completed at the read are not waited for. With work on more than one queue, one of them can still run during the restore (debt [Frame replay pacing]). - When the capture's frame start had accepted a submission, the first pass starts with an empty graphics command buffer, submitted from a thread of its own, so that a CPU flip takes no serial where the title's took none. This applies to every replay of such a capture, with or without pacing and in any calls format; the replay's absolute serials then start one higher. - In every capture of the current calls format, with or without deltas read in flight, the wait breaker no longer applies a later memory delta early to release a REWIND, since that delta may have been read in flight. So every capture this recorder writes loses #12567's early REWIND release (`97284fe586`); a capture of the previous format keeps it. A REWIND whose control word only a later delta sets stays blocked until that delta's own call. The first call paced behind it waits out `--pace-timeout-ms`, which releases nothing, and with `--strict` the replay fails. Other waits are still released with an earlier recorded value, or with a value derived from the reference, which #12567's `fence_reuse` needs. - The "pacing gave up" warning lists the waits the queues are blocked on again. `4ef54b694c` in #12567 took that list out to keep the warning's earlier text. This PR puts it back because it shows which wait a stalled replay of the current format is blocked on, such as a REWIND above. The text before it is unchanged. - The JSON line adds `memory_held_wait_s` and `memory_in_flight_wait_s` (both inside `pace_wait_s`), `restore_s`, and `in_flight_max` and `in_flight_mean`: the submissions in flight after each submit's pacing gate, from passes 2 to n with `--repeat n`. - `main`'s `concurrent` test (#11197) now also accepts a memory delta flagged as read in flight: before the copier thread's first call, such a delta can be read while the copies run. **Format version.** Calls format 4 (`aps5-frame-calls 4`, `InFlightCallsVersion`) changes three things against format 3. A call's accepted and completed serials are read when it enters, before its delta. A submission, flip or suspend point appends the serial it took. A delta read in flight carries `InFlightDeltaFlag` and lists, after its group, the serials of the submissions that had started, in place of the parked waits a held delta lists. The replay compares a capture's format with `InFlightCallsVersion` at its checks. Formats 2 (#14137) and 3 (#12568's parked-wait records) keep their replay rules, apart from the empty command buffer described under Replay, and a format 2 or 3 capture that marks a delta read in flight is refused before any restore. Format 1 is still refused. **Outside a capture** these hooks stay on; their cost was not measured: - per packet, one load of the recorder hold; - per draw committer item and finisher job, a hold check and a store-serial scope; - per draw committer item, finisher job and deferred label, a read of the thread's store serial when it is queued, kept with it (the finisher keeps these in a deque beside its jobs, pushed and popped under the lock it already takes); - per submission, a scope, one node inserted into and erased from a set under the lock the worker already holds, and two relaxed loads of the wait-tracking flag; - per completed submission, an erase from one empty map and a lookup in another, under the driver lock it already holds; - per wait packet, one call with a relaxed load; - per title call and deferred label, one scope; - per completion registration, a read of the current serial, and for `OnComplete` and `AfterRecordedWork` with a nonzero serial, one load of the store observer; - per `AfterCompletions` action and per batch finish, one scope; - per reported driver store, one load of the store observer, which is null; - per storage-image mark and write-back, a loop over its units, and per write-back one scope. No new lock is taken. **Docs and debt.** BUILD.md describes the in-flight read, its hold reasons and which unfinished labels satisfy a title wait, the stops, the replay's gate with its CPU-flip rules and the empty first command buffer, and the refusals. The debt file updates [Frame capture deltas] and [Frame replay pacing]. It adds [REWIND waits in frame replays], [Title waits in frame capture deltas], [Unwatched blocks in frame capture deltas], [Stores into frame capture deltas read in flight] and [Serials of frame replay calls]. The [Title waits ...] entry names the stores over a counted label that the rule does not see. The [Stores into ...] entry names the kinds of driver store for which it has not been checked whether they are reported with their writer. One that is not reported at all, and lands in a page of a delta read in flight after the read, is overwritten by the replay's restore. The longest new entry, [Serials ...], has 998 characters. **New tests.** Each is `agc_driver_frame_replay_<mode>` unless named otherwise. There are 44. Capture modes record frames through the driver, then replay them, except the two that say they run no replay. The title's work runs behind a long run of `WRITE_DATA` labels, so that it is still in flight at the title's next call. - `in_flight_delta`: while the busy submission runs, the title stores a page and submits a copy of it. The delta of that call must be flagged as read in flight and counted at depth 1 in `read_depths`. The test takes a suspend point right after the flip that starts the capture; each submission and the suspend point must record the serial after the accepted one, both recorded flips must record the serial they took, and the replay must copy the stored page. - `in_flight_store`: a copy queued behind the busy labels stores into a page that the title then writes and a delta reads in flight. The capture must stop on that page (`stale_delta`), and the replay must refuse it. - `in_flight_gate`: a submission copies X to Y between two runs of labels and writes a label after the copy. The title waits for that label, overwrites X and makes a call. The delta must list the submission as started, and the replay must dump the old X from Y, so a gate that waits for the wrong submission, or for none, fails. - `late_store`: in a one-frame capture, the last copy, behind the busy labels, lands after the last flip in a page of a delta read in flight. The end of the capture must find it (`stale_delta` or `unverified_deltas`), and the replay must refuse the capture. It skips as inconclusive unless the capture recorded its end with the copy still pending, so only the end check can find the store. - `late_wait`: in a one-frame capture, the last submission, accepted after a delta read in flight, waits on a title dword that the title stores only after its last flip returns. The end-of-capture check must still verify that delta (`unverified_deltas` 0), and the replay must accept the capture. - `wait_after_read`, `wait64_after_read`, `rewind_after_read`: a started submission still has to pass a `WAIT_REG_MEM`, `WAIT_REG_MEM_64` or REWIND wait on a title flag when the title writes the copy's source and makes its next call. No delta may be read in flight with that submission listed, `awaits_title` and `title_wait_unpassed` must be counted, and a replay with `--no-release` must copy the title's store. - `wait_labelled_after`, `wait_labelled_before`, `wait_labelled_skipped`, `wait_labelled_elsewhere`: the same, but the flag also gets a label that must not count: behind the wait, ahead of it with a value the wait rejects, ahead of it under a `COND_EXEC` that skips it, or in a compute submission in flight with a value the wait rejects. The delta of the title's next call must still be held and counted as `title_wait_unpassed`. `wait_labelled_after` replays with the default release, since its label rewrites the flag before the next delta reads it. - `wait_labelled_rewind`, `wait_labelled_rewind_chain`: the wait sits in a REWIND tail, and the flag's newest label ahead of it stores a value the wait rejects: in `wait_labelled_rewind` the submission's label before its REWIND, in `wait_labelled_rewind_chain` (wait in the second tail) the first tail's label, which follows the submission's label of an accepted value. The queue's previous submission, which stored the accepted value, keeps its label record until the title's next call has returned. The delta read at that call must count `title_wait_unpassed`, and the strict replay must copy the title's store only after the wait passes. - `semaphore_after_read`: the same with `MEM_SEMAPHORE`, signalled by a second thread once the submission has reached its wait. No delta may be read in flight with that submission listed and `awaits_title` must be counted, but not `title_wait_unpassed`, since the signal may come before that read. The capture must not stop. This mode runs no replay. - `wait_before_read`: the submission has passed its wait on the title's flag but is still running when the title makes its next call. The delta holds the flag's page, so it must be held (`awaits_title`), and the replay must copy the title's store. - `unwatched_in_flight`: an unwatched block that nothing changed and that holds no awaited dword does not hold a delta read with the busy submission in flight: that delta is read in flight, no `unwatched` hold is counted, the block's counters show no change and no driver store, and the replay must restore the page the title wrote. - `unwatched_restored`: the busy submission stores into an unwatched block, and the title writes the recorded bytes back. The call must be recorded with the busy submission in flight, its delta must be held for `unwatched`, and the replay must keep the title's bytes. - `wait_unwatched_reset`: a submission waits on a flag in an unwatched block; the title stores the release value, the submission passes, the title writes the recorded value back and makes its next call while the submission still runs. The block's counters must show no change and no driver store, no delta may be read in flight with that submission listed, `awaits_title` must be counted, and the replay (with release on: no delta holds the release value) must copy the title's store. - `unwatched_rewatched` (registered on Windows only; elsewhere `Rewatch` notes nothing, so a block cannot return to the write watch): an unwatched block is recorded with A, rewatched, stored B and listed, then, with a busy submission running, stored A again and unwatched. The next delta read in flight must hold A at the block; the test skips as inconclusive when that delta was held. - `host_page_restored`: while a submission waits on the title's flag, a shader delta writes a host-range page that the title changed, and the title then writes back the bytes that the full delta before the shader delta recorded. The capture must hold those bytes at the next full delta, made with the submission in flight. It has no timing precondition and no inconclusive skip. This mode runs no replay; it checks the captured chunks. - `hold_diagnostics`: deltas are read while a queue parks on a title gate, a submission queues behind it, and a compute queue parks on a label that a graphics submission writes. Each reason must be counted (`parked`, `queued`, `parked_on_title`, `driver_page` with and without `driver_page_since_full`, `title_wait_unpassed`, `wait_dword_in_delta`), along with the unwatched block counters and the replay's `in_flight_max`. - `flip_serial_start` (in a build without the timing log; it skips in one with it): two CPU flips from a thread without graphics submissions after the driver accepted submissions, so the second takes no serial, then a delta read in flight behind a busy submission. The replay must reproduce the copy and, by the driver's accepted-serial trace (`APS5_TRACE_GPU`), take as many serials for CPU flips as the capture's flips did. - `in_flight_once`: the title stores page x while the busy submission runs and makes a call, whose delta is read in flight; after the driver went idle it stores page y and makes another call. x must be in that in-flight delta's group only and y only in the idle delta read before the call that copies it, with `stale_delta` 0 and `unverified_deltas` 0, and the replay must copy both pages. Pins that a read in flight moves its ranges' marks past what it read. - `held_concurrent_store`: a submission queued behind the busy one holds the delta at the title's call (`queued`); the title stores a watched page w before the call, and a second thread that makes no driver calls stores page z once the title's call waits for the queues to settle (seen through the driver's idle-waiter count). w and z must both be in the held delta's group and z in no later group. Pins the second collect after the settle (commit 3). - `owner_lifetime`: a page read in flight by delta D, then an idle delta that does not list it, then a driver store with no serial into it: the capture must stop with `stale_delta` = D. `owner_lifetime_rewritten`: the title stores the page again before the idle delta, which lists it and frees D's owner, so the same store leaves `stale_delta` 0. Pins the owner release rule; the base mode pins the stricter contract that a store with no serial long after D's work still stops the capture. - `empty_in_flight_read`: every word of the page a delta reads in flight already holds a noted GPU word, so the read writes no bytes; the delta must still be recorded (flagged, no chunk for its group), and a later store into the page by the submission in flight must stop the capture naming that group. The GPU words are noted through the driver's label-store note (`DriverTestAccess::NoteLabelStore`), since no real store sequence reaches this read without a driver page store holding the delta first. - `shader_in_flight`: a shader registration while the busy submission runs, with a page of the shader's 64 KiB block stored before it: its shader delta is read in flight (flagged, with the started submission) and holds the page; a second registration with nothing stored records no memory delta; the next full delta lists the page once more (shader deltas do not move the ranges' marks) and the page beside it, and no other delta holds them. - `last_thread_hold`: a submission whose REWIND tail is released before it is submitted flips the capture's last frame while 20,000 labels behind it still run, and a second thread that has made no recorded call reaches that frame boundary first (its submit calls `RewindTailFlips` before the recorder records it), so `finish()` runs on that thread with work in flight. The last delta must be held (`threads` counted), not read in flight, and the replay must accept the capture. Pins `finish()` counting its own thread (commit 3). Most capture modes skip as inconclusive (exit 77) when the title's work finishes, or reaches its wait, before the title's next call. Without a capture: - `carried_label` (with `APS5_PIPELINED_DRAWS=0`) installs a driver-store observer of its own. A queue-0 label that a submission queued, and that the next, already queued submission stores because the first one's end flush was skipped, must be reported under the serial of the submission that queued it, and the next submission's own label under that submission's serial. - `agc_driver_draw_finisher_overlap` (with `APS5_DRAW_PIPELINE=1`): a thread that hands the draw finisher no work must see, through `DrawPipeline::OverlapsAny`, a write the finisher still holds, and not a range beside it. Replay modes run the replay in-process on synthetic captures: - `gate_failure`: a driver failure reported once a submission parked on an unwritten label, while the gate of a delta read in flight waits for it, must end the gate with that error, and shutdown must rethrow it. - `gate_settled`: the same gate with no failure must end with the "no queue runs" error before its time limit, and must not restore the delta. - `held_drained_release`: a submission parked on a flag that a held delta records as 0, the delta's record showing as many submissions completed as accepted, a submission queued behind the waiter, and a delta read in flight listing that one. The replay must finish; the waiter must copy the source the held delta restored (released after the first apply), the delta must be applied again (`out` 3, flag 0), and `of_them_at_deltas`, `of_them_synthesized` and `park_restores` must each be 1. - `held_parked_no_release`: the same, but the held delta's record shows the waiter in flight, parked on a value the replay never parks on, so only that record keeps the replay from releasing: the gate must end with the "no queue runs" error and restore nothing. - `held_drained_no_release`: the first mode with `--no-release`: the gate must end as before. - `held_shader_no_release`: no release at a delta followed by a shader registration or any of the three ABI resolutions, at one made after a second thread's first call, or in a calls format 3 capture; a release at a delta that ends the window. - `gate_no_frame_start`: a delta read in flight in a capture without a frame start must make the gate throw instead of mapping its started serials by their distance from the accepted one. - `unverified`: a capture of the current calls format without `capture.json` is refused, also one with no delta read in flight. One with a delta read in flight is also refused without `stale_delta` or `unverified_deltas`, with a non-numeric or nonzero `unverified_deltas`, or with a stale delta. A verified one (also one that stopped for low disk space), one without such deltas, and a capture of the previous calls format without `capture.json` are not refused. A capture of the previous calls format with a delta marked as read in flight (`flagged_previous`) is refused. The mode calls the tool's `restoreMemory` directly, which checks each capture and restores the ones it accepts; it replays no calls. - `depth_submits`: the replay samples the in-flight depth at submits only, as `submit_depths` does, not at an EOP flip reservation. - `depth_passes`: with two passes, the depth counters hold only the second pass's samples. - `in_flight_breaker`: a queue parks at a REWIND whose valid bit only a later delta read in flight holds. The replay must release nothing, give up pacing once, and run the tail after that delta's own restore. - `previous_breaker`: the same window from a capture rewritten to the calls format before `InFlightCallsVersion`, with the delta not flagged. The breaker must apply that later delta early to release the REWIND before pacing gives up (5 s), and the tail must run. - `serial_diverged`: before a delta read in flight, each of these must make the replay throw: a submission or a suspend point recorded as taking the second serial after the frame start; a CPU flip recorded as taking the third serial after a submission that took the first (in a build without the timing log); a submission with no recorded serial; a delta read in flight at a serial that no call before it in the window took; one that lists a serial no call since the frame start took; and one after a second thread's first call. The tool's `run()` must refuse, before its restore, a capture whose submission or suspend point before a delta read in flight recorded no serial. A window whose calls took the recorded serials replays. - `serial_flip_in_order` (with `APS5_CPU_FLIP_IN_ORDER=1`): a CPU flip that took no serial in the capture takes one in the replay. The replay must restore the delta read in flight behind it, and only after that flip presented. - `flip_serial_neutral` (in a build without the timing log): a compute submission, a CPU flip recorded as taking the next serial and a graphics submission, where the replay's flip takes none. The delta read in flight behind them must be restored. With the graphics submission parked, the gate must skip the flip's serial and name that submission at the replay serial it took. With the compute submission before the flip parked instead, the gate must wait for it at the replay serial it took, and restore nothing. `serial_diverged`, `flip_serial_start` and `flip_serial_neutral` fail with a message when `APS5_CPU_FLIP_IN_ORDER` or `APS5_SYNC_FLIP` is set or `APS5_DUMP_SUBMITS` is not empty, since a CPU flip would then take a serial. Their CTest registrations set none of these, so only a run that sets one for every test makes them fail. Recorder tests: - `agc_recorder_title_call_closure`: completions registered through `OnComplete`, `AfterCompletions` and `AfterRecordedWork` under the title-call serial must reach the store observer with serial 0, and under submission 141 with 141. - `agc_recorder_storage_writer`: a storage image marked pending under serial 100 (or 0), dropped without a write-back and marked again under 141 must report its write-back under 141. One marked under 141 and again under a title call must report 0. Changed: `main`'s `concurrent` (above), and #12568's `gpu_restore_cached` now also checks the serials each recorded call took. It expects its CPU flip to record 0 only in a build without the timing log, with neither `APS5_CPU_FLIP_IN_ORDER` nor `APS5_SYNC_FLIP` set and `APS5_DUMP_SUBMITS` unset or empty. **Open before ready for review** - Merge order: this PR merges after #12568. - No test fails today when any of these is dropped: the hold terms `late_or_host`, `label`, `snapshot`, `storage`, `shadow` and `queue0` (`agc_driver_draw_finisher_overlap` tests the query behind `queue0`, not the term), the recorder's queue hold, commit 8's hold when the arm finds a newer driver store, and, at this head, the host-page loop's update of the unwatched record (commit 4): `forget` (commit 9) now drops the record first, so a page without the update counts as changed and is listed anyway; the update only lets a later delta read in flight leave an unchanged host page out (no committed test reaches that window; only the local injection `d-t2a` shows it). The recorder's stop when a recorded call moves the driver's accepted serial by anything but one (none or one for a flip) is an invariant check, not an untested behaviour: no input reaches it through the driver's entry points, since every submission, flip and suspend point enters the driver through the recorder, the recorder holds its mutex across each call's accept, and a submission or suspend point moves the accepted serial by exactly one or throws. - Commit 3's subject says a delta is read in flight "when nothing in flight can store into it". A started submission can still store into it, and that stops the capture; reword it. - #13021's native multisample depth publication: attribute it to the draw that wrote the samples, as commit 2 does for storage-image write-backs, with a capture test built on `NativeMultisampleDepth`; until then debt [Stores into frame capture deltas read in flight] names it. A miss needs the HTILE plane to share a 4 KiB page with title data written between the draw's submission and the delta read; the replay then fails at the publication's same-value check rather than replaying wrong bytes. From code reading; not seen on P5R. - Not this PR's, noted for #12568 and `main`: with frame capture on, a command-buffer flip waits in #7978's flip hold while the recorder holds its lock across the call (#12568's design, which commit 7's accepted-serial check also relies on). If the previous flip submission waits after its flip on a queue-0 `MEM_SEMAPHORE` that another thread signals with a later submission, that thread blocks on the lock and the run hangs. The root is that the flip hold does not count a `MEM_SEMAPHORE` wait as a wait on the title, as it does `WAIT_REG_MEM`; without the recorder the same hang needs the signal to come after the title's next flip. From code reading, not reproduced; P5R's captures record calls from one thread. - A nit from the review, not changed yet: a queue-0 label carried past its submission's completion is not an unfinished label for the hold, so such a delta stops the capture instead of being held. - Recapture P5R with this head: the hold-reason mix, the share of deltas read in flight, `stale_delta` and `unverified_deltas` have not been measured at this head (the latest capture, `b18ca951c1` above, carries an earlier push). - Linux: run the new tests on the Linux job, which runs on a push to `main` or a dispatch, not on a pull request. There, `tools/check_skips.py` fails any skip that does not report a device limitation, and the capture modes' inconclusive skips do not. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows 11 26200, AMD Radeon RX 6700 XT (gfx1031), driver 32.0.21045.16010, WinLibs GCC 15.2.0 r7, Release. Each arm is a full build (`cmake --build build`) after `git submodule update --init --recursive`. The focused set is `ctest -R "frame_(replay|capture)|agc_recorder_(title_call_closure|storage_writer|completion_labels)|draw_finisher_overlap|queued_constant_ram_dump|dumped_constant_capture|draw_pipeline_retired_items|agc_recorder_stored_bytes|agc_driver_(present_mode|flip_compute|eop_interrupts)" -V --timeout 120` with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1`. Validation runs add `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` (a local build of the layer), `VK_LOADER_LAYERS_DISABLE=~implicit~` and `VK_LOADER_DEBUG=layer`, so their logs show whether the layer loaded. The focused-set rows below ran at `236795e85c`, the previous push's tree but for one skip message in `late_store`. At this head the frame set passed 103/103 under the layer (0 `VUID-` lines, layer loaded), the gate modes (`gate_failure`, `gate_settled`, `gate_no_frame_start`, `serial_diverged`, `flip_serial_neutral`) and three of the new capture modes passed 3 of 3 runs, and commits 7 to 10 each built and passed `ctest -R "frame_(replay|capture)"` (95, 95, 96 and 103 tests). Rows for earlier heads are in this description's edit history. **Focused set, base and head:** | Commit | Run | Passed | Failed | `VUID-` lines | Layer | |---|---|---|---|---|---| | base `e0df5b76d8` | without the layer | 70/70 | none | – | – | | base `e0df5b76d8` | with the layer | 70/70 | none | 0 | loaded (73 `Inserted device layer "VK_LAYER_KHRONOS_validation"` lines); 0 missing-layer lines | | `236795e85c` | without the layer, run 1 | 113/113 | none | – | – | | `236795e85c` | without the layer, run 2 | 113/113 | none | – | – | | `236795e85c` | without the layer, run 3 | 113/113 | none | – | – | | `236795e85c` | with the layer | 113/113 | none | 0 | loaded (155 `Inserted device layer "VK_LAYER_KHRONOS_validation"` lines); 0 missing-layer lines | - No test skipped in these runs. The seven new modes and `late_store` also passed 3 of 3 runs each at `236795e85c` with `--repeat until-fail:3`, with no skip. - `reservation_error` (#11435's), which timed out at 30 s in all our earlier Windows runs, passes at the base and the head: #14100 is in `main` below `e0df5b76d8`, so a replay error now exits instead of hanging the tool on Windows. **Every commit built at its earlier revisions**, and from commit 3 on passed the frame tests (`ctest -R "frame_(replay|capture)"`, `ANYPS5_REQUIRE_VULKAN=1`). This push is a restack checked at its head only (above); at the previous push (`f99e62f0bb`, on `e0df5b76d8`) commits 7, 8, 9 and 10 built and passed 95/95, 95/95, 96/96 and 103/103. Commits 3 to 6 passed 67/67, 86/86, 87/87 and 89/89 (commits 4 and 5 at `236795e85c`'s series, 3 and 6 on trees identical to them). Commits 1 and 2 were built only. The recorder and draw-pipeline test targets were built at the previous push's head only. **Flakes, not from this PR.** #12568's `rewind_store` and `store_second_wait` restore a delta again once the queue parks as captured; each failed now and then in our runs, on the base as well as the head: in 30 runs each, `rewind_store` failed 0 at the head and 2 at the base ("the replay applied the CPU store before the copy that preceded it"), `store_second_wait` 1 at each ("the replay ran the copy behind the gate's first wait after restoring the CPU store ..."). `rewind_store` also failed once in a validation run of the frame set at `236795e85c`. I will look into them on #12568. **Full suite** not rerun for this push; the last run (at `e4dfa4b069`) and its reruns are in this description's edit history. **Red checks.** Each patch undoes one piece of this PR and must turn the named test red; the other tests its regex matches must pass. `d-t2a` instead injects the store that commit 8 handles. The patched tree is built, the test executables relinked (their copy of the driver checked by hash), then the tests run with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1`. The rows that say `236795e85c` ran there; the others ran on the previous pushes' series on #12568's `da47027017` and `f21b60440d` (`e4dfa4b069` had this push's commits 1 to 8 as trees before the restack; `58d76317c6`, `7c7333675d`, `9cac8e2692` and `0191553a68` are earlier heads of this PR) and were not rerun at this head. | Red patch: what it undoes | Test | Earlier | Last run: the commit named (`236795e85c` is the previous push's tree but for a skip message) | |---|---|---|---| | title-call-closure: a completion a title call registers keeps the title-call serial | `agc_recorder_title_call_closure` | `58d76317c6`: failed | failed | | storage-writer-d1: one writer serial per storage image instead of one per unit | `agc_recorder_storage_writer` | `3366c145f6`, patch fixed by hand: failed 3 of 3 runs | failed | | storage-writer-title-call: a unit a title call marks keeps the title-call serial | `agc_recorder_storage_writer` | `58d76317c6`: failed | failed | | unwatched-restored-l6: a call's serials are read after its delta, not when it enters | `unwatched_restored` | `58d76317c6`: failed | `236795e85c`: failed | | in-flight-store-hazard: no stop on a driver store into a delta read in flight | `in_flight_store` | `58d76317c6`: failed | `236795e85c`: failed | | late-store-end-check: no check at the end of the capture | `late_store` | `58d76317c6`: failed | `236795e85c`: failed | | late-wait-c1: the end check waits for the driver to go idle, not for the deltas' submissions | `late_wait` | `58d76317c6`: failed | `236795e85c` (re-anchored: only `awaitLateStores` changed): failed | | mask-awaits-title: no `awaits_title` hold | `wait_after_read`, `wait64_after_read`, `rewind_after_read`, `wait_before_read`, `semaphore_after_read` | `58d76317c6`: failed, 5/5 | `236795e85c`: failed, 5/5 | | mask-queued: every delta made with work in flight is held as `queued` | `in_flight_delta`, `late_store`, `unwatched_in_flight` | `58d76317c6`: failed, 3/3 | `236795e85c`: failed, 3/3 | | in-flight-gate: no wait for the started submissions | `in_flight_gate` | `58d76317c6`: failed | does not apply; `0191553a68`: failed | | gate-failure-rethrow: `SerialDone` does not rethrow a driver failure | `gate_failure` | `58d76317c6`: failed | failed (the test's form before this push; not rerun on its new form) | | gate-settled-r1: the gate does not end when no queue runs; only its time limit ends it | `gate_settled` | `58d76317c6`: failed | does not apply; `0191553a68`: failed after 20.20 s (the test's form before this push; not rerun on its new form) | | unverified-r3: a capture that stopped early is refused although its end check passed | `unverified` | `58d76317c6`: failed | does not apply; `0191553a68`: failed | | depth-submits-r5: depth is sampled at every paced call, not only at submits | `depth_submits` | `58d76317c6`: failed | failed | | depth-passes-r5b: with `--repeat`, the first pass's depth samples are kept | `depth_passes` | `58d76317c6`: failed | failed | | a-t2-overlap: `OverlapsAny` asks the finisher's producer-only query again | `agc_driver_draw_finisher_overlap` | tree of `ef6a91568d`: failed | failed | | a-t8g, 3 patches: the serial scope of the `OnComplete`, `AfterCompletions` or `AfterRecordedWork` wrap is removed | `agc_recorder_title_call_closure` | tree of `ef6a91568d`: failed, 3/3 | failed, 3/3 | | a-t8h-capture: a deferred label does not take its submission's serial | `carried_label` | tree of `ef6a91568d`: failed | failed | | a-t8h-restore: a deferred label's store does not run under that serial | `carried_label` | tree of `ef6a91568d`: failed | failed | | b-u1-head-driver: the driver's title-wait rule back to the previous push's | the 4 `wait_labelled_*` modes | final code of `9fc6d89504`, before it was committed: failed, 4/4 | failed, 4/4 | | b-wait-labelled-after: a label behind the wait on the waiter's own queue counts | `wait_labelled_after` | same: failed | failed | | b-wait-labelled-before: the value check accepts every value | `wait_labelled_before`, `wait_labelled_elsewhere` | same: failed, 2/2 | failed, 2/2 | | b-wait-labelled-skipped: a label under a `COND_EXEC` counts as fixed at submit | `wait_labelled_skipped` | same: failed | failed | | b-wait-labelled-elsewhere: another queue's label counts whatever its value | `wait_labelled_elsewhere` | same: failed | failed | | c-unlined: no accepted-serial check at the gate | `serial_diverged` | `d6fa1cb409`: failed | does not apply; `0191553a68`: failed | | c-threaded: no second-thread check at the gate | `serial_diverged` | `d6fa1cb409`: failed | does not apply; `0191553a68`: failed | | c-early: no refusal in `run()` before the restore | `serial_diverged` | `d6fa1cb409`: failed | failed | | c-suspendtraced: no serial check of a suspend point | `serial_diverged` | `d6fa1cb409`: failed | failed | | c-suspendkind: the early refusal ignores suspend points | `serial_diverged` | `d6fa1cb409`: failed | failed | | c-inflightbreaker: the breaker may apply a later delta early in a replay of the current calls format | `in_flight_breaker` | tree of `abc85ff056`: failed | failed | | c-prevbreaker: the breaker never applies a later delta early | `previous_breaker` | tree of `abc85ff056`: failed after 5.09 s | failed after 5.09 s | | c-unheadedprev: a capture of the previous format also needs `capture.json` | `unverified` | `d6fa1cb409`: failed | failed | | c-v1branch: the reader's previous-format branch | `unverified`, `previous_breaker` | `d6fa1cb409`: failed, 2/2 | failed, 2/2 | | c-flipzero: the recorder writes 0 for every flip | `in_flight_delta` | `d6fa1cb409`: failed | failed | | c-suspendunaccepted: a suspend point is recorded without its accept | `in_flight_delta` | `d6fa1cb409`: failed | failed | | c-u7env, with `APS5_CPU_FLIP_IN_ORDER=1`: `gpu_restore_cached` always expects a CPU flip without a serial | `gpu_restore_cached` | tree of `abc85ff056`: failed | not rerun | | d-t2a (an injection): the first started submission reports a store into the delta's first page right after the hold check | `in_flight_delta` (the delta must be held, not read in flight) | `7c7333675d` with commit 8's change: failed | `236795e85c`: failed ("the delta read while the busy submission ran was held, not read in flight" is the injected store's hold) | | d-t3red: the host-page loop does not update the unwatched record | `host_page_restored` | `9cac8e2692` with the fix uncommitted: failed | `236795e85c`: passed: commit 9's `forget` now drops the record first (see Open) | | u13-red0: the replay tool back to the previous push's | `flip_serial_start` | `27408f2a32`: the replay refused the capture ("call 5 (flip) took replay serial 1 where the capture's call took none") and the test timed out at 120 s (Known, above); `flip_serial_neutral` and `serial_flip_in_order` failed | not rerun | | u13-red1: no empty command buffer before the first pass | `flip_serial_start` | `27408f2a32`: failed | does not apply; `0191553a68`: failed | | u13-red2: neither CPU-flip case of the serial check | `flip_serial_neutral`, `serial_flip_in_order` | `27408f2a32`: failed, 2/2 | failed, 2/2 | | u13-red3: the replay does not wait for a CPU flip that only it gave a serial to present | `serial_flip_in_order` | `27408f2a32`: failed | failed | | rt-seed: `executeRewindTail` adds no labels ahead of a REWIND tail's waits | `wait_labelled_rewind`, `wait_labelled_rewind_chain` | `36551c543c` (the fix on `4daf1dbd66`, whose driver and tool are `0191553a68`'s): failed, 2/2, in 3 of 3 runs | `3d1e020f44`: failed, 2/2, in 3 of 3 runs | | rt-record-only: a tail's waits see only the labels its submission's record kept, not the earlier tails' | `wait_labelled_rewind_chain` (`wait_labelled_rewind` must pass) | same: failed in 3 of 3 runs, `wait_labelled_rewind` passed | `3d1e020f44`: failed in 3 of 3 runs, `wait_labelled_rewind` passed | | flagged-prev: no refusal of a format 2 or 3 capture that marks a delta read in flight | `unverified` (`flagged_previous`) | new | `1f77916e75`: failed, 1 of 1 ("the replay did not refuse capture flagged_previous ...") | | t5-forget: `forget` keeps the per-page records of unwatched pages | `unwatched_rewatched` | fix round of the previous push (before the in-flight assert): failed | `1f77916e75`: failed, 1 of 1 ("... left out the unwatched block whose bytes the title wrote back ...") | | T1-0: a read in flight does not move its ranges' marks | `in_flight_once` | new | `236795e85c`: failed | | he-0: no second collect after the settle | `held_concurrent_store` | new | `236795e85c`: failed | | he-1: the second collect does not move the marks | `held_concurrent_store` | new | `236795e85c`: failed | | T3-0: any later delta frees a page's store owner | `owner_lifetime` | new | `236795e85c`: failed | | T3-1: no owner is freed by a later settled delta | `owner_lifetime_rewritten` | new | `236795e85c`: failed | | T6-0: a delta read in flight that writes no bytes is not recorded | `empty_in_flight_read` | new | `236795e85c`: failed | | T4-0: a shader delta does not keep its marks | `shader_in_flight` | new | `236795e85c`: failed | | T4-1: a delta that collected nothing still takes the in-flight decision | `shader_in_flight` | new | `236795e85c`: failed | | T5-0: `finish()` does not count its own thread | `last_thread_hold` | new | `236795e85c`: failed | | no-frame-start: the gate maps started serials by distance when the capture has no frame start | `gate_no_frame_start` | new | this push's tree: failed | | u13-red4: the gate maps a started serial by its distance from the accepted one | `flip_serial_neutral`, `serial_diverged` | new | `0191553a68`: failed, 2/2 | Each failure in the table printed the message its test gives for that defect, except u13-red0's `flip_serial_start` (the tool's refusal, then the exit hang) and c-v1branch (the reader's "is not a frame capture file"). With commit 8 reverted as well as injected (`t2b`, on `7c7333675d`), `in_flight_delta` passes: the delta is read in flight and the capture is accepted with `stale_delta` 0, which is the silent case commit 8 closes. 41 of the 43 new tests have a red row at this head or the previous pushes; `hold_diagnostics` has none, and `host_page_restored`'s (d-t3red) no longer turns it red at this head. **Not tested:** - Linux. A WSL2 lavapipe build (kernel 5.15) at `58d76317c6` passed 26 of 63 tests. The 37 frame-capture tests stop at "frame capture: the guest write watch is unavailable", because asynchronous userfaultfd write protection fails there. That is not the CI path, and the pull request build does not run the Linux job. None of this push's new or changed tests has run on Linux. Third-party Linux runs so far cover only the stack, without this PR's code: TechLevelZero ran this PR's base `f21b60440d` merged onto `main` `4f41f4c375` on an NVIDIA RTX 2000 Ada and on an AMD RX 6300 (RADV); both runs passed with 0 new failures and no new validation IDs against `main`. - A `-DAPS5_ENABLE_TIMING_LOG=ON` build of this head. By the code, in such a build `flip_serial_start` skips, `flip_serial_neutral` returns at once, `serial_diverged` leaves out its CPU-flip row, and `gpu_restore_cached` accepts 0 or the next serial for its CPU flip. Such a build of `4daf1dbd66` ran (an earlier push: its driver and tool are `0191553a68`'s, not this head's), and its tests lack the assembled-head review's changes (the `flip_serial_start` guard, `flip_serial_neutral`'s third window and `serial_diverged`'s listed-serial row). There `flip_serial_start` failed 3 of 3 runs ("the first CPU flip after the frame start, from a thread without graphics submissions, took a serial in the capture"), the case its guard now skips, and `serial_diverged`, `serial_flip_in_order`, `flip_serial_neutral`, `gpu_restore_cached` and `in_flight_delta` passed 3 of 3. The same tree built without the timing log passed all six, 3 of 3. The environment side ran: `gpu_restore_cached` passed 3 of 3 runs with `APS5_CPU_FLIP_IN_ORDER=1` on the tree of `abc85ff056`, and failed with its guard forced (the c-u7env row). - An empty `APS5_DUMP_SUBMITS`: Windows removes a variable set to empty, so the empty-is-unset terms rest on code reading. - The draw finisher's store serial (taken in `DrawFinisher::Enqueue`, applied around each job in `DrawFinisher::run`): the finisher runs only with `APS5_DRAW_PIPELINE`, and none of the tests that install a driver-store observer sets it. Without that scope a finisher store reports serial 0. Into a page of a delta read in flight, that stops the capture (`stale_delta`), so a good capture is refused, loudly. Anywhere else it only adds to `unattributed_stores` and, like any reported store, holds later deltas over its page. It cannot make a replay silently wrong. - Branches of the title-wait rule that no test or red row pins: the predicated-packet and `RELEASE_MEM` timestamp terms of a label's fixed value, predicated `INDIRECT_BUFFER` ranges, the newest earlier submission on the waiter's own queue, the pairing of a 64-bit wait's two dwords, `RewindValid` on another queue's label, the `MEM_SEMAPHORE` early return, and the erase of a completed submission's labels. - A P5R capture with this head. The P5R numbers above come from `02132ba69e` and `b18ca951c1`. - Linux for the two REWIND-tail modes, like the rest of this push's tests (above). - The cost outside a capture of the hooks listed above. - Cold times on llvmpipe. On the RX 6700 XT in run 1 of the focused set at `236795e85c` the slowest test took 4.8 s (`rewind_release`) and the seven new modes of this push 2.0-3.1 s each. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions (these commits sit on #12568's `4cd4bc371a`; `git merge-tree` of the head into `main` `6711907d65` is clean) - [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: #12568 at `4cd4bc371a` (merge order: this PR after it) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: AMD Radeon RX 6700 XT (gfx1031), driver 32.0.21045.16010, Windows 11 26200 - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-11-16 19:49:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T19:49:00Z.

Review: COMMENTED


Reviewed — comments

The change is substantial and the inspected replay and capture paths did not establish a blocking defect, but most changed lines and two excluded files were not reviewed, so a formal approval is not justified.

What I ran

Reviewed head 7028c55d7eb09a2acfb8121779ea4d5322209db8 using the prepared review bundle and the pinned repo_read.py reader; no build or tests were run.

Results

Check Result Note
Prepared change bundle passed Description, commits, manifest and diff inspected
Targeted code review not run Only selected capture and replay ranges inspected
Build and tests not run Description reports author-run checks

Findings

Blocking

None identified in the inspected code.

Non-blocking

None.

Not verified

The inspected source ranges were FrameCapture.cpp:260–400 and FrameReplay.cpp:680–745, plus targeted search results in FrameReplay.cpp. The review bundle also included description.md, commits.md, manifest.json, README.md, and the initial and final portions of diff.patch. Other changed source and test lines were not read. Graphics/src/Texture.cpp and tests/Recorder.cpp were excluded from the review folder as too large and were not read through the reader. No test or build results were independently confirmed; the checks in the description are author-reported.

To get this to a good state

Nothing is required. The optional point is to complete review of the remaining changed code, especially the excluded files, before requesting a formal decision.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5926447839 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15136#pullrequestreview-5926447839). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-16T19:49:00Z. **Review:** COMMENTED --- # Reviewed — comments The change is substantial and the inspected replay and capture paths did not establish a blocking defect, but most changed lines and two excluded files were not reviewed, so a formal approval is not justified. ## What I ran Reviewed head `7028c55d7eb09a2acfb8121779ea4d5322209db8` using the prepared review bundle and the pinned `repo_read.py` reader; no build or tests were run. ## Results | Check | Result | Note | |---|---|---| | Prepared change bundle | passed | Description, commits, manifest and diff inspected | | Targeted code review | not run | Only selected capture and replay ranges inspected | | Build and tests | not run | Description reports author-run checks | ## Findings ### Blocking None identified in the inspected code. ### Non-blocking None. ## Not verified The inspected source ranges were `FrameCapture.cpp:260–400` and `FrameReplay.cpp:680–745`, plus targeted search results in `FrameReplay.cpp`. The review bundle also included `description.md`, `commits.md`, `manifest.json`, `README.md`, and the initial and final portions of `diff.patch`. Other changed source and test lines were not read. `Graphics/src/Texture.cpp` and `tests/Recorder.cpp` were excluded from the review folder as too large and were not read through the reader. No test or build results were independently confirmed; the checks in the description are author-reported. ## To get this to a good state Nothing is required. The optional point is to complete review of the remaining changed code, especially the excluded files, before requesting a formal decision.
ligmaSec commented 2026-12-03 22:45:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:45:17Z.

Review: COMMENTED


I trial-merged the exact head onto c1601e56d5. It conflicts in the recorder and replay tools, packet memory, label history, and their tests. Please keep replay coverage for a capture boundary with outstanding work, including a partial store and an unrelated submission, when reconciling the recorded serials. A fully settled capture only exercises the simpler layout. The author’s historical clean merge does not cover this main revision.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6179947321 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15136#pullrequestreview-6179947321). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T22:45:17Z. **Review:** COMMENTED --- I trial-merged the exact head onto `c1601e56d5`. It conflicts in the recorder and replay tools, packet memory, label history, and their tests. Please keep replay coverage for a capture boundary with outstanding work, including a partial store and an unrelated submission, when reconciling the recorded serials. A fully settled capture only exercises the simpler layout. The author’s historical clean merge does not cover this main revision. AI-assisted: yes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/15136:upstream-pr/15136'
git switch 'upstream-pr/15136'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/15136'
git switch 'upstream-pr/15136'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/15136'
git switch 'upstream-pr/15136'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/15136'
git switch 'main'
git merge --squash 'upstream-pr/15136'
git switch 'main'
git merge --ff-only 'upstream-pr/15136'
git switch 'main'
git merge 'upstream-pr/15136'
git push origin 'main'
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!15136
No description provided.