Skip to content

perf(agc): demand-driven texture cache budgets behind a switch - #22580

Merged
oneandonlydean merged 3 commits into
boykopovar:mainfrom
oneandonlydean:perf/agc-texture-budget-demand
Nov 18, 2026
Merged

oneandonlydean merged 3 commits into
boykopovar:mainfrom
oneandonlydean:perf/agc-texture-budget-demand

Conversation

@oneandonlydean

Copy link
Copy Markdown
Collaborator

What

An experiment for the texture thrash reported in #17533 and #12575, behind APS5_TEXTURE_BUDGET_DEMAND=1. Without the variable nothing changes.

Background: the automatic sampled texture budget is the heap budget minus the other device memory in use, minus a reservation for the storage image cache, minus an eighth of the heap budget. The reservation is the larger of a quarter of the heap and what the storage image cache holds. On a 12 GiB card in the pirate island level of PPSA21564 that is 10105 - 2769 - 3072 - 1263 = 3001 MiB for a level that holds about 5.9 GiB of sampled textures, while the storage image cache holds 1282 MiB of its 3072 MiB reservation. The storage image budget in turn subtracts everything the sampled cache holds, so it shrinks under what it holds once the sampled cache is allowed to grow.

With the switch:

  • The sampled budget reserves what the storage image cache holds plus 256 MiB instead of a quarter of the heap.
  • The storage image budget counts at most 2 GiB of sampled textures against itself, so storage images keep priority and the sampled cache yields when they grow.
  • Both keep a sixteenth of the heap budget free instead of an eighth.

On the numbers above the sampled budget becomes about 5170 MiB instead of 3001 MiB. APS5_TEXTURE_CACHE_MIB still overrides both.

Tested

Linux, built on b9e3cbbc0c. agc_driver_graphics passes with new assertions in sampledTextureBudgetTests for a 12 GiB heap: the default and the switch arm of both formulas, the sampled budget staying put when the cache fills it, the sampled budget yielding to storage images that grow, and both floors. The sampled and storage cache budget tests pass.

What the budget is worth, measured on main b9e3cbbc0c with forced budgets (RTX 4090, PPSA21564 pirate island, one perf window, profiled 300 s arms, medians of the last twelve 10 s windows, one arm each):

Arm Frame p50 Presents per 10 s Sampled snapshots created
default (8332 MiB, 5340 MiB held) 247.6 ms 41 1632
APS5_TEXTURE_CACHE_MIB=3072 3995.3 ms 3 108719
APS5_TEXTURE_CACHE_MIB=4608 1380.4 ms 8 66882
APS5_TEXTURE_CACHE_MIB=5632 252.4 ms 40 1873

So the cost falls steeply as the budget approaches what the level holds and is gone once it fits.

Not tested: the switch itself on a card where it changes the outcome. On my 24 GiB card the default budget already holds the level. On 12 GiB the switch still leaves the budget under what the level holds, so I expect less thrash there, not none; a 16 GiB card should move from the edge to a clear fit. The run that would settle it is the same scene with APS5_PROFILE_DRAW=1, default against APS5_TEXTURE_BUDGET_DEMAND=1, reading the [gpu] sampled texture cache budget line, the [textures] sampled created line and the frame time, and watching for failed allocations.

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 and the licence notice of code adapted from upstream
  • Unimplemented paths throw; silent stubs are listed under Silent stubs in their library's technical debt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none (see perf: heavy 3D titles are bound by per-draw work in the draw path; a direct path that reads descriptors on the GPU #17533)
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 4090, driver 610.57.04, Linux
  • AI-assisted: yes

…DGET_DEMAND

The sampled texture budget reserves what the storage image cache holds
plus 256 MiB instead of a quarter of the heap, the storage image budget
counts at most 2 GiB of sampled textures against itself, and both keep a
sixteenth of the heap budget free. Default off.
@github-actions github-actions Bot added docs agc libSceAgc* perf Performance change perf numbers missing perf pull request without a before and after summary line labels Nov 17, 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.

@JJenkx

JJenkx commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Found a feature-on fixture failure on Linux/RADV while preparing the requested lower-VRAM title comparison.

On PR head 9ac2391225cc7848d786ff4a455e054b9138d43e integrated onto main 291a878fd2218c58a2c28524eb1cd8f00221a868 (8214ef9c84837cf4a28975855dcb614496ea16d0):

  • Main/default and this PR/default both pass the same 25 focused cases.
  • With APS5_TEXTURE_BUDGET_DEMAND=1, 24/25 pass. agc_driver_sampled_cache_budget_memory stops at the sampled texture cache budget does not count its cached texture as the cache's own memory.
  • ExpectedBudget still calls the pure formula with its default demand=false, whereas the live getter uses the enabled formula. The storage-pressure expectation in that same fixture also assumes eight GiB of headroom; the enabled formula uses four GiB for its deterministic 64 GiB reported budget.

Support commit a641d0cd71875405c7d4b0ef590dc743ce840860 updates the fixture reference to the selected mode, adjusts the storage-pressure headroom expectation and adds agc_driver_sampled_cache_budget_memory_demand. The existing memory case explicitly selects 0; the new case selects 1, including the Windows runtime PATH property. It changes only the two test files; production code is unchanged.

Same frozen production SDK 8214ef9c8483 26-case suite including the new explicit demand case
original fixture 25 pass; only the new demand-memory case fails at the assertion above
corrected fixture, default environment 26/26 pass
corrected fixture, global demand enabled 26/26 pass

Each 26-case arm has 23 Vulkan cases and three CPU cases (PM4 protocol, device selection and the Graphics formula/mock fixture). Linux 7.2.14, Ryzen 9 7950X, RX 6650 XT 8 GB / RADV Mesa 26.2.7, Khronos layer 1.4.363; required Vulkan and disabled shader caches. Loader/device evidence is checked for every Vulkan case. Zero skips, VUIDs or validation errors. The memory tests use deterministic mocked heap-budget queries while allocating actual Vulkan textures; these are correctness results, not physical-VRAM performance measurements. All frozen SDK/fixture hashes and kernel restoration checks pass. The fixture was rebuilt separately, without another SDK rebuild. Conventions pass against the parent and origin/main.

Fetchable integration and support commit. Build/test logs, JUnit, actual CMake registrations, loader bindings, manifests, patch and production-equivalence proof, SHA-256 18c79c03e32ebf2e765bdc562d3fc12a42d07e5edb9cd33db9a13c493618dd32 (downloaded and all payload hashes verified).

No feature-on title performance or gameplay gain is established yet. The pirate-island pilot with the separate #12575 integration reached its arrival sequence at severe cache pressure, so I am working on reaching a repeatable scene before supplying a performance comparison.

AI-assisted: yes.

@github-actions

github-actions Bot commented Nov 18, 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 20041 core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_sampled_cache_budget_tests.cmake L47

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 1395 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 1896 docs/dev/ENVIRONMENT.md
PR 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4472 docs/dev/ENVIRONMENT.md
PR 5925 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6186 docs/dev/ENVIRONMENT.md
PR 6192 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6235 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6280 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6340 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6412 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6804 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7256 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7275 docs/dev/ENVIRONMENT.md
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_sampled_cache_budget_tests.cmake
core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpp
docs/dev/ENVIRONMENT.md
PR 7643 docs/dev/ENVIRONMENT.md
PR 7689 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 8246 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/ENVIRONMENT.md
PR 9345 docs/dev/ENVIRONMENT.md
PR 9356 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/ENVIRONMENT.md
PR 9387 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/ENVIRONMENT.md
PR 9508 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_sampled_cache_budget_tests.cmake
core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpp
docs/dev/ENVIRONMENT.md
PR 9712 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/ENVIRONMENT.md
PR 9852 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 9895 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_sampled_cache_budget_tests.cmake
core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpp
docs/dev/ENVIRONMENT.md
PR 10442 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 10443 docs/dev/ENVIRONMENT.md
PR 10743 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 11435 docs/dev/ENVIRONMENT.md
PR 11436 docs/dev/ENVIRONMENT.md
PR 11444 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 12324 docs/dev/ENVIRONMENT.md
PR 12575 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpp
PR 12746 docs/dev/ENVIRONMENT.md
PR 12849 docs/dev/ENVIRONMENT.md
PR 12944 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 13796 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 13920 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
docs/dev/ENVIRONMENT.md
PR 13928 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_sampled_cache_budget_tests.cmake
core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpp
docs/dev/ENVIRONMENT.md
PR 13929 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_sampled_cache_budget_tests.cmake
core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpp
docs/dev/ENVIRONMENT.md
PR 13963 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 14032 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 14944 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 15529 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 15548 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/ENVIRONMENT.md
PR 15570 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/ENVIRONMENT.md
PR 16793 docs/dev/ENVIRONMENT.md
PR 16831 docs/dev/ENVIRONMENT.md
PR 17259 docs/dev/ENVIRONMENT.md
PR 17557 docs/dev/ENVIRONMENT.md
PR 17558 docs/dev/ENVIRONMENT.md
PR 17611 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/ENVIRONMENT.md
PR 17729 docs/dev/ENVIRONMENT.md
PR 17915 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 17956 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 18173 docs/dev/ENVIRONMENT.md
PR 18226 docs/dev/ENVIRONMENT.md
PR 19100 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 19445 docs/dev/ENVIRONMENT.md
PR 20187 docs/dev/ENVIRONMENT.md
PR 20315 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/ENVIRONMENT.md

@oneandonlydean

Copy link
Copy Markdown
Collaborator Author

@JJenkx you are right, the memory fixture took its reference from the default formula while the getter followed the switch. I picked a641d0cd71 onto the branch as 6a66582c1c. Here agc_driver_sampled_cache_budget_memory and the new agc_driver_sampled_cache_budget_memory_demand both pass, with the other five cache budget tests (RTX 4090, Linux).

On the title comparison: APS5_TEXTURE_CACHE_MIB=3072 gave me a repeatable thrash in the pirate island level on a card that otherwise fits it, in case a forced budget helps you reach a stable scene.

@github-actions github-actions Bot added the build label Nov 18, 2026
@JJenkx

JJenkx commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Actual 8 GB title measurements, in A–B–A order, after the fixture coverage refresh above. These are exploratory results with the observed headroom and camera differences retained.

ASTRO BOT PPSA21564 01.018.000, -lvl big_hand_pirate_island, 3840×2160, no pad input, fresh saves. The camera is the DualSpeeder approach above the sea facing the island/wreck. Each arm receives a private verified copy of the same 8,965-file warm-pirate shader/Mesa cache seed. Linux 7.2.14, Ryzen 9 7950X, RX 6650 XT 8 GB / RADV Mesa 26.2.7. These native performance runs use the ordinary driver; the separate validation results are in the previous comment.

  • A1/A2: plain main 291a878fd2218c58a2c28524eb1cd8f00221a868, flag 0.
  • B1: only this PR (9ac2391225cc) integrated onto that main, 8214ef9c84837cf4a28975855dcb614496ea16d0, flag 1. No perf(agc): reuse a texture the sampled cache refuses while frames keep using it #12575/private rendering stack is included. The support commit changes test files only and is absent from the frozen production SDK.
  • All three runs close normally after about 383–385 s, with native/observer exit 0, no remaining native processes, and unchanged asset/input/cache-seed/SDK checks plus restored kernel settings. The trace request is APS5_TRACE_SECONDS=260:60; the producer records complete frame boundaries, so the actual durations below extend past sixty seconds.
Run Presents Actual trace window, s Frame p50, ms Resources.Complete, ms/present Initial reported heap budget, MiB Reported heap-budget range, MiB Sampled-budget range, MiB
A1 (main) 3 79.924 25835.978 23079.244 5256 4933–5521 2048–2490
B1 (enabled) 13 60.836 3258.992 2601.914 6133 6071–8176 2241–5407
A2 (main) 3 74.652 24333.323 22996.025 6844 6655–6846 2048–3879

Allocation-pressure result: B1 logs device-local allocations falling back to host memory as the heap reaches its reported budget. The last such report says eight allocations / 27 MiB, a lower bound because this logger prints the first five and then powers of two. Neither control has a placed in host memory marker in its retained GPU allocation reports. B1 still closes normally. This is another reason to retain the experimental default-off scope while judging the result.

Both main controls remain slow, while the enabled arm has lower measured frame times and less resource preparation per present. A2 starts with more reported heap budget than B1, so the first pair's result cannot simply be explained by the enabled run starting with more available budget. During B1 the reported budget grows further; these recordings do not distinguish policy/residency feedback from outside GPU memory use. The enabled late image also shows more sky/horizon than the two controls. I therefore do not infer a reliable percentage gain or a general 8 GB recommendation from this series. All three arms and captures are supplied, including the first lower-headroom control. No landing or gameplay qualification is claimed.

Full three-arm traces, original native captures near/after the trace window, producer summaries, trace_digest.py output, budget/allocation profile lines, counters, exact local harness/protocol, frozen source/binary manifests and A2 DRM snapshots, SHA-256 23f9e97900b07a0e9a8d760939cff6d09bf7c1bdb538bbc477740da4c123dc33. No game assets, saves, shader caches or SDK binaries are included. The read-only DRM snapshots cover A2 only; they do not supply a missing B1 ownership comparison.

Producer summary lines, copied as recorded:

A1

{"commit":"291a878fd221","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PROFILE_DRAW":"1","APS5_SCREENSHOT_TRIGGER":"<path>","APS5_TEXTURE_BUDGET_DEMAND":"0","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_MEMORY_BUDGET":"1","APS5_TRACE_SECONDS":"260:60"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.7-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.018.000","resolution":"3840x2160","window":{"spec":"seconds 260:60","first_present":705,"ms":79924.471},"presents":3,"frame_ms":{"p50":25835.978,"p90":29681.033,"p99":29681.033,"max":29681.033},"gpu_busy_ms_per_present":1686.110,"worker_busy_pct":{"queue worker 0x0":99.938,"queue worker 0x48":69.526,"queue worker 0x40":67.713,"queue worker 0x46":0.008},"phase_totals_ms":{"Driver.Completion":0.232,"Driver.Dispatch":7479.683,"Driver.Dispatch.capture_resources":9.020,"Driver.Dispatch.decode_key_device_setup":7332.872,"Driver.Dispatch.lookup_cache":9.084,"Driver.Dispatch.materialize":1.871,"Driver.Dispatch.prepared_invocation":0.987,"Driver.Draw":71275.661,"Driver.Draw.device_setup":45.014,"Driver.Draw.draw_enqueued":68895.355,"Driver.Draw.post_compile_prepare":7.710,"Driver.Draw.prepare":145.285,"Driver.Draw.shader_compile_and_link":868.258,"Driver.EndSubmission":16.014,"Driver.Packet":189553.293,"Driver.Packet.device_lock":2.983,"Driver.Packet.dispatch":7481.322,"Driver.Packet.draw":71291.283,"Driver.Packet.execute":90.107,"Driver.Packet.flip_flush":0.696,"Driver.Packet.flush_between_packets":30.451,"Driver.Packet.memory_wait":109482.794,"Driver.Packet.pipeline_drain":112.679,"Driver.Packet.pipeline_prepare":7.764,"Driver.Packet.prepare_memory":132.588,"Driver.Packet.rendering_wait":0.024,"Driver.Present":137.260,"Driver.Present.acquire_image":0.171,"Driver.Present.device_setup":0.003,"Driver.Present.gpu_mutex_wait":0.406,"Driver.Present.inflight_wait":0.009,"Driver.Present.present_display_buffer":1.020,"Driver.Present.queue_present":0.057,"Driver.Present.release_and_callback":0.009,"Driver.Present.render_fence_wait":135.544,"Driver.Present.resize":0.006,"Driver.Present.validate":0.001,"Driver.Suspend":0.001,"GpuMutex.wait.dispatch":38.299,"GpuMutex.wait.draw":30.731,"GpuMutex.wait.end":18.321,"GpuMutex.wait.fill":0.016,"GpuMutex.wait.flush":17.256,"GpuMutex.wait.hook":9.119,"GpuMutex.wait.indirect":0.078,"GpuMutex.wait.label":76.872,"GpuMutex.wait.other":6.539,"GpuMutex.wait.present":0.165,"GpuMutex.wait.wait":0.088,"Graphics.Draw":77260.056,"Graphics.Draw.draw_and_resource_release":58343.104,"Graphics.Draw.index_upload":158.306,"Graphics.Draw.validate":386.664,"Graphics.Draw.vertex_upload":89.035,"Graphics.DrawWithRecipe":397.635,"Graphics.DrawWithRecipe.draw_and_resource_release":363.339,"Graphics.DrawWithRecipe.index_upload":1.173,"Graphics.DrawWithRecipe.validate":14.328,"Graphics.DrawWithRecipe.vertex_upload":8.207,"Recorder.Reap":134.990,"Recorder.Submit":1046.964,"Recorder.WaitSerial":71.061,"Resources.Complete":69237.731,"Resources.Prepare":520.290,"Shader.DrawStage":743.555,"Shader.DrawStage.capture_resources":204.476,"Shader.DrawStage.materialize":498.079,"Shader.DrawStage.prepared_invocation":38.501,"Shader.ResolveAbi":0.714,"Shader.ResolveGraphicsAbi":0.205,"Shader.ResolveGraphicsStagesAbi":5.418,"VideoOut.Flip":110.693,"VideoOut.Flip.completion_mutex_wait":0.002,"VideoOut.Flip.config_mutex_wait":0.000,"VideoOut.Flip.frame_limit":0.005,"VideoOut.Flip.notify_game":0.272,"VideoOut.Flip.present":110.224,"VideoOut.Flip.validate":0.004,"VideoOut.Flip.vblank_wait":0.002,"VideoOut.Flip.window_prepare":0.007,"VideoOut.Flip.window_title":0.178,"VideoOut.Readiness":0.013,"VideoOut.Readiness.locks_validate":0.006,"Vulkan.Acquire":0.164,"Vulkan.Acquire.acquire_fence_wait":0.028,"Vulkan.Acquire.acquire_image":0.110,"Vulkan.Acquire.fence_reset":0.023,"Vulkan.Acquire.retired_swapchains":0.001,"Vulkan.Dispatch":50.802,"Vulkan.Dispatch.command_record":4.853,"Vulkan.Dispatch.shader_resources":45.477,"Vulkan.DispatchRecipe":3.806,"Vulkan.DispatchRecipe.command_record":3.772,"Vulkan.DrawFromRecipe":408.776,"Vulkan.GraphicsPipeline":3834.149,"Vulkan.GraphicsPipeline.create":3796.681,"Vulkan.GraphicsPipeline.modules_and_state":37.342,"Vulkan.GraphicsPipelineLibrary":3781.070,"Vulkan.GraphicsPipelineLink":3.365,"Vulkan.Present":0.801,"Vulkan.Present.command_record_scale":0.247,"Vulkan.Present.pixel_upload":0.008,"Vulkan.Present.queue_submit":0.543,"Vulkan.QueuePresent":0.051,"Vulkan.QueuePresent.queue_present":0.049,"Vulkan.Retire":135.541,"Vulkan.Retire.dump":98.966,"Vulkan.Retire.wait":36.462},"top_phases_ms_per_frame":{"Driver.Packet":63184.431,"Driver.Packet.memory_wait":36494.265,"Graphics.Draw":25753.352,"Driver.Packet.draw":23763.761,"Driver.Draw":23758.554,"Resources.Complete":23079.244,"Driver.Draw.draw_enqueued":22965.118,"Graphics.Draw.draw_and_resource_release":19447.701},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":96,"Graphics.Barrier.dcc-clear":36,"Graphics.Barrier.dcc-keys":36,"Graphics.Barrier.dispatch-lead":297,"Graphics.Barrier.dispatch-trail":589,"Graphics.Barrier.draw":5866,"Graphics.Barrier.fill":117,"Graphics.Barrier.fill-clear":46,"Graphics.Barrier.indirect-args":27,"Graphics.Barrier.label-run":16833,"Graphics.Barrier.present-blit":6,"Graphics.Barrier.shadow-publish":37,"Graphics.Barrier.staging-in":464,"Graphics.Barrier.staging-out":202,"Graphics.Barrier.storage-upload":606,"Graphics.Barrier.storage-writeback":604,"Graphics.BarrierMerged.dispatch-lead":346,"Graphics.BarrierMerged.fill":27,"Graphics.BarrierMerged.label-run":12,"Graphics.BarrierMerged.shadow-publish":25,"Graphics.BarrierMerged.staging-in":123,"Graphics.BarrierMerged.staging-out":202,"Graphics.BarrierMerged.storage-writeback":92,"Graphics.Copy":9573,"Graphics.Copy.bytes":41311410792,"Graphics.RenderPass":2802,"Graphics.RenderPass.Close.command":1915,"Graphics.RenderPass.Close.image":10,"Graphics.RenderPass.Close.key":7,"Graphics.RenderPass.Close.label":12,"Graphics.RenderPass.Close.new-batch":858,"Graphics.RenderPass.Continued":19278},"trace_dropped":false,"trace":"aps5-trace-291a878fd221-707833.json.gz"}

B1

{"commit":"8214ef9c8483","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PROFILE_DRAW":"1","APS5_SCREENSHOT_TRIGGER":"<path>","APS5_TEXTURE_BUDGET_DEMAND":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_MEMORY_BUDGET":"1","APS5_TRACE_SECONDS":"260:60"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.7-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.018.000","resolution":"3840x2160","window":{"spec":"seconds 260:60","first_present":657,"ms":60836.422},"presents":13,"frame_ms":{"p50":3258.992,"p90":6625.673,"p99":12071.185,"max":12071.185},"gpu_busy_ms_per_present":422.305,"worker_busy_pct":{"queue worker 0x0":99.737,"queue worker 0x48":95.083,"queue worker 0x40":94.476,"queue worker 0x46":0.027},"phase_totals_ms":{"Driver.Completion":0.786,"Driver.Dispatch":1048.211,"Driver.Dispatch.capture_resources":33.180,"Driver.Dispatch.decode_key_device_setup":688.591,"Driver.Dispatch.lookup_cache":8.017,"Driver.Dispatch.materialize":3.630,"Driver.Dispatch.prepared_invocation":3.099,"Driver.Draw":55794.492,"Driver.Draw.device_setup":204.263,"Driver.Draw.draw_enqueued":51936.979,"Driver.Draw.post_compile_prepare":37.965,"Driver.Draw.prepare":565.543,"Driver.Draw.shader_compile_and_link":2503.983,"Driver.EndSubmission":23.489,"Driver.Packet":175989.254,"Driver.Packet.device_lock":18.504,"Driver.Packet.dispatch":1052.110,"Driver.Packet.draw":55864.989,"Driver.Packet.execute":180.945,"Driver.Packet.flip_flush":1.958,"Driver.Packet.flush_between_packets":106.406,"Driver.Packet.memory_wait":114379.767,"Driver.Packet.pipeline_drain":109.540,"Driver.Packet.pipeline_prepare":35.115,"Driver.Packet.prepare_memory":808.356,"Driver.Packet.rendering_wait":0.065,"Driver.Present":96.014,"Driver.Present.acquire_image":0.582,"Driver.Present.device_setup":0.010,"Driver.Present.gpu_mutex_wait":2.566,"Driver.Present.inflight_wait":0.031,"Driver.Present.present_display_buffer":4.205,"Driver.Present.queue_present":0.208,"Driver.Present.release_and_callback":0.020,"Driver.Present.render_fence_wait":88.302,"Driver.Present.resize":0.021,"Driver.Present.validate":0.004,"Driver.Suspend":0.004,"GpuMutex.wait.dispatch":136.980,"GpuMutex.wait.draw":111.373,"GpuMutex.wait.end":13.846,"GpuMutex.wait.fill":0.158,"GpuMutex.wait.flush":28.144,"GpuMutex.wait.hook":23.837,"GpuMutex.wait.indirect":5.322,"GpuMutex.wait.label":141.920,"GpuMutex.wait.other":2.054,"GpuMutex.wait.present":2.511,"GpuMutex.wait.wait":2.972,"Graphics.Draw":50806.907,"Graphics.Draw.draw_and_resource_release":39375.167,"Graphics.Draw.index_upload":379.327,"Graphics.Draw.validate":837.941,"Graphics.Draw.vertex_upload":260.738,"Graphics.DrawWithRecipe":2342.134,"Graphics.DrawWithRecipe.draw_and_resource_release":2161.797,"Graphics.DrawWithRecipe.index_upload":9.222,"Graphics.DrawWithRecipe.validate":76.419,"Graphics.DrawWithRecipe.vertex_upload":38.805,"Recorder.Reap":638.937,"Recorder.Submit":3348.084,"Recorder.WaitSerial":625.338,"Resources.Complete":33824.884,"Resources.Prepare":445.262,"Shader.DrawStage":1973.708,"Shader.DrawStage.capture_resources":855.008,"Shader.DrawStage.materialize":980.862,"Shader.DrawStage.prepared_invocation":127.892,"Shader.ResolveAbi":2.843,"Shader.ResolveGraphicsAbi":0.921,"Shader.ResolveGraphicsStagesAbi":23.375,"VideoOut.Flip":91.802,"VideoOut.Flip.completion_mutex_wait":0.012,"VideoOut.Flip.config_mutex_wait":0.001,"VideoOut.Flip.frame_limit":0.010,"VideoOut.Flip.notify_game":0.517,"VideoOut.Flip.present":90.600,"VideoOut.Flip.validate":0.025,"VideoOut.Flip.vblank_wait":0.010,"VideoOut.Flip.window_prepare":0.024,"VideoOut.Flip.window_title":0.597,"VideoOut.Readiness":0.029,"VideoOut.Readiness.locks_validate":0.019,"Vulkan.Acquire":0.538,"Vulkan.Acquire.acquire_fence_wait":0.022,"Vulkan.Acquire.acquire_image":0.421,"Vulkan.Acquire.fence_reset":0.087,"Vulkan.Acquire.retired_swapchains":0.006,"Vulkan.Dispatch":79.687,"Vulkan.Dispatch.command_record":15.682,"Vulkan.Dispatch.shader_resources":62.970,"Vulkan.DispatchRecipe":8.251,"Vulkan.DispatchRecipe.command_record":7.760,"Vulkan.DrawFromRecipe":2407.880,"Vulkan.GraphicsPipeline":8743.895,"Vulkan.GraphicsPipeline.create":8710.622,"Vulkan.GraphicsPipeline.modules_and_state":33.040,"Vulkan.GraphicsPipelineLibrary":8691.497,"Vulkan.GraphicsPipelineLink":4.284,"Vulkan.Present":3.588,"Vulkan.Present.command_record_scale":0.491,"Vulkan.Present.pixel_upload":0.186,"Vulkan.Present.queue_submit":2.895,"Vulkan.QueuePresent":0.189,"Vulkan.QueuePresent.queue_present":0.177,"Vulkan.Retire":88.293,"Vulkan.Retire.dump":10.820,"Vulkan.Retire.wait":77.135},"top_phases_ms_per_frame":{"Driver.Packet":13537.635,"Driver.Packet.memory_wait":8798.444,"Driver.Packet.draw":4297.307,"Driver.Draw":4291.884,"Driver.Draw.draw_enqueued":3995.152,"Graphics.Draw":3908.224,"Graphics.Draw.draw_and_resource_release":3028.859,"Resources.Complete":2601.914},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":201,"Graphics.Barrier.dcc-clear":156,"Graphics.Barrier.dcc-keys":156,"Graphics.Barrier.dispatch-lead":1222,"Graphics.Barrier.dispatch-trail":2561,"Graphics.Barrier.draw":19539,"Graphics.Barrier.fill":527,"Graphics.Barrier.fill-clear":252,"Graphics.Barrier.indirect-args":117,"Graphics.Barrier.label-run":134193,"Graphics.Barrier.present-blit":26,"Graphics.Barrier.shadow-publish":119,"Graphics.Barrier.staging-in":1010,"Graphics.Barrier.staging-out":787,"Graphics.Barrier.storage-upload":911,"Graphics.Barrier.storage-writeback":2324,"Graphics.BarrierMerged.dispatch-lead":1573,"Graphics.BarrierMerged.fill":105,"Graphics.BarrierMerged.label-run":103,"Graphics.BarrierMerged.shadow-publish":67,"Graphics.BarrierMerged.staging-in":564,"Graphics.BarrierMerged.staging-out":787,"Graphics.BarrierMerged.storage-writeback":363,"Graphics.Copy":10158,"Graphics.Copy.bytes":26480696300,"Graphics.RenderPass":8957,"Graphics.RenderPass.Close.command":2414,"Graphics.RenderPass.Close.image":82,"Graphics.RenderPass.Close.key":48,"Graphics.RenderPass.Close.label":103,"Graphics.RenderPass.Close.new-batch":4976,"Graphics.RenderPass.Close.raw":1334,"Graphics.RenderPass.Continued":157363},"trace_dropped":false,"trace":"aps5-trace-8214ef9c8483-748529.json.gz"}

A2

{"commit":"291a878fd221","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_PROFILE_DRAW":"1","APS5_SCREENSHOT_TRIGGER":"<path>","APS5_TEXTURE_BUDGET_DEMAND":"0","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_MEMORY_BUDGET":"1","APS5_TRACE_SECONDS":"260:60"},"gpu":"AMD Radeon RX 6650 XT (RADV NAVI23)","driver":"radv Mesa 26.2.7-arch1.1","os":"Linux 7.2.14-arch1-1","cpu":"AMD Ryzen 9 7950X 16-Core Processor","cpu_threads":32,"memory_mib":127901,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.018.000","resolution":"3840x2160","window":{"spec":"seconds 260:60","first_present":616,"ms":74651.794},"presents":3,"frame_ms":{"p50":24333.323,"p90":28293.892,"p99":28293.892,"max":28293.892},"gpu_busy_ms_per_present":1625.556,"worker_busy_pct":{"queue worker 0x0":99.963,"queue worker 0x40":68.932,"queue worker 0x48":62.110,"queue worker 0x46":0.006},"phase_totals_ms":{"Driver.Completion":0.296,"Driver.Dispatch":2854.073,"Driver.Dispatch.capture_resources":13.525,"Driver.Dispatch.decode_key_device_setup":2757.774,"Driver.Dispatch.lookup_cache":7.132,"Driver.Dispatch.materialize":1.216,"Driver.Dispatch.prepared_invocation":0.712,"Driver.Draw":71032.891,"Driver.Draw.device_setup":38.603,"Driver.Draw.draw_enqueued":70223.704,"Driver.Draw.post_compile_prepare":6.527,"Driver.Draw.prepare":111.598,"Driver.Draw.shader_compile_and_link":520.854,"Driver.EndSubmission":10.771,"Driver.Packet":172443.015,"Driver.Packet.device_lock":2.523,"Driver.Packet.dispatch":2855.348,"Driver.Packet.draw":71046.760,"Driver.Packet.execute":128.660,"Driver.Packet.flip_flush":0.481,"Driver.Packet.flush_between_packets":21.514,"Driver.Packet.memory_wait":97647.690,"Driver.Packet.pipeline_drain":19.364,"Driver.Packet.pipeline_prepare":6.866,"Driver.Packet.prepare_memory":125.324,"Driver.Packet.rendering_wait":0.023,"Driver.Present":70.288,"Driver.Present.acquire_image":0.159,"Driver.Present.device_setup":0.002,"Driver.Present.gpu_mutex_wait":0.205,"Driver.Present.inflight_wait":0.008,"Driver.Present.present_display_buffer":1.181,"Driver.Present.queue_present":0.091,"Driver.Present.release_and_callback":0.025,"Driver.Present.render_fence_wait":68.564,"Driver.Present.resize":0.006,"Driver.Present.validate":0.001,"Driver.Suspend":0.000,"GpuMutex.wait.dispatch":26.767,"GpuMutex.wait.draw":25.619,"GpuMutex.wait.end":5.579,"GpuMutex.wait.fill":0.007,"GpuMutex.wait.flush":13.660,"GpuMutex.wait.hook":5.356,"GpuMutex.wait.indirect":2.273,"GpuMutex.wait.label":20.251,"GpuMutex.wait.other":5.085,"GpuMutex.wait.present":0.168,"GpuMutex.wait.wait":0.191,"Graphics.Draw":73438.866,"Graphics.Draw.draw_and_resource_release":65096.712,"Graphics.Draw.index_upload":93.100,"Graphics.Draw.validate":179.329,"Graphics.Draw.vertex_upload":63.192,"Graphics.DrawWithRecipe":147.075,"Graphics.DrawWithRecipe.draw_and_resource_release":134.264,"Graphics.DrawWithRecipe.index_upload":0.502,"Graphics.DrawWithRecipe.validate":5.376,"Graphics.DrawWithRecipe.vertex_upload":3.118,"Recorder.Reap":74.775,"Recorder.Submit":471.970,"Recorder.WaitSerial":111.671,"Resources.Complete":68988.076,"Resources.Prepare":350.725,"Shader.DrawStage":414.320,"Shader.DrawStage.capture_resources":204.312,"Shader.DrawStage.materialize":169.806,"Shader.DrawStage.prepared_invocation":37.825,"Shader.ResolveAbi":0.736,"Shader.ResolveGraphicsAbi":0.240,"Shader.ResolveGraphicsStagesAbi":7.315,"VideoOut.Flip":57.390,"VideoOut.Flip.completion_mutex_wait":0.002,"VideoOut.Flip.config_mutex_wait":0.000,"VideoOut.Flip.frame_limit":0.002,"VideoOut.Flip.notify_game":0.020,"VideoOut.Flip.present":57.278,"VideoOut.Flip.validate":0.004,"VideoOut.Flip.vblank_wait":0.003,"VideoOut.Flip.window_prepare":0.006,"VideoOut.Flip.window_title":0.079,"VideoOut.Readiness":0.006,"VideoOut.Readiness.locks_validate":0.004,"Vulkan.Acquire":0.151,"Vulkan.Acquire.acquire_fence_wait":0.006,"Vulkan.Acquire.acquire_image":0.114,"Vulkan.Acquire.fence_reset":0.029,"Vulkan.Acquire.retired_swapchains":0.001,"Vulkan.Dispatch":17.883,"Vulkan.Dispatch.command_record":3.573,"Vulkan.Dispatch.shader_resources":14.073,"Vulkan.DispatchRecipe":4.993,"Vulkan.DispatchRecipe.command_record":4.951,"Vulkan.DrawFromRecipe":152.308,"Vulkan.GraphicsPipeline":994.373,"Vulkan.GraphicsPipeline.create":970.542,"Vulkan.GraphicsPipeline.modules_and_state":23.801,"Vulkan.GraphicsPipelineLibrary":963.779,"Vulkan.GraphicsPipelineLink":1.483,"Vulkan.Present":0.980,"Vulkan.Present.command_record_scale":0.261,"Vulkan.Present.pixel_upload":0.296,"Vulkan.Present.queue_submit":0.422,"Vulkan.QueuePresent":0.056,"Vulkan.QueuePresent.queue_present":0.045,"Vulkan.Retire":68.558,"Vulkan.Retire.dump":10.321,"Vulkan.Retire.wait":58.161},"top_phases_ms_per_frame":{"Driver.Packet":57481.005,"Driver.Packet.memory_wait":32549.230,"Graphics.Draw":24479.622,"Driver.Packet.draw":23682.253,"Driver.Draw":23677.630,"Driver.Draw.draw_enqueued":23407.901,"Resources.Complete":22996.025,"Graphics.Draw.draw_and_resource_release":21698.904},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":138,"Graphics.Barrier.dcc-clear":36,"Graphics.Barrier.dcc-keys":36,"Graphics.Barrier.dispatch-lead":269,"Graphics.Barrier.dispatch-trail":576,"Graphics.Barrier.draw":6737,"Graphics.Barrier.fill":108,"Graphics.Barrier.fill-clear":60,"Graphics.Barrier.indirect-args":27,"Graphics.Barrier.label-run":11159,"Graphics.Barrier.present-blit":6,"Graphics.Barrier.shadow-publish":27,"Graphics.Barrier.staging-in":1310,"Graphics.Barrier.staging-out":423,"Graphics.Barrier.storage-upload":168,"Graphics.Barrier.storage-writeback":537,"Graphics.BarrierMerged.dispatch-lead":361,"Graphics.BarrierMerged.fill":24,"Graphics.BarrierMerged.label-run":5,"Graphics.BarrierMerged.shadow-publish":15,"Graphics.BarrierMerged.staging-in":196,"Graphics.BarrierMerged.staging-out":423,"Graphics.BarrierMerged.storage-writeback":86,"Graphics.Copy":13412,"Graphics.Copy.bytes":54079801020,"Graphics.RenderPass":3222,"Graphics.RenderPass.Close.command":2718,"Graphics.RenderPass.Close.image":15,"Graphics.RenderPass.Close.key":10,"Graphics.RenderPass.Close.label":5,"Graphics.RenderPass.Close.new-batch":462,"Graphics.RenderPass.Close.raw":12,"Graphics.RenderPass.Continued":15823},"trace_dropped":false,"trace":"aps5-trace-291a878fd221-786458.json.gz"}

AI-assisted: yes.

@milescoviello

milescoviello commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Four Ghost of Tsushima (PPSA02225) runs with the switch off and on, on a 12 GiB card, which the Tested section says is untested.

Setup:

  • Build: main 6119c53c4b with this head merged (2f2ff82532), Release libraries. One build for both arms; the switch-off arm is main's path.
  • Hardware: RTX 4070 Ti 12 GiB, NVIDIA 615.71.09, Linux 7.0.
  • Run: pinned save, scripted button presses from the same start, 450 s, 22 GB memory cap. Arms interleaved off/on/off/on.
run APS5_TEXTURE_BUDGET_DEMAND end presents highest sampled budget logged cache releases peak RSS
1 off 457 s timeout 1259 6825 MiB 8 22.3 GB
2 on killed at 359 s by my 22 GB cap 1208 10331 MiB 8 23.5 GB
3 off 457 s timeout 791 6823 MiB 0 19.4 GB
4 on 452 s timeout 1160 10327 MiB 4 21.4 GB

What this shows:

  • The switch does what the description says on 12 GiB. The automatic sampled budget peaks at about 10.3 GiB with the switch instead of about 6.8 GiB. The heap budget here is about 11 GiB, so that's most of it.
  • I can't read a frame-rate result from these runs. The scripted presses lead the four runs to different screens (photo mode in one, a loading screen in another at the same time), and the present counts move more between runs of one arm than between arms.
  • Memory is borderline. One switch-on run went over the 22 GB cap that the off runs stayed under, but the off runs ranged from 19.4 to 22.3 GB, so two runs per arm don't separate the arms. If it's useful, I can repeat this on a fixed scene without input and log device-local and host-placed allocations per interval.

AI-assisted: yes (Claude Code). The runs are from this machine.

Fixed scene, as asked (11-18). Same build (main 6119c53c4b + 2f2ff82532), off, on, off, on, 450 s each. Each run had three rounds of scripted presses to load the pinned save, then no input. The first switch-on run was lost to a full disk on my side (killed at 120 s), so arm 2 is a rerun.

arm run end device memory placed in host memory sampled budget range presents after 250 s peak RSS cache releases
off 1 457 s timeout none 2636 to 6823 MiB none: a black frame from about 265 s 19.9 GB 0
on 2 451 s timeout none 3327 to 10331 MiB 424 in 195 s 18.5 GB 0
off 3 452 s timeout 2 device buffers of 896 MiB with the heap at 10350 of 10797 MiB, then 6 [bufferpool] allocations, 443 MiB in all 2048 to 6821 MiB 19 in 177 s 22.3 GB 22
on 4 452 s timeout 8 textures of 3266 MiB each, 26127 MiB in all, with the heap at 7991 to 8605 of 10296 to 10734 MiB 2108 to 10329 MiB 18 in 166 s 23.7 GB 12
  • No allocation failed outright. Every out of device memory result was placed in host memory instead.
  • Both arms placed device memory in host memory, in one run of two each. The switch run's placements were much larger: eight 3266 MiB textures, against 1.8 GiB of buffers and 443 MiB of pool allocations with the switch off. They also happened with the heap at 8.0 to 8.6 GiB of a 10.3 to 10.7 GiB budget, not at the top of it.
  • The scene still wasn't fixed. After the presses, run 1 sat on a black frame, run 2 presented about 2.2 times a second, and runs 3 and 4 about once every 10 s. So the presents column doesn't compare the arms; the placement and RSS columns do.

@oneandonlydean

Copy link
Copy Markdown
Collaborator Author

@milescoviello yes, a fixed scene without input would be useful, and the allocation lines are the part I most want. The open question on this switch is the thinner headroom: on an 8 GiB card it placed device-local allocations in host memory, and your 12 GiB card with a budget at 10.3 of about 11 GiB is where that would show next.

What I would read from each arm:

  • the count of stderr lines [bufferpool] ... placed in host memory type ... (printed without any profile switch) and any failed allocation,
  • the sampled budget range, as you logged it here,
  • presents over the same interval once the scene has settled, and peak RSS.

Two runs per arm in the same off, on, off, on order is enough. If the switch arm shows host placements and the off arm does not, I will add a floor on the free headroom before anyone considers it as a default.

@milescoviello

Copy link
Copy Markdown
Contributor

@oneandonlydean thanks, that's clear. The fixed-scene runs are queued on the same build (main 6119c53c4b + 2f2ff82532, its pipeline cache already warm), off, on, off, on, 450 s each. The pinned save gets three rounds of presses to load into gameplay, then the pad stays neutral. For each arm I'll report:

  • the count of placed in host memory type lines and any failed allocation,
  • the sampled budget range,
  • presents per 10 s from 250 s on,
  • peak RSS.

I'll add them to my results comment above when the four runs finish.

AI-assisted: yes (Claude Code)

@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

The reviewed change is an opt-in texture cache budget experiment; no verified blocking defect was found, but the claimed runtime benefit remains unverified on a card where the switch changes the budget.

What I ran

No build or tests were run. I inspected the prepared diff and targeted source at head 34bcf276a78204cd9bb4fe51a92b0c9a1326aacc using repo_read.py.

Results

Check Result Note
Source review passed Budget formulas and call sites inspected
Build and tests not run No execution environment used
Changed-file coverage not run Two changed files were only partially read

Findings

Blocking

None.

Non-blocking

  • The demand-mode formula is covered by explicit fixture assertions, but the description says the actual switch was not tested on hardware where it changes the outcome. A run on a 16 GiB card, or another setup where the default budget is too small and demand mode allows the level to fit, would confirm the intended effect.

Not verified

  • I read the prepared diff, ShaderResources.hpp, targeted ranges of ShaderResources.cpp, Graphics.cpp, SampledCacheBudget.cpp, the CMake test registration, and the environment documentation. ShaderResources.cpp and Graphics.cpp were not read in full; other source outside the targeted ranges was not inspected.
  • The prepared review bundle did not provide files.json; the changed-file list was checked with the review-folder listing. The manifest lists five changed files as included and two excluded as too large; I read targeted ranges of both excluded files through the reader.
  • No build, automated tests, Windows checks, or physical-console/hardware run was performed. The performance measurements and Linux test results in the PR description are author-reported, not independently verified.

To get this to a good state

Nothing is required. Optional: report the described demand-mode comparison on hardware where the setting changes the budget, including allocation failures and the sampled budget/cache metrics.

@milescoviello

Copy link
Copy Markdown
Contributor

@oneandonlydean the fixed-scene runs are in my results comment. In short:

  • No allocation failed outright.
  • One switch-on run placed eight 3266 MiB textures in host memory, with the device-local heap at about 8 of 10.5 GiB.
  • One switch-off run placed two 896 MiB buffers there (heap at 10.35 of 10.8 GiB) and 443 MiB of pool allocations.
  • The other run in each arm placed nothing.

The scene didn't settle the same way each run, so the presents don't compare between arms.

AI-assisted: yes (Claude Code)

@oneandonlydean

Copy link
Copy Markdown
Collaborator Author

@milescoviello that answers what I asked. My reading of the placement column:

  • Run 4's placements are single 3266 MiB textures arriving with 1.7 to 2.7 GiB free in the heap. An allocation of that size is refused at that fill level whatever the headroom rule is, so a floor on the headroom would not have kept them on the device.
  • Run 3 shows the switch-off path filling the heap to 10350 of 10797 MiB as well, so the fuller heap is not specific to the switch on this title.

What the table cannot tell me yet is whether the cache gave back less with the switch on. Before a texture goes to host memory the driver asks the texture caches to release, and prints one stderr line each time:

[gpu] texture caches released N MiB of the M MiB asked for: ... sampled entries, ... storage images, ...

Could you paste those lines from runs 3 and 4, next to the placed in host memory lines they precede? If run 4 shows (cache busy, skipped) or releases far short of what was asked while the cache held several GiB, the switch needs a rule for large allocations and I will add it here. If the cache was released and the texture still did not fit, the title asks for more than the card has in that scene and the switch is not the cause.

@milescoviello

milescoviello commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

@oneandonlydean here are the release lines, in log order, from the same two runs.

Run 4 (switch on): every 3265 MiB texture request first released only 194 to 808 MiB. There was no (cache or device busy, skipped) line. Each release left about 740 storage images and 82 to 100 entries with pending results in place, and freed 138 to 300 sampled entries. The one exception is the run's first 3265 MiB request, which released 1161 MiB, followed by an 896 MiB request that released 897 MiB. So the cache wasn't skipped: it gave back well short of what was asked, mostly because storage images and pending-result entries stayed.

Run 3 (switch off):

  • The first 3265 MiB request released 1094 MiB.
  • The two 896 MiB device buffers that went to host memory each followed a release of 0 MiB, with 100 entries with pending results kept.
  • The pool's storage-texture placements followed releases of 0 MiB.
  • Around its 9 MiB device-buffer placement, eight releases say (cache or device busy, skipped), four just before it and four after.

So with the switch off, the busy-skip case shows up in this title, and with it on, the releases fall short without it.

The lines

Run 3 (switch off):

[gpu] texture caches released 1094 MiB of the 3265 MiB asked for: 1899 sampled entries, 904 storage images, 100 with pending results kept
[gpu] texture caches released 0 MiB of the 896 MiB asked for: 0 sampled entries, 0 storage images, 100 with pending results kept
[gpu] device buffer: device-local heap 0 uses 10350 of its 10797 MiB budget, 939524096 bytes placed in host memory type 0; 1 such allocations, 896 MiB
[gpu] texture caches released 0 MiB of the 896 MiB asked for: 0 sampled entries, 0 storage images, 100 with pending results kept
[gpu] device buffer: device-local heap 0 uses 10350 of its 10797 MiB budget, 939524096 bytes placed in host memory type 0; 2 such allocations, 1792 MiB
[gpu] texture caches released 288 MiB of the 287 MiB asked for: 115 sampled entries, 53 storage images, 1 with pending results kept
[gpu] texture caches released 294 MiB of the 287 MiB asked for: 45 sampled entries, 39 storage images, 1 with pending results kept
[gpu] texture caches released 178 MiB of the 287 MiB asked for: 0 sampled entries, 735 storage images, 83 with pending results kept
[gpu] texture caches released 0 MiB of the 352 MiB asked for: 0 sampled entries, 18 storage images, 83 with pending results kept
[bufferpool] vkAllocateMemory storage texture: memory type 1 is out of device memory for 100663296 bytes after reclaiming 0 and releasing 0; placed in host memory type 0 until it is released; 1 such allocations, 96 MiB
[gpu] texture caches released 0 MiB of the 336 MiB asked for: 0 sampled entries, 1 storage images, 83 with pending results kept
[bufferpool] vkAllocateMemory storage texture: memory type 1 is out of device memory for 83886080 bytes after reclaiming 0 and releasing 0; placed in host memory type 0 until it is released; 2 such allocations, 176 MiB
[gpu] texture caches released 0 MiB of the 336 MiB asked for: 0 sampled entries, 1 storage images, 83 with pending results kept
[bufferpool] vkAllocateMemory storage texture: memory type 1 is out of device memory for 83886080 bytes after reclaiming 0 and releasing 0; placed in host memory type 0 until it is released; 3 such allocations, 256 MiB
[gpu] texture caches released 0 MiB of the 336 MiB asked for: 0 sampled entries, 1 storage images, 83 with pending results kept
[bufferpool] vkAllocateMemory storage texture: memory type 1 is out of device memory for 83886080 bytes after reclaiming 0 and releasing 0; placed in host memory type 0 until it is released; 4 such allocations, 336 MiB
[gpu] texture caches released 0 MiB of the 336 MiB asked for: 0 sampled entries, 1 storage images, 83 with pending results kept
[bufferpool] vkAllocateMemory storage texture: memory type 1 is out of device memory for 83886080 bytes after reclaiming 0 and releasing 0; placed in host memory type 0 until it is released; 5 such allocations, 416 MiB
[gpu] texture caches released 163 MiB of the 287 MiB asked for: 54 sampled entries, 731 storage images, 82 with pending results kept
[gpu] texture caches released 15 MiB of the 265 MiB asked for: 14 sampled entries, 0 storage images (cache or device busy, skipped), 0 with pending results kept
[gpu] texture caches released 0 MiB of the 265 MiB asked for: 0 sampled entries, 0 storage images (cache or device busy, skipped), 0 with pending results kept
[gpu] texture caches released 0 MiB of the 265 MiB asked for: 0 sampled entries, 0 storage images (cache or device busy, skipped), 0 with pending results kept
[gpu] texture caches released 0 MiB of the 265 MiB asked for: 0 sampled entries, 0 storage images (cache or device busy, skipped), 0 with pending results kept
[bufferpool] vkAllocateMemory device buffer: memory type 1 is out of device memory for 9437184 bytes after reclaiming 0 and releasing 0; placed in host memory type 0 until it is released; 8 such allocations, 443 MiB
[gpu] texture caches released 0 MiB of the 265 MiB asked for: 0 sampled entries, 0 storage images (cache or device busy, skipped), 0 with pending results kept
[gpu] texture caches released 0 MiB of the 265 MiB asked for: 0 sampled entries, 0 storage images (cache or device busy, skipped), 0 with pending results kept
[gpu] texture caches released 0 MiB of the 265 MiB asked for: 0 sampled entries, 0 storage images (cache or device busy, skipped), 0 with pending results kept
[gpu] texture caches released 0 MiB of the 265 MiB asked for: 0 sampled entries, 0 storage images (cache or device busy, skipped), 0 with pending results kept
[gpu] texture caches released 0 MiB of the 264 MiB asked for: 0 sampled entries, 5 storage images, 46 with pending results kept
[gpu] texture caches released 0 MiB of the 271 MiB asked for: 0 sampled entries, 14 storage images, 46 with pending results kept

Run 4 (switch on):

[gpu] texture caches released 1161 MiB of the 3265 MiB asked for: 1930 sampled entries, 920 storage images, 88 with pending results kept
[gpu] texture caches released 897 MiB of the 896 MiB asked for: 4699 sampled entries, 0 storage images, 0 with pending results kept
[gpu] texture caches released 206 MiB of the 3265 MiB asked for: 144 sampled entries, 734 storage images, 100 with pending results kept
[gpu] vkAllocateMemory texture: device-local heap 0 uses 7991 of its 10734 MiB budget, 3424619520 bytes placed in host memory type 0; 1 such allocations, 3265 MiB
[gpu] texture caches released 194 MiB of the 3265 MiB asked for: 138 sampled entries, 741 storage images, 90 with pending results kept
[gpu] vkAllocateMemory texture: device-local heap 0 uses 8081 of its 10690 MiB budget, 3424619520 bytes placed in host memory type 0; 2 such allocations, 6531 MiB
[gpu] texture caches released 753 MiB of the 3265 MiB asked for: 251 sampled entries, 746 storage images, 88 with pending results kept
[gpu] vkAllocateMemory texture: device-local heap 0 uses 8209 of its 10624 MiB budget, 3424619520 bytes placed in host memory type 0; 3 such allocations, 9797 MiB
[gpu] texture caches released 791 MiB of the 3265 MiB asked for: 300 sampled entries, 742 storage images, 82 with pending results kept
[gpu] vkAllocateMemory texture: device-local heap 0 uses 8314 of its 10552 MiB budget, 3424619520 bytes placed in host memory type 0; 4 such allocations, 13063 MiB
[gpu] texture caches released 808 MiB of the 3265 MiB asked for: 263 sampled entries, 726 storage images, 88 with pending results kept
[gpu] vkAllocateMemory texture: device-local heap 0 uses 8433 of its 10490 MiB budget, 3424619520 bytes placed in host memory type 0; 5 such allocations, 16329 MiB
[gpu] texture caches released 779 MiB of the 3265 MiB asked for: 267 sampled entries, 740 storage images, 88 with pending results kept
[gpu] texture caches released 207 MiB of the 3265 MiB asked for: 216 sampled entries, 729 storage images, 88 with pending results kept
[gpu] texture caches released 771 MiB of the 3265 MiB asked for: 271 sampled entries, 731 storage images, 88 with pending results kept
[gpu] vkAllocateMemory texture: device-local heap 0 uses 8605 of its 10296 MiB budget, 3424619520 bytes placed in host memory type 0; 8 such allocations, 26127 MiB
[gpu] texture caches released 738 MiB of the 3265 MiB asked for: 252 sampled entries, 730 storage images, 88 with pending results kept
[gpu] texture caches released 768 MiB of the 3265 MiB asked for: 271 sampled entries, 738 storage images, 88 with pending results kept

AI-assisted: yes (Claude Code). The runs are from this machine.

@oneandonlydean

Copy link
Copy Markdown
Collaborator Author

@milescoviello these lines settle the first half. The release was not skipped in run 4: it ran, freed what only the cache still held (138 to 300 entries, 194 to 808 MiB), and the 3265 MiB texture still did not fit in a heap at 8.0 to 8.6 GiB. Both runs also show the first 3265 MiB request fitting after a release of about 1.1 GiB, so the two arms behave alike until the later requests, which run 3 never reached.

What they do not show is how much the sampled cache held when the release fell short. The release only frees entries nothing else references. If the cache held several GiB at that moment and gave back 200 MiB, the larger budget is keeping referenced textures around and the switch needs a rule for that. If it held about what it released, the scene itself has 8 GiB live and the switch is not the cause.

One switch-on run with APS5_PROFILE_DRAW=1 would answer it. Every 10 s it prints

[texture-cache] (10 s): ... evicted, N held ones passed over, ...; X MiB in Y entries, budget Z MiB, frame ...

and the lines I need are the ones just before each placed in host memory line. No second arm and no settled scene needed for this, only a run that reaches the 3265 MiB requests again. I am not changing the branch until that is known.

@mrfelek

mrfelek commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

@oneandonlydean the run your Not tested section asks for, on a 12 GiB card.

Setup

  • Hardware: Linux 7.3, RTX 3080 Ti 12 GB (NVIDIA 615.71.09, VK_EXT_memory_budget reports a 10049 MiB budget), Ryzen 9 5950X.
  • Build: this head 34bcf276a7, Release. The title is relinked with the same build's relinker.
  • Scene: PPSA21564 -lvl big_hand_pirate_island, no input, warm shader cache. One warm-up run, then A B A B on the same binary, 150 s after the level starts.
  • A: no switch. B: APS5_TEXTURE_BUDGET_DEMAND=1. Both arms run with APS5_PROFILE_DRAW=1.

Results

A (default) B (APS5_TEXTURE_BUDGET_DEMAND=1)
presents per second, last 5 windows (runs 1 / 2) 0.25 / 0.15 2.16 / 2.47
frame p50 9.0 s / 9.3 s 410 ms / 407 ms
GPU per present 1262 ms / 2172 ms 152 ms / 158 ms
[texture-cache] budget in the level (second run) 3108 to 3328 MiB, holding about 3880 MiB 5484 MiB, holding 5800 MiB
textures evicted per 10 s (second run) 852 12
[textures] sampled created snapshots at the end (second run) 80477 2127
failed allocations none none
  • The sampled texture cache budget line in A reads 3190 MiB: the heap uses 7623 MiB, 3809 MiB of it sampled textures, with 1282 MiB of cached storage images.
  • B's budget lands where you estimated, about 5.2 to 5.5 GiB.
  • On this card that is enough for the level to stop thrashing. It stays at about 2.4 presents per second, the same as I got on main earlier with a forced APS5_TEXTURE_CACHE_MIB=6144 (perf: heavy 3D titles are bound by per-draw work in the draw path; a direct path that reads descriptors on the GPU #17533). So on 12 GiB the switch turns the level from about 0.2 to about 2.4 presents per second.
  • Per 10 s, A's last windows ran 7, 6, 3, 4, 1, 2, 2, 2 presents and B's held 23 to 25.
  • No allocation errors and no device loss in either arm. I grepped each log for out of device memory, VK_ERROR_OUT_OF and failed allocations, and found none.

Radeon 780M (RADV, Mesa 26.0.8, shared memory, Linux 7.0)

The same head and scene, one warm-up, then A B A B, about 300 s after the level starts. Here the switch makes no lasting difference, and one B run lost the device.

  • The start budget is 5242 MiB in A and 8071 to 8366 MiB in B. Heap 1 reports a budget of about 9.3 GiB.
  • During the level, both arms fall to the 2048 MiB floor. The heap budget grows to 11.3 GiB, but the heap fills with 9.5 to 9.9 GiB, of which under 1 GiB is sampled textures. B steps down through 4140 to 4502 MiB and then about 2100 to 2500 MiB before it reaches the floor.
  • Both arms end at 1 present per 10 s. B starts a little higher (22 against 9 to 20 presents in the first windows) but slides to the same rate.
  • Every run hit the full heap: there are 9 to 11 vkAllocateMemory ... uses 11316 of its 11316 MiB budget ... placed in host memory lines per run in both arms.
  • The second B run then lost the device, at about 210 s into the level. The kernel logged amdgpu_vm_validate() failed / Not enough memory for command submission, and the game logged vkQueueSubmit recorder: Vulkan result -4. Neither A run did that. But at that point both arms were at the same 2048 MiB budget, so with 1 of 2 runs I can't tie it to the switch.

One limitation on the 3080 Ti: each arm's second run wrote over the first run's log folder, so the budget, eviction and snapshot lines are from the second run of each arm. The present rates come from both runs' summaries.

AI-assisted.

@oneandonlydean

Copy link
Copy Markdown
Collaborator Author

@mrfelek that is the pair this PR was missing. On the 3080 Ti the default budget of about 3.2 GiB sits under the 5.8 GiB the level holds, and the switch moves frame p50 from about 9 s to about 410 ms with no failed allocation, the same level you reached with a forced 6144 MiB.

On the 780M I read your lines the same way you do: the heap fills with 9.5 to 9.9 GiB of which under 1 GiB is sampled textures, so both arms end on the 2048 MiB floor and the switch has nothing to give. One device loss in two B runs, at a point where both arms had the same budget, does not tie it to the switch, but it is why I am not proposing a default change from this PR.

Where this leaves it: the switch stays off by default here. Two things are open before I would propose it as the default: the large single allocations milescoviello saw on a 12 GiB card with a fuller heap (his profiled run above), and a rule for shared-memory heaps like the 780M's, where the higher starting budget only delays the same slide.

@milescoviello

Copy link
Copy Markdown
Contributor

@oneandonlydean understood. The profiled run is queued: switch on, APS5_PROFILE_DRAW=1, same build, save and presses. It starts after the title runs on the host now, in about 15 minutes. I'll post the [texture-cache] lines just before each placed in host memory line.

AI-assisted: yes (Claude Code)

@oneandonlydean
oneandonlydean merged commit 77b0822 into boykopovar:main Nov 18, 2026
14 checks passed
@DerKarussellbremser

Copy link
Copy Markdown
Contributor

A data point from a 6 GiB card, where the switch changes the storage image side rather than the sampled side, and one stop that I only see with the switch on.

Setup

default APS5_TEXTURE_BUDGET_DEMAND=1 APS5_TEXTURE_CACHE_MIB=4096
presents per 10 s 17 21 22
GPU busy per present 251 ms 239 ms 213 ms
storage images evicted per 10 s (cache eviction) 3621 47 9
storage uploads by reason first, per 10 s 8527 MiB 0 0
[gpu-memory] storage line sampled_live 1945 to 1964 MiB, storage_cached 511 MiB, available 337 to 339 MiB, selected 512 MiB sampled_live 1622 MiB, storage_cached 897 MiB, selected 944 to 1014 MiB forced
heap 0 usage of its 5187 MiB budget 4710 to 4713 MiB 4744 to 4815 MiB not recorded
failed allocations none none none

So by default the storage image budget sits on its 512 MiB floor while the dialogs need about 0.9 GiB of storage images, and the cache evicts and uploads again about 8.5 GiB per 10 s. With the switch the budget is about 1 GiB, the evictions are gone and the heap stays under its budget. The frame rate gain is small (17 to 21 presents per 10 s) because about 200 ms of GPU time per present remain either way; in the run without evictions the [storage] line still shows about 8 GiB per 10 s of storage refresh write-backs and as much shadow upload.

The stop. Two of four runs with the switch on ended with

compute shader 0x407e525200: AGC graphics: a cached image access of 0x41fe0c0000+0x2c0000 overlaps multisampled color target 0x41fe040000+0x3c0000 (4 samples), whose samples are only on the host: guest access to it is not implemented

after 274 s and after 233 s (the second with program 0x407e4a5200, the same two ranges). The other two ran 3700 s and 1800 s without it. I have not seen it without the switch: two runs of 300 s on this build (one of them with the forced 4096 MiB) and three of 900 s on the build before the last two commits of #28077. I have not traced it. My reading, unproven: a cached build whose image the smaller budget would have evicted is still alive when the title turns that memory into a multisampled color target.

Not covered: other titles, other GPUs, Linux. The table is one run per column.

AI-assisted (Claude Code).

@oneandonlydean

Copy link
Copy Markdown
Collaborator Author

@DerKarussellbremser your 29 Nov result here is now the open question on #28766, which makes APS5_TEXTURE_BUDGET_DEMAND the default: 2 of your 4 runs with the switch stopped on a cached image access ... overlaps multisampled color target ... whose samples are only on the host, and none of 5 without it did.

Could you repeat it on current main without your local PR stack, if PPSA28183 still reaches the first-boot dialogs there: 4 runs with APS5_TEXTURE_BUDGET_DEMAND=1 and 4 without, same window (to 300 s or the stop)? What I need per run is only whether it stopped, at what second, and the stop line. If plain main does not get that far, the same 4 + 4 on your stack is as useful.

If the stop shows again only with the switch, the default does not go in as it is.

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

Labels

agc libSceAgc* build docs 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.

6 participants