Skip to content

test(agc): pad the surfaces that leave the write watch so their cases run - #24872

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
Jirka135:test/agc-store-over-untracked-watched-padding
Nov 27, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
Jirka135:test/agc-store-over-untracked-watched-padding

Conversation

@Jirka135

Copy link
Copy Markdown
Contributor

What

Second part of #22670. In agc_driver_store_over_untracked, Run() built its write-watch surfaces as Surface surface(leaves, neighbour ? Page : 0): 256 KiB, or 320 KiB with the lead page. On Windows a host import of write-watched memory stays watched only when it is settled, which takes at least settleFloorBytes (1 MiB, importWatching in GuestBufferMemory.cpp). So these surfaces left the watch at their first store, and the cases printed not run, the surface is not write-watched. "A surface that left the write watch" and "... whose first block left the write watch with the page before it" were skipped in every run here; without the validation layer, "written before it left" and "whose import left" were skipped too, often all four in the same run.

The surfaces now get the 16-block tail that RunStoredThenLeftWatch already uses: Surface surface(leaves, neighbour ? Page : 0, leaves ? 16 * Block : 0). This is @Superseabas's change from #22670; the commit carries them as co-author. The driver is unchanged.

What running them adds: disabling the unwatch hook is caught with or without the padding (as @Superseabas found), because the driver throws on that path from any case that reaches it. A narrower mutation shows the difference: removing only the save of pending results in StorageTexture::SaveBeforeUnwatch (texture->saveBeforeUnwatch(address, bytes) for overlapping), which only these four cases exercise, was caught without the validation layer in 4 of 10 unpadded runs on the RTX 5090 and 1 of 5 on the Radeon (every passing run had skipped all four cases), and in 10 of 10 and 5 of 5 padded runs. So the padded cases detect no new kind of regression, but they check the pending-at-unwatch path in every run instead of in roughly half of them.

"Not run" stays a skip rather than a failure: whether an import stays watched is decided by runtime probes (watchPrivateImports on Windows, unwatchImports elsewhere), so a GPU or driver whose probe chooses comparison would fail for no fault of its own. RunStoredThenLeftWatch treats it the same way.

Tested

Windows 11 Enterprise 10.0.26300, Ryzen 7 9800X3D, WinLibs GCC 15.2.0, Release, validation layer 1.4.369. ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -R '^agc_driver_store_over_untracked$' -V, a fresh process per run, with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer and without it.

tree RTX 5090 + layer Radeon + layer RTX 5090, no layer Radeon, no layer
#22764 (5503a0cbff) 10/10 pass, 2 cases not run in every run 5/5 pass, 2 cases not run in every run 10/10 pass, 2 to 4 cases not run per run (all four in 5 runs) 5/5 pass, 2 to 4 not run per run (all four in 1 run)
this change 10/10, all cases run 5/5, all cases run 10/10, all cases run 5/5, all cases run
this change merged onto main b23daffaf9 10/10, all cases run 5/5, all cases run 10/10, all cases run 5/5, all cases run

Every log with the layer shows Insert instance layer "VK_LAYER_KHRONOS_validation", none shows was not found, and no log has a VUID- line. The test takes under 13 s. Not tested: Linux and macOS (CI), Intel GPUs. check_conventions.py --base upstream/main passes; pr_overlap.py --branch reports only #6188, which changes RunSecondStore, not this line. The branch carries #22764's commit underneath; once #22764 merges it rebases cleanly onto main.

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 (see AGENTS.md)
  • 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: test(agc): run the second-store case on a surface that was never watched #22764
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 5090, driver 617.42, Windows 11; AMD Radeon(TM) Graphics (Ryzen 7 9800X3D iGPU, 1002:13c0), driver 32.0.21045.29003, Windows 11
  • AI-assisted: yes

🤖 Generated with Claude Code

DerKarussellbremser and others added 2 commits November 20, 2026 04:38
The case took an arena surface out of the write watch, and a settled host
import could put it back before the first write-back, which then kept no
saved bytes. A surface outside the arena stays unwatched, so the case now
requires that and still checks the saved bytes and the second store.

Co-authored-by: thalesdot1dot1 <296322452+thalesdot1dot1@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011TXsSW8zeAgKgHLCFsYwM3
… run

The write-watch cases of agc_driver_store_over_untracked built 256 KiB
surfaces (320 KiB with the lead page). On Windows a host import of
write-watched memory stays watched only when it is settled, which takes
at least settleFloorBytes (1 MiB), so these surfaces left the watch at
their first store and the cases printed "not run, the surface is not
write-watched". Give them the 16-block tail RunStoredThenLeftWatch
already uses.

Proposed by Superseabas in boykopovar#22670.

Co-authored-by: Superseabas <131002911+Superseabas@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@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 diff makes the write-watch cases use larger surfaces and adds checks to the second-store case; I found no concrete defect in the changed code.

What I ran

  • Reviewed head be1791e1b962e98f5a4d8412b4cddcb4cc5c84aa.
  • Read the prepared description, commit list, manifest, diff, and the complete changed source file through repo_read.py.
  • No tests or build commands were run.

Results

Check Result Note
Changed-code review passed One changed file read in full
Tests not run Author reports Windows and GPU runs
Other files not applicable No other changed files in manifest

Findings

Blocking

None.

Non-blocking

None.

Not verified

I did not independently run the tests, verify the reported Windows/GPU results, or inspect CI behavior on Linux and macOS. The author’s reported test results are not independently confirmed.

To get this to a good state

Nothing is required.

@github-actions github-actions Bot added the agc libSceAgc* label Nov 21, 2026
@throny

throny commented Nov 22, 2026

Copy link
Copy Markdown

GPU test run: ✅ the skipped cases now run, and the test passes every time on an RTX 4080

Basis: built and ran · head be1791e1b9 on main 851212fb98 · Windows 11 Pro 26300, RTX 4080 (10de:2704, driver 610.88), WinLibs GCC 15.2.0 r7, Release · ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 APS5_NO_PIPELINE_JOURNAL=1

Checked

  • On main, a single run prints not run, the surface is not write-watched for "a surface that left the write watch", "… written before it left the write watch" and "… whose first block left the write watch with the page before it", and agc_driver_store_over_untracked fails 16 of 30 and 12 of 30 serial runs (the store left no saved guest bytes, agc_driver_store_over_untracked is flaky on Windows: the second-store case sometimes finds no saved guest bytes #22670).
  • With this PR: 0 of 20 serial runs failed, and none printed not run, so the padded surfaces stay write-watched and their cases run.
  • The 42 agc_* tests tools/select_tests.py selects for this change, with the Khronos validation layer (nightly 1.4.369): 42 of 42 passed, 0 VUID- messages (main with the same settings: 0 VUID-).

Findings: none from this run; this is a GPU run, not a code review.

AI-assisted test run (Claude Code) · head be1791e1b9 · base main 851212fb98

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

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 6188 core/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cpp

@oneandonlydean
oneandonlydean merged commit 0a864f5 into boykopovar:main Nov 27, 2026
14 checks passed
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.

5 participants