fix(agc): write back BDA stores into writable heap mirrors #12840

Merged
EagleBearerYS merged 39 commits from upstream-pr/12840 into main 2026-11-26 18:16:46 +00:00
EagleBearerYS commented 2026-10-29 12:10:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-29T12:10:17Z.


What

A shader that stores through a FLAT/GLOBAL address, or through a V# it computed itself, into a writable heap mirror is refused today. sktharunbalaji13-cmd's Ghost of Tsushima Director's Cut (PPSA02225) run stops a compute store this way (I#5166):

[gpu] deferred write-back failed: BDA access failed: address=0x1579d4e49e instruction=0x1284 bytes=1 stage=4 reason=2; the store hit 0x150c000000+0x8c600000, read-only in the BDA table: stores through GPU-selected descriptors and FLAT/GLOBAL addresses reach only writable ranges imported in place, not ones served by a mirror or a copy

On main b11c7bf84f the title still hits this refusal, 7 times per run, each with the store hit 0x1549750000+0x4eeb0000 (instruction 0x1b4, 4 bytes, compute), right after its intro H.264 decoder is created. On this PR's head it runs with none (run; see Tested). On main 133feb30f0, from a pinned save on Linux, @milescoviello's pair logs no such refusal in either arm, so that pair can't show the fix (see Tested). A probe on main 7c444b77ad still refuses such a store, and the same probe on this PR's head stores it (see Tested).

The refusal is deliberate. Granting Write to writable mirrors in GuestBufferMemory::addressRange alone would lose the stores silently:

  • WriteBack stores only the build's declared write ranges, so a store elsewhere in the mirror never reaches guest memory.
  • The next refresh of the mirror then replaces it with guest bytes.

The change. When a build's shaders can store through addresses (!bdaReadOnly), its writable heap mirror spans are marked writable in the BDA table, and the stores reach guest memory without binding, copying or reading back the span:

  • Resident (sparse) mirrors:
    • A store into an unbound block is redirected to a 4 KiB store page from a small per-build pool. APS5_BDA_STORE_PAGES sets its size: the default is 1,024 pages, about 4.6 MiB. Pages are found by a 16-probe hash keyed by the page, and a read in the same dispatch finds the store there.
    • A full pool is a stop. A dispatch whose stores need more distinct pages than the pool can place faults with "none of the N store pages free", and none of its stores reach guest memory. With 16 probes, the default pool starts refusing consecutive pages at about 988. There is no fallback in this PR.
    • After the use, each stored page goes to guest memory by its per-byte store mask, so a stored zero lands too. The block stays unbound until a later refresh binds it from guest memory.
    • Bound pages that the recompiler's written-page record lists are gathered on the GPU (StorePageGather.comp) and compared with the resident shadow, which equals the device bytes at upload.
  • Copy-backed mirrors: each store ORs one bit per byte it writes into a mask beside its page slot, and the write-back copies only the masked bytes.
  • CPU bytes: either way, a CPU byte written during the dispatch survives, even in the same page or the same dword.
  • APS5_HEAP_MIRROR_MIB is never charged for a store.
  • The pending-write note still covers the span. Host reads, copies and the next address-based refresh of that heap must wait for the storing use, and the span is the only set known before the dispatch. It's a range, not bytes.
  • NoteWrittenBack notes only the runs that were actually stored, so a completion label inside the span that no thread stores over isn't counted as overwritten.
  • Compile cost: compute pipelines get the store-page code only through a dispatch-time specialization constant (PipelineSpecialization::StorePages, ID 8239). The driver binds that variant only when the build's BDA table carries a store page pool, so every other compute shader compiles as before.
  • Still refused, unchanged:
    • copies, read-only heap mirrors and image mirrors;
    • bytes past the served end;
    • stores into uncommitted holes of a sparse heap, whose spans are clipped to the committed runs.
  • Recorded in the debt file: an atomic whose result leaves a byte unchanged still writes that byte back.

The commits:

  1. bf54c5e942: note only the stored runs of address-store spans as written back. This answers question 1 of the review.
  2. 99f1f37aed, 91e4d82e7c: compare only the pages BDA stores hit, and take the reference on the GPU. The next commits supersede these for address stores.
  3. fbb103c45f: the shader side, which redirects stores into unbound heap mirror blocks to store pages.
  4. bbeb08e9f6: resident mirrors without binding, copying or reading back the span.
  5. 7e7c81a2aa: copy-backed mirrors by per-byte store masks.
  6. 425cd9d8b0: store page pools reused across address-based builds.
  7. 6c6997ec33: unbound blocks written back by their store masks, so a stored zero isn't lost. This answers point 1 of the second review.
  8. 92409250c8, 822a2b879e: tests that pin store page exhaustion, at a small pool's size and at 1,025 pages against the default pool (point 2).
  9. 1aa803e9d3: a merge of main.

Cost

Each figure is the extra work of a storing dispatch over a load-only dispatch on the same heap, per dispatch. It's measured on lavapipe (4-vCPU Xeon, Release) as the mean of two runs, at 0, 1 and 16 stored blocks.

