Skip to content

perf(agc): share BDA fault buffers in a per-device arena, with 32-byte slots for report-only programs - #8963

Merged
oneandonlydean merged 10 commits into
boykopovar:mainfrom
EagleBearerYS:perf/agc-shared-bda-fault-buffers
Nov 3, 2026
Merged

oneandonlydean merged 10 commits into
boykopovar:mainfrom
EagleBearerYS:perf/agc-shared-bda-fault-buffers

Conversation

@EagleBearerYS

@EagleBearerYS EagleBearerYS commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What

Every BdaResources owns a host-visible fault buffer of BdaAbi::FaultBufferBytes: 24,620 bytes, which the buffer pool rounds to 32 KiB. A program uses only part of it:

words contents written by
0–7 the fault report record_bda_fault (image-table faults, unlinked calls, the loop guard) and the rect-list check
8–6153 the written-page record only programs that store through the BDA table
6154 the SRT guard word only programs with a guarded SRT read

A buffer lives as long as its owner: while the resource cache keeps a fault-only build, and while an address-based draw is in flight, which the recorder holds until its batch completes.

In a Village-shaped bench (agc_driver_village_draw_cost_tests --cost 20, lavapipe, APS5_PROFILE_DRAW=1, two runs), the fault buffers were 97.7% of the driver's "shader data" host-visible memory:

  • 189.7 and 198.7 MiB, in 6,071 and 6,359 buffers;
  • of a host-visible peak of 214.4 and 224.4 MiB.

Every one of the 22,000 BDA builds there could write only the report.

The change, in two commits:

  1. Fault buffers are slots of a per-device arena, in 512 KiB host-visible chunks at minStorageBufferOffsetAlignment.
    • Each slot is bound with its offset (ShaderResources::prepareFaultSlot rewrites only the fault descriptor of the owner's own sets).
    • An owner notes the serial of each batch it's bound or marked in. The recorder reports each batch once its completions ran (BdaResources::NoteFinished).
    • When no chunk has a free slot, under the GPU lock only, the arena takes back the slots of the older half of the idle owners. An idle owner is one whose last batch finished and whose slot is clean: no unread report, written-page claim or SRT guard. Without the lock the arena grows instead.
    • An owner that lost its slot takes one again when it's next bound. A slot in use never moves, so every report is read from the slot its shader wrote, and per-draw attribution is unchanged.
    • APS5_NO_SHARED_FAULT_SLOTS=1 restores one full buffer per owner (documented in docs/dev/ENVIRONMENT.md).
  2. Report-only programs get a 32-byte slot.
    • SpirvFaultReportOnly(words, set, binding), cached per module hash, proves that a program reaches its fault buffer only through OpAccessChain with constant member 0 and a constant word below 8, used only in loads, stores and atomics.
    • Any other reference fails the proof and keeps the full slot: a computed index, word 8 or beyond, a copied pointer, the buffer passed to a function, or a module that can't be read.
    • prepareAddressBindings ANDs the proof over every stage. For such an owner, CheckFault reads only the report, and markWrittenPages and checkSrtGuard are skipped: the program can't write those words, and they aren't in the slot.
    • Report-only and full slots come from separate chunks.
    • BdaAbi.hpp is unchanged and no shader offset moves, so the shader cache isn't affected. The BDA read execution tests have always bound a sizeof(Abi::Fault) buffer to read programs.

Fault reports kept exactly:

  • Per-draw attribution: one slot per owner, never moved while in use.
  • Image-table faults and the loop guard: report words, read and reset as before.
  • SRT guard faults: a guarded program writes word 6154, fails the proof and keeps a full slot.
  • The written-page record: a program with BDA stores writes words 8 and up, fails the proof and keeps a full slot.

Measured, same bench and runs:

arm host-visible peak "shader data" BDA fault buffers
main 214.4 / 224.4 MiB 194.1 / 203.4 MiB 189.7 / 198.7 MiB (6,071 / 6,359 buffers)
commit 1 only 188.4 / 196.4 MiB 165.9 / 174.7 MiB 161.0 / 169.5 MiB (322 / 339 chunks)
both 30.4 / 28.4 MiB 6.6 / 5.9 MiB 0.5 MiB (one chunk)
  • On this bench nearly all of the saving is the second commit's. The buffers belonged to draws in flight, which the first commit's give-back can't take, and its arena saves only the pool's rounding.
  • The give-back is for fault-only builds the resource cache keeps: rect-list, image-table and SRT-guard builds. Its test covers that case.
  • The bench's wall times per draw fell too, but they're too noisy on lavapipe to claim.

Resident Evil Village (PPSA01556): one pair on an NVIDIA GeForce RTX 3070 Laptop GPU (driver 617.42, Windows 11), clocks not held, both arms with APS5_PROFILE_DRAW=1, APS5_LAZY_SHADER_PREPARE=1, APS5_NO_GPL=1 and APS5_HOST_IMPORT_MIB=6400; 6 min at the static menu, then Yes and 4 min in control. Host-visible "shader data", where the fault buffers are allocated: 27.6 → 18.8 MiB and 24.4 → 15.9 MiB at the menu (after 1 and 5 min), and 12.4 → 2.8 MiB in control. No fault lines in either arm. After the load the two arms took different host-import paths (27,062 imports made without this PR, 44,814 with it). That moves the buffer pool and host copies, not the fault buffers, so total host-visible memory isn't compared here. An earlier pair at the static menu, before the give-back and the 32-byte slots, showed ~20 MiB with and without the change.

The last summary line of each arm, in the control scene (without this PR, then with it). Both arms ran with APS5_PROFILE_DRAW=1, each line is a single present, and the lines carry no memory fields, so they record the scene the memory figures above come from, not a speed. Their frame times (4.0 s and 8.1 s) aren't comparable: both arms were profiled, and they took different host-import paths after the load (see above):

{"commit":"af0821dddb64","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"6400","APS5_LAZY_SHADER_PREPARE":"1","APS5_NO_GPL":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PROFILE_DRAW":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SUMMARY_EVERY":"1"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 9 5900HS with Radeon Graphics","cpu_threads":16,"memory_mib":15776,"title_id":"PPSA01556","title":"Resident Evil Village","content_version":"01.210.000","resolution":"3840x2160","window":{"spec":"summary_every 1","first_present":5458,"ms":4017.622},"interval_start_s":2400.257,"interval_end_s":2404.275,"presents":1,"frame_ms":{"p50":4017.622,"p90":4017.622,"p99":4017.622,"max":4017.622},"gpu_busy_ms_per_present":231.500,"worker_busy_pct":{"queue worker 0x0":88.827,"queue worker 0x38":10.990,"queue worker 0x20":75.535,"queue worker 0x28":82.775},"top_phases_ms_per_frame":{"Driver.Packet":10368.420,"Driver.Packet.memory_wait":6239.427,"Driver.Packet.draw":2859.241,"Driver.Draw":2857.528,"Graphics.Draw":2525.684,"Graphics.Draw.draw_and_resource_release":2503.759,"Resources.Complete":2023.137,"Driver.Packet.dispatch":1190.484},"trace_dropped":false,"trace":""}
{"commit":"5f6425ca4a49","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"6400","APS5_LAZY_SHADER_PREPARE":"1","APS5_NO_GPL":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PROFILE_DRAW":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SUMMARY_EVERY":"1"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 9 5900HS with Radeon Graphics","cpu_threads":16,"memory_mib":15776,"title_id":"PPSA01556","title":"Resident Evil Village","content_version":"01.210.000","resolution":"3840x2160","window":{"spec":"summary_every 1","first_present":4832,"ms":8053.336},"interval_start_s":2797.378,"interval_end_s":2805.432,"presents":1,"frame_ms":{"p50":8053.336,"p90":8053.336,"p99":8053.336,"max":8053.336},"gpu_busy_ms_per_present":229.928,"worker_busy_pct":{"queue worker 0x0":94.510,"queue worker 0x38":5.374,"queue worker 0x20":85.585,"queue worker 0x28":90.852},"top_phases_ms_per_frame":{"Driver.Packet":22249.511,"Driver.Packet.memory_wait":11986.929,"Driver.Packet.draw":4459.777,"Driver.Draw":4457.433,"Resources.Complete":4328.588,"Graphics.Draw":4112.876,"Graphics.Draw.draw_and_resource_release":4083.483,"Driver.Packet.dispatch":4041.343},"trace_dropped":false,"trace":""}

Overlap: checked with git merge-tree against every open PR on the same files, on main b77bd58.

Tested

  • agc_driver_graphics (faultSlotTests, mock device):
    • 256 idle cached BdaResources hold fewer than 64 slots, and the reclaim count is non-zero;
    • two of them retaken while in flight survive 64 pressure objects and report their own addresses from one batch;
    • a fault-only ShaderResources reclaimed under pressure takes a new slot on Bind and reports its own address, while the build that took its old slot reports its own;
    • a build whose program can't be read keeps a full slot;
    • 64 report-only owners share one chunk of 32-byte slots, with neighbours reporting their own addresses;
    • the real rect-list program is bound 32 bytes and reports its fault.
  • agc_driver_bda_device (lavapipe):
    • the proof accepts the BDA read and fault programs, and rejects store and write programs, a missing binding and unreadable modules;
    • five hand-assembled modules cover report-word loads, stores and atomics, and rejections for word 8, a computed index, a copied pointer and the buffer passed to a function;
    • two neighbouring 32-byte slots, dispatched in one batch, each report their own fault.
  • Red lines (each fix hunk reverted at its commit, the test unchanged):
    • commit 1, the reclaim: "256 idle cached BdaResources hold 256 fault slots in 13 chunks (6563 KiB of host-visible memory)";
    • commit 2, the slot size: "64 report-only BdaResources hold 4 fault chunks with 24620-byte slots", and on the device "two report-only BdaResources did not take 32-byte slots of one fault chunk";
    • commit 2, the plumbing: "the rect-list check, which writes only the fault report, was bound 24620 bytes of fault buffer";
    • commit 2, without the proof: "a build whose program could not be read was bound less than a full fault buffer".
    • The same four reds at this PR's head cfe7302, on GitHub's runners, each fix hunk reverted on its own there with the tests unchanged, one run of agc_driver_graphics and agc_driver_bda_device each, with the other tests built from the changed files. Each fails on Linux and on Windows with its line:
      • reclaim off (run): "256 idle cached BdaResources hold 256 fault slots in 13 chunks (6563 KiB of host-visible memory)";
      • full-size slots (run): "64 report-only BdaResources hold 4 fault chunks with 24620-byte slots", and on Linux agc_driver_bda_device also fails with "two report-only BdaResources did not take 32-byte slots of one fault chunk";
      • the plumbing (run): "the rect-list check, which writes only the fault report, was bound 24620 bytes of fault buffer";
      • the proof's result dropped (run): "a build whose program could not be read was bound less than a full fault buffer".
      • In each run agc_driver_graphics fails (on Linux its _maps_fallback run too), plus agc_driver_bda_device where noted; the other tests pass, and on Windows agc_driver_bda_device skips without a Vulkan device. The green at the same head is the cfe7302 run below.
  • The existing BDA, fault, SRT-guard and image-table tests (31, agc_shader_srt_read_patching included) pass ×10, with the same 2 skips as main.
  • GitHub's runners (run):
    • agc_driver_graphics, agc_driver_bda_device and agc_shader_srt_read_patching pass ×10 on Linux. On Windows (MinGW), agc_driver_graphics and agc_shader_srt_read_patching pass ×10 and agc_driver_bda_device skips without a Vulkan device. The run's other tests, which it picked from the changed files, pass too: 32 run on Linux and 31 on Windows in all.
    • The libc and libkernel suites pass on both.
    • With main's code the new tests don't build, because they use the arena's API. The red lines above come from reverting each fix hunk instead.
  • CI's Linux job, mirrored (Ubuntu 24.04, gcc 13.3, lavapipe): 1,776 of 1,782 here and 1,775 of 1,782 on main a07e985.
    • The same six network tests fail on both, from that machine's sandbox.
    • main also failed agc_driver_sgpr_pattern_fill_keys under load; it passes here, and 10 of 10 alone.
    • Registration and check_skips.py match.
  • RADV, run by clairtonmichel (comment; RX 7900 XTX, Mesa 26.2.5, Fedora): 872 of the 875 AGC and video tests pass. The other three have known failures on main on RADV: agc_driver_guest_memory_lifetime (agc_driver_guest_memory_lifetime fails on RADV since the host-import cut larger-side keep (16473dbbe, #6499 family) #7784), agc_driver_tessellation (agc_driver_tessellation segfaults on RADV with Mesa 26.2+: nir_opt_varyings corrupts the TCS input offset's use list (Mesa bug) #5444, a crash with Mesa 26.2 and later; theirs is 26.2.5) and agc_driver_image_array_window_past_layer_limit (the expectation test(agc): clamp the array window test's layer to the slices its view covers #8969 fixes). Their runs on main and with APS5_NO_SHARED_FAULT_SLOTS=1 weren't posted.
  • check_conventions.py passes, with no comment lines added.
  • 1c7d058, a merge of main 0db47b2. The only conflict was two declarations added at the same place in ShaderResources.hpp: this branch's SpirvFaultReportOnly and main's ShaderStoresThroughAddresses, and both are kept. The run linked here before didn't run this PR's tests (its name list matched none of them); the run under cfe7302 below covers this merge's code.
  • cfe7302, a merge of main 2b16484. The only conflict was in tests/BdaResources.cpp, where this branch's faultSlotTests and fix(agc): mirror only unimported tails of registered heaps #8380's partialHeapImportBudgetTests were added at the same place, and both are kept. The PR's added and removed lines are unchanged. On GitHub's runners, 10 runs (run): on Linux, this PR's tests, agc_driver_graphics, agc_driver_bda_device, agc_shader_srt_read_patching, agc_device_fault, agc_bda_staging, agc_driver_bda_reads_shadowed_results and its _per_build run, agc_driver_image_table_vouch_queued_draws and agc_driver_image_table_vouched_lookups, pass, 9 of 9, and so do the 32 other tests built from the changed files: 41 run, 41 pass, 0 skip, 0 fail. On Windows, agc_driver_graphics, agc_shader_srt_read_patching and agc_device_fault pass and the 6 device tests skip without a Vulkan device: 40 run, 33 pass, 7 skip (those 6 and agc_driver_host_import_failure_handles), 0 fail. The libc and libkernel suites pass on both (122 and 204 tests on Linux, 149 and 216 on Windows), run with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners. The run linked here before didn't run this PR's tests, so it's replaced.
  • Validation layer, main against this PR (CONTRIBUTING's AGC rule), on GitHub's Linux runner (llvmpipe, LLVM 20.1.2; run), with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1 and ctest -V. The tests are the existing ones that build on main too, agc_driver_bda_reads_shadowed_results and its _per_build run, agc_device_fault, agc_bda_staging, agc_driver_image_table_vouch_queued_draws, agc_driver_image_table_vouched_lookups and agc_shader_srt_read_patching, with the other tests built from the changed files, once on each tree: 39 run, 39 pass with the change and on main. The loader inserted VK_LAYER_KHRONOS_validation 7 times on each tree, neither log has was not found but was requested, and both report only VUID-VkDeviceCreateInfo-pNext-pNext. This PR adds no VUID- message. The new cases in agc_driver_graphics and agc_driver_bda_device don't build with main's code, so this comparison doesn't cover them.
  • 08392c0, a merge of main facac6a (run). Three conflicts, each resolved by keeping both sides: BdaResources.hpp's include block (fix(agc): share a table's rejection messages instead of copying each #10150's <memory> and this PR's includes); ShaderResources.hpp, where imellag's perf(agc): copy moved draw words into the draw upload ring #11142 removed MovedWordBuffer next to this PR's FaultDescriptor and prepareFaultSlot(), so the merge keeps this PR's members without the removed ones; and docs/dev/ENVIRONMENT.md, with this PR's APS5_NO_SHARED_FAULT_SLOTS row and main's new APS5_NO_SINGLE_PASS_COLLECT text. This PR's added and removed lines are the same, except #include <memory>, which main now has. The 13 tests named above, with the tests for the files the merge changes, pass 10 runs in a row. Linux: 49 run, 49 pass, 0 skip, 0 fail. Windows: 48 run, 38 pass, 10 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (166 and 264). On Windows libc passes (194) and libkernel passes 283 of 286: exec_arguments, guest_timed_join_import_libkernel_sys and guest_timed_join_import_libkernel_web fail at their setup in the verify's Windows build (FileNotFoundError starting the title, or copying the libraries they load), and pass in main's own Windows job at 1829def (job). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 92f08cb, a merge of main d4cb893 (run). The one conflict was docs/dev/ENVIRONMENT.md, where Astronaut10's perf(agc): repeat a draw shape's resident targets and pipeline instead of looking them up again #11696 adds APS5_NO_SHAPE_MEMO on the line where this PR adds APS5_NO_SHARED_FAULT_SLOTS; the merge keeps both rows, in order. This PR's other changed lines are the same. The BDA, fault-buffer, heap-mirror, pipeline-store and draw-state tests of this PR's earlier runs ran 10 times with no failure (each runner builds its own set). Linux: 50 run, 50 pass, 0 skip, 0 fail. Windows: 49 run, 39 pass, 10 skip (the Vulkan device tests), 0 fail. Suites: libc and libkernel pass on Linux (171 and 289). On Windows libc passes (199), and in the job's second attempt libkernel passes 309 of 312: exec_arguments, guest_timed_join_import_libkernel_sys and guest_timed_join_import_libkernel_web fail at their setup in the verify's Windows build (FileNotFoundError starting the title, or copying the libraries they load), with main's code too, and pass in main's own Windows job at 1829def (job). In the first attempt, libkernel's guest_filesystem also aborted, right after it creates its test junctions: its Require(read > 0) after sceKernelOpen(".", O_DIRECTORY) failed while other suite tests removed their folders from the same directory, the Windows directory-listing race that dantdmdarealguy's fix(libkernel): leave out directory entries removed while getdents lists them on Windows #12139 fixes. This PR touches no libkernel or filesystem code, the rerun passed it, and main 04fefeb passes it 20 runs in a row on both runners (run). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 918b1ee, a merge of main 1189ec3, which brings Amoenus's fix(agc): refuse buffer aliases of native MSAA targets #6498 (run, validation run).
    • The conflict: ShaderResources::Bind(), where fix(agc): refuse buffer aliases of native MSAA targets #6498 adds requireGuestBuffers() and this PR adds prepareFaultSlot(). The merge keeps both, the guard first.
    • PrepareDrawBindings merged on its own: fix(agc): refuse buffer aliases of native MSAA targets #6498's requireGuestBuffers(moved) runs before the early return, and this PR's prepareFaultSlot() after it.
    • This PR's added and removed lines are unchanged.
    • Tests, ×10: the last merge's 50 named tests and agc_driver_sample_multisample_target (fix(agc): refuse buffer aliases of native MSAA targets #6498's cases), with the tests for the files the merge changes.
      • Linux: 53 run, 53 pass, 0 skip, 0 fail.
      • Windows: 52 run, 41 pass, 11 skip (no Vulkan device), 0 fail.
      • The libc and libkernel suites run 194 and 294 tests on Linux and 224 and 317 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, llvmpipe (LLVM 20.1.2), Mesa 25.2.8), main 1189ec3 against this head, the same tests:
      • they pass on both arms;
      • the loader inserted VK_LAYER_KHRONOS_validation 14 times on each, and neither log has was not found;
      • both report only VUID-VkDeviceCreateInfo-pNext-pNext, so the merge adds none.
  • d958699, a merge of main 6a691f6, which brings Celegans12's perf(agc): expand an HTILE on the GPU behind a pending mask clear kernel #8105 (run, validation run).
    • The one conflict: the include block of Graphics/src/Recorder.cpp, where perf(agc): expand an HTILE on the GPU behind a pending mask clear kernel #8105 adds DepthSurface.hpp on the line where this PR adds BdaResources.hpp. Both are kept.
    • Merged on their own: seven other files both sides change, BdaResources.hpp/.cpp, ShaderResources.hpp/.cpp, tests/BdaDevice.cpp, tests/BdaResources.cpp and docs/dev/ENVIRONMENT.md. In buildComplete, main's UploadFinish(usesBda, htileClear) sits next to this PR's faultReportOnly constructor calls, and Recorder::finish keeps this PR's BdaResources::NoteFinished.
    • This PR's added and removed lines are unchanged.
    • Tests, ×10: the 42 tests run by agc_driver_bda_device_tests and agc_driver_graphics_tests, the binaries this PR's test files build into, and every ^agc_driver_bda_ test.
      • Linux: 47 run, 47 pass, 0 skip, 0 fail.
      • Windows: 46 run, 39 pass, 7 skip (no Vulkan device), 0 fail. agc_driver_graphics_maps_fallback and agc_heap_mirror_unwatched_import are registered only off Windows.
      • 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 6a691f6 against this head, the same tests:
      • they pass on both arms;
      • the loader inserted VK_LAYER_KHRONOS_validation 7 times on each, and neither log has was not found;
      • both report only VUID-VkDeviceCreateInfo-pNext-pNext, so the merge adds none.
    • On a cloud Linux machine (lavapipe): the 42 tests pass 420 of 420 runs; ctest -R '^(agc|shader)' 1,084 passed, 75 skipped, 0 failed.
  • 38f1f88, oneandonlydean's merge of main 88e804b. The one conflict was Recorder.cpp's include block: this PR's BdaResources.hpp include and main's ReferenceStorage.hpp include, both kept. This PR's diff over main is unchanged. On GitHub's runners (run, on e035452, a merge of the same two commits with the same tree), agc_driver_pipeline_journal and the ^agc_driver_bda and ^agc_bda tests ran 10 times with no failure. Linux: 10 run, 10 pass, 0 skip, 0 fail. Windows: 10 run, 2 pass, 8 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.
  • 972242f, oneandonlydean's merge of main a4eca2a. The one conflict was the variable table in docs/dev/ENVIRONMENT.md, where this PR's APS5_NO_SHARED_FAULT_SLOTS row and Gonic0's APS5_NO_SHARED_GDS row from perf(agc): back the GDS with anonymous shared memory on integrated GPUs and keep its DMA_DATA on the GPU #13159 were added at the same place; the merge keeps both, in alphabetical order. This PR's diff over main is unchanged. On GitHub's runners (run, on e78abd6, our merge of the same two commits with the same tree), agc_driver_pipeline_journal and the ^agc_driver_bda and ^agc_bda tests ran 10 times with no failure. Linux: 10 run, 10 pass, 0 skip, 0 fail. Windows: 10 run, 2 pass, 8 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (235 and 319) and on Windows (262 and 340). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.

Checklist

Every BdaResources made its own host-visible fault buffer (24,620 bytes,
32 KiB from the pool) and kept it for its whole life, cached or not: on
the Village bench some 6,000 fault buffers were 190-199 MiB of the
214-224 MiB host-visible peak.

The fault buffers now come from per-device 512 KiB chunks cut into
FaultBufferBytes slots at minStorageBufferOffsetAlignment. An object
notes the serial of the batch each use is recorded in (when it is bound
and when its writes are marked), and the recorder reports each batch
once its completions ran. When a chunk has no free slot, the arena first
takes back the slots of the older half of the idle holders: those whose
last batch finished and whose slot holds no unread fault report,
written-page claim or SRT guard. Slots are only taken back under the GPU
lock, which uses and fault checks also hold; without it the arena grows
instead. A holder that lost its slot takes one again when it is next
bound and rewrites only its fault descriptor in its own sets, which no
recorded work uses then. A slot in use is never moved, so every report
is read from the slot the shader wrote, exactly as before. A chunk is
freed once none of its slots is held, so no chunk outlives the objects
that used it.

On the Village bench (--cost 20, APS5_PROFILE_DRAW=1, two runs each) the
host-visible peak went from 214.4 and 224.4 MiB to 188.4 and 196.4 MiB,
the fault buffers' part from 189.7 and 198.7 MiB to 161.0 and 169.5 MiB.
Almost every holder there is a draw still in flight, so the gain is the
packing; the reclaim bounds what idle cached objects hold (256 idle
objects keep fewer than 64 slots in the new test).

APS5_NO_SHARED_FAULT_SLOTS=1 gives every object its own buffer for its
whole life as before.
A program that never stores through the BDA table and has no guarded
SRT read writes only the eight-word fault report, yet every fault slot
was FaultBufferBytes (24,620 bytes) for the written-page record and the
SRT guard word. Every BDA build of the Village bench is such a program,
and after the previous change the slots of its draws in flight still
held 161-170 MiB of host-visible memory.

ShaderResources now reads each fault-buffer program's SPIR-V once per
module and binds a 32-byte slot, rounded up to
minStorageBufferOffsetAlignment, when the fault buffer is reached only
through access chains with constant word indices inside the report, and
those chains only by loads, stores and atomics. Anything else (a
computed index, a word past the report, the buffer or a word pointer
handed on) keeps the full slot. The BDA read execution tests have always
bound a 32-byte fault buffer to read programs. A report-only object's
fault check reads only the report: the written-page record and the
guard word are not in its slot, and its program cannot write them.
Report-only and full slots come from separate chunks, and an idle
holder is only taken back for a slot of its own size.

On the Village bench (--cost 20, APS5_PROFILE_DRAW=1, two runs) all
22,000 BDA builds take a report-only slot, and the draws in flight fit
in one 512 KiB chunk: the host-visible peak is 30.4 and 28.4 MiB, from
188.4 and 196.4 MiB after the previous change and 214.4 and 224.4 MiB
before both. The fault buffers are 0.5 of 6.6 and 5.9 MiB of shader
data, from 189.7 of 194.1 and 198.7 of 203.4 MiB.

APS5_NO_SHARED_FAULT_SLOTS=1 still gives every object its own full-size
buffer.
@github-actions github-actions Bot added perf Performance change perf numbers missing perf pull request without a before and after summary line labels Oct 21, 2026
@github-actions

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

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

Pull request Conflicting files (lines on main) Same exports Same new files
PR 9508 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp L57-58, L590, L625
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderAddressResources.cpp L6-8, L13-120
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp L5870, L6017, L6031-6033
core/libs/prx/libSceAgcDriver/tests/BdaContracts.cpp L16-118, L144-158
PR 13159 docs/dev/ENVIRONMENT.md L352

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

Pull request Shared files not compared
PR 1896 docs/dev/ENVIRONMENT.md
PR 4472 docs/dev/ENVIRONMENT.md
PR 5021 core/libs/prx/libSceAgcDriver/tests/BdaDevice.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 6186 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 6192 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6194 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6197 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 6223 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6412 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderAddressResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6804 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6918 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 6924 docs/dev/ENVIRONMENT.md
PR 6970 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7002 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7449 docs/dev/ENVIRONMENT.md
PR 7457 docs/dev/ENVIRONMENT.md
PR 7464 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 7514 docs/dev/ENVIRONMENT.md
PR 7604 docs/dev/ENVIRONMENT.md
PR 7689 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderAddressResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 8004 docs/dev/ENVIRONMENT.md
PR 8246 docs/dev/ENVIRONMENT.md
PR 8484 docs/dev/ENVIRONMENT.md
PR 9012 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 9318 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9345 docs/dev/ENVIRONMENT.md
PR 9356 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 9387 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 9592 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9712 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 9852 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 9884 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9897 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9898 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 10049 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Graphics/include/BdaResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderAddressResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/BdaContracts.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
docs/dev/ENVIRONMENT.md
PR 10249 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 10256 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10442 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
docs/dev/ENVIRONMENT.md
PR 10743 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10757 docs/dev/ENVIRONMENT.md
PR 10894 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 10920 core/libs/prx/libSceAgcDriver/tests/BdaDevice.cpp
PR 11351 docs/dev/ENVIRONMENT.md
PR 11435 docs/dev/ENVIRONMENT.md
PR 11436 docs/dev/ENVIRONMENT.md
PR 11444 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 11901 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 12120 docs/dev/ENVIRONMENT.md
PR 12323 docs/dev/ENVIRONMENT.md
PR 12324 docs/dev/ENVIRONMENT.md
PR 12544 docs/dev/ENVIRONMENT.md
PR 12567 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 12575 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 12746 docs/dev/ENVIRONMENT.md
PR 12863 docs/dev/ENVIRONMENT.md
PR 12930 docs/dev/ENVIRONMENT.md
PR 12944 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 12970 docs/dev/ENVIRONMENT.md
PR 13646 docs/dev/ENVIRONMENT.md
PR 13707 docs/dev/ENVIRONMENT.md
PR 13796 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 13863 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 13920 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 13928 core/libs/prx/libSceAgcDriver/Graphics/include/BdaResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderAddressResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/BdaContracts.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
docs/dev/ENVIRONMENT.md
PR 13929 core/libs/prx/libSceAgcDriver/Graphics/include/BdaResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderAddressResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/BdaContracts.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
docs/dev/ENVIRONMENT.md
PR 13963 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 14032 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 14262 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 14264 docs/dev/ENVIRONMENT.md
PR 14299 docs/dev/ENVIRONMENT.md
PR 14344 docs/dev/ENVIRONMENT.md
PR 14621 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 14943 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 14944 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 15059 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md

@clairtonmichel

Copy link
Copy Markdown

Tested on Fedora Linux (AMD Ryzen 7 9800X3D, RX 7900 XTX, Mesa/RADV).

Clean compile, and out of 875 tests in the AGC/Video suite, 872 passed successfully (99%). However, I caught 3 failures during this run that you might want to look into for this BDA/fault buffer draft:

  • 606 - agc_driver_guest_memory_lifetime (Failed)
  • 614 - agc_driver_image_array_window_past_layer_limit (Failed)
  • 848 - agc_driver_tessellation (SEGFAULT)

Great work on the host memory reduction overall! Let me know if you need any logs re-run for these specific failures.

@EagleBearerYS

Copy link
Copy Markdown
Contributor Author

@clairtonmichel, thanks for running it on the RX 7900 XTX. Two of the three fail on RADV without this PR too:

  • agc_driver_guest_memory_lifetime fails on main on RADV with "guest prefix unmap failed" (#7784).
  • agc_driver_tessellation segfaulted on RADV with Mesa 26.2 and later inside Mesa's nir_opt_varyings (#5444).

agc_driver_image_array_window_past_layer_limit has no report for RADV that I know of.

To tell whether any of them comes from this PR, could you post:

  • your Mesa version;
  • the output of the three tests on this PR's base, main a07e985, built the same way;
  • the same three on this PR's head with APS5_NO_SHARED_FAULT_SLOTS=1, which turns the shared fault buffers off?

If a test fails the same way on main as on this PR's head, it isn't this PR. If it fails only on this PR's head with the shared buffers on, its output line is what we need.

@EagleBearerYS

Copy link
Copy Markdown
Contributor Author

@clairtonmichel, one update on the third: agc_driver_image_array_window_past_layer_limit fails on main on RADV too, in the test's expectation rather than in the driver, and #8969 fixes it. If your failing line reads "thread 7 component 0 is 107.000000/255, expected 147/255", it's that one, and it doesn't need the APS5_NO_SHARED_FAULT_SLOTS=1 run. The main run and your Mesa version still help for the other two.

@clairtonmichel

Copy link
Copy Markdown

Thanks for the guidance! Here is the data from my setup (AMD Ryzen 7 9800X3D, RX 7900 XTX):

Everything matches expected upstream behavior on RADV, confirming your shared fault buffer implementation is clean and introduces no new regressions!

@github-actions github-actions Bot added docs agc libSceAgc* labels Oct 21, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 23, 2026
Keeps both declarations in ShaderResources.hpp: this branch's SpirvFaultReportOnly and main's ShaderStoresThroughAddresses.
@github-actions github-actions Bot removed needs rebase Conflicts with main, rebase needed perf numbers missing perf pull request without a before and after summary line labels Oct 24, 2026
@EagleBearerYS
EagleBearerYS marked this pull request as ready for review October 24, 2026 19:07
@oneandonlydean oneandonlydean self-assigned this Oct 25, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 92f08cb merged onto main ba5b533 · tested 2026-10-29 16:29 UTC · 24 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,210 passed · 4 failed (0 new, 3 also fail on main, 1 unstable on main) · 39 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,253 of 2,891 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (855 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_lazy_resolved_abi_switch_set 30.1 s
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_submit_progress: failed in 3 of the last 5 main runs
Failing on main too (3, not counted against this PR)
agc_compute_pipeline_inspection
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (4 IDs in 404 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (404 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_passes, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_alpha_to_coverage, agc_driver_array_layer_target_cpu, agc_driver_bc_block_copy, and 396 more
VUID-vkCmdCopyImage-srcImage-01548 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, and 3 more
VUID-vkCmdCopyImage-srcImage-01551 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, and 3 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
Skipped (39)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_msaa_dcc_compared_import_2: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_4: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_8: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fresh: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_labels: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SD
Reproduce
git fetch origin 92f08cb9c207dad36b6a5629b622be704c7d9a9a ba5b5330b37724bca4b99f30faab504653635a04
git checkout ba5b5330b37724bca4b99f30faab504653635a04 && git merge --no-ff 92f08cb9c207dad36b6a5629b622be704c7d9a9a
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated 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.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@EagleBearerYS heads-up: #6498 just merged and touches ShaderResources.hpp / ShaderResources.cpp, so this PR now conflicts there. When you merge main, please keep #6498's requireGuestBuffers guard sites alongside your arena change. We'll re-check the merged head and then run the game gate.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 29, 2026
# Conflicts:
#	core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 30, 2026
@EagleBearerYS

Copy link
Copy Markdown
Contributor Author

@oneandonlydean merged. The head is now 918b1ee, a merge of main 1189ec3.

#6498's requireGuestBuffers guard stays at both places this PR calls into:

On GitHub's runners, the BDA, fault-buffer and heap tests and agc_driver_sample_multisample_target ran ×10 (run): 53 of 53 pass on Linux; on Windows 41 pass and 11 skip, since that runner has no Vulkan device. None failed. The validation comparison against main adds no VUIDs (run). It's ready for your re-check and the game gate.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 918b1ee merged onto main 76fd1c0 · tested 2026-10-30 03:02 UTC · 24 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,262 passed · 2 failed (0 new, 2 also fail on main) · 41 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,305 of 2,949 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (861 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_bda_device 58.0 s
Failing on main too (2, not counted against this PR)
guest_mmap_executable
guest_socket_options_multicast
Passed on retry (1, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)
agc_driver_job_manager_compute_capacity: Failed in the parallel run; also passed only on retry in 69 other runs in the last 7 days
Validation IDs already present on main (4 IDs in 390 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (390 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_passes, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_alias_copy_label, agc_driver_array_layer_target_cpu, agc_driver_bda_span_reads_draw_pipeline, and 382 more
VUID-vkCmdCopyImage-srcImage-01548 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, and 3 more
VUID-vkCmdCopyImage-srcImage-01551 (11 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_storage_dispatch, and 3 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (2 tests): agc_driver_prepared_exports, agc_driver_srgb8_color_target
Skipped (41)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_msaa_dcc_compared_import_2: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_4: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_8: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fresh: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or plat
Reproduce
git fetch origin 918b1eeb5dd7cd6aa0c4165d2193a6e6021c8040 76fd1c09e9be0465d50a7431a79d371a5a10abb2
git checkout 76fd1c09e9be0465d50a7431a79d371a5a10abb2 && git merge --no-ff 918b1eeb5dd7cd6aa0c4165d2193a6e6021c8040
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated 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.

EagleBearerYS added a commit to EagleBearerYS/AnyPS5 that referenced this pull request Oct 31, 2026
… fault record

A reused address-based draw build has one fault record, its boykopovar#8963 slot,
and every use of it checked that record when its batch completed. Two
uses in one batch shared it: the first fault was reported by both
completions (the record is never cleared after a report), a second
use's own fault was lost behind it, and each later use reported the old
fault again.

A recorded draw of a space-reuse build now begins a use
(BeginDrawUse), as boykopovar#8971's a581de8 does for dispatches. The first use
in flight takes the build's own record and descriptor sets; a use that
starts while it is taken takes a record of its own, a slot from the
boykopovar#8963 arena (a BdaResources without a table), and sets that repeat the
build's writes with that slot in the fault binding (AllocateRewritten,
through the same writer as the moved-buffer and snapshot sets, which now
take the use's slot too). The use's completion checks its own record
with the build's tables (BdaResources::CheckUse) and clears it, so a
fault is reported once, by the use that made it, and the next use of the
record starts clean. The record returns to the arena, and the build's own
record is released, when the use ends.

Builds whose stages store through addresses are still never reusable
(NeverReusable), so their single use keeps the build's record.

agc_driver_address_draw_space_reuse's fault-per-use case runs pairs of
uses of one build in a batch, each through its own pointer: a faulting
use before a clean one and after one, two faulting uses, and two clean
uses after them. Each fault is reported once at its own address and the
clean pair reports none. On the previous commit the first pair reports
its fault twice; with every use on the build's own record the second
fault of the faulting pair is never reported.
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 31, 2026
EagleBearerYS added a commit to EagleBearerYS/AnyPS5 that referenced this pull request Oct 31, 2026
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 31, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head d958699 merged onto main 828ac0b · tested 2026-10-31 10:40 UTC · 24 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,321 passed · 4 failed (0 new, 2 also fail on main, 2 unstable on main) · 41 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,366 of 3,048 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (866 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_bda_device 53.9 s, ⚠️ agc_driver_graphics_maps_fallback 33.0 s, ⚠️ agc_driver_graphics 32.1 s
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)
agc_submit_progress: failed in 6 of the last 10 main runs
agc_submit_progress_no_timeline: failed in 8 of the last 10 main runs
Failing on main too (2, not counted against this PR)
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (3 IDs in 384 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (384 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_passes, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, and 376 more
VUID-vkCmdCopyImage-srcImage-01548 (12 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_sampling, and 4 more
VUID-vkCmdCopyImage-srcImage-01551 (12 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_sampling, and 4 more
Skipped (41)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_msaa_dcc_compared_import_2: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_4: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_8: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fresh: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_labels: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is eithe
Reproduce
git fetch origin d958699e8b7cb503f83ab6f3031340e349c0a4e1 828ac0b2ae74aac181ba128fb59b08a1534f2041
git checkout 828ac0b2ae74aac181ba128fb59b08a1534f2041 && git merge --no-ff d958699e8b7cb503f83ab6f3031340e349c0a4e1
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated 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.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 2, 2026
# Conflicts:
#	core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 2, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 38f1f88 merged onto main 88e804b · tested 2026-11-02 12:38 UTC · 24 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,495 passed · 6 failed (0 new, 3 also fail on main, 3 unstable on main) · 45 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,546 of 3,234 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (970 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s, ⚠️ agc_driver_lookup_log_fits_build 35.7 s, ⚠️ agc_driver_graphics_maps_fallback 30.8 s, ⚠️ agc_driver_graphics 30.1 s
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 2 of the last 10 main runs
agc_submit_progress: failed in 8 of the last 10 main runs
agc_submit_progress_no_timeline: failed in 8 of the last 10 main runs
Failing on main too (3, not counted against this PR)
agc_driver_image_table
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (4 IDs in 495 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (495 tests): agc_driver, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, and 487 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkShaderModuleCreateInfo-pCode-08737 (1 test): agc_driver_image_sample_derivatives
Skipped (45)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_dcc: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_deferred: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fps_limit: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_o
Reproduce
git fetch origin 38f1f885edcf9622dd2174d8ec8d699639f5c91d 88e804b0a7df1f1ac373a9e2f72fb378d925fdd4
git checkout 88e804b0a7df1f1ac373a9e2f72fb378d925fdd4 && git merge --no-ff 38f1f885edcf9622dd2174d8ec8d699639f5c91d
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated 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.

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Nov 2, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 972242f merged onto main 9090972 · tested 2026-11-03 03:34 UTC · 35 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,638 passed · 5 failed (0 new, 2 also fail on main, 3 unstable on main) · 44 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,687 of 3,607 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (974 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s, ⚠️ agc_driver_graphics_maps_fallback 31.1 s
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 3 of the last 10 main runs
agc_submit_progress: failed in 7 of the last 10 main runs
agc_submit_progress_no_timeline: failed in 6 of the last 10 main runs
Failing on main too (2, not counted against this PR)
agc_driver_image_table
guest_socket_options_multicast
Validation IDs already present on main (4 IDs in 517 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (517 tests): agc_driver, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, and 509 more
VUID-vkCmdCopyImage-srcImage-01548 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (7 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_sampling, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_prepared_exports
Skipped (44)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_backtoback: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_dcc: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_deferred: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fps_limit: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fresh: skipped, no display or Vulkan device: 
Reproduce
git fetch origin 972242f204f759432cf6c56636455b4cc4db08c4 9090972b7e91fd266819cbd77a8b058e177b5682
git checkout 9090972b7e91fd266819cbd77a8b058e177b5682 && git merge --no-ff 972242f204f759432cf6c56636455b4cc4db08c4
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated 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.

@oneandonlydean
oneandonlydean merged commit fe69769 into boykopovar:main Nov 3, 2026
14 checks passed
oneandonlydean pushed a commit that referenced this pull request Nov 4, 2026
… fault record

A reused address-based draw build has one fault record, its #8963 slot,
and every use of it checked that record when its batch completed. Two
uses in one batch shared it: the first fault was reported by both
completions (the record is never cleared after a report), a second
use's own fault was lost behind it, and each later use reported the old
fault again.

A recorded draw of a space-reuse build now begins a use
(BeginDrawUse), as #8971's a581de8 does for dispatches. The first use
in flight takes the build's own record and descriptor sets; a use that
starts while it is taken takes a record of its own, a slot from the
#8963 arena (a BdaResources without a table), and sets that repeat the
build's writes with that slot in the fault binding (AllocateRewritten,
through the same writer as the moved-buffer and snapshot sets, which now
take the use's slot too). The use's completion checks its own record
with the build's tables (BdaResources::CheckUse) and clears it, so a
fault is reported once, by the use that made it, and the next use of the
record starts clean. The record returns to the arena, and the build's own
record is released, when the use ends.

Builds whose stages store through addresses are still never reusable
(NeverReusable), so their single use keeps the build's record.

agc_driver_address_draw_space_reuse's fault-per-use case runs pairs of
uses of one build in a batch, each through its own pointer: a faulting
use before a clean one and after one, two faulting uses, and two clean
uses after them. Each fault is reported once at its own address and the
clean pair reports none. On the previous commit the first pair reports
its fault twice; with every use on the build's own record the second
fault of the faulting pair is never reported.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs perf Performance change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants