Skip to content

fix(tests): read the storage cache budget from the device the test opened - #2223

Closed
tezzgod74 wants to merge 1 commit into
boykopovar:mainfrom
tezzgod74:fix/storage-cache-budget-device
Closed

tezzgod74 wants to merge 1 commit into
boykopovar:mainfrom
tezzgod74:fix/storage-cache-budget-device

Conversation

@tezzgod74

Copy link
Copy Markdown
Contributor

What

agc_driver_storage_cache_budget (#1059) computed its expected budget from a device other than the one it ran on. SelectDevice ranked the physical devices itself and always took the discrete GPU's memory heaps, while OpenVulkanTestDevice honours ANYPS5_GPU. It now takes the heaps of the physical device whose name matches VulkanDevice::DeviceName().

On a machine with an RX 9060 XT (16 GiB heap) and a Ryzen 9 7950X iGPU (32 GiB shared heap), a run on the iGPU expected a 4076 MiB budget while the driver used 8083 MiB:

texture cache budget 4076 MiB; each 4096x4096 32_UINT surface holds 64 MiB; cyclic set of 33 surfaces (2112 MiB)
AGC graphics: surface 0 is still cached after 65 surfaces under a budget of 63 of them

With the change, the same run reports texture cache budget 8083 MiB and passes. Machines with a single device are unaffected.

Tested

Windows 11 Pro 10.0.26300, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON, on main at d70b899.

While another process held about 10.7 GiB of the RX 9060 XT's VRAM, VK_EXT_memory_budget reported a 2197 MiB heap budget and the 2112 MiB cyclic set failed with vkAllocateMemory storage texture: Vulkan result -2, with and without this change. The storage image cache budget is TextureCacheBudget (a quarter of the heap size) and does not follow VK_EXT_memory_budget as the sampled cache does, so the test fails rather than skips when other processes use the device memory. Not changed here.

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 in TechnicalDebt
  • 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
  • AI-assisted: yes

🤖 Generated with Claude Code

…ened

SelectDevice ranked physical devices on its own and took the discrete
GPU's memory heaps even when ANYPS5_GPU selected another device. On a
machine with an RDNA 4 dGPU (16 GiB) and an RDNA 2 iGPU (32 GiB shared
heap), a run on the iGPU expected eviction at a 4076 MiB budget while
the driver used 8083 MiB, and failed with "surface 0 is still cached".
The test now takes the heaps of the physical device whose name matches
the opened VulkanDevice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added agc libSceAgc* needs rebase Conflicts with main, rebase needed labels Oct 9, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

Closing: 68072d6 on main replaced the device lookup in StorageCacheBudget.cpp with a fixed test budget, so the multi-GPU mismatch is gone. Reopen if the test still fails on current main.

@tezzgod74
tezzgod74 deleted the fix/storage-cache-budget-device branch October 11, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* needs rebase Conflicts with main, rebase needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants