Skip to content

perf(agc): keep device buffers placed in host memory for reuse while the device heap is full - #8748

Merged
oneandonlydean merged 6 commits into
boykopovar:mainfrom
LeandroLP23:perf/agc-pool-host-placed-device-buffers
Nov 3, 2026
Merged

oneandonlydean merged 6 commits into
boykopovar:mainfrom
LeandroLP23:perf/agc-pool-host-placed-device-buffers

Conversation

@LeandroLP23

@LeandroLP23 LeandroLP23 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What

When a device buffer doesn't fit in the budget VK_EXT_memory_budget reports for the device-local heap, DeviceMemoryType places it in host memory (d04e983). On release such a buffer was freed rather than pooled, so that host memory would never be handed out as device memory later. That keeps placement right, but while the heap stays over budget, every request allocates host memory again and frees it on release.

An APU with the common 512 MiB carve-out is always in that state. On a Radeon 860M (device-local heap 512 MiB, budget 486 MiB) the heap reports 512/486 MiB from the menu on. SuperTuxKart's tutorial race placed 8192 buffers in host memory per run, about 97–102 GiB, nearly all of them 8 MiB. A discrete GPU whose VRAM sits at its budget takes the same path.

  • A host-placed device buffer is now released into the device tier under its own key: hostPlaced, a new field of BufferAllocation and of the pool's slot key.
  • DeviceBuffer asks for a device-local slot first. Only on a miss does it take a host-placed slot. It keeps that slot only when Context::DeviceLocalFits says a new allocation would not fit the device-local heap either; otherwise it puts the slot back and allocates as before. So a buffer gets device-local memory whenever the reported budget has room for it, and the budget is read only when a host-placed slot is there to take.
  • A matching host-placed slot is taken without first asking the texture caches to release room. DeviceMemoryType asks them before a new host placement (since e2c1c305ff), but on a heap that stays over budget, a release for every such request would move the churn into the texture caches. A new allocation, with no host-placed slot to take, still asks the caches first. HostSlotBeforeCacheRelease pins both. This order was not measured in a title: the captures below predate e2c1c305ff.
  • DeviceLocalFits and DeviceMemoryType share one budget read (Context::ReportedHeap) and its fit test; only DeviceMemoryType goes on to the texture-cache release.
  • Host-placed slots count against the device tier's budget and are evicted and trimmed like any other slot.

Tested

Head 28f80c25a9 on main aaccd0ba39.

  • agc_buffer_pool passes. HostPlacement and RefusedDevicePlacement check three things: a host-placed buffer is kept after release; it is reused while the device-local heap has no room; and a request that fits gets device-local memory, not the retained host memory. With Resources.cpp from main, the first two checks fail.
  • HostSlotBeforeCacheRelease (head d845d4bfc5, on main 4f41f4c375) retains a host-placed buffer, then sets a texture-cache release that would free any amount: the next request of that size takes the retained buffer without calling it, and a new request of another size calls it once and gets device-local memory. With the probe in Resources.cpp changed to try the release before taking the slot, all three checks fail. agc_buffer_pool, its two small-device modes, the three agc_memory_accounting tests and agc_device_memory_fallback pass, 7/7, on the Radeon 860M laptop (Windows 11, WinLibs GCC, Release).
  • ctest -R "buffer|pool|resources|device_memory|host_placement|budget" with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation: 76/76 pass on Windows 11, i5-10600K, RTX 5060 Ti (driver 621.01), WinLibs GCC 15.2.0, Release.
  • SuperTuxKart (PPSA69421) tutorial race on a Radeon 860M (1002:1114, 512 MiB carve-out, driver 32.0.13058.8001), Windows 11 26300, APS5_TRACE_SECONDS=95:20, main and this head alternating in one session. Summary lines, traces and tools/trace_digest.py output for every run are in this comment.
Tree Runs FPS Device buffers placed in host memory per run
main aaccd0ba39 2 7.69, 10.44 8192+ (at least 53–58 GiB)
this PR 28f80c25a9 3 11.78, 8.29, 11.61 3 (48 MiB)

The change removes the host-memory allocation churn. On current main the frame rate difference is within run-to-run spread: both trees fall into the same two modes, about 27 and 44 ms of GPU time per present. An earlier comparison on ec7eacc62, where the race ran at about 2.5 FPS, gave 2.47 FPS on main and 2.94 with this change; that gain does not reproduce on current main.

Overlap. #6553 changes the body of DeviceMemoryType (host heap selection), so the two conflict textually there, not in what they do. #4472 stops pooling device buffers while the device-local heap is over budget. On a 512 MiB carve-out that is always the case, so as written it would drop these host-placed slots too and bring the churn back. They hold no device-local memory, so I think they could be left out of that check. tools/pr_overlap.py found no other overlap among the PRs it could compare.

Idle device reclaim (#8672). ReclaimIdleDevice now skips host-placed slots. They live in deviceTier, but their memory is on the host heap. IdleReclaimSkipsHostPlaced retains an older host-placed slot and a younger device-local slot, and checks that the reclaim frees and counts only the device-local one. Without the skip it fails. agc_buffer_pool and its two small-device modes pass, 3/3.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: AMD Radeon 860M, driver 32.0.13058.8001, Windows 11 26300; NVIDIA RTX 5060 Ti, driver 621.01, Windows 11
  • AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added perf Performance change perf numbers missing perf pull request without a before and after summary line labels Oct 20, 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.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the allocation-selection and pool-key changes plus the host-placement regression cases. The device-local pool is still preferred; a retained host-placed slot is reused only after a fresh budget check says a new device-local allocation would not fit, and the tests assert both reuse under pressure and device-local selection once the budget allows it. The PR includes paired same-machine SuperTuxKart captures and reports the buffer-allocation drop from 8,192 placements to 5. Eligibility, conventions, intake, labels, and report checks pass; hosted platform/runtime jobs are skipped, and the author notes the Khronos validation layer was unavailable.

@github-actions

github-actions Bot commented Oct 20, 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 14815 core/libs/prx/libSceAgcDriver/tests/BufferPool.cpp L1480

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 4472 core/libs/prx/libSceAgcDriver/Graphics/include/BufferPool.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/BufferPool.cpp
core/libs/prx/libSceAgcDriver/tests/BufferPool.cpp
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
PR 6553 core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
core/libs/prx/libSceAgcDriver/tests/BufferPool.cpp
PR 6804 core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
PR 7275 core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/include/BufferPool.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/BufferPool.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Resources.cpp
PR 9356 core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
PR 9387 core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
PR 9712 core/libs/prx/libSceAgcDriver/Graphics/include/BufferPool.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/BufferPool.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Resources.cpp
core/libs/prx/libSceAgcDriver/tests/BufferPool.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Graphics/include/BufferPool.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/BufferPool.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Resources.cpp
PR 11444 core/libs/prx/libSceAgcDriver/Graphics/src/Resources.cpp
PR 12120 core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
PR 13148 core/libs/prx/libSceAgcDriver/Graphics/src/BufferPool.cpp
PR 13646 core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
PR 13863 core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Resources.cpp
PR 13920 core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Resources.cpp
PR 13928 core/libs/prx/libSceAgcDriver/Graphics/include/BufferPool.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/BufferPool.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Resources.cpp
PR 13929 core/libs/prx/libSceAgcDriver/Graphics/include/BufferPool.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/BufferPool.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Resources.cpp
PR 14943 core/libs/prx/libSceAgcDriver/Graphics/src/Resources.cpp

@github-actions github-actions Bot added the agc libSceAgc* label Oct 21, 2026
@LeandroLP23
LeandroLP23 force-pushed the perf/agc-pool-host-placed-device-buffers branch from 8a45597 to d1ce2c5 Compare October 21, 2026 06:36
@github-actions github-actions Bot removed the perf numbers missing perf pull request without a before and after summary line label Oct 21, 2026
@LeandroLP23

LeandroLP23 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor Author

SuperTuxKart race data with the rest of the STK fixes underneath. This PR removes the device-buffer churn that is left once the storage round trip and the label waits are gone.

Setup.

tree FPS p50 / p90 / p99 ms GPU busy per present device buffers placed in host memory (whole run)
base 10.19 89.1 / 129.1 / 160.9 35.1 ms 4096, 31506 MiB
base 9.55 95.6 / 132.4 / 165.9 36.1 ms 8192, 48524 MiB
base + this PR 10.46 87.7 / 122.0 / 162.0 33.9 ms 32, 118 MiB
base + this PR 10.68 87.3 / 114.9 / 151.3 31.0 ms 32, 118 MiB

The frame rate gain is small, 5 to 10 %. What the PR removes shows on the draw committer: one run per side with APS5_PROFILE_DRAW=1, a 10 s window in the race.

per 10 s base base + this PR
recorded draw, average 356 us 242 us
keep 585.9 ms 56.4 ms
readTarget 1606.6 ms 1137.7 ms

On the base, the committer is the busiest thread. Sampling it puts about 19 % of its time inside the driver under BufferPool::AllocateMemory, in D3DKMTCreateAllocation / FreeGpuVirtualAddress, through DeviceBuffer::DeviceBuffer. With this PR, the placed allocations drop to 32 for the whole run. The busiest thread is then the title's own: about 64 % of its samples are in sceKernelUsleep, waiting for GPU work. So the committer is no longer what bounds the race.

Traces and summary lines: pr8748-race-traces.

@Lander0606

Copy link
Copy Markdown
Contributor

Linux (RADV) run on the same chip as the description: head d1ce2c5127 against its base 65c393a684, without merging onto current main.

Setup

  • Radeon 860M (Ryzen AI 7 350, 1002:1114, RADV KRACKAN1), Mesa 26.2.5, Vulkan 1.4.354, Fedora 44, kernel 7.2.11.
  • Built in an Ubuntu 24.04 container with GCC 13.3, Release, BUILD_TESTING=ON, ANYPS5_ENABLE_SPIRV_TOOLS=ON. The tests ran on the Fedora host, with VK_DRIVER_FILES limited to RADV.
  • ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest -j1 -V -R "buffer|pool|resources|device_memory|host_placement|budget" (53 tests on this platform), three runs without and three with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (1.4.341).
Without the layer With the layer
base 65c393a684 53/53, 53/53, 53/53 53/53, 53/53, 53/53
this PR d1ce2c5127 53/53, 53/53, 53/53 53/53, 53/53, 53/53
  • agc_buffer_pool, with this PR's HostPlacement and RefusedDevicePlacement checks, passes on the head.
  • Validation: the loader inserted VK_LAYER_KHRONOS_validation 30 times in each run (VK_LOADER_DEBUG=layer). No log contains was not found but was requested by env var VK_INSTANCE_LAYERS, and neither side logs a VUID- line.
  • Coverage: RADV reports this 860M differently from AMD's Windows driver. Heap 1 is device-local with 10795.2 MiB and heap 0 is a 5397.6 MiB host heap, so the full 512 MiB device-local heap this PR targets is not what this machine reports. These runs show no regression and clean validation on RADV; they do not reach the over-budget path in a title, and I ran no title.

@mrfelek

mrfelek commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Data point for the Linux APU case: Radeon 780M, RADV, Mesa 26.0.8, upstream main 853baf3 with this PR (d1ce2c5) on top. Diablo II: Resurrected and Hot Wheels Unleashed (garage), two alternating pairs each against main.

The host-placement path never fired: 0 host placements in every run. The device heap peaked at ~1290 of 1324 MiB on D2R and never overflowed; on Hot Wheels the device tier sat at ~752-758 of 768 MiB and was reclaimed instead. Frame rates were the same as main (Hot Wheels 3/3 presents per 10 s in all four runs; D2R within its run-to-run noise). No new errors.

So no regression on this setup, but also no coverage of the code path itself. A title that actually overflows the device heap on an APU would be needed for that.

This comment was written with help from Claude (AI).

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@LeandroLP23 This now merges cleanly with the idle-device reclaim code from #8672, but ReclaimIdleDevice in the resulting BufferPool.cpp does not skip allocation.hostPlaced. Those retained slots live in deviceTier while their memory belongs to the host heap. An old host-placed slot can therefore satisfy the requested reclaim byte count, leave idle device-local slots untouched, and report device memory released when none was freed. Please exclude hostPlaced allocations from this scan and add a composition regression with an older host-placed slot and a younger idle device-local slot, checking that reclaim preserves the former and frees/counts the latter. The current IdleDeviceReclaim test's host allocation uses Buffer rather than a host-placed DeviceBuffer, so it does not cover this case.

@LeandroLP23
LeandroLP23 force-pushed the perf/agc-pool-host-placed-device-buffers branch from d1ce2c5 to 70a183e Compare October 25, 2026 09:58
@LeandroLP23

Copy link
Copy Markdown
Contributor Author

@oneandonlydean thanks, confirmed and fixed in 70a183ef7f (rebased onto main da6c581a02). The ReclaimIdleDevice scan now skips allocation.hostPlaced next to buffer == VK_NULL_HANDLE and slab. Free lists are keyed by hostPlaced, so each list it looks at holds only one kind.

The new IdleReclaimSkipsHostPlaced builds what you described with the budget mock. A 176 MiB DeviceBuffer over the reported budget is placed in the host memory type and released first. Then a 4 MiB DeviceBuffer within the budget goes to device-local memory and is released after it. After a complete idle interval, ReclaimIdleDevice(1 MiB) must return 4 MiB, free the device-local memory and keep the host-placed memory. Without the new condition it fails with idle device reclaim counted a host-placed buffer as device memory and idle device reclaim freed the host-placed buffer instead of the idle device-local one. With it, agc_buffer_pool, _small_device_shared and _small_device_no_staging pass (3/3) on Windows 11, Radeon 860M, GCC 15.2. These are mock-device tests, so no Vulkan validation applies.

AI-assisted: yes (Claude Code)

@JulesB40

Copy link
Copy Markdown
Contributor

Note

🤖 Claude Opus 5.5 responding on behalf of JulesB40

On Windows + NVIDIA (Ada), head 70a183ef7f merged onto main d4cb89300f matches that main exactly across all 1,125 agc_ tests: same passes, same skips, same VUID- lines.

Setup: Windows 11 Home 10.0.26200, Intel Core i9-13900HX, NVIDIA GeForce RTX 4070 Laptop GPU (0x2860), driver 616.92, Vulkan SDK 1.4.335 (VK_LAYER_KHRONOS_validation), WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. Both sides were built in the same tree; the merge (e4d72c377, local only) applied cleanly.

Command, the same on both sides:

ANYPS5_GPU=4070 ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^agc_' -j 6
Passed Failed Skipped VUID- lines Missing-layer lines
main d4cb89300f 1117 0 8 18 0
this PR merged 1117 0 8 18 0

No title was run.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 70a183e merged onto main 52c09d5 · tested 2026-10-29 09:06 UTC · 42 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,202 passed · 6 failed (0 new, 5 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,247 of 2,873 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 (857 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) none
Intermittent validation messages (1, seen once in the parallel run, not reproduced when the test was re-run alone 2 times; not counted against this PR)
agc_driver_depth_clear_hle: VUID-vkCmdCopyBuffer-commonparent (6x)
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 2 of the last 4 main runs
Failing on main too (5, not counted against this PR)
agc_compute_pipeline_inspection
agc_submit_progress
agc_submit_progress_no_timeline
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_depth_clear_hle: SEGFAULT in the parallel run; also passed only on retry in 14 other runs in the last 7 days
Validation IDs already present on main (4 IDs in 407 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (407 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 399 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 70a183ef7f82308f6f5e1dfba6f6b6ab2c29066f 52c09d567d2fa453494dd720fcf53a98149468e4
git checkout 52c09d567d2fa453494dd720fcf53a98149468e4 && git merge --no-ff 70a183ef7f82308f6f5e1dfba6f6b6ab2c29066f
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.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-check — changes requested\n\nThe additional ReclaimIdleDevice change and IdleReclaimSkipsHostPlaced test address the accounting issue: reclaim now skips host-placed slots instead of freeing host memory while reporting it as released device memory. The new NVIDIA report on head 70a183e is useful broad coverage, but it is not a comparison against current main and does not repeat the title performance measurement.\n\nThe branch is based on acbfd7c, and current main is aaccd0b. Main has changed all five PR paths since that base: BufferPool.hpp/cpp, Context.hpp, Resources.cpp and BufferPool.cpp tests. Please rebase onto current main, preserve the device-local-first/host-fallback budget behavior and the reclaim regression, then rerun agc_buffer_pool and the focused memory-budget tests on the exact updated head. Because this is labeled perf, refresh the same-machine SuperTuxKart main/change captures, summary lines, traces and digests after the integration as well. I did not run local tests or GPU captures.

@LeandroLP23
LeandroLP23 force-pushed the perf/agc-pool-host-placed-device-buffers branch from 70a183e to 28f80c2 Compare October 29, 2026 11:46
@LeandroLP23

Copy link
Copy Markdown
Contributor Author

@MarcZX10 thanks for the re-check. I rebased this onto main aaccd0ba39 with no conflicts. The new head is 28f80c25a9. Device-local-first selection, the host fallback and IdleReclaimSkipsHostPlaced are unchanged.

I ran the focused tests on that exact head:

  • Command: ctest -R "buffer|pool|resources|device_memory|host_placement|budget" with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (Vulkan SDK 1.4.363).
  • Result: 76/76 pass, including agc_buffer_pool, agc_buffer_pool_small_device_shared, agc_buffer_pool_small_device_no_staging, agc_device_memory_fallback and guest_agc_driver_resources.
  • Machine: Windows 11, i5-10600K, RTX 5060 Ti (driver 621.01), WinLibs GCC 15.2.0, Release.

I don't have the SuperTuxKart main/change captures on current main yet. They need the 860M with its 512 MiB carve-out. The 5060 Ti never goes over its device-local budget in that race, so the path this PR changes doesn't run there. I'll post both summary lines, traces and trace_digest.py output when I have alternating pairs from that machine.

AI-assisted: yes (Claude Code)

@MarcZX10

Copy link
Copy Markdown
Contributor

Re-checked — new head, changes still requested

The focused tests now cover the updated head, but the required matched performance report for the current main/change pair is still outstanding.

What I ran

  • Reviewed exact head 28f80c25a9b466b067a3c3b9bbbd504d548e0376 and the author’s 12:20 UTC update.
  • Ran git merge-tree --write-tree upstream/main refs/remotes/upstream/pr/8748-check-20261029 against current main 5454cd2e455994d992aca39335ce60507eeda1eb; it is clean, tree 8417bf473497a1fd27ed5e26ecd9f48eab392e28.
  • Ran git diff --check upstream/main...refs/remotes/upstream/pr/8748-check-20261029; exit 0, no output.
  • Compared the five changed source/test paths between the author's rebase base aaccd0ba39 and current main; no differences in those paths.
  • Read the reported exact-head focused test results and refreshed hosted checks. I did not run the GPU tests or performance captures locally.

Results

Check Result
Current-main merge preview Clean
Diff check Passed
Focused tests on exact head Author reports 76/76 pass on Windows 11, i5-10600K, RTX 5060 Ti; useful for correctness, but that GPU does not exercise the over-budget host-placement path
Hosted eligibility, conventions, labels, report, and Windows Passed
Hosted Linux and specialized product jobs Skipped
Required performance A/B report Still outstanding for current main and the change on the Radeon 860M / SuperTuxKart scene
Unedited local command output
8417bf473497a1fd27ed5e26ecd9f48eab392e28
240	2

git diff --check produced no output and exited 0.

Findings

Blocking

  • Current-main performance evidence is missing. The report in the PR body compares older commits ec7eacc62d58 and d1ce2c51278f; the current PR head is 28f80c25a9b4, and no paired summary lines, traces, or tools/trace_digest.py output for current main and this head are posted. The 5060 Ti focused test run does not exercise the reported 512 MiB over-budget reuse path. Please post the matched current-main/change captures from the Radeon 860M setup, including both summary lines, trace attachments, and digest output.

Non-blocking

  • The exact-head focused test report addresses the test rerun request. The current-main rebase also merges cleanly, and I found no changes to the five changed source/test paths between aaccd0ba39 and current main.

Sources

Not verified

I did not independently run the focused tests, the Radeon 860M capture pair, traces, or digests. Hosted Linux and specialized product checks were skipped.

To get this to a good state

Please add the current-main/change performance artifacts described above. I’ll rerun the same merge and diff checks and re-review the report when they are posted.

@XairRrR XairRrR left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — approved

Head 28f80c25a9 merges cleanly onto current main, builds, and passes the focused buffer-pool and device-memory tests with the Khronos validation layer active and no VUID- lines on either side; the new agc_buffer_pool checks fail when the production files are reverted to main.

What I ran

  • Head: 28f80c25a9b466b067a3c3b9bbbd504d548e0376
  • main: 5454cd2e455994d992aca39335ce60507eeda1eb (merge base of the branch: aaccd0ba39)
  • Arch Linux 7.2.11-zen, GCC 16.2.1, Release, Ninja, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), in a clean worktree.
git fetch origin main pull/8748/head:refs/review/8748
git checkout --detach origin/main
git merge --no-ff --no-edit refs/review/8748
git diff --check origin/main...refs/review/8748
python3 tools/check_conventions.py --base origin/main

cmake --build build -j10 --target agc_buffer_pool_tests agc_device_memory_fallback_tests \
  guest_agc_driver_resources_tests agc_driver_many_buffers_tests agc_driver_pooled_buffer_range_tests \
  agc_driver_graphics_tests agc_static_buffer_tests agc_driver_buffer_load_store_tests \
  agc_driver_depth_plane_buffer_memory_tests agc_driver_recorder_tests agc_driver_sparse_buffer_holes_tests libs

VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \
VK_LOADER_DEBUG=error,warn,layer ctest --test-dir build -j4 -V --output-on-failure -R \
  '^(agc_buffer_pool|agc_buffer_pool_small_device_shared|agc_buffer_pool_small_device_no_staging|agc_device_memory_fallback|guest_agc_driver_resources|agc_driver_many_buffers|agc_driver_pooled_buffer_range|agc_pipeline_store_lazy_buffer_pool|agc_static_buffer|agc_driver_buffer_load_store|agc_driver_depth_plane_buffer_memory|agc_storage_written_buffer_order|agc_driver_sparse_buffer_holes)$'

# same build targets and ctest command on origin/main, then back to the merged tree

Results

Check Result
Merge onto main Clean
git diff --check Clean
tools/check_conventions.py --base origin/main All conventions checks passed.
Build of the targets above and libs (merged tree) OK, no warnings
Focused tests, merged tree, with validation 13/13 passed
Focused tests, main, with validation 13/13 passed
VUID- lines 0 on main, 0 on the merged tree
was not found but was requested by env var VK_INSTANCE_LAYERS Absent from both logs; the loader inserted VK_LAYER_KHRONOS_validation 6 times in each run (the GPU tests in the set)
GPU used by the GPU tests NVIDIA GeForce RTX 4070 Ti SUPER, 10de:2705, driver 615.78.08
Test duration agc_buffer_pool 0.38 s; whole set 1.32 s
Merged tree, ctest summary
1/13 Test  #763: agc_buffer_pool_small_device_no_staging ...   Passed    0.00 sec
2/13 Test  #762: agc_buffer_pool_small_device_shared .......   Passed    0.00 sec
3/13 Test  #674: agc_static_buffer .........................   Passed    0.00 sec
4/13 Test  #765: agc_device_memory_fallback ................   Passed    0.00 sec
5/13 Test  #761: agc_buffer_pool ...........................   Passed    0.38 sec
6/13 Test  #804: agc_storage_written_buffer_order ..........   Passed    0.54 sec
7/13 Test #1343: agc_driver_pooled_buffer_range ............   Passed    0.25 sec
8/13 Test #1014: agc_driver_depth_plane_buffer_memory ......   Passed    0.94 sec
9/13 Test #1581: agc_pipeline_store_lazy_buffer_pool .......   Passed    0.00 sec
10/13 Test #1765: guest_agc_driver_resources ................   Passed    0.00 sec
11/13 Test #1416: agc_driver_sparse_buffer_holes ............   Passed    0.23 sec
12/13 Test  #981: agc_driver_buffer_load_store ..............   Passed    1.09 sec
13/13 Test #1268: agc_driver_many_buffers ...................   Passed    0.90 sec
100% tests passed out of 13

Negative control

  1. Restored BufferPool.hpp, Context.hpp, BufferPool.cpp and Resources.cpp from main and kept the PR's tests/BufferPool.cpp. agc_buffer_pool fails; the two small-device modes still pass:

    FAIL: a device buffer placed in host memory was not kept in the pool after its release
    FAIL: a device buffer over the device-local budget did not reuse the retained host-placed buffer
    FAIL: idle device reclaim freed the host-placed buffer instead of the idle device-local one
    
  2. On the merged tree, removed only the slot.allocation.hostPlaced || condition from ReclaimIdleDevice. agc_buffer_pool fails:

    FAIL: idle device reclaim counted a host-placed buffer as device memory
    FAIL: idle device reclaim freed the host-placed buffer instead of the idle device-local one
    

    This confirms the author's report on the #8672 composition, which oneandonlydean raised.

Both changes were restored afterwards.

Findings

Blocking

None.

Non-blocking

  1. A host-placed slot that is probed and refused is re-inserted as the newest slot. Resources.cpp L166-L172 puts the slot back with cache->Put(*pooled) when DeviceLocalFits says device memory is available. Put gives it a fresh lastUse (++clock, BufferPool.cpp L578), and Take has already counted the probe in ++tier.hits (BufferPool.cpp L409-L426). Once the heap is back under budget, a host-placed slot holds host memory that the pool will not hand out while device memory fits. Each refused probe also makes that slot the youngest in the device tier. evictOldest then drops reusable device-local slots of other keys before it, and ReclaimIdleDevice skips it by design. The APS5_PROFILE_DRAW device-tier hit count also includes these refused probes. Suggested fix: when the probe is refused, destroy the slot rather than putting it back, because device memory fits and the host copy is the wrong placement. Alternatively, re-insert it with its original lastUse and leave hits uncounted.

  2. DeviceLocalFits does not check exactly what the fresh path checks. The probe calls DeviceLocalFits(~0u, capacity). The fresh allocation it competes with uses DeviceMemoryType(requirements.memoryTypeBits, ClassAllocationBytes(requirements, capacity), ...) (Resources.cpp L200-L210). With ~0u, MemoryType can pick a device-local type the buffer cannot use. The size also lacks the alignment rounding. On the usual single device-local heap these agree. In the edge case, a request just at the budget boundary passes over the host slot, then gets host memory anyway from a new allocation. The description says both decisions use "the same rule", and that holds only approximately. Passing the slot's alignment-rounded allocationBytes would make the two match exactly.

  3. The GPUs tested line does not match the validation evidence. The checklist names only the Radeon 860M, where the description says the Khronos validation layer is not installed. The author's later run with validation on head 28f80c25a9 used an RTX 5060 Ti and covered only the change, not main. CONTRIBUTING asks for the same focused tests on main and the change with the layer, with each GPU named on that line. The comparison above on the RTX 4070 Ti SUPER, and the earlier ones by JulesB40 and the NVIDIA CI comment, show no new VUID- lines, so I do not treat this as blocking. Adding the 5060 Ti, and a main run on it, to the description would close it.

  4. Overlap with #4472, as the description already says: #4472 stops pooling device buffers while the device-local heap is over budget. Whichever lands second has to exempt hostPlaced slots, or the churn this PR removes comes back on 512 MiB carve-outs. Agreeing the order with that author, and noting it under Depends on if needed, would help.

Not verified

  • The performance claim. I have no APU with a small device-local carve-out. On this machine the device-local heap never goes over budget, so the host-placement path only runs in the mock tests. The description's summary lines and traces are for head d1ce2c51278f against main ec7eacc62, not the current head. MarcZX10 asked for a refresh on current main, and the author says that is pending. The code behind the measured path is the same apart from the reclaim skip, but I have not reproduced the numbers.
  • Windows and AMD drivers, and any title. I ran no title.
  • The full test suite; only the 13 focused tests above.

@TechLevelZero

TechLevelZero commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 28f80c2 merged onto main ba5b533 · tested 2026-10-29 16:50 UTC · 29 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,215 passed · 3 failed (0 new, 3 also fail 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,257 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 (857 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) none
Failing on main too (3, not counted against this PR)
agc_compute_pipeline_inspection
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 39 other runs in the last 7 days
Validation IDs already present on main (4 IDs in 406 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (406 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 398 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 28f80c25a9b466b067a3c3b9bbbd504d548e0376 ba5b5330b37724bca4b99f30faab504653635a04
git checkout ba5b5330b37724bca4b99f30faab504653635a04 && git merge --no-ff 28f80c25a9b466b067a3c3b9bbbd504d548e0376
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.

@blawesom

Copy link
Copy Markdown
Contributor

Static review plus an independent Linux/AMD run on both trees per the repo AGENTS AGC protocol (CachyOS, kernel 7.2.10, GCC 16.2.1, Ninja 1.13.2, Release, BUILD_TESTING=ON, Ryzen 7 9800X3D). No findings in the change itself; the overlap note at the end is worth addressing before merge.

What I checked (static)

  • BufferAllocation and BufferPool::SlotKey grow a hostPlaced discriminator: when Context::DeviceMemoryType falls back to host memory because the reported device-local heap is over budget, the allocation is now tagged and looked up by exact key (added to the slot hash at bit 63, distinct from the device-local keys), so a host-placed buffer never crosses into the device-local free list and vice versa.
  • ReclaimIdleDevice's eviction scan skips slot.allocation.hostPlaced entries: reclaiming a host-placed buffer frees no device VRAM, so retaining it is pure win — the perf claim in the PR body follows directly from this line.
  • DeviceBuffer::release() returns both kinds to the pool (the old && !hostPlaced guard is removed, consistent with the new tagging). In the constructor, when a pooled hit is host-placed but a fresh device-local allocation would now fit (checked via Context::DeviceLocalFits), the hit is put back and reset — so the pool prefers real VRAM again once the heap frees up. Both Take and Put thread the flag so the two populations stay separate bookkeeping-wise.
  • The test additions mirror the behavior flips exactly: HostPlacement asserts a pooled host-placed buffer is kept and is reused on a second allocation (previously asserted the opposite), and asserts a budget-feasible allocation does not pick it up (device != placed); RefusedDevicePlacement adds the same negative for a small allocation; the new IdleReclaimSkipsHostPlaced pins the central claim end-to-end — a host-placed 176 MiB buffer survives ReclaimIdleDevice while the 4 MiB device-local one is reclaimed (== 4 * MiB returned, placed kept, device freed).

Focused paired run (VVL env)

tree agc_buffer_pool _small_device_shared _small_device_no_staging _pipeline_store_lazy_buffer_pool total
this head 28f80c25a9 Passed (0.32s) Passed Passed Passed 4/4
main bb04a4f1ea Passed (0.31s) Passed Passed Passed 4/4

Both logs: 0 was not found but was requested by env var VK_INSTANCE_LAYERS (layer found and requested), 0 VUID-. Comparing logs, no new errors from this change.

Overlap note

tools/pr_overlap.py flags BufferPool.cpp as contended by other open PRs (e.g. #11920 also edits it near line 42). This PR and #8912 ("give small device-local buffers a pool tier of their own") both rework BufferPool/tier selection — whichever lands first will need the other to rebase, and the two-tier/path changes compound. Worth sequencing deliberately rather than merging both blindly.

Not covered

The mock-device suite (agc_buffer_pool_tests) exercises the pool logic against mock.memoryTypes/reportedBudget; a real run driving heapUsage past heapBudget on this RX 9070 XT (large-title capture) was not performed here. The logic ordering (prefer device-local when it fits again) is pinned by the mock test but not stress-tested under real budget flap.

@LeandroLP23

Copy link
Copy Markdown
Contributor Author

@MarcZX10 here are the matched captures on the 860M for current main and this head.

Setup

  • Machine: Radeon 860M (1002:1114, 512 MiB carve-out, budget 486 MiB), Ryzen AI 7 350, 32 GiB, on AC power.
  • Software: Windows 11 26300, AMD driver 32.0.13058.8001, WinLibs GCC 15.2.0, Release.
  • Trees: main aaccd0ba39 and this head 28f80c25a9, alternating in one session. Each tree was rebuilt in the same build directory before its run.
  • Scene: the SuperTuxKart (PPSA69421 00.001.000) tutorial race, started from the menu through APS5_PAD_INPUT_FILE, with APS5_TRACE_SECONDS=95:20. Every window below starts after the race has loaded.
Run Tree Commit Presents FPS Frame p50 / p90 / p99 (ms) GPU busy (ms/present) Device buffers placed in host memory Trace
1 main aaccd0ba39b7 154 in 20.0 s 7.69 130.9 / 149.3 / 195.9 44.7 8192+ (59685 MiB) trace
2 this PR 28f80c25a9b4 236 in 20.0 s 11.78 84.1 / 88.0 / 108.4 26.4 3 (48 MiB) trace
3 main aaccd0ba39b7 209 in 20.0 s 10.44 91.7 / 117.1 / 124.1 27.9 8192+ (54645 MiB) trace
4 this PR 28f80c25a9b4 166 in 20.0 s 8.29 121.5 / 143.8 / 168.2 43.1 3 (48 MiB) trace
5 this PR 28f80c25a9b4 233 in 20.1 s 11.61 84.5 / 95.9 / 98.9 26.4 3 (48 MiB) trace

I dropped a sixth run, main in the third pair, because the input never reached the race in three attempts and the window recorded the menu.

What this shows

  • The churn is gone. On main the race places at least 8192 device buffers in host memory, at least 53–58 GiB allocated and freed per run, nearly all of them 8 MiB. With this PR it places 3 (48 MiB), and later requests reuse those slots.
  • The frame rate difference is not attributable on current main. Both trees land in the same two modes, one at about 27 ms of GPU time per present (10.4–11.8 FPS) and one at about 44 ms (7.7–8.3 FPS). main gave 7.69 and 10.44 FPS, the PR 11.78, 8.29 and 11.61. The FPS gain in the description (2.47 → 2.94) was measured on ec7eacc62, where this race ran at about 2.5 FPS. It does not reproduce as a measurable gain here.

I'll update the description so it claims the removed allocation churn rather than an FPS gain. If you'd rather this not carry the perf scope on that basis, tell me and I'll retitle it.

Summary lines
{"commit":"aaccd0ba39b7","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon(TM) 860M Graphics","driver":"AMD proprietary driver 24.30.58.08 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen AI 7 350 w/ Radeon 860M","cpu_threads":16,"memory_mib":31866,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":568,"ms":20038.473},"presents":154,"frame_ms":{"p50":130.851,"p90":149.309,"p99":195.904,"max":198.737},"gpu_busy_ms_per_present":44.676,"worker_busy_pct":{"queue worker 0x0":17.835},"top_phases_ms_per_frame":{"Graphics.Draw":25.517,"Graphics.Draw.draw_and_resource_release":24.604,"Driver.Packet":21.681,"Driver.Packet.draw":19.131,"Driver.Draw":19.048,"Driver.Draw.draw_enqueued":14.698,"Vulkan.DrawFromRecipe":4.115,"Graphics.DrawWithRecipe":4.094},"trace_dropped":false,"trace":"aps5-trace-aaccd0ba39b7-2880.json.gz"}
{"commit":"28f80c25a9b4","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon(TM) 860M Graphics","driver":"AMD proprietary driver 24.30.58.08 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen AI 7 350 w/ Radeon 860M","cpu_threads":16,"memory_mib":31866,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":964,"ms":20030.191},"presents":236,"frame_ms":{"p50":84.143,"p90":87.982,"p99":108.403,"max":110.949},"gpu_busy_ms_per_present":26.388,"worker_busy_pct":{"queue worker 0x0":13.317},"top_phases_ms_per_frame":{"Graphics.Draw":17.642,"Graphics.Draw.draw_and_resource_release":16.970,"Driver.Packet":9.435,"Driver.Packet.draw":7.396,"Driver.Draw":7.327,"Driver.Draw.draw_enqueued":4.360,"Vulkan.DrawFromRecipe":2.866,"Graphics.DrawWithRecipe":2.851},"trace_dropped":false,"trace":"aps5-trace-28f80c25a9b4-7800.json.gz"}
{"commit":"aaccd0ba39b7","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon(TM) 860M Graphics","driver":"AMD proprietary driver 24.30.58.08 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen AI 7 350 w/ Radeon 860M","cpu_threads":16,"memory_mib":31866,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":865,"ms":20010.054},"presents":209,"frame_ms":{"p50":91.668,"p90":117.107,"p99":124.081,"max":144.382},"gpu_busy_ms_per_present":27.932,"worker_busy_pct":{"queue worker 0x0":17.825},"top_phases_ms_per_frame":{"Graphics.Draw":19.501,"Graphics.Draw.draw_and_resource_release":18.808,"Driver.Packet":16.312,"Driver.Packet.draw":14.269,"Driver.Draw":14.204,"Driver.Draw.draw_enqueued":10.438,"Driver.Draw.shader_compile_and_link":3.041,"Vulkan.DrawFromRecipe":2.901},"trace_dropped":false,"trace":"aps5-trace-aaccd0ba39b7-9236.json.gz"}
{"commit":"28f80c25a9b4","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon(TM) 860M Graphics","driver":"AMD proprietary driver 24.30.58.08 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen AI 7 350 w/ Radeon 860M","cpu_threads":16,"memory_mib":31866,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":918,"ms":20014.382},"presents":166,"frame_ms":{"p50":121.488,"p90":143.807,"p99":168.221,"max":172.264},"gpu_busy_ms_per_present":43.101,"worker_busy_pct":{"queue worker 0x0":14.932},"top_phases_ms_per_frame":{"Graphics.Draw":21.394,"Graphics.Draw.draw_and_resource_release":20.433,"Driver.Packet":17.025,"Driver.Packet.draw":14.584,"Driver.Draw":14.503,"Driver.Draw.draw_enqueued":10.019,"Vulkan.DrawFromRecipe":4.026,"Graphics.DrawWithRecipe":4.004},"trace_dropped":false,"trace":"aps5-trace-28f80c25a9b4-6440.json.gz"}
{"commit":"28f80c25a9b4","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon(TM) 860M Graphics","driver":"AMD proprietary driver 24.30.58.08 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen AI 7 350 w/ Radeon 860M","cpu_threads":16,"memory_mib":31866,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":925,"ms":20061.966},"presents":233,"frame_ms":{"p50":84.459,"p90":95.874,"p99":98.879,"max":102.374},"gpu_busy_ms_per_present":26.438,"worker_busy_pct":{"queue worker 0x0":13.498},"top_phases_ms_per_frame":{"Graphics.Draw":18.401,"Graphics.Draw.draw_and_resource_release":17.704,"Driver.Packet":9.745,"Driver.Packet.draw":7.623,"Driver.Draw":7.553,"Driver.Draw.draw_enqueued":4.503,"Vulkan.DrawFromRecipe":2.900,"Graphics.DrawWithRecipe":2.884},"trace_dropped":false,"trace":"aps5-trace-28f80c25a9b4-13900.json.gz"}
Run 1 (`main`): tools/trace_digest.py

seconds 95:20 from present 568: 154 presents, frame p50 130.9 / p90 149.3 / p99 195.9 / max 198.7 ms, GPU busy 44.7 ms per present
AMD Radeon(TM) 860M Graphics, AMD proprietary driver 24.30.58.08 (LLPC), Windows 10.0.26300, 1920x1080, commit aaccd0b, dropped: no

{"commit":"aaccd0ba39b7","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon(TM) 860M Graphics","driver":"AMD proprietary driver 24.30.58.08 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen AI 7 350 w/ Radeon 860M","cpu_threads":16,"memory_mib":31866,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":568,"ms":20038.473},"presents":154,"frame_ms":{"p50":130.851,"p90":149.309,"p99":195.904,"max":198.737},"gpu_busy_ms_per_present":44.676,"worker_busy_pct":{"queue worker 0x0":17.835},"top_phases_ms_per_frame":{"Graphics.Draw":25.517,"Graphics.Draw.draw_and_resource_release":24.604,"Driver.Packet":21.681,"Driver.Packet.draw":19.131,"Driver.Draw":19.048,"Driver.Draw.draw_enqueued":14.698,"Vulkan.DrawFromRecipe":4.115,"Graphics.DrawWithRecipe":4.094},"trace_dropped":false,"trace":"aps5-trace-aaccd0ba39b7-2880.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 715: 198.7 ms at 18947 ms: Driver.WorkerWait (queue worker 0x0) 171.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 171.0, batch (gpu) 52.5, Graphics.Draw (draw committer) 28.9
  • present 692: 195.9 ms at 15953 ms: Driver.WorkerWait (queue worker 0x0) 172.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 171.8, Graphics.Draw (draw committer) 27.1, batch (gpu) 26.5
  • present 706: 185.8 ms at 17661 ms: Driver.WorkerWait (queue worker 0x0) 158.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 158.1, batch (gpu) 35.4, Graphics.Draw (draw committer) 30.1
  • present 718: 185.7 ms at 19462 ms: Driver.WorkerWait (queue worker 0x0) 158.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 157.9, batch (gpu) 61.5, Graphics.Draw (draw committer) 30.3
  • present 605: 181.1 ms at 4934 ms: Driver.WorkerWait (queue worker 0x0) 150.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 150.7, batch (gpu) 84.9, Graphics.Draw (draw committer) 32.9

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.0 (0 %) 0.0 (0 %) 130.1 0.2 Recorder.Sync 0.0
queue worker 0x0 21.9 (17 %) 106.4 (82 %) 1.8 6.6 Driver.Packet 20.4, Driver.EndSubmission 1.5
draw committer 30.5 (23 %) 2.1 (2 %) 97.6 0.4 Graphics.Draw 25.5, Vulkan.DrawFromRecipe 4.1
presenter 0.7 (1 %) 1.0 (1 %) 128.4 0.0 VideoOut.Flip 1.7, Driver.Present 0.0
gpu 44.6 (34 %) 0.0 (0 %) 85.5 0.0 batch 44.6

Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 106.4, Driver.WorkerWait.idle_and_completion_poll 106.3, batch 44.6, Graphics.Draw 25.5, Graphics.Draw.draw_and_resource_release 24.6, Driver.Packet 20.4, Driver.Packet.draw 19.1, Driver.Draw 19.0, Driver.Draw.draw_enqueued 14.2, Vulkan.DrawFromRecipe 4.1

Longest waits

  • Driver.WorkerWait (queue worker 0x0) 28.3 ms at 4991 ms, present 605
  • Driver.WorkerWait (queue worker 0x0) 24.1 ms at 16149 ms, present 692
  • Driver.WorkerWait (queue worker 0x0) 23.9 ms at 5019 ms, present 605
  • Driver.WorkerWait (queue worker 0x0) 23.3 ms at 19352 ms, present 717
  • Driver.WorkerWait (queue worker 0x0) 22.8 ms at 6888 ms, present 619
  • Driver.WorkerWait (queue worker 0x0) 22.5 ms at 17736 ms, present 706
  • Driver.WorkerWait (queue worker 0x0) 21.2 ms at 5293 ms, present 607
  • Driver.WorkerWait (queue worker 0x0) 21.1 ms at 7172 ms, present 621
  • Driver.WorkerWait (queue worker 0x0) 20.8 ms at 17922 ms, present 707
  • Driver.WorkerWait (queue worker 0x0) 19.5 ms at 614 ms, present 572

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 1265: 22.1 ms at 4968 ms, present 605: GPU no ranges; recorded by Graphics.Draw (draw committer) 1.0, Graphics.Draw.draw_and_resource_release (draw committer) 1.0, Recorder.Submit (draw committer) 0.1, Recorder.Reap (draw committer) 0.0
  • batch 1741: 18.1 ms at 6864 ms, present 619: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.7, Graphics.Draw.draw_and_resource_release (draw committer) 0.7, Recorder.Submit (draw committer) 0.1
  • batch 1266: 17.9 ms at 4995 ms, present 605: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.4, Graphics.Draw.draw_and_resource_release (draw committer) 0.4, Recorder.Submit (draw committer) 0.1, Recorder.Reap (draw committer) 0.0
  • batch 5073: 17.1 ms at 19330 ms, present 717: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.6, Graphics.Draw.draw_and_resource_release (draw committer) 0.6, Recorder.Submit (draw committer) 0.1
  • batch 1333: 16.4 ms at 5269 ms, present 607: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.9, Graphics.Draw.draw_and_resource_release (draw committer) 0.9, Recorder.Submit (draw committer) 0.1
Run 2 (this PR): tools/trace_digest.py

seconds 95:20 from present 964: 236 presents, frame p50 84.1 / p90 88.0 / p99 108.4 / max 110.9 ms, GPU busy 26.4 ms per present
AMD Radeon(TM) 860M Graphics, AMD proprietary driver 24.30.58.08 (LLPC), Windows 10.0.26300, 1920x1080, commit 28f80c2, dropped: no

{"commit":"28f80c25a9b4","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon(TM) 860M Graphics","driver":"AMD proprietary driver 24.30.58.08 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen AI 7 350 w/ Radeon 860M","cpu_threads":16,"memory_mib":31866,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":964,"ms":20030.191},"presents":236,"frame_ms":{"p50":84.143,"p90":87.982,"p99":108.403,"max":110.949},"gpu_busy_ms_per_present":26.388,"worker_busy_pct":{"queue worker 0x0":13.317},"top_phases_ms_per_frame":{"Graphics.Draw":17.642,"Graphics.Draw.draw_and_resource_release":16.97,"Driver.Packet":9.435,"Driver.Packet.draw":7.396,"Driver.Draw":7.327,"Driver.Draw.draw_enqueued":4.36,"Vulkan.DrawFromRecipe":2.866,"Graphics.DrawWithRecipe":2.851},"trace_dropped":false,"trace":"aps5-trace-28f80c25a9b4-7800.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 965: 110.9 ms at 108 ms: Driver.WorkerWait (queue worker 0x0) 97.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 97.4, batch (gpu) 43.1, Graphics.Draw (draw committer) 21.3
  • present 966: 108.9 ms at 219 ms: Driver.WorkerWait (queue worker 0x0) 95.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 95.0, batch (gpu) 45.0, Graphics.Draw (draw committer) 19.3
  • present 964: 108.4 ms at 0 ms: Driver.WorkerWait (queue worker 0x0) 88.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 88.5, batch (gpu) 40.4, Graphics.Draw (draw committer) 21.4
  • present 967: 105.6 ms at 328 ms: Driver.WorkerWait (queue worker 0x0) 92.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 92.9, batch (gpu) 38.5, Graphics.Draw (draw committer) 20.0
  • present 968: 103.9 ms at 434 ms: Driver.WorkerWait (queue worker 0x0) 91.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 91.1, batch (gpu) 34.5, Graphics.Draw (draw committer) 20.8

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.0 (0 %) 0.0 (0 %) 84.9 0.1 Recorder.Sync 0.0
queue worker 0x0 10.0 (12 %) 73.1 (86 %) 1.8 5.8 Driver.Packet 8.1, Driver.EndSubmission 1.8
draw committer 21.4 (25 %) 1.3 (2 %) 62.2 0.3 Graphics.Draw 17.6, Vulkan.DrawFromRecipe 2.9
presenter 0.8 (1 %) 0.6 (1 %) 83.5 0.0 VideoOut.Flip 1.4, Driver.Present 0.0
gpu 26.4 (31 %) 0.0 (0 %) 58.5 0.0 batch 26.4

Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 73.1, Driver.WorkerWait.idle_and_completion_poll 73.1, batch 26.4, Graphics.Draw 17.6, Graphics.Draw.draw_and_resource_release 17.0, Driver.Packet 8.1, Driver.Packet.draw 7.2, Driver.Draw 7.1, Driver.Draw.draw_enqueued 4.0, Vulkan.DrawFromRecipe 2.9

Longest waits

  • Driver.WorkerWait (queue worker 0x0) 22.3 ms at 249 ms, present 966
  • Driver.WorkerWait (queue worker 0x0) 21.5 ms at 138 ms, present 965
  • Driver.WorkerWait (queue worker 0x0) 20.1 ms at 355 ms, present 967
  • Driver.WorkerWait (queue worker 0x0) 19.4 ms at 30 ms, present 964
  • Driver.WorkerWait (queue worker 0x0) 14.7 ms at 464 ms, present 968
  • Driver.WorkerWait (queue worker 0x0) 14.0 ms at 49 ms, present 964
  • Driver.WorkerWait (queue worker 0x0) 13.7 ms at 160 ms, present 965
  • Driver.WorkerWait (queue worker 0x0) 12.9 ms at 7667 ms, present 1052
  • Driver.WorkerWait (queue worker 0x0) 12.7 ms at 7753 ms, present 1053
  • Driver.WorkerWait (queue worker 0x0) 12.6 ms at 375 ms, present 967

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 74: 12.8 ms at 221 ms, present 966: GPU no ranges; recorded by Graphics.Draw (draw committer) 7.3, Graphics.Draw.draw_and_resource_release (draw committer) 6.9, Graphics.Draw.validate (draw committer) 0.2, Recorder.Submit (draw committer) 0.1
  • batch 108: 11.6 ms at 327 ms, present 966: GPU no ranges; recorded by Graphics.Draw (draw committer) 6.9, Graphics.Draw.draw_and_resource_release (draw committer) 6.5, Graphics.Draw.validate (draw committer) 0.2, Recorder.Submit (draw committer) 0.1
  • batch 40: 11.4 ms at 111 ms, present 965: GPU no ranges; recorded by Graphics.Draw (draw committer) 7.5, Graphics.Draw.draw_and_resource_release (draw committer) 7.0, Graphics.Draw.validate (draw committer) 0.3, Recorder.Submit (draw committer) 0.1
  • batch 6: 10.1 ms at 3 ms, present 964: GPU no ranges; recorded by Graphics.Draw (draw committer) 7.6, Graphics.Draw.draw_and_resource_release (draw committer) 7.1, Graphics.Draw.validate (draw committer) 0.3, Recorder.Submit (draw committer) 0.1
  • batch 75: 9.1 ms at 234 ms, present 966: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.7, Graphics.Draw.draw_and_resource_release (draw committer) 0.7, Recorder.Submit (draw committer) 0.1
Run 3 (`main`): tools/trace_digest.py

seconds 95:20 from present 865: 209 presents, frame p50 91.7 / p90 117.1 / p99 124.1 / max 144.4 ms, GPU busy 27.9 ms per present
AMD Radeon(TM) 860M Graphics, AMD proprietary driver 24.30.58.08 (LLPC), Windows 10.0.26300, 1920x1080, commit aaccd0b, dropped: no

{"commit":"aaccd0ba39b7","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon(TM) 860M Graphics","driver":"AMD proprietary driver 24.30.58.08 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen AI 7 350 w/ Radeon 860M","cpu_threads":16,"memory_mib":31866,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":865,"ms":20010.054},"presents":209,"frame_ms":{"p50":91.668,"p90":117.107,"p99":124.081,"max":144.382},"gpu_busy_ms_per_present":27.932,"worker_busy_pct":{"queue worker 0x0":17.825},"top_phases_ms_per_frame":{"Graphics.Draw":19.501,"Graphics.Draw.draw_and_resource_release":18.808,"Driver.Packet":16.312,"Driver.Packet.draw":14.269,"Driver.Draw":14.204,"Driver.Draw.draw_enqueued":10.438,"Driver.Draw.shader_compile_and_link":3.041,"Vulkan.DrawFromRecipe":2.901},"trace_dropped":false,"trace":"aps5-trace-aaccd0ba39b7-9236.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 901: 144.4 ms at 3618 ms: Driver.WorkerWait (queue worker 0x0) 104.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 104.1, batch (gpu) 53.3, Driver.Packet (queue worker 0x0) 37.6
  • present 909: 131.5 ms at 4598 ms: Driver.WorkerWait (queue worker 0x0) 98.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 98.1, batch (gpu) 45.3, Driver.Packet (queue worker 0x0) 30.8
  • present 919: 124.1 ms at 5794 ms: Driver.WorkerWait (queue worker 0x0) 99.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 99.0, batch (gpu) 45.8, Driver.Packet (queue worker 0x0) 22.5
  • present 898: 123.3 ms at 3258 ms: Driver.WorkerWait (queue worker 0x0) 104.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 104.7, batch (gpu) 44.8, Graphics.Draw (draw committer) 21.9
  • present 904: 122.2 ms at 4004 ms: Driver.WorkerWait (queue worker 0x0) 106.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 106.0, batch (gpu) 43.9, Graphics.Draw (draw committer) 20.4

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.0 (0 %) 0.0 (0 %) 95.7 0.2 Recorder.Sync 0.0
queue worker 0x0 15.8 (16 %) 78.2 (82 %) 1.7 6.5 Driver.Packet 15.1, Driver.EndSubmission 0.7
draw committer 22.8 (24 %) 2.1 (2 %) 70.8 0.3 Graphics.Draw 19.5, Vulkan.DrawFromRecipe 2.9
presenter 1.1 (1 %) 0.5 (1 %) 94.1 0.0 VideoOut.Flip 1.6, Driver.Present 0.0
gpu 28.0 (29 %) 0.0 (0 %) 67.8 0.0 batch 28.0

Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 78.2, Driver.WorkerWait.idle_and_completion_poll 78.2, batch 28.0, Graphics.Draw 19.5, Graphics.Draw.draw_and_resource_release 18.8, Driver.Packet 15.1, Driver.Packet.draw 14.1, Driver.Draw 14.0, Driver.Draw.draw_enqueued 10.0, Vulkan.DrawFromRecipe 2.9

Longest waits

  • GpuMutex.wait.draw (draw committer) 16.2 ms at 3625 ms, present 901
  • GpuMutex.wait.draw (draw committer) 16.0 ms at 4604 ms, present 909
  • Driver.WorkerWait (queue worker 0x0) 16.0 ms at 3698 ms, present 901
  • Driver.WorkerWait (queue worker 0x0) 15.3 ms at 5496 ms, present 916
  • Driver.WorkerWait (queue worker 0x0) 15.0 ms at 5856 ms, present 919
  • Driver.WorkerWait (queue worker 0x0) 14.8 ms at 3684 ms, present 901
  • Driver.WorkerWait (queue worker 0x0) 14.8 ms at 3662 ms, present 901
  • Driver.WorkerWait (queue worker 0x0) 14.7 ms at 5733 ms, present 918
  • Driver.WorkerWait (queue worker 0x0) 14.6 ms at 4062 ms, present 904
  • Driver.WorkerWait (queue worker 0x0) 14.5 ms at 4537 ms, present 908

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 1227: 13.3 ms at 3635 ms, present 901: GPU no ranges; recorded by Graphics.Draw (draw committer) 16.7, Graphics.Draw.draw_and_resource_release (draw committer) 16.5, Resources.Complete (draw committer) 0.2, Resources.Prepare (draw committer) 0.2
  • batch 1499: 12.3 ms at 4607 ms, present 909: GPU no ranges; recorded by Graphics.Draw (draw committer) 10.6, Graphics.Draw.draw_and_resource_release (draw committer) 10.5, Recorder.Submit (draw committer) 0.1
  • batch 1091: 11.8 ms at 3135 ms, present 896: GPU no ranges; recorded by Graphics.Draw (draw committer) 10.9, Graphics.Draw.draw_and_resource_release (draw committer) 10.5, Recorder.Submit (draw committer) 0.1
  • batch 993: 11.4 ms at 2799 ms, present 894: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.7, Graphics.Draw.draw_and_resource_release (draw committer) 0.7, Recorder.Submit (draw committer) 0.1
  • batch 1601: 11.3 ms at 4963 ms, present 911: GPU no ranges; recorded by Graphics.Draw (draw committer) 13.9, Graphics.Draw.draw_and_resource_release (draw committer) 13.5, Recorder.Submit (draw committer) 0.1
Run 4 (this PR): tools/trace_digest.py

seconds 95:20 from present 918: 166 presents, frame p50 121.5 / p90 143.8 / p99 168.2 / max 172.3 ms, GPU busy 43.1 ms per present
AMD Radeon(TM) 860M Graphics, AMD proprietary driver 24.30.58.08 (LLPC), Windows 10.0.26300, 1920x1080, commit 28f80c2, dropped: no

{"commit":"28f80c25a9b4","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon(TM) 860M Graphics","driver":"AMD proprietary driver 24.30.58.08 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen AI 7 350 w/ Radeon 860M","cpu_threads":16,"memory_mib":31866,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":918,"ms":20014.382},"presents":166,"frame_ms":{"p50":121.488,"p90":143.807,"p99":168.221,"max":172.264},"gpu_busy_ms_per_present":43.101,"worker_busy_pct":{"queue worker 0x0":14.932},"top_phases_ms_per_frame":{"Graphics.Draw":21.394,"Graphics.Draw.draw_and_resource_release":20.433,"Driver.Packet":17.025,"Driver.Packet.draw":14.584,"Driver.Draw":14.503,"Driver.Draw.draw_enqueued":10.019,"Vulkan.DrawFromRecipe":4.026,"Graphics.DrawWithRecipe":4.004},"trace_dropped":false,"trace":"aps5-trace-28f80c25a9b4-6440.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 937: 172.3 ms at 2401 ms: Driver.WorkerWait (queue worker 0x0) 147.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 147.7, batch (gpu) 80.0, Graphics.Draw (draw committer) 28.5
  • present 1030: 168.2 ms at 13913 ms: Driver.WorkerWait (queue worker 0x0) 147.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 147.0, batch (gpu) 58.0, Graphics.Draw (draw committer) 24.9
  • present 936: 167.3 ms at 2234 ms: Driver.WorkerWait (queue worker 0x0) 147.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 147.3, batch (gpu) 68.0, Graphics.Draw (draw committer) 22.3
  • present 1056: 161.2 ms at 16902 ms: Driver.WorkerWait (queue worker 0x0) 139.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 139.1, batch (gpu) 69.7, Graphics.Draw (draw committer) 24.3
  • present 923: 152.9 ms at 688 ms: Driver.WorkerWait (queue worker 0x0) 132.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 132.1, batch (gpu) 67.1, Graphics.Draw (draw committer) 24.8

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.1 (0 %) 0.0 (0 %) 120.5 0.2 Recorder.Sync 0.1
queue worker 0x0 16.7 (14 %) 102.0 (85 %) 1.9 6.7 Driver.Packet 15.7, Driver.EndSubmission 0.9
draw committer 26.4 (22 %) 2.1 (2 %) 92.1 0.4 Graphics.Draw 21.4, Vulkan.DrawFromRecipe 4.0
presenter 0.8 (1 %) 1.0 (1 %) 118.7 0.0 VideoOut.Flip 1.8, Driver.Present 0.0
gpu 43.1 (36 %) 0.0 (0 %) 77.5 0.0 batch 43.1

Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 102.0, Driver.WorkerWait.idle_and_completion_poll 101.9, batch 43.1, Graphics.Draw 21.4, Graphics.Draw.draw_and_resource_release 20.4, Driver.Packet 15.7, Driver.Packet.draw 14.5, Driver.Draw 14.4, Driver.Draw.draw_enqueued 9.5, Vulkan.DrawFromRecipe 4.0

Longest waits

  • Driver.WorkerWait (queue worker 0x0) 24.3 ms at 585 ms, present 922
  • Driver.WorkerWait (queue worker 0x0) 24.1 ms at 2296 ms, present 936
  • Driver.WorkerWait (queue worker 0x0) 23.8 ms at 2478 ms, present 937
  • Driver.WorkerWait (queue worker 0x0) 22.8 ms at 2456 ms, present 937
  • Driver.WorkerWait (queue worker 0x0) 22.6 ms at 3595 ms, present 945
  • Driver.WorkerWait (queue worker 0x0) 21.9 ms at 4480 ms, present 952
  • Driver.WorkerWait (queue worker 0x0) 21.7 ms at 4844 ms, present 955
  • Driver.WorkerWait (queue worker 0x0) 21.6 ms at 6615 ms, present 969
  • Driver.WorkerWait (queue worker 0x0) 21.4 ms at 5268 ms, present 958
  • Driver.WorkerWait (queue worker 0x0) 20.5 ms at 3575 ms, present 945

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 143: 22.3 ms at 559 ms, present 922: GPU no ranges; recorded by Graphics.Draw (draw committer) 1.1, Graphics.Draw.draw_and_resource_release (draw committer) 1.0, Recorder.Submit (draw committer) 0.1
  • batch 654: 21.0 ms at 2451 ms, present 937: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.4, Graphics.Draw.draw_and_resource_release (draw committer) 0.3, Recorder.Submit (draw committer) 0.1
  • batch 653: 21.0 ms at 2429 ms, present 937: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.9, Graphics.Draw.draw_and_resource_release (draw committer) 0.9, Recorder.Submit (draw committer) 0.1
  • batch 1163: 20.4 ms at 4453 ms, present 952: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.7, Graphics.Draw.draw_and_resource_release (draw committer) 0.7, Recorder.Submit (draw committer) 0.1
  • batch 620: 20.3 ms at 2269 ms, present 936: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.4, Graphics.DrawWithRecipe (draw committer) 0.4, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.4, Recorder.Submit (draw committer) 0.2
Run 5 (this PR): tools/trace_digest.py

seconds 95:20 from present 925: 233 presents, frame p50 84.5 / p90 95.9 / p99 98.9 / max 102.4 ms, GPU busy 26.4 ms per present
AMD Radeon(TM) 860M Graphics, AMD proprietary driver 24.30.58.08 (LLPC), Windows 10.0.26300, 1920x1080, commit 28f80c2, dropped: no

{"commit":"28f80c25a9b4","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"95:20"},"gpu":"AMD Radeon(TM) 860M Graphics","driver":"AMD proprietary driver 24.30.58.08 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen AI 7 350 w/ Radeon 860M","cpu_threads":16,"memory_mib":31866,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 95:20","first_present":925,"ms":20061.966},"presents":233,"frame_ms":{"p50":84.459,"p90":95.874,"p99":98.879,"max":102.374},"gpu_busy_ms_per_present":26.438,"worker_busy_pct":{"queue worker 0x0":13.498},"top_phases_ms_per_frame":{"Graphics.Draw":18.401,"Graphics.Draw.draw_and_resource_release":17.704,"Driver.Packet":9.745,"Driver.Packet.draw":7.623,"Driver.Draw":7.553,"Driver.Draw.draw_enqueued":4.503,"Vulkan.DrawFromRecipe":2.9,"Graphics.DrawWithRecipe":2.884},"trace_dropped":false,"trace":"aps5-trace-28f80c25a9b4-13900.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 968: 102.4 ms at 3689 ms: Driver.WorkerWait (queue worker 0x0) 87.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 87.6, batch (gpu) 28.0, Graphics.Draw (draw committer) 22.7
  • present 974: 100.1 ms at 4262 ms: Driver.WorkerWait (queue worker 0x0) 86.6, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 86.5, batch (gpu) 27.0, Graphics.Draw (draw committer) 21.8
  • present 998: 98.9 ms at 6574 ms: Driver.WorkerWait (queue worker 0x0) 86.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 86.3, batch (gpu) 27.5, Graphics.Draw (draw committer) 21.3
  • present 984: 98.9 ms at 5216 ms: Driver.WorkerWait (queue worker 0x0) 82.6, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 82.5, batch (gpu) 28.2, Graphics.Draw (draw committer) 21.8
  • present 980: 98.8 ms at 4842 ms: Driver.WorkerWait (queue worker 0x0) 84.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 84.1, batch (gpu) 28.2, Graphics.Draw (draw committer) 22.9

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.0 (0 %) 0.0 (0 %) 86.1 0.2 Recorder.Sync 0.0
queue worker 0x0 10.3 (12 %) 74.0 (86 %) 1.8 5.9 Driver.Packet 8.4, Driver.EndSubmission 1.8
draw committer 22.1 (26 %) 1.4 (2 %) 62.6 0.3 Graphics.Draw 18.4, Vulkan.DrawFromRecipe 2.9
presenter 0.8 (1 %) 0.6 (1 %) 84.7 0.0 VideoOut.Flip 1.4, Driver.Present 0.0
gpu 26.5 (31 %) 0.0 (0 %) 59.6 0.0 batch 26.5

Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 74.0, Driver.WorkerWait.idle_and_completion_poll 74.0, batch 26.5, Graphics.Draw 18.4, Graphics.Draw.draw_and_resource_release 17.7, Driver.Packet 8.4, Driver.Packet.draw 7.4, Driver.Draw 7.3, Driver.Draw.draw_enqueued 4.1, Vulkan.DrawFromRecipe 2.9

Longest waits

  • Driver.WorkerWait (queue worker 0x0) 13.7 ms at 11299 ms, present 1053
  • Driver.WorkerWait (queue worker 0x0) 12.7 ms at 10863 ms, present 1048
  • Driver.WorkerWait (queue worker 0x0) 12.6 ms at 11383 ms, present 1054
  • Driver.WorkerWait (queue worker 0x0) 12.3 ms at 3730 ms, present 968
  • Driver.WorkerWait (queue worker 0x0) 12.1 ms at 3828 ms, present 969
  • Driver.WorkerWait (queue worker 0x0) 12.0 ms at 804 ms, present 934
  • Driver.WorkerWait (queue worker 0x0) 11.9 ms at 6613 ms, present 998
  • Driver.WorkerWait (queue worker 0x0) 11.8 ms at 6515 ms, present 997
  • Driver.WorkerWait (queue worker 0x0) 11.8 ms at 2761 ms, present 957
  • Driver.WorkerWait (queue worker 0x0) 11.7 ms at 5549 ms, present 987

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 4360: 7.5 ms at 11276 ms, present 1053: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.4, Graphics.DrawWithRecipe (draw committer) 0.4, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.4, Recorder.Submit (draw committer) 0.1
  • batch 4189: 7.0 ms at 10841 ms, present 1048: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.6, Graphics.Draw.draw_and_resource_release (draw committer) 0.6, Recorder.Submit (draw committer) 0.1
  • batch 4393: 6.9 ms at 11360 ms, present 1054: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.6, Graphics.Draw.draw_and_resource_release (draw committer) 0.6, Recorder.Submit (draw committer) 0.1
  • batch 1708: 6.7 ms at 4376 ms, present 975: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.2, Graphics.DrawWithRecipe (draw committer) 0.2, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.2, Recorder.Submit (draw committer) 0.1
  • batch 4359: 6.7 ms at 11264 ms, present 1053: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.6, Graphics.Draw.draw_and_resource_release (draw committer) 0.6, Recorder.Submit (draw committer) 0.1

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added the perf numbers missing perf pull request without a before and after summary line label Oct 29, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

I reviewed head 28f80c25a9b466b067a3c3b9bbbd504d548e0376; the updated evidence supports reduced host-memory allocation churn, while correctly making no repeatable FPS-gain claim.

What I ran

  • Compared PR head 28f80c25a9b466b067a3c3b9bbbd504d548e0376 with current main 1a217758a55c09e817366fa4411daac854eeb3f9; their merge base is aaccd0ba39b7d40fdbf19664575a7e567d8542f7 and the merge preview is clean (8c6773cdd121de6ed2d9fa52bfb5f7ee5275c1dd). None of the five PR files changed on main after that baseline.
  • Ran git diff --check upstream/main...refs/review/upstream-8748 and python tools/check_conventions.py --base upstream/main --head refs/review/upstream-8748 on Linux with Python 3.11.2. No local build or tests were run.
  • Read the updated SuperTuxKart report on the same Radeon 860M, including the reported paired summaries, trace digests, and trace links.
git merge-base upstream/main refs/review/upstream-8748
git merge-tree --write-tree upstream/main refs/review/upstream-8748
git diff --check upstream/main...refs/review/upstream-8748
python tools/check_conventions.py --base upstream/main --head refs/review/upstream-8748

Results

Check Result
Current-main merge preview Clean; tree 8c6773cdd121de6ed2d9fa52bfb5f7ee5275c1dd
git diff --check Pass; no output
Conventions Pass; All conventions checks passed.
Exact-head focused tests Author reports 76/76 focused buffer-pool/resource tests passed on 28f80c25a9, with Vulkan validation enabled
Matched title captures Author reports same-machine main aaccd0ba39b7 and PR-head 28f80c25a9b4 captures, summaries, digests, and traces. Buffer placements fell from 8,192+ to 3; the measured FPS modes overlap, so the report does not claim a repeatable FPS gain.
Hosted checks Windows, conventions, labels, eligibility, and report pass; Linux and specialized jobs are skipped

Findings

Blocking

None.

Non-blocking

The evidence supports the reduced allocation churn. It does not establish a general frame-rate improvement, and the updated description states that limitation clearly.

Sources

Not verified

I did not build or run tests locally, download or independently digest the attached traces, or test Linux behavior. Hosted Linux and specialized jobs were skipped.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 31, 2026
LeandroLP23 and others added 3 commits November 1, 2026 01:21
…the device heap is full

A device buffer placed in host memory because the device-local heap was
over its VK_EXT_memory_budget was freed on release, so every later
request allocated host memory again. On an APU with a 512 MiB carve-out
the device-local heap stays over budget, and SuperTuxKart's race made
and freed 4096-8192 such 8 MiB buffers per run.

They now enter the device tier under their own key and are handed out
only when a new allocation would be placed in host memory too, so a
device buffer still gets device-local memory whenever it fits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ReclaimIdleDevice (boykopovar#8672) scans deviceTier for the oldest idle slots, and
the host-placed device buffers this change retains live there too. An
older host-placed slot could satisfy the requested byte count, so the
reclaim freed host memory, reported it as released device memory and left
the idle device-local slots in place. The scan now skips hostPlaced
allocations.

IdleReclaimSkipsHostPlaced retains an older host-placed and a younger
device-local slot and checks that the reclaim frees and counts only the
device-local one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Heap

The texture-cache release before a host placement (from main) re-queried
the budget through locals that DeviceMemoryType no longer has since the
heap report moved into ReportedHeap. Use the report and re-read it after a
release, with the same fit test as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LeandroLP23
LeandroLP23 force-pushed the perf/agc-pool-host-placed-device-buffers branch from 28f80c2 to 7cd426f Compare November 1, 2026 00:21
@LeandroLP23

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (head 7cd426f00f). Two merged changes overlapped and needed more than a textual merge:

  • BufferPool::Take. main added a const char* category parameter for memory accounting, and this PR adds bool hostPlaced. The signature is now Take(bytes, usage, properties, category = nullptr, hostPlaced = false). Both DeviceBuffer calls pass "vkAllocateMemory device buffer", the same category main uses for a new device buffer whether it lands in device or host memory. The accounting keeps the heap of the actual memory type, so a reused host-placed buffer is still counted against the host heap. No other Take caller passes a bool in that position.
  • Context::DeviceMemoryType. e2c1c30 (release texture caches before a budget-full allocation goes to host memory) merged without a textual conflict. It still used the usage/budget/reported locals that this PR had moved into ReportedHeap, so the merged file did not compile. The new commit 7cd426f00f reads the report through ReportedHeap and re-reads it after a cache release, with the same fit test as main.

Tested on the RTX 5060 Ti desktop (Windows, driver 621.01, WinLibs GCC 15.2.0, Release). ctest -R "agc_buffer_pool|agc_memory_accounting" -V was run with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation:

  • this branch: 6 of 6 passed, including IdleReclaimSkipsHostPlaced;
  • main (e59a3f8baa): 6 of 6 passed.

Neither log has was not found but was requested by env var VK_INSTANCE_LAYERS or any VUID- line. Between the tested head and the pushed one, only unrelated main commits differ; the Graphics sources are identical.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 1, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 7cd426f merged onto main 3741ca9 · tested 2026-11-01 08:12 UTC · 22 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,425 passed · 5 failed (0 new, 3 also fail on main, 2 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,474 of 3,121 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 (929 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 47.4 s, ⚠️ agc_driver_lookup_log_fits_build 41.3 s, ⚠️ agc_driver_graphics_maps_fallback 32.4 s
Intermittent validation messages (1, seen once in the parallel run, not reproduced when the test was re-run alone 2 times; not counted against this PR)
agc_driver_depth_clear_hle: VUID-vkCmdCopyBuffer-commonparent (6x)
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_depth_clear_hle: failed in 2 of the last 10 main runs
agc_submit_progress: failed in 6 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 (5 IDs in 480 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (480 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 472 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
VUID-VkShaderModuleCreateInfo-pCode-08737 (1 test): agc_driver_image_sample_derivatives
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_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_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_f
Reproduce
git fetch origin 7cd426f00f6efc4ae4a0431c1a8f849bcd500cf1 3741ca9327246d0df81638726a986cef862b6db5
git checkout 3741ca9327246d0df81638726a986cef862b6db5 && git merge --no-ff 7cd426f00f6efc4ae4a0431c1a8f849bcd500cf1
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.

@LeandroLP23

Copy link
Copy Markdown
Contributor Author

@TechLevelZero thanks for the run. About the slow-test lines, which show up on most PRs and on main too: the same tests are much faster on my Windows machine, with the same environment (ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation).

Test Your runner (RTX 2000 Ada, Linux) RTX 5060 Ti, Windows 11, main 029463ceb6, ctest -j 6
agc_driver_pipeline_journal 47-80 s (#8748, #9154, #7622, #7668) 9.5 s
agc_driver_lookup_log_fits_build 41-54 s 2.5 s
agc_driver_graphics_maps_fallback 31-32 s Linux-only. It reruns the whole agc_driver_graphics binary, which takes 24 s here, so ~30 s looks expected

My validation layer is the one from Vulkan SDK 1.4.363.0, with default settings.

pipeline_journal also varies a lot between your runs (47 s to 80 s), so I suspect the runner rather than the tests. Do these two take as long when run alone (ctest -R '^agc_driver_lookup_log_fits_build$')? Are GPU-assisted or synchronization validation turned on through VK_LAYER_SETTINGS_PATH or vk_layer_settings.txt? lookup_log_fits_build binds 1500 texture descriptors, which those modes are much slower on. If they're slow alone with default layer settings, I can look into it, but I don't have a Linux machine with an NVIDIA GPU to reproduce it on.

AI-assisted: yes (Claude Code)

# Conflicts:
#	core/libs/prx/libSceAgcDriver/tests/BufferPool.cpp
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 3, 2026

@XairRrR XairRrR left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — changes requested

This pull request does not merge cleanly into main (4f41f4c): head 7cd426f conflicts in

  • core/libs/prx/libSceAgcDriver/tests/BufferPool.cpp

Please rebase it onto current main. I will review the change once it merges cleanly.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head 53570aa merged onto main 4f41f4c · tested 2026-11-03 11:05 UTC · 36 min

GPU AMD Radeon RX 6300 (RADV NAVI24), driver Mesa 25.2.8-0ubuntu0.24.04.4, Vulkan 1.4.318
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-42-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,690 passed · 9 failed (0 new, 7 also fail on main, 2 unstable on main) · 58 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,757 of 3,811 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 (929 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s, ⚠️ public_headers 67.2 s, ⚠️ agc_driver_image_sample_unnormalized 52.9 s, ⚠️ agc_driver_lazy_resolved_abi 48.8 s
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 7 of the last 9 main runs
agc_driver_store_over_untracked: failed in 1 of the last 9 main runs
Failing on main too (7, not counted against this PR)
agc_driver_image_table
agc_driver_native_depth_bda_clear
agc_driver_native_multisample_depth
agc_driver_submit_progress
agc_submit_progress
agc_submit_progress_no_timeline
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 (8 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth, agc_driver_stencil_null_feedback, agc_driver_stencil_plane_memory
VUID-vkCmdCopyImage-srcImage-01551 (8 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth, agc_driver_stencil_null_feedback, agc_driver_stencil_plane_memory
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_srgb8_color_target
Skipped (58)
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_copied_writer_label_order: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_float16_unused_nan_payloads: skipped, the device has no native f16 conversions with RTE rounding and kept f16 denormals
agc_driver_image_table_vouched_lookups: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a watched imported table cannot be vouched for
agc_driver_linear_target_direct_write_completion: skipped, the device does not keep host imports write-watched, so no completion stamp over the target is tracked
agc_driver_ngg_vertex_wave_reduction: skipped, s3 describes a 32-lane wave only on 32-lane subgroups, and the device has 64 lanes
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_unit_shadow: skipped, the device does not import watched host memory for unit shadows
agc_driver_unit_shadow_budget: skipped, the device does not import watched host memory for unit shadows
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_idle_publish_wait: skipped, the device reports 4 of 4 host-imported pages written after a GPU read, so a forced watch of the import reads its submissions as CPU stores
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_shadowed_key_stores: skipped, the device imports no watched host memory under a unit shadow
agc_small_tiled_shadow_label: skipped, host imports are unavailable: the test block is not imported and watched
agc_storage_clear_hand_over: skipped, the device imports no watched host memory for the clear-key hand-over
agc_unit_shadow: skipped, the device does not import watched host memory for unit shadows
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: DisplayW
Reproduce
git fetch origin 53570aa5ffeabb0b4b49dd951649de8a5afa0e71 4f41f4c375f5abb487dbd184fbc150f31994d762
git checkout 4f41f4c375f5abb487dbd184fbc150f31994d762 && git merge --no-ff 53570aa5ffeabb0b4b49dd951649de8a5afa0e71
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 12 --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 16 --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 AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@XairRrR XairRrR left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-checked — approved

Since my last review the branch was rebased onto newer main and gained commit 7cd426f00f, which re-reads the heap report through ReportedHeap after main's texture-cache release. main 4f41f4c was also merged into it, and the description now has matched 860M captures. The merged tree builds, the focused tests pass with the Khronos layer active, and the new checks still fail without the production change. One new non-blocking point: how this change interacts with main's texture-cache release.

What changed since my last review

  • Rebase. 48b6bc5d12 now passes the category argument that main added to BufferPool::Take. Otherwise its logic is unchanged. 0ac7f6d55e (the reclaim skip) is identical to the commit I reviewed before.
  • New commit 7cd426f00f. main's e2c1c305ff added a texture-cache release to DeviceMemoryType before it falls back to host memory. That code re-read the budget through locals this PR removed. It now calls ReportedHeap(heap) again after a release and applies the same fit test.
  • 53570aa5ff merges main 4f41f4c. The only conflict was in tests/BufferPool.cpp. The resolution keeps IdleReclaimSkipsHostPlaced and its call in main().
  • Description. It now has the matched SuperTuxKart pairs on main aaccd0ba39 and head 28f80c25a9, and it claims only the removed allocation churn, not a frame-rate gain. The GPUs tested line now names the RTX 5060 Ti too.

What I ran

Head 53570aa5ffeabb0b4b49dd951649de8a5afa0e71, main 4f41f4c375f5abb487dbd184fbc150f31994d762, merged tree 25ccd1a440c2976735630c9f7f144eb5981ffc72. Machine: Debian 13 VM, 2× Xeon Gold 6136, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6, LLVM 19).

git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...53570aa5ffeabb0b4b49dd951649de8a5afa0e71
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762

# negative control: BufferPool.hpp, Context.hpp, BufferPool.cpp, Resources.cpp from main; PR tests kept
git show 4f41f4c375f5abb487dbd184fbc150f31994d762:<path> > <path>
ninja -C build agc_buffer_pool_tests agc_driver_native_multisample_depth_tests
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \
  ctest --test-dir build -j8 -V --output-on-failure \
  -R '^(agc_buffer_pool|agc_buffer_pool_small_device_shared|agc_buffer_pool_small_device_no_staging|agc_driver_native_depth_uniform_planes)$'

# restore the merged files, rebuild, rerun
git show 25ccd1a440c2976735630c9f7f144eb5981ffc72:<path> > <path>
ninja -C build agc_buffer_pool_tests agc_driver_native_multisample_depth_tests agc_device_memory_fallback_tests
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -j8 -V --output-on-failure \
  -R '^(agc_buffer_pool|agc_buffer_pool_small_device_shared|agc_buffer_pool_small_device_no_staging|agc_device_memory_fallback|agc_driver_native_depth_uniform_planes)$'
git status --porcelain
Check Result
git diff --check Clean, exit 0
check_conventions.py All conventions checks passed.
Build and libs, merged tree (script) OK
Selected tests, merged tree (script) 2173 run, 2052 passed, 114 expected skips, 0 new failures. All 7 failures also fail on main: the denormal/division agc_driver_* tests, vector_constant_factor_tininess and one unwrap_self test.
Validation comparison (script) Layer loaded in 769/770 tests. One "new" ID, VUID-vkCmdDispatch-groupCountX-00386 in agc_driver_native_depth_uniform_planes, a test that is newer than the baseline. It comes from main; see below.
Focused tests, merged tree, with validation 5/5 passed (agc_buffer_pool 0.49 s)
Negative control agc_buffer_pool fails with 3 messages; see below
Worktree after restore git status --porcelain empty
VUID check with main's production files

With the four production files restored from main, agc_driver_native_depth_uniform_planes reports the same 4× VUID-vkCmdDispatch-groupCountX-00386 as on the merged tree. The test was added on main by c9987271e3, after the validation baseline d1ae628bc2. The message comes from main, not from this PR.

Negative control

I restored BufferPool.hpp, Context.hpp, BufferPool.cpp and Resources.cpp from main and kept the PR's tests/BufferPool.cpp. agc_buffer_pool fails; the two small-device modes still pass:

FAIL: a device buffer placed in host memory was not kept in the pool after its release
FAIL: a device buffer over the device-local budget did not reuse the retained host-placed buffer
FAIL: idle device reclaim freed the host-placed buffer instead of the idle device-local one

After restoring the merged files and rebuilding, all 5 tests pass.

Previous findings

  1. A refused host-placed slot is put back as the newest slot and counted as a hit. Still open, non-blocking. Resources.cpp L179-L186 still calls cache->Put(*pooled), and Put gives the slot a fresh ++clock (BufferPool.cpp L589).
  2. DeviceLocalFits(~0u, capacity) does not test what the fresh path tests. Still open, non-blocking. The fresh path uses the buffer's memoryTypeBits and the alignment-rounded ClassAllocationBytes.
  3. GPUs tested line vs the validation evidence. Resolved for the checklist: the line now names the RTX 5060 Ti next to the 860M. The author has not posted a main-side layer run on the 5060 Ti. The lavapipe comparison here, the AMD RX 6300 CI comment on this exact head, and the earlier NVIDIA runs show no new IDs, which covers that gap.
  4. Overlap with #4472. Still open, non-blocking. The description still records it and leaves the order to be agreed.

The perf evidence MarcZX10 asked for is now posted (three PR runs and two main runs, with summary lines, traces and digests). It supports the narrowed claim that 8192+ host placements per run drop to 3. I accept those numbers as author-reported; I could not reproduce them.

New findings

Blocking

None.

Non-blocking

  1. The host-slot probe skips main's texture-cache release, so a retained host slot now wins over a device-local placement that the cache release could make possible. Since e2c1c305ff, a fresh over-budget request first asks the texture caches for the request plus the heap's overage. If they release enough, or the budget read again has room, the request stays device-local (Context.hpp L357-L372). The probe in Resources.cpp L182 only reads the budget through DeviceLocalFits. While a matching host-placed slot exists, the cache release never runs for that size, and the buffer stays in host memory. This contradicts two claims in the description: "a buffer still gets device-local memory whenever there is room for it" and "both decide with the same rule". It may be the better trade-off: releasing textures on every 8 MiB request on a permanently full 512 MiB heap could just move the churn into the texture cache. But it was not measured: the captures are on aaccd0ba39, which predates e2c1c305ff (git merge-base --is-ancestor confirms this). Suggested fix: either state that a retained host slot is preferred over a texture-cache release, and add a mock case with cacheReclaim set that pins this, or try the release before taking the host slot.
  2. Minor: the re-check after a release (Context.hpp L368-L371) writes out the fit test by hand instead of calling after.Fits(bytes). The two differ only when the budget is 0, which the first Fits already handled, so behaviour is the same. Calling Fits would keep a single rule.

Not verified

  • The performance numbers. I have no APU with a small carve-out. The host-placement path runs here only in the mock tests.
  • The interaction with the texture-cache release (new finding 1) in a title.
  • Windows and AMD/NVIDIA hardware drivers. I ran on lavapipe only, and launched no title. I did not run the full suite: only the script's selected tests plus the 5 focused tests above.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 3, 2026
LeandroLP23 and others added 2 commits November 3, 2026 12:41
…exture-cache release

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eapReport::Fits

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LeandroLP23

Copy link
Copy Markdown
Contributor Author

Thanks @XairRrR. Both new points are addressed at d845d4bfc5:

  1. Host slot vs texture-cache release. I kept the order: a matching host-placed slot is taken without asking the caches to release room first. A release for every such request on a heap that stays over budget would move the churn into the texture caches, and trying it first has a second cost: when the release succeeds but the reported budget doesn't show it yet, the slot would go back to the pool and the new allocation would still land in host memory. The description now says this, drops "whenever there is room" for "whenever the reported budget has room", and notes that the captures predate e2c1c305ff, so the order is not measured in a title. bd4354ef0c adds HostSlotBeforeCacheRelease. It retains a host-placed buffer and then sets a release that would free any amount. The next request of that size takes the retained buffer without calling the release, and a new request of another size calls it once and gets device-local memory. With the probe in Resources.cpp changed to try the release before taking the slot, all three checks fail.
  2. Re-check after a release. d845d4bfc5 uses after.Fits(bytes).

agc_buffer_pool, its two small-device modes, the three agc_memory_accounting tests and agc_device_memory_fallback pass, 7/7, on the Radeon 860M laptop (Windows 11, WinLibs GCC, Release). Conventions pass.

AI-assisted: yes (Claude Code)

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 53570aa merged onto main 4f41f4c · tested 2026-11-03 11:49 UTC · 33 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,704 passed · 5 failed (0 new, 2 also fail on main, 3 unstable on main) · 48 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,757 of 3,811 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 (929 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s, ⚠️ agc_driver_lazy_resolved_abi 30.8 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 4 of the last 10 main runs
agc_submit_progress: failed in 6 of the last 10 main runs
agc_submit_progress_no_timeline: failed in 5 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 (9 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, agc_driver_stencil_null_feedback, and 1 more
VUID-vkCmdCopyImage-srcImage-01551 (9 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, agc_driver_stencil_null_feedback, and 1 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_srgb8_color_target
Skipped (48)
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_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
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_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 co
Reproduce
git fetch origin 53570aa5ffeabb0b4b49dd951649de8a5afa0e71 4f41f4c375f5abb487dbd184fbc150f31994d762
git checkout 4f41f4c375f5abb487dbd184fbc150f31994d762 && git merge --no-ff 53570aa5ffeabb0b4b49dd951649de8a5afa0e71
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.

@XairRrR XairRrR left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-checked — approved

Since my last review, bd4354ef0c adds HostSlotBeforeCacheRelease, which pins the order between a retained host-placed slot and main's texture-cache release. d845d4bfc5 replaces the hand-written re-check after a release with after.Fits(bytes). The description now states the order and that the captures predate e2c1c305ff. Both points I raised last time are addressed. The new test fails in both negative controls, and nothing blocking remains.

What changed since my last review

  • bd4354ef0c (test only). HostSlotBeforeCacheRelease retains a 176 MiB host-placed buffer, then installs a cacheReclaim that releases any amount and counts its calls. It checks two things. First, a new request of the same size reuses the retained buffer and makes zero release calls. Second, a 64 MiB request, which has no host slot, makes exactly one release call and gets device-local memory.

  • d845d4bfc5. In DeviceMemoryType, the re-check after a partial release is now after.Fits(bytes) (Context.hpp L364-L371). Production code changed nowhere else (git diff 53570aa5ff d845d4bfc5 --stat: 1 line in Context.hpp, 31 lines in tests/BufferPool.cpp).

  • Description. It now says a matching host-placed slot is taken without a cache release, and it gives the reason. "Whenever there is room" became "whenever the reported budget has room". It notes that the order was not measured in a title.

  • Author reply (11:46 UTC). The author kept the order on purpose and gave two reasons:

    • Releasing caches on every request against a heap that stays over budget would move the churn into the texture caches.
    • A release that succeeds before the reported budget catches up would put the slot back and still place the new buffer in host memory.

    I agree with both: the first is the trade-off I raised, and the second is a real cost of the alternative order. With the order now documented and pinned by a test, I withdraw the request.

What I ran

Head d845d4bfc50963a172bbefb624641ed48e704fb5, main 4f41f4c375f5abb487dbd184fbc150f31994d762, merged tree 4abace0fa91fceb7f140487b1aed12fbd3ce130f. Machine: Debian 13 VM, 2× Xeon Gold 6136, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6, LLVM 19).

git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...d845d4bfc50963a172bbefb624641ed48e704fb5
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
git diff 53570aa5ffeabb0b4b49dd951649de8a5afa0e71 d845d4bfc50963a172bbefb624641ed48e704fb5 --stat

# negative control A: the probe tries the texture-cache release before keeping a host slot (Resources.cpp line 182)
#   if (pooled && ((context.cacheReclaim != nullptr && context.cacheReclaim(capacity, true) >= capacity) || context.DeviceLocalFits(~0u, capacity)))
ninja -C build agc_buffer_pool_tests
ctest --test-dir build --output-on-failure -R '^agc_buffer_pool'

# negative control B: BufferPool.hpp, Context.hpp, BufferPool.cpp, Resources.cpp from main; PR tests kept
git show 4f41f4c375f5abb487dbd184fbc150f31994d762:<path> > <path>
ninja -C build agc_buffer_pool_tests
ctest --test-dir build --output-on-failure -R '^agc_buffer_pool'

# restore merged files, rebuild, focused run with the layer requested
git show 4abace0fa91fceb7f140487b1aed12fbd3ce130f:<path> > <path>
git status --porcelain
ninja -C build agc_buffer_pool_tests agc_device_memory_fallback_tests
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -j8 --test-load 32 -V --output-on-failure \
  -R '^(agc_buffer_pool|agc_buffer_pool_small_device_shared|agc_buffer_pool_small_device_no_staging|agc_device_memory_fallback|agc_memory_accounting.*)$'
Check Result
git diff --check Clean, exit 0
check_conventions.py All conventions checks passed.
Build and libs, merged tree (script) OK
Selected tests, merged tree (script) 2173 run, 2052 passed, 114 expected skips, 0 new failures. The 7 failures (the denormal/division agc_driver_* tests, vector_constant_factor_tininess and one unwrap_self test) also fail on main.
Validation comparison (script) The layer loaded in 769/770 tests. One ID is listed as new: VUID-vkCmdDispatch-groupCountX-00386 in agc_driver_native_depth_uniform_planes. That test is newer than the baseline d1ae628bc2. My last review reproduced this ID with main's production files, and the one production line changed since cannot reach a dispatch. It is not counted against this PR.
Focused tests, merged tree 7/7 passed (agc_buffer_pool 0.55 s). No VUID- lines and no was not found but was requested lines. These are mock-device tests.
Negative control A (release first) agc_buffer_pool fails with the 3 new messages
Negative control B (production from main) agc_buffer_pool fails with 6 messages
Worktree after restore git status --porcelain empty
Negative control output

A, release tried before keeping the host slot:

FAIL: a retained host-placed buffer was passed over for a texture-cache release
FAIL: taking a retained host-placed buffer asked the texture caches to release memory
FAIL: a new device buffer over the device-local budget did not get device-local memory after the texture caches released room

B, production files from main:

FAIL: a device buffer placed in host memory was not kept in the pool after its release
FAIL: a device buffer over the device-local budget did not reuse the retained host-placed buffer
FAIL: a retained host-placed buffer was passed over for a texture-cache release
FAIL: taking a retained host-placed buffer asked the texture caches to release memory
FAIL: a new device buffer over the device-local budget did not get device-local memory after the texture caches released room
FAIL: idle device reclaim freed the host-placed buffer instead of the idle device-local one

In both runs, agc_buffer_pool_small_device_shared and _no_staging passed. Control A confirms the author's statement that all three checks fail.

Previous findings

  1. A refused host-placed slot is put back as the newest slot and counted as a hit. Still open, non-blocking. Resources.cpp L179-L186 is unchanged.
  2. DeviceLocalFits(~0u, capacity) does not test what the fresh path tests (the fresh path uses memoryTypeBits and ClassAllocationBytes). Still open, non-blocking. The code is unchanged.
  3. GPUs tested line. Resolved in my last review. Nothing changed.
  4. Overlap with #4472. Still open, non-blocking. The description still records it, and the order still has to be agreed.
  5. The host-slot probe skips main's texture-cache release. Resolved. The order is now intentional and documented in the description. HostSlotBeforeCacheRelease pins it, and that test fails when the order is reversed (control A).
  6. Minor: the re-check after a release is written out by hand. Resolved. It now calls after.Fits(bytes) (Context.hpp L368-L371).

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • The performance numbers. The SuperTuxKart captures on the Radeon 860M are author-reported. I have no APU with a small carve-out, and the host-placement path runs here only in the mock tests.
  • The cache-release order in a title. The author states this too: the captures predate e2c1c305ff.
  • Windows and AMD/NVIDIA hardware drivers. I ran on lavapipe only, and launched no title. I did not rerun agc_driver_native_depth_uniform_planes with main's files on this head; the attribution to main rests on my previous run.
  • The author's 7/7 on the 860M is accepted as author-reported.

@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head d845d4b merged onto main 4f41f4c · tested 2026-11-03 12:20 UTC · 19 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,704 passed · 5 failed (0 new, 2 also fail on main, 3 unstable on main) · 48 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,757 of 3,811 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 (929 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s, ⚠️ agc_driver_lazy_resolved_abi 43.2 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 4 of the last 10 main runs
agc_driver_submit_progress: failed in 5 of the last 10 main runs
agc_submit_progress: 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 (9 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, agc_driver_stencil_null_feedback, and 1 more
VUID-vkCmdCopyImage-srcImage-01551 (9 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, agc_driver_stencil_null_feedback, and 1 more
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_srgb8_color_target
Skipped (48)
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_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
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_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 co
Reproduce
git fetch origin d845d4bfc50963a172bbefb624641ed48e704fb5 4f41f4c375f5abb487dbd184fbc150f31994d762
git checkout 4f41f4c375f5abb487dbd184fbc150f31994d762 && git merge --no-ff d845d4bfc50963a172bbefb624641ed48e704fb5
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* perf numbers missing perf pull request without a before and after summary line perf Performance change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants