test(agc): cover repeated driver stores into a shared block's exact ring #10333
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10333"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-23T18:11:52Z.
What
Replaces #6868. #7233 (
e424d57f9b, @MarcZX10) made a driver store whose range contains earlier pieces of its ring take their slot, and a full ring forget its oldest piece instead of the next in round-robin order, for both the exact and the possible ring. That is the rule #6868 proposed for the exact ring, so this PR drops the code and keeps the tests and the debt line.What the tests cover that main's do not:
CheckRepeatedNeighbourStores(agc_write_tracking): six repeated exact stores of a neighbour's bytes leave the other surface's share of the block unstored and keep their own complete coverage; a store that contains three earlier pieces answers for the contained bytes only and frees their slots, so two more small stores fit without an eviction; a full exact ring forgets its oldest piece and not a newer one, and the forgotten piece counts as a store over the rest of the block; an overlapping store that contains nothing replaces nothing and again evicts the oldest. Main'sCheckRepeatedPossibleStorescovers the eviction order for possible writes; its exact-ring tests cover distinct stores overflowing the ring only.agc_repeated_neighbour_stores(agc_driver_recorder_tests --repeated-neighbour-stores-only): a 1024x512 linear RGBA8 storage image, cleared on the GPU and written back after five driver stores of the 0x6000 neighbour bytes in its last 64 KiB block, over watched memory and over a watched host import: every texel keeps the GPU's value and the neighbour bytes stay intact. An arm that cannot run says why and is skipped: "no write watching: repeated neighbour stores over watched memory not tested" (and the same for the host-import arm) without a write watch, "host imports unavailable: ..." without host imports, "Linux write watch only" for the import arm on Windows. The mode returns 77 (ctest: Skipped) when no arm ran and 0 when every arm that ran passed; a failed arm throws and the suite exits 1. Without a usable Vulkan device the suite returns 77, or 1 when ANYPS5_REQUIRE_VULKAN is set.StoredOvertrue for every range of the block at older generations,StoredAllSincefalse for the exact ring only, a storage image's write-back leaving a shared block to the CPU, a native multisample depth clear refusing (exact ring).@milescoviello's fix/driver-store-forget (4f4729b084, one commit on an earlier #7233 head, 42cbe0c334: eight pieces per ring, evicted pieces kept as up to four ranges that merge their two oldest) would rewrite this debt line and change the four-piece counts in these tests. This PR does not depend on it.
Overlap (2026-10-28 22:55Z, against the then head d6eed67d4e and main
b76d41ea82:git merge-treeof every open PR that touches one of these four files (tests/Recorder.cpp, tests/WriteTracking.cpp, CMakeLists.txt, the debt file) or whose file list GitHub caps at 100 entries, 234 of the 1,392 open, each against this head and against main): #10159 conflicts with this PR and not with main, in Recorder.cpp at the spot afterrefreshProofTestswhere this PR'srepeatedNeighbourStoreTestsgoes; #12378 the same in the debt file, where this PR's line precedes the three entries it rewrites. Whichever merges second re-places one function or one line. 76 PRs conflict with main in the same files with or without this PR (#9508, #10193 and #7642 among them); the other 156 merge cleanly with both. Of the PRs this paragraph named on 2026-10-25, #9521, #9275 and #7505 have merged (#9521's mode line is the one conflict the rebase ontob76d41ea82resolved) and #10026 now merges cleanly with both. Rechecked at c0d7a684c8 on3a2b919816: see the reply to @MarcZX10. Rechecked at 30983dab5f on47cdccde40(2026-10-30 06:41Z; 250 PRs of the 1,488 open: every other open PR whose file list touches one of the four files, the 12 lists GitHub caps at 100 entries read through the API): #10159 is still the one PR that conflicts with this PR and not with main, in Recorder.cpp at the spot afterrefreshProofTestswhere this PR'srepeatedNeighbourStoreTestsand #10159'spendingKeyRefreshTestsboth go; #12378 has merged (712fc0e924, 2026-10-30 05:54Z), and its rewrite of the three debt entries after this PR's line is the one conflict this rebase resolved. 97 conflict with main in the same files with or without this PR; the other 152 merge cleanly with both.Tested
Head 30983dab5fa308d021116aa7957da48efeb0e978 is this PR's single commit rebased onto upstream/main
47cdccde40(2026-10-30 06:24Z, "Merge pull request #12437 from pushkarreddyy/fix/sanitizer-report-summary-validation"). One conflict, in the debt file: #12378 (merged 2026-10-30 05:54Z as712fc0e924) rewrote the three entries that follow this PR's line; the rebase keeps main's text for them and this PR's line, unchanged, before them.git range-diffagainst the previous head c0d7a684c8 shows the patch unchanged; only that context differs. Main's 53 non-merge commits, from 31 PRs, to this PR's four files between3a2b919816and47cdccde40(#12378, #12264, #12559, #12690, #9243, #11550 and #12927 among them) merge with this PR's additions without a change to them; at this head the registration is at CMakeLists.txt 1829–1834,repeatedNeighbourStoreTestsat Recorder.cpp 7648 with its mode at 12502 and its call at 12809,CheckRepeatedNeighbourStoresat WriteTracking.cpp 204 with its call at 2220, and the debt line is line 156. The driver-store ring code in GuestMemory.cpp is unchanged since938812df14. That file's three commits between3a2b919816and47cdccde40, all from #12378, are Windows-only:blockPartWatchednow counts a stored part of a block as watched when any of its pages is watched, not only its first or last (as the Linux branch already does), and it decides whether a driver store reaches the rings;walkHintsstamps the watched pages a hint walk clears as CPU stores. The Linux runs below do not exercise either change, and the Windows run under Earlier runs predates it.agc_write_tracking_testspasses ("write tracking tests passed");agc_driver_recorder_tests --repeated-neighbour-stores-onlypasses both arms ("repeated neighbour stores over watched memory: ok", "repeated neighbour stores over a watched host import: ok"). Exact commands, environment and output: in the reply at this head.ctest -R '^(agc_write_tracking|agc_repeated_neighbour_stores)$': both***Skipped(77); agc_write_tracking prints "no write watching: skipped", agc_repeated_neighbour_stores prints "no write watching: repeated neighbour stores over watched memory not tested" and "no write watching: repeated neighbour stores over a watched host import not tested".python3 tools/check_conventions.py --base upstream/main: passes at 30983dab5f.main= this PR's parent47cdccde40(so the pair isolates this PR;main's later commits to these files and a clean merge preview againsted1e0ed08fare in the reply) and this head, both built on the desktop (Release, BUILD_TESTING=ON, GCC 16.2.1) and run from their build trees withctest -V -R '^(agc_write_tracking|agc_write_tracking_[a-z_]+|agc_driver_recorder|agc_repeated_neighbour_stores)$'(the second alternative names Windows-only modes and matches no test on Linux) under VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1 and ANYPS5_REQUIRE_VULKAN=1 (validation layer 1.4.363.0; VK_LOADER_DEBUG=layer added for the proof of insertion):main2 of 2 passed, this head 3 of 3 (agc_repeated_neighbour_stores exists only here). The loader inserted VK_LAYER_KHRONOS_validation for agc_driver_recorder on both sides and for agc_repeated_neighbour_stores; agc_write_tracking creates no Vulkan instance and adds no validation coverage (a control with a bogus layer name shows the loader's not-found line on the recorder test and none on agc_write_tracking). Neither log reports "was not found but was requested by env var VK_INSTANCE_LAYERS"; neither has a VUID- message, so no new VUID againstmainin these tests. Exact commands and output in the paired-validation reply.98ddd9c, 2026-10-30 12:28Z (comment), NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329, Linux (Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04), 2,411 selected tests, the GPU ones under VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1, main run the same way: 2,367 passed, 3 failed (0 new: 2 also fail on main, 1 unstable on main), 41 skipped; no new validation IDs against main over the 904 tests run on the GPU; agc_repeated_neighbour_stores validated but not compared (main has no baseline for it).Earlier runs (before this rebase; same desktop and build host, binaries built the same way):
3a2b919816, 2026-10-29 01:27Z on lavapipe and 02:00Z on the RTX 3080): the same results; exact commands, environment and output in the reply to @MarcZX10.b76d41ea82, 2026-10-28 23:01Z on lavapipe and 2026-10-29 00:32Z on the RTX 3080): the same results; exact commands, environment and output in the reply to @MarcZX10.b91a6a60c5, 2026-10-25 11:07Z on lavapipe and 11:12Z on the RTX 3080): the same results,agc_write_tracking_testsand both arms ofagc_driver_recorder_tests --repeated-neighbour-stores-onlypass on the RTX 3080, both tests skip (77) on lavapipe.f26434afa3, 2026-10-24 23:15Z and 23:04Z): the same results; exact commands, environment and output in the reply to @oneandonlydean.c8d34aa8f4, 2026-10-24 21:32Z and 21:43Z): the same results,agc_write_tracking_testsand both arms ofagc_driver_recorder_tests --repeated-neighbour-stores-onlypass on the RTX 3080, both tests skip (77) on lavapipe.9ce5037ccf(e424d57f9b's parent, 2026-10-23) with these tests: agc_write_tracking_tests fails at "repeated stores of the neighbour's bytes count for the first surface's part of the shared block". A local variant that catches six groups of checks separately (not in this PR; the first two groups hold two checks each and stop at their first failure) fails four: that one, "a store over earlier pieces counts for the first surface's part of the shared block", "a full exact ring evicted a newer piece instead of its oldest" and "a store that overlaps without containing evicted a newer piece instead of the oldest". Three checks that round-robin eviction also satisfies pass: the containing store's own-range check, a forgotten piece counting for the rest of the block, and an overlapping store that contains nothing replacing nothing. agc_driver_recorder_tests --repeated-neighbour-stores-only: the watched-memory arm passes (the block's bytes still equal the image's upload copy, so the write-back stores it anyway); the host-import arm fails: "repeated neighbour stores over a watched host import: 2048 of 524288 texels the GPU wrote were not stored".e424d57f9b(9ce5037ccf's child, 2026-10-23): both tests pass.938812df14with these tests (2026-10-23): both pass.ec5b89a5ec, before 940d2a31f6 (per-arm ok lines, 77 without a watched arm):agc_write_trackingandagc_repeated_neighbour_storespassed there, the host-import arm reporting "Linux write watch only"; not rerun since.938812df14+ this PR before 940d2a31f6): noVUID-message, no "was not found but was requested by env var VK_INSTANCE_LAYERS"; with VK_LOADER_DEBUG=layer the loader reports the layer inserted.agcctest subset on plain938812df14: 907/931, 24 failed, of which agc_driver_sgpr_pattern_fill_keys and agc_driver_shutdown_threads_queued_prebuilds pass on two re-runs of the idle node (they ran under a concurrent build); with this PR: 910/932, the same 22 failures (lavapipe and no-write-watch cases: native depth, MSAA DCC clears, fmask, sRGB copies, image-table vouching, staged clears, resource-cache and lifetime tests); agc_write_tracking Skipped (77); agc_repeated_neighbour_stores counted as passed because the mode then exited 0 without a watched arm (it returns 77 since 940d2a31f6).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)938812df14; lavapipe (Mesa 26.2.4, Arch Linux) on the build host, both tests skip (77) at 30983dab5f, c0d7a684c8, d6eed67d4e, e3e47a939c, 41a5976cce and d7ed8e578b,agcctest baseline on938812df14; Intel Arc Graphics (driver 101.9150, Windows 11) by @BKlaasWerkman at 7a7b4b4751; paired validation-layer run (vulkan-validation-layers 1.4.363.0) at 30983dab5f against its parent47cdccde40on the same RTX 3080: no VUID- message on either side; NVIDIA RTX 2000 Ada Generation (driver 595.99.02, Linux, Ubuntu 26.04.1 LTS) by TechLevelZero's NVIDIA CI at 30983dab5f merged onto main98ddd9c: no new validation IDs against main.🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T21:03:05Z.
Review: CHANGES_REQUESTED
I reviewed exact head
940d2a31f69ed1f5beee0626cd18f2687cf7c13a, including the exact-ring assertions, the watched-memory/host-import GPU regression, skip behavior, cleanup, and the debt update. The added checks distinguish the containing-store behavior and oldest-piece eviction from round-robin eviction; the recorder mode reports each arm and returns CTest's skip code when no watched arm runs. The author reports a red host-import control on the old implementation, green runs on the current behavior, and separate Windows/Linux coverage. The hosted product tests are skipped by path policy.One required integration step remains: this branch is based on
938812df1403(merge #9168), while currentmainisc8d34aa8f4d8;git rev-listshows 7,963 commits on main since the merge base.CONTRIBUTING.mdsays to keep the branch up to date with main. The heads merge cleanly, but the reported GPU and write-tracking runs were performed on the older base, and no hosted product test ran on the current main merge. Please update the branch to current main and rerunagc_write_trackingplusagc_repeated_neighbour_storeson the resulting tree, including the Linux host-import arm where supported. Then I can complete the review against the supported base.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T22:15:00Z.
Review: CHANGES_REQUESTED
The new unit and GPU regression coverage is carefully scoped, and the reported RTX 3080 runs exercise both watched-memory and watched-host-import arms. The reported no-write-watch environment also skips with return code 77 as intended. The hosted checks currently pass conventions, eligibility, labels, and the progress report; Linux, Windows, write-watch, and relinker jobs are skipped, so hosted CI does not independently run these tests.
I cannot approve the current head (
e3e47a939c278dcf992482bd6465057fe9f71d1e) yet: GitHub currently reports the branch asCONFLICTING/DIRTYwithmain. Currentmainhas continued changing the AGC driver CMake and test files since the base described in the provided run report. Please resolve the conflicts against currentmain, verify the test registration and assertions in the resulting tree, and rerunagc_write_trackingplusagc_repeated_neighbour_storesthere, including the Linux watched-host-import arm where available. The prior detailed results are useful evidence, but they predate this conflicting integration state.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T00:44:14Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The test additions are focused and the reported watched-memory and watched-host-import runs are useful, but the submitted head is not the revision those runs identify and is substantially behind current
main.What I ran
d6eed67d4e2a6ccb91ea2e417b2fc25a42d67650, its four-file diff, currentmain, and the branch/update rules.git diff --checkagainst the merge base.main; it merges cleanly, while both branches edit the AGC CMake list and debt file.Results
Raw status
conventions passRaw status
windows pendingRaw status
linux skipping; register-context skipping; relinker skipping; relinker-asan skipping; write-watch skippingRaw output
git diff --check upstream/main...refs/review/pr-10333— no output; exit status 0Raw output
merge-tree-exit=0; edits from both branches incore/libs/prx/libSceAgcDriver/CMakeLists.txtanddocs/dev/debt/libSceAgcDriver.mdRaw values
Merge baseb76d41ea82791ba2ccab7ec299b74a0ad3e8b44b; currentmainis3a2b91981651569163768854a1fcdc7193b6667b; 127 commits from this PR head to currentmain.Negative control
The description reports red results on the old implementation and green watched-memory plus watched-host-import runs on rebased commit
41a5976cce6a3ee259deb51d69917684b5ba3173. I did not independently run these tests. The current PR head isd6eed67d4e2a6ccb91ea2e417b2fc25a42d67650, so the report does not identify the submitted revision.Findings
Blocking
CONTRIBUTING.mdrequires branches to stay up to date withmain. Please rebase this PR on currentmainand rerunagc_write_trackingandagc_repeated_neighbour_storeson the resulting head. Update the description to identify that exact revision and include the per-arm output, including a skip result where write watching or host imports are unavailable.Non-blocking
mainsince the branch's merge base; please check those hunks during the rebase.Sources
d6eed67d4e2a6ccb91ea2e417b2fc25a42d67650.mainat3a2b91981651569163768854a1fcdc7193b6667b.CONTRIBUTING.mdat3a2b91981651569163768854a1fcdc7193b6667b.Not verified
I did not run a local build, watched-memory tests, watched-host-import tests, or console tests. Linux and specialized hosted jobs were skipped, and the Windows job is pending. The GPU results cited above are author-provided and from a different commit than the current PR head.
To get this to a good state
Rebase onto current
main, resolve/check the CMake and debt edits, run both focused tests on the resulting head in a watched environment (including host imports where supported), and update the report with the exact head and per-arm output.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T02:32:46Z.
Review: APPROVED
Re-checked — new head, looks good
I reviewed exact head c0d7a684c82606111b17e721e57d34ec864291d9 against current main
3a2b919816; the merge preview is clean, the author’s current-head RTX runs cover both watched-memory arms, and the hosted Windows workflow completed successfully.What I ran
Environment: Linux x86_64, kernel 6.1.0-54-amd64, Python 3.11.2. I reviewed the four-file test and debt diff and ran:
I did not build or execute the C++ test binaries locally. The Windows workflow linked the changed host-only test executable, but its CMake library build and CTest steps were skipped. The GPU test results below are the author’s exact-head report, not local runs.
Results
Raw local and hosted output
Author-reported exact-head test output
Negative control
9ce5037ccfFindings
Blocking
None found in the reviewed test and documentation changes. The updated branch is based on current main, the previously missing exact-head Linux hardware output is now supplied, and the existing CI integration completes its Windows host-test link successfully.
Non-blocking
The Windows workflow skipped CTest after linking the changed host-only test executable, and the Linux and specialized jobs were skipped. The exact GPU assertions were exercised on the author’s RTX 3080 with write-watch and host imports, but those runs are author-reported rather than locally reproduced.
Sources
Not verified
I did not run the C++ tests locally, reproduce the RTX 3080 GPU path, test Windows GPU write-watch behavior, or test console behavior. The Linux lavapipe run and specialized hosted jobs skipped the relevant tests.
To get this to a good state
No code change is needed for this reviewed head. If the head changes, I will rerun the merge, diff, and convention checks and recheck the focused watched-memory tests on the new revision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T07:00:52Z.
Review: CHANGES_REQUESTED
Re-checked — new head, changes requested
The current head is 12 commits behind
main, carries the liveneeds rebaselabel, and the previous focused test report is for a different head and an older base; currentmainhas since changed this PR’s test registration and test files.What I ran
I inspected the current PR diff and GitHub state for head
30983dab5fa308d021116aa7957da48efeb0e978against basef7f03daf52f11191174b1be089a56e268390a707. Environment: Debian Linux x86_64, GitHub CLI/API; no compiler was used and no build or test was run. I compared the changed-line content with the previously reviewed patch and checked currentmain’s changes in the PR-touched files.Results
30983dab5fa308d021116aa7957da48efeb0e978, basef7f03daf52f11191174b1be089a56e268390a707; comparison reports 1 commit ahead and 12 behind;needs rebaselabel is presentd9b914f5b68d6b377df0822db916f04c2f7c9c6d0a9f151939ea05de76e2cf1f); this does not validate integration with currentmainmainsince the previous test baseCMakeLists.txt+139/-11,Recorder.cpp+354/-5, andWriteTracking.cpp+7/-2; all three are touched by this PRUnedited state and comparison output
Findings
Blocking
main, contrary to the repository rule, and the stale base changes the same test registration and assertion files this PR touches. The previous report names headc0d7a684c82606111b17e721e57d34ec864291d9on base3a2b91981651569163768854a1fcdc7193b6667b; it does not establish the behavior of this current head integrated withmainatf7f03daf52f11191174b1be089a56e268390a707. Please rebase onto currentmainand rerunagc_write_trackingandagc_repeated_neighbour_storeson the resulting tree, including the watched host-import arm where supported.Non-blocking
None found in the changed test assertions from the patch comparison; their current-main integration remains unverified.
Sources
Not verified
I did not run a local merge preview, diff check, convention check, build, or CTest on head
30983dab5fa308d021116aa7957da48efeb0e978. The focused GPU/write-watch results in the PR description are author-reported for a different head and base; no PS5 behavior was tested here.To get this to a good state
Rebase onto current
main, then rerun the same focused checks—agc_write_trackingandagc_repeated_neighbour_stores, with the watched host-import arm where supported—and update the report with the resulting head and output. I will rerun the relevant source, merge, convention, and test checks on that new head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T07:56:40Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
I withdraw the rebase finding: the PR's current merge preview is clean, and
mainchanges since its merge base do not touch the PR's changed paths; paired AGC validation evidence is still missing.What I ran
Reviewed exact head
30983dab5fa308d021116aa7957da48efeb0e978against currentmainf7f03daf52f11191174b1be089a56e268390a707. Environment: Linux x86_64, Git 2.39.5. No build or CTest was run locally.Results
112b322cb7be783a83c2582dd4ef8a75c926f5d9.git diff --checkUnedited local output
Findings
Blocking
The PR description reports the focused tests only on the change. The repository requires the same AGC tests on
mainand the change, on the same machine and GPU, withVK_LAYER_KHRONOS_validationenabled and newVUID-messages compared. Please add the paired run and its output. I am not requesting a rebase based on the current merge and touched-path checks.Non-blocking
None.
Sources
mainNot verified
I did not build or run CTest, use write-watch locally, or run GPU validation. The focused test results are author-reported.
To get this to a good state
Run
agc_write_trackingandagc_repeated_neighbour_storeson both currentmainand this head on the same RTX 3080 machine with the required validation environment, then report the loaded-layer check and VUID comparison. I will rerun the no-build checks and compare the resulting evidence.