heap before (91e4d82e7c): wait, ms now: wait, ms now: CPU, ms bound after a store into a zero heap
8 MiB in 4 runs 4.2-6.3 0.1-1.0 0.0-0.3 1 MiB (was 7.8)
36 MiB in 16 runs (the report's shape) 23.5-27.6 0.1-1.4 0.0-0.5 1 MiB (was 35)
36 MiB in 1 run 14.6-15.7 0.1-1.3 0.0-0.6 1 MiB (was 36)
72 MiB in 16 runs 45.8-51.8 0.1-1.4 0.0-0.5 1 MiB (was 71)
  • The first version of this PR (781dc4525b) added 7.3-80.6 ms of CPU per dispatch for these heaps.
  • The 1 MiB bound after a store is the next refresh binding the block that now holds data; nothing is bound to take the store.
  • A 2 GiB heap with one block stored runs inside APS5_HEAP_MIRROR_MIB=64, with 1 MiB bound and 0.4-1.4 ms of wait.
  • Compile time, cold, on lavapipe: agc_driver_flat_store takes 73.4 s, against 75.7 s with no store-page code. The runtime_formatted_store tests take 25.6-27.3 s, against 27.3-29.9 s. Inlining the store-page code into every compute shader, the first try, made them 23-46 % slower, which is why it's specialized.
  • Resident Evil Village (PPSA01556), a title that works today: it never takes the changed path, so its cost is the specialization/ABI change only.
    • A counter build of this PR logged no address-storing build (no [bda-store-spans] line) to the static menu +15 min.
    • On this pair's tree family, its mirror census reads 1 ranges (0.6 MiB, 0 writable, 0 heap 0.0 MiB), 294164 address-based builds served. 6c6997ec33 changes no shader code, so a pair on 425cd9d8b0 measures this head too.
    • The setup:
      • B A A B, unprofiled, from the static menu +5 to +15 min, on an NVIDIA GeForce RTX 3070 Laptop GPU under Windows.
      • B = main ebb4075168 + 425cd9d8b0; A = the same main. Both arms carry the same three local changes Village needs to boot on that base: a pad fix, #11580 and #10304.
      • The GPU sat in P0 for 98-99 % of samples, and the clocks weren't held.
    • The cut: the 10 s intervals in each boot's aps5-summary.jsonl that start from menu +5 to +15 min (files, the warm-up boot included). b1's and a1's menu times are logged. a2's and b2's weren't, so their cuts use offsets that reproduce the frame rate logged at the time; it moves by at most 0.004 fps within ±20 s of them.
    • Frame rate: B 0.653 and 0.641 fps, A 0.692 and 0.637. B's mean is 2.6 % under A's. The A boots' spread is 8.2 % of the A mean. a1 was first posted as 0.691; its file at the logged menu time gives 0.692.
    • The phases, B against A, as the median of the 10 s intervals and as the presents-weighted mean: Driver.Packet.draw 1,161 against 1,156 ms per frame (+0.4 %) and 1,185 against 1,161 (+2.1 %); Graphics.Draw +0.1 % and +2.7 %; Graphics.Draw.draw_and_resource_release +0.05 % and +2.6 %. They replace the figures first posted here (Driver.Packet.draw +0.5 %, Graphics.Draw +1.1 %, draw_and_resource_release +1.0 %), which didn't say median or mean and don't all reproduce from the files.
    • Boot to boot: the weighted Driver.Packet.draw is 1,185 and 1,184 ms in the B boots, and 1,103 and 1,223 in the A boots. The A boots differ by 10.8 %, more than the gap between the arms.
    • Non-game CPU, the harness's reading for each boot: b1 36.0 %, a1 29.8 %, a2 35.7 %, b2 35.1 %. a1, the fastest boot and the one with the lowest phases, is 5.3-6.2 points under the other three, more than the 5 points we allow between boots.
    • The same in every boot: 0 shader cache misses after the warm-up, 0 failed imports, matching renders, and private memory within about 120 MB.
    • The cache key changes with the recompiler's source hash, as for any recompiler change, so expect one cold-cache boot per key.

Tested

  • agc_driver_bda_store_heap_mirror, also run as _no_space_cache (APS5_NO_ADDRESS_SPACE_CACHE=1) and as _budget (--budget, APS5_HEAP_MIRROR_MIB=64). Each case was run against a tree with its own mutation (red) and on this branch (green):

    • Budget: a 2 GiB committed heap, copy-backed and resident, with one block stored, once bound and once unbound. The bytes reach guest memory, the use stays inside 64 MiB, and the counters show bound, reference and readback bytes far below the span.
      • Red, the span bound as on 781dc4525b: "a store into one bound block of a 2 GiB heap: the store of thread 0 reached guest memory as 0x0, expected 0x5a000000".
      • The test's refusal check also matches (APS5_HEAP_MIRROR_MIB), so a refusal can't pass quietly.
    • An unbound block stored, read in the same dispatch, and after write-back.
      • Red, spill write-back removed: "a store into an unbound block: the store of thread 0 reached guest memory as 0x0".
      • Red, same-dispatch read not redirected: "a read in the same dispatch of thread 0's store into an unbound block returned 0x0".
    • A CPU byte in the same page and the same dword as a GPU byte store, during the dispatch (bound and unbound, resident and copy-backed). Red with each of:
      • the shadow comparison skipped;
      • every byte of the page written back;
      • guest memory used as the reference;
      • masks ignored.
    • Two storing dispatches with no wait, and a CPU store between their write-backs. Red with guest memory as the reference, and red with masks ignored.
    • Chained dispatches (a dispatch reads what the one before stored into an unbound block). Red, pending-write note removed: "the first of two storing dispatches lost the store of thread 0".
    • Labels (LabelTests):
      • a label the dispatch doesn't touch keeps the CPU's bytes, and the [recorder] write-back-over-label counter stays 0;
      • a label a thread stores over is still noted.
      • Red on 781dc4525b.
    • A zero store into an unbound block (ZeroStoreTests, resident and copy-backed): the guest block holds non-zero bytes, and 64 threads store zero, as a dword and as a byte. Red: 425cd9d8b0's code with only this test fails agc_driver_bda_store_heap_mirror and _no_space_cache on Linux (run 41047122594).
    • Store page exhaustion:
      • agc_driver_bda_store_heap_mirror_store_pages: a small pool takes every slot. A dispatch that needs one more page leaves guest memory untouched.
      • _store_pages_default: 1,025 distinct pages against the default pool, resident and copy-backed. It asserts that none of that dispatch's stores landed. It doesn't assert that 1,024 fit.
    • The earlier cases (sparse runs, the mixed GLOBAL and V# store, the read-only control) still pass.
  • agc_driver_bda_device, shader level: six mutations of the store-page code, each red, e.g. "a read after a store into an unbound heap mirror block in the same dispatch returned 0x77777777" and "a store finding no free store page did not fault". Two more cases check that the store-page pipeline is selected and cached.

  • Linux (lavapipe, Ubuntu 24.04, GCC 13.3, Release, CI's flags), at 425cd9d8b0:

    • each of the six commits builds and passes its focused tests;
    • the BDA tests passed 10 of 10;
    • ctest -R '^(agc|shader)' --parallel 4: 1,132 tests, 1,059 passed, 73 skipped, 0 failed.
  • GitHub's runners at this head, run 41102347191, ×10: every ^agc_driver_bda_ test, including the five heap mirror tests, plus agc_driver_recorder and agc_recorder_command_buffer_release.

    • Linux: 126 tests. 118 passed 10 of 10, 8 skipped, 0 failed.
    • Windows: 141 tests. 42 passed 10 of 10, and 99 skipped, since the runner has no Vulkan device; the BDA store tests are among the skipped. 0 failed. The branch builds there.
    • The libc and libkernel suites, run with APS5_SKIP_TIMING_TESTS=1, pass: 198 and 307 tests on Linux, 225 and 327 on Windows.
  • Vulkan validation (Khronos layer, ANYPS5_NO_SHADER_CACHE=1), on 92409250c8 (run 41039517488): the heap mirror tests show only VUID-VkDeviceCreateInfo-pNext-pNext, from device creation. TechLevelZero's NVIDIA run lists the same ID among main's own, in 427 tests. The store-page variant pipelines add none.

  • NVIDIA RTX 2000 Ada Generation, TechLevelZero's NVIDIA GPU test at this head (comment): merged onto main 9f748f4, driver 595.99.02, the Khronos layer. 2,400 passed, 0 new failures, and no new validation IDs in 916 GPU tests.

  • AMD Radeon RX 9070 XT (RDNA 4), by @bunbeans2-arch, at 425cd9d8b0 (comment): Windows 11 Pro 10.0.22631, driver 32.0.32015.7029 (amdvlk64), MSYS2 UCRT64 g++ 16.1.0, Release, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and the Khronos validation layer (the loader inserts it in every run). The head merged onto main f7f03daf52, 3 runs per side:

    • agc_driver_bda_store_heap_mirror, _budget and _no_space_cache pass 3 of 3.
    • agc_driver_bda_device, agc_driver_bda_reads_shadowed_results, _per_build, agc_driver_host_import_failure_handles, agc_driver_recorder and the agc_recorder_* tests pass 3 of 3, as on main.
    • No VUID- line on either side.
  • Checks:

    • check_conventions.py and check_test_registration.py pass.
    • MinGW-w64 -fsyntax-only is clean on the eight changed files that toolchain can parse. GuestBufferMemory.cpp and Recorder.cpp stop at the same CpuTopology.hpp header gap as main's copies.
  • A probe on main and on this head, run on fork verify branches only (BdaMirrorStoreProbe.cpp, which isn't part of this PR): 64 threads make a GLOBAL store into a 2 MiB writable guest heap, outside any declared write. The host-import budget is held so that the heap is served by a heap mirror, and the probe checks that it is.

    • main 7c444b77ad (run): the store is refused as "read-only in the BDA table", and none of the 64 values reaches guest memory, in 3 of 3 runs.
    • This head, bcc617f141 (run): the same probe stores all 64 values with no refusal, in 3 of 3 runs.
    • Both ran on GitHub's Linux runner (llvmpipe). The Windows runner has no Vulkan device, so the probe skips there.
  • Ghost of Tsushima Director's Cut (PPSA02225), by @milescoviello, at bcc617f141 on main 133feb30f0 (comment): Ubuntu 26.04.1 (kernel 7.0), NVIDIA GeForce RTX 4070 Ti (driver 615.71.09), i7-13700K, Release libraries, 4K output, main's defaults with only the 10 s summary, a 22 GiB cap. One 600 s run per arm, from the same pinned save with scripted presses, both with a cold shader cache.

    • No refusal in either arm: neither logs deferred write-back failed: BDA access failed, the store hit or read-only in the BDA table. On this route the store isn't refused on main, so the pair can't show the fix.
    • Both arms create the intro H.264 decoder and run to the 600 s timeout without a device loss: 1,103 presents on main, 1,112 with this PR.
    • The last stretch differs: with this PR, after 416 s, 1 or 2 presents per 15 to 40 s window, and 555 shaders prepared at use against 393. The tester reads this as that arm being further into a heavier scene with a cold cache, which one run per arm can't separate from scene variance.
    • The b11c7bf84f runs below were on Windows, with a display that stayed black after the "Sony Interactive Entertainment presents" card, and their stores were refused right after the intro decoder was created. This pair's arms create that decoder too, so the difference lies in the main commit, the OS and GPU, or the save, and one pair can't say which.
  • Ghost of Tsushima Director's Cut (PPSA02225), by @sktharunbalaji13-cmd, at 3fa9852e8c (comment): retail v02.024.000, NVIDIA GeForce RTX 4060 Laptop GPU (8 GB, driver 617.42), 16 GB of RAM, Windows 11, MinGW g++ 15.2, Release. Both arms run the same executable and environment (only APS5_SKIP_REFUSED_DRAWS=1 and APS5_PROFILE_DRAW=1), with only the driver libraries swapped.

    driver runs read-only in the BDA table faults
    main b11c7bf84f 3, of 150-300 s each 7 per run, every one the store hit 0x1549750000+0x4eeb0000 (instruction 0x1b4, 4 bytes, compute)
    this PR at 3fa9852e8c 2, of 240 s and 450 s 0
    • Past the fault: on main the faults come right after the intro H.264 decoder is created. The 450 s run on this PR goes past that point, with 363 address-based builds and 703 presented frames, and logs no deferred write-back failed, no store-page refusal and no not implemented stop. The title was still running at the end of the window.
    • Not changed: the display stays black after the "Sony Interactive Entertainment presents" card, as on main.
    • Device memory, in later 150 s runs of the same tree (#15296, I#5166): 2 of the last 3 aborted, at about 120 s and at 135 s, on vkAllocateMemory of a heap mirror slab with device heap 0 past its 7,188 MiB budget. The tester traces it to the 16 MiB slabs of the two big heaps' mirrors. With #15295 added, a run didn't abort in 150 s, and the heap mirror budget was lowered 9 times instead. Whether main alone reaches this in the same conditions wasn't measured.
    • One local change to boot, outside this PR: relinked with main b11c7bf84f's relinker, the title aborts at about 1 s on Windows, because prospero/steamnetworkingsockets.prx starts deferred. Their relinker starts it at process start instead (I#5166), and both arms use that executable.
  • Ghost of Tsushima Director's Cut (PPSA02225), by @sktharunbalaji13-cmd, at 425cd9d8b0 (comment): retail v02.024.000, NVIDIA GeForce RTX 4060 Laptop GPU (8 GB, a 7,188 MiB budget), 16 GB of RAM.

    • The budget stop is gone. The run of 781dc4525b stopped on heap mirror of 0x127c000000+0xa9800000: past the budget (4014 MiB, limit 2816 MiB). On this head that stop doesn't occur, and nothing about store-page exhaustion is logged with the default pool of 1,024 pages.
    • Frames: the title presents 129 frames. The last, at a guest time of 107.0 s, is the disclaimer screen, not black.
    • The next stop: at 114.7 s, in compute shader 0x20001ef700, AGC graphics: native multisample stencil or depth format import is not implemented. That's the multisampled depth import #9533 adds, outside this PR.
  • Ghost of Tsushima Director's Cut (PPSA02225), by @milescoviello, at 425cd9d8b0 with #9742 (comment): main 98ddd9c179 + #12840 425cd9d8b0 + #9742 1c904e29a2 (#9533's 6eb141ce5f inside), merged cleanly; Linux, RTX 4070 Ti (NVIDIA 615.71.09), release libraries, 21 GiB cap, booting from a settings save. The run stops 33 s in on a check outside this PR, native multisample depth sampled identity or format mismatch in compute shader 0x20001ef700, which #9717 takes.

  • e6c85d37f5, a merge of main d30e04fb8a, and 582e856556, the journal race test (test-only).

    • Why: merged with current main, this branch failed agc_driver_pipeline_journal 3 of 3, at the replay-race assertion from chitters2004's 307f2202e7: "a dispatch and the replay both built a compute pipeline: 32 built for 24 replayed". The merge has no textual conflict, so GitHub didn't flag it.

    • The cause: the race records its 32 compute pipelines into the journal that the test binary's earlier cases already use, capped at APS5_PIPELINE_JOURNAL_MAX_MIB=1.

      • With the store-page lookups, every shader that stores through an address carries more SPIR-V: the race's fixture grows from 6,582 to 7,819 words, and each journal module record from 26,924 to 31,880 bytes.
      • So the 32 records and the earlier ones no longer fit, and the journal evicted the oldest 8, as its cap says it should.
      • The identities match on both devices, no StorePages=1 variant is built, and nothing is rejected. The 8 were evicted, not lost.
    • The fix: the test sets the journal aside, records its 32 pipelines into an empty journal (1,022,496 of 1,048,576 bytes), requires all 32 to be journaled before racing, and puts the earlier journal back afterwards. When they don't fit, it now says so instead of reporting a double build. The race check is unchanged. Red: 20 of 20 failures on the merge without the fix; green: 20 of 20 with it (cloud Linux, lavapipe).

    • The cost: address-writing compute modules are 18.8 % larger in SPIR-V words and 18.4 % larger in journal bytes. On llvmpipe this binary's first run, before Mesa's shader cache holds its pipelines, now takes about two minutes, so its registration sets TIMEOUT 240, as agc_shader_disk_cache_large_file does. On GitHub's Linux runner, --repeat ×3, with the first run cold:

      Tree First run Later runs Run
      main d30e04fb8a 67.8 s 5.1, 5.1 s 41175053022
      main + this PR + the fix 118.9 s 7.9, 7.8 s 41169371014

      That's +75 % for the cold run and about +53 % warm. It isn't measured on a GPU: TechLevelZero's NVIDIA run of this head (report) passed, but its test selection didn't include agc_driver_pipeline_journal. The compile growth comes from the store-page branch in each address lookup; it can be narrowed in a follow-up if reviewers want it.

    • ×10 on 582e856556 (run): this PR's store-heap-mirror, BDA and recorder tests, the ^agc_driver_bda_ and ^agc_bda tests, and agc_driver_pipeline_journal.

      • Linux: 127 run, 119 pass, 8 skip, 0 fail. This PR's five agc_driver_bda_store_heap_mirror* tests passed every run. The 8 skips are other tests in the set (host-import and unit-shadow cases this runner can't run). agc_driver_pipeline_journal took 108.3 s on its first run and 8.3 to 8.7 s after.
      • Windows: 142 run, 42 pass, 100 skip (no Vulkan device), 0 fail.
      • The libc and libkernel suites run 199 and 308 tests on Linux and 226 and 330 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 6bec085232, the journal watermark test (test-only, tests/execution/PipelineJournal.cpp), for @jotitadev's review.

    • Why: with the default ANYPS5_ENABLE_SPIRV_TOOLS=OFF, agc_driver_pipeline_journal failed every run at EvictionWatermarkTests: "three consecutive records after a rewrite triggered another rewrite", 92 bytes over the 1 MiB cap. GitHub's Linux runner builds with ON, where the modules are smaller, so it passed there.
    • The cause: a rewrite leaves the journal at most at its target, three quarters of the cap, so it guarantees 262,144 bytes free.
      • The case's three records carried a fixed 16 Ki-word payload, 279,288 bytes on main.
      • They fit there only because the rewritten journal sat 36,880 bytes under the target.
      • The store-page lookups make each module about 4,956 bytes larger.
    • The fix: each record is sized from the rewrite target.
      • The case encodes the fixture's module as the journal does, and adds user words until the module and compute records take 65,536 bytes, a quarter of the room above the target. The three take 196,608 bytes, whatever the fixture's SPIR-V.
      • It keeps the journal EvictionTests just rewrote, because an empty journal couldn't trigger a rewrite whatever the target.
      • The four checks are unchanged. Raising the production rewrite target to 7/8 or 15/16 of the cap turns the case red (cloud Linux, lavapipe).
    • Red: 582e856556 with OFF fails 3 of 3 with that message on GitHub's Linux runner (run).
    • ×10 with OFF (run) and ×10 with ON (run), on Windows too: agc_driver_pipeline_journal, the graphics binary's agc_pipeline_journal and agc_pipeline_journal_long_paths, and every ^agc_driver_bda test.
      • Linux, both builds: 127 run, 119 pass, 8 skip, 0 fail.
      • Windows, both builds: 142 run, 42 pass, 100 skip (no Vulkan device), 0 fail.
      • The libc and libkernel suites run 199 and 308 tests on Linux and 226 and 330 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • Validation (VERIFY_VALIDATION=1 on GitHub's Linux runner, main against this head, the same tests): both pass. The loader inserted VK_LAYER_KHRONOS_validation 98 times on main and 103 with this head, and neither log has was not found. Both report only VUID-VkDeviceCreateInfo-pNext-pNext, so the change adds none.
    • ^agc once with OFF (run):
      • Linux: 1,140 run, 1,065 pass, 75 skip, 0 fail.
      • Windows: 1,185 run, 356 pass, 828 skip, 1 fail. agc_driver_graphics stops at this PR's own check "a writable heap mirror a program stores to through addresses is not writable in the BDA table" (tests/BdaResources.cpp, from 781dc4525b).
      • That runner has no Vulkan device. In this run, the test's own context logs host imports failing at vkAllocateMemory (−2 and −1000072003) and falling back to copies. The repository's Windows CI job fails the same check at this head (run): it now runs the AGC tests, which its run at 582e856556 didn't.
      • 6bec085232 doesn't touch it. d22d9c1a11, below, brings the case up to date.
  • NVIDIA (TechLevelZero's GPU runner, 6546250585): 6bec085232 merged onto main 73f4f7e, RTX 2000 Ada, driver 595.99.02, Linux. Passed: 2,436 passed, 0 new failures (4 fail on main too), and no new validation IDs against main over 929 GPU tests. Its GPU pass ran agc_driver_graphics and the four agc_driver_bda_store_heap_mirror tests it selected (_budget, _no_space_cache, _store_pages, _store_pages_default), all passed. Its selection didn't include agc_driver_pipeline_journal, and agc_driver_graphics' heap-mirror case skips on Linux (no guest arena), so neither of those is measured there.

  • d22d9c1a11, the Windows heap mirror case (test-only, tests/BdaResources.cpp +77 −41).

    • Why it failed: heapMirrorTests runs only where the guest arena exists, which is Windows. It runs on the mock context, which has no sparse residency, so every heap mirror in it is copy-backed. Since 7e7c81a2aa, a copy-backed writable mirror is Read|Write|Masked in the BDA table, and its write-back stores only the pages the GPU reports. The case still expected Read|Write and reported no stores, so it failed on Windows every time, whatever the GPU. The production code is right; the case was out of date.
    • The fix: the writable part runs twice, first on a mirror forced copy-backed (SetResidentAddressSpaceLimit(1), as BdaStoreHeapMirror.cpp does), then on the mirror the context gives. Each pass requires one mirror of the expected kind and expects exactly Read|Write|Masked for a copy-backed mirror, or Read|Write for a resident one with every block bound. It reports its three stores as the BDA does (NoteAddressStores, NoteStorePages) before WriteBack. The other checks are unchanged.
    • Red and green on GitHub's Windows runner: at 6bec085232, agc_driver_graphics fails (run). At d22d9c1a11 it passes 10 runs in a row, with this PR's journal and BDA tests, with OFF (run) and with ON (run). Linux: 128 run, 120 pass, 8 skip, 0 fail. Windows: 143 run, 43 pass, 100 skip (no Vulkan device), 0 fail.
    • A mutation that drops Write from copy-backed mirrors' ranges turns agc_driver_graphics red on Windows and four of the agc_driver_bda_store_heap_mirror tests red on Linux (run).
    • ^agc once at d22d9c1a11 (run): Linux 1,150 run, 1,075 pass, 75 skip, 0 fail. Windows 1,185 run, 357 pass, 828 skip, 0 fail.
    • The libc and libkernel suites run 199 and 308 tests on Linux and 226 and 330 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 9d2c13fd78, a merge of main 0836dfdf4f (run with ON, run with OFF).

    • The conflicts:
      • CMakeLists.txt, from #12862's split, resolved with tools/agc_test_split.py resolve. This PR's registrations move into a new tests/cmake/agc_driver_bda_store_heap_mirror_tests.cmake (+26) and into agc_driver_pipeline_journal_tests.cmake (+4, its TIMEOUT 240). Its StorePageGather.comp build rule stays in CMakeLists.txt.
      • Graphics/include/GuestBufferMemory.hpp, where ashwin280802's #13581 (heap mirror eviction) adds HoldsMirror, EvictMirror, WasEvicted and RecordEvicted at the spot where this PR adds AllowAddressStores, NoteAddressStores and the store span and page types. Both sides are kept, each unchanged.
    • This PR's own diff is unchanged apart from the registration move.
    • #13581's eviction can't drop a mirror that holds this PR's pending stores (read at the merge). sweepMirrors takes a writable heap mirror only when the mirror cache holds its one reference. The memory that records store spans for a mirror (writable heap mirrors only, at upload) holds it through its region's shared_ptr until WriteBack has consumed the stores. EvictMirror and RecordEvicted act only on a memory still being built, which has no spans or pages yet.
    • The count: with -DBUILD_TESTING=ON, ctest -N gives 3080 tests: main's 3075 plus this PR's 5, each listed once, and agc_driver_pipeline_journal with this PR's TIMEOUT 240.
    • ×10 on GitHub's runners, with ON and with OFF: this PR's journal, BDA and store-heap-mirror tests, agc_driver_graphics and #13581's agc_driver_resident_heap_mirror. Linux: 17 run, 17 pass, 0 skip, 0 fail. Windows: 18 run, 5 pass, 13 skip (no Vulkan device), 0 fail; agc_driver_graphics passes. The libc and libkernel suites run 199 and 308 tests on Linux and 226 and 330 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • On a cloud Linux machine (lavapipe, CI's flags; result): with ON, this PR's set ×10 (160 runs) and agc_driver_resident_heap_mirror ×10 pass, and ^agc gives 1,158 run, 1,083 pass, 75 skip, 0 fail. With OFF, the set and #13581's test pass ×3.
  • a896536714 and d28c760af1, from oneandonlydean's review (run with ON, run with OFF).

    • a896536714:
      • The two store-page tests no longer require the "found none of the N store pages free" text.
      • The case at exactly the pool size is unchanged.
      • The over-limit dispatch must leave guest memory untouched. _store_pages_default already checked that, and _store_pages now checks that none of its threads' values reach any of its pages.
    • d28c760af1: a new debt entry, "Store page pool", says what a title gets past the pool. The use's fault check throws that message, none of its stores into heap mirrors reach guest memory, and raising APS5_BDA_STORE_PAGES gives a use more pages.
    • ×10, with ON and with OFF: the same set as above. Linux: 17 run, 17 pass, 0 skip, 0 fail. Windows: 18 run, 5 pass, 13 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 199 and 308 tests on Linux and 226 and 330 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • Not run: a title-level cost comparison against a baseline on real hardware.
  • NVIDIA RTX 2000 Ada Generation, TechLevelZero's NVIDIA GPU test at d28c760af1 (comment): merged onto main d5ec8e6, driver 595.99.02, Linux, the Khronos layer. Passed: 2,494 passed, 0 new failures (3 fail on main too and 1 is unstable there), 45 skipped, and no new validation IDs against main over 939 GPU tests.

    • Its GPU pass ran agc_driver_bda_store_heap_mirror (passed, 7.96 s) and, this time, agc_driver_pipeline_journal (passed, 134.0 s with the layer and ANYPS5_NO_SHADER_CACHE=1). The report gives no main time for the journal test, so this isn't a cost comparison. Its selection didn't include this PR's other four store-heap-mirror tests or agc_driver_graphics.
    • agc_driver_bda_store_heap_mirror is this PR's own test, so main's baseline doesn't have it and its validation wasn't compared.
  • b6f54ac940, a merge of main 5bae1a4bc2 (run with ON, run with OFF, validation).

    • The conflict: #14839 reverted liskeee's #13931 (persistent compute pipeline binaries) on main. The previous merge, 6f7d8f1277 (main d8b60b46ed), had kept #13931's ComputePipelineObjects::binaryLayoutKey and its fill in createComputePipeline beside this PR's storePages and SPIR-V scan, in Execution/src/VulkanDevice.cpp, so the revert conflicted there. The merge takes main's side for #13931's lines and keeps this PR's, so no PipelineBinaryStore or binaryLayoutKey is left in the file.
    • This PR's diff is unchanged: the merged tree is the same as merging main 5bae1a4bc2 into d28c760af1, the head before 6f7d8f1277, and the changed lines are the same in all 31 files. Only PipelineJournal.cpp's context moved, from main's eb4ec317c0.
    • ×10, with ON and with OFF: this PR's journal, BDA and store-heap-mirror tests, agc_driver_graphics and #13581's agc_driver_resident_heap_mirror. #13931's two pipeline-binary tests left main with the revert. Linux, both builds: 18 run, 18 pass, 0 skipped, 0 fail. Windows, both builds: 19 run, 5 pass, 14 skipped (no Vulkan device), 0 fail. The libc and libkernel suites ran 208 and 309 tests on Linux and 235 and 330 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • Validation (VERIFY_VALIDATION=1 on GitHub's Linux runner, main against this head, the same tests): the loader inserted VK_LAYER_KHRONOS_validation 17 times on main and 31 with this head, and neither log has was not found. Both report only VUID-VkDeviceCreateInfo-pNext-pNext, so the merge adds none.
    • The same resolution on a 4-vCPU Xeon (Ubuntu 24.04, GCC 13.3, the CI flags, lavapipe, as an unprivileged user): this PR's 130 tests and every test in the four executables #14839 and #14823 touch (agc_display_buffer_dcc_tests, agc_driver_dcc_keys_first_write_tests, agc_pipeline_cache_allocation_tests, agc_driver_recorder_tests). 137 run, 129 pass, 8 skipped (recorder tests that skip on that machine), 0 fail.
  • TechLevelZero's GPU tests at 6f7d8f1277, merged onto main f2d874c, before the revert:

    • AMD Radeon RX 6300 (RADV NAVI24, Mesa 25.2.8, Linux; report): 2,494 passed, 12 failed and 54 skipped. None of the failures is new: 9 also fail on main and 3 are unstable on main. No new validation IDs against main over 944 GPU tests.
    • NVIDIA RTX 2000 Ada Generation (driver 595.99.02, Linux; report): 2,510 passed, 4 failed and 46 skipped. All 4 failures also fail on main. No new validation IDs against main over 944 GPU tests.
    • With the layer, agc_driver_pipeline_journal took 183.3 s on the AMD card and 132.6 s on the NVIDIA one. Neither report gives a main time for it.
  • 7af65f5066, a merge of main 88e804b0a7. main now has JJenkx's #8874 (heap mirror reference buffers), Celegans12's #9287 (staged copies inside a dispatch run) and JJenkx's #6959 (layered mesh targets).

    • #8874: GuestBufferMemory::takeHeapReferences and releaseHeapReferences keep both sides. Each reference is taken from #8874's ReferenceStorage pool and returned to it, and this PR's copied path (pendingReferenceCopies) still applies inside a recorded run. Where the mirror is cleared, the references are released before this PR's store-page resets.
    • #9287: in ShaderResources.cpp, this PR's RecordStorePageGather runs after #9287's in-run copy-back block.
    • #6959 takes specialization IDs 8237 and 8238 for MeshLayerBase and MeshLayerCount, so StorePages moves to 8239.
    • A code change inside the merge commit: #6959 also adds a loop to buildSpecializedModule in Recompiler.cpp that lists a module's specialization constants. It leaves out only the workgroup offsets and looks every other ID up among the prepared values. StorePages is supplied at dispatch, not prepared, so that lookup threw map::at: before the change, nine tests failed on Linux and three on Windows. The merge commit changes that one line from IsWorkgroupOffset(id) to IsDispatchSupplied(id), the check specializeWords already uses for the same IDs. It's folded into the merge so that no commit fails its tests.
    • This PR's diff over main is otherwise unchanged.
    • ×10 (run): the BDA, heap-mirror, pipeline-journal and graphics tests, with #6959's new tests and the tests that failed before the change. Linux: 29 run, 28 pass, 1 skip (agc_driver_layered_volume_mesh), 0 fail. Windows: 30 run, 12 pass, 18 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (210 and 310) and on Windows (237 and 331). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • Every agc test, once (run): Linux: 1,223 run, 1,146 pass, 77 skip, 0 fail. Windows: 1,259 run, 379 pass, 880 skip (no Vulkan device), 0 fail.
    • NVIDIA: TechLevelZero's NVIDIA bot ran this head merged onto main 88e804b on an RTX 2000 Ada (report): 2,560 passed, 5 failed, none new (3 also fail on main, 2 unstable on main), 45 skipped, with no new validation IDs (978 tests on the GPU).
  • 9fd023a310, a merge of main 5cb015caaa, which brings Pipodi's #12764 (compute scratch backed by a device buffer slot pool).

    • The conflicts: VulkanDevice.hpp and VulkanDevice.cpp, each time one PR's addition next to the other's. The merge keeps both: in the header, #12764's scratchPoolHeader declaration and this PR's specializedComputePipeline; in the source, this PR's StorePages scan and #12764's three-element setLayouts for the scratch pool.
    • This PR's diff over main is otherwise unchanged.
    • ×10 (run): the BDA, heap-mirror, pipeline-journal and graphics tests, with the dispatch-overlap, layered-mesh and layer-specialization tests. Linux: 29 run, 28 pass, 1 skip (agc_driver_layered_volume_mesh), 0 fail. Windows: 30 run, 12 pass, 18 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (279 and 321) and on Windows (306 and 342). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • Every agc test, once (run): Linux: 1,258 run, 1,176 pass, 80 skip, 2 fail. Windows: 1,295 run, 397 pass, 898 skip (no Vulkan device), 0 fail. The two Linux failures:
      • agc_driver_image_sample_lod_clamp_shader_lane fails on main too. #12980 added its bilinear row, and adriadam10's 5821b867e7 on main widens that check after main's push builds failed it on lavapipe.
      • agc_driver_pipeline_journal reached its 240-second timeout while the sweep ran four of its 1,258 tests at a time. In the ×10 above, among 29 tests, it passes 10 of 10, in 57 to 185 s.
    • The journal test's time, run alone three times on GitHub's Linux runner:
      • on main 7feb37ee3e, without this PR (run), its first run reaches the 120-second default timeout;
      • with this PR at 9fd023a310 (run), all 3 pass, in 181.4, 65.1 and 64.2 s, under its TIMEOUT 240.
      • TechLevelZero's AMD machine also lists it as unstable on main: it failed in 4 of the last 6 main runs there (report).
      • So on a cold run on that runner, main's own test already takes longer than 120 s, and this PR adds to that, as the cost note above says.
    • GPUs: TechLevelZero's bots ran this head. NVIDIA RTX 2000 Ada (driver 595.99.02), merged onto main f6232fc (report): 2,753 passed, 5 failed, none new (3 also fail on main, 2 unstable on main), 49 skipped, with no new validation IDs (943 tests on the GPU). AMD Radeon RX 6300 (RADV NAVI24, Mesa 25.2.8), merged onto main 7feb37e (report): 2,740 passed, 9 failed, none new (8 also fail on main, 1 unstable on main), 58 skipped, with no new validation IDs (943 tests on the GPU).
  • a162a98f11, a merge of main 4f41f4c375, which brings #8963 (shared BDA fault buffers, merged first as planned) and ee6aba54's #6185 (WriteBack keeping the CPU's bytes only in host-copied write-backs).

    • The conflicts: CMakeLists.txt, Execution/src/GuestMemory.cpp, Graphics/include/BdaResources.hpp, Graphics/src/BdaResources.cpp, Graphics/src/GuestBufferMemory.cpp and tests/BdaShader.cpp.
    • #8963's fault arena replaces per-build fault buffers with shared 512 KiB chunks, 32-byte slots for report-only builds, and reclaim of idle builds' slots under pressure. This PR keeps its store-page words (pool address, base, slots, overflow) after SrtGuardWord in a full-size fault buffer, so the merge keeps the arena and changes one thing in it:
      • A build that stores through addresses gets a private fault slot: its own one-slot buffer with device-address usage. The arena never shares it with another build and never reclaims it from a live idle build, because its address is part of that build's store-page setup. It is freed when the build is destroyed or evicted, and the arena's slot and chunk counts drop by one, as every slot does with APS5_NO_SHARED_FAULT_SLOTS=1.
      • Fault-only builds keep #8963's shared and report-only slots unchanged.
      • The store-page code reads and writes the slot through the arena (faultBytes() and the slot's device address), where it used to use its own buffer.
    • #6185's ChangedStore composes with this PR's recorded store runs. In GuestBufferMemory.cpp, storeChanged takes #6185's store function and this PR's Pieces* stored: a heap-mirror write-back passes stored and writes through GuestMemory::WriteChanged, recording each run, and every other caller stores with #6185's function. In GuestMemory.cpp, one writeChanged takes #6185's keepGuest and this PR's stored, behind three wrappers.
    • CMakeLists.txt and BdaShader.cpp keep both sides.
    • This PR's diff over main goes from +1,956 −70 to +1,964 −77, in 31 files. The change is in BdaResources.hpp, BdaResources.cpp, GuestBufferMemory.cpp and GuestMemory.cpp.
    • ×10 (run): agc_changed_copy, agc_driver_graphics, agc_driver_pipeline_journal, agc_driver_resident_heap_mirror and every test matching ^agc_driver_bda, ^agc_bda, ^agc_driver_heap_mirror or ^agc_shader_bda. Linux: 18 run, 18 pass, 0 skip, 0 fail. Windows: 18 run, 3 pass, 15 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 300 and 322 tests on Linux and 327 and 342 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • Every agc and guest_memory test, once (run): Linux: 1,281 run, 1,197 pass, 83 skip, 1 fail. Windows: 1,317 run, 402 pass, 915 skip (no Vulkan device), 0 fail. The one failure: 992/1281 Test #1389: agc_driver_pipeline_journal ...***Timeout 240.07 sec. It passes 10 of 10 in the ×10 above, and it timed out the same way, at 240.06 s, in this PR's sweep before the merge. TechLevelZero's AMD machine lists it as unstable on main, failed in 6 of the last 8 main runs there (report).
    • GPUs: TechLevelZero's bots ran this head merged onto main 4f41f4c. NVIDIA RTX 2000 Ada (driver 595.99.02; report): 2,772 passed, 6 failed, none new (3 also fail on main, 3 unstable on main), 48 skipped, with no new validation IDs (939 tests on the GPU). AMD Radeon RX 6300 (RADV NAVI24, Mesa 25.2.8; report): 2,758 passed, 10 failed, none new (8 also fail on main, 2 unstable on main), 58 skipped, with no new validation IDs (939 tests on the GPU). Under the validation layer, agc_driver_pipeline_journal took 130.4 s on the NVIDIA card and 240.1 s on the AMD one, whose bot lists it as failed in 7 of the last 9 main runs there.
  • c68d814837, a test of the private fault slot (test-only, tests/BdaResources.cpp). The heap-mirror tests now create a build that stores through addresses over each writable heap mirror, copy-backed and resident:

    • while it lives, the arena counts one more slot, one more chunk and one more holder, and destroying it takes all three back out;
    • under fault slot pressure that reclaims idle builds' slots, the idle storing build keeps its private slot.
    • These builds use a context without the buffer pool, so the memory they free can't serve the heap-mirror budget checks that follow.
    • Red: 75cbd46109 drops || privateSlot from the check in BdaResources' destructor that gives a slot's counts back. On GitHub's Windows runner agc_driver_graphics then fails with "a destroyed build that stored through addresses into a copy-backed writable heap mirror left its fault chunk counted in the arena" (run). On GitHub's Linux runner it passes either way: the heap-mirror tests don't run there ("guest arena unavailable or not write-watched: heap mirrors not tested").
    • ×10 (run): agc_changed_copy, agc_driver_graphics, agc_driver_pipeline_journal, agc_driver_resident_heap_mirror and every test matching ^agc_driver_bda or ^agc_bda. Linux: 18 run, 18 pass, 0 skip, 0 fail. Windows: 18 run, 3 pass, 15 skip (no Vulkan device), 0 fail; agc_driver_graphics, which holds the new case, passes 10 of 10. The libc and libkernel suites run 300 and 322 tests on Linux and 327 and 342 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • c4d6d41dff, a merge of main 04a9eb4fa2 (run). The one conflict was in Execution/include/GuestMemory.hpp, where JAB-dev's #13021 declares WriteChangedIfHeld at the place this PR declares its WriteChanged overload that returns the stored ranges. Both stay, and this PR's diff over main is unchanged.

    • ×10: agc_changed_copy, agc_driver_graphics, agc_driver_pipeline_journal, agc_driver_resident_heap_mirror and every test matching ^agc_driver_bda or ^agc_bda, with #13021's agc_driver_native_depth_publication. Linux: 19 run, 19 pass, 0 skip, 0 fail. Windows: 19 run, 3 pass, 16 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 300 and 324 tests on Linux and 330 and 342 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • TechLevelZero's GPU bots at c4d6d41dff, this head merged onto main 1c8c0ef, 2,853 of 3,842 tests selected. Of this PR's tests, agc_driver_bda_store_heap_mirror and agc_driver_resident_heap_mirror ran and passed on both. The four added registrations (agc_driver_bda_store_heap_mirror_budget, _no_space_cache, _store_pages and _store_pages_default) weren't in either selection.
      • NVIDIA RTX 2000 Ada Generation (report), driver 595.99.02: 2,798 passed, 5 failed (none new: 3 also fail on main, 2 unstable on main), 50 skipped.
      • AMD Radeon RX 6300 (RADV NAVI24, Mesa 25.2.8) (report): 2,783 passed, 9 failed (none new: 7 also fail on main, 2 unstable on main), 61 skipped. No new validation IDs over 960 GPU tests.
      • Both ran before #15423, so their agc_driver_pipeline_journal times include the filler zero-fills #15423 removes.
  • 3fa9852e8c, a merge of main b11c7bf84f, which brings #13858 (×10, every agc test).

    • The conflicts, in BdaResources.hpp, ShaderResources.hpp and BdaResources.cpp. #13858 checks a draw use's fault record through CheckUse(record), and checkFault, markWrittenPages and checkSrtGuard take the record whose fault slot the GPU wrote. This PR's store pages live in that slot too, so the merge has checkFault collect the record's store pages, check its overflow, and re-attach its pages after a loop-guard clear.
      • For a build's own use, the record is the build itself, as before. #13858 reuses only read-only builds, and their records hold no store pages.
      • markWrittenPages keeps this PR's written-page list.
      • Both headers keep both sides' declarations, and BdaResources.cpp keeps #13858's TableBytes and TableGuardCurrent beside this PR's store-page functions.
      • This PR's store-page words come after SrtGuardWord, so #13858's slot cleaning, which clears the fault head and the SRT guard word, leaves them in place.
    • ×10: every test matching ^agc_driver_bda, ^agc_bda, ^agc_driver_address_draw_space_reuse, ^agc_host_import, ^agc_write_tracking or ^agc_driver_host_import_proofs, with agc_driver_resident_heap_mirror and agc_driver_pipeline_journal, which takes in this PR's tests and #13858's. Linux: 28 run, 27 pass, 1 skip (agc_host_import_sparse, no /dev/udmabuf), 0 fail. Windows: 33 run, 8 pass, 25 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 303 and 327 tests on Linux and 334 and 345 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • Every agc test, once: Linux: 1,331 run, 1,246 pass, 85 skip, 0 fail. Windows: 1,370 run, 407 pass, 963 skip (no Vulkan device), 0 fail.
    • TechLevelZero's GPU bots at 3fa9852e8c, this head merged onto main b11c7bf, 2,915 of 3,894 tests selected. Of this PR's tests, agc_driver_bda_store_heap_mirror and agc_driver_resident_heap_mirror ran and passed on both, and so did #13858's agc_driver_address_draw_space_reuse. The four added registrations weren't in either selection.
      • NVIDIA RTX 2000 Ada Generation (report), driver 595.99.02: 2,863 passed, 3 failed (none new: all 3 also fail on main), 49 skipped. No new validation IDs over 990 GPU tests.
      • AMD Radeon RX 6300 (RADV NAVI24, Mesa 25.2.8) (report): 2,847 passed, 8 failed (none new: 7 also fail on main, 1 unstable on main), 60 skipped. No new validation IDs over 990 GPU tests.
      • Both ran before #15423, so their agc_driver_pipeline_journal times include the filler zero-fills #15423 removes.
  • 125faf559e, a merge of main 090f57166a (×10, #15423's test ×10).

    • The conflict: tests/cmake/agc_driver_pipeline_journal_tests.cmake, where main now has #15423's if(BUILD_TESTING) block with agc_driver_pipeline_journal_undecodable_module. This PR's TIMEOUT 240 line for agc_driver_pipeline_journal goes into that block as its first line, so the file keeps one block. This PR's other lines are unchanged; Recorder.cpp and docs/dev/debt/libSceAgcDriver.md differ only in context.
    • ×10: the same tests as on 3fa9852e8c. Linux: 29 run, 28 pass, 1 skip (agc_host_import_sparse, no /dev/udmabuf), 0 fail; agc_driver_pipeline_journal passed 10 of 10, the slowest in 102.8 s. Windows: 34 run, 9 pass, 25 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 327 and 344 tests on Linux and 358 and 371 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • #15423's test: that set names agc_driver_pipeline_journal exactly, so a second ×10 ran agc_driver_pipeline_journal_undecodable_module with this PR's five agc_driver_bda_store_heap_mirror* tests. Linux: 6 run, 6 pass, 0 fail, the new test 10 of 10. Windows: 6 run, 6 skip (no Vulkan device).
  • a62b1d7b8d, a merge of main dd7c8de5de (×10).

    • The conflicts:
      • GuestMemory.cpp: this PR's writeChanged definition, with its stored parameter, takes the [[maybe_unused]] on byteStoreLimit that oberonlift's #15797 added to main's.
      • tests/execution/PipelineJournal.cpp's ReplayRacesDispatchTests: dantdmdarealguy's #15730 builds the race's programs with the shared ReplayedCodes(), 16 programs from salt 8 in place of 32 from salt 16, and drops the function's Pipelines = 32. The merge takes const auto codes = ReplayedCodes(); and keeps this PR's lines: the journal set aside, the raced pipelines recorded into an empty journal and required to be journaled, and the journal put back. Since Pipelines is gone, the count check now reads held == ReplayedPrograms, main's constant.
    • This PR's other changed lines are the same, and GuestBufferMemory.hpp differs in context only.
    • ×10: every test matching ^agc_driver_bda, ^agc_bda, ^agc_driver_address_draw_space_reuse, ^agc_host_import, ^agc_write_tracking, ^agc_driver_host_import_proofs, ^agc_driver_pipeline_journal or ^agc_pipeline_journal, with agc_driver_graphics and agc_driver_resident_heap_mirror. Linux: 34 run, 33 pass, 1 skip (agc_host_import_sparse), 0 fail; agc_driver_pipeline_journal, agc_driver_pipeline_journal_undecodable_module, agc_pipeline_journal and agc_pipeline_journal_long_paths pass 10 of 10. Windows: 40 run, 13 pass, 27 skip, 0 fail. The Windows runner has no Vulkan device, so agc_driver_pipeline_journal and agc_driver_pipeline_journal_undecodable_module skip there with the other Vulkan tests; the graphics binary's agc_pipeline_journal, agc_pipeline_journal_long_paths and agc_pipeline_journal_extended_paths pass 10 of 10. The libc and libkernel suites run 344 and 346 tests on Linux and 375 and 373 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • a3e3e770e7, a merge of main 7259cce111 (×10, every agc test).

    • The conflict: VulkanDevice.cpp's ComputePipelineObjects, where liskeee's #15169 adds binaryLayoutKey on the line this PR adds storePages to. The merge keeps both. #15169's pipeline binary store arguments reach this PR's specializedComputePipeline without a conflict, and the store's key covers the specialization data, so the StorePages variant gets its own binary. oneandonlydean's #17982 has since reverted #15169 on main (see 7cf8f10403 below).
    • This PR's changed lines are the same in all 31 files; only their context differs.
    • ×10: the same tests as on a62b1d7b8d, with #15169's ^agc_pipeline_binary and ^agc_driver_pipeline_binary tests. Linux: 48 run, 45 pass, 3 skip (agc_host_import_sparse, and #15169's agc_pipeline_binary_vulkan and agc_driver_pipeline_binary_startup), 0 fail. This PR's five agc_driver_bda_store_heap_mirror* tests, agc_driver_graphics, agc_driver_resident_heap_mirror and agc_driver_pipeline_journal pass 10 of 10, the journal's slowest in 89.9 s. Windows: 56 run, 27 pass, 29 skip (no Vulkan device), 0 fail. #15169's two Vulkan tests skip on both runners, so these runs don't show the StorePages variant going through a pipeline binary.
    • Every agc test, once: Linux: 1,507 run, 1,412 pass, 95 skip, 0 fail. Windows: 1,550 run, 477 pass, 1,073 skip (no Vulkan device), 0 fail.
    • Suites: libc and libkernel run 350 and 348 tests on Linux with 0 failed, and 380 and 375 on Windows. On Windows, libkernel's guest_kernel_resident_fmem_export and guest_kernel_resident_fmem_export_patched fail in both runs. The same harness fails them on main 7259cce111 alone (run), and main's own Windows job passes them, so they come from the verify harness, not this PR. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 7cf8f10403, a merge of main 47adcad89a (×10, every agc test).

    • The conflict: oneandonlydean's #17982 reverts #15169 on main, since main crashed at boot in PipelineBinaryStore::queryKey. That takes out the binaryLayoutKey member that the merge of 7259cce111 kept beside this PR's storePages in ComputePipelineObjects. The merge drops binaryLayoutKey and keeps storePages. Nothing in the tree uses #15169's store any more, and this PR's changed lines are the same in all 31 files.
    • ×10: the same tests as on a62b1d7b8d, without #15169's 14 tests, which the revert removes. Linux: 34 run, 33 pass, 1 skip (agc_host_import_sparse), 0 fail. This PR's five agc_driver_bda_store_heap_mirror* tests, agc_driver_graphics, agc_driver_resident_heap_mirror and agc_driver_pipeline_journal pass 10 of 10, the journal's slowest in 68.3 s. Windows: 42 run, 15 pass, 27 skip (no Vulkan device), 0 fail.
    • Every agc test, once: Linux: 1,518 run, 1,425 pass, 93 skip, 0 fail. Windows: 1,561 run, 466 pass, 1,095 skip (no Vulkan device), 0 fail.
    • Suites: libc and libkernel run 350 and 348 tests on Linux with 0 failed, and 380 and 375 on Windows, where only the verify harness's guest_kernel_resident_fmem_export and guest_kernel_resident_fmem_export_patched fail, as on a3e3e770e7. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • af6430b3d4, a merge of main 884694cf85 (×10, every agc test).

    • The conflict: chitters2004's #16752 tracks the Vulkan command state. A raw vkCmdBindPipeline through Resolved or function() no longer compiles, and a compute pipeline binds through context.BindComputePipeline, which skips a bind the command buffer already has. Three of this PR's binds move to it:
      • in VulkanDevice.cpp, the dispatch's bind, of specializedComputePipeline's StorePages variant or the record's pipeline;
      • in VulkanDevice.cpp, the bind for each split chunk;
      • in Recorder.cpp, the store-page gather's bind of storePageGatherPipeline, as #16752 does for the recorder's other compute pipelines.
        It's main's API, with this PR's pipelines unchanged. This PR's changed lines are the same in the other 29 of its 31 files.
    • ×10: the same tests as on 7cf8f10403, with #16752's agc_command_state, agc_graphics_state_recorder and agc_graphics_state_recorder_unsuppressed. Linux: 38 run, 37 pass, 1 skip (agc_host_import_sparse), 0 fail. This PR's five agc_driver_bda_store_heap_mirror* tests, agc_driver_graphics, agc_driver_resident_heap_mirror, agc_driver_pipeline_journal and #16752's three tests pass 10 of 10, the journal's slowest in 67.0 s. Windows: 47 run, 18 pass, 29 skip (no Vulkan device), 0 fail.
    • Every agc test, once: Linux: 1,651 run, 1,543 pass, 106 skip, 2 fail. Windows: 1,689 run, 495 pass, 1,194 skip (no Vulkan device), 0 fail. The two Linux failures are main's:
      • agc_driver_global_atomic_csub: "AGC graphics: global atomic csub without glc: wave64 byte 644 is 146, expected 0";
      • agc_driver_coherent_atomic_loads_enabled: a 60-second timeout.
        main's own Linux job fails both, with the same message and the same timeout, at d2949cd806 (job) and at 67ec0f7d8c (job), covered by #19332.
    • Suites: libc and libkernel run 380 and 374 tests on Linux with 0 failed in both runs, and 410 and 402 on Windows.
      • The ×10 run's first Windows attempt (attempt 1): libkernel's guest_timed_wait_cpu failed on its overshoot limits. sceKernelUsleep(500 us) reached a P99 overshoot of 4,303 µs, against a limit of 2,500 µs, and ksem_timedwait(500 us) 3,248 and 3,012 µs. This PR doesn't change libkernel. In the agc run on the same head, the Windows libkernel suite ran 402 tests with 0 failed, guest_timed_wait_cpu among them.
      • The rerun of that job (attempt 2): Windows: 47 run, 18 pass, 29 skip (no Vulkan device), 0 fail, 10 of 10 runs. The libc and libkernel suites ran 410 and 402 tests with 0 failed, guest_timed_wait_cpu among them.
      • The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes only precise_wait's median bounds on GitHub's hosted runners.
    • agc_shader_memory in upstream's Windows job (job): upstream CI merged this head onto main b6717527ce, and agc_shader_memory exited with 0xc0000374 after "read of 0xffffffff00000008". That main sits between #18827 (04:46Z on 14 Nov) and #19893 (08:20Z), and main alone crashes in the same test binary there:
      • main's own push run at 6f6d066c7e (job) exits agc_shader_memory with 0xc0000374;
      • main b6717527ce alone on GitHub's Windows runner (run) passes agc_shader_memory 10 of 10, and agc_shader_memory_coherent_atomic_loads crashes in its 10th run with the same fault address;
      • this head merged onto b6717527ce (run) crashes both tests in their 3rd run, at the same instruction as upstream's job (agc_shader_memory_tests.exe+0x522829).
        On main f0c9b11f91, after #19893, neither test crashes: in 3 runs of 10 per arm, this head merged onto it and main alone each pass agc_shader_memory and agc_shader_memory_coherent_atomic_loads 30 of 30 (this head: 1, 2, 3; main: 1, 2, 3). The Windows trees of these runs had #19899's _putenv_s test fix on top.
  • 3704189764, a merge of main 11992f9695 (×10, ×10 with the Windows test fix, every agc test), which brings adam25136's #17850 (CPU reads of indirect draw records wait for address-based writers).

    • The conflict: docs/dev/debt/libSceAgcDriver.md only. #17850 rewrote the "CPU reads behind an address-based build" entry, right before this PR's two entries. The file merges with merge=union, which would keep the old copy of that entry next to the new one, so the merge takes #17850's entry and keeps this PR's two after it.
    • Diff: this PR's changed lines are the same in all 31 files, and its diff over main stays +1,996 −77. Only context lines moved, in that debt entry and in docs/dev/ENVIRONMENT.md. GuestBufferMemory.cpp, which #17850 also changes, merged without a conflict.
    • ×10: the set of the af6430b3d4 run, with #17850's four agc_driver_indirect_draw_pending_producer* tests. Linux: 45 run, 44 pass, 1 skip (agc_host_import_sparse), 0 fail; #17850's four tests pass 10 of 10. Windows: 57 run, 21 pass, 36 skip (no Vulkan device; #17850's four tests are among them), 0 fail. The libc and libkernel suites run 388 and 384 tests on Linux and 418 and 412 on Windows, with 0 failed. They ran with APS5_SKIP_TIMING_TESTS=1, which relaxes only precise_wait's median bounds on GitHub's hosted runners.
    • Every agc test, once, on Linux: 1,809 run, 1,686 pass, 114 skip, 9 fail.
      • Seven also fail in main's own Linux job at 3e1b183e43 (job): agc_driver_global_atomic_csub, agc_driver_stencil_copy_draw, agc_driver_coherent_atomic_loads_enabled, agc_driver_image_table_packed_guards, agc_driver_recorder, agc_draw_input_mirrors and agc_draw_input_reuse.
      • The other two, the agc_driver_runtime_buffer_spans_x3_spans and _x4_spans timeouts, passed there. Over 10 runs of main 790e9a371c with #19899's test-only commit on top (run), both time out too.
    • The Windows tree: the Windows runs had Sankalp7317's #19899 on top, since main's Windows test build stops at "'setenv' was not declared" in UploadCacheReadOnlyFlush.cpp (from #18037). It isn't on this branch. The Windows builds of the first ×10 and of the agc run, on this head alone, stopped at that error.
    • No GPU run on 3704189764.
  • bcc617f141, a merge of main 0173f20a5f (×10, every agc test), which brings Ketz7's #20870 (a BDA fault recorded with one atomic claim).

    • The conflict: one line in Graphics/src/BdaResources.cpp, at the Require that a fault record without a publication holds no data. #20870 changes its last check from report.otherFaults == 0 to report.claim == 0, and this PR adds its pagesOverflowed Require on the next line. The merge keeps #20870's line, with this PR's after it.
    • Diff: this PR's changed lines are the same in all 31 files, and its diff over main stays +1,996 −77. Its patch-id changed, since the line before this PR's Require is now #20870's.
    • The fault buffer layout: #20870 grows BdaAbi::Fault from 32 to 40 bytes (otherFaults becomes claim, discard and reserved). This PR's store-page words follow the fault record and chain from WrittenOverflowWord = sizeof(Fault) / 4, so they move with it, and FaultBufferBytes grows to match. In the merged code, the host side, the SPIR-V emitter (SpirvBdaLookup.cpp, SpirvMemoryInstructions.cpp) and the tests address these words through the BdaAbi constants, and the store-page gather shader gets its word indices as push constants from Recorder.cpp, so no word index is written out by hand.
    • ×10: the set of the 3704189764 run. Linux: 45 run, 44 pass, 1 skip (agc_host_import_sparse), 0 fail; agc_driver_bda_device and agc_shader_memory, whose tests #20870 changes, pass 10 of 10. Windows: 57 run, 22 pass, 35 skip (no Vulkan device), 0 fail.
    • The suites: libc and libkernel run 391 and 390 tests on Linux and 422 and 417 on Windows. Libkernel: 0 failed on both. Libc: guest_multibyte_locale, which checks that wcstombs fills the capacity mid-character, fails on both. That comes from main: gurtgg's #21244 (merged 08:27Z on 16 Nov) stops wcstombs before a character that doesn't fit, main's own push run at dcf3d15978 fails the test on Linux and Windows, and oneandonlydean's open #21515 reverts #21244. This PR changes no libc file. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes only precise_wait's median bounds on GitHub's hosted runners.
    • Every agc test, once: Linux: 1,876 run, 1,746 pass, 123 skip, 7 fail. Windows: 1,918 run, 559 pass, 1,359 skip, 0 fail. agc_driver_graphics, which holds #20870's BdaResources test changes, passes on both.
      • Six also fail in main's own Linux job at dcf3d15978 (job): agc_hook_clear_access, agc_hook_clear_access_off, agc_driver_recorder, and the agc_driver_runtime_buffer_spans_x2_spans, _x3_spans and _x4_spans timeouts.
      • The seventh, agc_driver_image_table_packed_guards, fails the same way in main's own Linux job at e249fc47b5 (job): three identical "stage 4 pc 0x68" records, then "unrecoverable packed table format was not poisoned". fernandomcrsilva's #21255 changes that test.
      • The suites: libc's guest_multibyte_locale on both, as above. On Linux, libkernel's guest_thermal_sensors also reached its 20 s timeout. It times out in every run I have on GitHub's Intel Xeon 6975P-C runners, main 0694c4cbd6 alone included (run), and passes in 0.01 to 0.02 s on GitHub's AMD EPYC runners and in main's own job. This PR changes no libkernel file.
    • The Windows tree again had #19899's _putenv_s test fix on top; it isn't on this branch.
    • A GPU run on bcc617f141: @domx4q's RTX 4090 run with the validation layer (below).
  • NVIDIA GeForce RTX 4090, by @domx4q, with the Khronos validation layer (comment): Arch Linux (kernel 7.3.4), GCC 16.2.1 Release, driver 620.70.06, Vulkan 1.4.357, validation layer 1.4.363.1, with ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1. This head bcc617f141 merged onto main e4caa07950 (a clean merge), against main e4caa07950 alone, ctest -R '^agc_(driver_bda|bda|driver_resident_heap_mirror|driver_pipeline_journal|pipeline_journal|host_import_sparse|shader_memory)'. main: 19 of 19 run pass, 3 skip. This PR: 24 of 24 run pass, 3 skip, including the five agc_driver_bda_store_heap_mirror* tests main doesn't have. The same three skip on both sides: agc_driver_bda_reads_shadowed_results and _per_build (the device reports watched host memory written when it imports or reads it) and agc_host_import_sparse (udmabuf's size_limit_mb is above 1024). No VUID- line on either side, and every device test selected the RTX 4090.

  • a96efaa504, a merge of main 8bb7635fe0 (×10, every agc test), which brings atinseau's #18842 (64-bit image and buffer atomics emulated on devices without them).

    • The conflicts: three, all where #18842 and this PR each add specialization constants that a compute pipeline gets at dispatch rather than at build:
      • core/shader/recompiler/PipelineSpecialization.hpp: #18842 adds IsAtomicLockTable (the two words of its lock table's address, ids 8244 and 8245) where this PR adds IsDispatchSupplied (the workgroup offsets and StorePages). The merge keeps both functions.
      • core/shader/recompiler/Recompiler.cpp: both change the condition that leaves such a constant out of a module's build-time specialization. The merge leaves out both sets: !PipelineSpecialization::IsDispatchSupplied(id) && !PipelineSpecialization::IsAtomicLockTable(id).
      • VulkanDevice.cpp, specializedComputePipeline: #18842's PipelineSpecialization constructor takes the lock table's address. The merge keeps this PR's version of the function (its four-word key with storePages, and the replaced list with StorePages) and builds it as #18842 does: PipelineSpecialization(shader, context.atomicLockTable, replaced).
    • Diff: this PR's changed lines are the same in 29 of its 31 files, and its diff over main stays +1,996 −77. In Recompiler.cpp and VulkanDevice.cpp, its one changed line in each now carries #18842's addition, so its patch-id changed.
    • ×10: the set of the bcc617f141 run, with #18842's agc_driver_buffer_atomics, _float, _inc_dec64, _or_swap64 and agc_driver_image_atomics64, and agc_placeholder_images, whose tests #18842 changes. Linux: 51 run, 50 pass, 1 skip (agc_host_import_sparse), 0 fail; this PR's five agc_driver_bda_store_heap_mirror* tests and #18842's five pass 10 of 10. Windows: 63 run, 23 pass, 40 skip (no Vulkan device), 0 fail.
    • The suites: libc and libkernel run 391 and 391 tests on Linux and 422 and 418 on Windows, with 0 failed; guest_multibyte_locale passes again on both. They ran with APS5_SKIP_TIMING_TESTS=1, which relaxes only precise_wait's median bounds on GitHub's hosted runners.
    • Every agc test, once: Linux: 1,876 run, 1,744 pass, 123 skip, 9 fail. Windows: 1,918 run, 559 pass, 1,359 skip, 0 fail. The libc and libkernel suites ran with 0 failed on both.
      • Seven also fail in main's own Linux job at dcf3d15978 (job): agc_hook_clear_access, agc_hook_clear_access_off, agc_driver_recorder, and the agc_driver_runtime_buffer_spans_x2_spans, _x3_spans, _x4_spans and _x4_reference timeouts.
      • The eighth, agc_driver_runtime_buffer_spans_x3_reference, passed in that job in 27.60 s, against its 30 s limit, and timed out at 30.06 s on main 0694c4cbd6 on GitHub's Linux runner (AMD EPYC 7763; run, with only #19899's Windows test fix on top).
      • The ninth, agc_driver_image_table_packed_guards, fails the same way in main's own Linux job at e249fc47b5 (job): three identical "stage 4 pc 0x68" records, then "unrecoverable packed table format was not poisoned". fernandomcrsilva's #21255 changes that test.
      • main 8bb7635fe0 alone on GitHub's Linux runner (Intel Xeon 6975P-C; run): 42 tests, the agc_driver_runtime_buffer* and agc_driver_image_table* tests with the hook pair and agc_driver_recorder, each run up to 3 times and stopped at its first failure. Seven fail the same way in their first run: agc_driver_image_table_packed_guards, agc_hook_clear_access, agc_hook_clear_access_off, agc_driver_recorder, and the _x2_spans, _x3_spans and _x4_spans timeouts. _x3_reference and _x4_reference pass 3 of 3 there: 21.44 and 20.80 s in their first run, beside the three _spans tests timing out, and 1.5 to 2.0 s in the next two. The agc run above had 1,876 tests in parallel. That run's libkernel suite also hit the guest_thermal_sensors timeout of that CPU, and its Windows build stops at main's "'setenv' was not declared" error, since its tree didn't have #19899's test fix.
    • The Windows tree again had #19899's _putenv_s test fix on top; it isn't on this branch.
    • A GPU run on a96efaa504: @nydal91's Marvel's Wolverine (PPSA03671) A/B on an AMD Radeon RX 6950 XT (below).
  • Marvel's Wolverine (PPSA03671 v01.001.005), by @nydal91, at a96efaa504 (comment): Linux (PikaOS 4, kernel 7.3.3), AMD Radeon RX 6950 XT (RADV, Mesa 26.3.0). An A/B on main f15df3256c with the prerequisites they carry, 300 s runs at APS5_HOST_IMPORT_MIB=5000:

    • Without this PR: 266 deferred write-back failed: BDA access failed ... read-only in the BDA table refusals, 4-byte compute stores into a 1.1 GiB unaligned descriptor view of a 2.5 GiB registered heap, then VK_ERROR_DEVICE_LOST at vkQueueSubmit.
    • With this PR (a96efaa504 merged with f15df3256c): 0 refusals, 0 deferred write-back failures and 0 store-page exhaustion faults; 656 frames presented and a clean exit, with the intro rendering through the subway and street scenes.
    • The store-page pool: the intro's wide stores (that 1.1 GiB view, and a 248 MiB descriptor region written back about 110 times) didn't exhaust the default pool.
  • 2687eec5fd, a merge of main 2b31f86019 (×10, every agc test), which brings ashwin280802's #17796 (storage-image results published into resident heap mirrors), merged first, as planned.

    • The conflicts: two, each resolved by keeping both sides:
      • GuestBufferMemory.cpp, UploadFinish: #17796 adds publishIntoMirrors() where this PR adds addAddressStoreSpans(), both before takeHeapReferences(). The merge calls addAddressStoreSpans() first, as planned in the merge-order note, so a writable mirror that a draw may store into through an address takes #17796's Written fallback.
      • ShaderResources.cpp: relativespace2K's #19131 adds a const DrawBindings* bindings parameter to MarkGpuWrites, which follows this PR's StorePages(). The merge keeps StorePages() and #19131's signature.
    • Diff: this PR's changed lines are the same in all 31 files, and its diff over main stays +1,996 −77. Its patch-id changed, since the lines next to two of its additions are now #17796's and #19131's.
    • ×10: the set of the a96efaa504 run, with #17796's agc_driver_resident_heap_mirror and agc_driver_resident_heap_mirror_no_publish. Linux: 53 run, 52 pass, 1 skip (agc_host_import_sparse), 0 fail. Windows: 65 run, 23 pass, 42 skip (no Vulkan device), 0 fail.
    • The suites: libc and libkernel run 410 and 411 tests on Linux and 439 and 432 on Windows, with 0 failed apart from libkernel's guest_thermal_sensors on Linux, which reached its 20 s timeout on one of GitHub's Intel Xeon 6975P-C runners, as in every run I have on those runners. They ran with APS5_SKIP_TIMING_TESTS=1, which relaxes only precise_wait's median bounds on GitHub's hosted runners.
    • Every agc test, once: Linux (AMD EPYC 7763): 1,963 run, 1,827 pass, 126 skip, 10 fail. Windows: 2,005 run, 568 pass, 1,437 skip, 0 fail. The libc and libkernel suites ran with 0 failed on both.
      • Five also fail on main 2b31f86019 alone in the same harness, on an Intel Xeon 6975P-C runner (run): agc_driver_image_gather_lod, agc_driver_image_table_packed_guards, and the agc_driver_runtime_buffer_spans_x2_spans, _x3_spans and _x4_spans timeouts.
      • The other five are timeouts: agc_driver_fault_check_dedup and agc_driver_oracle_runner at 120 s, and agc_driver_image_table, agc_driver_runtime_buffer_spans_x3_reference and _x4_reference at 30 s. That run's EPYC 7763 runner took 1,016 s for the Linux pass, against 601 s for main's pass on the Xeon runner. On a Xeon 6975P-C runner, this head runs them 3 times each with the agc_driver_runtime_buffer_spans family and this PR's heap mirror tests (run), and all five pass every time. Their first, cold runs take 75.2, 42.4, 21.3, 21.2 and 20.6 s, against 72.5, 33.8, 17.6, 17.3 and 28.6 s in main's full pass. The _spans timeouts there are main's three.
    • The Windows tree again had #19899's _putenv_s test fix on top; it isn't on this branch.

Overlaps

  • #8874 (JJenkx, heap mirror reference buffers): merged first, as planned, and the merge of main 88e804b0a7 keeps both (see Tested). This PR no longer takes whole-span references for address stores, so #8874's pool serves only the declared writes' references.
  • #8963 (shared BDA fault buffers): merged first, as planned. The merge of main 4f41f4c375 gives a build that stores through addresses a private slot in its arena for the store-page words (see Tested).
  • #12827 (JJenkx, a resident heap mirror's write-back from its readback buffer): a conflict in GuestBufferMemory.cpp's resident write-back. #12827 stores from the readback buffer without copying it, and this PR copies each written piece's readback into a vector, so on rebase it takes a span over the piece's slice instead. Merge order: #12827 first, this one second (note).
  • #15296 (Prophet069, resident heap mirrors without host copies): a design conflict in GuestBufferMemory.hpp and .cpp. #15296 removes the resident host copies (ResidentBuffer::Read, Store and Block), which this PR's resident write-back compares the declared writes and the gathered store pages with, and takes resident references from device copies (RecordReference). Copy-backed mirrors keep this PR's device reference copies. Merge order: #15296 first (it lands after #15295 and #12827), this one second, rebased off the host copies (note).
  • #15295 (Prophet069, heap mirror slabs within device memory): it merges with this PR. Its one conflict, in Context.hpp, is with main, and this PR doesn't change that file. sktharunbalaji13-cmd ran the two together on Ghost of Tsushima Director's Cut (see Tested).
  • #6185 and #6186 (WriteBack keeping the CPU's bytes): #6185 has merged, and the merge of main 4f41f4c375 composes its ChangedStore with the store-mask write-back (see Tested). #6186, which also conflicts with main, conflicts with this branch only in tests/Recorder.cpp and tests/cmake/agc_driver_recorder_tests.cmake.
  • #10442: a conflict in ShaderResources.cpp, besides CMakeLists.txt and Draw.cpp.
  • #12662 and #12980 have merged. The merge of main 5cb015caaa brings them without a conflict.
  • #13858 has merged. The merge of main b11c7bf84f composes its per-use fault records with this PR's store pages (see Tested).
  • #15423 (dantdmdarealguy, the journal's module frame check) has merged. Both PRs added an if(BUILD_TESTING) block at the end of tests/cmake/agc_driver_pipeline_journal_tests.cmake, and the merge of main 090f57166a puts this PR's TIMEOUT 240 line, which covers this PR's own cold compile, into #15423's block (see Tested).
  • #15169 (liskeee, pipeline binaries) merged, and oneandonlydean's #17982 reverted it on 11-10, since main crashed at boot in PipelineBinaryStore::queryKey. The merge of main 47adcad89a drops its binaryLayoutKey and keeps this PR's storePages (see Tested). If #15169 comes back, the two are again neighbouring members of ComputePipelineObjects, and keeping both resolves it.
  • #17796 (ashwin280802, storage-image results published into resident heap mirrors): merged first, as planned (note). Both add a call to GuestBufferMemory.cpp's UploadFinish before takeHeapReferences(). The merge of main 2b31f86019 calls this PR's addAddressStoreSpans() before #17796's publishIntoMirrors(), so a writable mirror that a draw may store into through an address takes #17796's Written fallback, and its ×10 runs #17796's agc_driver_resident_heap_mirror and _no_publish with this PR's tests (see Tested).
  • #17850 (adam25136, waiting for address-based writers before reading indirect draw records) has merged, first, as planned. The merge of main 11992f9695 keeps #17850's rewritten debt entry with this PR's two after it, and runs #17850's agc_driver_indirect_draw_pending_producer tests with this PR's store pages (see Tested).
  • #16752 (chitters2004, tracked Vulkan command state) has merged. Its tracker refuses a raw vkCmdBindPipeline, so the merge of main 884694cf85 binds this PR's three compute pipelines through its context.BindComputePipeline (see Tested).
  • #20870 (Ketz7, a BDA fault recorded with one atomic claim): merged first, as planned. The merge of main 0173f20a5f keeps its report.claim == 0 check with this PR's pagesOverflowed Require after it, and this PR's store-page words move with its 40-byte fault record (see Tested).
  • #18842 (atinseau, 64-bit atomics emulated on devices without them) has merged. Both PRs add specialization constants supplied at dispatch, and the merge of main 8bb7635fe0 keeps both: a module's build-time specialization leaves out this PR's and #18842's, and this PR's StorePages pipeline variant gets #18842's lock table address (see Tested).
  • #20519 and #22424 (slopezjur, the bindless image heap and, on it, layout-only pointer tables) and #22359 (Remi-Bon, split table calls): text conflicts only, each resolved by keeping both sides. Each appends to BdaAbi.hpp's FaultReason after WindowLaneSpill: this PR StorePages, #20519 and #22424 BindlessMiss and BindlessRefused, and #22359 SplitState. Whichever lands second takes the next numbers, and every use names the reason, not its number. BdaResources.cpp has an adjacent #include line (#20519 and #22424) and adjacent fault messages (#22359). In VulkanDevice.cpp, #22359's split-state block goes before this PR's store-page bind. No merge order: whichever lands second resolves the conflict (git merge-tree on main 1adc0e2f4b).
  • #22692 (Logan1h, cached SPIR-V stored compressed with zstd): a conflict in VulkanDevice.cpp's compute pipeline creation. #22692 creates each compute module from a SharedSpirv::Words() lease, and this PR's specializedComputePipeline (splitComputePipeline on main) keys its pipelines by the store-page flag as well as the workgroup offsets. The merge keeps this PR's four-word key and replaced constants, with StorePages when the flag is set, and creates the module from #22692's lease. In createComputePipeline both add const auto words = shader.spirv.Words();, so the merge drops this PR's line, and its StorePages scan reads #22692's lease, declared before objects->module. Merge order: #22692 first, this one second (note). That's one text conflict on main b1a1e61f91 (git merge-tree).
  • #22944 (Ketz7, BDA stores recorded in per-range granule bits and a page map): a conflict in the BDA written-page record. #22944 replaces the note_bda_write hash table with per-range granule bits and a page map. This PR's store-page words follow SrtGuardWord, and its StorePageGather.comp finds the pages BDA stores hit from the table's count, slot and list words, which Recorder.cpp passes to it. The merge puts the store-page words after #22944's SrtGuardWord and has the gather read #22944's written-page record. In SpirvEmitterState.hpp it drops bdaNoteWriteFunction with #22944 and keeps this PR's two store-page members. Merge order: #22944 first, this one second (note). That's six conflict blocks in five files on main 8dbb3bf68d (git merge-tree). Recorder.cpp merges without one but still passes the table's words.
  • #23596 (nydal91, GPU-readback staging for writable-copy write-back): a conflict in one hunk of GuestBufferMemory.cpp's RecordCopyBacks, where both change the loop that records the heap-mirror readbacks. Proposed order: this PR first, and #23596 then resolves the conflict keeping both sides (see the note on #23596). The merged loop is #23596's, with its heapMirror and writableCopy branches, iterating this PR's declaredReadbacks, and with this PR's AddressStoreTallies().readbackBytes line in the heapMirror branch. Whichever goes second runs this PR's agc_driver_bda_store_heap_mirror* tests and #23596's copy write-back tests on the merged tree.

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: #12827, #15296, #22692, #22944 (merge order only); #8874, #8963, #17796, #17850 and #20870 have merged, and the merges of main 88e804b0a7, 4f41f4c375, 11992f9695, 0173f20a5f, 8bb7635fe0 and 2b31f86019 keep both
  • Fixes: none
  • Related: #5166
  • Unblocks: none
  • GPUs tested: lavapipe (llvmpipe, LLVM 20.1.2); NVIDIA GeForce RTX 4060 Laptop GPU (Ghost of Tsushima Director's Cut, by @sktharunbalaji13-cmd); NVIDIA GeForce RTX 4070 Ti (Ghost of Tsushima Director's Cut, by @milescoviello, twice); AMD Radeon RX 9070 XT, RDNA 4 (tests, by @bunbeans2-arch); NVIDIA RTX 2000 Ada Generation (tests, TechLevelZero's NVIDIA GPU test); AMD Radeon RX 6300, RADV (tests, TechLevelZero's AMD GPU test); NVIDIA GeForce RTX 3070 Laptop GPU (Resident Evil Village pair); NVIDIA GeForce RTX 4090 (driver 620.70.06, Arch Linux, with the validation layer), by @domx4q; AMD Radeon RX 6950 XT, RADV (Marvel's Wolverine (PPSA03671), by @nydal91)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5067732130 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12840). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-29T12:10:17Z. --- ### What A shader that stores through a FLAT/GLOBAL address, or through a V# it computed itself, into a writable heap mirror is refused today. sktharunbalaji13-cmd's Ghost of Tsushima Director's Cut (PPSA02225) run stops a compute store this way ([I#5166](https://github.com/boykopovar/AnyPS5/issues/5166#issuecomment-6492874290)): ``` [gpu] deferred write-back failed: BDA access failed: address=0x1579d4e49e instruction=0x1284 bytes=1 stage=4 reason=2; the store hit 0x150c000000+0x8c600000, read-only in the BDA table: stores through GPU-selected descriptors and FLAT/GLOBAL addresses reach only writable ranges imported in place, not ones served by a mirror or a copy ``` On `main` b11c7bf84f the title still hits this refusal, 7 times per run, each with `the store hit 0x1549750000+0x4eeb0000` (instruction 0x1b4, 4 bytes, compute), right after its intro H.264 decoder is created. On this PR's head it runs with none ([run](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6632914836); see Tested). On `main` 133feb30f0, from a pinned save on Linux, @milescoviello's pair logs no such refusal in either arm, so that pair can't show the fix (see Tested). A probe on `main` 7c444b77ad still refuses such a store, and the same probe on this PR's head stores it (see Tested). The refusal is deliberate. Granting `Write` to writable mirrors in `GuestBufferMemory::addressRange` alone would lose the stores silently: - `WriteBack` stores only the build's declared write ranges, so a store elsewhere in the mirror never reaches guest memory. - The next refresh of the mirror then replaces it with guest bytes. **The change.** When a build's shaders can store through addresses (`!bdaReadOnly`), its writable heap mirror spans are marked writable in the BDA table, and the stores reach guest memory without binding, copying or reading back the span: - **Resident (sparse) mirrors:** - A store into an unbound block is redirected to a 4 KiB *store page* from a small per-build pool. `APS5_BDA_STORE_PAGES` sets its size: the default is 1,024 pages, about 4.6 MiB. Pages are found by a 16-probe hash keyed by the page, and a read in the same dispatch finds the store there. - **A full pool is a stop.** A dispatch whose stores need more distinct pages than the pool can place faults with "none of the N store pages free", and none of its stores reach guest memory. With 16 probes, the default pool starts refusing consecutive pages at about 988. There is no fallback in this PR. - After the use, each stored page goes to guest memory by its per-byte store mask, so a stored zero lands too. The block stays unbound until a later refresh binds it from guest memory. - Bound pages that the recompiler's written-page record lists are gathered on the GPU (`StorePageGather.comp`) and compared with the resident shadow, which equals the device bytes at upload. - **Copy-backed mirrors:** each store ORs one bit per byte it writes into a mask beside its page slot, and the write-back copies only the masked bytes. - **CPU bytes:** either way, a CPU byte written during the dispatch survives, even in the same page or the same dword. - **`APS5_HEAP_MIRROR_MIB`** is never charged for a store. - **The pending-write note still covers the span.** Host reads, copies and the next address-based refresh of that heap must wait for the storing use, and the span is the only set known before the dispatch. It's a range, not bytes. - **`NoteWrittenBack` notes only the runs that were actually stored,** so a completion label inside the span that no thread stores over isn't counted as overwritten. - **Compile cost:** compute pipelines get the store-page code only through a dispatch-time specialization constant (`PipelineSpecialization::StorePages`, ID 8239). The driver binds that variant only when the build's BDA table carries a store page pool, so every other compute shader compiles as before. - **Still refused, unchanged:** - copies, read-only heap mirrors and image mirrors; - bytes past the served end; - stores into uncommitted holes of a sparse heap, whose spans are clipped to the committed runs. - **Recorded in the debt file:** an atomic whose result leaves a byte unchanged still writes that byte back. The commits: 1. `bf54c5e942`: note only the stored runs of address-store spans as written back. This answers [question 1](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6496483144) of the review. 2. `99f1f37aed`, `91e4d82e7c`: compare only the pages BDA stores hit, and take the reference on the GPU. The next commits supersede these for address stores. 3. `fbb103c45f`: the shader side, which redirects stores into unbound heap mirror blocks to store pages. 4. `bbeb08e9f6`: resident mirrors without binding, copying or reading back the span. 5. `7e7c81a2aa`: copy-backed mirrors by per-byte store masks. 6. `425cd9d8b0`: store page pools reused across address-based builds. 7. `6c6997ec33`: unbound blocks written back by their store masks, so a stored zero isn't lost. This answers [point 1](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6518837738) of the second review. 8. `92409250c8`, `822a2b879e`: tests that pin store page exhaustion, at a small pool's size and at 1,025 pages against the default pool (point 2). 9. `1aa803e9d3`: a merge of `main`. ### Cost Each figure is the extra work of a storing dispatch over a load-only dispatch on the same heap, per dispatch. It's measured on lavapipe (4-vCPU Xeon, Release) as the mean of two runs, at 0, 1 and 16 stored blocks. | heap | before (91e4d82e7c): wait, ms | now: wait, ms | now: CPU, ms | bound after a store into a zero heap | |---|---|---|---|---| | 8 MiB in 4 runs | 4.2-6.3 | 0.1-1.0 | 0.0-0.3 | 1 MiB (was 7.8) | | 36 MiB in 16 runs (the report's shape) | 23.5-27.6 | 0.1-1.4 | 0.0-0.5 | 1 MiB (was 35) | | 36 MiB in 1 run | 14.6-15.7 | 0.1-1.3 | 0.0-0.6 | 1 MiB (was 36) | | 72 MiB in 16 runs | 45.8-51.8 | 0.1-1.4 | 0.0-0.5 | 1 MiB (was 71) | - **The first version of this PR (781dc4525b)** added 7.3-80.6 ms of CPU per dispatch for these heaps. - **The 1 MiB bound after a store** is the next refresh binding the block that now holds data; nothing is bound to take the store. - **A 2 GiB heap** with one block stored runs inside `APS5_HEAP_MIRROR_MIB=64`, with 1 MiB bound and 0.4-1.4 ms of wait. - **Compile time, cold, on lavapipe:** `agc_driver_flat_store` takes 73.4 s, against 75.7 s with no store-page code. The `runtime_formatted_store` tests take 25.6-27.3 s, against 27.3-29.9 s. Inlining the store-page code into every compute shader, the first try, made them 23-46 % slower, which is why it's specialized. - **Resident Evil Village (PPSA01556), a title that works today:** it never takes the changed path, so its cost is the specialization/ABI change only. - A counter build of this PR logged no address-storing build (no `[bda-store-spans]` line) to the static menu +15 min. - On this pair's tree family, its mirror census reads `1 ranges (0.6 MiB, 0 writable, 0 heap 0.0 MiB), 294164 address-based builds served`. `6c6997ec33` changes no shader code, so a pair on 425cd9d8b0 measures this head too. - **The setup:** - B A A B, unprofiled, from the static menu +5 to +15 min, on an NVIDIA GeForce RTX 3070 Laptop GPU under Windows. - B = `main` ebb4075168 + 425cd9d8b0; A = the same `main`. Both arms carry the same three local changes Village needs to boot on that base: a pad fix, #11580 and #10304. - The GPU sat in P0 for 98-99 % of samples, and the clocks weren't held. - **The cut:** the 10 s intervals in each boot's `aps5-summary.jsonl` that start from menu +5 to +15 min ([files](https://github.com/EagleBearerYS/AnyPS5/tree/evidence/12840-village-pair/village-12840-pair), the warm-up boot included). b1's and a1's menu times are logged. a2's and b2's weren't, so their cuts use offsets that reproduce the frame rate logged at the time; it moves by at most 0.004 fps within ±20 s of them. - **Frame rate:** B 0.653 and 0.641 fps, A 0.692 and 0.637. B's mean is 2.6 % under A's. The A boots' spread is 8.2 % of the A mean. a1 was first posted as 0.691; its file at the logged menu time gives 0.692. - **The phases,** B against A, as the median of the 10 s intervals and as the presents-weighted mean: `Driver.Packet.draw` 1,161 against 1,156 ms per frame (+0.4 %) and 1,185 against 1,161 (+2.1 %); `Graphics.Draw` +0.1 % and +2.7 %; `Graphics.Draw.draw_and_resource_release` +0.05 % and +2.6 %. They replace the figures first posted here (`Driver.Packet.draw` +0.5 %, `Graphics.Draw` +1.1 %, `draw_and_resource_release` +1.0 %), which didn't say median or mean and don't all reproduce from the files. - **Boot to boot:** the weighted `Driver.Packet.draw` is 1,185 and 1,184 ms in the B boots, and 1,103 and 1,223 in the A boots. The A boots differ by 10.8 %, more than the gap between the arms. - **Non-game CPU,** the harness's reading for each boot: b1 36.0 %, a1 29.8 %, a2 35.7 %, b2 35.1 %. a1, the fastest boot and the one with the lowest phases, is 5.3-6.2 points under the other three, more than the 5 points we allow between boots. - **The same in every boot:** 0 shader cache misses after the warm-up, 0 failed imports, matching renders, and private memory within about 120 MB. - **The cache key** changes with the recompiler's source hash, as for any recompiler change, so expect one cold-cache boot per key. ### Tested - **`agc_driver_bda_store_heap_mirror`**, also run as `_no_space_cache` (`APS5_NO_ADDRESS_SPACE_CACHE=1`) and as `_budget` (`--budget`, `APS5_HEAP_MIRROR_MIB=64`). Each case was run against a tree with its own mutation (red) and on this branch (green): - **Budget:** a 2 GiB committed heap, copy-backed and resident, with one block stored, once bound and once unbound. The bytes reach guest memory, the use stays inside 64 MiB, and the counters show bound, reference and readback bytes far below the span. - **Red, the span bound** as on 781dc4525b: "a store into one bound block of a 2 GiB heap: the store of thread 0 reached guest memory as 0x0, expected 0x5a000000". - The test's refusal check also matches `(APS5_HEAP_MIRROR_MIB)`, so a refusal can't pass quietly. - **An unbound block stored, read in the same dispatch, and after write-back.** - **Red, spill write-back removed:** "a store into an unbound block: the store of thread 0 reached guest memory as 0x0". - **Red, same-dispatch read not redirected:** "a read in the same dispatch of thread 0's store into an unbound block returned 0x0". - **A CPU byte in the same page and the same dword as a GPU byte store, during the dispatch** (bound and unbound, resident and copy-backed). Red with each of: - the shadow comparison skipped; - every byte of the page written back; - guest memory used as the reference; - masks ignored. - **Two storing dispatches with no wait, and a CPU store between their write-backs.** Red with guest memory as the reference, and red with masks ignored. - **Chained dispatches** (a dispatch reads what the one before stored into an unbound block). **Red, pending-write note removed:** "the first of two storing dispatches lost the store of thread 0". - **Labels (`LabelTests`):** - a label the dispatch doesn't touch keeps the CPU's bytes, and the `[recorder]` write-back-over-label counter stays 0; - a label a thread stores over is still noted. - Red on 781dc4525b. - **A zero store into an unbound block** (`ZeroStoreTests`, resident and copy-backed): the guest block holds non-zero bytes, and 64 threads store zero, as a dword and as a byte. **Red:** 425cd9d8b0's code with only this test fails `agc_driver_bda_store_heap_mirror` and `_no_space_cache` on Linux ([run 41047122594](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41047122594)). - **Store page exhaustion:** - `agc_driver_bda_store_heap_mirror_store_pages`: a small pool takes every slot. A dispatch that needs one more page leaves guest memory untouched. - `_store_pages_default`: 1,025 distinct pages against the default pool, resident and copy-backed. It asserts that none of that dispatch's stores landed. It doesn't assert that 1,024 fit. - The earlier cases (sparse runs, the mixed GLOBAL and V# store, the read-only control) still pass. - **`agc_driver_bda_device`,** shader level: six mutations of the store-page code, each red, e.g. "a read after a store into an unbound heap mirror block in the same dispatch returned 0x77777777" and "a store finding no free store page did not fault". Two more cases check that the store-page pipeline is selected and cached. - **Linux** (lavapipe, Ubuntu 24.04, GCC 13.3, Release, CI's flags), at 425cd9d8b0: - each of the six commits builds and passes its focused tests; - the BDA tests passed 10 of 10; - `ctest -R '^(agc|shader)' --parallel 4`: 1,132 tests, 1,059 passed, 73 skipped, 0 failed. - **GitHub's runners at this head,** [run 41102347191](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41102347191), ×10: every `^agc_driver_bda_` test, including the five heap mirror tests, plus `agc_driver_recorder` and `agc_recorder_command_buffer_release`. - **Linux:** 126 tests. 118 passed 10 of 10, 8 skipped, 0 failed. - **Windows:** 141 tests. 42 passed 10 of 10, and 99 skipped, since the runner has no Vulkan device; the BDA store tests are among the skipped. 0 failed. The branch builds there. - **The libc and libkernel suites,** run with `APS5_SKIP_TIMING_TESTS=1`, pass: 198 and 307 tests on Linux, 225 and 327 on Windows. - **Vulkan validation** (Khronos layer, `ANYPS5_NO_SHADER_CACHE=1`), on 92409250c8 ([run 41039517488](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41039517488)): the heap mirror tests show only `VUID-VkDeviceCreateInfo-pNext-pNext`, from device creation. TechLevelZero's NVIDIA run lists the same ID among `main`'s own, in 427 tests. The store-page variant pipelines add none. - **NVIDIA RTX 2000 Ada Generation, TechLevelZero's NVIDIA GPU test at this head** ([comment](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6531986391)): merged onto `main` 9f748f4, driver 595.99.02, the Khronos layer. 2,400 passed, 0 new failures, and no new validation IDs in 916 GPU tests. - **AMD Radeon RX 9070 XT (RDNA 4), by @bunbeans2-arch, at 425cd9d8b0** ([comment](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6523286088)): Windows 11 Pro 10.0.22631, driver 32.0.32015.7029 (amdvlk64), MSYS2 UCRT64 g++ 16.1.0, Release, `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and the Khronos validation layer (the loader inserts it in every run). The head merged onto `main` f7f03daf52, 3 runs per side: - `agc_driver_bda_store_heap_mirror`, `_budget` and `_no_space_cache` pass 3 of 3. - `agc_driver_bda_device`, `agc_driver_bda_reads_shadowed_results`, `_per_build`, `agc_driver_host_import_failure_handles`, `agc_driver_recorder` and the `agc_recorder_*` tests pass 3 of 3, as on `main`. - No `VUID-` line on either side. - **Checks:** - `check_conventions.py` and `check_test_registration.py` pass. - MinGW-w64 `-fsyntax-only` is clean on the eight changed files that toolchain can parse. `GuestBufferMemory.cpp` and `Recorder.cpp` stop at the same `CpuTopology.hpp` header gap as `main`'s copies. - **A probe on `main` and on this head,** run on fork verify branches only (`BdaMirrorStoreProbe.cpp`, which isn't part of this PR): 64 threads make a GLOBAL store into a 2 MiB writable guest heap, outside any declared write. The host-import budget is held so that the heap is served by a heap mirror, and the probe checks that it is. - **`main` 7c444b77ad** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43887131598)): the store is refused as "read-only in the BDA table", and none of the 64 values reaches guest memory, in 3 of 3 runs. - **This head, bcc617f141** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43887392316)): the same probe stores all 64 values with no refusal, in 3 of 3 runs. - Both ran on GitHub's Linux runner (llvmpipe). The Windows runner has no Vulkan device, so the probe skips there. - **Ghost of Tsushima Director's Cut (PPSA02225), by @milescoviello, at bcc617f141 on `main` 133feb30f0** ([comment](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6918916270)): Ubuntu 26.04.1 (kernel 7.0), NVIDIA GeForce RTX 4070 Ti (driver 615.71.09), i7-13700K, Release libraries, 4K output, `main`'s defaults with only the 10 s summary, a 22 GiB cap. One 600 s run per arm, from the same pinned save with scripted presses, both with a cold shader cache. - **No refusal in either arm:** neither logs `deferred write-back failed: BDA access failed`, `the store hit` or `read-only in the BDA table`. On this route the store isn't refused on `main`, so the pair can't show the fix. - **Both arms** create the intro H.264 decoder and run to the 600 s timeout without a device loss: 1,103 presents on `main`, 1,112 with this PR. - **The last stretch differs:** with this PR, after 416 s, 1 or 2 presents per 15 to 40 s window, and 555 shaders prepared at use against 393. The tester reads this as that arm being further into a heavier scene with a cold cache, which one run per arm can't separate from scene variance. - **The `b11c7bf84f` runs below** were on Windows, with a display that stayed black after the "Sony Interactive Entertainment presents" card, and their stores were refused right after the intro decoder was created. This pair's arms create that decoder too, so the difference lies in the `main` commit, the OS and GPU, or the save, and one pair can't say which. - **Ghost of Tsushima Director's Cut (PPSA02225), by @sktharunbalaji13-cmd, at 3fa9852e8c** ([comment](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6632914836)): retail v02.024.000, NVIDIA GeForce RTX 4060 Laptop GPU (8 GB, driver 617.42), 16 GB of RAM, Windows 11, MinGW g++ 15.2, Release. Both arms run the same executable and environment (only `APS5_SKIP_REFUSED_DRAWS=1` and `APS5_PROFILE_DRAW=1`), with only the driver libraries swapped. | driver | runs | `read-only in the BDA table` faults | |---|---|---| | `main` b11c7bf84f | 3, of 150-300 s each | 7 per run, every one `the store hit 0x1549750000+0x4eeb0000` (instruction 0x1b4, 4 bytes, compute) | | this PR at 3fa9852e8c | 2, of 240 s and 450 s | 0 | - **Past the fault:** on `main` the faults come right after the intro H.264 decoder is created. The 450 s run on this PR goes past that point, with 363 address-based builds and 703 presented frames, and logs no `deferred write-back failed`, no store-page refusal and no `not implemented` stop. The title was still running at the end of the window. - **Not changed:** the display stays black after the "Sony Interactive Entertainment presents" card, as on `main`. - **Device memory, in later 150 s runs of the same tree** ([#15296](https://github.com/boykopovar/AnyPS5/pull/15296#issuecomment-6637406390), [I#5166](https://github.com/boykopovar/AnyPS5/issues/5166#issuecomment-6636589032)): 2 of the last 3 aborted, at about 120 s and at 135 s, on `vkAllocateMemory of a heap mirror slab` with device heap 0 past its 7,188 MiB budget. The tester traces it to the 16 MiB slabs of the two big heaps' mirrors. With #15295 added, a run didn't abort in 150 s, and the heap mirror budget was lowered 9 times instead. Whether `main` alone reaches this in the same conditions wasn't measured. - **One local change to boot, outside this PR:** relinked with `main` b11c7bf84f's relinker, the title aborts at about 1 s on Windows, because `prospero/steamnetworkingsockets.prx` starts deferred. Their relinker starts it at process start instead ([I#5166](https://github.com/boykopovar/AnyPS5/issues/5166#issuecomment-6632580189)), and both arms use that executable. - **Ghost of Tsushima Director's Cut (PPSA02225), by @sktharunbalaji13-cmd, at 425cd9d8b0** ([comment](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6518006244)): retail v02.024.000, NVIDIA GeForce RTX 4060 Laptop GPU (8 GB, a 7,188 MiB budget), 16 GB of RAM. - **The budget stop is gone.** The run of 781dc4525b stopped on `heap mirror of 0x127c000000+0xa9800000: past the budget (4014 MiB, limit 2816 MiB)`. On this head that stop doesn't occur, and nothing about store-page exhaustion is logged with the default pool of 1,024 pages. - **Frames:** the title presents 129 frames. The last, at a guest time of 107.0 s, is the disclaimer screen, not black. - **The next stop:** at 114.7 s, in compute shader 0x20001ef700, `AGC graphics: native multisample stencil or depth format import is not implemented`. That's the multisampled depth import #9533 adds, outside this PR. - **Ghost of Tsushima Director's Cut (PPSA02225), by @milescoviello, at 425cd9d8b0 with #9742** ([comment](https://github.com/boykopovar/AnyPS5/issues/5166#issuecomment-6526573860)): `main` 98ddd9c179 + #12840 425cd9d8b0 + #9742 1c904e29a2 (#9533's 6eb141ce5f inside), merged cleanly; Linux, RTX 4070 Ti (NVIDIA 615.71.09), release libraries, 21 GiB cap, booting from a settings save. The run stops 33 s in on a check outside this PR, `native multisample depth sampled identity or format mismatch` in compute shader 0x20001ef700, which #9717 takes. - **e6c85d37f5, a merge of `main` d30e04fb8a, and 582e856556, the journal race test** (test-only). - **Why:** merged with current `main`, this branch failed `agc_driver_pipeline_journal` 3 of 3, at the replay-race assertion from chitters2004's 307f2202e7: "a dispatch and the replay both built a compute pipeline: 32 built for 24 replayed". The merge has no textual conflict, so GitHub didn't flag it. - **The cause:** the race records its 32 compute pipelines into the journal that the test binary's earlier cases already use, capped at `APS5_PIPELINE_JOURNAL_MAX_MIB=1`. - With the store-page lookups, every shader that stores through an address carries more SPIR-V: the race's fixture grows from 6,582 to 7,819 words, and each journal module record from 26,924 to 31,880 bytes. - So the 32 records and the earlier ones no longer fit, and the journal evicted the oldest 8, as its cap says it should. - The identities match on both devices, no `StorePages=1` variant is built, and nothing is rejected. The 8 were evicted, not lost. - **The fix:** the test sets the journal aside, records its 32 pipelines into an empty journal (1,022,496 of 1,048,576 bytes), requires all 32 to be journaled before racing, and puts the earlier journal back afterwards. When they don't fit, it now says so instead of reporting a double build. The race check is unchanged. Red: 20 of 20 failures on the merge without the fix; green: 20 of 20 with it (cloud Linux, lavapipe). - **The cost:** address-writing compute modules are 18.8 % larger in SPIR-V words and 18.4 % larger in journal bytes. On llvmpipe this binary's first run, before Mesa's shader cache holds its pipelines, now takes about two minutes, so its registration sets `TIMEOUT 240`, as `agc_shader_disk_cache_large_file` does. On GitHub's Linux runner, `--repeat` ×3, with the first run cold: | Tree | First run | Later runs | Run | |---|---|---|---| | `main` d30e04fb8a | 67.8 s | 5.1, 5.1 s | [41175053022](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41175053022) | | `main` + this PR + the fix | 118.9 s | 7.9, 7.8 s | [41169371014](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41169371014) | That's +75 % for the cold run and about +53 % warm. It isn't measured on a GPU: TechLevelZero's NVIDIA run of this head ([report](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6541334865)) passed, but its test selection didn't include `agc_driver_pipeline_journal`. The compile growth comes from the store-page branch in each address lookup; it can be narrowed in a follow-up if reviewers want it. - **×10** on 582e856556 ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41179180859)): this PR's store-heap-mirror, BDA and recorder tests, the `^agc_driver_bda_` and `^agc_bda` tests, and `agc_driver_pipeline_journal`. - Linux: 127 run, 119 pass, 8 skip, 0 fail. This PR's five `agc_driver_bda_store_heap_mirror*` tests passed every run. The 8 skips are other tests in the set (host-import and unit-shadow cases this runner can't run). `agc_driver_pipeline_journal` took 108.3 s on its first run and 8.3 to 8.7 s after. - Windows: 142 run, 42 pass, 100 skip (no Vulkan device), 0 fail. - The libc and libkernel suites run 199 and 308 tests on Linux and 226 and 330 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **6bec085232, the journal watermark test** (test-only, `tests/execution/PipelineJournal.cpp`), for @jotitadev's [review](https://github.com/boykopovar/AnyPS5/pull/12840#pullrequestreview-5723063502). - **Why:** with the default `ANYPS5_ENABLE_SPIRV_TOOLS=OFF`, `agc_driver_pipeline_journal` failed every run at `EvictionWatermarkTests`: "three consecutive records after a rewrite triggered another rewrite", 92 bytes over the 1 MiB cap. GitHub's Linux runner builds with `ON`, where the modules are smaller, so it passed there. - **The cause:** a rewrite leaves the journal at most at its target, three quarters of the cap, so it guarantees 262,144 bytes free. - The case's three records carried a fixed 16 Ki-word payload, 279,288 bytes on `main`. - They fit there only because the rewritten journal sat 36,880 bytes under the target. - The store-page lookups make each module about 4,956 bytes larger. - **The fix:** each record is sized from the rewrite target. - The case encodes the fixture's module as the journal does, and adds user words until the module and compute records take 65,536 bytes, a quarter of the room above the target. The three take 196,608 bytes, whatever the fixture's SPIR-V. - It keeps the journal `EvictionTests` just rewrote, because an empty journal couldn't trigger a rewrite whatever the target. - The four checks are unchanged. Raising the production rewrite target to 7/8 or 15/16 of the cap turns the case red (cloud Linux, lavapipe). - **Red:** 582e856556 with `OFF` fails 3 of 3 with that message on GitHub's Linux runner ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41211473230)). - **×10 with `OFF`** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41211481931)) and **×10 with `ON`** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41211489975)), on Windows too: `agc_driver_pipeline_journal`, the graphics binary's `agc_pipeline_journal` and `agc_pipeline_journal_long_paths`, and every `^agc_driver_bda` test. - Linux, both builds: 127 run, 119 pass, 8 skip, 0 fail. - Windows, both builds: 142 run, 42 pass, 100 skip (no Vulkan device), 0 fail. - The libc and libkernel suites run 199 and 308 tests on Linux and 226 and 330 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Validation** (`VERIFY_VALIDATION=1` on GitHub's Linux runner, `main` against this head, the same tests): both pass. The loader inserted `VK_LAYER_KHRONOS_validation` 98 times on `main` and 103 with this head, and neither log has `was not found`. Both report only `VUID-VkDeviceCreateInfo-pNext-pNext`, so the change adds none. - **`^agc` once with `OFF`** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41211498473)): - Linux: 1,140 run, 1,065 pass, 75 skip, 0 fail. - Windows: 1,185 run, 356 pass, 828 skip, **1 fail**. `agc_driver_graphics` stops at this PR's own check "a writable heap mirror a program stores to through addresses is not writable in the BDA table" (`tests/BdaResources.cpp`, from 781dc4525b). - That runner has no Vulkan device. In this run, the test's own context logs host imports failing at `vkAllocateMemory` (−2 and −1000072003) and falling back to copies. The repository's Windows CI job fails the same check at this head ([run](https://github.com/boykopovar/AnyPS5/actions/runs/41218223853/job/124587158688)): it now runs the AGC tests, which its run at 582e856556 didn't. - 6bec085232 doesn't touch it. d22d9c1a11, below, brings the case up to date. - **NVIDIA (TechLevelZero's GPU runner, [6546250585](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6546250585)):** 6bec085232 merged onto main 73f4f7e, RTX 2000 Ada, driver 595.99.02, Linux. Passed: 2,436 passed, 0 new failures (4 fail on main too), and no new validation IDs against main over 929 GPU tests. Its GPU pass ran `agc_driver_graphics` and the four `agc_driver_bda_store_heap_mirror` tests it selected (`_budget`, `_no_space_cache`, `_store_pages`, `_store_pages_default`), all passed. Its selection didn't include `agc_driver_pipeline_journal`, and `agc_driver_graphics`' heap-mirror case skips on Linux (no guest arena), so neither of those is measured there. - **d22d9c1a11, the Windows heap mirror case** (test-only, `tests/BdaResources.cpp` +77 −41). - **Why it failed:** `heapMirrorTests` runs only where the guest arena exists, which is Windows. It runs on the mock context, which has no sparse residency, so every heap mirror in it is copy-backed. Since 7e7c81a2aa, a copy-backed writable mirror is `Read|Write|Masked` in the BDA table, and its write-back stores only the pages the GPU reports. The case still expected `Read|Write` and reported no stores, so it failed on Windows every time, whatever the GPU. The production code is right; the case was out of date. - **The fix:** the writable part runs twice, first on a mirror forced copy-backed (`SetResidentAddressSpaceLimit(1)`, as `BdaStoreHeapMirror.cpp` does), then on the mirror the context gives. Each pass requires one mirror of the expected kind and expects exactly `Read|Write|Masked` for a copy-backed mirror, or `Read|Write` for a resident one with every block bound. It reports its three stores as the BDA does (`NoteAddressStores`, `NoteStorePages`) before `WriteBack`. The other checks are unchanged. - **Red and green on GitHub's Windows runner:** at 6bec085232, `agc_driver_graphics` fails ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41241022255)). At d22d9c1a11 it passes 10 runs in a row, with this PR's journal and BDA tests, with `OFF` ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41241180044)) and with `ON` ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41241192999)). Linux: 128 run, 120 pass, 8 skip, 0 fail. Windows: 143 run, 43 pass, 100 skip (no Vulkan device), 0 fail. - **A mutation** that drops `Write` from copy-backed mirrors' ranges turns `agc_driver_graphics` red on Windows and four of the `agc_driver_bda_store_heap_mirror` tests red on Linux ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41241032703)). - **`^agc` once at d22d9c1a11** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41241076240)): Linux 1,150 run, 1,075 pass, 75 skip, 0 fail. Windows 1,185 run, 357 pass, 828 skip, 0 fail. - The libc and libkernel suites run 199 and 308 tests on Linux and 226 and 330 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **9d2c13fd78, a merge of `main` 0836dfdf4f** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41246182571) with `ON`, [run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41246193038) with `OFF`). - **The conflicts:** - `CMakeLists.txt`, from #12862's split, resolved with `tools/agc_test_split.py resolve`. This PR's registrations move into a new `tests/cmake/agc_driver_bda_store_heap_mirror_tests.cmake` (+26) and into `agc_driver_pipeline_journal_tests.cmake` (+4, its `TIMEOUT 240`). Its `StorePageGather.comp` build rule stays in `CMakeLists.txt`. - `Graphics/include/GuestBufferMemory.hpp`, where ashwin280802's #13581 (heap mirror eviction) adds `HoldsMirror`, `EvictMirror`, `WasEvicted` and `RecordEvicted` at the spot where this PR adds `AllowAddressStores`, `NoteAddressStores` and the store span and page types. Both sides are kept, each unchanged. - **This PR's own diff** is unchanged apart from the registration move. - **#13581's eviction can't drop a mirror that holds this PR's pending stores** (read at the merge). `sweepMirrors` takes a writable heap mirror only when the mirror cache holds its one reference. The memory that records store spans for a mirror (writable heap mirrors only, at upload) holds it through its region's `shared_ptr` until `WriteBack` has consumed the stores. `EvictMirror` and `RecordEvicted` act only on a memory still being built, which has no spans or pages yet. - **The count:** with `-DBUILD_TESTING=ON`, `ctest -N` gives 3080 tests: `main`'s 3075 plus this PR's 5, each listed once, and `agc_driver_pipeline_journal` with this PR's `TIMEOUT 240`. - **×10 on GitHub's runners, with `ON` and with `OFF`:** this PR's journal, BDA and store-heap-mirror tests, `agc_driver_graphics` and #13581's `agc_driver_resident_heap_mirror`. Linux: 17 run, 17 pass, 0 skip, 0 fail. Windows: 18 run, 5 pass, 13 skip (no Vulkan device), 0 fail; `agc_driver_graphics` passes. The libc and libkernel suites run 199 and 308 tests on Linux and 226 and 330 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **On a cloud Linux machine** (lavapipe, CI's flags; [result](https://github.com/EagleBearerYS/AnyPS5/blob/cloud-results/results/cloud-1/PRM-112b.md)): with `ON`, this PR's set ×10 (160 runs) and `agc_driver_resident_heap_mirror` ×10 pass, and `^agc` gives 1,158 run, 1,083 pass, 75 skip, 0 fail. With `OFF`, the set and #13581's test pass ×3. - **a896536714 and d28c760af1, from oneandonlydean's review** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41297438213) with `ON`, [run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41297446034) with `OFF`). - **a896536714:** - The two store-page tests no longer require the "found none of the N store pages free" text. - The case at exactly the pool size is unchanged. - The over-limit dispatch must leave guest memory untouched. `_store_pages_default` already checked that, and `_store_pages` now checks that none of its threads' values reach any of its pages. - **d28c760af1:** a new debt entry, "Store page pool", says what a title gets past the pool. The use's fault check throws that message, none of its stores into heap mirrors reach guest memory, and raising `APS5_BDA_STORE_PAGES` gives a use more pages. - **×10, with `ON` and with `OFF`:** the same set as above. Linux: 17 run, 17 pass, 0 skip, 0 fail. Windows: 18 run, 5 pass, 13 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 199 and 308 tests on Linux and 226 and 330 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Not run:** a title-level cost comparison against a baseline on real hardware. - **NVIDIA RTX 2000 Ada Generation, TechLevelZero's NVIDIA GPU test at d28c760af1** ([comment](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6557952355)): merged onto `main` d5ec8e6, driver 595.99.02, Linux, the Khronos layer. Passed: 2,494 passed, 0 new failures (3 fail on `main` too and 1 is unstable there), 45 skipped, and no new validation IDs against `main` over 939 GPU tests. - Its GPU pass ran `agc_driver_bda_store_heap_mirror` (passed, 7.96 s) and, this time, `agc_driver_pipeline_journal` (passed, 134.0 s with the layer and `ANYPS5_NO_SHADER_CACHE=1`). The report gives no `main` time for the journal test, so this isn't a cost comparison. Its selection didn't include this PR's other four store-heap-mirror tests or `agc_driver_graphics`. - `agc_driver_bda_store_heap_mirror` is this PR's own test, so `main`'s baseline doesn't have it and its validation wasn't compared. - **b6f54ac940, a merge of `main` 5bae1a4bc2** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41350601208) with `ON`, [run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41350612387) with `OFF`, [validation](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41350624034)). - **The conflict:** #14839 reverted liskeee's #13931 (persistent compute pipeline binaries) on `main`. The previous merge, 6f7d8f1277 (`main` d8b60b46ed), had kept #13931's `ComputePipelineObjects::binaryLayoutKey` and its fill in `createComputePipeline` beside this PR's `storePages` and SPIR-V scan, in `Execution/src/VulkanDevice.cpp`, so the revert conflicted there. The merge takes `main`'s side for #13931's lines and keeps this PR's, so no `PipelineBinaryStore` or `binaryLayoutKey` is left in the file. - **This PR's diff is unchanged:** the merged tree is the same as merging `main` 5bae1a4bc2 into d28c760af1, the head before 6f7d8f1277, and the changed lines are the same in all 31 files. Only `PipelineJournal.cpp`'s context moved, from `main`'s eb4ec317c0. - **×10, with `ON` and with `OFF`:** this PR's journal, BDA and store-heap-mirror tests, `agc_driver_graphics` and #13581's `agc_driver_resident_heap_mirror`. #13931's two pipeline-binary tests left `main` with the revert. Linux, both builds: 18 run, 18 pass, 0 skipped, 0 fail. Windows, both builds: 19 run, 5 pass, 14 skipped (no Vulkan device), 0 fail. The libc and libkernel suites ran 208 and 309 tests on Linux and 235 and 330 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Validation** (`VERIFY_VALIDATION=1` on GitHub's Linux runner, `main` against this head, the same tests): the loader inserted `VK_LAYER_KHRONOS_validation` 17 times on `main` and 31 with this head, and neither log has `was not found`. Both report only `VUID-VkDeviceCreateInfo-pNext-pNext`, so the merge adds none. - **The same resolution on a 4-vCPU Xeon** (Ubuntu 24.04, GCC 13.3, the CI flags, lavapipe, as an unprivileged user): this PR's 130 tests and every test in the four executables #14839 and #14823 touch (`agc_display_buffer_dcc_tests`, `agc_driver_dcc_keys_first_write_tests`, `agc_pipeline_cache_allocation_tests`, `agc_driver_recorder_tests`). 137 run, 129 pass, 8 skipped (recorder tests that skip on that machine), 0 fail. - **TechLevelZero's GPU tests at 6f7d8f1277**, merged onto `main` f2d874c, before the revert: - **AMD Radeon RX 6300** (RADV NAVI24, Mesa 25.2.8, Linux; [report](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6563655756)): 2,494 passed, 12 failed and 54 skipped. None of the failures is new: 9 also fail on `main` and 3 are unstable on `main`. No new validation IDs against `main` over 944 GPU tests. - **NVIDIA RTX 2000 Ada Generation** (driver 595.99.02, Linux; [report](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6563870799)): 2,510 passed, 4 failed and 46 skipped. All 4 failures also fail on `main`. No new validation IDs against `main` over 944 GPU tests. - With the layer, `agc_driver_pipeline_journal` took 183.3 s on the AMD card and 132.6 s on the NVIDIA one. Neither report gives a `main` time for it. - **7af65f5066, a merge of `main` 88e804b0a7.** `main` now has JJenkx's #8874 (heap mirror reference buffers), Celegans12's #9287 (staged copies inside a dispatch run) and JJenkx's #6959 (layered mesh targets). - **#8874:** `GuestBufferMemory::takeHeapReferences` and `releaseHeapReferences` keep both sides. Each reference is taken from #8874's `ReferenceStorage` pool and returned to it, and this PR's copied path (`pendingReferenceCopies`) still applies inside a recorded run. Where the mirror is cleared, the references are released before this PR's store-page resets. - **#9287:** in `ShaderResources.cpp`, this PR's `RecordStorePageGather` runs after #9287's in-run copy-back block. - **#6959** takes specialization IDs 8237 and 8238 for `MeshLayerBase` and `MeshLayerCount`, so `StorePages` moves to 8239. - **A code change inside the merge commit:** #6959 also adds a loop to `buildSpecializedModule` in `Recompiler.cpp` that lists a module's specialization constants. It leaves out only the workgroup offsets and looks every other ID up among the prepared values. `StorePages` is supplied at dispatch, not prepared, so that lookup threw `map::at`: before the change, nine tests failed on Linux and three on Windows. The merge commit changes that one line from `IsWorkgroupOffset(id)` to `IsDispatchSupplied(id)`, the check `specializeWords` already uses for the same IDs. It's folded into the merge so that no commit fails its tests. - This PR's diff over `main` is otherwise unchanged. - **×10** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41437490403)): the BDA, heap-mirror, pipeline-journal and graphics tests, with #6959's new tests and the tests that failed before the change. Linux: 29 run, 28 pass, 1 skip (`agc_driver_layered_volume_mesh`), 0 fail. Windows: 30 run, 12 pass, 18 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (210 and 310) and on Windows (237 and 331). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Every `agc` test, once** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41437504329)): Linux: 1,223 run, 1,146 pass, 77 skip, 0 fail. Windows: 1,259 run, 379 pass, 880 skip (no Vulkan device), 0 fail. - **NVIDIA:** TechLevelZero's NVIDIA bot ran this head merged onto `main` 88e804b on an RTX 2000 Ada ([report](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6579714344)): 2,560 passed, 5 failed, none new (3 also fail on `main`, 2 unstable on `main`), 45 skipped, with no new validation IDs (978 tests on the GPU). - **9fd023a310, a merge of `main` 5cb015caaa**, which brings Pipodi's #12764 (compute scratch backed by a device buffer slot pool). - **The conflicts:** `VulkanDevice.hpp` and `VulkanDevice.cpp`, each time one PR's addition next to the other's. The merge keeps both: in the header, #12764's `scratchPoolHeader` declaration and this PR's `specializedComputePipeline`; in the source, this PR's `StorePages` scan and #12764's three-element `setLayouts` for the scratch pool. - This PR's diff over `main` is otherwise unchanged. - **×10** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41540603065)): the BDA, heap-mirror, pipeline-journal and graphics tests, with the dispatch-overlap, layered-mesh and layer-specialization tests. Linux: 29 run, 28 pass, 1 skip (`agc_driver_layered_volume_mesh`), 0 fail. Windows: 30 run, 12 pass, 18 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (279 and 321) and on Windows (306 and 342). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Every `agc` test, once** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41540618055)): Linux: 1,258 run, 1,176 pass, 80 skip, 2 fail. Windows: 1,295 run, 397 pass, 898 skip (no Vulkan device), 0 fail. The two Linux failures: - `agc_driver_image_sample_lod_clamp_shader_lane` fails on `main` too. #12980 added its bilinear row, and adriadam10's 5821b867e7 on `main` widens that check after `main`'s push builds failed it on lavapipe. - `agc_driver_pipeline_journal` reached its 240-second timeout while the sweep ran four of its 1,258 tests at a time. In the ×10 above, among 29 tests, it passes 10 of 10, in 57 to 185 s. - **The journal test's time,** run alone three times on GitHub's Linux runner: - on `main` 7feb37ee3e, without this PR ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41551689674)), its first run reaches the 120-second default timeout; - with this PR at 9fd023a310 ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41551702789)), all 3 pass, in 181.4, 65.1 and 64.2 s, under its `TIMEOUT 240`. - TechLevelZero's AMD machine also lists it as unstable on `main`: it failed in 4 of the last 6 `main` runs there ([report](https://github.com/boykopovar/AnyPS5/pull/10000#issuecomment-6592019764)). - So on a cold run on that runner, `main`'s own test already takes longer than 120 s, and this PR adds to that, as the cost note above says. - **GPUs:** TechLevelZero's bots ran this head. NVIDIA RTX 2000 Ada (driver 595.99.02), merged onto `main` f6232fc ([report](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6596906057)): 2,753 passed, 5 failed, none new (3 also fail on `main`, 2 unstable on `main`), 49 skipped, with no new validation IDs (943 tests on the GPU). AMD Radeon RX 6300 (RADV NAVI24, Mesa 25.2.8), merged onto `main` 7feb37e ([report](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6597093695)): 2,740 passed, 9 failed, none new (8 also fail on `main`, 1 unstable on `main`), 58 skipped, with no new validation IDs (943 tests on the GPU). - **a162a98f11, a merge of `main` 4f41f4c375**, which brings #8963 (shared BDA fault buffers, merged first as planned) and ee6aba54's #6185 (`WriteBack` keeping the CPU's bytes only in host-copied write-backs). - **The conflicts:** `CMakeLists.txt`, `Execution/src/GuestMemory.cpp`, `Graphics/include/BdaResources.hpp`, `Graphics/src/BdaResources.cpp`, `Graphics/src/GuestBufferMemory.cpp` and `tests/BdaShader.cpp`. - **#8963's fault arena** replaces per-build fault buffers with shared 512 KiB chunks, 32-byte slots for report-only builds, and reclaim of idle builds' slots under pressure. This PR keeps its store-page words (pool address, base, slots, overflow) after `SrtGuardWord` in a full-size fault buffer, so the merge keeps the arena and changes one thing in it: - A build that stores through addresses gets a private fault slot: its own one-slot buffer with device-address usage. The arena never shares it with another build and never reclaims it from a live idle build, because its address is part of that build's store-page setup. It is freed when the build is destroyed or evicted, and the arena's slot and chunk counts drop by one, as every slot does with `APS5_NO_SHARED_FAULT_SLOTS=1`. - Fault-only builds keep #8963's shared and report-only slots unchanged. - The store-page code reads and writes the slot through the arena (`faultBytes()` and the slot's device address), where it used to use its own buffer. - **#6185's `ChangedStore`** composes with this PR's recorded store runs. In `GuestBufferMemory.cpp`, `storeChanged` takes #6185's store function and this PR's `Pieces* stored`: a heap-mirror write-back passes `stored` and writes through `GuestMemory::WriteChanged`, recording each run, and every other caller stores with #6185's function. In `GuestMemory.cpp`, one `writeChanged` takes #6185's `keepGuest` and this PR's `stored`, behind three wrappers. - **`CMakeLists.txt` and `BdaShader.cpp`** keep both sides. - **This PR's diff over `main`** goes from +1,956 −70 to +1,964 −77, in 31 files. The change is in `BdaResources.hpp`, `BdaResources.cpp`, `GuestBufferMemory.cpp` and `GuestMemory.cpp`. - **×10** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41603560365)): `agc_changed_copy`, `agc_driver_graphics`, `agc_driver_pipeline_journal`, `agc_driver_resident_heap_mirror` and every test matching `^agc_driver_bda`, `^agc_bda`, `^agc_driver_heap_mirror` or `^agc_shader_bda`. Linux: 18 run, 18 pass, 0 skip, 0 fail. Windows: 18 run, 3 pass, 15 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 300 and 322 tests on Linux and 327 and 342 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Every `agc` and `guest_memory` test, once** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41603573697)): Linux: 1,281 run, 1,197 pass, 83 skip, 1 fail. Windows: 1,317 run, 402 pass, 915 skip (no Vulkan device), 0 fail. The one failure: `992/1281 Test #1389: agc_driver_pipeline_journal ...***Timeout 240.07 sec`. It passes 10 of 10 in the ×10 above, and it timed out the same way, at 240.06 s, in this PR's sweep before the merge. TechLevelZero's AMD machine lists it as unstable on `main`, failed in 6 of the last 8 `main` runs there ([report](https://github.com/boykopovar/AnyPS5/pull/9457#issuecomment-6600140416)). - **GPUs:** TechLevelZero's bots ran this head merged onto `main` 4f41f4c. NVIDIA RTX 2000 Ada (driver 595.99.02; [report](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6604681013)): 2,772 passed, 6 failed, none new (3 also fail on `main`, 3 unstable on `main`), 48 skipped, with no new validation IDs (939 tests on the GPU). AMD Radeon RX 6300 (RADV NAVI24, Mesa 25.2.8; [report](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6606024292)): 2,758 passed, 10 failed, none new (8 also fail on `main`, 2 unstable on `main`), 58 skipped, with no new validation IDs (939 tests on the GPU). Under the validation layer, `agc_driver_pipeline_journal` took 130.4 s on the NVIDIA card and 240.1 s on the AMD one, whose bot lists it as failed in 7 of the last 9 `main` runs there. - **c68d814837, a test of the private fault slot** (test-only, `tests/BdaResources.cpp`). The heap-mirror tests now create a build that stores through addresses over each writable heap mirror, copy-backed and resident: - while it lives, the arena counts one more slot, one more chunk and one more holder, and destroying it takes all three back out; - under fault slot pressure that reclaims idle builds' slots, the idle storing build keeps its private slot. - These builds use a context without the buffer pool, so the memory they free can't serve the heap-mirror budget checks that follow. - **Red:** 75cbd46109 drops `|| privateSlot` from the check in `BdaResources`' destructor that gives a slot's counts back. On GitHub's Windows runner `agc_driver_graphics` then fails with "a destroyed build that stored through addresses into a copy-backed writable heap mirror left its fault chunk counted in the arena" ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41639577740)). On GitHub's Linux runner it passes either way: the heap-mirror tests don't run there ("guest arena unavailable or not write-watched: heap mirrors not tested"). - **×10** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41639677306)): `agc_changed_copy`, `agc_driver_graphics`, `agc_driver_pipeline_journal`, `agc_driver_resident_heap_mirror` and every test matching `^agc_driver_bda` or `^agc_bda`. Linux: 18 run, 18 pass, 0 skip, 0 fail. Windows: 18 run, 3 pass, 15 skip (no Vulkan device), 0 fail; `agc_driver_graphics`, which holds the new case, passes 10 of 10. The libc and libkernel suites run 300 and 322 tests on Linux and 327 and 342 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **c4d6d41dff, a merge of `main` 04a9eb4fa2** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41722438134)). The one conflict was in `Execution/include/GuestMemory.hpp`, where JAB-dev's #13021 declares `WriteChangedIfHeld` at the place this PR declares its `WriteChanged` overload that returns the stored ranges. Both stay, and this PR's diff over `main` is unchanged. - **×10:** `agc_changed_copy`, `agc_driver_graphics`, `agc_driver_pipeline_journal`, `agc_driver_resident_heap_mirror` and every test matching `^agc_driver_bda` or `^agc_bda`, with #13021's `agc_driver_native_depth_publication`. Linux: 19 run, 19 pass, 0 skip, 0 fail. Windows: 19 run, 3 pass, 16 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 300 and 324 tests on Linux and 330 and 342 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **TechLevelZero's GPU bots at c4d6d41dff**, this head merged onto `main` 1c8c0ef, 2,853 of 3,842 tests selected. Of this PR's tests, `agc_driver_bda_store_heap_mirror` and `agc_driver_resident_heap_mirror` ran and passed on both. The four added registrations (`agc_driver_bda_store_heap_mirror_budget`, `_no_space_cache`, `_store_pages` and `_store_pages_default`) weren't in either selection. - **NVIDIA RTX 2000 Ada Generation** ([report](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6620293752)), driver 595.99.02: 2,798 passed, 5 failed (none new: 3 also fail on `main`, 2 unstable on `main`), 50 skipped. - **AMD Radeon RX 6300 (RADV NAVI24, Mesa 25.2.8)** ([report](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6621055833)): 2,783 passed, 9 failed (none new: 7 also fail on `main`, 2 unstable on `main`), 61 skipped. No new validation IDs over 960 GPU tests. - Both ran before #15423, so their `agc_driver_pipeline_journal` times include the filler zero-fills #15423 removes. - **3fa9852e8c, a merge of `main` b11c7bf84f,** which brings #13858 ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41802412002), [every `agc` test](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41802496830)). - **The conflicts,** in `BdaResources.hpp`, `ShaderResources.hpp` and `BdaResources.cpp`. #13858 checks a draw use's fault record through `CheckUse(record)`, and `checkFault`, `markWrittenPages` and `checkSrtGuard` take the record whose fault slot the GPU wrote. This PR's store pages live in that slot too, so the merge has `checkFault` collect the record's store pages, check its overflow, and re-attach its pages after a loop-guard clear. - For a build's own use, the record is the build itself, as before. #13858 reuses only read-only builds, and their records hold no store pages. - `markWrittenPages` keeps this PR's written-page list. - Both headers keep both sides' declarations, and `BdaResources.cpp` keeps #13858's `TableBytes` and `TableGuardCurrent` beside this PR's store-page functions. - This PR's store-page words come after `SrtGuardWord`, so #13858's slot cleaning, which clears the fault head and the SRT guard word, leaves them in place. - **×10:** every test matching `^agc_driver_bda`, `^agc_bda`, `^agc_driver_address_draw_space_reuse`, `^agc_host_import`, `^agc_write_tracking` or `^agc_driver_host_import_proofs`, with `agc_driver_resident_heap_mirror` and `agc_driver_pipeline_journal`, which takes in this PR's tests and #13858's. Linux: 28 run, 27 pass, 1 skip (`agc_host_import_sparse`, no `/dev/udmabuf`), 0 fail. Windows: 33 run, 8 pass, 25 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 303 and 327 tests on Linux and 334 and 345 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Every `agc` test, once:** Linux: 1,331 run, 1,246 pass, 85 skip, 0 fail. Windows: 1,370 run, 407 pass, 963 skip (no Vulkan device), 0 fail. - **TechLevelZero's GPU bots at 3fa9852e8c**, this head merged onto `main` b11c7bf, 2,915 of 3,894 tests selected. Of this PR's tests, `agc_driver_bda_store_heap_mirror` and `agc_driver_resident_heap_mirror` ran and passed on both, and so did #13858's `agc_driver_address_draw_space_reuse`. The four added registrations weren't in either selection. - **NVIDIA RTX 2000 Ada Generation** ([report](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6632476088)), driver 595.99.02: 2,863 passed, 3 failed (none new: all 3 also fail on `main`), 49 skipped. No new validation IDs over 990 GPU tests. - **AMD Radeon RX 6300 (RADV NAVI24, Mesa 25.2.8)** ([report](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6634336011)): 2,847 passed, 8 failed (none new: 7 also fail on `main`, 1 unstable on `main`), 60 skipped. No new validation IDs over 990 GPU tests. - Both ran before #15423, so their `agc_driver_pipeline_journal` times include the filler zero-fills #15423 removes. - **125faf559e, a merge of `main` 090f57166a** ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42374441913), [#15423's test ×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42379738376)). - **The conflict:** `tests/cmake/agc_driver_pipeline_journal_tests.cmake`, where `main` now has #15423's `if(BUILD_TESTING)` block with `agc_driver_pipeline_journal_undecodable_module`. This PR's `TIMEOUT 240` line for `agc_driver_pipeline_journal` goes into that block as its first line, so the file keeps one block. This PR's other lines are unchanged; `Recorder.cpp` and `docs/dev/debt/libSceAgcDriver.md` differ only in context. - **×10:** the same tests as on 3fa9852e8c. Linux: 29 run, 28 pass, 1 skip (`agc_host_import_sparse`, no `/dev/udmabuf`), 0 fail; `agc_driver_pipeline_journal` passed 10 of 10, the slowest in 102.8 s. Windows: 34 run, 9 pass, 25 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 327 and 344 tests on Linux and 358 and 371 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **#15423's test:** that set names `agc_driver_pipeline_journal` exactly, so a second ×10 ran `agc_driver_pipeline_journal_undecodable_module` with this PR's five `agc_driver_bda_store_heap_mirror*` tests. Linux: 6 run, 6 pass, 0 fail, the new test 10 of 10. Windows: 6 run, 6 skip (no Vulkan device). - **a62b1d7b8d, a merge of `main` dd7c8de5de** ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42512331020)). - **The conflicts:** - `GuestMemory.cpp`: this PR's `writeChanged` definition, with its `stored` parameter, takes the `[[maybe_unused]]` on `byteStoreLimit` that oberonlift's #15797 added to `main`'s. - `tests/execution/PipelineJournal.cpp`'s `ReplayRacesDispatchTests`: dantdmdarealguy's #15730 builds the race's programs with the shared `ReplayedCodes()`, 16 programs from salt 8 in place of 32 from salt 16, and drops the function's `Pipelines = 32`. The merge takes `const auto codes = ReplayedCodes();` and keeps this PR's lines: the journal set aside, the raced pipelines recorded into an empty journal and required to be journaled, and the journal put back. Since `Pipelines` is gone, the count check now reads `held == ReplayedPrograms`, `main`'s constant. - This PR's other changed lines are the same, and `GuestBufferMemory.hpp` differs in context only. - **×10:** every test matching `^agc_driver_bda`, `^agc_bda`, `^agc_driver_address_draw_space_reuse`, `^agc_host_import`, `^agc_write_tracking`, `^agc_driver_host_import_proofs`, `^agc_driver_pipeline_journal` or `^agc_pipeline_journal`, with `agc_driver_graphics` and `agc_driver_resident_heap_mirror`. Linux: 34 run, 33 pass, 1 skip (`agc_host_import_sparse`), 0 fail; `agc_driver_pipeline_journal`, `agc_driver_pipeline_journal_undecodable_module`, `agc_pipeline_journal` and `agc_pipeline_journal_long_paths` pass 10 of 10. Windows: 40 run, 13 pass, 27 skip, 0 fail. The Windows runner has no Vulkan device, so `agc_driver_pipeline_journal` and `agc_driver_pipeline_journal_undecodable_module` skip there with the other Vulkan tests; the graphics binary's `agc_pipeline_journal`, `agc_pipeline_journal_long_paths` and `agc_pipeline_journal_extended_paths` pass 10 of 10. The libc and libkernel suites run 344 and 346 tests on Linux and 375 and 373 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **a3e3e770e7, a merge of `main` 7259cce111** ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42683083429), [every `agc` test](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42683154784)). - **The conflict:** `VulkanDevice.cpp`'s `ComputePipelineObjects`, where liskeee's #15169 adds `binaryLayoutKey` on the line this PR adds `storePages` to. The merge keeps both. #15169's pipeline binary store arguments reach this PR's `specializedComputePipeline` without a conflict, and the store's key covers the specialization data, so the `StorePages` variant gets its own binary. oneandonlydean's #17982 has since reverted #15169 on `main` (see 7cf8f10403 below). - This PR's changed lines are the same in all 31 files; only their context differs. - **×10:** the same tests as on a62b1d7b8d, with #15169's `^agc_pipeline_binary` and `^agc_driver_pipeline_binary` tests. Linux: 48 run, 45 pass, 3 skip (`agc_host_import_sparse`, and #15169's `agc_pipeline_binary_vulkan` and `agc_driver_pipeline_binary_startup`), 0 fail. This PR's five `agc_driver_bda_store_heap_mirror*` tests, `agc_driver_graphics`, `agc_driver_resident_heap_mirror` and `agc_driver_pipeline_journal` pass 10 of 10, the journal's slowest in 89.9 s. Windows: 56 run, 27 pass, 29 skip (no Vulkan device), 0 fail. #15169's two Vulkan tests skip on both runners, so these runs don't show the `StorePages` variant going through a pipeline binary. - **Every `agc` test, once:** Linux: 1,507 run, 1,412 pass, 95 skip, 0 fail. Windows: 1,550 run, 477 pass, 1,073 skip (no Vulkan device), 0 fail. - **Suites:** libc and libkernel run 350 and 348 tests on Linux with 0 failed, and 380 and 375 on Windows. On Windows, libkernel's `guest_kernel_resident_fmem_export` and `guest_kernel_resident_fmem_export_patched` fail in both runs. The same harness fails them on `main` 7259cce111 alone ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42693594401)), and `main`'s own Windows job passes them, so they come from the verify harness, not this PR. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **7cf8f10403, a merge of `main` 47adcad89a** ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42757410241), [every `agc` test](https://github.com/EagleBearerYS/AnyPS5/actions/runs/42746210101)). - **The conflict:** oneandonlydean's #17982 reverts #15169 on `main`, since `main` crashed at boot in `PipelineBinaryStore::queryKey`. That takes out the `binaryLayoutKey` member that the merge of 7259cce111 kept beside this PR's `storePages` in `ComputePipelineObjects`. The merge drops `binaryLayoutKey` and keeps `storePages`. Nothing in the tree uses #15169's store any more, and this PR's changed lines are the same in all 31 files. - **×10:** the same tests as on a62b1d7b8d, without #15169's 14 tests, which the revert removes. Linux: 34 run, 33 pass, 1 skip (`agc_host_import_sparse`), 0 fail. This PR's five `agc_driver_bda_store_heap_mirror*` tests, `agc_driver_graphics`, `agc_driver_resident_heap_mirror` and `agc_driver_pipeline_journal` pass 10 of 10, the journal's slowest in 68.3 s. Windows: 42 run, 15 pass, 27 skip (no Vulkan device), 0 fail. - **Every `agc` test, once:** Linux: 1,518 run, 1,425 pass, 93 skip, 0 fail. Windows: 1,561 run, 466 pass, 1,095 skip (no Vulkan device), 0 fail. - **Suites:** libc and libkernel run 350 and 348 tests on Linux with 0 failed, and 380 and 375 on Windows, where only the verify harness's `guest_kernel_resident_fmem_export` and `guest_kernel_resident_fmem_export_patched` fail, as on a3e3e770e7. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **af6430b3d4, a merge of `main` 884694cf85** ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43555771772), [every `agc` test](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43555824098)). - **The conflict:** chitters2004's #16752 tracks the Vulkan command state. A raw `vkCmdBindPipeline` through `Resolved` or `function()` no longer compiles, and a compute pipeline binds through `context.BindComputePipeline`, which skips a bind the command buffer already has. Three of this PR's binds move to it: - in `VulkanDevice.cpp`, the dispatch's bind, of `specializedComputePipeline`'s `StorePages` variant or the record's pipeline; - in `VulkanDevice.cpp`, the bind for each split chunk; - in `Recorder.cpp`, the store-page gather's bind of `storePageGatherPipeline`, as #16752 does for the recorder's other compute pipelines. It's `main`'s API, with this PR's pipelines unchanged. This PR's changed lines are the same in the other 29 of its 31 files. - **×10:** the same tests as on 7cf8f10403, with #16752's `agc_command_state`, `agc_graphics_state_recorder` and `agc_graphics_state_recorder_unsuppressed`. Linux: 38 run, 37 pass, 1 skip (`agc_host_import_sparse`), 0 fail. This PR's five `agc_driver_bda_store_heap_mirror*` tests, `agc_driver_graphics`, `agc_driver_resident_heap_mirror`, `agc_driver_pipeline_journal` and #16752's three tests pass 10 of 10, the journal's slowest in 67.0 s. Windows: 47 run, 18 pass, 29 skip (no Vulkan device), 0 fail. - **Every `agc` test, once:** Linux: 1,651 run, 1,543 pass, 106 skip, 2 fail. Windows: 1,689 run, 495 pass, 1,194 skip (no Vulkan device), 0 fail. The two Linux failures are `main`'s: - `agc_driver_global_atomic_csub`: "AGC graphics: global atomic csub without glc: wave64 byte 644 is 146, expected 0"; - `agc_driver_coherent_atomic_loads_enabled`: a 60-second timeout. `main`'s own Linux job fails both, with the same message and the same timeout, at d2949cd806 ([job](https://github.com/boykopovar/AnyPS5/actions/runs/43549645830/job/132332373767)) and at 67ec0f7d8c ([job](https://github.com/boykopovar/AnyPS5/actions/runs/43553714011/job/132335135662)), covered by #19332. - **Suites:** libc and libkernel run 380 and 374 tests on Linux with 0 failed in both runs, and 410 and 402 on Windows. - **The ×10 run's first Windows attempt** ([attempt 1](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43555771772/attempts/1)): libkernel's `guest_timed_wait_cpu` failed on its overshoot limits. `sceKernelUsleep(500 us)` reached a P99 overshoot of 4,303 µs, against a limit of 2,500 µs, and `ksem_timedwait(500 us)` 3,248 and 3,012 µs. This PR doesn't change libkernel. In the `agc` run on the same head, the Windows libkernel suite ran 402 tests with 0 failed, `guest_timed_wait_cpu` among them. - **The rerun of that job** ([attempt 2](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43555771772/attempts/2)): Windows: 47 run, 18 pass, 29 skip (no Vulkan device), 0 fail, 10 of 10 runs. The libc and libkernel suites ran 410 and 402 tests with 0 failed, `guest_timed_wait_cpu` among them. - The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes only `precise_wait`'s median bounds on GitHub's hosted runners. - **`agc_shader_memory` in upstream's Windows job** ([job](https://github.com/boykopovar/AnyPS5/actions/runs/43567857187/job/132365571621)): upstream CI merged this head onto `main` b6717527ce, and `agc_shader_memory` exited with 0xc0000374 after "read of 0xffffffff00000008". That `main` sits between #18827 (04:46Z on 14 Nov) and #19893 (08:20Z), and `main` alone crashes in the same test binary there: - `main`'s own push run at 6f6d066c7e ([job](https://github.com/boykopovar/AnyPS5/actions/runs/43560552921/job/132349152031)) exits `agc_shader_memory` with 0xc0000374; - `main` b6717527ce alone on GitHub's Windows runner ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43571968405)) passes `agc_shader_memory` 10 of 10, and `agc_shader_memory_coherent_atomic_loads` crashes in its 10th run with the same fault address; - this head merged onto b6717527ce ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43579769792)) crashes both tests in their 3rd run, at the same instruction as upstream's job (`agc_shader_memory_tests.exe+0x522829`). On `main` f0c9b11f91, after #19893, neither test crashes: in 3 runs of 10 per arm, this head merged onto it and `main` alone each pass `agc_shader_memory` and `agc_shader_memory_coherent_atomic_loads` 30 of 30 (this head: [1](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43588745602), [2](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43588838434), [3](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43588924121); `main`: [1](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43588788058), [2](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43588878255), [3](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43588964205)). The Windows trees of these runs had #19899's `_putenv_s` test fix on top. - **3704189764, a merge of `main` 11992f9695** ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43757739276), [×10 with the Windows test fix](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43765406022), [every `agc` test](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43757822987)), which brings adam25136's #17850 (CPU reads of indirect draw records wait for address-based writers). - **The conflict:** `docs/dev/debt/libSceAgcDriver.md` only. #17850 rewrote the "CPU reads behind an address-based build" entry, right before this PR's two entries. The file merges with `merge=union`, which would keep the old copy of that entry next to the new one, so the merge takes #17850's entry and keeps this PR's two after it. - **Diff:** this PR's changed lines are the same in all 31 files, and its diff over `main` stays +1,996 −77. Only context lines moved, in that debt entry and in `docs/dev/ENVIRONMENT.md`. `GuestBufferMemory.cpp`, which #17850 also changes, merged without a conflict. - **×10:** the set of the af6430b3d4 run, with #17850's four `agc_driver_indirect_draw_pending_producer*` tests. Linux: 45 run, 44 pass, 1 skip (`agc_host_import_sparse`), 0 fail; #17850's four tests pass 10 of 10. Windows: 57 run, 21 pass, 36 skip (no Vulkan device; #17850's four tests are among them), 0 fail. The libc and libkernel suites run 388 and 384 tests on Linux and 418 and 412 on Windows, with 0 failed. They ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes only `precise_wait`'s median bounds on GitHub's hosted runners. - **Every `agc` test, once, on Linux:** 1,809 run, 1,686 pass, 114 skip, 9 fail. - Seven also fail in `main`'s own Linux job at 3e1b183e43 ([job](https://github.com/boykopovar/AnyPS5/actions/runs/43752627274/job/132933973639)): `agc_driver_global_atomic_csub`, `agc_driver_stencil_copy_draw`, `agc_driver_coherent_atomic_loads_enabled`, `agc_driver_image_table_packed_guards`, `agc_driver_recorder`, `agc_draw_input_mirrors` and `agc_draw_input_reuse`. - The other two, the `agc_driver_runtime_buffer_spans_x3_spans` and `_x4_spans` timeouts, passed there. Over 10 runs of `main` 790e9a371c with #19899's test-only commit on top ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43765537506)), both time out too. - **The Windows tree:** the Windows runs had Sankalp7317's [#19899](https://github.com/boykopovar/AnyPS5/pull/19899) on top, since `main`'s Windows test build stops at "'setenv' was not declared" in `UploadCacheReadOnlyFlush.cpp` (from #18037). It isn't on this branch. The Windows builds of the first ×10 and of the `agc` run, on this head alone, stopped at that error. - **No GPU run on 3704189764.** - **bcc617f141, a merge of `main` 0173f20a5f** ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43833018634), [every `agc` test](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43833137194)), which brings Ketz7's #20870 (a BDA fault recorded with one atomic claim). - **The conflict:** one line in `Graphics/src/BdaResources.cpp`, at the `Require` that a fault record without a publication holds no data. #20870 changes its last check from `report.otherFaults == 0` to `report.claim == 0`, and this PR adds its `pagesOverflowed` `Require` on the next line. The merge keeps #20870's line, with this PR's after it. - **Diff:** this PR's changed lines are the same in all 31 files, and its diff over `main` stays +1,996 −77. Its patch-id changed, since the line before this PR's `Require` is now #20870's. - **The fault buffer layout:** #20870 grows `BdaAbi::Fault` from 32 to 40 bytes (`otherFaults` becomes `claim`, `discard` and `reserved`). This PR's store-page words follow the fault record and chain from `WrittenOverflowWord = sizeof(Fault) / 4`, so they move with it, and `FaultBufferBytes` grows to match. In the merged code, the host side, the SPIR-V emitter (`SpirvBdaLookup.cpp`, `SpirvMemoryInstructions.cpp`) and the tests address these words through the `BdaAbi` constants, and the store-page gather shader gets its word indices as push constants from `Recorder.cpp`, so no word index is written out by hand. - **×10:** the set of the 3704189764 run. Linux: 45 run, 44 pass, 1 skip (`agc_host_import_sparse`), 0 fail; `agc_driver_bda_device` and `agc_shader_memory`, whose tests #20870 changes, pass 10 of 10. Windows: 57 run, 22 pass, 35 skip (no Vulkan device), 0 fail. - **The suites:** libc and libkernel run 391 and 390 tests on Linux and 422 and 417 on Windows. Libkernel: 0 failed on both. Libc: `guest_multibyte_locale`, which checks that `wcstombs` fills the capacity mid-character, fails on both. That comes from `main`: gurtgg's #21244 (merged 08:27Z on 16 Nov) stops `wcstombs` before a character that doesn't fit, `main`'s own push run at dcf3d15978 fails the test on [Linux](https://github.com/boykopovar/AnyPS5/actions/runs/43834891663/job/133202991353) and [Windows](https://github.com/boykopovar/AnyPS5/actions/runs/43834891663/job/133202991404), and oneandonlydean's open #21515 reverts #21244. This PR changes no libc file. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes only `precise_wait`'s median bounds on GitHub's hosted runners. - **Every `agc` test, once:** Linux: 1,876 run, 1,746 pass, 123 skip, 7 fail. Windows: 1,918 run, 559 pass, 1,359 skip, 0 fail. `agc_driver_graphics`, which holds #20870's `BdaResources` test changes, passes on both. - Six also fail in `main`'s own Linux job at dcf3d15978 ([job](https://github.com/boykopovar/AnyPS5/actions/runs/43834891663/job/133202991353)): `agc_hook_clear_access`, `agc_hook_clear_access_off`, `agc_driver_recorder`, and the `agc_driver_runtime_buffer_spans_x2_spans`, `_x3_spans` and `_x4_spans` timeouts. - The seventh, `agc_driver_image_table_packed_guards`, fails the same way in `main`'s own Linux job at e249fc47b5 ([job](https://github.com/boykopovar/AnyPS5/actions/runs/43816702928/job/133145283420)): three identical "stage 4 pc 0x68" records, then "unrecoverable packed table format was not poisoned". fernandomcrsilva's #21255 changes that test. - The suites: libc's `guest_multibyte_locale` on both, as above. On Linux, libkernel's `guest_thermal_sensors` also reached its 20 s timeout. It times out in every run I have on GitHub's Intel Xeon 6975P-C runners, `main` 0694c4cbd6 alone included ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43832502375)), and passes in 0.01 to 0.02 s on GitHub's AMD EPYC runners and in `main`'s own job. This PR changes no libkernel file. - **The Windows tree** again had #19899's `_putenv_s` test fix on top; it isn't on this branch. - **A GPU run on bcc617f141:** @domx4q's RTX 4090 run with the validation layer (below). - **NVIDIA GeForce RTX 4090, by @domx4q, with the Khronos validation layer** ([comment](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-6922566730)): Arch Linux (kernel 7.3.4), GCC 16.2.1 Release, driver 620.70.06, Vulkan 1.4.357, validation layer 1.4.363.1, with `ANYPS5_REQUIRE_VULKAN=1` and `ANYPS5_NO_SHADER_CACHE=1`. This head bcc617f141 merged onto `main` e4caa07950 (a clean merge), against `main` e4caa07950 alone, `ctest -R '^agc_(driver_bda|bda|driver_resident_heap_mirror|driver_pipeline_journal|pipeline_journal|host_import_sparse|shader_memory)'`. `main`: 19 of 19 run pass, 3 skip. This PR: 24 of 24 run pass, 3 skip, including the five `agc_driver_bda_store_heap_mirror*` tests `main` doesn't have. The same three skip on both sides: `agc_driver_bda_reads_shadowed_results` and `_per_build` (the device reports watched host memory written when it imports or reads it) and `agc_host_import_sparse` (udmabuf's `size_limit_mb` is above 1024). No `VUID-` line on either side, and every device test selected the RTX 4090. - **a96efaa504, a merge of `main` 8bb7635fe0** ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43904439175), [every `agc` test](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43904141090)), which brings atinseau's #18842 (64-bit image and buffer atomics emulated on devices without them). - **The conflicts:** three, all where #18842 and this PR each add specialization constants that a compute pipeline gets at dispatch rather than at build: - `core/shader/recompiler/PipelineSpecialization.hpp`: #18842 adds `IsAtomicLockTable` (the two words of its lock table's address, ids 8244 and 8245) where this PR adds `IsDispatchSupplied` (the workgroup offsets and `StorePages`). The merge keeps both functions. - `core/shader/recompiler/Recompiler.cpp`: both change the condition that leaves such a constant out of a module's build-time specialization. The merge leaves out both sets: `!PipelineSpecialization::IsDispatchSupplied(id) && !PipelineSpecialization::IsAtomicLockTable(id)`. - `VulkanDevice.cpp`, `specializedComputePipeline`: #18842's `PipelineSpecialization` constructor takes the lock table's address. The merge keeps this PR's version of the function (its four-word key with `storePages`, and the `replaced` list with `StorePages`) and builds it as #18842 does: `PipelineSpecialization(shader, context.atomicLockTable, replaced)`. - **Diff:** this PR's changed lines are the same in 29 of its 31 files, and its diff over `main` stays +1,996 −77. In `Recompiler.cpp` and `VulkanDevice.cpp`, its one changed line in each now carries #18842's addition, so its patch-id changed. - **×10:** the set of the bcc617f141 run, with #18842's `agc_driver_buffer_atomics`, `_float`, `_inc_dec64`, `_or_swap64` and `agc_driver_image_atomics64`, and `agc_placeholder_images`, whose tests #18842 changes. Linux: 51 run, 50 pass, 1 skip (`agc_host_import_sparse`), 0 fail; this PR's five `agc_driver_bda_store_heap_mirror*` tests and #18842's five pass 10 of 10. Windows: 63 run, 23 pass, 40 skip (no Vulkan device), 0 fail. - **The suites:** libc and libkernel run 391 and 391 tests on Linux and 422 and 418 on Windows, with 0 failed; `guest_multibyte_locale` passes again on both. They ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes only `precise_wait`'s median bounds on GitHub's hosted runners. - **Every `agc` test, once:** Linux: 1,876 run, 1,744 pass, 123 skip, 9 fail. Windows: 1,918 run, 559 pass, 1,359 skip, 0 fail. The libc and libkernel suites ran with 0 failed on both. - Seven also fail in `main`'s own Linux job at dcf3d15978 ([job](https://github.com/boykopovar/AnyPS5/actions/runs/43834891663/job/133202991353)): `agc_hook_clear_access`, `agc_hook_clear_access_off`, `agc_driver_recorder`, and the `agc_driver_runtime_buffer_spans_x2_spans`, `_x3_spans`, `_x4_spans` and `_x4_reference` timeouts. - The eighth, `agc_driver_runtime_buffer_spans_x3_reference`, passed in that job in 27.60 s, against its 30 s limit, and timed out at 30.06 s on `main` 0694c4cbd6 on GitHub's Linux runner (AMD EPYC 7763; [run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43853110628), with only #19899's Windows test fix on top). - The ninth, `agc_driver_image_table_packed_guards`, fails the same way in `main`'s own Linux job at e249fc47b5 ([job](https://github.com/boykopovar/AnyPS5/actions/runs/43816702928/job/133145283420)): three identical "stage 4 pc 0x68" records, then "unrecoverable packed table format was not poisoned". fernandomcrsilva's #21255 changes that test. - **`main` 8bb7635fe0 alone on GitHub's Linux runner** (Intel Xeon 6975P-C; [run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/43927236867)): 42 tests, the `agc_driver_runtime_buffer*` and `agc_driver_image_table*` tests with the hook pair and `agc_driver_recorder`, each run up to 3 times and stopped at its first failure. Seven fail the same way in their first run: `agc_driver_image_table_packed_guards`, `agc_hook_clear_access`, `agc_hook_clear_access_off`, `agc_driver_recorder`, and the `_x2_spans`, `_x3_spans` and `_x4_spans` timeouts. `_x3_reference` and `_x4_reference` pass 3 of 3 there: 21.44 and 20.80 s in their first run, beside the three `_spans` tests timing out, and 1.5 to 2.0 s in the next two. The `agc` run above had 1,876 tests in parallel. That run's libkernel suite also hit the `guest_thermal_sensors` timeout of that CPU, and its Windows build stops at `main`'s "'setenv' was not declared" error, since its tree didn't have #19899's test fix. - **The Windows tree** again had #19899's `_putenv_s` test fix on top; it isn't on this branch. - **A GPU run on a96efaa504:** @nydal91's Marvel's Wolverine (PPSA03671) A/B on an AMD Radeon RX 6950 XT (below). - **Marvel's Wolverine (PPSA03671 v01.001.005), by @nydal91, at a96efaa504** ([comment](https://github.com/boykopovar/AnyPS5/pull/12840#issuecomment-7005225766)): Linux (PikaOS 4, kernel 7.3.3), AMD Radeon RX 6950 XT (RADV, Mesa 26.3.0). An A/B on `main` f15df3256c with the prerequisites they carry, 300 s runs at `APS5_HOST_IMPORT_MIB=5000`: - **Without this PR:** 266 `deferred write-back failed: BDA access failed ... read-only in the BDA table` refusals, 4-byte compute stores into a 1.1 GiB unaligned descriptor view of a 2.5 GiB registered heap, then `VK_ERROR_DEVICE_LOST` at `vkQueueSubmit`. - **With this PR** (a96efaa504 merged with f15df3256c): 0 refusals, 0 deferred write-back failures and 0 store-page exhaustion faults; 656 frames presented and a clean exit, with the intro rendering through the subway and street scenes. - **The store-page pool:** the intro's wide stores (that 1.1 GiB view, and a 248 MiB descriptor region written back about 110 times) didn't exhaust the default pool. - **2687eec5fd, a merge of `main` 2b31f86019** ([×10](https://github.com/EagleBearerYS/AnyPS5/actions/runs/44498648039), [every `agc` test](https://github.com/EagleBearerYS/AnyPS5/actions/runs/44498830550)), which brings ashwin280802's #17796 (storage-image results published into resident heap mirrors), merged first, as planned. - **The conflicts:** two, each resolved by keeping both sides: - `GuestBufferMemory.cpp`, `UploadFinish`: #17796 adds `publishIntoMirrors()` where this PR adds `addAddressStoreSpans()`, both before `takeHeapReferences()`. The merge calls `addAddressStoreSpans()` first, as planned in the merge-order note, so a writable mirror that a draw may store into through an address takes #17796's `Written` fallback. - `ShaderResources.cpp`: relativespace2K's #19131 adds a `const DrawBindings* bindings` parameter to `MarkGpuWrites`, which follows this PR's `StorePages()`. The merge keeps `StorePages()` and #19131's signature. - **Diff:** this PR's changed lines are the same in all 31 files, and its diff over `main` stays +1,996 −77. Its patch-id changed, since the lines next to two of its additions are now #17796's and #19131's. - **×10:** the set of the a96efaa504 run, with #17796's `agc_driver_resident_heap_mirror` and `agc_driver_resident_heap_mirror_no_publish`. Linux: 53 run, 52 pass, 1 skip (`agc_host_import_sparse`), 0 fail. Windows: 65 run, 23 pass, 42 skip (no Vulkan device), 0 fail. - **The suites:** libc and libkernel run 410 and 411 tests on Linux and 439 and 432 on Windows, with 0 failed apart from libkernel's `guest_thermal_sensors` on Linux, which reached its 20 s timeout on one of GitHub's Intel Xeon 6975P-C runners, as in every run I have on those runners. They ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes only `precise_wait`'s median bounds on GitHub's hosted runners. - **Every `agc` test, once:** Linux (AMD EPYC 7763): 1,963 run, 1,827 pass, 126 skip, 10 fail. Windows: 2,005 run, 568 pass, 1,437 skip, 0 fail. The libc and libkernel suites ran with 0 failed on both. - Five also fail on `main` 2b31f86019 alone in the same harness, on an Intel Xeon 6975P-C runner ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/44520596587)): `agc_driver_image_gather_lod`, `agc_driver_image_table_packed_guards`, and the `agc_driver_runtime_buffer_spans_x2_spans`, `_x3_spans` and `_x4_spans` timeouts. - The other five are timeouts: `agc_driver_fault_check_dedup` and `agc_driver_oracle_runner` at 120 s, and `agc_driver_image_table`, `agc_driver_runtime_buffer_spans_x3_reference` and `_x4_reference` at 30 s. That run's EPYC 7763 runner took 1,016 s for the Linux pass, against 601 s for `main`'s pass on the Xeon runner. On a Xeon 6975P-C runner, this head runs them 3 times each with the `agc_driver_runtime_buffer_spans` family and this PR's heap mirror tests ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/44560638533)), and all five pass every time. Their first, cold runs take 75.2, 42.4, 21.3, 21.2 and 20.6 s, against 72.5, 33.8, 17.6, 17.3 and 28.6 s in `main`'s full pass. The `_spans` timeouts there are `main`'s three. - **The Windows tree** again had #19899's `_putenv_s` test fix on top; it isn't on this branch. ### Overlaps - **#8874 (JJenkx, heap mirror reference buffers):** merged first, as planned, and the merge of `main` 88e804b0a7 keeps both (see Tested). This PR no longer takes whole-span references for address stores, so #8874's pool serves only the declared writes' references. - **#8963 (shared BDA fault buffers):** merged first, as planned. The merge of `main` 4f41f4c375 gives a build that stores through addresses a private slot in its arena for the store-page words (see Tested). - **#12827 (JJenkx, a resident heap mirror's write-back from its readback buffer):** a conflict in `GuestBufferMemory.cpp`'s resident write-back. #12827 stores from the readback buffer without copying it, and this PR copies each written piece's readback into a vector, so on rebase it takes a span over the piece's slice instead. Merge order: #12827 first, this one second ([note](https://github.com/boykopovar/AnyPS5/pull/12827#issuecomment-6596109639)). - **#15296 (Prophet069, resident heap mirrors without host copies):** a design conflict in `GuestBufferMemory.hpp` and `.cpp`. #15296 removes the resident host copies (`ResidentBuffer::Read`, `Store` and `Block`), which this PR's resident write-back compares the declared writes and the gathered store pages with, and takes resident references from device copies (`RecordReference`). Copy-backed mirrors keep this PR's device reference copies. Merge order: #15296 first (it lands after #15295 and #12827), this one second, rebased off the host copies ([note](https://github.com/boykopovar/AnyPS5/pull/15296#issuecomment-6596109204)). - **#15295 (Prophet069, heap mirror slabs within device memory):** it merges with this PR. Its one conflict, in `Context.hpp`, is with `main`, and this PR doesn't change that file. sktharunbalaji13-cmd ran the two together on Ghost of Tsushima Director's Cut (see Tested). - **#6185 and #6186** (`WriteBack` keeping the CPU's bytes): #6185 has merged, and the merge of `main` 4f41f4c375 composes its `ChangedStore` with the store-mask write-back (see Tested). #6186, which also conflicts with `main`, conflicts with this branch only in `tests/Recorder.cpp` and `tests/cmake/agc_driver_recorder_tests.cmake`. - **#10442:** a conflict in `ShaderResources.cpp`, besides `CMakeLists.txt` and `Draw.cpp`. - **#12662 and #12980** have merged. The merge of `main` 5cb015caaa brings them without a conflict. - **#13858** has merged. The merge of `main` b11c7bf84f composes its per-use fault records with this PR's store pages (see Tested). - **#15423 (dantdmdarealguy, the journal's module frame check)** has merged. Both PRs added an `if(BUILD_TESTING)` block at the end of `tests/cmake/agc_driver_pipeline_journal_tests.cmake`, and the merge of `main` 090f57166a puts this PR's `TIMEOUT 240` line, which covers this PR's own cold compile, into #15423's block (see Tested). - **#15169 (liskeee, pipeline binaries)** merged, and oneandonlydean's #17982 reverted it on 11-10, since `main` crashed at boot in `PipelineBinaryStore::queryKey`. The merge of `main` 47adcad89a drops its `binaryLayoutKey` and keeps this PR's `storePages` (see Tested). If #15169 comes back, the two are again neighbouring members of `ComputePipelineObjects`, and keeping both resolves it. - **#17796 (ashwin280802, storage-image results published into resident heap mirrors):** merged first, as planned ([note](https://github.com/boykopovar/AnyPS5/pull/17796#issuecomment-6749366051)). Both add a call to `GuestBufferMemory.cpp`'s `UploadFinish` before `takeHeapReferences()`. The merge of `main` 2b31f86019 calls this PR's `addAddressStoreSpans()` before #17796's `publishIntoMirrors()`, so a writable mirror that a draw may store into through an address takes #17796's `Written` fallback, and its ×10 runs #17796's `agc_driver_resident_heap_mirror` and `_no_publish` with this PR's tests (see Tested). - **#17850 (adam25136, waiting for address-based writers before reading indirect draw records)** has merged, first, as planned. The merge of `main` 11992f9695 keeps #17850's rewritten debt entry with this PR's two after it, and runs #17850's `agc_driver_indirect_draw_pending_producer` tests with this PR's store pages (see Tested). - **#16752 (chitters2004, tracked Vulkan command state)** has merged. Its tracker refuses a raw `vkCmdBindPipeline`, so the merge of `main` 884694cf85 binds this PR's three compute pipelines through its `context.BindComputePipeline` (see Tested). - **#20870 (Ketz7, a BDA fault recorded with one atomic claim):** merged first, as planned. The merge of `main` 0173f20a5f keeps its `report.claim == 0` check with this PR's `pagesOverflowed` `Require` after it, and this PR's store-page words move with its 40-byte fault record (see Tested). - **#18842 (atinseau, 64-bit atomics emulated on devices without them)** has merged. Both PRs add specialization constants supplied at dispatch, and the merge of `main` 8bb7635fe0 keeps both: a module's build-time specialization leaves out this PR's and #18842's, and this PR's `StorePages` pipeline variant gets #18842's lock table address (see Tested). - **#20519 and #22424 (slopezjur, the bindless image heap and, on it, layout-only pointer tables) and #22359 (Remi-Bon, split table calls):** text conflicts only, each resolved by keeping both sides. Each appends to `BdaAbi.hpp`'s `FaultReason` after `WindowLaneSpill`: this PR `StorePages`, #20519 and #22424 `BindlessMiss` and `BindlessRefused`, and #22359 `SplitState`. Whichever lands second takes the next numbers, and every use names the reason, not its number. `BdaResources.cpp` has an adjacent `#include` line (#20519 and #22424) and adjacent fault messages (#22359). In `VulkanDevice.cpp`, #22359's split-state block goes before this PR's store-page bind. No merge order: whichever lands second resolves the conflict (`git merge-tree` on `main` `1adc0e2f4b`). - **#22692 (Logan1h, cached SPIR-V stored compressed with zstd):** a conflict in `VulkanDevice.cpp`'s compute pipeline creation. #22692 creates each compute module from a `SharedSpirv::Words()` lease, and this PR's `specializedComputePipeline` (`splitComputePipeline` on `main`) keys its pipelines by the store-page flag as well as the workgroup offsets. The merge keeps this PR's four-word key and `replaced` constants, with `StorePages` when the flag is set, and creates the module from #22692's lease. In `createComputePipeline` both add `const auto words = shader.spirv.Words();`, so the merge drops this PR's line, and its `StorePages` scan reads #22692's lease, declared before `objects->module`. Merge order: #22692 first, this one second ([note](https://github.com/boykopovar/AnyPS5/pull/22692#issuecomment-6973962896)). That's one text conflict on `main` `b1a1e61f91` (`git merge-tree`). - **#22944 (Ketz7, BDA stores recorded in per-range granule bits and a page map):** a conflict in the BDA written-page record. #22944 replaces the `note_bda_write` hash table with per-range granule bits and a page map. This PR's store-page words follow `SrtGuardWord`, and its `StorePageGather.comp` finds the pages BDA stores hit from the table's count, slot and list words, which `Recorder.cpp` passes to it. The merge puts the store-page words after #22944's `SrtGuardWord` and has the gather read #22944's written-page record. In `SpirvEmitterState.hpp` it drops `bdaNoteWriteFunction` with #22944 and keeps this PR's two store-page members. Merge order: #22944 first, this one second ([note](https://github.com/boykopovar/AnyPS5/pull/22944#issuecomment-6983550226)). That's six conflict blocks in five files on `main` `8dbb3bf68d` (`git merge-tree`). `Recorder.cpp` merges without one but still passes the table's words. - **#23596 (nydal91, GPU-readback staging for writable-copy write-back):** a conflict in one hunk of `GuestBufferMemory.cpp`'s `RecordCopyBacks`, where both change the loop that records the heap-mirror readbacks. Proposed order: this PR first, and #23596 then resolves the conflict keeping both sides (see the note on #23596). The merged loop is #23596's, with its `heapMirror` and `writableCopy` branches, iterating this PR's `declaredReadbacks`, and with this PR's `AddressStoreTallies().readbackBytes` line in the `heapMirror` branch. Whichever goes second runs this PR's `agc_driver_bda_store_heap_mirror*` tests and #23596's copy write-back tests on the merged tree. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [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: #12827, #15296, #22692, #22944 (merge order only); #8874, #8963, #17796, #17850 and #20870 have merged, and the merges of `main` 88e804b0a7, 4f41f4c375, 11992f9695, 0173f20a5f, 8bb7635fe0 and 2b31f86019 keep both - [x] Fixes: none - [x] Related: #5166 - [x] Unblocks: none - [x] GPUs tested: lavapipe (llvmpipe, LLVM 20.1.2); NVIDIA GeForce RTX 4060 Laptop GPU (Ghost of Tsushima Director's Cut, by @sktharunbalaji13-cmd); NVIDIA GeForce RTX 4070 Ti (Ghost of Tsushima Director's Cut, by @milescoviello, twice); AMD Radeon RX 9070 XT, RDNA 4 (tests, by @bunbeans2-arch); NVIDIA RTX 2000 Ada Generation (tests, TechLevelZero's NVIDIA GPU test); AMD Radeon RX 6300, RADV (tests, TechLevelZero's AMD GPU test); NVIDIA GeForce RTX 3070 Laptop GPU (Resident Evil Village pair); NVIDIA GeForce RTX 4090 (driver 620.70.06, Arch Linux, with the validation layer), by @domx4q; AMD Radeon RX 6950 XT, RADV (Marvel's Wolverine (PPSA03671), by @nydal91) - [x] AI-assisted: yes
jotitadev commented 2026-10-31 14:00:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-31T14:00:24Z.

Review: COMMENTED


Linux run of head 582e856556. agc_driver_pipeline_journal still fails here on both devices, in a different case from the one 582e856556 fixed: EvictionWatermarkTests ends with three consecutive records after a rewrite triggered another rewrite. It misses the 1 MiB cap by 92 bytes.

Setup: Ubuntu 26.04, GCC 15.2, Release with the default ANYPS5_ENABLE_SPIRV_TOOLS=OFF. RTX 3070 with NVIDIA 595.99.02 and lavapipe (Mesa 26.0.3), one at a time via VK_DRIVER_FILES. The head is merged --no-ff onto main 809c7fa2df with no conflicts. main has no AGC or shader changes since the 828ac0b2ae the NVIDIA CI used. ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, ctest -j1.

Results

  • This head: fails every run, with the same message every time. That's 6/6 on the 3070 (VVL 1.4.341, VVL 1.3.275 and no layer) and 4/4 on lavapipe (VVL 1.4.341 and in the suite). The other 128 tests in the binaries this PR's tests build pass on both devices. On lavapipe, the rest of ^agc passes too: 1136/1137.
  • main on the same box: passes, 3/3 on the 3070.
  • Not from the set-aside: with ReplayRacesDispatchTests skipped (local change), it fails the same way, 3/3 on the 3070 and 1/1 on lavapipe.

Size measurements (file size printed before and after the watermark's three records, local only; 3070, no layer)

journal at start after the 3 records 3 records margin to 1,048,576
main 749,552 1,028,840 279,288 19,736 left
this head 754,512 over the cap, so it rewrites ~294,150 about 92 bytes over
  • The start differs by 4,960 bytes. That's one larger module kept from EvictionTests.
  • The three records are each about 4,956 bytes larger. That matches your 26,924 → 31,880 per module record.
  • So this check only had about 19.7 KB of slack on main, and the store-page lookups use all of it.

Why CI passes: probably the build option. build.yml configures with -DANYPS5_ENABLE_SPIRV_TOOLS=ON, the NVIDIA CI build does too, and it didn't select this test anyway. With the SPIR-V optimized, the modules are smaller and the watermark records likely fit. I haven't rebuilt with ON to confirm. The default build is OFF, and there it fails.

Possible fixes: give EvictionWatermarkTests its own empty journal, as 582e856556 does for the race, or size its three records from the rewrite target instead of fixed 16 Ki-word payloads. Either way it would stop depending on how large the fixture's SPIR-V is.

GPUs tested: NVIDIA GeForce RTX 3070, 595.99.02, Ubuntu 26.04; Mesa 26.0.3 lavapipe, Ubuntu 26.04

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

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5723063502 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12840#pullrequestreview-5723063502). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-31T14:00:24Z. **Review:** COMMENTED --- Linux run of head `582e856556`. `agc_driver_pipeline_journal` still fails here on both devices, in a different case from the one 582e856556 fixed: `EvictionWatermarkTests` ends with `three consecutive records after a rewrite triggered another rewrite`. It misses the 1 MiB cap by 92 bytes. Setup: Ubuntu 26.04, GCC 15.2, Release with the default `ANYPS5_ENABLE_SPIRV_TOOLS=OFF`. RTX 3070 with NVIDIA 595.99.02 and lavapipe (Mesa 26.0.3), one at a time via `VK_DRIVER_FILES`. The head is merged `--no-ff` onto `main` `809c7fa2df` with no conflicts. `main` has no AGC or shader changes since the `828ac0b2ae` the NVIDIA CI used. `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1`, `ctest -j1`. **Results** - **This head:** fails every run, with the same message every time. That's 6/6 on the 3070 (VVL 1.4.341, VVL 1.3.275 and no layer) and 4/4 on lavapipe (VVL 1.4.341 and in the suite). The other 128 tests in the binaries this PR's tests build pass on both devices. On lavapipe, the rest of `^agc` passes too: 1136/1137. - **`main` on the same box:** passes, 3/3 on the 3070. - **Not from the set-aside:** with `ReplayRacesDispatchTests` skipped (local change), it fails the same way, 3/3 on the 3070 and 1/1 on lavapipe. **Size measurements** (file size printed before and after the watermark's three records, local only; 3070, no layer) | | journal at start | after the 3 records | 3 records | margin to 1,048,576 | |---|---|---|---|---| | `main` | 749,552 | 1,028,840 | 279,288 | 19,736 left | | this head | 754,512 | over the cap, so it rewrites | ~294,150 | about 92 bytes over | - **The start differs by 4,960 bytes.** That's one larger module kept from `EvictionTests`. - **The three records are each about 4,956 bytes larger.** That matches your 26,924 → 31,880 per module record. - **So this check only had about 19.7 KB of slack on `main`,** and the store-page lookups use all of it. **Why CI passes:** probably the build option. `build.yml` configures with `-DANYPS5_ENABLE_SPIRV_TOOLS=ON`, the NVIDIA CI build does too, and it didn't select this test anyway. With the SPIR-V optimized, the modules are smaller and the watermark records likely fit. I haven't rebuilt with `ON` to confirm. The default build is `OFF`, and there it fails. **Possible fixes:** give `EvictionWatermarkTests` its own empty journal, as 582e856556 does for the race, or size its three records from the rewrite target instead of fixed 16 Ki-word payloads. Either way it would stop depending on how large the fixture's SPIR-V is. GPUs tested: NVIDIA GeForce RTX 3070, 595.99.02, Ubuntu 26.04; Mesa 26.0.3 lavapipe, Ubuntu 26.04 Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
CnRJay commented 2026-11-01 19:51:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:51:00Z.

Review: COMMENTED


The evidence is thorough, and the refusal being removed is the real blocker in #5166. One design point.

The store-page pool is a fixed limit that throws, and its default looks sized to one title. APS5_BDA_STORE_PAGES defaults to 1,024 4 KiB pages (about 4.6 MiB), found by a 16-probe hash, and the body states the default "starts refusing consecutive pages at about 988". A dispatch needing more distinct pages faults and none of its stores reach guest memory. The mirror that triggered this is 0x8c600000 bytes (about 2.2 GiB). A FLAT-store compute pass that writes a large buffer densely (a clear, a scatter, a skinning output) can legitimately touch far more than 988 pages. Throwing is the right behaviour and the "Store page pool" debt entry records it, but the numbers do not say where the default comes from.

Please state how many distinct store pages the PPSA02225 dispatch uses in the Tsushima runs (the [bda-store-spans] line), and whether the pool could be sized from the build's declared mirror span instead of a constant, so a legal shader does not hit a limit that raising an env var is the only way past.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729927416 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12840#pullrequestreview-5729927416). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-11-01T19:51:00Z. **Review:** COMMENTED --- The evidence is thorough, and the refusal being removed is the real blocker in #5166. One design point. **The store-page pool is a fixed limit that throws, and its default looks sized to one title.** `APS5_BDA_STORE_PAGES` defaults to 1,024 4 KiB pages (about 4.6 MiB), found by a 16-probe hash, and the body states the default "starts refusing consecutive pages at about 988". A dispatch needing more distinct pages faults and none of its stores reach guest memory. The mirror that triggered this is 0x8c600000 bytes (about 2.2 GiB). A FLAT-store compute pass that writes a large buffer densely (a clear, a scatter, a skinning output) can legitimately touch far more than 988 pages. Throwing is the right behaviour and the "Store page pool" debt entry records it, but the numbers do not say where the default comes from. Please state how many distinct store pages the PPSA02225 dispatch uses in the Tsushima runs (the `[bda-store-spans]` line), and whether the pool could be sized from the build's declared mirror span instead of a constant, so a legal shader does not hit a limit that raising an env var is the only way past.
MarcZX10 commented 2026-11-17 16:28:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T16:28:53Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

  • Head a96efaa504feb785cb81ab375577dcdb1e30620a, base main. Merged-preview check: not run.
  • Read the description (lines 1–218 of 402), the commit list, the manifest and all of diff.patch (2,956 lines, 31 changed files).
  • Read the house rules from the ruling file: "Readable reviews", "Standard PR response format" and "Accuracy and evidence".
  • Repository lookups through the reader, at head:
repo_read.py search "TakeFaultSlot" core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp
repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp 183 200
repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp 326 362
repo_read.py search "MarkGpuWrites" core/libs/prx/libSceAgcDriver
  • No build and no tests were run by me. The test results in the description are the author's.

Results

Check Result Note
Diff, all hunks passed 31 files read as hunks
Full text of changed files not run none read in full
Memory constructor at head passed same fault-slot setup as the base constructor
MarkGpuWrites call site passed called at VulkanDevice.cpp:6136
Build and unit tests not run author-reported only

Findings

Blocking

None.

Non-blocking

  • core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp, checkFault, loop-guard branch (diff.patch hunk @@ -492,6 +581,7 @@): attachStorePages() runs after collectStorePages() has already moved pages to the recorder pool. attachStorePages() returns early when pages is null, so the zeroed fault record gets no store-page table. If that record is reused after a loop-guard trip, stores into unbound blocks would take the fault path. I did not confirm whether a tripped record is ever reused.

Not verified

  • Full text of the four files too large for the review folder: Execution/src/VulkanDevice.cpp, Graphics/src/GuestBufferMemory.cpp, Graphics/src/ShaderResources.cpp and tests/Recorder.cpp. Only their diff hunks were read.
  • The description after line 218, including the cost tables, the Village and Ghost of Tsushima evidence, and the linked runs. Those are author-reported.
  • Whether the store-page gather is recorded after the dispatch it reads. MarkGpuWrites is called at VulkanDevice.cpp:6136; I did not read the dispatch path above it in full.
  • Reads that fall outside one 4 KiB page of an unbound block. The lookup in SpirvBdaLookup.cpp faults with the "store pages free" message when the access does not fit; whether a read can reach that path is not confirmed.
  • The GLSL and SPIR-V emitted by StorePageGather.comp and SpirvBdaLookup.cpp: not compiled and not validated here.
  • The set_tests_properties(agc_driver_pipeline_journal ... TIMEOUT 240) registration in CMake: not checked against where that test is defined.

To get this to a good state

Nothing is required.

Optional:

  • Confirm whether a record that trips the loop guard can be reused. If it can, reattach the store-page table or drop the reuse.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5942391254 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12840#pullrequestreview-5942391254). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T16:28:53Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. ## What I ran - Head `a96efaa504feb785cb81ab375577dcdb1e30620a`, base `main`. Merged-preview check: not run. - Read the description (lines 1–218 of 402), the commit list, the manifest and all of `diff.patch` (2,956 lines, 31 changed files). - Read the house rules from the ruling file: "Readable reviews", "Standard PR response format" and "Accuracy and evidence". - Repository lookups through the reader, at head: ``` repo_read.py search "TakeFaultSlot" core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp 183 200 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp 326 362 repo_read.py search "MarkGpuWrites" core/libs/prx/libSceAgcDriver ``` - No build and no tests were run by me. The test results in the description are the author's. ## Results | Check | Result | Note | |---|---|---| | Diff, all hunks | passed | 31 files read as hunks | | Full text of changed files | not run | none read in full | | Memory constructor at head | passed | same fault-slot setup as the base constructor | | `MarkGpuWrites` call site | passed | called at `VulkanDevice.cpp:6136` | | Build and unit tests | not run | author-reported only | ## Findings **Blocking** None. **Non-blocking** - `core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp`, `checkFault`, loop-guard branch (`diff.patch` hunk `@@ -492,6 +581,7 @@`): `attachStorePages()` runs after `collectStorePages()` has already moved `pages` to the recorder pool. `attachStorePages()` returns early when `pages` is null, so the zeroed fault record gets no store-page table. If that record is reused after a loop-guard trip, stores into unbound blocks would take the fault path. I did not confirm whether a tripped record is ever reused. ## Not verified - Full text of the four files too large for the review folder: `Execution/src/VulkanDevice.cpp`, `Graphics/src/GuestBufferMemory.cpp`, `Graphics/src/ShaderResources.cpp` and `tests/Recorder.cpp`. Only their diff hunks were read. - The description after line 218, including the cost tables, the Village and Ghost of Tsushima evidence, and the linked runs. Those are author-reported. - Whether the store-page gather is recorded after the dispatch it reads. `MarkGpuWrites` is called at `VulkanDevice.cpp:6136`; I did not read the dispatch path above it in full. - Reads that fall outside one 4 KiB page of an unbound block. The lookup in `SpirvBdaLookup.cpp` faults with the "store pages free" message when the access does not fit; whether a read can reach that path is not confirmed. - The GLSL and SPIR-V emitted by `StorePageGather.comp` and `SpirvBdaLookup.cpp`: not compiled and not validated here. - The `set_tests_properties(agc_driver_pipeline_journal ... TIMEOUT 240)` registration in CMake: not checked against where that test is defined. ## To get this to a good state Nothing is required. Optional: - Confirm whether a record that trips the loop guard can be reused. If it can, reattach the store-page table or drop the reuse.
MarcZX10 commented 2026-11-20 06:55:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T06:55:53Z.

Review: DISMISSED


Reviewed — changes requested

Changes are required before merge: add parameters.base when the gather shader reconstructs a page address, so it can match absolute target spans and gather the resident page contents.

What I ran

Reviewed head 2687eec5fd8bd19a74e40ac7a10981c18942d338 using the prepared review bundle and repo_read.py. No tests or builds were run.

Results

Check Result Note
Diff review failed Resident page address omits its base
Tests and build not run No independent execution

Findings

Blocking

  • In StorePageGather.comp, the gathered page address is reconstructed from a relative chunk offset, but target span bounds are absolute guest addresses. The address therefore fails the target-span overlap check, so a written resident page is skipped and later write-back can fail because the page was not gathered. Add parameters.base to the reconstructed address. Evidence: core/libs/prx/libSceAgcDriver/Graphics/shaders/StorePageGather.comp:444.

Non-blocking

None.

Not verified

The full text for core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp was excluded as too large for the review folder; the relevant diff hunk was inspected. No tests, builds, or runtime behavior were independently verified. The description, commits, manifest, diff, and included changed-file texts were read; the manifest also lists excluded files, including VulkanDevice.cpp.

To get this to a good state

Fix the absolute page address reconstruction, then rerun the focused resident heap mirror gather and write-back tests and review the new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5988691838 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12840#pullrequestreview-5988691838). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T06:55:53Z. **Review:** DISMISSED --- # Reviewed — changes requested Changes are required before merge: add `parameters.base` when the gather shader reconstructs a page address, so it can match absolute target spans and gather the resident page contents. ## What I ran Reviewed head `2687eec5fd8bd19a74e40ac7a10981c18942d338` using the prepared review bundle and `repo_read.py`. No tests or builds were run. ## Results | Check | Result | Note | |---|---|---| | Diff review | failed | Resident page address omits its base | | Tests and build | not run | No independent execution | ## Findings ### Blocking - In `StorePageGather.comp`, the gathered page address is reconstructed from a relative chunk offset, but target span bounds are absolute guest addresses. The address therefore fails the target-span overlap check, so a written resident page is skipped and later write-back can fail because the page was not gathered. Add `parameters.base` to the reconstructed address. Evidence: `core/libs/prx/libSceAgcDriver/Graphics/shaders/StorePageGather.comp:444`. ### Non-blocking None. ## Not verified The full text for `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` was excluded as too large for the review folder; the relevant diff hunk was inspected. No tests, builds, or runtime behavior were independently verified. The description, commits, manifest, diff, and included changed-file texts were read; the manifest also lists excluded files, including `VulkanDevice.cpp`. ## To get this to a good state Fix the absolute page address reconstruction, then rerun the focused resident heap mirror gather and write-back tests and review the new head.
MarcZX10 commented 2026-11-25 18:26:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T18:26:26Z.

Review: COMMENTED


Reviewed — comments

The review is incomplete because several changed files were not read and no checks were run; nothing is required, and the optional points below identify what remains unverified.

What I ran

Inspected the prepared bundle for head bf7e2772c517c34018afcf3da7fb891aa72aece9 using the review reader. No tests or build checks were run.

Results

Check Result Note
Bundle and diff inspection passed Goal and changed-file list reviewed
Build and tests not run No execution performed
Full changed-line review not run Only selected diff ranges inspected

Findings

Blocking

None identified in the inspected excerpts.

Non-blocking

  • Complete the changed-line review before relying on this assessment; the change spans address translation, GPU write-back, synchronization, and pipeline specialization.

Sources

  • Prepared change description, commit list, manifest, and selected ranges of diff.patch.

Not verified

The full text or all added lines were not read for the changed files. In particular, Execution/src/VulkanDevice.cpp, Graphics/src/GuestBufferMemory.cpp, Graphics/src/ShaderResources.cpp, and tests/Recorder.cpp were excluded from the prepared files/ bundle; other changed files were also not fully read. No source behavior beyond the inspected excerpts, build, or tests was verified. Author-reported checks in the description were not run by this review.

To get this to a good state

Nothing is required. Optional: complete the changed-line review and run the relevant checks before treating this review as a merge assessment.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6062860601 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12840#pullrequestreview-6062860601). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T18:26:26Z. **Review:** COMMENTED --- # Reviewed — comments The review is incomplete because several changed files were not read and no checks were run; nothing is required, and the optional points below identify what remains unverified. ## What I ran Inspected the prepared bundle for head `bf7e2772c517c34018afcf3da7fb891aa72aece9` using the review reader. No tests or build checks were run. ## Results | Check | Result | Note | |---|---|---| | Bundle and diff inspection | passed | Goal and changed-file list reviewed | | Build and tests | not run | No execution performed | | Full changed-line review | not run | Only selected diff ranges inspected | ## Findings ### Blocking None identified in the inspected excerpts. ### Non-blocking - Complete the changed-line review before relying on this assessment; the change spans address translation, GPU write-back, synchronization, and pipeline specialization. ## Sources - Prepared change description, commit list, manifest, and selected ranges of `diff.patch`. ## Not verified The full text or all added lines were not read for the changed files. In particular, `Execution/src/VulkanDevice.cpp`, `Graphics/src/GuestBufferMemory.cpp`, `Graphics/src/ShaderResources.cpp`, and `tests/Recorder.cpp` were excluded from the prepared `files/` bundle; other changed files were also not fully read. No source behavior beyond the inspected excerpts, build, or tests was verified. Author-reported checks in the description were not run by this review. ## To get this to a good state Nothing is required. Optional: complete the changed-line review and run the relevant checks before treating this review as a merge assessment.
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!12840
No description provided.