Repository navigation
fix(agc): write back BDA stores into writable heap mirrors - #12840
EagleBearerYS wants to merge 36 commits into
Conversation
A shader that stores through FLAT or GLOBAL addresses into a writable sparse heap mirror was refused as read-only in the BDA table. Granting Write in the table alone loses the stores: the span is not in the write-back set, so the bytes never reach guest memory and the next refresh of the mirror reverts them. Builds whose shaders store through addresses now add the served spans of writable heap mirrors to the write-back set before the heap references are taken, so the table marks them Write and WriteBack diffs them against the reference, keeping CPU stores made during the dispatch. Sparse mirrors add only their committed runs. Copies, read-only mirrors and ranges past the served end keep the refusal. Co-authored-by: Tharun Balaji K <239791575+sktharunbalaji13-cmd@users.noreply.github.com>
|
@EagleBearerYS The mechanism reads correctly for the case in your report: the spans of the writable heap mirrors are added to the write set before
|
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
… back WriteBack noted every merged write range of a mirror as written back before the diff. With the served spans of writable heap mirrors in the write set, a dispatch that stores through addresses noted the whole heap, up to 36 MiB, although only the changed bytes were stored. A completion label anywhere in that heap was then counted pending, its completion store forced, and the write-back counted as one over a tracked label. For heap mirror ranges of an address-storing build, declared write ranges are still noted whole, and the rest is noted only for the runs WriteChanged stored. The recorder joins those runs across gaps that hold no tracked label, so a scattered store cannot overflow the write-back ring.
An address-storing build adds the served spans of its writable heap mirrors to the write set, and its write-back compared each whole span against the reference: 36 MiB per dispatch for a 36 MiB heap, whatever the shader stored. Every BDA store and atomic already records the 4 KiB guest pages it wrote in the fault buffer's written-page table, after its Write lookup succeeded. BdaResources now keeps the ranges it reads from that table, and WriteBackBuffers hands them to the guest memory before the write-back. A heap mirror span then compares and stores only those pages, plus the declared write ranges inside it, which keep their whole compare. Resident mirrors copy and store only the same runs from their readback. Without a record, the whole span is compared as before.
A writable heap mirror's write-back reference was a CPU copy of the whole span at upload: 36 MiB copied on the dispatching thread for a 36 MiB heap, although the write-back now reads only the stored pages of it. When a recorder is active, the reference is now a GPU copy recorded into the batch after the resident flush and before the work: the resident buffer's readback for a resident mirror, a buffer copy for a copy-backed one, whose buffer gains TRANSFER_SRC. The write-back reads the stored pages of that copy once the batch completed. A build with no active recorder, or one inside a completion, keeps the CPU copy.
|
Regarding question 3 on real-world title telemetry: We tested PR #12840 on Ghost of Tsushima Director's Cut (PPSA02225) under Windows 11 on RTX 4060 Laptop hardware (8 GB physical VRAM, 7,188 MiB budget). Full telemetry details are posted in Issue #5166 comment 6498236130. Key observations:
|
|
@oneandonlydean thanks, all three were right to ask. The work is on fix/agc-bda-store-writable-mirror-review on our fork, and it comes into this PR once the last part below is done. 1. Labels in a heap span. Yes, a label can sit there. It reaches the GPU through a host import of its own bytes (
2. Two storing builds over one heap. The order rules it out.
3. Numbers, and first or together: together. sktharunbalaji13-cmd's run of 781dc45 on Ghost of Tsushima Director's Cut (PPSA02225) (I#5166) settles it:
So the block scoping goes into this PR before it's ready.
When that's in, I'll post the Ghost rerun, with its stop line and frame time. I'll also post a count from Resident Evil Village (PPSA01556) of how many of its address-storing builds hold writable heap mirrors; that run is queued. |
…r reading back the span
|
@oneandonlydean the last part from my reply is in. The head is now
|
|
@EagleBearerYS Here is the full empirical run of Ghost of Tsushima Director's Cut (PPSA02225, retail v02.024.000) on #12840's head 1. BDA Store Page Pool & Heap Mirror Verification
2. Frame Progression & Visual Telemetry
3. First Stop Line & Frame Time
As you predicted in #5166 (comment 6500086955), once the heap mirror BDA store path passes, the title immediately transitions to its depth readback / sampling pipeline (compute shader |
|
@sktharunbalaji13-cmd thanks, that's the run this PR was waiting for.
I've added your run to the description and marked the PR ready for review. |
|
@EagleBearerYS thanks for the rework: the answers to the three points of the first review are in the code.
Please keep the focused Linux cases, the honest Windows GPU skips and the budget, copy-backed, resident and overflow/refusal tests on the final composition after the agreed #8874 / #8963 merge order. |
✅ NVIDIA GPU test: passedPR head
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (2, not counted against this PR)Validated but not compared (2, not in the main baseline's validation pass)Validation IDs already present on main (4 IDs in 430 tests)Skipped (41)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
…store masks A store redirected into a store page for an unbound block of a resident heap mirror was written back by comparing the page with zeros, so only its non-zero bytes reached guest memory. A thread storing 0 over a byte the CPU made non-zero during the dispatch left the CPU's byte. The unbound pieces of a resident mirror's written ranges now carry the Masked flag as well as Spill, so the shader records which bytes each store wrote in the page's mask, and the write-back stores exactly those bytes, as it already did for copy-backed mirrors (one helper serves both paths). The spilled and compared counters keep their meaning. The heap mirror test stores a zero dword and a zero byte into a zero block while the CPU fills it with non-zero bytes: the stored bytes read 0 and the bytes beside them keep the CPU's value, on resident mirrors and, as a control, on copy-backed ones.
…l size A dispatch that stores through addresses into more distinct heap mirror pages than the store page pool holds is refused with the StorePages fault, and nothing pinned that. agc_driver_bda_store_heap_mirror_store_pages runs with APS5_BDA_STORE_PAGES=4, which the driver raises to its minimum of 64 slots. On resident and copy-backed mirrors, a dispatch whose 64 threads store into 64 distinct pages succeeds and its stores reach guest memory, and the same dispatch with one more page is refused with the "found none of the 64 store pages free (APS5_BDA_STORE_PAGES)" message.
… page pool agc_driver_bda_store_heap_mirror_store_pages_default runs with no APS5_BDA_STORE_PAGES, so the pool has its default 1,024 slots. On resident and copy-backed mirrors, one 1,024-thread dispatch stores into 1,025 distinct pages of a zero heap: each thread into its own page and all of them into one more. The use is refused with "found none of the 1024 store pages free (APS5_BDA_STORE_PAGES)" and none of its stores reaches guest memory. Exactly 1,024 pages are not asserted to fit: with 16 linear probes the table can refuse earlier.
boykopovar#17850 rewrote the "CPU reads behind an address-based build" debt entry next to this branch's two new entries; keeps main's rewritten entry and this branch's two entries after it.
Keeps both sides in BdaResources.cpp's checkFault with boykopovar#20870: its claim word in the empty-record Require, then this branch's store-page overflow Require.
|
Ghost of Tsushima (PPSA02225) A/B on Linux, current Setup:
Notes:
So on AI-assisted: yes |
|
@milescoviello thanks for the A/B, and for setting it up so the cold cache hits both arms alike. The |
|
NVIDIA Linux run with the Khronos validation layer of the BDA store write-back into writable heap mirrors, on the BDA, heap mirror, pipeline journal and shader memory tests the Tested section names. Setup: Arch Linux, kernel 7.3.4, GCC 16.2.1, Release. NVIDIA GeForce RTX 4090 (vendor
Every device test selected the RTX 4090 ( The five No new AI-assisted: yes (Claude Code) |
|
@domx4q thanks for the RTX 4090 pair with the validation layer, and for naming why the three shared tests skip. It's in the description under Tested, and in the GPUs tested line. |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
- Head
a96efaa504feb785cb81ab375577dcdb1e30620a, basemain. 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.patchhunk@@ -492,6 +581,7 @@):attachStorePages()runs aftercollectStorePages()has already movedpagesto the recorder pool.attachStorePages()returns early whenpagesis 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.cppandtests/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.
MarkGpuWritesis called atVulkanDevice.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.cppfaults 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.compandSpirvBdaLookup.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.
|
Thanks for the review at |
|
Independent second-title validation: Marvel's Wolverine (PPSA03671 v01.001.005), Linux (PikaOS 4, kernel 7.3.3), AMD RX 6950 XT (RADV Mesa 26.3.0), Intel Core Ultra 7 265KF, 16 GB RAM. A/B on the same base (
Wolverine's wide sequential stores (the 1.1 GiB view above, plus a 248 MiB descriptor region written back ~110x) did not exhaust the default store-page pool in this run, so the bounded-pool concern does not materialize for this title's intro. We had been carrying a local alternative for the same refusal class (fault-window / whole-mirror write grants, opt-in |
|
@nydal91 thank you for the Marvel's Wolverine (PPSA03671) A/B. It's in the Tested section now, with the RX 6950 XT under GPUs tested, and it's good to know the default store-page pool held through the intro's wide stores. Since then this PR has merged |
MarcZX10
left a comment
There was a problem hiding this comment.
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. Addparameters.baseto 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 thanks for the review. On the gathered page address (review): at this head
So I'd leave the reconstruction as it is. If you see a path where the written-page key is taken relative to a base, point me at it and I'll add it as a test. |
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):
On
mainb11c7bf the title still hits this refusal, 7 times per run, each withthe 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). Onmain133feb3, 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 onmain7c444b7 still refuses such a store, and the same probe on this PR's head stores it (see Tested).The refusal is deliberate. Granting
Writeto writable mirrors inGuestBufferMemory::addressRangealone would lose the stores silently:WriteBackstores only the build's declared write ranges, so a store elsewhere in the mirror never reaches guest memory.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:APS5_BDA_STORE_PAGESsets 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.StorePageGather.comp) and compared with the resident shadow, which equals the device bytes at upload.APS5_HEAP_MIRROR_MIBis never charged for a store.NoteWrittenBacknotes only the runs that were actually stored, so a completion label inside the span that no thread stores over isn't counted as overwritten.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.The commits:
bf54c5e942: note only the stored runs of address-store spans as written back. This answers question 1 of the review.99f1f37aed,91e4d82e7c: compare only the pages BDA stores hit, and take the reference on the GPU. The next commits supersede these for address stores.fbb103c45f: the shader side, which redirects stores into unbound heap mirror blocks to store pages.bbeb08e9f6: resident mirrors without binding, copying or reading back the span.7e7c81a2aa: copy-backed mirrors by per-byte store masks.425cd9d8b0: store page pools reused across address-based builds.6c6997ec33: unbound blocks written back by their store masks, so a stored zero isn't lost. This answers point 1 of the second review.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).1aa803e9d3: a merge ofmain.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.
APS5_HEAP_MIRROR_MIB=64, with 1 MiB bound and 0.4-1.4 ms of wait.agc_driver_flat_storetakes 73.4 s, against 75.7 s with no store-page code. Theruntime_formatted_storetests 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.[bda-store-spans]line) to the static menu +15 min.1 ranges (0.6 MiB, 0 writable, 0 heap 0.0 MiB), 294164 address-based builds served.6c6997ec33changes no shader code, so a pair on 425cd9d measures this head too.mainebb4075 + 425cd9d; A = the samemain. Both arms carry the same three local changes Village needs to boot on that base: a pad fix, fix(shader): load and store 16-bit data of converted packed images #11580 and fix(agc): keep buffer owners when a staged address space dissolves #10304.aps5-summary.jsonlthat 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.Driver.Packet.draw1,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.Driver.Packet.drawis 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.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):(APS5_HEAP_MIRROR_MIB), so a refusal can't pass quietly.LabelTests):[recorder]write-back-over-label counter stays 0;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: 425cd9d's code with only this test failsagc_driver_bda_store_heap_mirrorand_no_space_cacheon Linux (run 41047122594).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.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 425cd9d:
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, plusagc_driver_recorderandagc_recorder_command_buffer_release.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 9240925 (run 41039517488): the heap mirror tests show onlyVUID-VkDeviceCreateInfo-pNext-pNext, from device creation. TechLevelZero's NVIDIA run lists the same ID amongmain'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
main9f748f4, 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 425cd9d (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=1and the Khronos validation layer (the loader inserts it in every run). The head merged ontomainf7f03da, 3 runs per side:agc_driver_bda_store_heap_mirror,_budgetand_no_space_cachepass 3 of 3.agc_driver_bda_device,agc_driver_bda_reads_shadowed_results,_per_build,agc_driver_host_import_failure_handles,agc_driver_recorderand theagc_recorder_*tests pass 3 of 3, as onmain.VUID-line on either side.Checks:
check_conventions.pyandcheck_test_registration.pypass.-fsyntax-onlyis clean on the eight changed files that toolchain can parse.GuestBufferMemory.cppandRecorder.cppstop at the sameCpuTopology.hppheader gap asmain's copies.A probe on
mainand 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.main7c444b7 (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.Ghost of Tsushima Director's Cut (PPSA02225), by @milescoviello, at bcc617f on
main133feb3 (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.deferred write-back failed: BDA access failed,the store hitorread-only in the BDA table. On this route the store isn't refused onmain, so the pair can't show the fix.main, 1,112 with this PR.b11c7bf84fruns 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 themaincommit, 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 3fa9852 (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=1andAPS5_PROFILE_DRAW=1), with only the driver libraries swapped.read-only in the BDA tablefaultsmainb11c7bfthe store hit 0x1549750000+0x4eeb0000(instruction 0x1b4, 4 bytes, compute)mainthe 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 nodeferred write-back failed, no store-page refusal and nonot implementedstop. The title was still running at the end of the window.main.vkAllocateMemory of a heap mirror slabwith 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 fix(agc): keep heap mirror slabs within device memory #15295 added, a run didn't abort in 150 s, and the heap mirror budget was lowered 9 times instead. Whethermainalone reaches this in the same conditions wasn't measured.mainb11c7bf's relinker, the title aborts at about 1 s on Windows, becauseprospero/steamnetworkingsockets.prxstarts 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 425cd9d (comment): retail v02.024.000, NVIDIA GeForce RTX 4060 Laptop GPU (8 GB, a 7,188 MiB budget), 16 GB of RAM.
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.AGC graphics: native multisample stencil or depth format import is not implemented. That's the multisampled depth import fix(agc): import native multisample D32S8 targets with a separate stencil plane and a depth-only HTILE #9533 adds, outside this PR.Ghost of Tsushima Director's Cut (PPSA02225), by @milescoviello, at 425cd9d with fix(agc): accept a colour alias over a native multisample depth plane when HTILE proves its clear #9742 (comment):
main98ddd9c + fix(agc): write back BDA stores into writable heap mirrors #12840 425cd9d + fix(agc): accept a colour alias over a native multisample depth plane when HTILE proves its clear #9742 1c904e2 (fix(agc): import native multisample D32S8 targets with a separate stencil plane and a depth-only HTILE #9533's 6eb141c 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 mismatchin compute shader 0x20001ef700, which feat(agc): sample the stencil plane of a native multisampled D32S8 target #9717 takes.e6c85d3, a merge of
maind30e04f, and 582e856, the journal race test (test-only).Why: merged with current
main, this branch failedagc_driver_pipeline_journal3 of 3, at the replay-race assertion from chitters2004's 307f220: "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.StorePages=1variant 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, asagc_shader_disk_cache_large_filedoes. On GitHub's Linux runner,--repeat×3, with the first run cold:maind30e04fmain+ this PR + the fixThat'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 582e856 (run): this PR's store-heap-mirror, BDA and recorder tests, the
^agc_driver_bda_and^agc_bdatests, andagc_driver_pipeline_journal.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_journaltook 108.3 s on its first run and 8.3 to 8.7 s after.APS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.6bec085, the journal watermark test (test-only,
tests/execution/PipelineJournal.cpp), for @jotitadev's review.ANYPS5_ENABLE_SPIRV_TOOLS=OFF,agc_driver_pipeline_journalfailed every run atEvictionWatermarkTests: "three consecutive records after a rewrite triggered another rewrite", 92 bytes over the 1 MiB cap. GitHub's Linux runner builds withON, where the modules are smaller, so it passed there.main.EvictionTestsjust rewrote, because an empty journal couldn't trigger a rewrite whatever the target.OFFfails 3 of 3 with that message on GitHub's Linux runner (run).OFF(run) and ×10 withON(run), on Windows too:agc_driver_pipeline_journal, the graphics binary'sagc_pipeline_journalandagc_pipeline_journal_long_paths, and every^agc_driver_bdatest.APS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.VERIFY_VALIDATION=1on GitHub's Linux runner,mainagainst this head, the same tests): both pass. The loader insertedVK_LAYER_KHRONOS_validation98 times onmainand 103 with this head, and neither log haswas not found. Both report onlyVUID-VkDeviceCreateInfo-pNext-pNext, so the change adds none.^agconce withOFF(run):agc_driver_graphicsstops 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 781dc45).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 582e856 didn't.NVIDIA (TechLevelZero's GPU runner, 6546250585): 6bec085 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_graphicsand the fouragc_driver_bda_store_heap_mirrortests it selected (_budget,_no_space_cache,_store_pages,_store_pages_default), all passed. Its selection didn't includeagc_driver_pipeline_journal, andagc_driver_graphics' heap-mirror case skips on Linux (no guest arena), so neither of those is measured there.d22d9c1, the Windows heap mirror case (test-only,
tests/BdaResources.cpp+77 −41).heapMirrorTestsruns 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 7e7c81a, a copy-backed writable mirror isRead|Write|Maskedin the BDA table, and its write-back stores only the pages the GPU reports. The case still expectedRead|Writeand reported no stores, so it failed on Windows every time, whatever the GPU. The production code is right; the case was out of date.SetResidentAddressSpaceLimit(1), asBdaStoreHeapMirror.cppdoes), then on the mirror the context gives. Each pass requires one mirror of the expected kind and expects exactlyRead|Write|Maskedfor a copy-backed mirror, orRead|Writefor a resident one with every block bound. It reports its three stores as the BDA does (NoteAddressStores,NoteStorePages) beforeWriteBack. The other checks are unchanged.agc_driver_graphicsfails (run). At d22d9c1 it passes 10 runs in a row, with this PR's journal and BDA tests, withOFF(run) and withON(run). Linux: 128 run, 120 pass, 8 skip, 0 fail. Windows: 143 run, 43 pass, 100 skip (no Vulkan device), 0 fail.Writefrom copy-backed mirrors' ranges turnsagc_driver_graphicsred on Windows and four of theagc_driver_bda_store_heap_mirrortests red on Linux (run).^agconce at d22d9c1 (run): Linux 1,150 run, 1,075 pass, 75 skip, 0 fail. Windows 1,185 run, 357 pass, 828 skip, 0 fail.APS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.9d2c13f, a merge of
main0836dfd (run withON, run withOFF).CMakeLists.txt, from build(agc): register each AGC test executable in its own CMake fragment #12862's split, resolved withtools/agc_test_split.py resolve. This PR's registrations move into a newtests/cmake/agc_driver_bda_store_heap_mirror_tests.cmake(+26) and intoagc_driver_pipeline_journal_tests.cmake(+4, itsTIMEOUT 240). ItsStorePageGather.compbuild rule stays inCMakeLists.txt.Graphics/include/GuestBufferMemory.hpp, where ashwin280802's fix(agc): evict unreferenced heap mirrors under memory pressure #13581 (heap mirror eviction) addsHoldsMirror,EvictMirror,WasEvictedandRecordEvictedat the spot where this PR addsAllowAddressStores,NoteAddressStoresand the store span and page types. Both sides are kept, each unchanged.sweepMirrorstakes 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'sshared_ptruntilWriteBackhas consumed the stores.EvictMirrorandRecordEvictedact only on a memory still being built, which has no spans or pages yet.-DBUILD_TESTING=ON,ctest -Ngives 3080 tests:main's 3075 plus this PR's 5, each listed once, andagc_driver_pipeline_journalwith this PR'sTIMEOUT 240.ONand withOFF: this PR's journal, BDA and store-heap-mirror tests,agc_driver_graphicsand fix(agc): evict unreferenced heap mirrors under memory pressure #13581'sagc_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_graphicspasses. The libc and libkernel suites run 199 and 308 tests on Linux and 226 and 330 on Windows, with 0 failed. The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.ON, this PR's set ×10 (160 runs) andagc_driver_resident_heap_mirror×10 pass, and^agcgives 1,158 run, 1,083 pass, 75 skip, 0 fail. WithOFF, the set and fix(agc): evict unreferenced heap mirrors under memory pressure #13581's test pass ×3.a896536 and d28c760, from oneandonlydean's review (run with
ON, run withOFF)._store_pages_defaultalready checked that, and_store_pagesnow checks that none of its threads' values reach any of its pages.APS5_BDA_STORE_PAGESgives a use more pages.ONand withOFF: 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 withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.NVIDIA RTX 2000 Ada Generation, TechLevelZero's NVIDIA GPU test at d28c760 (comment): merged onto
maind5ec8e6, driver 595.99.02, Linux, the Khronos layer. Passed: 2,494 passed, 0 new failures (3 fail onmaintoo and 1 is unstable there), 45 skipped, and no new validation IDs againstmainover 939 GPU tests.agc_driver_bda_store_heap_mirror(passed, 7.96 s) and, this time,agc_driver_pipeline_journal(passed, 134.0 s with the layer andANYPS5_NO_SHADER_CACHE=1). The report gives nomaintime 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 oragc_driver_graphics.agc_driver_bda_store_heap_mirroris this PR's own test, somain's baseline doesn't have it and its validation wasn't compared.b6f54ac, a merge of
main5bae1a4 (run withON, run withOFF, validation).main. The previous merge, 6f7d8f1 (maind8b60b4), had kept feat(agc): keep driver pipeline caches and costly compute pipeline binaries across updates #13931'sComputePipelineObjects::binaryLayoutKeyand its fill increateComputePipelinebeside this PR'sstorePagesand SPIR-V scan, inExecution/src/VulkanDevice.cpp, so the revert conflicted there. The merge takesmain's side for feat(agc): keep driver pipeline caches and costly compute pipeline binaries across updates #13931's lines and keeps this PR's, so noPipelineBinaryStoreorbinaryLayoutKeyis left in the file.main5bae1a4 into d28c760, the head before 6f7d8f1, and the changed lines are the same in all 31 files. OnlyPipelineJournal.cpp's context moved, frommain's eb4ec31.ONand withOFF: this PR's journal, BDA and store-heap-mirror tests,agc_driver_graphicsand fix(agc): evict unreferenced heap mirrors under memory pressure #13581'sagc_driver_resident_heap_mirror. feat(agc): keep driver pipeline caches and costly compute pipeline binaries across updates #13931's two pipeline-binary tests leftmainwith 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 withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.VERIFY_VALIDATION=1on GitHub's Linux runner,mainagainst this head, the same tests): the loader insertedVK_LAYER_KHRONOS_validation17 times onmainand 31 with this head, and neither log haswas not found. Both report onlyVUID-VkDeviceCreateInfo-pNext-pNext, so the merge adds none.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 6f7d8f1, merged onto
mainf2d874c, before the revert:mainand 3 are unstable onmain. No new validation IDs againstmainover 944 GPU tests.main. No new validation IDs againstmainover 944 GPU tests.agc_driver_pipeline_journaltook 183.3 s on the AMD card and 132.6 s on the NVIDIA one. Neither report gives amaintime for it.7af65f5, a merge of
main88e804b.mainnow has JJenkx's perf(agc): reuse heap mirror reference buffers between builds #8874 (heap mirror reference buffers), Celegans12's perf(agc): keep staged buffer copies inside a dispatch run #9287 (staged copies inside a dispatch run) and JJenkx's fix(agc): render layered mesh targets within device limits #6959 (layered mesh targets).GuestBufferMemory::takeHeapReferencesandreleaseHeapReferenceskeep both sides. Each reference is taken from perf(agc): reuse heap mirror reference buffers between builds #8874'sReferenceStoragepool 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.ShaderResources.cpp, this PR'sRecordStorePageGatherruns after perf(agc): keep staged buffer copies inside a dispatch run #9287's in-run copy-back block.MeshLayerBaseandMeshLayerCount, soStorePagesmoves to 8239.buildSpecializedModuleinRecompiler.cppthat lists a module's specialization constants. It leaves out only the workgroup offsets and looks every other ID up among the prepared values.StorePagesis supplied at dispatch, not prepared, so that lookup threwmap::at: before the change, nine tests failed on Linux and three on Windows. The merge commit changes that one line fromIsWorkgroupOffset(id)toIsDispatchSupplied(id), the checkspecializeWordsalready uses for the same IDs. It's folded into the merge so that no commit fails its tests.mainis otherwise unchanged.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 withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.agctest, 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.main88e804b on an RTX 2000 Ada (report): 2,560 passed, 5 failed, none new (3 also fail onmain, 2 unstable onmain), 45 skipped, with no new validation IDs (978 tests on the GPU).9fd023a, a merge of
main5cb015c, which brings Pipodi's perf(recompiler): back compute scratch with a device buffer slot pool #12764 (compute scratch backed by a device buffer slot pool).VulkanDevice.hppandVulkanDevice.cpp, each time one PR's addition next to the other's. The merge keeps both: in the header, perf(recompiler): back compute scratch with a device buffer slot pool #12764'sscratchPoolHeaderdeclaration and this PR'sspecializedComputePipeline; in the source, this PR'sStorePagesscan and perf(recompiler): back compute scratch with a device buffer slot pool #12764's three-elementsetLayoutsfor the scratch pool.mainis otherwise unchanged.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 withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.agctest, 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_lanefails onmaintoo. fix(agc): bind a T# minimum LOD through an S# that holds the LOD at 0 #12980 added its bilinear row, and adriadam10's 5821b86 onmainwidens that check aftermain's push builds failed it on lavapipe.agc_driver_pipeline_journalreached 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.main7feb37e, without this PR (run), its first run reaches the 120-second default timeout;TIMEOUT 240.main: it failed in 4 of the last 6mainruns there (report).main's own test already takes longer than 120 s, and this PR adds to that, as the cost note above says.mainf6232fc (report): 2,753 passed, 5 failed, none new (3 also fail onmain, 2 unstable onmain), 49 skipped, with no new validation IDs (943 tests on the GPU). AMD Radeon RX 6300 (RADV NAVI24, Mesa 25.2.8), merged ontomain7feb37e (report): 2,740 passed, 9 failed, none new (8 also fail onmain, 1 unstable onmain), 58 skipped, with no new validation IDs (943 tests on the GPU).a162a98, a merge of
main4f41f4c, which brings perf(agc): share BDA fault buffers in a per-device arena, with 32-byte slots for report-only programs #8963 (shared BDA fault buffers, merged first as planned) and ee6aba54's fix(agc): copy only the dwords a shader changed back from a GPU-copied buffer #6185 (WriteBackkeeping the CPU's bytes only in host-copied write-backs).CMakeLists.txt,Execution/src/GuestMemory.cpp,Graphics/include/BdaResources.hpp,Graphics/src/BdaResources.cpp,Graphics/src/GuestBufferMemory.cppandtests/BdaShader.cpp.SrtGuardWordin a full-size fault buffer, so the merge keeps the arena and changes one thing in it:APS5_NO_SHARED_FAULT_SLOTS=1.faultBytes()and the slot's device address), where it used to use its own buffer.ChangedStorecomposes with this PR's recorded store runs. InGuestBufferMemory.cpp,storeChangedtakes fix(agc): copy only the dwords a shader changed back from a GPU-copied buffer #6185's store function and this PR'sPieces* stored: a heap-mirror write-back passesstoredand writes throughGuestMemory::WriteChanged, recording each run, and every other caller stores with fix(agc): copy only the dwords a shader changed back from a GPU-copied buffer #6185's function. InGuestMemory.cpp, onewriteChangedtakes fix(agc): copy only the dwords a shader changed back from a GPU-copied buffer #6185'skeepGuestand this PR'sstored, behind three wrappers.CMakeLists.txtandBdaShader.cppkeep both sides.maingoes from +1,956 −70 to +1,964 −77, in 31 files. The change is inBdaResources.hpp,BdaResources.cpp,GuestBufferMemory.cppandGuestMemory.cpp.agc_changed_copy,agc_driver_graphics,agc_driver_pipeline_journal,agc_driver_resident_heap_mirrorand every test matching^agc_driver_bda,^agc_bda,^agc_driver_heap_mirroror^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 withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.agcandguest_memorytest, 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 onmain, failed in 6 of the last 8mainruns there (report).main4f41f4c. NVIDIA RTX 2000 Ada (driver 595.99.02; report): 2,772 passed, 6 failed, none new (3 also fail onmain, 3 unstable onmain), 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 onmain, 2 unstable onmain), 58 skipped, with no new validation IDs (939 tests on the GPU). Under the validation layer,agc_driver_pipeline_journaltook 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 9mainruns there.c68d814, 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:|| privateSlotfrom the check inBdaResources' destructor that gives a slot's counts back. On GitHub's Windows runneragc_driver_graphicsthen 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").agc_changed_copy,agc_driver_graphics,agc_driver_pipeline_journal,agc_driver_resident_heap_mirrorand every test matching^agc_driver_bdaor^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 withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.c4d6d41, a merge of
main04a9eb4 (run). The one conflict was inExecution/include/GuestMemory.hpp, where JAB-dev's feat(agc): publish a written native multisample D32S8 surface to its guest planes on a guest read #13021 declaresWriteChangedIfHeldat the place this PR declares itsWriteChangedoverload that returns the stored ranges. Both stay, and this PR's diff overmainis unchanged.agc_changed_copy,agc_driver_graphics,agc_driver_pipeline_journal,agc_driver_resident_heap_mirrorand every test matching^agc_driver_bdaor^agc_bda, with feat(agc): publish a written native multisample D32S8 surface to its guest planes on a guest read #13021'sagc_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 withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.main1c8c0ef, 2,853 of 3,842 tests selected. Of this PR's tests,agc_driver_bda_store_heap_mirrorandagc_driver_resident_heap_mirrorran and passed on both. The four added registrations (agc_driver_bda_store_heap_mirror_budget,_no_space_cache,_store_pagesand_store_pages_default) weren't in either selection.main, 2 unstable onmain), 50 skipped.main, 2 unstable onmain), 61 skipped. No new validation IDs over 960 GPU tests.agc_driver_pipeline_journaltimes include the filler zero-fills fix(agc): check a journal module's frame size before allocating it #15423 removes.3fa9852, a merge of
mainb11c7bf, which brings perf(agc): reuse read-only address-based draw builds over their cached address space #13858 (×10, everyagctest).BdaResources.hpp,ShaderResources.hppandBdaResources.cpp. perf(agc): reuse read-only address-based draw builds over their cached address space #13858 checks a draw use's fault record throughCheckUse(record), andcheckFault,markWrittenPagesandcheckSrtGuardtake the record whose fault slot the GPU wrote. This PR's store pages live in that slot too, so the merge hascheckFaultcollect the record's store pages, check its overflow, and re-attach its pages after a loop-guard clear.markWrittenPageskeeps this PR's written-page list.BdaResources.cppkeeps perf(agc): reuse read-only address-based draw builds over their cached address space #13858'sTableBytesandTableGuardCurrentbeside this PR's store-page functions.SrtGuardWord, so perf(agc): reuse read-only address-based draw builds over their cached address space #13858's slot cleaning, which clears the fault head and the SRT guard word, leaves them in place.^agc_driver_bda,^agc_bda,^agc_driver_address_draw_space_reuse,^agc_host_import,^agc_write_trackingor^agc_driver_host_import_proofs, withagc_driver_resident_heap_mirrorandagc_driver_pipeline_journal, which takes in this PR's tests and perf(agc): reuse read-only address-based draw builds over their cached address space #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 withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.agctest, 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.mainb11c7bf, 2,915 of 3,894 tests selected. Of this PR's tests,agc_driver_bda_store_heap_mirrorandagc_driver_resident_heap_mirrorran and passed on both, and so did perf(agc): reuse read-only address-based draw builds over their cached address space #13858'sagc_driver_address_draw_space_reuse. The four added registrations weren't in either selection.main), 49 skipped. No new validation IDs over 990 GPU tests.main, 1 unstable onmain), 60 skipped. No new validation IDs over 990 GPU tests.agc_driver_pipeline_journaltimes include the filler zero-fills fix(agc): check a journal module's frame size before allocating it #15423 removes.125faf5, a merge of
main090f571 (×10, #15423's test ×10).tests/cmake/agc_driver_pipeline_journal_tests.cmake, wheremainnow has fix(agc): check a journal module's frame size before allocating it #15423'sif(BUILD_TESTING)block withagc_driver_pipeline_journal_undecodable_module. This PR'sTIMEOUT 240line foragc_driver_pipeline_journalgoes into that block as its first line, so the file keeps one block. This PR's other lines are unchanged;Recorder.cppanddocs/dev/debt/libSceAgcDriver.mddiffer only in context.agc_host_import_sparse, no/dev/udmabuf), 0 fail;agc_driver_pipeline_journalpassed 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 withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.agc_driver_pipeline_journalexactly, so a second ×10 ranagc_driver_pipeline_journal_undecodable_modulewith this PR's fiveagc_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).a62b1d7, a merge of
maindd7c8de (×10).GuestMemory.cpp: this PR'swriteChangeddefinition, with itsstoredparameter, takes the[[maybe_unused]]onbyteStoreLimitthat oberonlift's refactor: route the libraries' fenv, TSC, cpuid and pause instructions through helpers #15797 added tomain's.tests/execution/PipelineJournal.cpp'sReplayRacesDispatchTests: dantdmdarealguy's test(agc): share the pipeline journal test's replayed compute programs #15730 builds the race's programs with the sharedReplayedCodes(), 16 programs from salt 8 in place of 32 from salt 16, and drops the function'sPipelines = 32. The merge takesconst 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. SincePipelinesis gone, the count check now readsheld == ReplayedPrograms,main's constant.GuestBufferMemory.hppdiffers in context only.^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_journalor^agc_pipeline_journal, withagc_driver_graphicsandagc_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_journalandagc_pipeline_journal_long_pathspass 10 of 10. Windows: 40 run, 13 pass, 27 skip, 0 fail. The Windows runner has no Vulkan device, soagc_driver_pipeline_journalandagc_driver_pipeline_journal_undecodable_moduleskip there with the other Vulkan tests; the graphics binary'sagc_pipeline_journal,agc_pipeline_journal_long_pathsandagc_pipeline_journal_extended_pathspass 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 withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.a3e3e77, a merge of
main7259cce (×10, everyagctest).VulkanDevice.cpp'sComputePipelineObjects, where liskeee's fix(agc): reapply pipeline cache persistence with guarded key queries #15169 addsbinaryLayoutKeyon the line this PR addsstorePagesto. The merge keeps both. fix(agc): reapply pipeline cache persistence with guarded key queries #15169's pipeline binary store arguments reach this PR'sspecializedComputePipelinewithout a conflict, and the store's key covers the specialization data, so theStorePagesvariant gets its own binary. oneandonlydean's revert(agc): revert #15169 pipeline binary store reland #17982 has since reverted fix(agc): reapply pipeline cache persistence with guarded key queries #15169 onmain(see 7cf8f10 below).^agc_pipeline_binaryand^agc_driver_pipeline_binarytests. Linux: 48 run, 45 pass, 3 skip (agc_host_import_sparse, and fix(agc): reapply pipeline cache persistence with guarded key queries #15169'sagc_pipeline_binary_vulkanandagc_driver_pipeline_binary_startup), 0 fail. This PR's fiveagc_driver_bda_store_heap_mirror*tests,agc_driver_graphics,agc_driver_resident_heap_mirrorandagc_driver_pipeline_journalpass 10 of 10, the journal's slowest in 89.9 s. Windows: 56 run, 27 pass, 29 skip (no Vulkan device), 0 fail. fix(agc): reapply pipeline cache persistence with guarded key queries #15169's two Vulkan tests skip on both runners, so these runs don't show theStorePagesvariant going through a pipeline binary.agctest, 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.guest_kernel_resident_fmem_exportandguest_kernel_resident_fmem_export_patchedfail in both runs. The same harness fails them onmain7259cce alone (run), andmain's own Windows job passes them, so they come from the verify harness, not this PR. The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.7cf8f10, a merge of
main47adcad (×10, everyagctest).main, sincemaincrashed at boot inPipelineBinaryStore::queryKey. That takes out thebinaryLayoutKeymember that the merge of 7259cce kept beside this PR'sstorePagesinComputePipelineObjects. The merge dropsbinaryLayoutKeyand keepsstorePages. Nothing in the tree uses fix(agc): reapply pipeline cache persistence with guarded key queries #15169's store any more, and this PR's changed lines are the same in all 31 files.agc_host_import_sparse), 0 fail. This PR's fiveagc_driver_bda_store_heap_mirror*tests,agc_driver_graphics,agc_driver_resident_heap_mirrorandagc_driver_pipeline_journalpass 10 of 10, the journal's slowest in 68.3 s. Windows: 42 run, 15 pass, 27 skip (no Vulkan device), 0 fail.agctest, 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.guest_kernel_resident_fmem_exportandguest_kernel_resident_fmem_export_patchedfail, as on a3e3e77. The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.af6430b, a merge of
main884694c (×10, everyagctest).vkCmdBindPipelinethroughResolvedorfunction()no longer compiles, and a compute pipeline binds throughcontext.BindComputePipeline, which skips a bind the command buffer already has. Three of this PR's binds move to it:VulkanDevice.cpp, the dispatch's bind, ofspecializedComputePipeline'sStorePagesvariant or the record's pipeline;VulkanDevice.cpp, the bind for each split chunk;Recorder.cpp, the store-page gather's bind ofstorePageGatherPipeline, as perf(agc): suppress redundant graphics pipeline and dynamic state commands #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.agc_command_state,agc_graphics_state_recorderandagc_graphics_state_recorder_unsuppressed. Linux: 38 run, 37 pass, 1 skip (agc_host_import_sparse), 0 fail. This PR's fiveagc_driver_bda_store_heap_mirror*tests,agc_driver_graphics,agc_driver_resident_heap_mirror,agc_driver_pipeline_journaland perf(agc): suppress redundant graphics pipeline and dynamic state commands #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.agctest, 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 aremain'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 d2949cd (job) and at 67ec0f7 (job), covered by test(agc): skip the csub and coherent atomic load runs on subgroups narrower than 32 lanes #19332.guest_timed_wait_cpufailed on its overshoot limits.sceKernelUsleep(500 us)reached a P99 overshoot of 4,303 µs, against a limit of 2,500 µs, andksem_timedwait(500 us)3,248 and 3,012 µs. This PR doesn't change libkernel. In theagcrun on the same head, the Windows libkernel suite ran 402 tests with 0 failed,guest_timed_wait_cpuamong them.guest_timed_wait_cpuamong them.APS5_SKIP_TIMING_TESTS=1, which relaxes onlyprecise_wait's median bounds on GitHub's hosted runners.agc_shader_memoryin upstream's Windows job (job): upstream CI merged this head ontomainb671752, andagc_shader_memoryexited with 0xc0000374 after "read of 0xffffffff00000008". Thatmainsits between perf(shader): resolve image tables with fewer allocations #18827 (04:46Z on 14 Nov) and fix(shader): keep the per-thread empty image tables in HostThreadLocal #19893 (08:20Z), andmainalone crashes in the same test binary there:main's own push run at 6f6d066 (job) exitsagc_shader_memorywith 0xc0000374;mainb671752 alone on GitHub's Windows runner (run) passesagc_shader_memory10 of 10, andagc_shader_memory_coherent_atomic_loadscrashes in its 10th run with the same fault address;agc_shader_memory_tests.exe+0x522829).On
mainf0c9b11, after fix(shader): keep the per-thread empty image tables in HostThreadLocal #19893, neither test crashes: in 3 runs of 10 per arm, this head merged onto it andmainalone each passagc_shader_memoryandagc_shader_memory_coherent_atomic_loads30 of 30 (this head: 1, 2, 3;main: 1, 2, 3). The Windows trees of these runs had fix(tests): set the upload cache test's environment with _putenv_s on Windows #19899's_putenv_stest fix on top.3704189, a merge of
main11992f9 (×10, ×10 with the Windows test fix, everyagctest), which brings adam25136's fix(agc): wait for address-based writers before reading indirect draw records #17850 (CPU reads of indirect draw records wait for address-based writers).docs/dev/debt/libSceAgcDriver.mdonly. fix(agc): wait for address-based writers before reading indirect draw records #17850 rewrote the "CPU reads behind an address-based build" entry, right before this PR's two entries. The file merges withmerge=union, which would keep the old copy of that entry next to the new one, so the merge takes fix(agc): wait for address-based writers before reading indirect draw records #17850's entry and keeps this PR's two after it.mainstays +1,996 −77. Only context lines moved, in that debt entry and indocs/dev/ENVIRONMENT.md.GuestBufferMemory.cpp, which fix(agc): wait for address-based writers before reading indirect draw records #17850 also changes, merged without a conflict.agc_driver_indirect_draw_pending_producer*tests. Linux: 45 run, 44 pass, 1 skip (agc_host_import_sparse), 0 fail; fix(agc): wait for address-based writers before reading indirect draw records #17850's four tests pass 10 of 10. Windows: 57 run, 21 pass, 36 skip (no Vulkan device; fix(agc): wait for address-based writers before reading indirect draw records #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 withAPS5_SKIP_TIMING_TESTS=1, which relaxes onlyprecise_wait's median bounds on GitHub's hosted runners.agctest, once, on Linux: 1,809 run, 1,686 pass, 114 skip, 9 fail.main's own Linux job at 3e1b183 (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_mirrorsandagc_draw_input_reuse.agc_driver_runtime_buffer_spans_x3_spansand_x4_spanstimeouts, passed there. Over 10 runs ofmain790e9a3 with fix(tests): set the upload cache test's environment with _putenv_s on Windows #19899's test-only commit on top (run), both time out too.main's Windows test build stops at "'setenv' was not declared" inUploadCacheReadOnlyFlush.cpp(from perf(agc): reuse read-only guest buffer uploads #18037). It isn't on this branch. The Windows builds of the first ×10 and of theagcrun, on this head alone, stopped at that error.bcc617f, a merge of
main0173f20 (×10, everyagctest), which brings Ketz7's perf(shader): record a BDA fault with one atomic claim and branch-free stores #20870 (a BDA fault recorded with one atomic claim).Graphics/src/BdaResources.cpp, at theRequirethat a fault record without a publication holds no data. perf(shader): record a BDA fault with one atomic claim and branch-free stores #20870 changes its last check fromreport.otherFaults == 0toreport.claim == 0, and this PR adds itspagesOverflowedRequireon the next line. The merge keeps perf(shader): record a BDA fault with one atomic claim and branch-free stores #20870's line, with this PR's after it.mainstays +1,996 −77. Its patch-id changed, since the line before this PR'sRequireis now perf(shader): record a BDA fault with one atomic claim and branch-free stores #20870's.BdaAbi::Faultfrom 32 to 40 bytes (otherFaultsbecomesclaim,discardandreserved). This PR's store-page words follow the fault record and chain fromWrittenOverflowWord = sizeof(Fault) / 4, so they move with it, andFaultBufferBytesgrows to match. In the merged code, the host side, the SPIR-V emitter (SpirvBdaLookup.cpp,SpirvMemoryInstructions.cpp) and the tests address these words through theBdaAbiconstants, and the store-page gather shader gets its word indices as push constants fromRecorder.cpp, so no word index is written out by hand.agc_host_import_sparse), 0 fail;agc_driver_bda_deviceandagc_shader_memory, whose tests perf(shader): record a BDA fault with one atomic claim and branch-free stores #20870 changes, pass 10 of 10. Windows: 57 run, 22 pass, 35 skip (no Vulkan device), 0 fail.guest_multibyte_locale, which checks thatwcstombsfills the capacity mid-character, fails on both. That comes frommain: gurtgg's fix(libc): stop wcstombs before multibyte character exceeding capacity #21244 (merged 08:27Z on 16 Nov) stopswcstombsbefore a character that doesn't fit,main's own push run at dcf3d15 fails the test on Linux and Windows, and oneandonlydean's open revert: stop wcstombs before a multibyte character exceeding capacity (#21244) #21515 reverts fix(libc): stop wcstombs before multibyte character exceeding capacity #21244. This PR changes no libc file. The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxes onlyprecise_wait's median bounds on GitHub's hosted runners.agctest, 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 perf(shader): record a BDA fault with one atomic claim and branch-free stores #20870'sBdaResourcestest changes, passes on both.main's own Linux job at dcf3d15 (job):agc_hook_clear_access,agc_hook_clear_access_off,agc_driver_recorder, and theagc_driver_runtime_buffer_spans_x2_spans,_x3_spansand_x4_spanstimeouts.agc_driver_image_table_packed_guards, fails the same way inmain's own Linux job at e249fc4 (job): three identical "stage 4 pc 0x68" records, then "unrecoverable packed table format was not poisoned". fernandomcrsilva's test(agc): keep the packed image table guard programs at different addresses #21255 changes that test.guest_multibyte_localeon both, as above. On Linux, libkernel'sguest_thermal_sensorsalso reached its 20 s timeout. It times out in every run I have on GitHub's Intel Xeon 6975P-C runners,main0694c4c alone included (run), and passes in 0.01 to 0.02 s on GitHub's AMD EPYC runners and inmain's own job. This PR changes no libkernel file._putenv_stest fix on top; it isn't on this branch.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=1andANYPS5_NO_SHADER_CACHE=1. This head bcc617f merged ontomaine4caa07 (a clean merge), againstmaine4caa07 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 fiveagc_driver_bda_store_heap_mirror*testsmaindoesn't have. The same three skip on both sides:agc_driver_bda_reads_shadowed_resultsand_per_build(the device reports watched host memory written when it imports or reads it) andagc_host_import_sparse(udmabuf'ssize_limit_mbis above 1024). NoVUID-line on either side, and every device test selected the RTX 4090.a96efaa, a merge of
main8bb7635 (×10, everyagctest), which brings atinseau's feat(shader): emulate 64-bit image and buffer atomics on devices without them #18842 (64-bit image and buffer atomics emulated on devices without them).core/shader/recompiler/PipelineSpecialization.hpp: feat(shader): emulate 64-bit image and buffer atomics on devices without them #18842 addsIsAtomicLockTable(the two words of its lock table's address, ids 8244 and 8245) where this PR addsIsDispatchSupplied(the workgroup offsets andStorePages). 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: feat(shader): emulate 64-bit image and buffer atomics on devices without them #18842'sPipelineSpecializationconstructor takes the lock table's address. The merge keeps this PR's version of the function (its four-word key withstorePages, and thereplacedlist withStorePages) and builds it as feat(shader): emulate 64-bit image and buffer atomics on devices without them #18842 does:PipelineSpecialization(shader, context.atomicLockTable, replaced).mainstays +1,996 −77. InRecompiler.cppandVulkanDevice.cpp, its one changed line in each now carries feat(shader): emulate 64-bit image and buffer atomics on devices without them #18842's addition, so its patch-id changed.agc_driver_buffer_atomics,_float,_inc_dec64,_or_swap64andagc_driver_image_atomics64, andagc_placeholder_images, whose tests feat(shader): emulate 64-bit image and buffer atomics on devices without them #18842 changes. Linux: 51 run, 50 pass, 1 skip (agc_host_import_sparse), 0 fail; this PR's fiveagc_driver_bda_store_heap_mirror*tests and feat(shader): emulate 64-bit image and buffer atomics on devices without them #18842's five pass 10 of 10. Windows: 63 run, 23 pass, 40 skip (no Vulkan device), 0 fail.guest_multibyte_localepasses again on both. They ran withAPS5_SKIP_TIMING_TESTS=1, which relaxes onlyprecise_wait's median bounds on GitHub's hosted runners.agctest, 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.main's own Linux job at dcf3d15 (job):agc_hook_clear_access,agc_hook_clear_access_off,agc_driver_recorder, and theagc_driver_runtime_buffer_spans_x2_spans,_x3_spans,_x4_spansand_x4_referencetimeouts.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 onmain0694c4c on GitHub's Linux runner (AMD EPYC 7763; run, with only fix(tests): set the upload cache test's environment with _putenv_s on Windows #19899's Windows test fix on top).agc_driver_image_table_packed_guards, fails the same way inmain's own Linux job at e249fc4 (job): three identical "stage 4 pc 0x68" records, then "unrecoverable packed table format was not poisoned". fernandomcrsilva's test(agc): keep the packed image table guard programs at different addresses #21255 changes that test.main8bb7635 alone on GitHub's Linux runner (Intel Xeon 6975P-C; run): 42 tests, theagc_driver_runtime_buffer*andagc_driver_image_table*tests with the hook pair andagc_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_spansand_x4_spanstimeouts._x3_referenceand_x4_referencepass 3 of 3 there: 21.44 and 20.80 s in their first run, beside the three_spanstests timing out, and 1.5 to 2.0 s in the next two. Theagcrun above had 1,876 tests in parallel. That run's libkernel suite also hit theguest_thermal_sensorstimeout of that CPU, and its Windows build stops atmain's "'setenv' was not declared" error, since its tree didn't have fix(tests): set the upload cache test's environment with _putenv_s on Windows #19899's test fix._putenv_stest fix on top; it isn't on this branch.Marvel's Wolverine (PPSA03671 v01.001.005), by @nydal91, at a96efaa (comment): Linux (PikaOS 4, kernel 7.3.3), AMD Radeon RX 6950 XT (RADV, Mesa 26.3.0). An A/B on
mainf15df32 with the prerequisites they carry, 300 s runs atAPS5_HOST_IMPORT_MIB=5000:deferred write-back failed: BDA access failed ... read-only in the BDA tablerefusals, 4-byte compute stores into a 1.1 GiB unaligned descriptor view of a 2.5 GiB registered heap, thenVK_ERROR_DEVICE_LOSTatvkQueueSubmit.2687eec, a merge of
main2b31f86 (×10, everyagctest), which brings ashwin280802's perf(agc): publish storage-image results into resident heap mirrors #17796 (storage-image results published into resident heap mirrors), merged first, as planned.GuestBufferMemory.cpp,UploadFinish: perf(agc): publish storage-image results into resident heap mirrors #17796 addspublishIntoMirrors()where this PR addsaddAddressStoreSpans(), both beforetakeHeapReferences(). The merge callsaddAddressStoreSpans()first, as planned in the merge-order note, so a writable mirror that a draw may store into through an address takes perf(agc): publish storage-image results into resident heap mirrors #17796'sWrittenfallback.ShaderResources.cpp: relativespace2K's fix(agc): rebind moved read-only buffers in place instead of snapshotting them #19131 adds aconst DrawBindings* bindingsparameter toMarkGpuWrites, which follows this PR'sStorePages(). The merge keepsStorePages()and fix(agc): rebind moved read-only buffers in place instead of snapshotting them #19131's signature.mainstays +1,996 −77. Its patch-id changed, since the lines next to two of its additions are now perf(agc): publish storage-image results into resident heap mirrors #17796's and fix(agc): rebind moved read-only buffers in place instead of snapshotting them #19131's.agc_driver_resident_heap_mirrorandagc_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.guest_thermal_sensorson 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 withAPS5_SKIP_TIMING_TESTS=1, which relaxes onlyprecise_wait's median bounds on GitHub's hosted runners.agctest, 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.main2b31f86 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 theagc_driver_runtime_buffer_spans_x2_spans,_x3_spansand_x4_spanstimeouts.agc_driver_fault_check_dedupandagc_driver_oracle_runnerat 120 s, andagc_driver_image_table,agc_driver_runtime_buffer_spans_x3_referenceand_x4_referenceat 30 s. That run's EPYC 7763 runner took 1,016 s for the Linux pass, against 601 s formain's pass on the Xeon runner. On a Xeon 6975P-C runner, this head runs them 3 times each with theagc_driver_runtime_buffer_spansfamily 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 inmain's full pass. The_spanstimeouts there aremain's three._putenv_stest fix on top; it isn't on this branch.Overlaps
main88e804b keeps both (see Tested). This PR no longer takes whole-span references for address stores, so perf(agc): reuse heap mirror reference buffers between builds #8874's pool serves only the declared writes' references.main4f41f4c gives a build that stores through addresses a private slot in its arena for the store-page words (see Tested).GuestBufferMemory.cpp's resident write-back. perf(agc): store a resident heap mirror's write-back from its readback buffer #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: perf(agc): store a resident heap mirror's write-back from its readback buffer #12827 first, this one second (note).GuestBufferMemory.hppand.cpp. fix(agc): keep resident heap mirrors without host copies #15296 removes the resident host copies (ResidentBuffer::Read,StoreandBlock), 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: fix(agc): keep resident heap mirrors without host copies #15296 first (it lands after fix(agc): keep heap mirror slabs within device memory #15295 and perf(agc): store a resident heap mirror's write-back from its readback buffer #12827), this one second, rebased off the host copies (note).Context.hpp, is withmain, and this PR doesn't change that file. sktharunbalaji13-cmd ran the two together on Ghost of Tsushima Director's Cut (see Tested).WriteBackkeeping the CPU's bytes): fix(agc): copy only the dwords a shader changed back from a GPU-copied buffer #6185 has merged, and the merge ofmain4f41f4c composes itsChangedStorewith the store-mask write-back (see Tested). fix(agc): keep CPU stores made after a deferred DCC key store was recorded #6186, which also conflicts withmain, conflicts with this branch only intests/Recorder.cppandtests/cmake/agc_driver_recorder_tests.cmake.ShaderResources.cpp, besidesCMakeLists.txtandDraw.cpp.main5cb015c brings them without a conflict.mainb11c7bf composes its per-use fault records with this PR's store pages (see Tested).if(BUILD_TESTING)block at the end oftests/cmake/agc_driver_pipeline_journal_tests.cmake, and the merge ofmain090f571 puts this PR'sTIMEOUT 240line, which covers this PR's own cold compile, into fix(agc): check a journal module's frame size before allocating it #15423's block (see Tested).maincrashed at boot inPipelineBinaryStore::queryKey. The merge ofmain47adcad drops itsbinaryLayoutKeyand keeps this PR'sstorePages(see Tested). If fix(agc): reapply pipeline cache persistence with guarded key queries #15169 comes back, the two are again neighbouring members ofComputePipelineObjects, and keeping both resolves it.GuestBufferMemory.cpp'sUploadFinishbeforetakeHeapReferences(). The merge ofmain2b31f86 calls this PR'saddAddressStoreSpans()before perf(agc): publish storage-image results into resident heap mirrors #17796'spublishIntoMirrors(), so a writable mirror that a draw may store into through an address takes perf(agc): publish storage-image results into resident heap mirrors #17796'sWrittenfallback, and its ×10 runs perf(agc): publish storage-image results into resident heap mirrors #17796'sagc_driver_resident_heap_mirrorand_no_publishwith this PR's tests (see Tested).main11992f9 keeps fix(agc): wait for address-based writers before reading indirect draw records #17850's rewritten debt entry with this PR's two after it, and runs fix(agc): wait for address-based writers before reading indirect draw records #17850'sagc_driver_indirect_draw_pending_producertests with this PR's store pages (see Tested).vkCmdBindPipeline, so the merge ofmain884694c binds this PR's three compute pipelines through itscontext.BindComputePipeline(see Tested).main0173f20 keeps itsreport.claim == 0check with this PR'spagesOverflowedRequireafter it, and this PR's store-page words move with its 40-byte fault record (see Tested).main8bb7635 keeps both: a module's build-time specialization leaves out this PR's and feat(shader): emulate 64-bit image and buffer atomics on devices without them #18842's, and this PR'sStorePagespipeline variant gets feat(shader): emulate 64-bit image and buffer atomics on devices without them #18842's lock table address (see Tested).BdaAbi.hpp'sFaultReasonafterWindowLaneSpill: this PRStorePages, feat(agc): opt-in bindless image heap for sampled image tables #20519 and perf(shader): keep only the layout of unbounded bindless pointer tables #22424BindlessMissandBindlessRefused, and feat(shader): split and continue table calls that cannot be linked #22359SplitState. Whichever lands second takes the next numbers, and every use names the reason, not its number.BdaResources.cpphas an adjacent#includeline (feat(agc): opt-in bindless image heap for sampled image tables #20519 and perf(shader): keep only the layout of unbounded bindless pointer tables #22424) and adjacent fault messages (feat(shader): split and continue table calls that cannot be linked #22359). InVulkanDevice.cpp, feat(shader): split and continue table calls that cannot be linked #22359's split-state block goes before this PR's store-page bind. No merge order: whichever lands second resolves the conflict (git merge-treeonmain1adc0e2f4b).VulkanDevice.cpp's compute pipeline creation. feat(shader): store cached SPIR-V compressed with zstd #22692 creates each compute module from aSharedSpirv::Words()lease, and this PR'sspecializedComputePipeline(splitComputePipelineonmain) keys its pipelines by the store-page flag as well as the workgroup offsets. The merge keeps this PR's four-word key andreplacedconstants, withStorePageswhen the flag is set, and creates the module from feat(shader): store cached SPIR-V compressed with zstd #22692's lease. IncreateComputePipelineboth addconst auto words = shader.spirv.Words();, so the merge drops this PR's line, and itsStorePagesscan reads feat(shader): store cached SPIR-V compressed with zstd #22692's lease, declared beforeobjects->module. Merge order: feat(shader): store cached SPIR-V compressed with zstd #22692 first, this one second (note). That's one text conflict onmainb1a1e61f91(git merge-tree).note_bda_writehash table with per-range granule bits and a page map. This PR's store-page words followSrtGuardWord, and itsStorePageGather.compfinds the pages BDA stores hit from the table's count, slot and list words, whichRecorder.cpppasses to it. The merge puts the store-page words after perf(agc): record BDA stores in per-range granule bits and a page map instead of the note_bda_write hash table #22944'sSrtGuardWordand has the gather read perf(agc): record BDA stores in per-range granule bits and a page map instead of the note_bda_write hash table #22944's written-page record. InSpirvEmitterState.hppit dropsbdaNoteWriteFunctionwith perf(agc): record BDA stores in per-range granule bits and a page map instead of the note_bda_write hash table #22944 and keeps this PR's two store-page members. Merge order: perf(agc): record BDA stores in per-range granule bits and a page map instead of the note_bda_write hash table #22944 first, this one second (note). That's six conflict blocks in five files onmain8dbb3bf68d(git merge-tree).Recorder.cppmerges without one but still passes the table's words.GuestBufferMemory.cpp'sRecordCopyBacks, where both change the loop that records the heap-mirror readbacks. Proposed order: this PR first, and feat(libSceAgcDriver): GPU-readback staging for writable-copy write-back #23596 then resolves the conflict keeping both sides (see the note on feat(libSceAgcDriver): GPU-readback staging for writable-copy write-back #23596). The merged loop is feat(libSceAgcDriver): GPU-readback staging for writable-copy write-back #23596's, with itsheapMirrorandwritableCopybranches, iterating this PR'sdeclaredReadbacks, and with this PR'sAddressStoreTallies().readbackBytesline in theheapMirrorbranch. Whichever goes second runs this PR'sagc_driver_bda_store_heap_mirror*tests and feat(libSceAgcDriver): GPU-readback staging for writable-copy write-back #23596's copy write-back tests on the merged tree.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)main88e804b, 4f41f4c, 11992f9, 0173f20, 8bb7635 and 2b31f86 keep both