Repository navigation
Conversation
A delta read while a queue is parked held the labels, WRITE_DATA and fills the queue's earlier packets had stored, so the replay saw those values before replaying the work that writes them and released waiting queues early. The driver now reports each word a queue worker stores from a packet (labels, WRITE_DATA, COPY_DATA, DMA_DATA up to 64 KiB, semaphores, constant RAM and sample dumps, and buffer fills by their pattern), and a delta leaves out every word that still holds that value, counted as gpu_store_bytes. A block of a new range that is all zero is skipped only when no such store touched it, so a block the title cleared after a GPU fill is no longer lost. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sample writable ranges without coverage while queues are settled. Reuse unchanged samples only when no GPU submission progressed between idle observations. Cover initial and later coverage loss, shared mappings, and restoring cached values after a GPU fill.
…s views on Windows The fixture block is one committed private allocation, and Windows can't release part of it to make room for the two section views. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in boykopovar#12567's merge of main ce9394b, which landed boykopovar#12566. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # core/libs/prx/libSceAgcDriver/CMakeLists.txt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nges The shader path recorded whole 64 KiB blocks and host pages around a shader pointer even across a gap between recorded ranges, so the replay copied bytes into a page it never mapped and crashed. Trim them to the readable ranges, including ranges committed since the snapshot, and have the replay refuse a snapshot or delta chunk that reaches outside every range of the capture. Co-Authored-By: Claude <noreply@anthropic.com>
…pieces Linux and WebAssembly refuse a commit that starts inside a used range, so committing the two pieces of an allocated block threw on Linux. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/dev/debt/libSceAgcDriver.md
# Conflicts: # core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
Shader deltas skip a host page whose hash has not changed, and full deltas skip an unwatched block whose hash and accepted serial have not changed. The two paths kept separate records of the same bytes and neither learned when the other wrote them, so a skip could leave the replay with bytes the title no longer held. Reverse: a shader delta writes B to a host page, a full delta writes C over it, the title writes B again, and the next shader delta skips the page, so the replayed registration reads C. Idle forward: a full delta records A for a chunk of a writable host range, a shader delta writes B into it, the title restores A, and the next full delta at the same accepted serial skips the chunk, so the replay keeps B. Cross-key: full-delta chunks start at the range's address, while shader deltas cut 64 KiB arena blocks and host pages at the range's edges, so a range that does not start on a 64 KiB boundary records the same bytes under two keys, and a write under one key leaves the other in place. Each block or host page a delta writes now drops every host page hash and unwatched-block hash that overlaps it before recording its own, so the other path's next delta writes those bytes again instead of trusting a hash of an older write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tores # Conflicts: # core/libs/prx/libSceAgcDriver/tests/FrameReplay.cpp # core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_frame_replay_tests.cmake # docs/dev/BUILD.md
…tores # Conflicts: # core/libs/prx/libSceAgcDriver/tests/FrameReplay.cpp # core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_frame_replay_tests.cmake # core/libs/prx/libSceAgcDriver/tools/FrameReplay.cpp
The merge of main collected a delta span one 64 KiB block at a time and kept the smallest returned generation, so the next delta collected again the pages this one had already read. Collect the span in one call, as main does, and add the blocks the tracker does not watch whole. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ture did A memory delta is read once the queues have settled, so its bytes include GPU work that ran up to the waits the queues were parked on. A replay that reaches the delta parked earlier, on a wait the delta's own stores release, ran that GPU work after restoring the delta and overwrote title stores made after it. The recorder now writes the parked wait addresses with each delta; the replay applies the delta, waits until its queues park on the same waits with the same number of submissions in flight, and applies it again without its REWIND control words. Also removes a phrase the last merge of main repeated in BUILD.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep the GPU store test modes and the second driver flush before a delta is written, and collect the delta's blocks after the driver settles. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
store_idle gates a DMA copy on a WAIT_REG_MEM the title releases, and store_idle_rewind puts the copy in the tail of a REWIND the title releases. In both, the title then stores over the copy's target, and the delta that holds the release and the store is read with nothing in flight, so no queue was parked when it was read. store_idle_unwatched unwatches the copy's target, reserves an EOP flip after the store and copies the target in the submission that flips. Replayed without early releases, each must end with the title's store: the replay reaches the delta parked on the gate, and only applying it again once the queues park as captured restores the store the released copy overwrote. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…its gate's second value store_second_wait submits one command buffer that waits for a gate to hold 1, copies into a target, writes a label and waits for the gate to hold 2. The title opens the gate with 1, waits for the label, stores over the target and flips, so the delta before that flip is read while the queue waits for the gate's second value. Replayed without early releases, the queue reaches that delta parked on the gate's first wait, which has the same address, and the replay must still end with the title's store. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The entry still said a CPU store to a page that left the write watch is not recorded until the tracker notes the page again, which the unwatched-block sampling in this change set replaced: each later delta reads such a block whole. What stays open is the cost of that sampling.
rewind_copy stores beside the copy right after submitting it, so the store usually lands before the queue worker imports the copy's destination and leaves the write watch. rewind_copy_held waits until the copy into the stored page is pending, so the store always lands on the unwatched page. Before unwatched ranges were sampled, the delta at the flip missed the store and the replay failed with "no memory delta was read while 1 submissions waited for the CPU" on every run.
…rder The poll in copyInFlightAtDelta read the active recorder's pending writes from the test thread while the draw-commit thread replaced the open batch and the published snapshot under the GPU mutex, so it could read a freed batch.
The GPU store test polled the compute queue's copy target with memcmp while the driver's DMA wrote it, a test-side bulk read racing the copy. The compute buffer now writes a label after its DMA, and the test waits for that label with an acquire load before it compares the target.
The recorder tracked GPU stores word by word and dropped a tracked word whenever a later store overlapped any byte of it. A 2-byte DMA_DATA store over half of a label RELEASE_MEM wrote, or into a word a buffer fill wrote, left the other GPU-written bytes untracked, so the memory delta restored them in the replay before the work that produces them. Each tracked word now carries the bytes a queue worker wrote with a mask of which ones are known. A store merges its bytes into the word, a forget clears only the bytes it covers, and a fill's partly covered boundary words keep their remaining pattern bytes. The delta leaves out each byte that still holds its GPU value and keeps the rest.
…tail A sampled unwatched block merges with an overlapping written block, so a kept unwatched hash can cover more than one capture block. Forgetting the hashes a store overlaps looked back only one capture block, so a store into the tail of a longer key left its hash, and an unchanged later sample of that key would skip the store. The look-back now spans the longest key kept.
Resolves the conflict with main b412486: noteLabelStore takes main's new ordered parameter and still reports the store to the frame recorder first.
…e deltas A fill whose address and size are multiples of 4 but not of 16 was forgotten rather than recorded, and the edge words of a split fill took their pattern word from the address modulo 16. Record every fill of whole words, keep the fill's origin across splits, and index its pattern from that origin. The word and fill bookkeeping moves into FrameRecorder::GpuStores so a unit test can drive a 20-byte fill at an address that is 4- but not 16-aligned.
writeDelta waited up to 10 s for the queues whenever a delta had any readable range, since it collected written blocks only after the wait. Collect written and unwatched blocks first and wait only when a block, an added range or a host page will be read, as main did before unwatched ranges were sampled. A GPU or CPU store that lands after the collection is collected by the next delta, whose generation mark is taken here.
…de the writer lock A delta part whose hash matched an earlier part at the same address and size was confirmed by flushing the memory file, reading the stored payload back and decompressing it under the writer mutex. The writer now keeps the raw bytes of the last part written at each key within a 512 MiB budget and compares a repeat against them with memcmp outside the mutex; only parts that did not fit fall back to the stored read-back. The capture prints the time spent reading unwatched blocks, hashing deltas and comparing repeats, and how many compares read back from the file.
…ookup The shader delta looked up readable ranges by the one that starts at or before a block, keyed by start address. A host page added by the capture prologue can overlap the tail of a readable range, and a range keyed at the same start kept only the larger end, so the bytes of an overlapping range after the found one were missed. Readable ranges are now merged into disjoint spans before the lookup.
FrameCapture.cpp included common/xxhash.h through zstd's include directory, an internal header of another library. An xxhash interface target now names zstd's bundled xxHash directory explicitly, every target that compiles the frame capture links it, and the source includes <xxhash.h> with XXH_INLINE_ALL so no zstd symbols are used.
…estored A title that unmaps a captured range, maps it again at the same address, writes it and then restores the earlier bytes replays each state. The remap never becomes an added range, because captured ranges stay captured and newRanges only adds addresses they do not cover, and every unwatched block of the captured ranges is read again after the added ranges in each delta, so no earlier hash survives the write.
…one back The writer cached the bytes of the first 512 MiB of delta parts and kept only a hash of every later key, so once the budget filled, a repeated part of a new key was compared by flushing the memory file and reading and decompressing the earlier payload under the writer mutex. In a 10-frame GTA V capture 14,383 keys hold 901 MiB, and 92,321 of the 140,832 repeated parts were read back that way. The cache now evicts the least recently used part instead, and a part whose key is not cached is stored again rather than read back. Repeats in that capture come within 1 to 3 deltas, so a 512 MiB LRU cache holds all but 5 of them. Every share is decided by memcmp against bytes held in RAM, outside the lock, so the hash, the read-back path and the xxHash build target are gone. The cost line now reports parts evicted from the cache. Tests replace the forced hash collision with a part that differs in its last byte, and add least-recently-used eviction, a part larger than the cache, the same address at two sizes, and eight threads writing the same keys under eviction. CI-Tests: agc_frame_capture|agc_driver_frame_capture|agc_driver_frame_replay CI-Jobs: linux-gate,windows Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PacketMemory dumpSampleCounters: main's per-block mask (boykopovar#22465) skips unselected dump blocks; this branch still notes each written block as a GPU store.
Main's boykopovar#22028 records CPU stores to pages outside the write watch by comparing each such page with the bytes the delta that last recorded it read (GuestMemory::ChangedComparedPages). This branch did the same job by reading every 64 KiB block without write-watch coverage at every delta and skipping it only when its hash and the accepted serial were unchanged. The compared copy now carries that job alone: it reads only 4 KiB pages whose bytes changed, also while GPU work is in flight, so the per-block Watched sampling and its hash cache (UnwatchedHashes, forget_unwatched_hashes) are gone. From this branch the compared copy takes the ranges it collects: writable sections, aliases, file views and host memory, and pages of write-watched ranges that are outside the watch when the capture starts, are hashed from the snapshot or the late range's first read. A queue worker's packet store into a compared page makes it unknown, so the next delta reads it and leaves out the words the store still holds (gpu_store_restored). A shader delta's host page updates the compared hash too. Overlapping blocks are merged only at aligned edges, as before. section_once now checks that an unchanged section block is recorded once, and shader_hole writes its shader after the capture starts, since a shader already in the snapshot is no longer sampled. The state test modes and BUILD.md take both sides; the duplicate Frame capture debt entries are one, and the entry for pages leaving the write watch is gone with main's fix. A new entry states what the compare cannot see: a title restoring recorded bytes after a write other than a packet store changed them.
…ide the write watch A page outside the write watch is recorded when its bytes differ from the ones the last delta read. A write the driver makes there and a title store that then puts back the recorded bytes left the page equal to its compared copy, so the restore was not recorded and the replay kept the driver's write. Only a queue worker's packet stores made the page unknown, from the recorder's GPU-store notes. Every store the driver notes outside the write watch (StoreOwnBytes, the writes it marks after GPU work, a failed fresh collect) now makes the compared pages it covers unknown, so the next delta reads them. That covers the packet stores too, so the recorder no longer forgets them itself.
The capture filter copies each call unchanged, but its writer always labelled the output calls format 3. A calls format 2 memory delta lists each parked wait by its address alone, so the replay read the filtered capture's wait lists with four values per wait and refused them, and the minimizer could discard a reduction that still reproduced the failure. The writer now takes the calls format it writes, 2 or 3, and the filter passes the source's.
…capture seedUnwatchedPages stepped whole host pages from the range's first byte, so a range that starts inside a page compared only straddling windows and left its pages out of the compared copy. Walk page boundaries and hash a partly covered page as the bytes read over the live page.
emitShaderDelta clipped host pages to the captured ranges and sent a partly covered page down the write-watch path, which never sees a host page and has no compared copy for a range the title cannot write, so a rewrite of shader code there was lost. Hash each clipped host interval the way whole host pages are hashed.
…st make Whether a writer shares a cached part depends on how the threads interleave; three addresses through a two-block cache always evict.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Since the last review: thuanquang's
591073f374(+33 −21, the parked-wait compare below) with its testsf8de2a2bc8and6a2e3c12cc,3ddbd843a0(restorestestParkedRewindReplays, which a merge ofmaindropped) ande264114de4(+2 −3: a duplicate flush inrestoreGroup, and the debt entries for the unwatched fallback). The rest are merges ofmain; the last,e0df5b76d8, mergesdff7484fd1. boykopovar#12567 is merged, so the diff againstmainis this PR's own: 16 files, +788 −64.A delta read while queues are parked (boykopovar#12567) holds what their earlier packets stored: labels,
WRITE_DATA, fills. The replay restores those values before it replays the work that writes them, so a queue waiting on such a label is released before the work ahead of the label runs. On GTA V this showed as garbage V# reads, device loss and magenta frames in about half the replays.The packet paths a queue worker executes report what they store through
FrameRecorder::NoteGpuStore: labels (noteLabelStore),WRITE_DATA,COPY_DATA,DMA_DATA,COND_WRITE, constant RAM dumps,MEM_SEMAPHOREsignals and waits, and sample dumps. Buffer fills report their pattern throughNoteGpuFill. Only a capture in progress records them, word by word, up to 64 KiB per store.A delta leaves out each word that still holds the value the driver stored there, counted as
gpu_store_bytesincapture.json. A word that holds another value is written and its entry retired, so a later title store of the driver's value is kept. This holds on every delta path, including the host pages a shader delta writes whole.A block of a new range that is all zero is skipped only when no recorded store touches it. Before, a block the title cleared after a GPU fill was skipped and the replayed fill survived.
(JJenkx) A delta also samples writable ranges that have no write-watch coverage, such as memory whose watch was lost at a host import, after the queues settle. An unchanged block is skipped only when the GPU was idle with no new submission accepted since its last sample. Before, a CPU store into such memory was never captured, because its write stamp never advanced.
(thuanquang) A shader delta is cut to the capture's readable ranges, so it no longer writes a whole 64 KiB block across a page no range holds, and the replay refuses a delta or snapshot that reaches memory no range maps.
(thuanquang) When a shader delta or a full delta writes bytes, it forgets the other path's hash records of them (
hostPageHashes,unwatchedHashes). Before, each path skipped bytes by a record the other never updated, so a capture could keep code a title had since registered again or restored.(thuanquang) A delta records each
WAIT_REG_MEMits queues were parked on with its address, reference, mask, compare function and size (calls format 3), and the replay compares all of them. Before, it recorded only the address, so a queue parked on the first of two waits on one gate counted as parked as captured while the capture had read the delta during the second, and the work between them overwrote a later CPU store. A REWIND park is recorded by its address only. Readers accept formats 1 to 3; a format 2 capture is compared by address as before.A writable range without write-watch coverage is sampled in every delta after GPU work, so on GTA V's city scene a 3-frame capture recorded its ~474 MiB of writable sections again in each group: 10 deltas, 3.5 GiB, against 103 MiB before the fallback. A delta part whose bytes equal the last part recorded at the same address and size now refers to that payload instead of storing it again (
7d87265d66,87111995ec). The writer compares every byte against its own copy of the earlier part before sharing it. The replay still restores the bytes in every group. Memory files are format 2, and readers accept formats 1 and 2. Overlapping collected blocks are merged before they are read, but only when both have 4-byte-aligned edges, sokeepTitleWordsstill leaves out GPU-stored words.Overlap: boykopovar#12567, which this was stacked on, is merged. The no-coverage fallback is carried here rather than in a separate PR, as agreed with JJenkx (comment): it relies on this PR's GPU-store filtering.
What stays in deltas (GPU copies, larger copies, occlusion counters, CPU-executed
RELEASE_MEMtimestamps, shader stores, render target write-backs) is a new debt entry.Tested
Since
34da67b255:a6a53249baamergesmaina3fecbe3ded.4ee175adf01makesagc_driver_frame_replay_rewind_copy_heldpoll the recorder under the GPU mutex, so its check no longer races the committer.c9ebb0b25d8makesagc_driver_frame_replay_gpu_storewait for a label the compute queue writes after its copy before it compares, instead of polling the copy's target. Both are test-only. Fork CI on lavapipe: run 43928056634. The Linux gate and Windows pass, and the report is clean. TSan fails only tests thatmainitself fails under TSan: the frame replay tests' label polls and bulk copies against test writes,agc_driver_recorder, andagc_graphics_profile_draw(main-only control: run 43906132257).Capture cost on a title (GTA V city scene, RTX 3080, Windows 11). Each build was booted twice and captured 3 frames 35 s after standing still. Base:
main2f8c843691+ boykopovar#14561. This PR:34da67b255+ boykopovar#14561.The snapshot is the same in both (about 12.5k ranges, 4.22 GiB). Frame time outside a capture is unchanged: every recorder path added here runs only while a capture is in progress, and outside one the store hooks cost one relaxed atomic load. The extra delta volume and the roughly 10 s longer stall come from the no-coverage fallback. It reads and hashes about 300 MiB of writable ranges without write-watch coverage at every delta. 71.2% of the delta bytes repeat the last part recorded at the same address and are shared, so only about 400 MiB more reaches the disk. Details: comment.
Since
c161bdbe6c:f51ab73729keeps the most recently used delta parts and drops the read-back path. Fork CI on lavapipe (run 44399609340): Linux 83 of 83, Windows 82 of 83;agc_driver_frame_replay_cold_pipelinesfails on its base too.Memory cost of the delta cache.
FrameCaptureWriterkeeps the raw bytes of the most recently used delta parts, keyed by address and size, so a repeated part is compared withmemcmpagainst RAM outside the writer mutex. The copy uses at mostFrameCaptureWriter::CachedDeltaBytes= 512 MiB, held until the capture ends.delta costsline drops the delta hashing time. It now reads<n> repeated parts compared in <s> s, <n> parts evicted from the delta cache.GTA V, standing, 10 frames, RTX 3080 on PCIe Gen4 x16. Four boots per build in ABBA and BAAB order, all quiet-checked CLEAN. The capture holds 14,383 keys of 901 MiB, and a part repeats 1 to 3 deltas later.
GuestMemory::Watchedcheck and the content hash, and no writer code runs inside it. One more boot per build timed the three parts separately (an untimed diagnostic build): every part was 8 to 17% slower with the change. That includes the content hash, which is pure CPU over bytes just read: guest read 0.52 → 0.61 s,Watched9.96 → 10.79 s, content hash 7.93 → 8.74 s. The same boots showed compare 6.33 → 0.55 s and 92,787 read-backs → none. So the change moves no cost into the read. The recording thread does different work between reads, and the reads run a little slower. The capture is still 6.9 s faster overall.Head
34da67b255is Dean's merge ofmain(4cd4bc371a, onf9dd5dcf5e) plus three commits:258c3a67a5: a shader delta wrote a host page its ranges cover whole straight to the capture, without the GPU-store filtering of every other delta path, so a label the GPU stored beside shader code entered the delta.agc_driver_frame_replay_shader_host_gpu_store(recorder only) registers a shader whose code sits in a host page, writes a label in that page with aWRITE_DATAsubmission (so the driver notes the store itself), rewrites the code and registers it again: the captured code must be the new code and the label must not be the GPU's value. It fails without the change ("the shader delta of a host page carried a label the GPU stored there") and passes with it, on Linux and under WinLibs GCC 15 and Wine.14f9558427: the debt entry for pages that leave the write watch said a store there is not recorded until the tracker notes the page again, which the unwatched-block sampling replaced. It now states the open cost of that sampling.34da67b255:agc_driver_frame_replay_rewind_copy_heldwaits until the copy into the stored page is pending, so the CPU store always lands on the page the copy's import took out of the write watch.Linux (Ubuntu 24.04, lavapipe, Mesa llvmpipe LLVM 20.1.2) on the same two commits before Dean's merge of
main(f9dd5dcf5ebase):ctest -R "agc_driver_frame_replay|agc_frame_capture|agc_driver_frame_capture": 68 of 68 pass (the threeagc_driver_frame_capturetests after rebuilding their test binary, which a build of another branch had left stale). That run had the test's first form, which noted the label store from the test; theWRITE_DATAform in258c3a67a5was run alone, on Linux and under Wine.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layerwith layer 1.4.363.1 andVK_KHRONOS_VALIDATION_VALIDATE_SYNC=1,ctest -R '^agc_(driver_frame_replay(_shader.*|_unwatched.*|_store.*|_gpu.*)?|frame_capture)$' -V: 30 of 30 pass, 34Insert instance layerlines, no missing-layer line, 0VUID-and 0SYNC-HAZARDlines. No sync canary ran, so this is not a synchronization-validation claim.On
34da67b255itself (same tree as the branch its CI ran on), fork CI on lavapipe (run 43726057702): Linux gate (Khronos layer) and Windows (MinGW) each pass 32 of 32 selected tests, with 0VUID-lines and nothing failing that passes on the base.The results below are from the heads named and were not rerun on
34da67b255.Head
cf368d991c: fork CI on lavapipe (run 43541821923): Linux 68 of 68 and the ASan build 68 of 68. Windows (MinGW, lavapipe, Khronos layer) 67 of 68;agc_driver_frame_replay_cold_pipelinesfails on its base too. 0VUID-lines. New tests:section_once(an unchanged multi-mapped section block without write-watch coverage is stored once across groups and replayed; it fails on1243812e74), a forced hash collision, a format 1 memory file, references inside a payload, to another address and past the file, and aligned and unaligned block merges.Head
e0df5b76d8(maindff7484fd1merged in):ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest -R "frame_(replay|capture)" -V: 62 of 62 pass, includingstore_second_waitandagc_driver_frame_replay_rewind_copy. 0VUID-lines in the test log and in the 7 replay subprocess logs; the loader inserted the layer in every run (VK_LOADER_DEBUG=layer: 201Insert instance layerlines) and no log haswas not found but was requested.dff7484fd146 of 46, 0VUID-lines, no missing-layer message.Earlier results, on the commits named:
Windows 11 Pro 26220, WinLibs GCC, Ninja Release, NVIDIA GeForce RTX 3080 (driver 621.01).
New tests. "Before", measured before the series was restacked onto boykopovar#11436, is this branch with
Execution/at its base (boykopovar#12567):agc_driver_frame_replay_gpu_store: a compute queue waits on a label that a graphics queue'sRELEASE_MEMwrites after 256 MiB of fills and a copy, and the CPU stores beside the label. The test checks that the delta holds the CPU store but not the label, and that the replayed compute queue copies only after the graphics copy. Before:the memory delta holds the label the graphics queue's RELEASE_MEM wrote, so the replay releases the compute queue before the graphics queue copies.agc_driver_frame_replay_gpu_cleared: a block is filled before its range is first recorded, then cleared. Before:the replay copied the GPU fill of a block the title cleared before its range was first recorded.agc_driver_frame_replay_gpu_fillchecks that the filtering keeps a title store that writes back the fill value over an earlier store. It passes here before and after, because host imports keep the write watch on this driver. On Linux/RADV the import drops it, and the test failed until the fallback (JJenkx's report).agc_driver_frame_replay_shader_holeand_delta_hole(thuanquang): a shader in a block with an unmapped page records only what the ranges hold, and a capture holding such a delta is refused. WithFrameRecorder.cppandtools/FrameReplay.cppfrom before78c714060eboth fail 3 of 3; on78c714060ethey pass 3 of 3.4a6daa3cbcfixes_shader_holeon Linux, where a commit inside an allocated block is refused, by releasing the reservation first. It changes only that test. Both hole tests pass 3 of 3 on Windows at that commit with the validation layer, 0VUID-lines; The NVIDIA run at that commit on Linux reports 0 new failures; its 2 new validation IDs are the knownVUID-VkDeviceCreateInfo-pNext-pNextreport for the maintenance8 structure.agc_driver_frame_replay_shader_host_rewritten,_shader_host_restoredand_shader_unaligned_restored(thuanquang), recorder only: a host page or unaligned unwatched range written by one delta path and then rewritten or restored is recorded again by the other. WithFrameRecorder.cppfrom2b39d2ac36all three fail in 2 of 2 runs; onf21b60440dthey pass 3 of 3.f21b60440d,a62a6958abmerged withmain4f41f4c375: full build, thenANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest -R "frame_(replay|capture)" -V --timeout 120: 43 of 43 pass, 0VUID-lines in the test log or the replay logs, no missing-layer message. Without the layer 42 of 43;reservation_errortimes out, the exit hang fix(agc): shut the driver down before frame replay exits with an error boykopovar/AnyPS5#14100 fixes.137e2d7876, this branch merged withmain3c3b3cda73, which includes fix(agc): snapshot host shader prologues before frame replay boykopovar/AnyPS5#12871: full build, thenctest -R frame_replay -Vwith the validation layer, 38 of 38 pass, including fix(agc): snapshot host shader prologues before frame replay boykopovar/AnyPS5#12871's threeshader_prologuetests and both hole tests, 0VUID-lines in the test log or the replay logs. The merges ofmainafter it,b3b438c9aeand2b39d2ac36, have not been run here. The results below are from earlier commits, as stated.agc_driver_frame_replay_gpu_restore_cached,_unwatched_start,_unwatched_lateand_unwatched_shared(JJenkx): CPU stores into memory with no write-watch coverage are captured, and an unchanged block isn't skipped across GPU work.7297b72e93makes_unwatched_sharedmap its section views over reset memory on Windows. Before, it threwguest release truncates a host allocationthere.GTA V (PPSA04263, North Yankton prologue), with all four PRs of this series applied: the capture records 3 frames with 13 deltas,
gpu_store_bytes1232. 1 cold-cache replay with--no-synthesizeand 5 normal replays all complete with 0 pace timeouts, 0 released waits and 0 synthesized. This is not a pixel-fidelity claim; replayed frames still differ from the title's.Paired run on
mainand this branch merged into it, same machine and GPU, full builds on both sides with submodules at their pinned commits, host imports on (the default),ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -R "frame_(replay|capture)" -V:mainatbb04a4f1ea: 11 tests, all passed, 0VUID-lines; this branch at7297b72e93merged into it (91292a2062): 35 tests, all passed, 0VUID-lines. Neither log containswas not found but was requested by env var VK_INSTANCE_LAYERS. Afterc184a96481, the same run:mainatce9394b844: 11 tests, all passed, 0VUID-lines; this head merged into it (7627024a73): 35 tests, all passed, 0VUID-lines; no missing-layer message in either log. Onmain4c8cff1916(after boykopovar#12264's write-tracking changes), the same run:main: 11 tests, all passed, 0VUID-lines; this headc184a96481merged into it (ca744e2c66): 35 tests, all passed, 0VUID-lines; no missing-layer message in either log. Capture overhead and delta volume of the fallback on a title are not measured yet.After
8e0d485048(each delta span collected in one call, asmaindoes) and4ef753497f(boykopovar#12567's fix for oneandonlydean's report, cherry-picked). Full builds, thenANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -R "^agc_driver_frame_replay" -V:8649da1e94, the head before them: 53 of 54 pass.agc_driver_frame_replay_oncefails, because the merge ofmaincollected each 64 KiB block separately and the next delta collected the same pages again.8e0d485048alone:agc_driver_frame_replay_rewind_storefails withthe replay applied the CPU store before the copy that preceded it. The re-collection had hidden this.4ef753497f: 54 of 54 pass.8649da1e94and4ef753497f: 0VUID-lines in the test logs or the replay logs, and neither log has the missing-layer message.The earlier runs: Windows 11 26220, RTX 3080, driver 621.01.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Summary by CodeRabbit