Skip to content

test(agc): reserve the image table cache test range above the guest arena on Windows - #19531

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
clutchwtn:fix/image-table-cache-test-windows
Nov 21, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
clutchwtn:fix/image-table-cache-test-windows

Conversation

@clutchwtn

Copy link
Copy Markdown
Contributor

What

agc_driver_image_table_cache fails on Windows with "image table cache: a result without Unmapped entries is not cacheable".

The test reserves a range with VirtualAlloc(nullptr, ...), captures while its second page is uncommitted, commits that page and captures again. On Windows the reservation lands at a low address (0x5b0000 here) inside the guest arena range (base 0x10000, size 0xfbffff0000 in the test process), so GuestMemory caches the second page as inaccessible. The test commits the page with VirtualAlloc directly, which does not invalidate that cache, so GuestMemory::Accessible still returns false for it and the second capture reports records 2 and 3 as Unmapped again.

The reservation now uses MEM_TOP_DOWN, which places it above the arena, as the mmap range is on Linux. The Windows CI job builds only three AGC execution tests, so it does not run this one.

Tested

Windows 11 (10.0.26300), WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh r7), i5-13600KF.

  • Before: agc_driver_image_table_cache failed in 5 of 5 runs on edb7d91.
  • After, on 7a61834 with this change: passed 10 of 10 runs with --repeat until-fail:10. The branch was rebased onto a newer main afterwards without another run; main did not change this file in between.
  • Full ctest run on edb7d91 before the change: 5296 of 5297 passed, this test being the only failure.
  • tools/check_conventions.py --base origin/main passes; tools/pr_overlap.py --branch reports no overlap with 1503 open pull requests.

Not tested on Linux or macOS; the change is inside #ifdef _WIN32.

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: n/a, the test creates no Vulkan device. The full ctest run was on NVIDIA GeForce RTX 4070 SUPER, driver 621.14, Windows 11
  • AI-assisted: yes

…rena on Windows

agc_driver_image_table_cache reserves a range with VirtualAlloc, captures
while its second page is uncommitted, commits that page and captures again.
On Windows the reservation lands at a low address inside the guest arena
range, so GuestMemory caches the second page as inaccessible, and the
direct VirtualAlloc commit does not invalidate that cache. The second
capture still reports the records as Unmapped and the test fails with
"a result without Unmapped entries is not cacheable".

Reserve with MEM_TOP_DOWN so the range lies above the arena, as the mmap
range does on Linux.
Copilot AI balanced review requested due to automatic review settings November 13, 2026 13:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot added the agc libSceAgc* label Nov 13, 2026
@JJenkx

JJenkx commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Windows check of head d627686a04. Setup: Windows 11 Enterprise 22621, AMD RX 6700 XT, AMD driver 26.10.1, MinGW-w64 GCC 15.2 UCRT, Release.

agc_driver_image_table_cache and agc_driver_image_table_cache_bounds passed in 3 of 3 runs:

  • GPU, through the shared Windows GPU FIFO with ANYPS5_REQUIRE_VULKAN=1, merged onto main e069333996 (merge 039c07d8a2): 6 of 6 outcomes. The binaries matched the hashes recorded at preparation, and the receipt shows exit 0 and app_count=0.
  • CPU, Vulkan hidden, merged onto main b975a42ca5 (merge 6df1133e8a): 1 passed and 1 skipped (it needs a device), in each of 3 runs.

AI-assisted: yes.

@rafaconvaitis

Copy link
Copy Markdown
Contributor

Confirmation on a machine where main fails: agc_driver_image_table_cache fails on main 907fe8fd31 with either GPU selected and passes with head d627686a04 merged alone onto it (git merge --no-ff, clean merge).

Setup: Windows 11 25H2 (build 26200), two GPUs in the same machine, each selected with ANYPS5_GPU: AMD Radeon 760M integrated graphics (1002:15bf, Vulkan device name Radeon 5), AMD Software 26.11.2 (driver 32.0.32029.2010, Vulkan 1.4.359), and NVIDIA GeForce RTX 3050 6 GB (10de:2584), driver 610.88 (Vulkan 1.4.341). WinLibs GCC 15.2.0 r7 UCRT, Release, BUILD_TESTING=ON, all 914 agc*_tests targets built, Khronos validation layer 1.4.363 (LunarG SDK 1.4.363.1).

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer SDL_AUDIODRIVER=dummy, ctest -R '^agc_driver_image_table_cache' -V -j 1, 3 runs per cell.

test main, Radeon 760M main, RTX 3050 this PR, Radeon 760M this PR, RTX 3050
agc_driver_image_table_cache fails 3/3 fails 3/3 passes 3/3 passes 3/3
agc_driver_image_table_cache_bounds passes 3/3 passes 3/3 passes 3/3 passes 3/3
  • On main it reports AGC graphics: image table cache: a result without Unmapped entries is not cacheable.
  • VUID- lines: 0 in all logs. Every run logs the Selected GPU name= line of its GPU and Insert instance layer "VK_LAYER_KHRONOS_validation", and none logs was not found but was requested.

AI-assisted: yes (build and runs scripted with an AI assistant, on the hardware above).

@kiwe147

kiwe147 commented Nov 21, 2026

Copy link
Copy Markdown

Tested head d627686a04, applied with git apply on main fd4aeed483 together with the other 29 PRs of one batch (#17478, #21223, #24030, #24201, #14202, #18889, #21641, #21773, #22468, #22471, #23239, #23255, #23484, #23869, #23992, #24311, #18425, #21195, #21255, #22989, #23507, #23886, #14582, #17878, #19666, #19899, #20138, #21656, #21746). All applied without conflicts and the whole tree built.

Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. GPUs: NVIDIA GeForce RTX 3080 (driver 621.24) and the AMD Radeon iGPU of the CPU (gfx1036, driver 32.0.21036.18). No validation layer. iGPU run: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ANYPS5_GPU="AMD Radeon", agc_/video tests only.

tests RTX 3080 iGPU
agc_driver_image_table, agc_driver_image_table_cache, agc_driver_image_table_cache_bounds and 3 more (6 tests, matched by name to the test file this PR changes) all pass all pass

Whole batch: the full ctest -j 12 (6522 tests) on the RTX 3080 has 4 failing tests; the 4 that also fail on main fd4aeed483 are agc_driver_stencil_plane_memory, agc_driver_msaa_dcc_unwatch, agc_storage_write_back_host_retile, and pr_overlap_names, which needs a newer Python than my 3.10. Intermittent in this run (pass when rerun alone, or known flaky): agc_driver_store_over_untracked. The 2125 agc_/video tests on the iGPU have 2 failing: agc_driver_stencil_plane_memory, agc_driver_store_over_untracked (agc_driver_stencil_plane_memory also fails on main).

This is one combined tree, not a run of this PR alone.

AI-assisted: yes (Claude Code)

This was referenced Nov 21, 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

The reviewed change at d627686a0494df5c12d4e1bf7604c2e3d6107d94 applies MEM_TOP_DOWN to the Windows test reservation; the inspected test flow supports the stated fix, and no blocking defect was found.

What I ran

Read the prepared description, commits, manifest, diff, and the changed file at the pinned head. No tests or builds were run.

Results

Check Result Note
Source review passed One changed file inspected
Tests and build not run Author-reported results only

Findings

Blocking

None.

Non-blocking

None.

Not verified

The author-reported Windows runs and CI results were not independently verified. The prepared bundle did not provide files.json; the manifest listed one changed file, and its full text was read through repo_read.py.

To get this to a good state

Nothing is required.

@oneandonlydean
oneandonlydean merged commit 60799c2 into boykopovar:main Nov 21, 2026
3 checks passed
@clutchwtn
clutchwtn deleted the fix/image-table-cache-test-windows branch November 22, 2026 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants