Repository navigation
test(agc): run the second-store case on a surface that was never watched - #22764
Conversation
|
Ran the test on NVIDIA's proprietary Linux driver with the Khronos validation layer, since the description's runs are on Windows. Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (vendor
The test binary was also run 50 more times on each side through No new AI-assisted: yes (Claude Code) |
|
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.
|
|
Turing on Windows with the validation layer. Setup: Windows 11 Enterprise 10.0.28000, i5-11400F, NVIDIA GeForce RTX 2060 (Turing, device Environment:
The rate on As in #22670, some cases skip on both builds with Not run: the full suite with this PR. AI-assisted: yes |
Ethan-Hainline
left a comment
There was a problem hiding this comment.
Reviewed and verified on Windows 11, Ryzen 5 7530U (Radeon Vega 8 iGPU), MinGW-w64 GCC 16.2.0 UCRT, Release, Vulkan available:
A/B on current main 168921678f
- Without the patch:
agc_driver_store_over_untracked_testsfailed 1 of 3 runs with exactlya second store over a surface outside the write watch: the store left no saved guest bytes, so #22670 reproduces here. - With
d1aaf844ddapplied: 10 of 10 runs passed.
Other checks
- The target compiles cleanly with the change.
AgcDriver::GuestMemory::Watched(address, SurfaceBytes)exists with that signature; reading it inside the sameGpuMutexcritical section asGuestSnapshotValid()matches howsettleUnwatchedImportsandrewatchSettledImportsuse it, so the decision is coherent.- The new branch fired on every run here (5 of 5), not occasionally. On this machine the rewatch happens before the check each time, so on Windows the case now always takes the "watched again" path and no longer exercises the saved-bytes assertion at all. The CPU-page and second-result checks still run, and the message makes the path visible in the log, so I don't think this blocks the fix — but if the rewatch is now the normal Windows behaviour rather than a race, the case name "outside the write watch" is doing less than it says. Worth a sentence in the body or a follow-up that re-unwatches and retries if the intent is to keep covering the unwatched path on Windows.
Not a blocker from me; the patch fixes the reproduced failure without weakening the assertions that still apply.
AI-assisted.
|
Head No new failures and no new validation messages on either GPU.
Layer runs used AI-assisted: yes |
|
@Ethan-Hainline thanks, that is a useful observation, and it is not what I see here. I went back to the logs of the 40 runs in the description: with the change the new branch fired in 21 of 40 runs on the RTX 2060, and the other 19 ran the saved-bytes requirement and passed. So on this machine it is still a race and both paths are exercised; on your Vega 8 the rewatch always wins. I added a paragraph to the description saying so. Forcing the unwatched path on every machine (unwatch again and retry, as you suggest) would be a change to the fixture rather than to the check, so I would keep it out of this fix; I can do it as a follow-up if the maintainers want the case to cover that path everywhere. AI-assisted (Claude Code). |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the optional points below are informational.
What I ran
Reviewed head d1aaf844dd53b545b6d07c922bf5b311944c6cc9. No commands or tests were run; I inspected the prepared diff and pinned source through the repository reader.
Results
| Check | Result | Note |
|---|---|---|
| Changed-code review | passed | One test fixture change |
| Tests | not run | No local execution |
Findings
Blocking
None.
Non-blocking
RunSecondStorenow accepts a rewatched surface and carries on to its second-store assertions. That addresses the reported timing-dependent early failure while retaining the saved-bytes requirement when the surface remains unwatched. The PR description also clarifies that the second store’s result and CPU-written page are checked in the rewatched path.
Not verified
- Test execution and CI results were not verified independently; reported runs in the PR description are author supplied.
- I did not read the full changed file; the review was limited to the changed hunk and nearby
RunSecondStorelogic, the relatedGuestMemory::Watchedimplementation, and the adjacent fixture function. review/description.md,review/commits.md,review/manifest.json,review/diff.patch, andcore/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cppranges 270–390 were read. No files were excluded by the manifest.
To get this to a good state
Nothing is required. The optional point above is informational.
|
Following up on the coverage gap discussed above, I prototyped a test-only change that keeps the existing case where the surface leaves the write watch and adds a separate case using a surface that was never registered. The new case requires a saved guest snapshot after the first store, then verifies that the second store reaches the untouched block and preserves the full page written by the CPU between stores. On Windows with an RTX 5060, I compared Sharing the test patch ( |
|
RTX 5080 run of head
10 of the 20 runs with the PR took the watched-again path and 10 the saved-bytes requirement. The 5 tests matching Setup: base AI-assisted: yes (Claude Code) |
|
Windows 11 Pro (build 26300), WinLibs GCC 15.2.0 r7, Release, On With this PR (d1aaf84) merged it passes 3/3 on the RTX 5080 and 3/3 on the AMD iGPU. On the RTX 5080 every run took the new branch: |
|
Confirmation on a machine where Setup: Windows 11 25H2 (build 26200), two GPUs in the same machine, each selected with
AI-assisted: yes (build and runs scripted with an AI assistant, on the hardware above). |
|
Hardware test report: RTX 4070 (Windows)
On this machine the test fails on AI-assisted: yes. Results are from one machine and one GPU only. |
|
For #22670, I compared this PR (d1aaf84) and the alternative fixture in the issue, each applied separately to 34bd032. The difference shows up even when both candidates pass CTest. On Intel Graphics 0x7d67 (101.8860), the ordinary baseline failed the second-store snapshot check in 12/30 pilot runs and 23/60 interleaved controls. Each candidate passed 300/300 interleaved runs. In 98/300 PR runs the surface regained its write watch, bypassing the saved-snapshot assertion. The other 202 had no rewatch message; the assertion has no success marker. The alternative fixture explicitly requires the surface to remain unwatched after the first store, so it more directly tests the unwatched second store. On the RTX 5090 Laptop (621.01), the ordinary baseline passed 30/30, so the long comparison ran only on Intel. With Khronos validation enabled the baseline failed 3/3 on each GPU and each candidate passed 3/3 on each. These are fixture comparisons on Windows 11 build 26200. The attached archive includes both diffs, runner, manifest and all 756 logs, including the 18 validation-enabled pending-identity controls. AI-assisted (Codex and Claude). |
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
d1aaf84 to
5503a0c
Compare
|
@u-instinct11 Thanks, that is right: the first version let a surface that was watched again pass without the saved-bytes check, so it did not test the unwatched second store. On my RTX 2060 that path was taken in 21 of 40 runs. The branch now carries the fixture @thalesdot1dot1 posted in #22670 instead (commit AI-assisted (Claude Code). |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the test now allocates an unwatched surface and checks that the write watch remains absent after the first store, while retaining its saved-byte and second-store assertions.
What I ran
Reviewed head 5503a0cbff3d3cf44f63b62c8c3c9ea69bde66b2 using repo_read.py to read the supplied review materials and the changed source. No commands or tests were run.
Files read: description.md, commits.md, manifest.json, diff.patch, and core/libs/prx/libSceAgcDriver/tests/execution/StoreOverUntracked.cpp (lines 1–25 and 260–355). The manifest lists one reviewed file, and its full text was available. No files were excluded by the manifest.
Results
| Check | Result | Note |
|---|---|---|
| Diff and changed source review | passed | One changed test file |
| Tests | not run | Author-reported results were not rerun |
Findings
Blocking
None.
Non-blocking
None.
Not verified
No tests or conventions checks were run. The author reports Windows runs and a conventions check in the description; these results were not independently verified. Linux, macOS, and full-suite behavior were not verified.
To get this to a good state
Nothing is required.
|
Windows NVIDIA run of the new head Setup: Windows 11 Home 10.0.26300, i9-13900K, RTX 4080 (
The other four cases still print Not checked: whether the second-store case took the unwatched path in each passing run (no counter added), the rest of the GPU set on the merge, AMD, Linux. AI-assisted: yes |
|
Thanks for updating the fixture. I checked the revised head 5503a0c against the exact alternative used in the Intel comparison: applying the saved fixture patch to 34bd032 produces the same StoreOverUntracked.cpp Git blob as the new head (b0219a8e73512b98f189b489251b28da239095b0). The saved fixture executable also matches the SHA-256 recorded in the run manifest. So the earlier 300/300 Intel comparison result covers this exact fixture source on the recorded base. I did not rebuild the new merge or count those as new trials. AI-assisted (Codex). |
throny
left a comment
There was a problem hiding this comment.
Approving per the review above.
AI-assisted review (Claude Code)
|
Two more data points, including the first Ampere card and an RDNA2 iGPU on AMD's Windows driver. Setup: Windows 11 Pro 10.0.26200, Ryzen 5 7600X, WinLibs GCC 15.2.0 r7 (WinLibs CMake 4.3.1, Ninja 1.13.2), Release,
All four The same test also failed once in a full AI-assisted: yes |
|
An RDNA1 data point: on an RX 5700 XT the test fails on every run on Setup: Windows 11 Home 26200, Ryzen 7 7700X, AMD Radeon RX 5700 XT (RDNA1, gfx1010, Command:
Every Two more runs on As on the other Windows machines, the two cases that need a write-watched surface print |
|
A Pascal data point: on a Quadro P3200 the test fails on every run on Setup: Windows 11 Pro 10.0.26300, Intel Core i7-8750H (laptop), NVIDIA Quadro P3200 (Pascal,
Every failure on AI-assisted: yes (Claude Code) |
|
Windows / AMD: this fixes Setup:
On On this host the failure isn't flaky. It also failed in my full Windows sweep of AI-assisted: yes. |
agc_driver_idle_store_over_unmap skipped on every Windows run with "the first store left no saved guest bytes to compare with", so it never reached the unmap it is written for. The surface came from the guest write-watch arena and was taken out of the watch with GuestMemory::Unwatch. On Windows the store's host import is settled and rewatchSettledImports puts the range back under the write watch before the first write-back, which then keeps no saved bytes. A probe showed the surface watched again after the first store in 3 of 3 runs on each GPU. This is the cause #22764 found for agc_driver_store_over_untracked. The surface now comes from memory that is never registered with the write watch (VirtualAlloc on Windows, mmap without registration elsewhere), as #22764 did for its second-store case. The test requires it to be outside the watch at the start and again after the first store, and keeps every later check. The driver is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
agc_driver_store_over_untrackedfails intermittently on Windows in its "a second store over a surface outside the write watch" case withthe store left no saved guest bytes(#22670). The cause is the test's fixture, not a lost store.RunSecondStoreallocated its surface in the guest write-watch arena, took it out of the watch withGuestMemory::Unwatchand then required the first store to leave saved guest bytes. On Windows the host import that the store makes over the surface is settled, andrewatchSettledImportsputs the range back under the write watch. When that happens before the first store's write-back, the write-back sees watched memory and keeps no saved bytes (GuestMemory::Watched(firstStored, ...) ? {} : prepareStoredSave(...)inwriteBackLayers), and the case reportedOutcome::Lost.The case now uses a surface that is never in the write-watch arena (
Surface surface;, the fixture's existing unwatched constructor), requires it to be outside the watch at the start and again after the first store, and keeps every check after that: the saved bytes, the CPU's page surviving the second store, and the second result reaching the block the CPU left alone. The driver is unchanged.This fixture is the one @thalesdot1dot1 posted in #22670; the commit carries them as co-author. It replaces my first version of this PR, which let a surface that was watched again skip the saved-bytes check. As @u-instinct11 measured on Intel, that version skipped it in 98 of 300 runs, and on this machine in 21 of 40, so it no longer tested the unwatched second store it is named for.
Tested
Windows 11 Home 10.0.26200, Intel i7-10750H, NVIDIA GeForce RTX 2060 (driver 610.91), WinLibs GCC 15.2.0 r7, Release,
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1,ctest -R ^agc_driver_store_over_untracked$, built frommaind50640e264:mainthe store left no saved guest bytesWith this change none of the 30 runs printed a line for the second-store case, so each ran it to the end with saved bytes and
lost 0.Earlier measurements on this machine (local trace lines, not part of this PR): in all 9 failing traced runs on
mainrewatchSettledImportscovered the surface between the test'sUnwatchand the first write-back.Not tested, and limits:
not run, the surface is not write-watchedon Windows (second part of agc_driver_store_over_untracked is flaky on Windows: the second-store case sometimes finds no saved guest bytes #22670) are not touched.python tools/check_conventions.py --base origin/mainpasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
https://claude.ai/code/session_011TXsSW8zeAgKgHLCFsYwM3