perf(agc): reuse address-based draw builds whose inputs are unchanged #6636

Closed
EagleBearerYS wants to merge 23 commits from upstream-pr/6636 into main
EagleBearerYS commented 2026-10-16 00:18:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-16T00:18:42Z.


What

A draw whose shaders reach guest memory through the BDA table (an address-based draw) builds its resources again on every draw: the lease of the registered memory, the upload, the page table and its fault buffer, the descriptor set and the image lookups. #2657 left such draws out of the resource cache because their build could not be kept: its completion checked the faults, marked the pages the shader stored to, wrote the written ranges back and released the lease, once per build.

In Resident Evil Village (PPSA01556) at the menu, most of queue 0's draws are address-based builds (APS5_PROFILE_DRAW=1, [draws] lines per 10 s):

  • on main 6ea62f9b40, with the fixes it needs to reach the menu: 218 of 224 draws, at 29.8 ms each (BDA 29829 (218));
  • on my local tree of main plus open PRs: 867 of 1,392 draws, at 3.8 ms each (BDA 3821 (867)).

The fix. A draw build over the cached address space (#5542) is now kept and reused by a later draw with the same content key, when everything it rests on can be proved again cheaply:

  • the space it was built over is the one a build would take now: the device's, of the current registry generation, with no import retired since;
  • its own regions are imports or read-only image mirrors with unchanged serials, or snapshot copies whose bytes the draw's snapshots repeat in the same order;
  • its images are proved as for any cached build;
  • the read-only buffers and data words the content key leaves out equal the build's. A template hit with other ones rebinds them per draw, which an address-based build can't do.

A reused draw takes the space again and refreshes its mirrors as a build does, and its imports are checked once more after the image proofs. Each draw keeps its own completion: its batch holds the space until then, and the completion checks the faults and marks the written pages and the written ranges served in place. Between draws the build pins no guest allocation, so a guest unmap never waits for the resource cache.

Buffers whose descriptor reaches past their allocation (bae2cd48ec). The two reuse checks of read-only buffers, MovedReadOnlyBuffers and CheckBufferAliases, took each guest buffer descriptor's raw size. A build binds less: past the device's range limit it cuts the size at the registered end, and it trims a stride overhang past the allocation. So a draw with such a descriptor was never reused, and fixing only the moved-buffer check would have made the reused draw fail the alias check. Both checks now use the size the build binds (ShaderResources::GuestBufferBytes, split out of addGuestBuffer without changing what it binds). #7044 (AlxcBTW, merged) added guestBufferBytes for the same size, for its moved compute dispatches. Since the merge of main 55f82fee83 that size has one body: main's, in GuestBufferBytes, which guestBufferBytes forwards to, so builds, both reuse checks and #7044's dispatch check size a buffer the same way. Templates of non-address draws use the same checks, so they get the same fix. This was found by an after-the-fact completeness review, not by a title.

Review follow-ups. The same review found three more gaps, each fixed with its test:

  • A rejected image-table element blocks reuse. The reuse proof doesn't prove an element the build rejected (an unmapped surface, a texture lookup that threw, a full table, failed sampler pairing, or a replayed rejection), so a build with one is no longer reusable. Anything that throws inside the reuse proof refuses the reuse, so the draw builds anew. Such a draw already stopped being reused after its first fault; this closes the window before it.
  • A discarded batch releases its build. Since #5837, a batch whose end or submit fails is discarded without running its completions, so the use a draw took on its build was never released and that build was never reused again. BeginUse now returns a token that releases the use when it is destroyed: at the end of the completion as before, or when the batch is discarded.
  • Snapshots in one order. A decode-cache hit listed the draw's snapshots in stage order, a fresh capture by address, so the first reuse after a decode miss failed SameSnapshots and built again. Both paths now sort them by address, then size.

Recorded GPU writes over a snapshot (6e5b5bdf4b). The reuse proof compared a draw's snapshots with memory right after its in-use check. A write recorded earlier in the batch over a snapshot's range (a fill, a copy, a dispatch storing through a descriptor) that hadn't run yet left memory holding the bytes the capture saw, so the proof passed and the reused draw ran after the write on a program specialized on the old bytes. A draw that builds anew syncs through such writes in the decoder's own validation. The proof now first completes the recorded writes over each snapshot's range (CompleteSnapshotWrites), so such a capture is refused and the draw builds again. Stores through the BDA table aren't recorded as pending writes; a later use reads them in place. This was found by a later review, not by a title.

Profile counters. With APS5_PROFILE_DRAW=1, a [rescache] address-based draws: line follows the [rescache] draws: line every 10 s, in windows that had an address-based proof or an in-use refusal. It gives the proofs, the reuses, the refusals by reason (in use, not reusable, snapshots, the space and why, images or buffers, imports, a proof that threw, moved buffers), the time spent in refused proofs, the host import refusals (budget and held import, and how many came while a reused draw held its space), and the pin-contention waits. The counts are relaxed atomics, and without the profile nothing prints. The use token also carries whether its use was a reuse, so a discarded batch releases that count too. From the test:

[rescache] address-based draws: 2401 proofs, 2401 reused; refused: in use 7999, not reusable 0, snapshots 0, space 0 (state 0, replaced 0, device 0, generation 0, epoch 0, mirrors 0), images or buffers 0, imports 0, threw 0, moved buffers 0; 0.0 ms in refused proofs; host import refusals: budget 0 (0 while a reused draw held its space), held import 0 (0); pin-contention waits 0 (0.0 ms)

What it leaves out (also in the debt file):

  • The fault buffer, which holds the fault and written-page records, belongs to the build. So one draw at a time uses a build: a draw that repeats it before the previous draw's completion ran (two in one batch) builds anew and replaces it in the cache.
  • A build whose draw faulted is not reused, nor one with a rejected image-table element.
  • Two stages that read the same or adjacent words of one page give one merged snapshot on a decode miss and two on a hit, so such a draw still misses its first reuse after a decode miss.
  • Dispatches and draw recipes don't reuse address-based builds.
  • APS5_NO_ADDRESS_DRAW_REUSE=1 builds every one as before.

With the draw pipeline (#1202, on by default). A pipelined direct draw is recorded by the committer in commitDraw, and any other draw inline after lockForDraw; both hold the GPU lock through Graphics::Draw, where the cache lookup, the proofs and BeginUse run. Completions run under the hold that reaps or syncs their batch. So the build's use count and its fault verdict change only under that lock, and pipelining opens no reuse race.

The commits:

  1. refactor(agc): split the cached address space checks out of AcquireRegistered (spaceMiss, stampSpaceImports, refreshSparseMirrors, appendWritableMirrors), so a reuse makes the same proof and refresh as a build. No behaviour change.
  2. perf(agc): the reuse, with its tests.
  3. docs(agc): the debt entry.
  4. fix(agc): buffers whose descriptor reaches past their allocation (above).
  5. fix(agc): refuse address-based reuse after rejections or a throw.
  6. A merge of main 5d9dcc42d2, which brings #5837's discarding of failed batches.
  7. fix(agc): release a draw build's use when its batch is discarded.
  8. fix(agc): order a draw's snapshots the same on decode misses and hits.
  9. perf(agc): count address-based draw reuses and refusals in the draw profile.
  10. fix(agc): complete recorded GPU writes over snapshots before an address reuse proof (above).
  11. A merge of main 55f82fee83, which brings #7044; its guestBufferBytes and this PR's GuestBufferBytes now share one body (above).
  12. A merge of main 2626e5ee7e, which brings #7339's host import construction guard. WaitForLeasesAndImports takes main's signature, without noexcept, and this PR's liveSnapshotCompared stays beside it.
  13. A merge of main 0d078f75d3, which brings #7089's masking of reserved bit 30 in guest buffer descriptors. GuestBufferBytes keeps this PR's signature and takes main's mask.
  14. docs(environment): the APS5_NO_ADDRESS_DRAW_REUSE row in docs/dev/ENVIRONMENT.md, which lists every switch since #6078.
  15. A merge of main 6efb7261b5, which brings #6492's debt entry next to this PR's; both are kept.
  16. A merge of main 6696def6e6, which brings #7650's multisample target guards for cached images and #6646's mirror check. importAllocation takes main's step-down and pinnedBytes, and counts a refusal only where the import is refused. A cached space is reused only when each of its heap and sparse mirrors is still watched or can't be imported now, both when it is acquired and in ResumeSpace, and its imports are stamped once per space, as main does.
  17. test(agc): reused draw builds over a sampled image whose memory became a multisampled target, with watched imports and without the address table (below).

Cost. A reuse makes the proofs above in place of a build. Synthetic draw on lavapipe (200 draws, median of 3): with each draw waited for, the per-draw time drops 57%, 50% and 48% at 512, 6,600 and 10,800 registered ranges (74.3 to 32.2, 197.2 to 99.2, 283.5 to 148.3 us). Back to back, a draw's build is still in flight when the next draw repeats it, so nothing is reused, and the time is within 3% of main's. Resident Evil Village's pair, with and without APS5_NO_ADDRESS_DRAW_REUSE=1, follows in a comment.

Overlap. Conflicts with open PRs are in shared lines, resolved by keeping both sides:

  • #6412 adds a deferred descriptor fault to the same reuse check in ShaderResources.cpp. Merged together, that condition must also keep an address-based build from being reused.
  • #6188: the resource cache lookup in Draw.cpp, where its prepared content key and this PR's in-use check combine.
  • #6628 (native multisample spans left out of BDA tables) merges cleanly with this PR but needs one check when both are in. A reused build keeps the BdaResources table it was built with, and #6628 makes that table depend on its multisample guard generation, which none of this PR's space checks read. Whichever merges second has BdaResources keep the guard generation its table was built or found under and expose TableCurrent(), and has the address-based reuse proof refuse a hit when it returns false, with a test that adds and then clears a guard around a cached address-based draw.
  • #6646 (merged) is carried by the merge of main 6696def6e6: a cached space is reused only when each of its heap and sparse mirrors is still watched or can't be imported now, both when AcquireRegistered finds it current and in ResumeSpace. A mirror whose import is refused doesn't count against the space: its existing refreshes bring that mirror up to date in full.
  • #6682 (publish unit-shadow results before an address-based build maps its heaps) merges cleanly with this PR but needs one call when both are in. #6682 publishes in UploadFinish, which a reused build never runs: it takes its space back through ResumeSpace and proves itself in Revalidate. Whichever merges second publishes the space's unit shadows after proveBuild in Revalidate (a PublishSpaceShadows() call), with a test that reuses a draw over a shadowed heap.
  • The debt file, with #6548, #6273 and #6194.

Tested

  • New agc_driver_address_draw_reuse (tests/execution/AddressDrawReuse.cpp, lavapipe):
    • repeated draws with unchanged inputs build once and read and store the guest value through the BDA table;
    • a guest write into memory the draw reads in place is seen by the next draw without a rebuild;
    • a reused draw that reads an unmapped pointer reports the BDA fault, and a build whose draw faulted doesn't serve the next draw;
    • mapping a range, unmapping a range the draw reads and unmapping another range each force a rebuild.
  • agc_driver_graphics (tests/BdaResources.cpp) additions: SpaceRegions, DirectWrites, SameSnapshots, suspending and resuming the space.
  • agc_driver_address_draw_reuse's OversizedVertexBuffer case (bae2cd48ec) has a vertex buffer descriptor of 64 GiB over a 64 KiB allocation. The draw is drawn, waited for and drawn again, and both draws must store through the BDA table, with the second reusing the first one's build. On GitHub's runners (run), with ShaderResources.cpp and Draw.cpp reverted to ec17620356's, it fails in all 3 runs on Linux ("a draw whose vertex buffer descriptor reaches past its allocation built its resources again"). With them, it and agc_driver_graphics pass 10 runs in a row. On Windows the draw test skips without a Vulkan device and agc_driver_graphics passes.
  • GitHub's runners, on my fork:
    • red on main 44df216321 (only the new test applied): agc_driver_address_draw_reuse fails on Linux (run 38795295627); Windows skips it without a Vulkan device.
    • the head, 20 runs each of the new test and of the tests tied to the files it changes (agc_driver_address_draw_reuse, agc_driver_address_space_teardown, agc_sparse_buffer_holes, agc_compute_descriptor_layout_flags, agc_descriptor_pool_reset_failure and the three alpha-to-coverage and centroid state tests): all pass on Linux and Windows (run); Windows skips the lavapipe one. The libc and libkernel suites pass apart from libc's precise_wait on Linux (a timing test; it passed in the red run) and libkernel's guest_kqueue on Windows, which fails on main on that runner too.
    • ^agc sweeps at the head:
      • Linux: 605 of 607 pass, 42 skip (run). The two failures fail the same way with main's code:
        • agc_driver_mesh_index_cache aborts inside llvmpipe's LLVM ("Cannot emit physreg copy instruction"), also with main's code (run). #6560 now skips it on llvmpipe.
        • agc_driver_preparation_scope_settle fails only under the sweep's parallel load and passes alone.
      • Windows: 600 of 601 pass, 468 skip without a Vulkan device (run). The one failure, agc_driver_pm4_replay_tool (0xc0000139), also fails on main on that runner. main doesn't build in full with MinGW since #5747 (alignas(65536) in a test), so this sweep ran with #6452's fix for that test applied, for this check only.
    • The branch was on main 44df216321; it now merges main 5d9dcc42d2.
  • The review follow-ups, Linux (lavapipe), CI configuration, each red without its fix:
    • agc_driver_graphics's addressRejectedTableElementTests: an address-based draw whose one image-table element points at reserved pages, which the build rejects as unmapped; the pages are then committed with no registry change. Red: "an address-based draw build whose image table element was rejected as unmapped was reused after the element's surface was committed".
    • agc_driver_address_draw_reuse's ThrowingProof: after the build, the sampled image's memory becomes a 4x multisampled color target, so the reuse proof's texture lookup throws. Red, with rejections blocked but no catch: "the reuse proof of an address-based draw build whose sampled image's memory became a multisampled target threw instead of refusing the reuse".
    • agc_driver_graphics's addressFailedSubmissionTests: a build whose batch fails to submit (the mock returns VK_ERROR_OUT_OF_HOST_MEMORY) must not stay in use. Red: "an address-based draw build stayed in use after the batch that took it failed to submit".
    • agc_driver_address_draw_reuse's DecodeCacheHit: a decode miss, a second miss and a decode-cache hit of the same submitted draw build once. Red: "a submitted draw that hit the decode cache built its resources again after a decode miss of the same draw".
    • With all three: both tests pass 10 runs in a row, ^agc passes 607 of 607 (43 skipped), and each commit builds and passes its own tests.
    • On GitHub's runners (run), the reuse tests and the tests tied to the changed files pass 3 runs in a row on Linux (86 tests). On Windows they pass and the GPU tests skip; the run's one failure is libkernel's guest_kqueue, which fails on main on that runner too.
  • The profile counters (Linux, lavapipe):
    • agc_driver_address_draw_reuse's ReuseCounters: four waited draws count 4 proofs and 4 reuses; two draws back to back count one reuse and one "in use" refusal; a rewrite of the pixel program's bytes counts one "snapshots" refusal. GuestWrite, Fault and ThrowingProof check their counts too, and the reused case of addressFailedSubmissionTests checks that a reused use's hold is released when its batch fails to submit.
    • Red with the counting removed: "4 repeated draws with unchanged inputs counted 0 reuses, 0 proofs and 0 refusals"; with the token not releasing the hold: "a reused address-based draw's hold of its space stayed counted after the batch that took it failed to submit"; with a throw left uncounted: "a reuse proof that threw was not counted as one refusal that threw".
    • Both tests pass 10 runs in a row, and ^agc passes 607 of 607 (43 skipped).
    • Cost: in 12 interleaved rounds, with the profile off, the per-draw time moved by +1.6 µs for a reused draw and +9.1 µs back to back, against about 10 µs between two runs of the base.
    • On GitHub's runners (run), agc_driver_address_draw_reuse and agc_driver_graphics with the tests run alongside pass 10 runs in a row on Linux and Windows (the new tests need the counters' API, so they don't build on the previous head). The suites' only failures were libc's precise_wait on Linux, a timing test, and libkernel's guest_kqueue on Windows, which fails on main there too.
  • The snapshot-write sync (6e5b5bdf4b), Linux (lavapipe), CI configuration: agc_driver_address_draw_reuse's PendingSnapshotWrite records a FillBuffer that rewrites the pointer the pixel shader loads and, in the same GPU-lock scope, offers the same draw with its old capture. It must read the new value, count one more snapshots refusal and no reuse, and build once more. Red without the sync: "a draw whose captured snapshot a pending GPU write changed was not refused for a changed snapshot and rebuilt (1 reuses, 0 builds)". With it the test passes 20 runs in a row, and ^agc passes 607 of 607 (43 skipped; a first sweep's one failure was agc_driver_preparation_scope_settle under the sweep's parallel load, which passes 5 of 5 alone). On GitHub's runners (run) the new case fails 2 of 2 runs on Linux at the previous head, and with the sync it and the tests tied to the file pass 10 runs in a row. On Windows (run, with #6452's MinGW fix for an unrelated test applied for this check only), agc_driver_graphics, agc_driver_address_space_teardown and agc_sparse_buffer_holes pass 10 runs and the draw test skips without a Vulkan device. The ^agc sweeps' only failures are agc_driver_preparation_scope_settle on Linux (and, in the first run, agc_frame_dump_io's pipe flake, which main has since fixed in 4b8ccd2e42) and agc_driver_pm4_replay_tool (0xc0000139) on Windows, as before.
  • Multisampled targets with watched imports (fc9c5416fc), after jotitadev's macOS run (review), where ThrowingProof failed with imports watched. The head that run tested, 28433ba132, predates #7650, which refuses that case in proveBuild (RequireNoMultisampleColorTarget) before either proof runs; the merge of 6696def6e6 brings it. Linux (lavapipe), CI's configuration:
    • New agc_driver_address_draw_reuse_watched_imports: the same test with APS5_WRITE_WATCH_IMPORTS=watch, registered on Linux and macOS builds. ThrowingProof also checks a cached build without the address table.
    • Red with #7650's line removed: the new registration fails at the address-based case ("an address-based draw build whose sampled image's memory became a multisampled target was reused"), and agc_driver_address_draw_reuse at the non-address case ("a draw build without the address table whose sampled image's memory became a multisampled target was reused"). With it, each passes 20 runs in a row.
    • ^agc passes 792 of 793 (57 skipped). The one failure, agc_driver_sgpr_pattern_fill_keys, fails under the sweep's parallel load on main too.
    • On GitHub's runners (run), both registrations and the tests tied to the changed files (30) pass 5 runs in a row on Linux. On Windows the new registration isn't built, the draw test skips without a Vulkan device and the other 27 pass. The libc and libkernel suites pass, apart from libc's precise_wait on Linux, a timing test.
  • Merged with main 6696def6e6 (084de35d85), on GitHub's runners (run): the reuse tests and the tests tied to the merged files pass 5 runs in a row on Linux and Windows (Windows skips the lavapipe ones), and the libc and libkernel suites pass.
  • Merged with main 0d078f75d3 and 6efb7261b5 (ff5fe23f8b, then the row 4bacab407a, then ca05f74aec, the head), on GitHub's runners: at 4bacab407a the ^agc tests pass 3 runs in a row on Linux (710, 0 failed), and the libc and libkernel suites pass (run); at ca05f74aec they pass again on Linux (710, 0 failed), as do the suites (run). On Windows the only failures at both are agc_driver_pm4_replay_tool and agc_shader_replay_tool, as in the runs below, and the suites pass.
  • Merged with main 2626e5ee7e (3db18a2b1c), on GitHub's runners (run): the ^agc tests (705, 0 failed), with the reuse tests and #7339's agc_driver_host_import_lifetime and agc_driver_host_import_mutation_race, pass 3 runs in a row on Linux, and the libc and libkernel suites pass. On Windows the only failures are agc_driver_pm4_replay_tool and agc_shader_replay_tool, as in the run below.
  • Merged with main 55f82fee83 (b5d0a2a039), on GitHub's runners (run): the reuse tests and the 14 tests tied to the changed files pass 3 runs in a row on Linux, as do the ^agc tests (682, 0 failed), and the libc and libkernel suites pass. On Windows the only failures are agc_driver_pm4_replay_tool and agc_shader_replay_tool, which fail the same way on that runner for an unrelated branch (run).
  • Resident Evil Village (PPSA01556), Windows 11, NVIDIA GeForce RTX 3070 Laptop GPU (driver 617.42): the [draws] lines above.
  • Onimusha: Way of the Sword (PPSA27836), run by simonbronk on Windows 11 with an NVIDIA GeForce RTX 5070 (driver 617.42) at 3840x2160 (GPU clocks weren't reported): boot to the language menu with no input, warm shader cache, the trace summary over 30 s from 60 s after the first present (APS5_TRACE_SECONDS=60:30). The base is main 84b0d2f24 with #6557, #6727 and #6762, 6 runs (3 before and 3 after this PR's); this PR is merged on top of it, 3 runs (comment):
    • Frame p50: 77.9 to 84.5 ms on the base (mean 82.0); 78.7, 85.6 and 87.6 ms with this PR (mean 84.0). Base p90: 84.3 to 93.6 ms; p90 with this PR wasn't given.

    • No gain in this scene. simonbronk reads it as no measurable change and notes that the menu may not reach the path this PR speeds up.

    • simonbronk's summary lines for his first pair, the first base run (base-r1) and the first run with this PR (pr6636-r1), from his comment. The runs and traces are his:

      {"commit":"5c521efea4cb","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":414,"ms":30052.503},"presents":256,"frame_ms":{"p50":84.478,"p90":93.612,"p99":972.971,"max":1952.003},"gpu_busy_ms_per_present":27.587,"worker_busy_pct":{"queue worker 0x38":1.653,"queue worker 0x20":35.070,"queue worker 0x0":91.809,"queue worker 0x28":64.589},"top_phases_ms_per_frame":{"Driver.Packet":224.620,"Driver.Packet.memory_wait":107.008,"Driver.Packet.draw":63.092,"Driver.Draw":63.071,"Driver.Packet.dispatch":52.429,"Driver.Dispatch":50.815,"Driver.Draw.draw_and_resource_release":48.789,"Graphics.Draw":48.759},"trace_dropped":false,"trace":"aps5-trace-5c521efea4cb-1894532.json.gz"}
      {"commit":"9f86b47f65bc","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":396,"ms":30238.620},"presents":273,"frame_ms":{"p50":78.703,"p90":87.730,"p99":951.593,"max":1017.455},"gpu_busy_ms_per_present":25.760,"worker_busy_pct":{"queue worker 0x38":1.992,"queue worker 0x20":38.049,"queue worker 0x0":97.744,"queue worker 0x28":72.995},"top_phases_ms_per_frame":{"Driver.Packet":231.188,"Driver.Packet.memory_wait":112.370,"Driver.Packet.draw":60.955,"Driver.Draw":60.933,"Driver.Packet.dispatch":55.705,"Driver.Dispatch":54.322,"Driver.Draw.draw_and_resource_release":46.104,"Graphics.Draw":46.074},"trace_dropped":false,"trace":"aps5-trace-9f86b47f65bc-1902128.json.gz"}
      
    • That pair's frame p50 is 84.5 ms without this PR and 78.7 ms with it, but as simonbronk says, it isn't representative: his other runs overlap, so the pair doesn't show a reliable gain. Thanks to simonbronk for the runs and the lines.

  • python3 tools/check_conventions.py --base origin/main: passed.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Related: #2657, #5542, #5465
  • Unblocks: Resident Evil Village (PPSA01556) speed at the menu
  • GPUs tested: lavapipe (GitHub's Linux runner); NVIDIA GeForce RTX 3070 Laptop GPU, driver 617.42, Windows 11, for the title
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4881576139 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-16T00:18:42Z. --- ### What A draw whose shaders reach guest memory through the BDA table (an address-based draw) builds its resources again on every draw: the lease of the registered memory, the upload, the page table and its fault buffer, the descriptor set and the image lookups. #2657 left such draws out of the resource cache because their build could not be kept: its completion checked the faults, marked the pages the shader stored to, wrote the written ranges back and released the lease, once per build. In Resident Evil Village (PPSA01556) at the menu, most of queue 0's draws are address-based builds (`APS5_PROFILE_DRAW=1`, `[draws]` lines per 10 s): - on `main` 6ea62f9b40, with the fixes it needs to reach the menu: 218 of 224 draws, at 29.8 ms each (`BDA 29829 (218)`); - on my local tree of `main` plus open PRs: 867 of 1,392 draws, at 3.8 ms each (`BDA 3821 (867)`). **The fix.** A draw build over the cached address space (#5542) is now kept and reused by a later draw with the same content key, when everything it rests on can be proved again cheaply: - the space it was built over is the one a build would take now: the device's, of the current registry generation, with no import retired since; - its own regions are imports or read-only image mirrors with unchanged serials, or snapshot copies whose bytes the draw's snapshots repeat in the same order; - its images are proved as for any cached build; - the read-only buffers and data words the content key leaves out equal the build's. A template hit with other ones rebinds them per draw, which an address-based build can't do. A reused draw takes the space again and refreshes its mirrors as a build does, and its imports are checked once more after the image proofs. Each draw keeps its own completion: its batch holds the space until then, and the completion checks the faults and marks the written pages and the written ranges served in place. Between draws the build pins no guest allocation, so a guest unmap never waits for the resource cache. **Buffers whose descriptor reaches past their allocation (bae2cd48ec).** The two reuse checks of read-only buffers, `MovedReadOnlyBuffers` and `CheckBufferAliases`, took each guest buffer descriptor's raw size. A build binds less: past the device's range limit it cuts the size at the registered end, and it trims a stride overhang past the allocation. So a draw with such a descriptor was never reused, and fixing only the moved-buffer check would have made the reused draw fail the alias check. Both checks now use the size the build binds (`ShaderResources::GuestBufferBytes`, split out of `addGuestBuffer` without changing what it binds). #7044 (AlxcBTW, merged) added `guestBufferBytes` for the same size, for its moved compute dispatches. Since the merge of `main` 55f82fee83 that size has one body: main's, in `GuestBufferBytes`, which `guestBufferBytes` forwards to, so builds, both reuse checks and #7044's dispatch check size a buffer the same way. Templates of non-address draws use the same checks, so they get the same fix. This was found by an after-the-fact completeness review, not by a title. **Review follow-ups.** The same review found three more gaps, each fixed with its test: - **A rejected image-table element blocks reuse.** The reuse proof doesn't prove an element the build rejected (an unmapped surface, a texture lookup that threw, a full table, failed sampler pairing, or a replayed rejection), so a build with one is no longer reusable. Anything that throws inside the reuse proof refuses the reuse, so the draw builds anew. Such a draw already stopped being reused after its first fault; this closes the window before it. - **A discarded batch releases its build.** Since #5837, a batch whose end or submit fails is discarded without running its completions, so the use a draw took on its build was never released and that build was never reused again. `BeginUse` now returns a token that releases the use when it is destroyed: at the end of the completion as before, or when the batch is discarded. - **Snapshots in one order.** A decode-cache hit listed the draw's snapshots in stage order, a fresh capture by address, so the first reuse after a decode miss failed `SameSnapshots` and built again. Both paths now sort them by address, then size. **Recorded GPU writes over a snapshot (6e5b5bdf4b).** The reuse proof compared a draw's snapshots with memory right after its in-use check. A write recorded earlier in the batch over a snapshot's range (a fill, a copy, a dispatch storing through a descriptor) that hadn't run yet left memory holding the bytes the capture saw, so the proof passed and the reused draw ran after the write on a program specialized on the old bytes. A draw that builds anew syncs through such writes in the decoder's own validation. The proof now first completes the recorded writes over each snapshot's range (`CompleteSnapshotWrites`), so such a capture is refused and the draw builds again. Stores through the BDA table aren't recorded as pending writes; a later use reads them in place. This was found by a later review, not by a title. **Profile counters.** With `APS5_PROFILE_DRAW=1`, a `[rescache] address-based draws:` line follows the `[rescache] draws:` line every 10 s, in windows that had an address-based proof or an in-use refusal. It gives the proofs, the reuses, the refusals by reason (in use, not reusable, snapshots, the space and why, images or buffers, imports, a proof that threw, moved buffers), the time spent in refused proofs, the host import refusals (budget and held import, and how many came while a reused draw held its space), and the pin-contention waits. The counts are relaxed atomics, and without the profile nothing prints. The use token also carries whether its use was a reuse, so a discarded batch releases that count too. From the test: ``` [rescache] address-based draws: 2401 proofs, 2401 reused; refused: in use 7999, not reusable 0, snapshots 0, space 0 (state 0, replaced 0, device 0, generation 0, epoch 0, mirrors 0), images or buffers 0, imports 0, threw 0, moved buffers 0; 0.0 ms in refused proofs; host import refusals: budget 0 (0 while a reused draw held its space), held import 0 (0); pin-contention waits 0 (0.0 ms) ``` **What it leaves out** (also in the debt file): - The fault buffer, which holds the fault and written-page records, belongs to the build. So one draw at a time uses a build: a draw that repeats it before the previous draw's completion ran (two in one batch) builds anew and replaces it in the cache. - A build whose draw faulted is not reused, nor one with a rejected image-table element. - Two stages that read the same or adjacent words of one page give one merged snapshot on a decode miss and two on a hit, so such a draw still misses its first reuse after a decode miss. - Dispatches and draw recipes don't reuse address-based builds. - `APS5_NO_ADDRESS_DRAW_REUSE=1` builds every one as before. **With the draw pipeline (#1202, on by default).** A pipelined direct draw is recorded by the committer in `commitDraw`, and any other draw inline after `lockForDraw`; both hold the GPU lock through `Graphics::Draw`, where the cache lookup, the proofs and `BeginUse` run. Completions run under the hold that reaps or syncs their batch. So the build's use count and its fault verdict change only under that lock, and pipelining opens no reuse race. The commits: 1. `refactor(agc)`: split the cached address space checks out of `AcquireRegistered` (`spaceMiss`, `stampSpaceImports`, `refreshSparseMirrors`, `appendWritableMirrors`), so a reuse makes the same proof and refresh as a build. No behaviour change. 2. `perf(agc)`: the reuse, with its tests. 3. `docs(agc)`: the debt entry. 4. `fix(agc)`: buffers whose descriptor reaches past their allocation (above). 5. `fix(agc)`: refuse address-based reuse after rejections or a throw. 6. A merge of `main` 5d9dcc42d2, which brings #5837's discarding of failed batches. 7. `fix(agc)`: release a draw build's use when its batch is discarded. 8. `fix(agc)`: order a draw's snapshots the same on decode misses and hits. 9. `perf(agc)`: count address-based draw reuses and refusals in the draw profile. 10. `fix(agc)`: complete recorded GPU writes over snapshots before an address reuse proof (above). 11. A merge of `main` 55f82fee83, which brings #7044; its `guestBufferBytes` and this PR's `GuestBufferBytes` now share one body (above). 12. A merge of `main` 2626e5ee7e, which brings #7339's host import construction guard. `WaitForLeasesAndImports` takes `main`'s signature, without `noexcept`, and this PR's `liveSnapshotCompared` stays beside it. 13. A merge of `main` 0d078f75d3, which brings #7089's masking of reserved bit 30 in guest buffer descriptors. `GuestBufferBytes` keeps this PR's signature and takes `main`'s mask. 14. `docs(environment)`: the `APS5_NO_ADDRESS_DRAW_REUSE` row in `docs/dev/ENVIRONMENT.md`, which lists every switch since #6078. 15. A merge of `main` 6efb7261b5, which brings #6492's debt entry next to this PR's; both are kept. 16. A merge of `main` 6696def6e6, which brings #7650's multisample target guards for cached images and #6646's mirror check. `importAllocation` takes `main`'s step-down and `pinnedBytes`, and counts a refusal only where the import is refused. A cached space is reused only when each of its heap and sparse mirrors is still watched or can't be imported now, both when it is acquired and in `ResumeSpace`, and its imports are stamped once per space, as `main` does. 17. `test(agc)`: reused draw builds over a sampled image whose memory became a multisampled target, with watched imports and without the address table (below). **Cost.** A reuse makes the proofs above in place of a build. Synthetic draw on lavapipe (200 draws, median of 3): with each draw waited for, the per-draw time drops 57%, 50% and 48% at 512, 6,600 and 10,800 registered ranges (74.3 to 32.2, 197.2 to 99.2, 283.5 to 148.3 us). Back to back, a draw's build is still in flight when the next draw repeats it, so nothing is reused, and the time is within 3% of `main`'s. Resident Evil Village's pair, with and without `APS5_NO_ADDRESS_DRAW_REUSE=1`, follows in a comment. **Overlap.** Conflicts with open PRs are in shared lines, resolved by keeping both sides: - #6412 adds a deferred descriptor fault to the same reuse check in `ShaderResources.cpp`. Merged together, that condition must also keep an address-based build from being reused. - #6188: the resource cache lookup in `Draw.cpp`, where its prepared content key and this PR's in-use check combine. - #6628 (native multisample spans left out of BDA tables) merges cleanly with this PR but needs one check when both are in. A reused build keeps the `BdaResources` table it was built with, and #6628 makes that table depend on its multisample guard generation, which none of this PR's space checks read. Whichever merges second has `BdaResources` keep the guard generation its table was built or found under and expose `TableCurrent()`, and has the address-based reuse proof refuse a hit when it returns false, with a test that adds and then clears a guard around a cached address-based draw. - #6646 (merged) is carried by the merge of `main` 6696def6e6: a cached space is reused only when each of its heap and sparse mirrors is still watched or can't be imported now, both when `AcquireRegistered` finds it current and in `ResumeSpace`. A mirror whose import is refused doesn't count against the space: its existing refreshes bring that mirror up to date in full. - #6682 (publish unit-shadow results before an address-based build maps its heaps) merges cleanly with this PR but needs one call when both are in. #6682 publishes in `UploadFinish`, which a reused build never runs: it takes its space back through `ResumeSpace` and proves itself in `Revalidate`. Whichever merges second publishes the space's unit shadows after `proveBuild` in `Revalidate` (a `PublishSpaceShadows()` call), with a test that reuses a draw over a shadowed heap. - The debt file, with #6548, #6273 and #6194. ### Tested - New `agc_driver_address_draw_reuse` (`tests/execution/AddressDrawReuse.cpp`, lavapipe): - repeated draws with unchanged inputs build once and read and store the guest value through the BDA table; - a guest write into memory the draw reads in place is seen by the next draw without a rebuild; - a reused draw that reads an unmapped pointer reports the BDA fault, and a build whose draw faulted doesn't serve the next draw; - mapping a range, unmapping a range the draw reads and unmapping another range each force a rebuild. - `agc_driver_graphics` (`tests/BdaResources.cpp`) additions: `SpaceRegions`, `DirectWrites`, `SameSnapshots`, suspending and resuming the space. - `agc_driver_address_draw_reuse`'s `OversizedVertexBuffer` case (bae2cd48ec) has a vertex buffer descriptor of 64 GiB over a 64 KiB allocation. The draw is drawn, waited for and drawn again, and both draws must store through the BDA table, with the second reusing the first one's build. On GitHub's runners ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/38843165327)), with `ShaderResources.cpp` and `Draw.cpp` reverted to ec17620356's, it fails in all 3 runs on Linux ("a draw whose vertex buffer descriptor reaches past its allocation built its resources again"). With them, it and `agc_driver_graphics` pass 10 runs in a row. On Windows the draw test skips without a Vulkan device and `agc_driver_graphics` passes. - GitHub's runners, on my fork: - red on `main` 44df216321 (only the new test applied): `agc_driver_address_draw_reuse` fails on Linux ([run 38795295627](https://github.com/EagleBearerYS/AnyPS5/actions/runs/38795295627)); Windows skips it without a Vulkan device. - the head, 20 runs each of the new test and of the tests tied to the files it changes (`agc_driver_address_draw_reuse`, `agc_driver_address_space_teardown`, `agc_sparse_buffer_holes`, `agc_compute_descriptor_layout_flags`, `agc_descriptor_pool_reset_failure` and the three alpha-to-coverage and centroid state tests): all pass on Linux and Windows ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/38805468797)); Windows skips the lavapipe one. The libc and libkernel suites pass apart from libc's `precise_wait` on Linux (a timing test; it passed in the red run) and libkernel's `guest_kqueue` on Windows, which fails on `main` on that runner too. - `^agc` sweeps at the head: - **Linux:** 605 of 607 pass, 42 skip ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/38805502667)). The two failures fail the same way with `main`'s code: - `agc_driver_mesh_index_cache` aborts inside llvmpipe's LLVM ("Cannot emit physreg copy instruction"), also with `main`'s code ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/38809917364)). #6560 now skips it on llvmpipe. - `agc_driver_preparation_scope_settle` fails only under the sweep's parallel load and passes alone. - **Windows:** 600 of 601 pass, 468 skip without a Vulkan device ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/38809852392)). The one failure, `agc_driver_pm4_replay_tool` (0xc0000139), also fails on `main` on that runner. `main` doesn't build in full with MinGW since #5747 (`alignas(65536)` in a test), so this sweep ran with #6452's fix for that test applied, for this check only. - The branch was on `main` 44df216321; it now merges `main` 5d9dcc42d2. - The review follow-ups, Linux (lavapipe), CI configuration, each red without its fix: - `agc_driver_graphics`'s `addressRejectedTableElementTests`: an address-based draw whose one image-table element points at reserved pages, which the build rejects as unmapped; the pages are then committed with no registry change. Red: "an address-based draw build whose image table element was rejected as unmapped was reused after the element's surface was committed". - `agc_driver_address_draw_reuse`'s `ThrowingProof`: after the build, the sampled image's memory becomes a 4x multisampled color target, so the reuse proof's texture lookup throws. Red, with rejections blocked but no catch: "the reuse proof of an address-based draw build whose sampled image's memory became a multisampled target threw instead of refusing the reuse". - `agc_driver_graphics`'s `addressFailedSubmissionTests`: a build whose batch fails to submit (the mock returns `VK_ERROR_OUT_OF_HOST_MEMORY`) must not stay in use. Red: "an address-based draw build stayed in use after the batch that took it failed to submit". - `agc_driver_address_draw_reuse`'s `DecodeCacheHit`: a decode miss, a second miss and a decode-cache hit of the same submitted draw build once. Red: "a submitted draw that hit the decode cache built its resources again after a decode miss of the same draw". - With all three: both tests pass 10 runs in a row, `^agc` passes 607 of 607 (43 skipped), and each commit builds and passes its own tests. - On GitHub's runners ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/38867096892)), the reuse tests and the tests tied to the changed files pass 3 runs in a row on Linux (86 tests). On Windows they pass and the GPU tests skip; the run's one failure is libkernel's `guest_kqueue`, which fails on `main` on that runner too. - The profile counters (Linux, lavapipe): - `agc_driver_address_draw_reuse`'s `ReuseCounters`: four waited draws count 4 proofs and 4 reuses; two draws back to back count one reuse and one "in use" refusal; a rewrite of the pixel program's bytes counts one "snapshots" refusal. `GuestWrite`, `Fault` and `ThrowingProof` check their counts too, and the reused case of `addressFailedSubmissionTests` checks that a reused use's hold is released when its batch fails to submit. - Red with the counting removed: "4 repeated draws with unchanged inputs counted 0 reuses, 0 proofs and 0 refusals"; with the token not releasing the hold: "a reused address-based draw's hold of its space stayed counted after the batch that took it failed to submit"; with a throw left uncounted: "a reuse proof that threw was not counted as one refusal that threw". - Both tests pass 10 runs in a row, and `^agc` passes 607 of 607 (43 skipped). - Cost: in 12 interleaved rounds, with the profile off, the per-draw time moved by +1.6 µs for a reused draw and +9.1 µs back to back, against about 10 µs between two runs of the base. - On GitHub's runners ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/38885988272)), `agc_driver_address_draw_reuse` and `agc_driver_graphics` with the tests run alongside pass 10 runs in a row on Linux and Windows (the new tests need the counters' API, so they don't build on the previous head). The suites' only failures were libc's `precise_wait` on Linux, a timing test, and libkernel's `guest_kqueue` on Windows, which fails on `main` there too. - The snapshot-write sync (6e5b5bdf4b), Linux (lavapipe), CI configuration: `agc_driver_address_draw_reuse`'s `PendingSnapshotWrite` records a `FillBuffer` that rewrites the pointer the pixel shader loads and, in the same GPU-lock scope, offers the same draw with its old capture. It must read the new value, count one more snapshots refusal and no reuse, and build once more. Red without the sync: "a draw whose captured snapshot a pending GPU write changed was not refused for a changed snapshot and rebuilt (1 reuses, 0 builds)". With it the test passes 20 runs in a row, and `^agc` passes 607 of 607 (43 skipped; a first sweep's one failure was `agc_driver_preparation_scope_settle` under the sweep's parallel load, which passes 5 of 5 alone). On GitHub's runners ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/38976115578)) the new case fails 2 of 2 runs on Linux at the previous head, and with the sync it and the tests tied to the file pass 10 runs in a row. On Windows ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/38980631632), with #6452's MinGW fix for an unrelated test applied for this check only), `agc_driver_graphics`, `agc_driver_address_space_teardown` and `agc_sparse_buffer_holes` pass 10 runs and the draw test skips without a Vulkan device. The `^agc` sweeps' only failures are `agc_driver_preparation_scope_settle` on Linux (and, in the first run, `agc_frame_dump_io`'s pipe flake, which `main` has since fixed in 4b8ccd2e42) and `agc_driver_pm4_replay_tool` (0xc0000139) on Windows, as before. - **Multisampled targets with watched imports** (fc9c5416fc), after jotitadev's macOS run ([review](https://github.com/boykopovar/AnyPS5/pull/6636#pullrequestreview-5566570447)), where `ThrowingProof` failed with imports watched. The head that run tested, 28433ba132, predates #7650, which refuses that case in `proveBuild` (`RequireNoMultisampleColorTarget`) before either proof runs; the merge of 6696def6e6 brings it. Linux (lavapipe), CI's configuration: - New `agc_driver_address_draw_reuse_watched_imports`: the same test with `APS5_WRITE_WATCH_IMPORTS=watch`, registered on Linux and macOS builds. `ThrowingProof` also checks a cached build without the address table. - Red with #7650's line removed: the new registration fails at the address-based case ("an address-based draw build whose sampled image's memory became a multisampled target was reused"), and `agc_driver_address_draw_reuse` at the non-address case ("a draw build without the address table whose sampled image's memory became a multisampled target was reused"). With it, each passes 20 runs in a row. - `^agc` passes 792 of 793 (57 skipped). The one failure, `agc_driver_sgpr_pattern_fill_keys`, fails under the sweep's parallel load on `main` too. - On GitHub's runners ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/39543871880)), both registrations and the tests tied to the changed files (30) pass 5 runs in a row on Linux. On Windows the new registration isn't built, the draw test skips without a Vulkan device and the other 27 pass. The libc and libkernel suites pass, apart from libc's `precise_wait` on Linux, a timing test. - **Merged with `main` 6696def6e6** (084de35d85), on GitHub's runners ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/39541100727)): the reuse tests and the tests tied to the merged files pass 5 runs in a row on Linux and Windows (Windows skips the lavapipe ones), and the libc and libkernel suites pass. - **Merged with `main` 0d078f75d3 and 6efb7261b5** (ff5fe23f8b, then the row 4bacab407a, then ca05f74aec, the head), on GitHub's runners: at 4bacab407a the `^agc` tests pass 3 runs in a row on Linux (710, 0 failed), and the libc and libkernel suites pass ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/39125192914)); at ca05f74aec they pass again on Linux (710, 0 failed), as do the suites ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/39128349206)). On Windows the only failures at both are `agc_driver_pm4_replay_tool` and `agc_shader_replay_tool`, as in the runs below, and the suites pass. - **Merged with `main` 2626e5ee7e** (3db18a2b1c), on GitHub's runners ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/39092319124)): the `^agc` tests (705, 0 failed), with the reuse tests and #7339's `agc_driver_host_import_lifetime` and `agc_driver_host_import_mutation_race`, pass 3 runs in a row on Linux, and the libc and libkernel suites pass. On Windows the only failures are `agc_driver_pm4_replay_tool` and `agc_shader_replay_tool`, as in the run below. - **Merged with `main` 55f82fee83** (b5d0a2a039), on GitHub's runners ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/39077457483)): the reuse tests and the 14 tests tied to the changed files pass 3 runs in a row on Linux, as do the `^agc` tests (682, 0 failed), and the libc and libkernel suites pass. On Windows the only failures are `agc_driver_pm4_replay_tool` and `agc_shader_replay_tool`, which fail the same way on that runner for an unrelated branch ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/39061670036)). - Resident Evil Village (PPSA01556), Windows 11, NVIDIA GeForce RTX 3070 Laptop GPU (driver 617.42): the `[draws]` lines above. - **Onimusha: Way of the Sword (PPSA27836)**, run by simonbronk on Windows 11 with an NVIDIA GeForce RTX 5070 (driver 617.42) at 3840x2160 (GPU clocks weren't reported): boot to the language menu with no input, warm shader cache, the trace summary over 30 s from 60 s after the first present (`APS5_TRACE_SECONDS=60:30`). The base is `main` 84b0d2f24 with #6557, #6727 and #6762, 6 runs (3 before and 3 after this PR's); this PR is merged on top of it, 3 runs ([comment](https://github.com/boykopovar/AnyPS5/pull/6636#issuecomment-6241965906)): - Frame p50: 77.9 to 84.5 ms on the base (mean 82.0); 78.7, 85.6 and 87.6 ms with this PR (mean 84.0). Base p90: 84.3 to 93.6 ms; p90 with this PR wasn't given. - No gain in this scene. simonbronk reads it as no measurable change and notes that the menu may not reach the path this PR speeds up. - simonbronk's summary lines for his first pair, the first base run (`base-r1`) and the first run with this PR (`pr6636-r1`), from [his comment](https://github.com/boykopovar/AnyPS5/pull/6636#issuecomment-6255412303). The runs and traces are his: ```jsonl {"commit":"5c521efea4cb","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":414,"ms":30052.503},"presents":256,"frame_ms":{"p50":84.478,"p90":93.612,"p99":972.971,"max":1952.003},"gpu_busy_ms_per_present":27.587,"worker_busy_pct":{"queue worker 0x38":1.653,"queue worker 0x20":35.070,"queue worker 0x0":91.809,"queue worker 0x28":64.589},"top_phases_ms_per_frame":{"Driver.Packet":224.620,"Driver.Packet.memory_wait":107.008,"Driver.Packet.draw":63.092,"Driver.Draw":63.071,"Driver.Packet.dispatch":52.429,"Driver.Dispatch":50.815,"Driver.Draw.draw_and_resource_release":48.789,"Graphics.Draw":48.759},"trace_dropped":false,"trace":"aps5-trace-5c521efea4cb-1894532.json.gz"} {"commit":"9f86b47f65bc","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":396,"ms":30238.620},"presents":273,"frame_ms":{"p50":78.703,"p90":87.730,"p99":951.593,"max":1017.455},"gpu_busy_ms_per_present":25.760,"worker_busy_pct":{"queue worker 0x38":1.992,"queue worker 0x20":38.049,"queue worker 0x0":97.744,"queue worker 0x28":72.995},"top_phases_ms_per_frame":{"Driver.Packet":231.188,"Driver.Packet.memory_wait":112.370,"Driver.Packet.draw":60.955,"Driver.Draw":60.933,"Driver.Packet.dispatch":55.705,"Driver.Dispatch":54.322,"Driver.Draw.draw_and_resource_release":46.104,"Graphics.Draw":46.074},"trace_dropped":false,"trace":"aps5-trace-9f86b47f65bc-1902128.json.gz"} ``` - That pair's frame p50 is 84.5 ms without this PR and 78.7 ms with it, but as simonbronk says, it isn't representative: his other runs overlap, so the pair doesn't show a reliable gain. Thanks to simonbronk for the runs and the lines. - `python3 tools/check_conventions.py --base origin/main`: passed. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Related: #2657, #5542, #5465 - [x] Unblocks: Resident Evil Village (PPSA01556) speed at the menu - [x] GPUs tested: lavapipe (GitHub's Linux runner); NVIDIA GeForce RTX 3070 Laptop GPU, driver 617.42, Windows 11, for the title - [x] AI-assisted: yes
MarcZX10 commented 2026-10-16 00:26:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T00:26:48Z.

Code review location: core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp; line 2828

@@ -2806,7 +2817,28 @@ const ShaderRecompiler::DescriptorBinding* ShaderResources::tableImages(std::spa
     return nullptr;
 }
 
-bool ShaderResources::Revalidate(std::span<const CompiledShader> shaders, ProofReport* report) {
+bool ShaderResources::Revalidate(std::span<const CompiledShader> shaders, ProofReport* report, std::span<const GuestMemorySnapshot> snapshots) {
+    if (!addressReuse) return proveBuild(shaders, report);
+    if (report != nullptr) *report = {ProofPath::Full, ProofFailure::Other};
+    if (!reusable || InUse() || !guestMemory.SameSnapshots(snapshots)) return false;
+    struct Suspend {
+        GuestBufferMemory& memory;
+        bool armed = true;
+        ~Suspend() {
+            if (armed) memory.SuspendSpace();

Integration question for #6628: this reuse path appears to preserve the BdaResources object created with the original ShaderResources build. ShaderResources constructs bda once (ShaderResources.cpp:1918), while this Revalidate resumes/proves the address space but does not recreate the BDA page table. The #6628 fix filters native-MSAA spans when BdaResources is built and keys that table to the MSAA guard generation. If a reusable address-based draw is built before a native MSAA guard is added, could a later cache hit retain the old table with that guarded span? It may need to record/check the guard generation during reuse (and rebuild/reject on change), with a test that adds/removes a guard around a cached draw. I have not tested this integration; please correct me if another proof already invalidates the template.

<!-- greyfinch-sync:boykopovar/AnyPS5:review-comment:4289632301 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#discussion_r4289632301). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T00:26:48Z. **Code review location:** `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`; line 2828 ~~~~diff @@ -2806,7 +2817,28 @@ const ShaderRecompiler::DescriptorBinding* ShaderResources::tableImages(std::spa return nullptr; } -bool ShaderResources::Revalidate(std::span<const CompiledShader> shaders, ProofReport* report) { +bool ShaderResources::Revalidate(std::span<const CompiledShader> shaders, ProofReport* report, std::span<const GuestMemorySnapshot> snapshots) { + if (!addressReuse) return proveBuild(shaders, report); + if (report != nullptr) *report = {ProofPath::Full, ProofFailure::Other}; + if (!reusable || InUse() || !guestMemory.SameSnapshots(snapshots)) return false; + struct Suspend { + GuestBufferMemory& memory; + bool armed = true; + ~Suspend() { + if (armed) memory.SuspendSpace(); ~~~~ --- Integration question for #6628: this reuse path appears to preserve the `BdaResources` object created with the original `ShaderResources` build. `ShaderResources` constructs `bda` once (`ShaderResources.cpp:1918`), while this `Revalidate` resumes/proves the address space but does not recreate the BDA page table. The #6628 fix filters native-MSAA spans when `BdaResources` is built and keys that table to the MSAA guard generation. If a reusable address-based draw is built before a native MSAA guard is added, could a later cache hit retain the old table with that guarded span? It may need to record/check the guard generation during reuse (and rebuild/reject on change), with a test that adds/removes a guard around a cached draw. I have not tested this integration; please correct me if another proof already invalidates the template.
EagleBearerYS commented 2026-10-16 00:30:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-16T00:30:12Z.

Code review location: core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp; line 2828

@@ -2806,7 +2817,28 @@ const ShaderRecompiler::DescriptorBinding* ShaderResources::tableImages(std::spa
     return nullptr;
 }
 
-bool ShaderResources::Revalidate(std::span<const CompiledShader> shaders, ProofReport* report) {
+bool ShaderResources::Revalidate(std::span<const CompiledShader> shaders, ProofReport* report, std::span<const GuestMemorySnapshot> snapshots) {
+    if (!addressReuse) return proveBuild(shaders, report);
+    if (report != nullptr) *report = {ProofPath::Full, ProofFailure::Other};
+    if (!reusable || InUse() || !guestMemory.SameSnapshots(snapshots)) return false;
+    struct Suspend {
+        GuestBufferMemory& memory;
+        bool armed = true;
+        ~Suspend() {
+            if (armed) memory.SuspendSpace();

Yes, that's a real gap for the two together, and you've read the reuse path right. Revalidate resumes the space and proves the images and imports, but it keeps the BdaResources table from the build (ShaderResources.cpp:1918), and nothing on that path reads your guard generation: spaceMiss checks the device, the registry generation and the import epoch, and adding a native MSAA guard changes none of them. On main alone the table depends only on the address space, which those checks cover, so the gap only opens once both PRs are in.

Neither PR can close it alone, since MultisampleTargetRangeGeneration() exists only in #6628 and the reuse path only here. Whichever merges second can: record the generation the build's table was made under, and have Revalidate return false, so the draw builds anew, when MultisampleTargetRangeGeneration() has moved since. The generation also moves when an owner is cleared, so that covers a span coming back too. The test would build a cached address-based draw, add a native MSAA guard over one of its ranges, and require the next draw to rebuild with that span left out, then rebuild again once the owner is cleared. I've added this to the overlap list here, and if this PR merges second I'll add the check and the test to it.

<!-- greyfinch-sync:boykopovar/AnyPS5:review-comment:4289650061 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#discussion_r4289650061). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-16T00:30:12Z. **Code review location:** `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`; line 2828 ~~~~diff @@ -2806,7 +2817,28 @@ const ShaderRecompiler::DescriptorBinding* ShaderResources::tableImages(std::spa return nullptr; } -bool ShaderResources::Revalidate(std::span<const CompiledShader> shaders, ProofReport* report) { +bool ShaderResources::Revalidate(std::span<const CompiledShader> shaders, ProofReport* report, std::span<const GuestMemorySnapshot> snapshots) { + if (!addressReuse) return proveBuild(shaders, report); + if (report != nullptr) *report = {ProofPath::Full, ProofFailure::Other}; + if (!reusable || InUse() || !guestMemory.SameSnapshots(snapshots)) return false; + struct Suspend { + GuestBufferMemory& memory; + bool armed = true; + ~Suspend() { + if (armed) memory.SuspendSpace(); ~~~~ --- Yes, that's a real gap for the two together, and you've read the reuse path right. `Revalidate` resumes the space and proves the images and imports, but it keeps the `BdaResources` table from the build (`ShaderResources.cpp:1918`), and nothing on that path reads your guard generation: `spaceMiss` checks the device, the registry generation and the import epoch, and adding a native MSAA guard changes none of them. On `main` alone the table depends only on the address space, which those checks cover, so the gap only opens once both PRs are in. Neither PR can close it alone, since `MultisampleTargetRangeGeneration()` exists only in #6628 and the reuse path only here. Whichever merges second can: record the generation the build's table was made under, and have `Revalidate` return false, so the draw builds anew, when `MultisampleTargetRangeGeneration()` has moved since. The generation also moves when an owner is cleared, so that covers a span coming back too. The test would build a cached address-based draw, add a native MSAA guard over one of its ranges, and require the next draw to rebuild with that span left out, then rebuild again once the owner is cleared. I've added this to the overlap list here, and if this PR merges second I'll add the check and the test to it.
MarcZX10 commented 2026-10-16 00:30:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T00:30:33Z.

Code review location: core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp; line 2828

@@ -2806,7 +2817,28 @@ const ShaderRecompiler::DescriptorBinding* ShaderResources::tableImages(std::spa
     return nullptr;
 }
 
-bool ShaderResources::Revalidate(std::span<const CompiledShader> shaders, ProofReport* report) {
+bool ShaderResources::Revalidate(std::span<const CompiledShader> shaders, ProofReport* report, std::span<const GuestMemorySnapshot> snapshots) {
+    if (!addressReuse) return proveBuild(shaders, report);
+    if (report != nullptr) *report = {ProofPath::Full, ProofFailure::Other};
+    if (!reusable || InUse() || !guestMemory.SameSnapshots(snapshots)) return false;
+    struct Suspend {
+        GuestBufferMemory& memory;
+        bool armed = true;
+        ~Suspend() {
+            if (armed) memory.SuspendSpace();

Thanks, that confirms the interaction and clarifies ownership. The guard generation needs to be part of the reuse proof when both changes are present, and checking it in whichever PR merges second avoids duplicating the integration in #6628. I have no further question on this path.

<!-- greyfinch-sync:boykopovar/AnyPS5:review-comment:4289651714 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#discussion_r4289651714). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T00:30:33Z. **Code review location:** `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`; line 2828 ~~~~diff @@ -2806,7 +2817,28 @@ const ShaderRecompiler::DescriptorBinding* ShaderResources::tableImages(std::spa return nullptr; } -bool ShaderResources::Revalidate(std::span<const CompiledShader> shaders, ProofReport* report) { +bool ShaderResources::Revalidate(std::span<const CompiledShader> shaders, ProofReport* report, std::span<const GuestMemorySnapshot> snapshots) { + if (!addressReuse) return proveBuild(shaders, report); + if (report != nullptr) *report = {ProofPath::Full, ProofFailure::Other}; + if (!reusable || InUse() || !guestMemory.SameSnapshots(snapshots)) return false; + struct Suspend { + GuestBufferMemory& memory; + bool armed = true; + ~Suspend() { + if (armed) memory.SuspendSpace(); ~~~~ --- Thanks, that confirms the interaction and clarifies ownership. The guard generation needs to be part of the reuse proof when both changes are present, and checking it in whichever PR merges second avoids duplicating the integration in #6628. I have no further question on this path.
MarcZX10 commented 2026-10-16 00:44:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T00:44:31Z.

Code review location: core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp; line 2828

@@ -2806,7 +2817,28 @@ const ShaderRecompiler::DescriptorBinding* ShaderResources::tableImages(std::spa
     return nullptr;
 }
 
-bool ShaderResources::Revalidate(std::span<const CompiledShader> shaders, ProofReport* report) {
+bool ShaderResources::Revalidate(std::span<const CompiledShader> shaders, ProofReport* report, std::span<const GuestMemorySnapshot> snapshots) {
+    if (!addressReuse) return proveBuild(shaders, report);
+    if (report != nullptr) *report = {ProofPath::Full, ProofFailure::Other};
+    if (!reusable || InUse() || !guestMemory.SameSnapshots(snapshots)) return false;
+    struct Suspend {
+        GuestBufferMemory& memory;
+        bool armed = true;
+        ~Suspend() {
+            if (armed) memory.SuspendSpace();

Thanks for confirming the interaction. #6628 now keys cached tables by (address-space serial, MSAA guard generation) and filters the table on a cache miss after the guard generation changes. This closes stale reuse inside BdaResources, but I agree the reusable draw template can retain the ShaderResources object and bypass that constructor entirely. Could Revalidate compare the generation captured by the template against MultisampleTargetRangeGeneration() and rebuild on mismatch, with the add/remove guard test you described? Since #6628 is still open, this seems the appropriate integration point if the two PRs land in this order.

<!-- greyfinch-sync:boykopovar/AnyPS5:review-comment:4289725124 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#discussion_r4289725124). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T00:44:31Z. **Code review location:** `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`; line 2828 ~~~~diff @@ -2806,7 +2817,28 @@ const ShaderRecompiler::DescriptorBinding* ShaderResources::tableImages(std::spa return nullptr; } -bool ShaderResources::Revalidate(std::span<const CompiledShader> shaders, ProofReport* report) { +bool ShaderResources::Revalidate(std::span<const CompiledShader> shaders, ProofReport* report, std::span<const GuestMemorySnapshot> snapshots) { + if (!addressReuse) return proveBuild(shaders, report); + if (report != nullptr) *report = {ProofPath::Full, ProofFailure::Other}; + if (!reusable || InUse() || !guestMemory.SameSnapshots(snapshots)) return false; + struct Suspend { + GuestBufferMemory& memory; + bool armed = true; + ~Suspend() { + if (armed) memory.SuspendSpace(); ~~~~ --- Thanks for confirming the interaction. #6628 now keys cached tables by `(address-space serial, MSAA guard generation)` and filters the table on a cache miss after the guard generation changes. This closes stale reuse inside `BdaResources`, but I agree the reusable draw template can retain the `ShaderResources` object and bypass that constructor entirely. Could `Revalidate` compare the generation captured by the template against `MultisampleTargetRangeGeneration()` and rebuild on mismatch, with the add/remove guard test you described? Since #6628 is still open, this seems the appropriate integration point if the two PRs land in this order.
EagleBearerYS commented 2026-10-16 00:48:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-16T00:48:00Z.

Code review location: core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp; line 2828

@@ -2806,7 +2817,28 @@ const ShaderRecompiler::DescriptorBinding* ShaderResources::tableImages(std::spa
     return nullptr;
 }
 
-bool ShaderResources::Revalidate(std::span<const CompiledShader> shaders, ProofReport* report) {
+bool ShaderResources::Revalidate(std::span<const CompiledShader> shaders, ProofReport* report, std::span<const GuestMemorySnapshot> snapshots) {
+    if (!addressReuse) return proveBuild(shaders, report);
+    if (report != nullptr) *report = {ProofPath::Full, ProofFailure::Other};
+    if (!reusable || InUse() || !guestMemory.SameSnapshots(snapshots)) return false;
+    struct Suspend {
+        GuestBufferMemory& memory;
+        bool armed = true;
+        ~Suspend() {
+            if (armed) memory.SuspendSpace();

Yes. If #6628 lands first, this PR adds it: BdaResources keeps the guard generation its table was built or found under, and the address-based reuse proof in Revalidate refuses the hit when that differs from MultisampleTargetRangeGeneration(), so the draw builds anew. The add-then-clear guard test comes with it. If this PR lands first, the same check fits in #6628, and I can send the code.

<!-- greyfinch-sync:boykopovar/AnyPS5:review-comment:4289754783 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#discussion_r4289754783). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-16T00:48:00Z. **Code review location:** `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`; line 2828 ~~~~diff @@ -2806,7 +2817,28 @@ const ShaderRecompiler::DescriptorBinding* ShaderResources::tableImages(std::spa return nullptr; } -bool ShaderResources::Revalidate(std::span<const CompiledShader> shaders, ProofReport* report) { +bool ShaderResources::Revalidate(std::span<const CompiledShader> shaders, ProofReport* report, std::span<const GuestMemorySnapshot> snapshots) { + if (!addressReuse) return proveBuild(shaders, report); + if (report != nullptr) *report = {ProofPath::Full, ProofFailure::Other}; + if (!reusable || InUse() || !guestMemory.SameSnapshots(snapshots)) return false; + struct Suspend { + GuestBufferMemory& memory; + bool armed = true; + ~Suspend() { + if (armed) memory.SuspendSpace(); ~~~~ --- Yes. If #6628 lands first, this PR adds it: `BdaResources` keeps the guard generation its table was built or found under, and the address-based reuse proof in `Revalidate` refuses the hit when that differs from `MultisampleTargetRangeGeneration()`, so the draw builds anew. The add-then-clear guard test comes with it. If this PR lands first, the same check fits in #6628, and I can send the code.
github-actions[bot] commented 2026-10-16 00:59:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T00:59:49Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6804 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp L488, L625-626
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp L2497-2499
PR 7261 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp L2497, L2502-2503, L2520-2521
PR 7647 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp L493

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1191 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 1896 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/debt/libSceAgcDriver.md
PR 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4072 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 4448 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
docs/dev/debt/libSceAgcDriver.md
PR 4449 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/debt/libSceAgcDriver.md
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5372 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
docs/dev/debt/libSceAgcDriver.md
PR 5404 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
PR 5431 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
docs/dev/ENVIRONMENT.md
PR 5441 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 5609 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 6187 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6194 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 6202 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6209 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6223 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6235 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6501 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6539 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6548 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6549 docs/dev/debt/libSceAgcDriver.md
PR 6628 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6788 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6867 docs/dev/debt/libSceAgcDriver.md
PR 6868 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 6879 docs/dev/ENVIRONMENT.md
PR 6887 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 6918 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 6924 docs/dev/ENVIRONMENT.md
PR 6946 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
docs/dev/debt/libSceAgcDriver.md
PR 6947 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
docs/dev/debt/libSceAgcDriver.md
PR 6965 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 6973 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 6977 docs/dev/debt/libSceAgcDriver.md
PR 6987 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 6989 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 6995 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 7002 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7048 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7275 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 7449 docs/dev/debt/libSceAgcDriver.md
PR 7484 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 7505 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 7514 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7604 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
docs/dev/debt/libSceAgcDriver.md
PR 7689 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7800 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7803 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7883 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7893 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7910 docs/dev/debt/libSceAgcDriver.md
PR 8004 docs/dev/ENVIRONMENT.md
PR 8014 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 8077 docs/dev/ENVIRONMENT.md
PR 8105 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 8212 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 8339 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
PR 8484 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 8538 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 8552 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8564 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 8592 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 8992 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 9020 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9077 docs/dev/debt/libSceAgcDriver.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6205594743 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#issuecomment-6205594743). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-16T00:59:49Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6804](https://www.github.com/boykopovar/AnyPS5/pull/6804) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp` [L488](https://github.com/boykopovar/AnyPS5/blob/2f161d4f33f82bca2cc113cbd9432adf1dc0ec1e/core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp#L488), [L625-626](https://github.com/boykopovar/AnyPS5/blob/2f161d4f33f82bca2cc113cbd9432adf1dc0ec1e/core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp#L625-L626)<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` [L2497-2499](https://github.com/boykopovar/AnyPS5/blob/2f161d4f33f82bca2cc113cbd9432adf1dc0ec1e/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L2497-L2499) | | | | [PR 7261](https://www.github.com/boykopovar/AnyPS5/pull/7261) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` [L2497](https://github.com/boykopovar/AnyPS5/blob/2f161d4f33f82bca2cc113cbd9432adf1dc0ec1e/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L2497), [L2502-2503](https://github.com/boykopovar/AnyPS5/blob/2f161d4f33f82bca2cc113cbd9432adf1dc0ec1e/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L2502-L2503), [L2520-2521](https://github.com/boykopovar/AnyPS5/blob/2f161d4f33f82bca2cc113cbd9432adf1dc0ec1e/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L2520-L2521) | | | | [PR 7647](https://www.github.com/boykopovar/AnyPS5/pull/7647) | `core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp` [L493](https://github.com/boykopovar/AnyPS5/blob/2f161d4f33f82bca2cc113cbd9432adf1dc0ec1e/core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp#L493) | | | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 1191](https://www.github.com/boykopovar/AnyPS5/pull/1191) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 1368](https://www.github.com/boykopovar/AnyPS5/pull/1368) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 1896](https://www.github.com/boykopovar/AnyPS5/pull/1896) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp` | | [PR 2434](https://www.github.com/boykopovar/AnyPS5/pull/2434) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 4040](https://www.github.com/boykopovar/AnyPS5/pull/4040) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 4072](https://www.github.com/boykopovar/AnyPS5/pull/4072) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 4449](https://www.github.com/boykopovar/AnyPS5/pull/4449) | `core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp` | | [PR 5058](https://www.github.com/boykopovar/AnyPS5/pull/5058) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 5371](https://www.github.com/boykopovar/AnyPS5/pull/5371) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5372](https://www.github.com/boykopovar/AnyPS5/pull/5372) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 5404](https://www.github.com/boykopovar/AnyPS5/pull/5404) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp` | | [PR 5431](https://www.github.com/boykopovar/AnyPS5/pull/5431) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`docs/dev/ENVIRONMENT.md` | | [PR 5441](https://www.github.com/boykopovar/AnyPS5/pull/5441) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 5609](https://www.github.com/boykopovar/AnyPS5/pull/5609) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6186](https://www.github.com/boykopovar/AnyPS5/pull/6186) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`docs/dev/ENVIRONMENT.md` | | [PR 6187](https://www.github.com/boykopovar/AnyPS5/pull/6187) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 6192](https://www.github.com/boykopovar/AnyPS5/pull/6192) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6194](https://www.github.com/boykopovar/AnyPS5/pull/6194) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6197](https://www.github.com/boykopovar/AnyPS5/pull/6197) | `core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp` | | [PR 6202](https://www.github.com/boykopovar/AnyPS5/pull/6202) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6209](https://www.github.com/boykopovar/AnyPS5/pull/6209) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6223](https://www.github.com/boykopovar/AnyPS5/pull/6223) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6235](https://www.github.com/boykopovar/AnyPS5/pull/6235) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6280](https://www.github.com/boykopovar/AnyPS5/pull/6280) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6300](https://www.github.com/boykopovar/AnyPS5/pull/6300) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6412](https://www.github.com/boykopovar/AnyPS5/pull/6412) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6481](https://www.github.com/boykopovar/AnyPS5/pull/6481) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6501](https://www.github.com/boykopovar/AnyPS5/pull/6501) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6539](https://www.github.com/boykopovar/AnyPS5/pull/6539) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 6548](https://www.github.com/boykopovar/AnyPS5/pull/6548) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6549](https://www.github.com/boykopovar/AnyPS5/pull/6549) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6628](https://www.github.com/boykopovar/AnyPS5/pull/6628) | `core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp` | | [PR 6747](https://www.github.com/boykopovar/AnyPS5/pull/6747) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6788](https://www.github.com/boykopovar/AnyPS5/pull/6788) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6808](https://www.github.com/boykopovar/AnyPS5/pull/6808) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6867](https://www.github.com/boykopovar/AnyPS5/pull/6867) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6868](https://www.github.com/boykopovar/AnyPS5/pull/6868) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6879](https://www.github.com/boykopovar/AnyPS5/pull/6879) | `docs/dev/ENVIRONMENT.md` | | [PR 6887](https://www.github.com/boykopovar/AnyPS5/pull/6887) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6918](https://www.github.com/boykopovar/AnyPS5/pull/6918) | `core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp` | | [PR 6924](https://www.github.com/boykopovar/AnyPS5/pull/6924) | `docs/dev/ENVIRONMENT.md` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`docs/dev/ENVIRONMENT.md`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`docs/dev/ENVIRONMENT.md`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6965](https://www.github.com/boykopovar/AnyPS5/pull/6965) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6973](https://www.github.com/boykopovar/AnyPS5/pull/6973) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 6987](https://www.github.com/boykopovar/AnyPS5/pull/6987) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6989](https://www.github.com/boykopovar/AnyPS5/pull/6989) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 6995](https://www.github.com/boykopovar/AnyPS5/pull/6995) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 7002](https://www.github.com/boykopovar/AnyPS5/pull/7002) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 7048](https://www.github.com/boykopovar/AnyPS5/pull/7048) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp` | | [PR 7256](https://www.github.com/boykopovar/AnyPS5/pull/7256) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 7275](https://www.github.com/boykopovar/AnyPS5/pull/7275) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 7449](https://www.github.com/boykopovar/AnyPS5/pull/7449) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 7484](https://www.github.com/boykopovar/AnyPS5/pull/7484) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`docs/dev/ENVIRONMENT.md` | | [PR 7505](https://www.github.com/boykopovar/AnyPS5/pull/7505) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 7514](https://www.github.com/boykopovar/AnyPS5/pull/7514) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp` | | [PR 7604](https://www.github.com/boykopovar/AnyPS5/pull/7604) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`docs/dev/ENVIRONMENT.md`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 7689](https://www.github.com/boykopovar/AnyPS5/pull/7689) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 7800](https://www.github.com/boykopovar/AnyPS5/pull/7800) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 7803](https://www.github.com/boykopovar/AnyPS5/pull/7803) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 7883](https://www.github.com/boykopovar/AnyPS5/pull/7883) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 7893](https://www.github.com/boykopovar/AnyPS5/pull/7893) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 7910](https://www.github.com/boykopovar/AnyPS5/pull/7910) | `docs/dev/debt/libSceAgcDriver.md` | | [PR 8004](https://www.github.com/boykopovar/AnyPS5/pull/8004) | `docs/dev/ENVIRONMENT.md` | | [PR 8014](https://www.github.com/boykopovar/AnyPS5/pull/8014) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 8077](https://www.github.com/boykopovar/AnyPS5/pull/8077) | `docs/dev/ENVIRONMENT.md` | | [PR 8105](https://www.github.com/boykopovar/AnyPS5/pull/8105) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 8212](https://www.github.com/boykopovar/AnyPS5/pull/8212) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 8339](https://www.github.com/boykopovar/AnyPS5/pull/8339) | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp` | | [PR 8484](https://www.github.com/boykopovar/AnyPS5/pull/8484) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`docs/dev/ENVIRONMENT.md` | | [PR 8538](https://www.github.com/boykopovar/AnyPS5/pull/8538) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 8552](https://www.github.com/boykopovar/AnyPS5/pull/8552) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 8564](https://www.github.com/boykopovar/AnyPS5/pull/8564) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 8592](https://www.github.com/boykopovar/AnyPS5/pull/8592) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 8992](https://www.github.com/boykopovar/AnyPS5/pull/8992) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 9020](https://www.github.com/boykopovar/AnyPS5/pull/9020) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`<br>`docs/dev/debt/libSceAgcDriver.md` | | [PR 9077](https://www.github.com/boykopovar/AnyPS5/pull/9077) | `docs/dev/debt/libSceAgcDriver.md` |
johnmaia commented 2026-10-16 02:47:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by johnmaia on 2026-10-16T02:47:59Z.


In-game run of head ec1762035: Epic Mickey: Rebrushed (PPSA15657, UE 4.27), short runs to the first level with APS5_PROFILE_DRAW=1. Linux, RX 7600 (RADV, Mesa 25.2.8). Tree: main 5d9dcc42d + #6236 (to get past PlayGo) + this head.

No new failures. No driver failure, Require or device loss in any of the 14 runs, with or without APS5_NO_ADDRESS_DRAW_REUSE=1.

Speed: no measurable difference in this title. It has about 240 address-based draws per 10 s in the level. Means of the last four [draws] lines of each run that reached the level:

Run Reuse Draws per 10 s BDA us per draw (count) build us per draw (count)
reuse_2 on 27,385 1,091 (239) 309 (1,586)
reuse_3 on 21,245 935 (200) 264 (4,978)
reuse_5 on 20,071 799 (283) 283 (5,018)
reuse_7 on 23,348 959 (250) 276 (5,708)
reuse_1 on 25,212 4,420 (230) 343 (6,382)
reuse_4 on 23,376 10,246 (305) 269 (5,406)
noreuse_6 off 24,175 1,026 (245) 288 (5,914)

Only one run with reuse off reached the level, so this is one comparison point. Most runs with reuse on sit at 0.8 to 1.1 ms per address-based draw, the same as that run; two runs averaged 4.4 and 10.2 ms. The PR doesn't log how many builds it reuses, so I can't tell how often reuse happens here. A [address] count of reuses would make that visible.

Crash rate at level load. This title has an intermittent crash on main while it loads the level (UE "Serial size mismatch": a 64 KiB block of file data the title just read is zeroed about 18 ms later, with no CPU write path of the driver involved; about 2 in 5 runs on main). On this tree:

Setting Crashed before the level
reuse on (default) 1 / 7
APS5_NO_ADDRESS_DRAW_REUSE=1 6 / 7

So reuse doesn't cause it; it makes it rarer. The PR isn't the fix, but this suggests the per-draw build, lease and completion of address-based draws on main are involved. I'm following that up separately.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6206905584 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#issuecomment-6206905584). Originally posted by [johnmaia](https://github.com/johnmaia) on 2026-10-16T02:47:59Z. --- In-game run of head ec1762035: Epic Mickey: Rebrushed (PPSA15657, UE 4.27), short runs to the first level with `APS5_PROFILE_DRAW=1`. Linux, RX 7600 (RADV, Mesa 25.2.8). Tree: `main` 5d9dcc42d + #6236 (to get past PlayGo) + this head. **No new failures.** No driver failure, `Require` or device loss in any of the 14 runs, with or without `APS5_NO_ADDRESS_DRAW_REUSE=1`. **Speed: no measurable difference in this title.** It has about 240 address-based draws per 10 s in the level. Means of the last four `[draws]` lines of each run that reached the level: | Run | Reuse | Draws per 10 s | `BDA` us per draw (count) | `build` us per draw (count) | |---|---|---|---|---| | reuse_2 | on | 27,385 | 1,091 (239) | 309 (1,586) | | reuse_3 | on | 21,245 | 935 (200) | 264 (4,978) | | reuse_5 | on | 20,071 | 799 (283) | 283 (5,018) | | reuse_7 | on | 23,348 | 959 (250) | 276 (5,708) | | reuse_1 | on | 25,212 | 4,420 (230) | 343 (6,382) | | reuse_4 | on | 23,376 | 10,246 (305) | 269 (5,406) | | noreuse_6 | off | 24,175 | 1,026 (245) | 288 (5,914) | Only one run with reuse off reached the level, so this is one comparison point. Most runs with reuse on sit at 0.8 to 1.1 ms per address-based draw, the same as that run; two runs averaged 4.4 and 10.2 ms. The PR doesn't log how many builds it reuses, so I can't tell how often reuse happens here. A `[address]` count of reuses would make that visible. **Crash rate at level load.** This title has an intermittent crash on `main` while it loads the level (UE "Serial size mismatch": a 64 KiB block of file data the title just read is zeroed about 18 ms later, with no CPU write path of the driver involved; about 2 in 5 runs on `main`). On this tree: | Setting | Crashed before the level | |---|---| | reuse on (default) | 1 / 7 | | `APS5_NO_ADDRESS_DRAW_REUSE=1` | 6 / 7 | So reuse doesn't cause it; it makes it rarer. The PR isn't the fix, but this suggests the per-draw build, lease and completion of address-based draws on `main` are involved. I'm following that up separately. AI-assisted: yes (Claude Code)
EagleBearerYS commented 2026-10-16 02:51:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-16T02:51:36Z.


Thanks for the runs and the tables. You're right that nothing counts reuses yet. I'm adding a count of reuses, and of refused reuses by reason, to the draw profile output, which should also show whether the two slow runs (4.4 and 10.2 ms per address-based draw) went into refused proofs. Thanks as well for the crash counts with reuse on and off. I'll post the counts from Resident Evil Village (PPSA01556) here once the commit is in.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6206945792 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#issuecomment-6206945792). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-16T02:51:36Z. --- Thanks for the runs and the tables. You're right that nothing counts reuses yet. I'm adding a count of reuses, and of refused reuses by reason, to the draw profile output, which should also show whether the two slow runs (4.4 and 10.2 ms per address-based draw) went into refused proofs. Thanks as well for the crash counts with reuse on and off. I'll post the counts from Resident Evil Village (PPSA01556) here once the commit is in.
EagleBearerYS commented 2026-10-16 02:52:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-16T02:52:21Z.


On the level-load crash: a 64 KiB block zeroed shortly after the title read it matches a known gap listed in docs/dev/debt/libSceAgcDriver.md. Pending storage-image results are stored when something next reads their memory, not when the GPU work that wrote them completes, so memory a title waits for, frees and reuses can be overwritten by a late store. If a run that crashes still crashes with APS5_STORE_AT_LABEL=1 (or APS5_STORE_AT_FLIP=1), it's something else; if it stops, it points there.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6206954122 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#issuecomment-6206954122). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-16T02:52:21Z. --- On the level-load crash: a 64 KiB block zeroed shortly after the title read it matches a known gap listed in `docs/dev/debt/libSceAgcDriver.md`. Pending storage-image results are stored when something next reads their memory, not when the GPU work that wrote them completes, so memory a title waits for, frees and reuses can be overwritten by a late store. If a run that crashes still crashes with `APS5_STORE_AT_LABEL=1` (or `APS5_STORE_AT_FLIP=1`), it's something else; if it stops, it points there.
johnmaia commented 2026-10-16 17:33:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by johnmaia on 2026-10-16T17:33:32Z.


@EagleBearerYS thanks, APS5_STORE_AT_FLIP=1 stops it. Epic Mickey: Rebrushed (PPSA15657), short runs to the first level, Linux, RX 7600 (RADV, Mesa 25.2.8). Tree: main 5d9dcc42d + #6236 (e088fd874), no other changes.

Runs Failed before reaching the level
APS5_STORE_AT_FLIP=1 16 (8, then 8 alternated with the runs below) 0
Unset, alternated 8 3

The three failures without it:

  • ObjectSerializationError on SM_MachineSet_01b, the same mesh as before (the "Serial size mismatch" crash).
  • LowLevelFatalError [Line: 1609] right after the title opens /savedata0/ue4savegame.dpx.sav.
  • A SIGSEGV in the title's own code.

Earlier runs of the same tree without the variable failed 2 of 5. With the flag, all 16 runs reached the level and played to the end of the run. APS5_STORE_AT_LABEL=1 couldn't be compared: with it the level load doesn't finish ("GameThread timed out waiting for RenderThread after 120.00 secs", 2 of 2).

So it points at the late store in docs/dev/debt/libSceAgcDriver.md (#1970). One detail that may matter for a fix: in an earlier trace, the crashing pair's APR read landed on a 64 KiB block that had a storage image write-back about 50 ms before. When that read started, its destination was in neither the published pending-write snapshot nor Recorder::PendingWriteOverlaps, so a flush on the read path that relies on them would not catch it.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6221124027 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#issuecomment-6221124027). Originally posted by [johnmaia](https://github.com/johnmaia) on 2026-10-16T17:33:32Z. --- @EagleBearerYS thanks, `APS5_STORE_AT_FLIP=1` stops it. Epic Mickey: Rebrushed (PPSA15657), short runs to the first level, Linux, RX 7600 (RADV, Mesa 25.2.8). Tree: `main` 5d9dcc42d + #6236 (e088fd874), no other changes. | | Runs | Failed before reaching the level | |---|---|---| | `APS5_STORE_AT_FLIP=1` | 16 (8, then 8 alternated with the runs below) | 0 | | Unset, alternated | 8 | 3 | The three failures without it: - `ObjectSerializationError` on `SM_MachineSet_01b`, the same mesh as before (the "Serial size mismatch" crash). - `LowLevelFatalError [Line: 1609]` right after the title opens `/savedata0/ue4savegame.dpx.sav`. - A SIGSEGV in the title's own code. Earlier runs of the same tree without the variable failed 2 of 5. With the flag, all 16 runs reached the level and played to the end of the run. `APS5_STORE_AT_LABEL=1` couldn't be compared: with it the level load doesn't finish ("GameThread timed out waiting for RenderThread after 120.00 secs", 2 of 2). So it points at the late store in `docs/dev/debt/libSceAgcDriver.md` (#1970). One detail that may matter for a fix: in an earlier trace, the crashing pair's APR read landed on a 64 KiB block that had a storage image write-back about 50 ms before. When that read started, its destination was in neither the published pending-write snapshot nor `Recorder::PendingWriteOverlaps`, so a flush on the read path that relies on them would not catch it. AI-assisted: yes (Claude Code)
EagleBearerYS commented 2026-10-16 17:39:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-16T17:39:40Z.


@johnmaia thank you for the alternated runs. 0 of 16 with APS5_STORE_AT_FLIP=1 against 3 of 8 without, on a tree without this PR, puts the Epic Mickey: Rebrushed (PPSA15657) level-load crash on main's late storage-image store (the debt entry in docs/dev/debt/libSceAgcDriver.md), not on this PR. Your detail that the APR read's destination was in neither the published pending-write snapshot nor Recorder::PendingWriteOverlaps matters for a fix on the read path, and I've passed it on with your numbers. The reuse counter you asked for is in (the [rescache] address-based draws: line, commit 9); the Resident Evil Village (PPSA01556) counts follow when I have a slot on the PC.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6221227374 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#issuecomment-6221227374). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-16T17:39:40Z. --- @johnmaia thank you for the alternated runs. 0 of 16 with `APS5_STORE_AT_FLIP=1` against 3 of 8 without, on a tree without this PR, puts the Epic Mickey: Rebrushed (PPSA15657) level-load crash on `main`'s late storage-image store (the debt entry in `docs/dev/debt/libSceAgcDriver.md`), not on this PR. Your detail that the APR read's destination was in neither the published pending-write snapshot nor `Recorder::PendingWriteOverlaps` matters for a fix on the read path, and I've passed it on with your numbers. The reuse counter you asked for is in (the `[rescache] address-based draws:` line, commit 9); the Resident Evil Village (PPSA01556) counts follow when I have a slot on the PC.
EagleBearerYS commented 2026-10-16 18:26:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-16T18:26:57Z.


@johnmaia Thanks for the A/B. It pinned this down. A storage image's write-back is recorded on the GPU and can land after a later APR read into the same memory, which zeroes the file data. Host writes into guest memory also didn't wait for GPU writes pending there. A fix is on EagleBearerYS:fix/agc-host-write-pending-storage (99af947b18, on main 66e290f1c0). Could you try it on Epic Mickey: Rebrushed the same way as before: runs without APS5_STORE_AT_FLIP, alternated? If this was their cause, the ObjectSerializationError on SM_MachineSet_01b, the LowLevelFatalError [Line: 1609] after the save opens, and the SIGSEGV should no longer appear. With APS5_TRACE_APR=1 APS5_TRACE_FLUSH=1, an APR read over pending results is now followed at once by a [flush] image … line, before the read's bytes land. If a run still fails, the [apr] read line nearest the failure would help.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6222078457 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#issuecomment-6222078457). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-16T18:26:57Z. --- @johnmaia Thanks for the A/B. It pinned this down. A storage image's write-back is recorded on the GPU and can land after a later APR read into the same memory, which zeroes the file data. Host writes into guest memory also didn't wait for GPU writes pending there. A fix is on `EagleBearerYS:fix/agc-host-write-pending-storage` (99af947b18, on main 66e290f1c0). Could you try it on Epic Mickey: Rebrushed the same way as before: runs without `APS5_STORE_AT_FLIP`, alternated? If this was their cause, the `ObjectSerializationError` on `SM_MachineSet_01b`, the `LowLevelFatalError [Line: 1609]` after the save opens, and the SIGSEGV should no longer appear. With `APS5_TRACE_APR=1 APS5_TRACE_FLUSH=1`, an APR read over pending results is now followed at once by a `[flush] image …` line, before the read's bytes land. If a run still fails, the `[apr] read` line nearest the failure would help.
parl0v commented 2026-10-16 19:52:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-16T19:52:50Z.


Data point: RTX 3060 12 GB (NVIDIA 617.42), i5-12400F, Windows 10 19045, MinGW GCC Release. Minecraft Dungeons II (PPSA16064 01.100.100), title screen, no input, 200 s rows, APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1; main c84249186 vs main + this PR, interleaved with three other PRs in one batch, two rounds. FPS is the mean of the last 10 [present] windows, GPU busy and idle gaps per frame over the last 8. This scene is CPU-bound on this machine (45-47 ms of idle gaps per frame).

libs FPS GPU busy idle gaps
main 6.60 / 6.60 105 / 105 ms 46 / 47 ms
+ this PR (89ab0ea75) 6.67 / 6.60 (+0.5 %) 104 / 105 ms 47 / 47 ms

Neutral on this scene (within the row spread); no regression. 0 fatal.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6223503436 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#issuecomment-6223503436). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-16T19:52:50Z. --- Data point: RTX 3060 12 GB (NVIDIA 617.42), i5-12400F, Windows 10 19045, MinGW GCC Release. Minecraft Dungeons II (PPSA16064 01.100.100), title screen, no input, 200 s rows, `APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1`; `main` c84249186 vs `main` + this PR, interleaved with three other PRs in one batch, two rounds. FPS is the mean of the last 10 `[present]` windows, GPU busy and idle gaps per frame over the last 8. This scene is CPU-bound on this machine (45-47 ms of idle gaps per frame). | libs | FPS | GPU busy | idle gaps | |---|---|---|---| | `main` | 6.60 / 6.60 | 105 / 105 ms | 46 / 47 ms | | + this PR (89ab0ea75) | 6.67 / 6.60 (+0.5 %) | 104 / 105 ms | 47 / 47 ms | Neutral on this scene (within the row spread); no regression. 0 fatal. AI-assisted: yes (Claude Code)
johnmaia commented 2026-10-17 02:47:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by johnmaia on 2026-10-17T02:47:45Z.


@EagleBearerYS your fix stops it. Epic Mickey: Rebrushed (PPSA15657), short runs to the first level, no APS5_STORE_AT_FLIP, Linux, RX 7600 (RADV, Mesa 25.2.8).

Current main no longer reproduces it often enough to measure, so I also ran the fix on yesterday's base, where it fails reliably:

Tree Runs Failed before reaching the level
main 5d9dcc42d + #6236 8 (alternated, yesterday) 3
same + #6364 (unrelated to this case) 16 3
same + your two commits (99af947b1, 082c3268a cherry-picked) 12 0
main e751dd205 8 0
main e751dd205 + your branch 8 (alternated with the row above) 0

None of the three failures appeared with the fix: the ObjectSerializationError on SM_MachineSet_01b, LowLevelFatalError [Line: 1609] and the SIGSEGV. All 12 runs reached the level and played to the end of the run.

main e751dd205 alone also passed 8 of 8, so something merged between 5d9dcc42d and e751dd205 makes the window rarer. I haven't looked into which; #5905 (prewarm mapped dma-buf) changes import timing and is the one I'd suspect.

With APS5_TRACE_APR=1 APS5_TRACE_FLUSH=1 on the fixed old base, 23 APR reads were followed at once by a [flush] image … for memory access over their destination, before the bytes landed. One is the image from the earlier trace:

[apr] read …/recolored-ps5.ucas offset=0x10a89ca0 size=0x41338 -> 0x204c540000
[flush] image 0x204c540000+0x60000 for memory access 0x204c540000+0x41338

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6228678047 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#issuecomment-6228678047). Originally posted by [johnmaia](https://github.com/johnmaia) on 2026-10-17T02:47:45Z. --- @EagleBearerYS your fix stops it. Epic Mickey: Rebrushed (PPSA15657), short runs to the first level, no `APS5_STORE_AT_FLIP`, Linux, RX 7600 (RADV, Mesa 25.2.8). Current `main` no longer reproduces it often enough to measure, so I also ran the fix on yesterday's base, where it fails reliably: | Tree | Runs | Failed before reaching the level | |---|---|---| | `main` 5d9dcc42d + #6236 | 8 (alternated, yesterday) | 3 | | same + #6364 (unrelated to this case) | 16 | 3 | | same + your two commits (99af947b1, 082c3268a cherry-picked) | 12 | **0** | | `main` e751dd205 | 8 | 0 | | `main` e751dd205 + your branch | 8 (alternated with the row above) | 0 | None of the three failures appeared with the fix: the `ObjectSerializationError` on `SM_MachineSet_01b`, `LowLevelFatalError [Line: 1609]` and the SIGSEGV. All 12 runs reached the level and played to the end of the run. `main` e751dd205 alone also passed 8 of 8, so something merged between 5d9dcc42d and e751dd205 makes the window rarer. I haven't looked into which; #5905 (prewarm mapped dma-buf) changes import timing and is the one I'd suspect. With `APS5_TRACE_APR=1 APS5_TRACE_FLUSH=1` on the fixed old base, 23 APR reads were followed at once by a `[flush] image … for memory access` over their destination, before the bytes landed. One is the image from the earlier trace: ``` [apr] read …/recolored-ps5.ucas offset=0x10a89ca0 size=0x41338 -> 0x204c540000 [flush] image 0x204c540000+0x60000 for memory access 0x204c540000+0x41338 ``` AI-assisted: yes (Claude Code)
EagleBearerYS commented 2026-10-17 02:56:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-17T02:56:51Z.


@johnmaia Thanks, that settles it. On the base that crashed, 6 of 24 runs failed without the fix (3 of 8, then 3 of 16) and none of 12 with it, and none of the three failures came back.

The two commits you cherry-picked (99af947b18 and 082c3268ac) are from #6926, not this PR, so I've added your runs to #6926's description as its Epic Mickey: Rebrushed (PPSA15657) evidence. I left out the current-main rows' comparison: both trees pass 8 of 8 there, so they can't tell the fix apart.

Your trace shows the fix at work. Each [flush] image … for memory access right after an [apr] read is #6926's host write hook storing the image's pending results over the read's destination before the file's bytes are written. Without the hook, that store was only recorded, and it landed after the read, which is the zeroed block in your earlier trace.

#5905 could well be why current main rarely shows it, since it changes when Linux dma-buf imports settle. The fix doesn't depend on that timing: it orders the host write after any store recorded over the same memory.

One optional extra: on #6926's current head (276f67d366), APS5_PROFILE_DRAW=1 prints a [hostwrite] line every 10 s with how many host writes waited for GPU work and for how long. That would give the PR its cost in the title. Your runs already answer the crash, so only if it's convenient.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6228763181 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#issuecomment-6228763181). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-17T02:56:51Z. --- @johnmaia Thanks, that settles it. On the base that crashed, 6 of 24 runs failed without the fix (3 of 8, then 3 of 16) and none of 12 with it, and none of the three failures came back. The two commits you cherry-picked (99af947b18 and 082c3268ac) are from #6926, not this PR, so I've added your runs to #6926's description as its Epic Mickey: Rebrushed (PPSA15657) evidence. I left out the current-`main` rows' comparison: both trees pass 8 of 8 there, so they can't tell the fix apart. Your trace shows the fix at work. Each `[flush] image … for memory access` right after an `[apr] read` is #6926's host write hook storing the image's pending results over the read's destination before the file's bytes are written. Without the hook, that store was only recorded, and it landed after the read, which is the zeroed block in your earlier trace. #5905 could well be why current `main` rarely shows it, since it changes when Linux dma-buf imports settle. The fix doesn't depend on that timing: it orders the host write after any store recorded over the same memory. One optional extra: on #6926's current head (276f67d366), `APS5_PROFILE_DRAW=1` prints a `[hostwrite]` line every 10 s with how many host writes waited for GPU work and for how long. That would give the PR its cost in the title. Your runs already answer the crash, so only if it's convenient.
simonbronk commented 2026-10-17 22:08:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-17T22:08:26Z.


Tested on Onimusha's menu: no measurable change in this scene.

Setup: Onimusha: Way of the Sword (PPSA27836), boot to the language menu with no input, APS5_TRACE_SECONDS=60:30, warm cache. Windows 11 26200, RTX 5070 (617.42), 3840x2160. Base main 84b0d2f24 + #6557 #6727 #6762 (5c521efea), 6 runs (3 before and 3 after the PR runs). The PR is merged on top of it (clean merge), 3 runs.

  • Base frame p50 (ms): 84.5, 82.6, 81.8, 81.5, 77.9, 83.5 (mean 82.0); p90 84.3-93.6.
  • With this PR, p50: 78.7, 85.6, 87.6. Within the base's run-to-run range.

This scene may simply not exercise the path this PR speeds up. Summary lines and traces available on request. AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6241965906 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#issuecomment-6241965906). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-17T22:08:26Z. --- Tested on Onimusha's menu: no measurable change in this scene. Setup: Onimusha: Way of the Sword (PPSA27836), boot to the language menu with no input, `APS5_TRACE_SECONDS=60:30`, warm cache. Windows 11 26200, RTX 5070 (617.42), 3840x2160. Base `main` 84b0d2f24 + #6557 #6727 #6762 (5c521efea), 6 runs (3 before and 3 after the PR runs). The PR is merged on top of it (clean merge), 3 runs. - Base frame p50 (ms): 84.5, 82.6, 81.8, 81.5, 77.9, 83.5 (mean 82.0); p90 84.3-93.6. - With this PR, p50: 78.7, 85.6, 87.6. Within the base's run-to-run range. This scene may simply not exercise the path this PR speeds up. Summary lines and traces available on request. AI-assisted: yes.
EagleBearerYS commented 2026-10-18 19:53:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-18T19:53:58Z.


@simonbronk a small ask, if you still have them: the Onimusha: Way of the Sword (PPSA27836) runs you did for this PR (main 84b0d2f24 with #6557, #6727 and #6762, with and without this PR, APS5_TRACE_SECONDS=60:30) each should have written an aps5-summary.jsonl next to its trace. Could you paste one line from a run without this PR and one from a run with it? The repo's new perf check reads those lines from the PR, and yours is the cleanest pair this PR has. The traces aren't needed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6254413808 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#issuecomment-6254413808). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-18T19:53:58Z. --- @simonbronk a small ask, if you still have them: the Onimusha: Way of the Sword (PPSA27836) runs you did for this PR (`main` 84b0d2f24 with #6557, #6727 and #6762, with and without this PR, `APS5_TRACE_SECONDS=60:30`) each should have written an `aps5-summary.jsonl` next to its trace. Could you paste one line from a run without this PR and one from a run with it? The repo's new perf check reads those lines from the PR, and yours is the cleanest pair this PR has. The traces aren't needed.
simonbronk commented 2026-10-18 21:33:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-18T21:33:23Z.


Here they are, from the runs in my comment above (same tree, scene and machine, warm cache). The pair: the first base run and the first run with this PR.

Without this PR (5c521efea = main 84b0d2f24 + #6557 #6727 #6762), base-r1:

{"commit":"5c521efea4cb","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":414,"ms":30052.503},"presents":256,"frame_ms":{"p50":84.478,"p90":93.612,"p99":972.971,"max":1952.003},"gpu_busy_ms_per_present":27.587,"worker_busy_pct":{"queue worker 0x38":1.653,"queue worker 0x20":35.070,"queue worker 0x0":91.809,"queue worker 0x28":64.589},"top_phases_ms_per_frame":{"Driver.Packet":224.620,"Driver.Packet.memory_wait":107.008,"Driver.Packet.draw":63.092,"Driver.Draw":63.071,"Driver.Packet.dispatch":52.429,"Driver.Dispatch":50.815,"Driver.Draw.draw_and_resource_release":48.789,"Graphics.Draw":48.759},"trace_dropped":false,"trace":"aps5-trace-5c521efea4cb-1894532.json.gz"}

With this PR merged on top (9f86b47f6), pr6636-r1:

{"commit":"9f86b47f65bc","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":396,"ms":30238.620},"presents":273,"frame_ms":{"p50":78.703,"p90":87.730,"p99":951.593,"max":1017.455},"gpu_busy_ms_per_present":25.760,"worker_busy_pct":{"queue worker 0x38":1.992,"queue worker 0x20":38.049,"queue worker 0x0":97.744,"queue worker 0x28":72.995},"top_phases_ms_per_frame":{"Driver.Packet":231.188,"Driver.Packet.memory_wait":112.370,"Driver.Packet.draw":60.955,"Driver.Draw":60.933,"Driver.Packet.dispatch":55.705,"Driver.Dispatch":54.322,"Driver.Draw.draw_and_resource_release":46.104,"Graphics.Draw":46.074},"trace_dropped":false,"trace":"aps5-trace-9f86b47f65bc-1902128.json.gz"}

That single pair favours the PR (p50 84.5 → 78.7 ms), but it is not representative. The other runs overlap, as in my comment above. All nine lines (6 base, 3 with the PR):

All runs
{"commit":"5c521efea4cb","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":414,"ms":30052.503},"presents":256,"frame_ms":{"p50":84.478,"p90":93.612,"p99":972.971,"max":1952.003},"gpu_busy_ms_per_present":27.587,"worker_busy_pct":{"queue worker 0x38":1.653,"queue worker 0x20":35.070,"queue worker 0x0":91.809,"queue worker 0x28":64.589},"top_phases_ms_per_frame":{"Driver.Packet":224.620,"Driver.Packet.memory_wait":107.008,"Driver.Packet.draw":63.092,"Driver.Draw":63.071,"Driver.Packet.dispatch":52.429,"Driver.Dispatch":50.815,"Driver.Draw.draw_and_resource_release":48.789,"Graphics.Draw":48.759},"trace_dropped":false,"trace":"aps5-trace-5c521efea4cb-1894532.json.gz"}
{"commit":"5c521efea4cb","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":392,"ms":30107.262},"presents":260,"frame_ms":{"p50":81.482,"p90":93.445,"p99":910.562,"max":974.056},"gpu_busy_ms_per_present":26.962,"worker_busy_pct":{"queue worker 0x38":1.791,"queue worker 0x20":37.441,"queue worker 0x0":97.837,"queue worker 0x28":69.835},"top_phases_ms_per_frame":{"Driver.Packet":237.429,"Driver.Packet.memory_wait":112.911,"Driver.Packet.draw":63.928,"Driver.Draw":63.909,"Driver.Packet.dispatch":58.156,"Driver.Dispatch":56.641,"Driver.Draw.draw_and_resource_release":49.642,"Graphics.Draw":49.615},"trace_dropped":false,"trace":"aps5-trace-5c521efea4cb-1899576.json.gz"}
{"commit":"5c521efea4cb","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":410,"ms":30067.819},"presents":232,"frame_ms":{"p50":82.552,"p90":91.353,"p99":947.238,"max":2195.088},"gpu_busy_ms_per_present":27.418,"worker_busy_pct":{"queue worker 0x38":1.571,"queue worker 0x20":35.495,"queue worker 0x0":91.122,"queue worker 0x28":65.018},"top_phases_ms_per_frame":{"Driver.Packet":248.225,"Driver.Packet.memory_wait":118.162,"Driver.Packet.draw":66.167,"Driver.Draw":66.145,"Driver.Packet.dispatch":61.545,"Driver.Dispatch":59.857,"Driver.Draw.draw_and_resource_release":51.929,"Graphics.Draw":51.899},"trace_dropped":false,"trace":"aps5-trace-5c521efea4cb-1891672.json.gz"}
{"commit":"5c521efea4cb","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":333,"ms":30077.757},"presents":329,"frame_ms":{"p50":77.924,"p90":84.348,"p99":551.119,"max":1990.566},"gpu_busy_ms_per_present":26.197,"worker_busy_pct":{"queue worker 0x38":1.874,"queue worker 0x20":34.336,"queue worker 0x0":91.315,"queue worker 0x28":60.749},"top_phases_ms_per_frame":{"Driver.Packet":170.271,"Driver.Packet.memory_wait":79.713,"Driver.Packet.draw":53.416,"Driver.Draw":53.395,"Driver.Draw.draw_and_resource_release":40.136,"Graphics.Draw":40.107,"Graphics.Draw.draw_and_resource_release":39.938,"Driver.Packet.dispatch":35.548},"trace_dropped":false,"trace":"aps5-trace-5c521efea4cb-1925336.json.gz"}
{"commit":"5c521efea4cb","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":395,"ms":30021.852},"presents":289,"frame_ms":{"p50":81.778,"p90":88.670,"p99":1002.226,"max":2014.816},"gpu_busy_ms_per_present":27.318,"worker_busy_pct":{"queue worker 0x38":1.808,"queue worker 0x20":33.389,"queue worker 0x0":91.405,"queue worker 0x28":62.072},"top_phases_ms_per_frame":{"Driver.Packet":193.974,"Driver.Packet.memory_wait":91.833,"Driver.Packet.draw":59.874,"Driver.Draw":59.853,"Driver.Draw.draw_and_resource_release":46.767,"Graphics.Draw":46.738,"Graphics.Draw.draw_and_resource_release":46.530,"Driver.Packet.dispatch":40.322},"trace_dropped":false,"trace":"aps5-trace-5c521efea4cb-1894288.json.gz"}
{"commit":"5c521efea4cb","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":432,"ms":30077.147},"presents":266,"frame_ms":{"p50":83.459,"p90":90.970,"p99":961.085,"max":2078.415},"gpu_busy_ms_per_present":27.305,"worker_busy_pct":{"queue worker 0x38":1.670,"queue worker 0x20":34.669,"queue worker 0x0":91.379,"queue worker 0x28":61.538},"top_phases_ms_per_frame":{"Driver.Packet":211.963,"Driver.Packet.memory_wait":98.952,"Driver.Packet.draw":61.309,"Driver.Draw":61.288,"Driver.Packet.dispatch":49.689,"Driver.Dispatch":48.281,"Driver.Draw.draw_and_resource_release":47.423,"Graphics.Draw":47.395},"trace_dropped":false,"trace":"aps5-trace-5c521efea4cb-1931244.json.gz"}
{"commit":"9f86b47f65bc","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":396,"ms":30238.620},"presents":273,"frame_ms":{"p50":78.703,"p90":87.730,"p99":951.593,"max":1017.455},"gpu_busy_ms_per_present":25.760,"worker_busy_pct":{"queue worker 0x38":1.992,"queue worker 0x20":38.049,"queue worker 0x0":97.744,"queue worker 0x28":72.995},"top_phases_ms_per_frame":{"Driver.Packet":231.188,"Driver.Packet.memory_wait":112.370,"Driver.Packet.draw":60.955,"Driver.Draw":60.933,"Driver.Packet.dispatch":55.705,"Driver.Dispatch":54.322,"Driver.Draw.draw_and_resource_release":46.104,"Graphics.Draw":46.074},"trace_dropped":false,"trace":"aps5-trace-9f86b47f65bc-1902128.json.gz"}
{"commit":"9f86b47f65bc","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":354,"ms":30050.124},"presents":286,"frame_ms":{"p50":85.648,"p90":93.299,"p99":980.078,"max":2078.655},"gpu_busy_ms_per_present":27.688,"worker_busy_pct":{"queue worker 0x38":1.714,"queue worker 0x20":33.302,"queue worker 0x0":91.267,"queue worker 0x28":62.448},"top_phases_ms_per_frame":{"Driver.Packet":196.358,"Driver.Packet.memory_wait":93.181,"Driver.Packet.draw":60.608,"Driver.Draw":60.584,"Driver.Draw.draw_and_resource_release":46.077,"Graphics.Draw":46.047,"Graphics.Draw.draw_and_resource_release":45.842,"Driver.Packet.dispatch":40.777},"trace_dropped":false,"trace":"aps5-trace-9f86b47f65bc-1916272.json.gz"}
{"commit":"9f86b47f65bc","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":479,"ms":30039.460},"presents":215,"frame_ms":{"p50":87.626,"p90":137.436,"p99":944.796,"max":2110.107},"gpu_busy_ms_per_present":27.710,"worker_busy_pct":{"queue worker 0x38":1.467,"queue worker 0x20":35.079,"queue worker 0x0":91.467,"queue worker 0x28":65.984},"top_phases_ms_per_frame":{"Driver.Packet":268.869,"Driver.Packet.memory_wait":127.532,"Driver.Packet.draw":71.253,"Driver.Draw":71.225,"Driver.Packet.dispatch":67.223,"Driver.Dispatch":65.074,"Driver.Draw.draw_and_resource_release":54.428,"Graphics.Draw":54.394},"trace_dropped":false,"trace":"aps5-trace-9f86b47f65bc-1915204.json.gz"}

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6255412303 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#issuecomment-6255412303). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-18T21:33:23Z. --- Here they are, from the runs in my comment above (same tree, scene and machine, warm cache). The pair: the first base run and the first run with this PR. Without this PR (`5c521efea` = `main` 84b0d2f24 + #6557 #6727 #6762), `base-r1`: ```json {"commit":"5c521efea4cb","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":414,"ms":30052.503},"presents":256,"frame_ms":{"p50":84.478,"p90":93.612,"p99":972.971,"max":1952.003},"gpu_busy_ms_per_present":27.587,"worker_busy_pct":{"queue worker 0x38":1.653,"queue worker 0x20":35.070,"queue worker 0x0":91.809,"queue worker 0x28":64.589},"top_phases_ms_per_frame":{"Driver.Packet":224.620,"Driver.Packet.memory_wait":107.008,"Driver.Packet.draw":63.092,"Driver.Draw":63.071,"Driver.Packet.dispatch":52.429,"Driver.Dispatch":50.815,"Driver.Draw.draw_and_resource_release":48.789,"Graphics.Draw":48.759},"trace_dropped":false,"trace":"aps5-trace-5c521efea4cb-1894532.json.gz"} ``` With this PR merged on top (`9f86b47f6`), `pr6636-r1`: ```json {"commit":"9f86b47f65bc","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":396,"ms":30238.620},"presents":273,"frame_ms":{"p50":78.703,"p90":87.730,"p99":951.593,"max":1017.455},"gpu_busy_ms_per_present":25.760,"worker_busy_pct":{"queue worker 0x38":1.992,"queue worker 0x20":38.049,"queue worker 0x0":97.744,"queue worker 0x28":72.995},"top_phases_ms_per_frame":{"Driver.Packet":231.188,"Driver.Packet.memory_wait":112.370,"Driver.Packet.draw":60.955,"Driver.Draw":60.933,"Driver.Packet.dispatch":55.705,"Driver.Dispatch":54.322,"Driver.Draw.draw_and_resource_release":46.104,"Graphics.Draw":46.074},"trace_dropped":false,"trace":"aps5-trace-9f86b47f65bc-1902128.json.gz"} ``` That single pair favours the PR (p50 84.5 → 78.7 ms), but it is not representative. The other runs overlap, as in my comment above. All nine lines (6 base, 3 with the PR): <details><summary>All runs</summary> ```json {"commit":"5c521efea4cb","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":414,"ms":30052.503},"presents":256,"frame_ms":{"p50":84.478,"p90":93.612,"p99":972.971,"max":1952.003},"gpu_busy_ms_per_present":27.587,"worker_busy_pct":{"queue worker 0x38":1.653,"queue worker 0x20":35.070,"queue worker 0x0":91.809,"queue worker 0x28":64.589},"top_phases_ms_per_frame":{"Driver.Packet":224.620,"Driver.Packet.memory_wait":107.008,"Driver.Packet.draw":63.092,"Driver.Draw":63.071,"Driver.Packet.dispatch":52.429,"Driver.Dispatch":50.815,"Driver.Draw.draw_and_resource_release":48.789,"Graphics.Draw":48.759},"trace_dropped":false,"trace":"aps5-trace-5c521efea4cb-1894532.json.gz"} {"commit":"5c521efea4cb","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":392,"ms":30107.262},"presents":260,"frame_ms":{"p50":81.482,"p90":93.445,"p99":910.562,"max":974.056},"gpu_busy_ms_per_present":26.962,"worker_busy_pct":{"queue worker 0x38":1.791,"queue worker 0x20":37.441,"queue worker 0x0":97.837,"queue worker 0x28":69.835},"top_phases_ms_per_frame":{"Driver.Packet":237.429,"Driver.Packet.memory_wait":112.911,"Driver.Packet.draw":63.928,"Driver.Draw":63.909,"Driver.Packet.dispatch":58.156,"Driver.Dispatch":56.641,"Driver.Draw.draw_and_resource_release":49.642,"Graphics.Draw":49.615},"trace_dropped":false,"trace":"aps5-trace-5c521efea4cb-1899576.json.gz"} {"commit":"5c521efea4cb","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":410,"ms":30067.819},"presents":232,"frame_ms":{"p50":82.552,"p90":91.353,"p99":947.238,"max":2195.088},"gpu_busy_ms_per_present":27.418,"worker_busy_pct":{"queue worker 0x38":1.571,"queue worker 0x20":35.495,"queue worker 0x0":91.122,"queue worker 0x28":65.018},"top_phases_ms_per_frame":{"Driver.Packet":248.225,"Driver.Packet.memory_wait":118.162,"Driver.Packet.draw":66.167,"Driver.Draw":66.145,"Driver.Packet.dispatch":61.545,"Driver.Dispatch":59.857,"Driver.Draw.draw_and_resource_release":51.929,"Graphics.Draw":51.899},"trace_dropped":false,"trace":"aps5-trace-5c521efea4cb-1891672.json.gz"} {"commit":"5c521efea4cb","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":333,"ms":30077.757},"presents":329,"frame_ms":{"p50":77.924,"p90":84.348,"p99":551.119,"max":1990.566},"gpu_busy_ms_per_present":26.197,"worker_busy_pct":{"queue worker 0x38":1.874,"queue worker 0x20":34.336,"queue worker 0x0":91.315,"queue worker 0x28":60.749},"top_phases_ms_per_frame":{"Driver.Packet":170.271,"Driver.Packet.memory_wait":79.713,"Driver.Packet.draw":53.416,"Driver.Draw":53.395,"Driver.Draw.draw_and_resource_release":40.136,"Graphics.Draw":40.107,"Graphics.Draw.draw_and_resource_release":39.938,"Driver.Packet.dispatch":35.548},"trace_dropped":false,"trace":"aps5-trace-5c521efea4cb-1925336.json.gz"} {"commit":"5c521efea4cb","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":395,"ms":30021.852},"presents":289,"frame_ms":{"p50":81.778,"p90":88.670,"p99":1002.226,"max":2014.816},"gpu_busy_ms_per_present":27.318,"worker_busy_pct":{"queue worker 0x38":1.808,"queue worker 0x20":33.389,"queue worker 0x0":91.405,"queue worker 0x28":62.072},"top_phases_ms_per_frame":{"Driver.Packet":193.974,"Driver.Packet.memory_wait":91.833,"Driver.Packet.draw":59.874,"Driver.Draw":59.853,"Driver.Draw.draw_and_resource_release":46.767,"Graphics.Draw":46.738,"Graphics.Draw.draw_and_resource_release":46.530,"Driver.Packet.dispatch":40.322},"trace_dropped":false,"trace":"aps5-trace-5c521efea4cb-1894288.json.gz"} {"commit":"5c521efea4cb","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":432,"ms":30077.147},"presents":266,"frame_ms":{"p50":83.459,"p90":90.970,"p99":961.085,"max":2078.415},"gpu_busy_ms_per_present":27.305,"worker_busy_pct":{"queue worker 0x38":1.670,"queue worker 0x20":34.669,"queue worker 0x0":91.379,"queue worker 0x28":61.538},"top_phases_ms_per_frame":{"Driver.Packet":211.963,"Driver.Packet.memory_wait":98.952,"Driver.Packet.draw":61.309,"Driver.Draw":61.288,"Driver.Packet.dispatch":49.689,"Driver.Dispatch":48.281,"Driver.Draw.draw_and_resource_release":47.423,"Graphics.Draw":47.395},"trace_dropped":false,"trace":"aps5-trace-5c521efea4cb-1931244.json.gz"} {"commit":"9f86b47f65bc","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":396,"ms":30238.620},"presents":273,"frame_ms":{"p50":78.703,"p90":87.730,"p99":951.593,"max":1017.455},"gpu_busy_ms_per_present":25.760,"worker_busy_pct":{"queue worker 0x38":1.992,"queue worker 0x20":38.049,"queue worker 0x0":97.744,"queue worker 0x28":72.995},"top_phases_ms_per_frame":{"Driver.Packet":231.188,"Driver.Packet.memory_wait":112.370,"Driver.Packet.draw":60.955,"Driver.Draw":60.933,"Driver.Packet.dispatch":55.705,"Driver.Dispatch":54.322,"Driver.Draw.draw_and_resource_release":46.104,"Graphics.Draw":46.074},"trace_dropped":false,"trace":"aps5-trace-9f86b47f65bc-1902128.json.gz"} {"commit":"9f86b47f65bc","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":354,"ms":30050.124},"presents":286,"frame_ms":{"p50":85.648,"p90":93.299,"p99":980.078,"max":2078.655},"gpu_busy_ms_per_present":27.688,"worker_busy_pct":{"queue worker 0x38":1.714,"queue worker 0x20":33.302,"queue worker 0x0":91.267,"queue worker 0x28":62.448},"top_phases_ms_per_frame":{"Driver.Packet":196.358,"Driver.Packet.memory_wait":93.181,"Driver.Packet.draw":60.608,"Driver.Draw":60.584,"Driver.Draw.draw_and_resource_release":46.077,"Graphics.Draw":46.047,"Graphics.Draw.draw_and_resource_release":45.842,"Driver.Packet.dispatch":40.777},"trace_dropped":false,"trace":"aps5-trace-9f86b47f65bc-1916272.json.gz"} {"commit":"9f86b47f65bc","dirty":false,"env":{"APS5_BINDLESS_MATERIAL_SCAN":"65536","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:30"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","resolution":"3840x2160","window":{"spec":"seconds 60:30","first_present":479,"ms":30039.460},"presents":215,"frame_ms":{"p50":87.626,"p90":137.436,"p99":944.796,"max":2110.107},"gpu_busy_ms_per_present":27.710,"worker_busy_pct":{"queue worker 0x38":1.467,"queue worker 0x20":35.079,"queue worker 0x0":91.467,"queue worker 0x28":65.984},"top_phases_ms_per_frame":{"Driver.Packet":268.869,"Driver.Packet.memory_wait":127.532,"Driver.Packet.draw":71.253,"Driver.Draw":71.225,"Driver.Packet.dispatch":67.223,"Driver.Dispatch":65.074,"Driver.Draw.draw_and_resource_release":54.428,"Graphics.Draw":54.394},"trace_dropped":false,"trace":"aps5-trace-9f86b47f65bc-1915204.json.gz"} ``` </details> AI-assisted: yes
github-actions[bot] commented 2026-10-19 00:21:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T00:21:25Z.


This pull request is labeled perf, so it needs the summary line of a capture on main and one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste both aps5-summary.jsonl lines, attach the two traces and add the output of tools/trace_digest.py.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6257010178 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#issuecomment-6257010178). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T00:21:25Z. --- <!-- pr-labels-perf --> This pull request is labeled `perf`, so it needs the summary line of a capture on `main` and one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste both `aps5-summary.jsonl` lines, attach the two traces and add the output of `tools/trace_digest.py`.
jotitadev commented 2026-10-19 03:22:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-19T03:22:47Z.

Review: COMMENTED


Apple GPU / MoltenVK run. One failure on macOS: agc_driver_address_draw_reuse fails at the ThrowingProof case, and it comes from how macOS write-tracks host imports.

Machine: Apple M2 Max, macOS 27.2, x86-64 build under Rosetta. Head 88b9b7f3c, PR diff applied cleanly. The current head 28433ba13 only merges main; the PR's own diff is unchanged. Drivers: MoltenVK 1.4.2 (Vulkan SDK 1.4.363.0) and MoltenVK main + SPIRV-Cross #2704.

Tested: the tree is main a373e85e5 + mugurc's macOS series (ci/macos-series-2, includes ImportWatched) + the PRs needed to build on macOS (#6667, #6668, #7524, #6969, and two files of #7332), not plain main (it doesn't build on macOS yet). This PR's base (84c1a4d9a) is an ancestor of that main. Base on that tree: 40 ^agc failures with MoltenVK 1.4.2 and 26 with MoltenVK main + #2704, the same known failures in every run below unless noted. I also stacked #6639 and #6557 in one build; the failure below is the same with this PR alone.

  • agc_driver_graphics (with the new BdaResources.cpp cases), agc_driver_pipeline_journal and agc_pipeline_journal pass 3 of 3 on both drivers.
  • Full ^agc suite: 41 of 729 on MoltenVK 1.4.2 and 27 of 729 on MoltenVK main + #2704. The base failures plus one, agc_driver_address_draw_reuse, on both drivers, every run:
    AGC graphics: address draw reuse: an address-based draw build whose sampled image's memory became a multisampled target was reused
    
    The cases before it in that test pass.

What separates it:

setting agc_driver_address_draw_reuse
default (on this Mac the probe prints host imports resolve write protection: no ... imported ranges stay watched) fails
APS5_WRITE_WATCH_IMPORTS=watch fails
APS5_WRITE_WATCH_IMPORTS=unwatch passes
APS5_NO_FAST_REVALIDATE=1 passes

So with watched imports, the fast proof (fastRevalidate) finds the image's memory unchanged after MultisampleTargetView takes it over, and Revalidate returns true. The full walk throws there, and the reuse is counted as a refusal that threw, which is what the test expects. My guess is that a GPU-side change of ownership leaves no write stamp for the fast proof to see when imports stay watched. If so, it would show up on Linux or Windows with APS5_WRITE_WATCH_IMPORTS=watch as well. I haven't checked that, and I don't know whether a cached non-address draw has the same gap through fastRevalidate.

Without the fix I couldn't run the test, since it uses the reuse API this PR adds.

GPUs tested: Apple M2 Max (MoltenVK 1.4.2; MoltenVK main + SPIRV-Cross #2704)

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5566570447 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#pullrequestreview-5566570447). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-19T03:22:47Z. **Review:** COMMENTED --- <!-- head: 28433ba13 (validated 88b9b7f3c) --> Apple GPU / MoltenVK run. One failure on macOS: `agc_driver_address_draw_reuse` fails at the `ThrowingProof` case, and it comes from how macOS write-tracks host imports. Machine: Apple M2 Max, macOS 27.2, x86-64 build under Rosetta. Head 88b9b7f3c, PR diff applied cleanly. The current head 28433ba13 only merges `main`; the PR's own diff is unchanged. Drivers: MoltenVK 1.4.2 (Vulkan SDK 1.4.363.0) and MoltenVK main + SPIRV-Cross #2704. **Tested:** the tree is `main` a373e85e5 + mugurc's macOS series (`ci/macos-series-2`, includes ImportWatched) + the PRs needed to build on macOS (#6667, #6668, #7524, #6969, and two files of #7332), not plain `main` (it doesn't build on macOS yet). This PR's base (84c1a4d9a) is an ancestor of that `main`. Base on that tree: 40 `^agc` failures with MoltenVK 1.4.2 and 26 with MoltenVK main + #2704, the same known failures in every run below unless noted. I also stacked #6639 and #6557 in one build; the failure below is the same with this PR alone. - `agc_driver_graphics` (with the new `BdaResources.cpp` cases), `agc_driver_pipeline_journal` and `agc_pipeline_journal` pass 3 of 3 on both drivers. - Full `^agc` suite: 41 of 729 on MoltenVK 1.4.2 and 27 of 729 on MoltenVK main + #2704. The base failures plus one, `agc_driver_address_draw_reuse`, on both drivers, every run: ``` AGC graphics: address draw reuse: an address-based draw build whose sampled image's memory became a multisampled target was reused ``` The cases before it in that test pass. What separates it: | setting | `agc_driver_address_draw_reuse` | |---|---| | default (on this Mac the probe prints `host imports resolve write protection: no ... imported ranges stay watched`) | fails | | `APS5_WRITE_WATCH_IMPORTS=watch` | fails | | `APS5_WRITE_WATCH_IMPORTS=unwatch` | passes | | `APS5_NO_FAST_REVALIDATE=1` | passes | So with watched imports, the fast proof (`fastRevalidate`) finds the image's memory unchanged after `MultisampleTargetView` takes it over, and `Revalidate` returns true. The full walk throws there, and the reuse is counted as a refusal that threw, which is what the test expects. My guess is that a GPU-side change of ownership leaves no write stamp for the fast proof to see when imports stay watched. If so, it would show up on Linux or Windows with `APS5_WRITE_WATCH_IMPORTS=watch` as well. I haven't checked that, and I don't know whether a cached non-address draw has the same gap through `fastRevalidate`. Without the fix I couldn't run the test, since it uses the reuse API this PR adds. GPUs tested: Apple M2 Max (MoltenVK 1.4.2; MoltenVK main + SPIRV-Cross #2704) Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
adriadam10 commented 2026-10-19 07:27:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T07:27:29Z.

Review: CHANGES_REQUESTED


Thanks for the thorough work and the follow-up fixes. Three things block this one:

  • Conflicts with main in GuestBufferMemory.hpp (DeviceReads next to the new SpaceRegions/SuspendSpace/ResumeSpace/... declarations) and GuestBufferMemory.cpp (host import replacement near held(it->second): main now uses replaced += it->second.pinnedBytes while this branch uses .bytes and adds countImportRefusal). Please rebase and re-run the reuse tests; the import-size change from main has to carry into the refusal counters.
  • macOS failure reported by @jotitadev: agc_driver_address_draw_reuse fails at ThrowingProof when imports stay watched (default on that machine, also APS5_WRITE_WATCH_IMPORTS=watch); it passes with APS5_NO_FAST_REVALIDATE=1 or unwatch. fastRevalidate accepts the draw after the sampled image's memory became a multisampled target, where the full walk throws. Please make the fast proof refuse that case (and check whether a cached non-address draw has the same gap), ideally with a Linux test using APS5_WRITE_WATCH_IMPORTS=watch so CI covers it.
  • perf label: the bot asks for the aps5-summary.jsonl lines of main and the change from the same title, scene and machine, plus the tools/trace_digest.py output. The Onimusha pair posted doesn't show a gain (the author's own wording), so please attach a pair from a scene that does exercise address-based draws (Resident Evil Village, on main plus this PR only, not a local tree with other PRs).

Welcome back once these are addressed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5568222997 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#pullrequestreview-5568222997). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-19T07:27:29Z. **Review:** CHANGES_REQUESTED --- Thanks for the thorough work and the follow-up fixes. Three things block this one: - **Conflicts with `main`** in `GuestBufferMemory.hpp` (`DeviceReads` next to the new `SpaceRegions`/`SuspendSpace`/`ResumeSpace`/... declarations) and `GuestBufferMemory.cpp` (host import replacement near `held(it->second)`: `main` now uses `replaced += it->second.pinnedBytes` while this branch uses `.bytes` and adds `countImportRefusal`). Please rebase and re-run the reuse tests; the import-size change from `main` has to carry into the refusal counters. - **macOS failure reported by @jotitadev**: `agc_driver_address_draw_reuse` fails at `ThrowingProof` when imports stay watched (default on that machine, also `APS5_WRITE_WATCH_IMPORTS=watch`); it passes with `APS5_NO_FAST_REVALIDATE=1` or `unwatch`. `fastRevalidate` accepts the draw after the sampled image's memory became a multisampled target, where the full walk throws. Please make the fast proof refuse that case (and check whether a cached non-address draw has the same gap), ideally with a Linux test using `APS5_WRITE_WATCH_IMPORTS=watch` so CI covers it. - **`perf` label**: the bot asks for the `aps5-summary.jsonl` lines of `main` and the change from the same title, scene and machine, plus the `tools/trace_digest.py` output. The Onimusha pair posted doesn't show a gain (the author's own wording), so please attach a pair from a scene that does exercise address-based draws (Resident Evil Village, on `main` plus this PR only, not a local tree with other PRs). Welcome back once these are addressed.
EagleBearerYS commented 2026-10-21 04:50:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-21T04:50:54Z.


@adriadam10, thanks for the review. All three points:

Conflicts with main. 084de35d85 merges main 6696def6e6. importAllocation takes main's step-down and pinnedBytes, so the replaced size counts pinned bytes, and a refusal is counted only where the import is refused, not where it steps down to a smaller size. A cached space is reused only when main's check of its heap and sparse mirrors passes, both when the space is acquired and in ResumeSpace, and its imports are stamped once per space, as main does. On GitHub's runners (run) the reuse tests and the tests tied to the merged files pass 5 runs in a row on Linux and Windows (Windows skips the lavapipe ones).

The macOS failure. Your and @jotitadev's reading is right. At 28433ba132, fastRevalidate never looked at the multisample target guards, and MultisampleTargetView writes no guest memory, so with watched imports nothing the fast proof compares had changed. #7650 (merged) now refuses that case in proveBuild, through RequireNoMultisampleColorTarget, before either proof runs, and the merge brings it into this branch. It checks a build's ordinary sampled and storage ranges; image tables stay exempt, as #7650's debt entry says. With that line removed, the case fails on Linux too when imports stay watched (APS5_WRITE_WATCH_IMPORTS=watch).

fc9c5416fc keeps it covered on CI:

  • agc_driver_address_draw_reuse_watched_imports registers the same test again with APS5_WRITE_WATCH_IMPORTS=watch, on Linux and macOS builds.
  • ThrowingProof also checks a cached draw build without the address table, the non-address case you asked about. It had the same gap before #7650, in both import modes, and the same guard refuses it now.

With #7650's line removed, the new registration fails at the address-based case ("an address-based draw build whose sampled image's memory became a multisampled target was reused") and the existing one at the non-address case ("a draw build without the address table whose sampled image's memory became a multisampled target was reused"). With it, each passes 20 runs in a row on Linux, and on GitHub's runners (run) both pass 5 runs in a row with the tests tied to the changed files. The ^agc tests pass 792 of 793 (57 skipped). The one failure, agc_driver_sgpr_pattern_fill_keys, fails under the sweep's parallel load on main too.

@jotitadev, could you run agc_driver_address_draw_reuse again on macOS with fc9c5416fc merged into your tree? With the default (watched imports) it should pass now.

The perf pair. I'll post a Resident Evil Village (PPSA01556) pair from a scene with address-based draws: main against main plus this PR, on the same machine, with both aps5-summary.jsonl lines, the traces and the output of tools/trace_digest.py. It's queued behind getting the title to boot on current main, and the post will name anything either tree needs beyond main and this PR.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6308329449 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#issuecomment-6308329449). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-21T04:50:54Z. --- @adriadam10, thanks for the review. All three points: **Conflicts with `main`.** 084de35d85 merges `main` 6696def6e6. `importAllocation` takes `main`'s step-down and `pinnedBytes`, so the replaced size counts pinned bytes, and a refusal is counted only where the import is refused, not where it steps down to a smaller size. A cached space is reused only when `main`'s check of its heap and sparse mirrors passes, both when the space is acquired and in `ResumeSpace`, and its imports are stamped once per space, as `main` does. On GitHub's runners ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/39541100727)) the reuse tests and the tests tied to the merged files pass 5 runs in a row on Linux and Windows (Windows skips the lavapipe ones). **The macOS failure.** Your and @jotitadev's reading is right. At 28433ba132, `fastRevalidate` never looked at the multisample target guards, and `MultisampleTargetView` writes no guest memory, so with watched imports nothing the fast proof compares had changed. #7650 (merged) now refuses that case in `proveBuild`, through `RequireNoMultisampleColorTarget`, before either proof runs, and the merge brings it into this branch. It checks a build's ordinary sampled and storage ranges; image tables stay exempt, as #7650's debt entry says. With that line removed, the case fails on Linux too when imports stay watched (`APS5_WRITE_WATCH_IMPORTS=watch`). fc9c5416fc keeps it covered on CI: - `agc_driver_address_draw_reuse_watched_imports` registers the same test again with `APS5_WRITE_WATCH_IMPORTS=watch`, on Linux and macOS builds. - `ThrowingProof` also checks a cached draw build without the address table, the non-address case you asked about. It had the same gap before #7650, in both import modes, and the same guard refuses it now. With #7650's line removed, the new registration fails at the address-based case ("an address-based draw build whose sampled image's memory became a multisampled target was reused") and the existing one at the non-address case ("a draw build without the address table whose sampled image's memory became a multisampled target was reused"). With it, each passes 20 runs in a row on Linux, and on GitHub's runners ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/39543871880)) both pass 5 runs in a row with the tests tied to the changed files. The `^agc` tests pass 792 of 793 (57 skipped). The one failure, `agc_driver_sgpr_pattern_fill_keys`, fails under the sweep's parallel load on `main` too. @jotitadev, could you run `agc_driver_address_draw_reuse` again on macOS with fc9c5416fc merged into your tree? With the default (watched imports) it should pass now. **The perf pair.** I'll post a Resident Evil Village (PPSA01556) pair from a scene with address-based draws: `main` against `main` plus this PR, on the same machine, with both `aps5-summary.jsonl` lines, the traces and the output of `tools/trace_digest.py`. It's queued behind getting the title to boot on current `main`, and the post will name anything either tree needs beyond `main` and this PR.
EagleBearerYS commented 2026-10-21 12:42:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-21T12:42:20Z.


@adriadam10, the Resident Evil Village (PPSA01556) runs show this PR doesn't pay off there, so I'm closing it rather than make you wait for the pair I promised.

What the runs showed. Both ran at the title's menu, with this PR at fc9c5416fc. They aren't on main plus this PR only, as you asked: main 1ff5c8ac5c aborts in Resident Evil Village's intro without #8926's fix. So both trees are main 1ff5c8ac5c + #8926's fix (63d5414338) + this PR. Both used APS5_LAZY_SHADER_PREPARE=1, APS5_NO_GPL=1 and APS5_HOST_IMPORT_MIB=6400 on a warm cache.

  • With the reuse counters, 6 minutes: 17,613 address-based proofs, and none reused. Each was refused because a snapshot had changed.
  • With one more commit on top that names each refusal's first failing check: of 2,295 refused proofs, 2,185 failed on a read's address and 108 on a count. None failed on size, bytes or a lookup. Its logging slowed the game to a crawl, so this run covers fewer frames of the menu.

Why. The proof compares the addresses a build read through its address space. Most of those reads are per-draw constants whose address changes from one draw to the next: mesh-stage constants of 0x50 and 0x70 bytes, and 4- and 8-byte pixel-stage reads. Ten draw keys read 9 or more distinct addresses each, and they account for 55% of the address reads the second run logged. Keeping a few builds per key would match about a quarter of those reads at best.

A gain here would need a proof over what the build derives from those reads, not over their addresses. That's a bigger change than this PR.

Thanks to you for the review, to @jotitadev for the macOS run, to @MarcZX10 for the review comments, to @simonbronk for the Onimusha: Way of the Sword (PPSA27836) runs, and to @johnmaia for the Epic Mickey: Rebrushed (PPSA15657) runs.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6316179021 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6636#issuecomment-6316179021). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-21T12:42:20Z. --- @adriadam10, the Resident Evil Village (PPSA01556) runs show this PR doesn't pay off there, so I'm closing it rather than make you wait for the pair I promised. **What the runs showed.** Both ran at the title's menu, with this PR at fc9c5416fc. They aren't on `main` plus this PR only, as you asked: `main` 1ff5c8ac5c aborts in Resident Evil Village's intro without #8926's fix. So both trees are `main` 1ff5c8ac5c + #8926's fix (63d5414338) + this PR. Both used `APS5_LAZY_SHADER_PREPARE=1`, `APS5_NO_GPL=1` and `APS5_HOST_IMPORT_MIB=6400` on a warm cache. - With the reuse counters, 6 minutes: 17,613 address-based proofs, and none reused. Each was refused because a snapshot had changed. - With one more commit on top that names each refusal's first failing check: of 2,295 refused proofs, 2,185 failed on a read's address and 108 on a count. None failed on size, bytes or a lookup. Its logging slowed the game to a crawl, so this run covers fewer frames of the menu. **Why.** The proof compares the addresses a build read through its address space. Most of those reads are per-draw constants whose address changes from one draw to the next: mesh-stage constants of 0x50 and 0x70 bytes, and 4- and 8-byte pixel-stage reads. Ten draw keys read 9 or more distinct addresses each, and they account for 55% of the address reads the second run logged. Keeping a few builds per key would match about a quarter of those reads at best. A gain here would need a proof over what the build derives from those reads, not over their addresses. That's a bigger change than this PR. Thanks to you for the review, to @jotitadev for the macOS run, to @MarcZX10 for the review comments, to @simonbronk for the Onimusha: Way of the Sword (PPSA27836) runs, and to @johnmaia for the Epic Mickey: Rebrushed (PPSA15657) runs.

Pull request closed

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!6636
No description provided.