fix(agc): separate possible writes from complete coverage #7233
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7233"
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 MarcZX10 on 2026-10-17T18:27:46Z.
What
StoredAllSince_nid_no_patchis used as byte-complete evidence for native depth clears. BDA shader reports are page-granular, and descriptor-bound direct/copy-back ranges describe writable ranges rather than exact byte stores. They were recorded throughMarkWritten, allowing those possible writes to prove complete coverage.This adds
MarkPossiblyWrittenand keeps possible-write intervals separate from exact writes. Both kinds still invalidate overlapping readers; only exact writes contribute to complete-coverage queries. BDA page reports and direct/copy-back shader ranges use the possible-write path. The tests cover sparse ranges, repeated reports, and retaining an exact store when a possible whole-block report arrives.The recognized full HTILE-clear kernel is an explicit producer exception: its exact kernel match and full dispatch extent prove the complete range.
DepthSurfaceaccepts that proof while still checking CPU-write races and every HTILE value. A new native-depth regression verifies this path when the tracker has only possible-write evidence, preserving the positive BDA control from #7228.Related: #6868 independently identified the repeated-interval retention bug for exact writes. This PR now applies containment reuse and oldest-generation eviction to both exact and possible-write histories, while keeping their slots independent. The two PRs need coordination against the updated branch before merge.
Fixes #7220.
Tested
eb55d58728f367f527253b3ae5b30ed45030fdf3was built with GCC 13.3 and GCC 16.2.1. Miles Coviello reportsagc_driver_native_multisample_depth_tests --clearspassed 3/3 with and without Khronos validation on an NVIDIA RTX 4070 Ti; the four selected native-depth CTests passed 4/4 in both modes, with no validation VUIDs.--clearstest passed three times on each of an RTX 3080 (NVIDIA 615.78.08), a Ryzen 9 7950X3D iGPU (RADV, Mesa 26.2.4), and lavapipe (Mesa 26.2.4); the lavapipe runs cover both with and without/dev/udmabuf. NVIDIA follows the tracked-store assertion (checked=27 unavailable=0). RADV and lavapipe report the write-coverage skip and then verify the current fail-safe refusal for uncovered HTILE (native multisample depth clear requires tracked HTILE generations); they do not claim successful output checks for that path. Counts: RADVchecked=27 unavailable=0; lavapipechecked=19 unavailable=8. The exact-head BDA-clear test passes 3/3 on RTX 3080 and self-skips on lavapipe. Khronos validation on NVIDIA reports no VUID.git diff --checkand the conventions check pass. Hosted eligibility, conventions, labels and report pass; build/runtime workflows are skipped by path policy.Checklist
main; no other open PR fixes the possible-write coverage issue (#6868 is related interval-retention work).mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T18:35:42Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cppL1732-1733core/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppL276, L360core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cppL598core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppL4669-4670, L5076core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cppL1712core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cppL1712core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cppL121, L142, L465, L494-495core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hppL57core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppL2186-2187core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppL5176, L5264, L5294core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cppL1712Some 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.
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hppcore/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hppcore/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hppcore/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cppcore/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hppcore/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cppcore/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hppcore/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hppcore/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hppcore/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hppcore/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cppcore/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cppcore/libs/prx/libSceAgcDriver/tests/WriteTracking.cppcore/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hppcore/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hppcore/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Lifecycle.cppcore/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hppcore/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/tests/WriteTracking.cppcore/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hppcore/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cppcore/libs/prx/libSceAgcDriver/tests/WriteTracking.cppcore/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hppcore/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppImported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-17T18:45:29Z.
Heads-up from #6455, which conflicts with this PR in
Execution/src/GuestMemory.cpp. #6455 addsWriteTracker::stampWatchedPart, which stamps the watched blocks of a store into partly watched memory. It callsnoteDriverStorefrom the partly watched paths ofstoreOwnandMarkWritten. With this PR'scompleteflag, the merge passestruefromstoreOwnandmarkWritten's own flag from there, so a possible write into partly watched memory stays a possible write rather than becoming complete evidence. Whichever of the two lands second can take that resolution. If this PR lands first, #6455's merge ofmainwill carry it.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T18:46:49Z.
Thanks for this. Review found a blocking problem.
This takes the same approach as the earlier #7220 proposal (5a9b4c22f): a BDA page report becomes a possible write that doesn't count for
StoredAllSince, and the direct and copy-back producers are converted the same way. The only consumer of that distinction isRequire(StoredAllSince)inCheckCurrent(core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp:215). So a legitimate full native HTILE clear through BDA would now throw "no complete tracked HTILE store". That is exactly the case #7228 tests, and 5a9b4c22f failed #7228's test 3/3 on NVIDIA and AMD with that message.The PR has no GPU run, and its one unit test is skipped in CI, so nothing here exercises that path.
A fix would need a recognized full-range clear to record an exact store, so that
StoredAllSincestill holds for it. Since #7228 is the regression test for this, it should land first; running it against this branch is the quickest check.Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-17T19:08:23Z.
Native HTILE consumer follow-up: #7371
Merge order: #7233 first, then #7371. The refreshed handoff is 191060e6fb, based on main
0393728fd3and this PR's2e048f56ff(adapted parent2ebf5005c0). Own two-commit scope: five files, +70/-5, production handoff 34 added lines; unchanged added/removed lines. Marc's prerequisite history and Jan Šlégl's tracker-test attribution are preserved.The follow-up registers a recognized queued clear's pending range and settles it before cached-owner, sampled-texture or attachment consumption. Settlement releases the surface mutex, and only an explicitly queued recognized producer enables it. Unknown writers, CPU races, missing complete coverage and unsupported metadata remain refused.
Windows: full default build, 54 focused passes on literal main and 54 on the change (36 GPU / 18 CPU each). Removing only the production handoff makes the BDA consumer test fail 3/3 per RTX 5080/Radeon Graphics; restored matching runtime passes 3/3 each. Actual devices and Khronos insertion verified, no selected skips/timeouts/VUIDs/errors/warnings. Detailed commands, drivers and analysis limitations are in #7371.
The prerequisite's DriverDispatch case still fails promptly on both GPUs with or without the handoff; it is excluded from passing counts. Maintained separate report. No new focused title replay or Driver/PM4 completion pass is claimed.
AI-assisted code/validation/report: Codex; author responsible.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T19:46:52Z.
Thanks for the follow-up. The #7228 BDA clear now goes through, but I don't think f0303b3 is mergeable yet, and the
agc_driver_native_depth_clear_refusalsfailure Amoenus reported is the symptom:clearKernelProvesCoverageis always true. It's only assigned inNoteHtileDepthClear(DepthSurface.cpp:1292), asnativeBytes == bytes && nativeBytes >= metadata.bytes, inside theelseof the check that already rejectednativeBytes != bytes || nativeBytes < metadata.bytes. So theStoredAllSince_nid_no_patchbranch inCheckCurrent(:216) can never run, and every clear is validated byStoredOveralone.StoredOvercounts possible pieces (possiblePieces,possibleWhole,possibleDropped) and returns true for unwatched or uncovered ranges. So after this change, a possible write to any byte of HTILE counts as coverage, which is the thing the PR sets out to separate. The newPossibleStorecase in--clearsasserts exactly this: aMarkPossiblyWritten-only HTILE completes the clear.--clear-refusals,PartialStore(4 bytes stored) now passes the coverage check and is only refused by the HTILE value check, because the rest of the fixture's HTILE doesn't hold the clear pattern. If it did (e.g. a repeated clear to the same value), the partial store would be accepted. BecauseTargetRefusesthrows on the first mismatch, the remaining six refusal cases (CpuWrite through Overlap) don't run at all.A possible direction: derive the "kernel proves coverage" bit from the recognized clear dispatch's actual write extent, or record the recognized clear's write as a complete store once it has executed, and keep
StoredAllSince_nid_no_patchas the guard.--clear-refusalsshould then pass unchanged. I'd also add a refusal case where the unstored HTILE words already hold the clear pattern, and makePossibleStorea refusal rather than a success. The #7228 BDA positive and the #7220 sparse-store control should both still pass.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T20:41:27Z.
Thanks for reproducing the same-value partial-store case. I removed the eager coverage shortcut. A recognized direct HTILE clear now carries its range with that specific recorded dispatch, bypasses recipe reuse, and schedules completion handling even when the resource path would not otherwise request it. Only after the dispatch completion callback finishes
CheckFaults()(orWriteBackBuffers()) does it mark the exact metadata range as a complete driver write.CheckCurrentnow always requiresStoredAllSince.The regression coverage now rejects a same-value partial store and a possible BDA write without completion; it also checks that a completed recognized clear can provide complete coverage. The
agc_driver_native_multisample_depth_teststarget builds on Linux. I could not runagc_driver_native_depth_clear_refusals: the host CPU guard aborts first because this Xeon E5-1620 v2 lacks LZCNT, BMI1/2, MOVBE, AVX2 and FMA.git diff --checkandtools/check_conventions.py --base upstream/mainpass.The overlap audit flags shared
DepthSurfacecode in #6300 and #6808 for their separate whole-HTILE fill and D32S8 paths; this change handles completion of the recognized HTILE mask dispatch. Those branches may need manual conflict resolution if both land.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T21:22:52Z.
The newest follow-up correctly removes the boolean coverage bypass and moves exact-store evidence to
CompleteHtileDepthClearafter dispatch. Thanks for addressing the accepted same-value partial-store case. Before I can treat this as resolved, please run the updated head through the fullagc_driver_native_depth_clear_refusalsmatrix (including the new same-value partial-store case) and retain the #7228 BDA-positive and #7220 sparse-store controls. The prior head failed before later refusal cases ran; current CI skips the GPU path, so a successful build alone will not settle the regression.Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-17T23:59:56Z.
@MarcZX100 I ran 007 First Light (PPSA11386) with #7233 on top of #6868, as offered on #6868, one run per arm. The possible-write ring needs #6868's rule as well:
Setup:
main4186f06a9with 007's bring-up stack (open PRs, among them #6346 at b8251dcbb and #6465, and local fixes) and local diagnostics. On top: #6868 (the change of its headaa8f73490), then #7233 at ef80e4aa0.StoredOver's slot check into aWriteTrackerhelper. Where Windows restores a private mapping, it also setsdroppedinstead of erasing the block's pieces. So the possible ring's fields went into that helper and that step too.GuestMemory.cpp/.hppare the same in your current head e7b6e4381. Its later commits (the HTILE clear completion) were not in these runs.For comparison, #6868's Tested on the same harness:
The case is the one in #6868's body. The fog history's last block collects one
MarkDirectWritesrange again and again. #7233 routes that range as a possible write, so it fills the possible ring instead of the exact one. Under round-robin,possibleDroppedthen passes the image's upload generation, andStoredOveranswers true for the image's part of the block.Test:
CheckRepeatedPossibleStoresfollows #6868'sCheckRepeatedNeighbourStores, withMarkPossiblyWritten. It checks three things:In place of #6868's store over three earlier pieces, it checks that an exact store's coverage survives possible writes that overflow the possible ring. On this machine, (b) fails it at "repeated possible writes of the neighbour's bytes count for the first surface's part of the shared block". (a) passes
agc_write_trackingas a whole, #7233's own checks included.agc_write_trackingneeds write watching (userfaultfd on Linux), so it skips on hosts without it.So in either merge order, I think the possible ring should get the same replacement and eviction as the exact one. If #7233 lands first, I'll do that in #6868's rebase. If you'd rather have it in #7233, I can put the test and the possible-ring change on a branch on top of your head. Without #6868 underneath, that change brings #6868's containment and eviction for the possible ring only.
One small thing: in
markWritten, theconst bool completefrom the write-watch collection shadows the newcompleteparameter. ThenoteDriverStorecall after that block reads the parameter, so only the name would change.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T00:11:48Z.
Thanks for the detailed 007 First Light report and the follow-up suggestion. I applied the contained-interval reuse and lowest-generation eviction rule to both the exact-write and possible-write rings in d88fbaa45, and added an assertion that six repeated possible writes do not make the adjacent range read as stored over. I also renamed the local write-watch collection result to avoid shadowing the complete/possible parameter.
check_conventions.py --base upstream/mainandgit diff --checkpass. Linux GCC 12.2/Ninja Release buildsagc_write_tracking_tests; this host returns the suite’s skip code 77 because write watching is unavailable, so I cannot claim the runtime assertion passed locally. The existing CTest registration reports it skipped for that reason. The focused regression is now in the PR for a write-watch-capable run.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-18T00:57:15Z.
Thanks for d88fbaa: the completion-time marking and the possible ring now using the same containment and lowest-generation eviction fix both issues from the last round. I ran it on a device: RTX 4090, Linux, main
a8581d3331+ this PR at d88fbaa45, with the tests added toANYPS5_AGC_EXECUTION_TESTS.agc_write_trackingran (it did not skip), and all five tests passed: write_tracking, native_multisample_depth, native_depth_retirement, native_depth_clears and native_depth_clear_refusals. WithCompleteHtileDepthClearchanged to mark nothing, native_depth_clears fails with "no complete tracked HTILE store", so the new positive case does depend on the completion mark.Three things before this can merge:
No test drives a recognized clear through the real path. Every test calls
NoteHtileDepthClearandCompleteHtileDepthCleardirectly, so nothing coversDriver::dispatch→recordDispatch→ theOnCompletecallback →CompleteHtileDepthClear. If that wiring broke, it would fail closed (native MSAA clears refused), so nothing would be corrupted, but CI wouldn't see it either. Could you add an execution case that submits the recognized HTILE clear dispatch as PM4 and then samples the depth? If that's too much, a title run that hits a recognized clear would do instead. @SleglJan's PPSA11386 harness run is one option.The ring-full eviction rule has no test. Containment now dedupes identical writes, so the existing six-repeat check passes with either lowest-generation or round-robin eviction once the ring is full. @SleglJan's
CheckRepeatedPossibleStorescovers this: a full possible ring forgets its lowest generation, and an overlapping write that contains no piece replaces nothing. Could you fold it in, or an equivalent?Order with #6868. Both PRs now change
noteDriverStore, so whichever lands second needs a rebase. @SleglJan offered to rebase #6868. Please agree between you which goes first.Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-18T01:13:00Z.
@MarcZX100 here are both checks for d88fbaa45.
Tests on your head as is (base
main922dc8999, no other changes). Setup: RTX 3080, NVIDIA 615.78.08, Linux 7.2.10, GCC 16.2.1, Release.ctest -R '^agc': 653 of 654 pass.agc_driver_stencil_ref_exportskips itself on this machine.agc_write_trackingran with write watching available: the binary prints "write tracking tests passed", with no skip.agc_driver_native_depth_clear_refusals,agc_driver_native_depth_clears,agc_driver_native_depth_retirement,agc_driver_native_multisample_depth,agc_driver_depth_htile_write,agc_driver_bda_deviceandagc_driver_bda_span_reads.agc_driver_native_depth_bda_clearwas merged intomainafter922dc8999, so it isn't in this tree and didn't run.007 First Light, arm (c): the harness from my last comment without #6868, plus your tracker commits 929e6cf2f and d88fbaa45, plus our
CheckRepeatedPossibleStores.Dispatch.cppandVulkanDevice.cpp.main, and will report here.mainthey decide whether its write-back stores its last block. The arms compare with each other, not with #7233 onmainalone.agc_write_trackingon (c)'s build passes, with your repeated-possible-write assertions andCheckRepeatedPossibleStoresin the same binary.Your new assertions cover repeated identical possible writes. #6868's tests are not in #7233:
CheckRepeatedNeighbourStoresinagc_write_trackingcovers four cases for the exact ring: six identical stores keeping their complete coverage, a store over three earlier pieces, lowest-generation eviction after a slot was replaced, and an overlap that contains no piece.agc_repeated_neighbour_storeswrites back a storage image whose last block takes five driver stores after its end, over watched memory and over a host import.For oneandonlydean's point 2, I'll put
CheckRepeatedPossibleStoreson a branch on top of d88fbaa45 and link it here.Since #7233 now carries #6868's exact-ring change, the two PRs overlap fully there. I'll come back on the order with #6868.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T01:37:55Z.
Thanks for running the current
d88fbaa45head on the RTX 3080 and for the controlled 007 comparison. The native depth refusal/clear/retirement and write-tracking groups pass on your device, and the updated possible-ring rule matches the no-magenta arm in the comparison.The remaining validation gap from @oneandonlydean is still real: the 007 arm you describe excludes the HTILE completion commits, so it does not exercise the production
Driver::dispatch→recordDispatch→ completion callback →CompleteHtileDepthClearpath. I will work on an execution regression for that wiring; I do not count the existing direct helper test as covering it.For ordering with #6868, I propose merging #7233 first because this head now contains the exact-ring fix and the possible-ring extension; #6868 can then rebase and keep its title-level write-back regression. Please link your possible-ring helper test branch when ready so I can review it against the current
CheckRepeatedPossibleStoresassertions.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T01:41:54Z.
Added a bounded-history regression to
agc_write_tracking_tests: eight disjoint possible-write intervals in one block evict the oldest of the four retained slots, retain the newest, and re-recording the old interval makes it visible again. The target compiles on Linux GCC 12.2/Ninja Release. Runtime execution skips on this Linux 6.1 host because guest write-watch support is unavailable, so the new assertions still need a supported host run. I have not yet added the fullDriver::dispatch->recordDispatch->OnCompleteintegration test; the existingNativeDepthBdaClearharness enters throughVulkanDevice::Dispatchand cannot prove Driver-side kernel recognition by itself.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-18T02:20:41Z.
Thanks for the bounded-history test. We ran 330610e2c on current
mainon an RTX 4090 with write watch available, so the test actually ran instead of skipping. The production change is the same as d88fbaa45, and the four native depth tests pass (agc_driver_native_multisample_depth,_depth_retirement,_depth_clears,_depth_clear_refusals). The new assertion fails:(WriteTracking.cpp:162.) The test and the code disagree about what eviction means. On eviction,
possibleDropped = max(possibleDropped, oldest.generation)folds the evicted interval's generation into the block, andStoredOverthen returns true for any range of that block oncepossibleDropped > generation. So after eight distinct inserts into a four-slot ring, interval 0 still reads as stored over, and so does the rest of the block. The test expects eviction to forget it.Please pick one:
StoredAllSincestays false. Or drop the commit.StoredOverconsumer that needs it and add a test of that consumer.Either way, a test that tells lowest-generation eviction apart from round-robin is still missing: refresh an old slot through containment, then overflow the ring, and check which slot was dropped.
Linux CI may skip
agc_write_trackingon a runner without userfaultfd, and Windows has no write watch, so please check that the test shows Passed (not Skipped) in the log, or run it on a host with write watch.The
Driver::dispatch→recordDispatch→ completion →CompleteHtileDepthClearintegration test can be a follow-up. A break in that wiring is refused rather than reported as a clear.On ordering with #6868: agreed, #7233 first.
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-18T02:23:45Z.
@MarcZX100 @oneandonlydean I get the same failure on my RTX 3080 machine (Linux, write watching available), from 330610e2c as is: "an evicted possible-write interval remained in the bounded history" (
tests/WriteTracking.cpp:162). The reason is the one oneandonlydean gives: the evictions raisepossibleDroppedpastbefore, andStoredOverthen answers true for the whole block (Execution/src/GuestMemory.cpp:1580).With the possible ring's eviction switched to round-robin locally, it fails the same way at the same line. Eight disjoint writes in generation order pick the same slots under both rules, so this check doesn't tell them apart.
offer/7233-possible-ring-testhas two commits on 330610e2c: oneandonlydean's option (a) for that block, then the ring test he asks for. The fix comes first, so it can be taken without the ring test, but I ran only the branch tip.before;CheckRepeatedPossibleStores. It checks three things:Compared with the version in (c)'s build, its repeated-writes section is gone: your six-repeat check tests the same three properties within one block.
On the RTX 3080,
agc_write_trackingpasses on the branch tip. Two local variants of the possible ring (not in the branch) make it fail at "a full possible ring evicted a newer piece instead of its oldest": round-robin eviction, and an eviction of the second-oldest piece.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-18T02:41:14Z.
Windows retest, 2026-10-21: the revised clear group passes on both GPUs, with 26 completed outputs and one expected uncovered-HTILE refusal per run.
Tested #7233
eb55d58728f367f527253b3ae5b30ed45030fdf3adapted onto maincd700fe9ec0ec49a0394845605c3d42f2789c556as base01248f46b6e3e16b5fc5b5ce5bf503a7593848ff, using test-only control20de25385f.NativeMultisampleDepth.cppis byte-identical to exact eb55. The control differs from the adapted base only by #7371's identical BDA regression; none of #7371's production handoff is present. This is an adapted-main composition, not an unchanged whole-PR checkout.agc_driver_native_depth_clearsEach clear run reports
checked=27 unavailable=0, but the uncovered DriverDispatch case returns after asserting the exact production refusalnative multisample depth clear requires tracked HTILE generations. That case does not validate completed-clear output. Both the fixture and live-driver contexts select the requested physical GPU; the scratch private-import probes say write watch is kept. Those probes do not prove coverage for the actual metadata span. The reason that span is uncovered on this Windows host remains unisolated; #8759's Linux host-import diagnosis must not be assumed to be its cause.Control total: 60 assertion passes plus six expected missing-pending-range failures (
the recognized HTILE clear is missing its pending write range), separately from literal main's 66 passes on its older fixture. All runs: no whole-test skips, timeouts, VUIDs, validation errors or warnings. Main's clear group has 23 completed-output cases, so passing names alone are not identical coverage. This supersedes the older dc960 completed-clear failure as the current fixture result, without claiming a production tracking fix or a game result.Windows 11 Enterprise 26200; WinLibs GCC15.2r7/UCRT Release. NVIDIA RTX 5080
10de:2c02, 610.62 / 32.0.16.1062; AMD Radeon(TM) Graphics1002:13c0, 32.0.21036.18. Actual devices and Khronos 1.4.363 insertion verified; required Vulkan, app shader cache and journal disabled; driver cache uncontrolled. #7371's separate qualified refresh now passes all66 selected processes, including the BDA consumer regression3/3 per GPU; it retains the same26 completed outputs plus1 expected refusal in the clear group. Those candidate results are not included in this control's counts.AI-assisted: yes (Codex); author responsible.
Historical Windows evidence at its original pins
Current Windows retest, 2026-10-20: the CPU-only gate exposes a completed-HTILE failure on both physical GPUs, including NVIDIA.
Tested #7233
dc960cf76594cf96ac07b804ddd3f310ecc47c9d/ main339217ebc9using control28336d0554. Its production andNativeMultisampleDepth.cppare byte-identical to that prerequisite. The sole file difference is #7371's independent BDA regression; none of #7371's production handoff is present. This is not an unchanged whole-PR checkout.agc_driver_native_depth_clears, three fresh serial CTest processes1002:13c0, driver 32.0.21036.18All six reach
driver idle returned before recording the completed HTILE dispatch(CTest exit 8), within 1.3 s. The CPU-device condition no longer hides these failures. Actual adapters and loaded Khronos 1.4.363 verified; zero VUIDs, validation errors/warnings or timeouts. Windows 11 Enterprise 26200, WinLibs GCC 15.2 r7/UCRT Release, required Vulkan, app shader cache/journal disabled; driver cache uncontrolled.This differs from the passing Linux NVIDIA results, so the observed failure is not confined to RADV. A common Windows/RADV cause is not established. The earlier actual-range watched-coverage measurement below was not repeated, and no assertion or production guard was weakened. #7371's qualified handoff refresh now passes its BDA regression 3/3 per GPU, while the prerequisite completed-clear assertion still fails 3/3 per GPU with that handoff present. It remains dependent on this PR.
AI-assisted: yes (Codex); author responsible.
Earlier Windows results, skip-gate checks and watched-range measurements at their original pins
@MarcZX10 @oneandonlydean @SleglJan Exact-head Windows retest, 2026-10-20:
8073c2e532still skips DriverDispatch on both physical GPUs; this is not a hardware completion pass.agc_driver_native_depth_clears: 3/3 skipped per GPU, after each process completed its 26 other clear subcases. The new result-based gate prevents theStoredAllSinceassertion from running on this hardware too. Dean's hardware-gating concern remains unresolved.skipped native HTILE driver dispatch: this device's ...does not match its device-limitation convention. This is a parser check, not a Linux/lavapipe runtime result.I pushed a one-line message-only proposal, based directly on Marc's head. Three fresh processes per GPU still skip, and all six outputs now pass both Linux and Windows skip-policy parsers. It changes neither the skip condition nor production validation, and does not resolve the hardware-gating review. Selected target builds and conventions pass; Cppcheck/clang-tidy complete with three advisories in unchanged code. No new full build or Linux runtime claim for the message edit.
Controls: literal main
434e965d46passes all 33 selected attempts. The older prerequisite adapted to that same main (fa23b5820a) gives 27 passes and six DriverDispatch failures. Its entire tree differs from exact8073c2e532only in the nine-line fixture update. Required Vulkan, actual adapters and loaded Khronos verified; no VUIDs, validation errors/warnings or timeouts in these focused runs. App shader cache/journal requested disabled; driver cache uncontrolled.RTX 5080 / 610.62 and Radeon Graphics / 32.0.21036.18, Windows 11 Enterprise 26200, WinLibs GCC15.2r7, Khronos1.4.363. Could the device-dependent DriverDispatch case also become a separate CTest entry, so its skip does not mark the 26 completed clear subcases as skipped?
AI-assisted: yes (Codex); author responsible.
Earlier Windows watched-range measurements and validation at their original pins
@MarcZX10 @oneandonlydean @SleglJan Windows follow-up, 2026-10-20: the actual HTILE range loses its watched coverage during DriverDispatch on both GPUs.
Current #7233
1c210cd21dcomposed with main77e31219c8as parent9d089a66d5, using its original fixture and none of #7371's production or fixture changes, failsagc_driver_native_depth_clears3/3 per GPU atdriver idle returned before recording the completed HTILE dispatch.Following Jan's actual-range investigation, I added only five net fixture lines querying the same metadata range before/after
SubmitDriverHtileClear, and printing the unchanged completion predicate. No production change or weakened assertion. All three fresh runs per GPU report:The scratch host-import probe reports
keep the write watch: yesin these processes; that probe does not guarantee coverage for this actual range. The Windows measurement confirms loss of the fixture's watched-range precondition, consistent with Jan's proposed post-dispatch capability check. It does not identify which Windows call removes coverage or directly measureclearGeneration. A capability-check adjustment remains to be validated; all six measurements still fail the original assertion.Later integration retest: after merging main
b85d972f42(including #6759's write-watch restoration), integrationca0c22e410still fails this DriverDispatch assertion 3/3 on each Windows GPU. The separate BDA-consumer fixture passes 3/3 on each. Required Vulkan, actual devices and Khronos insertion verified; no VUIDs, validation errors/warnings, skips or timeouts in these twelve runs. This composition includes #7371 and other bring-up work: it is not an isolated #7233/main comparison, and it does not repeat the watched-range measurements above or establish a new cause.Windows 11 Enterprise 26200, WinLibs GCC15.2r7; RTX5080 610.62 and Radeon Graphics 32.0.21036.18. Actual devices and loaded Khronos1.4.363 verified, Vulkan required, app shader cache/journal disabled; no skips, timeouts, VUIDs or validation errors/warnings. The earlier CPU-race message is absent. #7371 has the same six completion failures; literal main passes its older fixture without this DriverDispatch coverage. No new Linux/title claim. AI-assisted: yes (Codex); author responsible.
Earlier Windows observations at older prerequisite pins
Windows follow-up, 2026-10-20: the unlocked Driver wait no longer times out, but the current prerequisite still fails its DriverDispatch completion case on both GPUs. This matches @SleglJan's Linux NVIDIA report on
2e048f56ff.Scope: #7233 head
2e048f56ffadapted onto main0393728fd3as2ebf5005c0, plus #7371's regression files at53be445b97, without #7371's production handoff. This is an adapted-parent check, not an unchanged published-head run. Prerequisite history and Jan's tracker-test attribution are retained.agc_driver_native_depth_clears, one fresh process per device, fails in 1.293 s on RTX 5080 and 1.834 s on Radeon Graphics:The same messages occur with #7371 production present (
191060e6fb), 1.277 / 1.629 s. No 30-second timeout, skip, VUID, validation error or warning. I have not identified the newer CPU stamp's source and have not relaxed the race guard. These results do not confirm an import-caused stamp.Literal main passes its original clear fixture once per GPU; it lacks the new DriverDispatch assertions. The separate six native-depth/draw groups pass 3x per GPU on main and the candidate (36 GPU passes per pin), with another 18 CPU passes per pin. The BDA consumer regression fails 3/3 per GPU without the handoff and passes 3/3 after restoration. None of those counts includes the failing DriverDispatch case. Full candidate build and all matching control/restoration target builds pass. Current scoped evidence.
Hardware: NVIDIA RTX 5080
10de:2c02, 610.62 / 32.0.16.1062; AMD Radeon(TM) Graphics1002:13c0, 32.0.21036.18; Windows 11 Enterprise 26200, supported WinLibs GCC 15.2r7/UCRT. Khronos 1.4.363 device insertion and actual GPU verified, Vulkan required, shader cache and pipeline journal disabled; driver caches/system implicit layers uncontrolled. No new title/performance claim.Earlier timeout and packet/unlock observations remain historical results at their original pins; they are superseded as a description of this current Driver case. Order remains #7233, then #7371.
AI-assisted validation/report: Codex; author responsible.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T02:41:51Z.
Added a
DriverDispatchclear case under--clears. It submits the recognized HTILE mask kernel through the public DCB/PM4 path, then uses the existing native depth readback to check that the production completion callback made the clear visible.Verification:
agc_driver_native_multisample_depth_testscompiled successfully.git diff --checkpassed.--clears; execution stopped before GPU assertions because this host's Xeon E5-1620 v2 lacks the required LZCNT, BMI1, BMI2, MOVBE, AVX2, and FMA instructions.check_conventions.py --base origin/mainreports six existing non-conventionalRevertcommit subjects in the PR history; no finding pointed to this change.Could someone with a supported CPU/GPU run
agc_driver_native_multisample_depth_tests --clearson this head and confirm the new production-path case passes?Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T02:44:25Z.
I reviewed and carried Jan Šlégl’s two test-only commits from
offer/7233-possible-ring-testonto this PR, preserving Jan as author. They correct the assertion to match the conservativepossibleDroppedbehavior, then add controls that exercise exact-store coverage, refreshing an older slot before overflow, and overlapping without containment. No production tracking behavior changed.Validation on this branch:
agc_write_tracking_tests; local execution returned 77 withno write watching: skippedon this host.--clearsexecution is stopped by this host’s CPU feature guard before GPU assertions.agc_write_trackingpassing 3/3 with write watching active on the offered commits.The production-path HTILE dispatch case is also on this head. It still needs a supported CPU/GPU run.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T03:07:51Z.
Thanks for the updated exact-head results. The timeout and the later incomplete-transition failure are in the new Driver clear regression added by this PR, so I agree that case is not passing and should be resolved before treating the PR as fully validated. I see you are extracting the current-main follow-up with #7233 first; please link the branch/commit or PR when it is ready so I can review and carry the fix without duplicating your consumer-handoff work. I will keep the validation claim scoped to the tracker tests and won’t describe the Driver clear case as passing.
Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-18T03:19:09Z.
@MarcZX100 The focused consumer-handoff follow-up is ready for review as #7371, head8cc74c3298. Our own two-commit diff is5files,+70/-5; full Windows/Linux builds and the focused physical-GPU regressions pass. It preserves your662 prerequisite and Jan's authorship.
Proposed order remains #7233 first, then #7371 as its separate dependent follow-up, so please coordinate here before carrying the handoff into the parent. The Driver-fixture correction is still under investigation: the latest attempts reach guest-write guards, and I have no passing fixture fix ready to cherry-pick. Its exact-head failures and source-verified setup mismatches remain in the maintained validation comment.
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-18T04:09:21Z.
@MarcZX100 @Amoenus @oneandonlydean here are Linux results for 662e427f3 and #7371. Setup: RTX 3080, NVIDIA 615.78.08, Linux 7.2.10, GCC 16.2.1, Release.
main2626e5ee7, so its column is on a newermainthan the other two.main0bb238b4a(#7233's base)agc_driver_native_multisample_depth_tests --clears, run directly with a 120 s limitCompletedPossibleStorefinish, then no output inDriverDispatchagc_driver_native_depth_clears(ctest)agc_driver_native_depth_bda_clear(#7228)agc_write_tracking,agc_driver_native_multisample_depth,agc_driver_native_depth_retirement,agc_driver_native_depth_clear_refusalsDriverDispatchtimeout that Amoenus reports reproduces here, and #7371's head still has it.agc_driver_native_depth_bda_clearfails on 662e427f3. There the full BDA clear's HTILE write counts only as a possible write, and the test dispatches throughVulkanDevice::Dispatchwithout the clear's completion, so nothing records the write as complete.ctest -R '^agc' -E '^agc_driver_native_depth_clears$'on 662e427f3: 679 of 681 pass.agc_driver_native_depth_bda_clearfails, andagc_driver_stencil_ref_exportskips itself.007 First Light, as I said I'd check: in three runs, no dispatch is recognized as the HTILE clear.
NoteHtileDepthClear.CompleteHtileDepthClear, which the arm (c) tree doesn't have.main922dc8999) + #5799, #6317, #6332 and #6881Counts cover each whole run from boot.
DriverDispatchcase is that test once it passes.APS5_PIPELINE_DISPATCH=1).One more point, from reading the code; I haven't measured it. At
Execution/src/Driver/Dispatch/Dispatch.cpp:403-405,dispatch()runs again for the same packet. By then the outer call has already passedNoteHtileDepthClear, and the completion it holds (:122) is not attached. The same holds for the resolve-ahead rethrow at :434-438 when it comes fromPrepareDispatch(:522); the call from :570 already carries the completion. The second call would then hit the overlap refusal inNoteHtileDepthClear(Graphics/src/DepthSurface.cpp:1313), and only a new surface clears that refusal.Graphics/src/Recorder.cpp:1013-1019), so at :403recordQueuedLabelsAfterCapturefinds no overlap and returns false.APS5_NO_QUEUED_LABELS=1orAPS5_NO_LABEL_BATCHING=1, the queued labels are not noted for that hook (Execution/src/Driver/Packets/PacketFlush.cpp:17-18), and the path looks reachable.[labels]reported 0 packets redone for a queued label over the capture (the :403 path), and[groupcap]reported 0 rejected by the device (the :434-438 path).AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T04:23:31Z.
Thanks for running the exact heads and for separating the title runs that never exercise HTILE recognition from the completion-path regression. The RTX 3080 results confirm that
DriverDispatchstill hangs on both #7233 and #7371, while main completes; the title runs therefore do not validate this path. I will keep the completion change unvalidated until that case finishes and the completion-aware BDA regression passes on the intended head. The detailed timeout location or a stack trace, if available, would help isolate where the dispatch stalls.Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-18T04:29:24Z.
@MarcZX100 @SleglJan I have no captured stack trace, but our fixture-only control localizes the first wait: main holds GpuMutex across the Driver case, which waits for the dispatch worker. Releasing that outer fixture lock around the case removes the timeout on RTX5080 and reaches the incomplete/unproven-clear refusal. Subsequent packet/extent corrections reach further guest-write guards; there is no passing Driver fix yet. Exact-head controls and the correction sequence are maintained in place; production guards remain intact.
Agreed that #7371's completion-aware BDA case is a changed fixture, not an unchanged-head pass for #7233, and the 007 runs do not validate unexercised HTILE completion. I also checked the cited dispatch re-entry ordering: recognition precedes both recursive calls. That is source evidence only; I have not reproduced its overlap refusal and will keep it separate from the confirmed fixture timeout.
AI-assisted: Codex; author responsible.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T04:30:19Z.
Thanks, that localizes the first wait to the fixture lock and separates it from the still-unproven HTILE clear. I agree that releasing the lock only removes the fixture timeout; it does not validate the production completion path, and the later refusal still needs to be resolved on the intended head. I also agree that #7371’s changed completion-aware fixture is separate evidence rather than a pass for #7233 as published.
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-18T04:45:55Z.
@MarcZX100 here are stacks of the
DriverDispatchstall on 662e427f3. It is the deadlock Amoenus describes. Line numbers are from 662e427f3.Setup: Linux, RTX 3080, a Release build (
-O3 -g) of the test target only,--clearsunder gdb, interrupted after 30 s,thread apply all bt.Test thread:
It holds
GuestMemory::GpuMutex()from thelock_guardatNativeMultisampleDepth.cpp:1153.Queue worker running the submitted
DISPATCH_DIRECT:The worker blocks on
GpuMutexatDispatch.cpp:85, whereDriver::dispatchcreates the driver'sVulkanDevicebecause none is loaded yet (:82-88). That comes before the recognition atDispatch.cpp:135-140, which is why no refusal text appears while the fixture holds the lock.The other threads are idle condition-variable waits: two Mesa RADV disk-cache threads (from the iGPU's Vulkan driver), five NVIDIA driver threads and the
AsyncLogthread.#7371 at 8cc74c329 has the same two stacks, with the lines shifted:
Lifecycle.cpp:180,GuestMemory.cpp:1968,mainatNativeMultisampleDepth.cpp:1191and thelock_guardat:1161. The rest are unchanged.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T04:49:44Z.
Thanks for collecting the stacks. This identifies the timeout as a test-fixture deadlock: the test holds
GuestMemory::GpuMutex()acrossWaitIdle, while the queue worker needs that mutex inDriver::dispatchbefore clear recognition runs. This separates the fixture timeout from the production HTILE completion path; the guard/refusal behavior still needs separate validation.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T05:07:17Z.
Thanks for the stacks; they confirm the fixture holds
GuestMemory::GpuMutex()while waiting for the queue worker that needs the same lock before it can reach the intended assertion.I prototyped releasing the fixture's
unique_lockaroundWaitIdleand reacquiring it on both success and exception. The focused target builds after a temporary, restored workaround for the unrelated GCC 12Flags<MemoryFlags>()parse error. CTest on this Xeon aborts at the host CPU feature guard before assertions, so I cannot claim a local runtime pass. The PR branch is behind currentmain; my local rebase hit an earlier conflict inGuestMemory.cpp, so I have not pushed this test change. The existing #7233 head remains unchanged.Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-18T05:12:32Z.
@MarcZX100 if you push the prototype to a branch, I can run
agc_driver_native_multisample_depth_tests --clearsand the native depth ctests against it on the RTX 3080 (Linux; this CPU passes the feature guard). It can stay on 662e427f3's base; no rebase is needed for the run.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T05:22:05Z.
I pushed the fixture-only prototype on codex/7233-unlock-fixture-wait, commit
b7bc7865600391a8b423fc33929470517a7c5e0a, based directly on the current #7233 head662e427f3; I have not rebased or changed the PR head. The change passesgit diff --checkandpython3 tools/check_conventions.py --base upstream/pr-7233-current --head HEAD, andagc_driver_native_multisample_depth_testsbuilds on Linux/GCC 12. CTest aborts at the Xeon E5-1620 v2 CPU-feature guard before reaching assertions, so I do not have a local runtime result. The one-linetemplateworkaround for the unrelated GCC 12 parse error inSrtDescriptorEvaluation.cppwas restored and is not in this branch. Could you runagc_driver_native_multisample_depth_tests --clearsand the native-depth CTests against this branch on the RTX 3080 when convenient?Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-18T05:53:09Z.
Current consumer-handoff validation (2026-10-18): #7371 now follows your rebased
348a5345d3directly. Its two handoff commits are unchanged; full Windows/Linux builds and the focused matrix pass (57 invocations, plus the documented Linux BDA write-watch skip). Our own scope remains five files, +70/-5. The prerequisite Driver/PM4 clear fixture is excluded from that passing matrix and remains separately disclosed; this does not establish that Driver case as passing.Earlier exact-b7 results and the CPU-validated rebase offer
@MarcZX100 I tested your exact
b7bc786560prototype on RTX 5080, Radeon Graphics, and Linux lavapipe. The timeout is gone on all three; the Driver clear test still fails at the incomplete/unproven transition guard (Linux aborts after printing it). The other native depth, retirement, and refusal groups each passed three fresh runs per device. Production guards were unchanged. I updated the existing validation report with the exact scope and results; this supports the wait correction, but does not yet validate the clear-completion path.Separate rebase offer:
db4c0d39feon our fork merges exact662e427f3with main66e71b63d1, retaining your original commits and Jan's credit. TheGuestMemory.cppresolution retains main's partial-watch stamping and carries yourcompleteflag throughstampWatchedPart; completed own stores passtrue. It adds a partly watchedMarkPossiblyWrittenregression. The CPU write-tracking group passes 3/3 on Windows and 3/3 on Linux; disabling partial-watch stamping for possible writes fails the new assertion 3/3 on Windows, then restoring it passes 3/3. Conventions pass. This is a CPU-validated source rebase offer, not a full/GPU-validated integration or upstream submission, and does not include your separateb7prototype.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T05:57:28Z.
Thanks for testing the exact fixture prototype on the RTX 5080, Radeon iGPU, and lavapipe. That confirms the fixture lock was the source of the timeout across those backends, while the incomplete-transition guard remains a separate failing production-path assertion; I will keep the PR’s validation scoped accordingly. I am reviewing your attribution-preserving rebase composition against current
mainnow, then I will continue on the clear-path test without relaxing its production guards.Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-18T06:04:48Z.
@MarcZX100 here are results for b7bc78656 on the RTX 3080 (Linux, NVIDIA 615.78.08, GCC 16.2.1, Release). Its diff against 662e427f3 touches only
tests/execution/NativeMultisampleDepth.cpp.On b7bc78656 as is:
--clearsno longer hangs. The 24 regular cases andCompletedPossibleStorepass, thenDriverDispatchfails with "native multisample depth incomplete or unproven fast-clear transition is not implemented", as Amoenus reports.agc_driver_native_depth_clearsfails in 0.47 s (no timeout).agc_driver_native_depth_bda_clearstill fails as on 662e427f3.agc_write_tracking,agc_driver_native_multisample_depth,agc_driver_native_depth_retirementandagc_driver_native_depth_clear_refusalspass.^agcoverall: 679 of 682 pass. Those 2 fail, andagc_driver_stencil_ref_exportskips itself.Where the refusal comes from, per a local
[htile]trace in the driver:NoteHtileDepthClear(htile, bytes = 1024, nativeBytes = 0)then takes the refusal branch (Graphics/src/DepthSurface.cpp:1312) and records no completion.CheckCurrent(:204), called fromDepthSurfaceHolds(:1431) andCheckDepthTarget(NativeMultisampleDepth.cpp:812).Two things in the test's packet (
SubmitDriverHtileClear) cause it. Both are already in Amoenus's validation comment:COMPUTE_PGM_RSRC2 = 8 << 1means eight user SGPRs and no X group id.HtileDepthClearBytes_nid_no_patchneeds six user words andgroupIdEnable[0](bit 7), so it returns 0.DISPATCH_DIRECTx = 1 covers 1,024 bytes (64 threads × 16), while this target's HTILE is 32,768 bytes. His diagnostic shows native = 1,024 against the 32,768 required once the SGPR flags are corrected.I changed both locally (not pushed). The hardcoded
0xf0words he also flags are unchanged:Here
metadataBytes = HtileMetadataBytes(extent)is passed in fromCheckDepthTarget. With that change, the case gets further along the production path:NoteHtileDepthClearreturns true;CheckCurrentruns with the clear pending and no refusal;CompleteHtileDepthClearis entered afterCheckCurrent(both takesurfacesMutex; its trace line comes second).Then it fails with "CPU writes raced native multisample depth clear". That comes from
CheckCurrent'sUnchangedSinceCollected(metadata.address, metadata.bytes, clearGeneration)check (DepthSurface.cpp:214), the CPU-race guard Amoenus reached after his corrections.CompleteHtileDepthClearprinted no trace line after itsMarkWritten. It has the same check (:1336).A possible cause I haven't verified: on this host, the run prints that importing a range dirties its watched pages, while a GPU write doesn't ("0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 4 after the import"). If the HTILE range is imported for the kernel after the clear is accepted, that import would read as a CPU write since
clearGeneration.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T06:16:08Z.
I traced the remaining
DriverDispatchrefusal to three fixture inputs, without changing production guards:COMPUTE_PGM_RSRC2must encode six user SGPRs andGROUP_ID_X_EN((6u << 1u) | 0x80u); the 5x3 HTILE extent is 32,768 bytes, so the dispatch needs 32 groups at 1,024 bytes/group; and the masked store computes(original & userData[5]) | userData[4], so the combined clear needsuserData[4] = 0xfffc00f0anduserData[5] = 0.I applied those fixture-only edits in the rebased worktree and built
agc_driver_native_multisample_depth_testssuccessfully. The runtime exits before the test starts because this Linux host (Xeon E5-1620 v2) lacks the AVX2/BMI/FMA features required by the test runner. The build also needed a temporary localtemplatedisambiguator atSrtDescriptorEvaluation.cpp:186for GCC 12; both temporary source edits have been reverted and the worktree is clean. I have not pushed or claimed a passing runtime result. Could someone with a supported CPU run the corrected--clearsfixture on the current PR head?Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T06:16:12Z.
Clarification on the build setup: the isolated CMake build used
-DCMAKE_CXX_FLAGS=-fpermissivein addition to the temporarytemplatedisambiguator, to get past GCC 12’s baseline parse failure. This is a compile-only result under that local workaround, not a clean standard-flags build.Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-18T06:38:54Z.
@MarcZX100 I ran all three fixture corrections together on the RTX 3080 (Linux, NVIDIA 615.78.08). They are local, on top of b7bc78656:
COMPUTE_PGM_RSRC2set to(6u << 1u) | (1u << 7u);DISPATCH_DIRECTx set tometadataBytes / 1024(32 here);userData[4] = 0xfffc00f0anduserData[5] = 0(registers 0x244/0x245).I haven't run the current head 348a5345d. Its
NativeMultisampleDepth.cppis the same as on 662e427f3, so it has neither your lock release nor these corrections. Line numbers below are from b7bc78656.DriverDispatchstill fails, at the same place as with the first two corrections: "CPU writes raced native multisample depth clear", fromCheckCurrent'sUnchangedSinceCollectedcheck (Graphics/src/DepthSurface.cpp:214). It fails the same way with and without my local trace. The run gets this far:CheckCurrentruns with the clear pending;CompleteHtileDepthClearis entered, but its trace line afterMarkWrittendoesn't appear before the test exits.So the user-data change doesn't move the stop. Going by the code,
CheckCurrentchecks the HTILE words (htileProvesClear,:221) only after this guard.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-18T06:40:54Z.
@MarcZX10 thanks for tracing the
DriverDispatchrefusal. The new head 348a5345d3 looks like a rebase of the same commits onto current main: the test files are byte-identical to 662e427f3, and b7bc786560 isn't on the PR branch. Could you push the fixture corrections from your 06:16Z comment (theCOMPUTE_PGM_RSRC2SGPR/GROUP_ID_X_ENencoding, 32 groups for the 32 KiB HTILE extent, and the rest) as a commit on this branch? We'll run full CI and the depth-clear tests on it straight away. The production side still reads correct after the rebase.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T12:02:12Z.
Pushed the requested fixture corrections in
42cbe0c33:COMPUTE_PGM_RSRC2;0xfffc00f0and zero the second mask word.Validation on Linux: both focused targets compiled.
agc_write_tracking_testsran and skipped because write-watch is unavailable on this Linux host.agc_driver_native_multisample_depth_testsstops at the existing host CPU guard (Xeon E5-1620 v2 lacks LZCNT, BMI1/2, AVX2, and FMA), before exercising the Vulkan test.git diff --checkandtools/check_conventions.py --base upstream/mainpassed. Hosted build jobs are skipped by the current path filters; conventions, eligibility, and report jobs passed on the preceding head. Please run the GPU-backed test on supported hardware for the final result.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T12:30:56Z.
Full
mainworkflow-dispatch run39126421629at0d078f75dgives a useful baseline: Linux CTest timed outagc_driver_native_depth_clearsat its configured 30 s limit (***Timeout 30.02 sec; 1 of 1,446 tests failed). This is consistent with the queue-wait issue this PR addresses, but it is an unmodified-main run, not validation of this branch. The Windows run had a separate timeout inshader_cache_native_paths.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-18T12:51:55Z.
Thanks for the register fix. The pushed commit has the RSRC2/group/mask corrections but not b7bc786560 ("release GPU lock while waiting for driver queue"), which was what removed the timeout in Amoenus's runs. On 42cbe0c3
SubmitDriverHtileClearstill callsAgcDriverWaitIdle_nid_postfix()while the test's outerlock_guardholds the GPU mutex, and full CI on 42cbe0c3 confirms it:agc_driver_native_depth_clearstimed out at 30 s on Linux. (Run 39126421629 is a PR build, not plain main: it's dispatched from main withpr=7233, and its "Merge the pull request into main" step mergesrefs/pull/7233/head42cbe0c33 into0d078f75d(11 files, including NativeMultisampleDepth.cpp) before building. So the timeout is on this branch.) Could you push b7bc786560 (or the equivalent unlock around the wait) on top?Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-18T13:32:10Z.
@MarcZX10 @oneandonlydean results for 42cbe0c33 on the RTX 3080 (Linux, NVIDIA 615.78.08, Release).
As pushed, matching oneandonlydean's CI run:
--clearsprints nothing after the 25 earlier cases (the 24 regular ones andCompletedPossibleStore) and was killed at 120 s. That's the same stop as on 662e427f3.agc_driver_native_depth_clearstimes out (30 s), andagc_driver_native_depth_bda_clearfails as before ("complete=0", "no complete tracked HTILE store").agc_write_tracking,agc_driver_native_multisample_depth,_depth_retirementand_depth_clear_refusalspass.^agc: 696 of 699 pass. Those 2 fail, andagc_driver_stencil_ref_exportskips itself.With b7bc78656's lock release cherry-picked on top (local), your corrected packets get the clear recognized:
CheckCurrentruns with the clear pending.CompleteHtileDepthClearis entered only after it: both holdsurfacesMutex, and its trace line comes second. Its trace line afterMarkWrittendoesn't appear before the test exits.The case then fails with "CPU writes raced native multisample depth clear". The throw is
CheckCurrent's first check with that text (gdb on that local tree, line numbers mapped to 42cbe0c33):The same frames and the same stop showed up on 662e427f3 with b7bc78656 and the same corrections (local), so the rebase onto
1b0c7cfa0didn't change it.The completion's
MarkWrittenisn't what fails:313:CompletedPossibleStore, which passes, the test callsCompleteHtileDepthClearbeforeCheckCurrent. ItsMarkWrittenreturns generation 3329, newer than that case'sclearGeneration3326, and:313holds.UnchangedSinceCollected(Execution/src/GuestMemory.cpp:1742) compares only CPU stamps, i.e. the per-page stamps fromnoteCpuStoreor the block's CPU stamp.MarkWrittenstamps its blocks as driver stores (:1592), which set neither. Its collect beforehand (:1576) stamps only pages that were already dirty, which the check's own collect would find anyway.From reading the code, not measured,
:313does count a host import inside the clear window:ImportWatchedcollects the range's dirty pages as CPU writes (:1449).stampWrittenRungives those pages CPU stamps even where the bytes didn't change (:1174). The import-window kind only keeps those blocks out of the stored stamp (:1058).VulkanDeviceis created in this dispatch (Execution/src/Driver/Dispatch/Dispatch.cpp:86, before the note at:139). So any import it makes for the dispatch comes afterclearGenerationwas collected.I haven't confirmed that the HTILE allocation is imported in this run. One more point from the code, also unverified:
Driver::WaitIdle(Execution/src/Driver/Lifecycle.cpp:175-184) waits until the worker has processed what was submitted, not for the completion. The completion runs when the batch is reaped, which is whyCheckCurrentcomes first here. With this fixture order,:314("no complete tracked HTILE store") would likely be the next stop even if:313held.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T13:52:45Z.
Thanks for the independent rerun and stack trace. The
CheckCurrentfailure at:313appears to precede completion, while the proposed lock release addresses the earlier wait timeout; the import-window CPU stamps you describe could be a separate cause. Before changing the patch, could you isolate whether the HTILE range is imported during this dispatch and whetherCheckCurrentstill fails with that import suppressed? That would distinguish the import-window hypothesis from a fixture/order issue. I would keep the lock-release change and this new failure separately validated.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-18T13:54:42Z.
Thanks @SleglJan, that narrows it a lot. @MarcZX10, with b7bc786560 the hang is gone and the clear is recognized, so the remaining
DriverDispatchfailure looks like two things:DepthSurface.cpp:313, added by this PR) usesUnchangedSinceCollected, which reads the per-page CPU stamps. Onmain, an import's collect gives its dirty pages CPU stamps even in the import window (stampWrittenRuncallsnoteCpuStorefor every kind exceptDriver,GuestMemory.cpp:1174; the window kind only changes the block stamp). On hosts where an import dirties its pages (SleglJan's 3080: "4 after the import"), importing the HTILE range afterclearGenerationis taken makes the guard refuse a clear nobody raced. In this test theVulkanDeviceis created inside the dispatch, so its import of the HTILE range lands inside the window. Could you confirm withAPS5_TRACE_HOST_IMPORT=1? If it does, I'd fix it in the product rather than the test: collect or import the metadata range before recordingclearGenerationwhen the clear is accepted, or have the check ignore pages stamped by an import-window collect. A title can hit the same thing whenever the HTILE range's first import comes after the clear.Driver::WaitIdlereturns once the worker has processed the submission, not after the batch is reaped, soCheckCurrentruns with the clear still pending, and:314("no complete tracked HTILE store") would fail next. If the guard is meant to refuse a pending clear (the safe direction in a title), the test should wait for the completion beforeCheckCurrent, asCompletedPossibleStoredoes. If a pending clear should be accepted,:314needs to account for it.Could you push b7bc786560, plus whichever of these you choose, so CI can show
agc_driver_native_depth_clearsandagc_driver_native_depth_bda_clearpassing?Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T14:00:04Z.
I traced the current code: the false-positive path is real at the tracker level.
ImportWatchedcalls the post-import walk withStampKind::CpuplusWindowCopy;stampWrittenRuncallsnoteCpuStorefor every non-Driver run before it checksWindowCopy::Holds, while the window only changes the general block stamp toImportWindow. So an unchanged page dirtied by the first host import can advance the CPU page stamp pastclearGeneration. I have not runAPS5_TRACE_HOST_IMPORT=1on the reported Windows/GPU setup, so I cannot confirm that specific runtime trace. Separately, the fixture should wait for/reap the completion before asserting the completed-clear proof;WaitIdlealone does not establish completion callback execution. I agree these should be tested independently so the guard does not accept pending work.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T14:07:36Z.
I checked the completion path further.
Recorder::Sync()runs the completion actions, so the dispatch fixture should call it afterAgcDriverWaitIdle_nid_postfix()and before asserting the completed-clear proof. The GPU-lock release commitb7bc78656addresses the independent wait hang.I also tried a fresh Linux build from the published head plus that fixture change. Configuration succeeded, but compilation stops in unchanged
core/shader/recompiler/Optimization/src/SrtWalker/SrtDescriptorEvaluation.cpp:186atread.read->Flags<MemoryFlags>()(GCC 12 reports a missing dependent-template keyword). I did not push the fixture-only change without a successful focused build/runtime check.For the import-stamp race, globally excluding
ImportWindowpages from CPU-write stamps would also hide a genuine same-value CPU store on those watched pages. A safe fix needs the metadata import to complete before the clear baseline (or equivalent evidence that distinguishes the importer from a CPU writer); the specific HTILE import trace on the reported machine remains unconfirmed.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T14:13:30Z.
Update to my previous build note: the failing template expression is exactly the current upstream occurrence already fixed by the open #6306/#6738 qualifier PRs. With that one-line qualifier applied temporarily in the isolated worktree, the full
agc_driver_native_multisample_depth_teststarget built successfully, including the GPU-lock release commit and a localrecorder.Sync()before the completed-clear assertion. The runtime binary then stopped at AnyPS5's host CPU guard because this Xeon lacks AVX2/BMI features; Vulkan execution was not reached. I restored the temporary qualifier and test edits and left #7233's published head unchanged. The HTILE import-stamp hypothesis still lacks the reported Windows/GPU trace, so this is not ready to push as a complete fix.Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-18T14:51:54Z.
@oneandonlydean @MarcZX10
APS5_TRACE_HOST_IMPORT=1confirms the import. Same local tree as in my last comment: 42cbe0c33 + b7bc78656, plus local[htile]trace lines; RTX 3080, Linux.The
DriverDispatchcase's dispatched clear is its second iteration; the first is a regular note and passes. In order:clearGenerationis collected.[gpu] host import of 0x…+0x10000 ok (1 live, 0.1 MiB live, 0.1 MiB ever). This imports the 64 KiB block that starts at the HTILE address, so it covers the whole 32 KiB metadata range.CheckCurrentstarts and fails at:313with "CPU writes raced native multisample depth clear".It is the only guest-memory host import (the only
[gpu] host importline) in the whole--clearsrun. None of the 25 earlier cases imports anything: they run on the fixture's own context, wherehostImportAlignmentis 0.The driver's device is created inside this dispatch, just before step 1. Its write-watch probe prints "host imports resolve write protection: no (0 of 4 scratch pages written after a GPU read, 0 after a GPU write, 4 after the import)".
I also added
recorder.Sync()right afterSubmitDriverHtileClearreturns (local). The order and the result are the same, and gdb again puts the throw atCheckCurrent:313(line mapped to 42cbe0c33), with the completion still after the check. The dispatch's completion is registered on the driver device's own recorder (Execution/src/VulkanDevice.cpp:4671,recorder.OnComplete, withrecorder=*state->recorderfrom:4522). The fixture'sRecorder::Sync()finishes only the fixture's recorder.:314is not reached, so this doesn't show whether it would pass.Importing the block before the clear isn't something the fixture can do on its own.
Graphics::HostImportForreturns nullptr there, because the fixture's own Vulkan context leaveshostImportAlignmentat 0. And the fixture's context isn't the driver's device anyway, which makes its own import inside the dispatch. A cheap control without a build isAPS5_NO_HOST_IMPORT=1, which stops the driver device from importing (the dispatch then copies and writes back instead). I'll run that next and add the result here.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-18T15:20:36Z.
The
APS5_NO_HOST_IMPORT=1control from my last comment doesn't separate the two. It runs on the same local tree (42cbe0c33 + b7bc78656 + trace).DriverDispatchcase never gets to the check. The clear is recognized and accepted, then the worker fails the dispatch with "AGC graphics: sample-preserving guest publication of native multisample depth is not implemented".RequireNoResidentDepthRead_nid_no_patch(Graphics/src/DepthSurface.cpp:1286). Without an import, the dispatch has to copy the HTILE block in through a guest read, and the resident native depth surface refuses that read.CheckCurrentnever runs for this clear, and neither:313nor:314is tested.With this fixture, the import is the only path that reaches the completion. To confirm the import as the cause of
:313directly, the product change (collect or import beforeclearGenerationis recorded) is the test.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T15:21:41Z.
Thanks for the follow-up control on #7220.
APS5_NO_HOST_IMPORT=1exits at the resident-depth read refusal before the completion/check path, so it does not discriminate the import race. That confirms the import-enabled driver-device path is the only current way to exercise this check; the fixture’s separate recorder cannot validate it. I agree the proposed production change remains unverified until a test or real-device run covers that path.Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-18T16:20:28Z.
A title-level datapoint for the containment reuse, which #6868 also has. Ruffle (PPSA68091) was on
main385ed71f2c+ #6543 + #7250 (Ruffle stops earlier without them), running Ruffle's own visual test SWFs, Linux, RTX 4070 Ti.The driver rewrites an 8-byte word at 0x400461a000 every frame, just after a 4x multisampled target's DCC (0x4004606000+0x14000) and in the same 64 KiB block. A temporary print in
StoredOvershowed the block's four pieces all at[0xa000, 0xa008), at generations 8385, 9011, 9637 and 10263, anddropped7758, newer than the target's 7143. So four frames after the target took a fast clear, its DCC read as stored over, though all 0x14000 bytes still held the clear key 0xc0. The next use stopped onwrites to a resident multisampled DCC target or its metadata are not implemented.filters__bevel_full,filters__bevel_inner,filters__bevel_outer,filters__glow_with_alpha_strength,filters__displacement_mapoutput.expected.png: a mean difference of 2.4 to 3.1 of 255 over 32x24 cells.blend_modes__shader_as_maskI ran this PR because #6868 conflicts with that stack in the debt file. The change that matters here is the containment reuse both PRs share.
Neither PR changes one thing: after a fifth distinct store in a block,
droppedstill makes every range of the block read as stored over and lose its coverage. I have a local change that also keeps the span of the pieces a block drops, so that only ranges overlapping it are affected. I'll offer it once this has landed rather than conflict with it.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T22:09:29Z.
Thanks for the title-level comparison. It shows the containment-reuse change lets five of the six SWFs reach the 32 s limit with frames close to their expected images;
blend_modes__shader_as_maskstill stops at the same refusal. The fifth-store coverage loss is a separate gap, and I’ll leave that follow-up to your planned change after this PR lands.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T17:51:56Z.
Merged current upstream
main(b6583dd868) into this PR asf0a05131bband resolved the write-tracking, depth-clear, and regression-test conflicts. The updated diff still includes the possible-write history coverage and native HTILE completion proof; I kept the upstream shared-block proof tests alongside this PR's possible-write eviction tests.Validation on Linux Release:
agc_write_tracking_testsbuilds successfully.no write watching: skipped; this host does not provide the write-watch facility, so the runtime assertions did not run here.python3 tools/check_conventions.py --base upstream/mainpasses.git diff upstream/main...HEAD --checkpasses.The overlap scan finds #7371 explicitly depends on this PR. It also reports shared AGC files in #7432 and several unrelated dispatch/graphics PRs; those paths were manually retained while resolving the merge. The current Windows CI result is pending.
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-19T20:15:17Z.
@MarcZX10 f0a05131bb on the RTX 3080, where write watching is available (Linux 7.2.10, NVIDIA 615.78.08, GCC 16.2.1, Release with
BUILD_TESTING=ON, onlyagc_write_tracking_testsandagc_driver_native_multisample_depth_testsbuilt). Each ctest ran 3 times:agc_write_trackingruns and passes, 3 of 3 (it printswrite tracking tests passed, not the exit-77 skip).agc_driver_native_multisample_depth,agc_driver_native_depth_retirementandagc_driver_native_depth_clear_refusalspass, 3 of 3.agc_driver_native_depth_clearstimes out at its 30 s limit, 3 of 3.--clearscompletes the same 25 cases as 42cbe0c33 did on 2026-10-18 (the 24 regular ones andCompletedPossibleStore). It then prints nothing inDriverDispatchuntil killed at 120 s.SubmitDriverHtileClearstill callsAgcDriverWaitIdle_nid_postfix()while the test'slock_guardonGuestMemory::GpuMutex()is held. The merge doesn't carry b7bc786560, as oneandonlydean noted for 42cbe0c33.mainb6583dd868, built the same way, passes all five 3 of 3. Its--clearsruns only the 24 regular cases (noCompletedPossibleStoreorDriverDispatch) and takes 0.39 to 0.40 s.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T20:22:37Z.
Thanks for the RTX 3080 run. It isolated a test-harness deadlock: the
DriverDispatchcase waited for the submitted queue while holdingGuestMemory::GpuMutex(). I pushedac0a545feto release theunique_lockaroundAgcDriverWaitIdle_nid_postfix()and reacquire it even if the wait throws.On this host the changed test source compiles and the executable links against the existing build artifacts, but the focused CTest aborts at the project CPU-feature guard (this E5-1620 v2 lacks required features). A full rebuild also stops earlier in
SrtDescriptorEvaluation.cppwith GCC 12's dependent-template parse error. I cannot claim a runtime pass here. Could you rerunagc_driver_native_depth_clearson the supported RTX 3080 host againstac0a545feto confirm it completes and preserves the expected cases?Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-19T20:55:37Z.
@MarcZX10 ac0a545fe on the RTX 3080, same build directory and settings as for f0a05131bb, rebuilt incrementally (the commit only changes
NativeMultisampleDepth.cpp, so onlyagc_driver_native_multisample_depth_testswas relinked). Three ctest runs and one direct--clearsrun:agc_driver_native_depth_clearsno longer hangs. It fails in 0.49–0.78 s, 3 of 3, with "AGC graphics: CPU writes raced native multisample depth clear".--clearscompletes the same 25 cases (the 24 regular ones andCompletedPossibleStore). It then fails inDriverDispatchwith that message and exits 1.CheckCurrentthrew atDepthSurface.cpp:313beforeCompleteHtileDepthClearran. I didn't take a stack trace this time, so I haven't confirmed it's the same check.agc_write_tracking,agc_driver_native_multisample_depth,agc_driver_native_depth_retirementandagc_driver_native_depth_clear_refusalsstill pass, 3 of 3.This head still calls
DepthSurfaceHoldsright after the wait, with the fixture'srecorder.Sync()after that check. The order from your 2026-10-18 14:07Z comment, arecorder.Sync()right afterSubmitDriverHtileClearreturns, I tried locally that day (https://github.com/boykopovar/AnyPS5/pull/7233#issuecomment-6251315588). It gave the same throw atCheckCurrentwith the completion still after the check, because the dispatch's completion is registered on the driver device's own recorder, not the fixture's.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T21:28:08Z.
Thanks for the RTX 3080 rerun. It confirms the unlocked wait fixed the hang, and isolates the remaining failure:
AgcDriverWaitIdle_nid_postfix()returned before the recorder ran the HTILE completion action. I pushed two commits: the regression now asserts complete-write evidence immediately after driver idle, andDriver::WaitIdle()drains the Vulkan recorder after queued submissions finish. The updated sources and test target link in a current-main integration build. My Linux runtime stops at the Xeon feature guard before reaching the assertion. Could you rerunagc_driver_native_depth_clearson the RTX 3080 against head2e048f56ff37441ac6bb19b01db6bf8d4a5db621and confirm both completion and the full clear matrix?Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-19T22:00:07Z.
@MarcZX10 2e048f56ff on the RTX 3080, same build directory, rebuilt incrementally.
Lifecycle.cppand the test were recompiled,libSceAgcDriver.prxwas relinked, and the test executable loads that.prx. Three ctest runs and one direct--clearsrun:agc_driver_native_depth_clearsfails in 0.50–0.51 s, 3 of 3.--clearscompletes the same 25 cases as before. InDriverDispatchit then prints these two lines and exits 1:--clears. I haven't traced this head.agc_write_tracking,agc_driver_native_multisample_depth,agc_driver_native_depth_retirementandagc_driver_native_depth_clear_refusalsstill pass, 3 of 3.Driver::WaitIdlenow changes for every caller. If you want, I can run the wider^agcset on this head and on its merge baseb6583dd868.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T22:36:39Z.
@SleglJan Thanks for rerunning the updated head. I traced the failure path:
NoteHtileDepthClearcapturesclearGenerationbeforePrepareDispatch/resource construction, whileCompleteHtileDepthClearlater rejects any CPU page stamp newer than that baseline.prepareDepthSamplingalready callsHostImportForfor the HTILE range before its initial baseline, so I cannot yet attribute the newer stamp to that import; the earlier import explanation remains unconfirmed on this head. Could you run theDriverDispatchcase withAPS5_TRACE_HOST_IMPORT=1and, if feasible, add a temporary trace ofclearGeneration,TrackerGeneration, and HTILE CPU page stamps aroundNoteHtileDepthClear, host import, and completion? That should tell us whether there is a second import/collection or a real CPU store after recognition. I am holding off on changing the conservative race guard until we can identify the stamp source. The wider^agccomparison againstb6583dd868would also be useful if it is convenient.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T22:37:44Z.
Correction to my previous note: I misread
prepareDepthSampling. It callsGuestMemory::Readfor HTILE, but that read/flush path does not itself callHostImportFor; the dispatch resource build can still make the first host import afterNoteHtileDepthClearcapturesclearGeneration. So the host-import explanation remains plausible and needs the requested exact-head trace. I should not have said the initial sampling path had already imported the range.Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-19T22:58:32Z.
@MarcZX10 here is the trace on 2e048f56ff (RTX 3080, Linux), with
APS5_TRACE_HOST_IMPORT=1plus local[htile]lines. The local lines record:clearGenerationandTrackerGeneration()at the note and at completion;UnchangedSinceCollectedfails.In
DriverDispatch's driver-path cycle (its first, fixture-path cycle passes with no stamps on the range), in order:NoteHtileDepthClearcollectsclearGeneration3909, withTrackerGeneration()also at 3909.ShaderResources::Complete→prepareAddressBindings→GuestBufferMemory::AcquireRegistered→ImportWatched.GuestWriteWatchCollectArmed→stampWrittenRun, withStampKind::Cpuand the import window set) stamps all of the 32 KiB HTILE range's pages at generation 3911.[gpu] host import of <HTILE block>+0x10000 ok.ImportWatched's pre-import walk (same kind, no window) has to succeed for this walk to run, and it logs nothing on the range, so the pages became written inside the import call itself.clearGeneration 3909, TrackerGeneration() 3913.UnchangedSinceCollectedcollects (3914), then fails on page 0 of the block, whose page stamp is 3911.Between the note and the completion, nothing else stamps the range: no
Rewatch, nowatchPrivateMapping, and no other written run. The whole--clearsrun makes two host imports of guest memory (the per-device write-watch probe imports only its own scratch pages): this one, and a 2 MiB import elsewhere just before it. On 42cbe0c33 + b7bc78656 on 2026-10-18, the HTILE import was the only one, so the 2 MiB one is new on this head. In the 24 regular cases andCompletedPossibleStore, the range's CPU stamps come only from written runs without an import window, none newer than that case'sclearGeneration, and no host import touches the range.So the newer stamp comes from the import's own walk, not from a second collection or a CPU store after recognition. That matches what you traced in the code on 2026-10-18 at 14:00Z:
stampWrittenRuncallsnoteCpuStorefor every non-Driver run before it checks the window. The window only switches the kind passed tostamp()toImportWindow, which skips the stored block stamp but still sets the CPU block stamp. The page stamp thatUnchangedSinceCollectedreads comes from the unconditionalnoteCpuStore.I'll run the wider
^agccomparison againstb6583dd868overnight and post it.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T22:59:37Z.
@SleglJan Thanks for the exact-head trace. It confirms that the import’s post-walk creates the newer page stamp: the
ImportWindowpath updates the CPU page stamp even though no guest CPU store occurred, andUnchangedSinceCollectedthen correctly rejects it as newer than the baseline.I have a local fix that leaves a recognized clear pending, then arms its generation baseline after dispatch resource construction/imports and immediately before
resources.MarkGpuWrites. The existing post-arm CPU-write refusal remains in place. I added a regression that runsImportWatchedbefore arming and retains the existing post-arm CPU-write refusal case. The rebased driver and test targets compile; local CTest still stops at this Xeon’s CPU-feature guard before Vulkan. I have not pushed yet because #8105 uses the same recognition path for its buffer-mask clear, and I asked its author to coordinate the baseline hook for that path.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T23:02:47Z.
@SleglJan I pushed a validation-only branch at codex/7233-import-baseline, head
cae2e8a997d8b9340de55553d34d86c9ec638ba3. It is rebased on currentmain; the open #7233 head is unchanged.The new
ImportWindowWritecase mutates HTILE inside theImportWatchedcallback, asserts that the import window creates a newer tracked generation, then arms the baseline. The existing post-armCpuWriterefusal case remains. Could you runagc_driver_native_depth_clears(or the executable with--clears) on this branch when convenient, along with the related native-depth groups? For the AGC validation comparison, please run the focused cases on currentmainand this branch with the validation layer and report any newVUID-messages. This host built the targets but its CPU feature guard stops CTest before Vulkan.Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-19T23:25:00Z.
@MarcZX10 results from the RTX 3080 (Linux 7.2.10, NVIDIA 615.78.08, GCC 16.2.1, Release with
BUILD_TESTING=ON), for the wider set first and then your validation branch.ctest -R '^agc', 795 tests, on 2e048f56ff and its merge baseb6583dd868, built the same way:agc_driver_native_depth_clears, theDriverDispatchcase from my trace;agc_driver_native_depth_bda_clear, which prints "Native full BDA clear: exact 32768-byte metadata readback passed; complete=0" and then fails with "native multisample depth clear has no complete tracked HTILE store", as on 42cbe0c33 on 2026-10-18.b6583dd868passes 794. On both treesagc_driver_stencil_ref_exportskips itself, as on 42cbe0c33.codex/7233-import-baseline cae2e8a997 against its base,
mainf29546ac4e. I builtagc_write_tracking_tests,agc_driver_native_multisample_depth_testsandagc_driver_native_depth_bda_clear_testson each. The focused ctest set ran twice:agc_write_tracking,agc_driver_native_multisample_depth,agc_driver_native_depth_retirementandagc_driver_native_depth_clear_refusalspass 2 of 2.agc_driver_native_depth_clearsandagc_driver_native_depth_bda_clearfail 2 of 2.f29546ac4e, all six pass 2 of 2 (its--clearshas only the 24 regular cases).--clearson cae2e8a997 completes the 24 regular cases,CompletedPossibleStoreand your newImportWindowWrite.DriverDispatchthen fails with "a native multisampled depth target is sampled only by recorded draws and dispatches". Nothing prints "CPU writes raced" and the driver-idle assertion holds, so the CPU-writes guard no longer trips there.__cxa_throw, the stack at that throw isCheckDepthTarget→CachedSampledTexture→cachedTexture→DepthSurfaceTexture→Require(recorder != nullptr, …). ThatRequirechecksRecorderFor(context)'s result, soRecorder::Active()is either null there or on another device; I haven't checked which.agc_driver_native_depth_bda_clearon cae2e8a997 prints the same readback line with "complete=0", then fails with "native multisample depth clear has not been recorded", which isCheckCurrent'sclearPendingcheck.Validation layer:
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, layers 1.4.363. Each of the six cases ran once as its executable, on both trees.VUID-message on either tree, in any of them. On cae2e8a997 the two failing executables stop at their failures, so they cover less than on main.--clearsunder the layer then aborts (exit 134) after the failure above, with the layer's "The VkDevice dispatch handle was not found and Validation will crash. If you are using exit() …" message. Onf29546ac4eit exits 0.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T23:54:22Z.
Thanks for the detailed RTX 3080 traces and the 795-test comparison. They show two failures on this head:
agc_driver_native_depth_clearsandagc_driver_native_depth_bda_clear.The first trace isolates a false CPU-write stamp from the post-import write-watch walk:
stampWrittenRunrecords the entire dirty run incpuPagesbefore checkingWindowCopy::Holds(), even though unchanged import-window pages are separately classified asImportWindow. I am adding focused tracking coverage for unchanged versus changed pages in that window.I am treating the BDA clear failure as a separate unresolved regression; I will trace its missing complete-store proof and will not consider the PR validated until both failures are resolved and the broader AGC suite is rerun.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T00:15:45Z.
I rebased this PR onto current
main(fafadca12caabaef739f8765159f9fbd9c5744ed) and resolved the conflicts while retaining the newer main APIs and tests. I also added two focused commits: one adds unchanged-versus-changed import-window page assertions, and the next avoids advancing a CPU page stamp for an import page whose bytes match the pre-import snapshot. The import still counts as a possible CPU touch in block-level reporting.Validation on this Linux host: syntax-only compilation passed for
GuestMemory.cpp,WriteTracking.cpp,DepthSurface.cpp, andNativeMultisampleDepth.cpp;tools/check_conventions.py --base upstream/mainandgit diff --checkpassed. Theagc_write_trackingCTest skips here because this kernel/header setup does not enable the Linux write-watch backend, so I do not have local runtime confirmation.Could you rerun
ctest -R '^agc'on this updated head, especiallyagc_driver_native_depth_clears,agc_driver_native_depth_bda_clear, andagc_write_tracking, and share the result? The previous RTX 3080 report was against the old head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T00:22:30Z.
Correction after reviewing the complete RTX 3080 report in comment 6279572344: the earlier
codex/7233-import-baselinerun already showed that arming the clear baseline after imports stopped the CPU-race refusal. The remainingDriverDispatchand BDA failures came from separate paths, so I removed the redundant tracker-stamp experiment from this PR.The updated head
cd6dd42743is rebased on currentmain(34b1b77abf). It keeps the post-import baseline, restores the native-depth fixture recorder after driver idle before the next cached texture lookup, and updates the BDA test to pass its recognized clear-completion candidate through the sameVulkanDevice::Dispatchargument used by the driver. The test changes are separate commits.Syntax-only compilation passed for
DepthSurface.cpp,VulkanDevice.cpp,NativeMultisampleDepth.cpp, andNativeDepthBdaClear.cpp; conventions andgit diff --checkpassed. Runtime tests are still unverified here: this Linux host lacks the write-watch backend, the automatic PR workflow skipped platform builds, and manual dispatch requires repository admin rights. Could you rerunagc_driver_native_depth_clearsandagc_driver_native_depth_bda_clearon this head and share whether both now pass?Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-20T00:47:49Z.
@MarcZX10 RTX 3080 results for 18ed64a111 and cd6dd42743. Each ran
ctest -R '^agc'(806 tests) against its own base, built the same way, with failures rerun one at a time. On all four builds,agc_write_trackingruns (not skipped) and passes, andagc_driver_stencil_ref_exportskips itself.cd6dd42743 against
main34b1b77abf:agc_driver_native_depth_clearsandagc_driver_native_depth_bda_clearpass. Run directly,--clearschecks all 27 cases and exits 0.agc_driver_flat_store.34b1b77abflogs the same refusal and passes.34b1b77abfhas no failures out of 806.18ed64a111 against
mainfafadca12c: 4 failures, whilefafadca12chas none.agc_driver_flat_store, with the same message;agc_driver_image_table_reuse, with "an entry a dispatch wrote in the epoch kept its old texels". It passes on cd6dd42743; I didn't isolate why.agc_driver_flat_store, building only its test target in the same build directory:34b1b77abfpasses.b6583dd868), it passed in the full run.mainwas resolved, interacts with somethingmaingained betweenb6583dd868and34b1b77abf. Themainmerges in that range that touchFlatStore.cpp,GuestMemory.cpp,BdaResources.cpporGuestBufferMemory.cppare #6457, #6479, #6701, #6730 and #7432.mainfurther, because my bisect setup broke at configure.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T00:51:43Z.
Thanks for narrowing this to
agc_driver_flat_store. I traced the regression to the possible-write bookkeeping added by this PR:StoredOver()checkspossibleWhole,possibleDropped, andpossiblePieces, butUnchangedSince()calls the separateWriteTracker::storedOver()helper, which did not. When an exact possible-write interval overlapped the query, that helper could therefore report the range unchanged.I pushed two focused commits to the PR:
test(agc): include possible writes in unchanged checksadds exact-overlap and adjacent-range assertions.fix(agc): include possible writes in unchanged checksmakes the unchanged query account for the possible-write records.The new head is
b0d4e988d5, rebased on currentmain. Local syntax-only compilation passed forGuestMemory.cppandWriteTracking.cpp; conventions andgit diff --checkpass. I could not run the Vulkan tests here. Could you rerunagc_driver_flat_storefirst, then the^agcsuite on this head and report whether the failure is gone?Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T00:53:47Z.
I rebased the updated series onto the latest
main(a569f47cb7) after it advanced. The possible-write regression test and fix are unchanged; the new PR head is96b16cc20f. Syntax-only compilation forGuestMemory.cppandWriteTracking.cpp, conventions, andgit diff --checkstill pass locally. Could you rerunagc_driver_flat_storeand thenctest -R '^agc'on this head? The previous RTX 3080 run was againstcd6dd42743, before the two follow-up commits.Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-20T01:14:08Z.
@MarcZX10 96b16cc20f on the RTX 3080, against its base
maina569f47cb7, both built the same way. I ranctest -R '^agc'(806 tests) on each:a569f47cb7. On both,agc_driver_stencil_ref_exportskips itself.agc_driver_flat_store,agc_driver_native_depth_clears,agc_driver_native_depth_bda_clear,agc_driver_image_table_reuseandagc_write_tracking.agc_write_trackingran, not skipped.agc_driver_native_multisample_depth_tests --clearschecks all 27 cases and exits 0.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T01:28:03Z.
Thanks for running the matrix on the exact current head and base. This supplies the GPU evidence we were waiting for: all 806 AGC tests pass on both, the focused native depth-clear cases pass, and
agc_write_trackingran rather than skipping. I have recorded that scope and the stencil-export skip as reported; I am not extending the claim beyond those checks.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T01:53:31Z.
Thanks. Arming the clear baseline after the import and draining in WaitIdle answers both points, and SleglJan's matrix looks good.
One thing came in with the rebase. Main's
5532d51changedGuestMemory::StoredOvertoreturn tracker.storedOver(address, address + bytes, generation, false);, so a block with no driver pieces counts as stored over only when its walk pages are newer. 96b16cc20f keeps the older inlined body, which returns true for any such block. That quietly undoes part of5532d51for every StoredOver caller: texture re-uploads, CMASK proofs, and the DCC range check in MultisampleTarget.cpp. YourstoredOvermember already has the possible-write checks, so could you restore main's one-line body?Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T08:18:33Z.
Thanks for catching the behavior restored from #5532. I pushed two focused commits:
6d0cf4792cadds a page-precision regression (a collected CPU write on one 4 KiB page must not make the adjacent page in the same 64 KiB block count as stored over), and5c4b9fe129restoresStoredOver()delegation totracker.storedOver(..., false). That keeps the possible-write evidence handled by the helper while restoring main’s page-specific walk behavior. Diff and conventions checks pass, but I cannot runagc_write_trackingon this Xeon host because the CPU guard fails before test code; no current-head runtime result is claimed. I updated the PR description to distinguish the earlier 806-test GPU report on96b16cc20ffrom this head.Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-20T08:37:57Z.
@MarcZX10 runtime results for the current head
5c4b9fe129, since your Xeon can't run them: Ubuntu 24.04 (Linux 6.8), NVIDIA RTX 4070 Ti (595.99.02), GCC 13.3, Release withBUILD_TESTING=ON. I builtagc_write_tracking_tests,agc_driver_native_multisample_depth_testsandagc_driver_native_depth_bda_clear_testsat the head and at its basemaina569f47cb7, each in the same build directory, and ranANYPS5_REQUIRE_VULKAN=1 ctest -R '^agc_write_tracking|^agc_driver_native_depth'3 times on each:agc_write_tracking,agc_driver_native_depth_bda_clear,agc_driver_native_depth_retirement,agc_driver_native_depth_clearsandagc_driver_native_depth_clear_refusals. None skipped.agc_write_trackingran, and at the head that includes your newCheckStoredOverUsesPageEvidence.Not run: the full
^agcmatrix, the validation layer, other GPUs.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T09:39:52Z.
Thanks for running the repeated exact-head/base comparison on the RTX 4070 Ti and for reporting the scope precisely. I verified that the current head
5c4b9fe129restoresGuestMemory::StoredOverto main’s page-awarestoredOver(..., false)delegation, so the reviewed rebase regression is addressed in the published branch. The 5/5 results across three runs on both base and head are useful focused evidence; I have not generalized them to the broader AGC suite.Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-20T09:42:46Z.
@MarcZX10 the wider set for 5c4b9fe129, since milescoviello covered the focused tests: RTX 3080 (Linux 7.2.10, NVIDIA 615.78.08, GCC 16.2.1, Release with
BUILD_TESTING=ON), against its basemaina569f47cb7, built the same way. I ranctest -R '^agc'(806 tests) on each:a569f47cb7. On both,agc_driver_stencil_ref_exportskips itself.agc_write_tracking(it ran, including your newCheckStoredOverUsesPageEvidence),agc_driver_flat_store,agc_driver_native_depth_clearsandagc_driver_native_depth_bda_clear.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T09:44:11Z.
Thanks for running the full 806-test AGC selection on both the PR head and its base, and for noting the one expected self-skip. That comparison shows no new failures in this selected suite on
5c4b9fe129; I will keep the scope limited to these reported tests.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T12:04:14Z.
Thanks for the rebase. CI on
1c210cd21d(merged into maind50ec76da0, run 39416473533) still fails one test on Linux, the same way as the two runs on5c4b9fe129before it:That's the
RequireatNativeMultisampleDepth.cpp:821in theClearFault::DriverDispatchcase: afterSubmitDriverHtileClearand the driver idle,StoredAllSince(htileAddress, metadataBytes, generation)is false. The other cases in the test pass first. It fails 3 of 3 runs on Linux CI (lavapipe). Testers on NVIDIA (RTX 3080, RTX 4070 Ti) pass, and the same test passes on main in other runs, so it looks specific to this PR on lavapipe.The rebase doesn't change the HTILE path (the production code is the same as
5c4b9fe129apart from the Dispatch.cpp capture list), so the failure is expected to repeat until that path changes.Reading the path, the idle itself looks ordered: the dispatch is recorded before
markCompleted,Driver::WaitIdlesyncs the recorder and runs its completions, andMarkWrittenbumps the generation before it stamps. SoStoredAllSincereturning false points at one of these:ArmHtileDepthCleardidn't arm (no pending clear, orCollectWritesUncachedreturned 0 and refused), orCompleteHtileDepthClearran without matching the surface.markWrittenfailed. Then the range is unwatched (!collected→ unwatch →noteUnstampedStore), andStoredAllSincereturns false at!tracker.covers.The
/dev/udmabuf: Permission deniedline is worth checking first. On the CI runner, shared direct memory is copied rather than imported, which changes how the HTILE range is imported and watched. Your NVIDIA testers probably have udmabuf access. That would fit 1 or 2 and would explain why only CI sees it.Could you:
StoredAllSinceexit, and at the arm/complete match for the surface, shows it in one run), and push a fix to the product code or to the fixture, whichever is right; if lavapipe can't prove the store in this setup, the test should skip that case with askipped, the device ...reason rather than fail;agc_driver_native_depth_clearslocally on lavapipe before pushing: Mesa'slvp_icdviaVK_DRIVER_FILES=<path>/lvp_icd.x86_64.json(orVK_ICD_FILENAMES), ideally also without access to/dev/udmabuf, as on the CI runner, and post the output.Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-20T14:11:30Z.
@MarcZX10 @oneandonlydean this reproduces locally, and udmabuf doesn't cause it.
Setup:
BUILD_TESTING=ON.VK_DRIVER_FILES.Results:
agc_driver_native_multisample_depth_tests --clearsfails (exit 1) in all 3 runs in each of two setups: with access to/dev/udmabuf, and without it (under bwrap with a minimal/dev, "open /dev/udmabuf: No such file or directory"). The diag run below shows it stops at "driver idle returned before recording the completed HTILE dispatch".agc_driver_native_depth_bda_clearskips itself in both setups ("skipped, the device does not retain guest write watching for native clear imports").What the
DriverDispatchcase does on lavapipe, from prints at the arm, the completion, the write marks and eachStoredAllSinceexit (local only):DriverDispatchcase itself, the fixture's first clear of the metadata arms with a nonzero generation, andStoredAllSincereturns true. So the range is watched just before the driver dispatch.ArmHtileDepthClearmatches the pending surface.CollectWritesUncachedover the 32 KiB metadata returns 0. SoclearGenerationstays 0 and the sampling is refused ("requires tracked HTILE generations"). That's your case 1.coversis false.CompleteHtileDepthClearskips the surface, becauseclearGenerationis 0.StoredAllSince_nid_no_patchreturns false at!tracker.covers(address, bytes).Why lavapipe:
GuestBufferMemory.cppcallsGuestMemory::ImportWatchedwithstaysWatchedfalse, and that unwatches the range.What to change: the refusal is the product's path for an untracked range, so it's the test case that assumes the range stays watched.
NativeDepthBdaClear.cppalready checks this after its warm-up dispatch, withMemory::Watchedon depth and metadata and the "does not retain guest write watching" skip. The same check in theDriverDispatchcase would have to go afterSubmitDriverHtileClearreturns, since the range is still watched before the dispatch imports it. I haven't tested that. #7371 carries the sameDriverDispatchcase, so this applies there too.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-20T17:23:50Z.
@Amoenus @MarcZX10 one more lavapipe run, since the 2e048f56ff Windows results don't fit the generation-zero path alone. Same build and setup as above.
With
APS5_WRITE_WATCH_IMPORTS=watch, so that imports stay watched, theDriverDispatchcase still fails 3 of 3, but at the other guard:UnchangedSinceCollectedfinds those pages newer than the clear's generation.CompleteHtileDepthClearthrows "CPU writes raced native multisample depth clear", logged as a deferred write-back failure, so the completed store is never recorded.StoredAllSince_nid_no_patchthen returns false at the driver-piececoverscheck, and the test fails with the same message.How that maps to the Windows logs: that race message is the one in Amoenus's 2e048f56ff logs. His 1c210cd21d logs have none. That fits the generation-zero path only if the HTILE range left the watch, and his probe line ("keep the write watch: yes", nothing after the GPU write) points the other way.
So on a device whose GPU writes to an imported range show up in the write watch, one of the two guards refuses this clear either way:
The case can pass only where the imported range stays watched and the GPU's writes don't mark it. That's the case on the RTX 3080 under Linux, whose probe reports "0 after a GPU write … imported ranges stay watched". By that probe, Windows is the same configuration, so it looks like a third case. What would separate it is the metadata range's own state right after
SubmitDriverHtileClear:Memory::Watchedon depth and metadata, asNativeDepthBdaClear.cppchecks.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T19:09:48Z.
Thanks for the two lavapipe traces. I pushed
8073c2e532on the rebased head (main434e965d46). TheDriverDispatchcase now checksUnchangedSinceCollectedafter the dispatch andWaitIdlerestores the fixture recorder. That detects both conditions in the reports: the import path no longer covers the metadata range, and a CPU-executed dispatch writes through the watch as though it were a CPU race. In either unsupported case the native-depth clear test reports a skip (77); when the device retains usable write-watch evidence, the existingStoredAllSince_nid_no_patchassertion still has to pass. This is test gating only; it does not weaken production clear validation.On this host,
python3 tools/check_conventions.py --base upstream/mainandgit diff --checkpass. I could not run the Vulkan test locally because no configured build is available and the filesystem has only 30 MiB free. Could you rerunagc_driver_native_depth_clearson the exact head, including lavapipe and a hardware GPU if available? The runtime result for this head is not yet verified.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T19:25:40Z.
Thanks for the update.
8073c2e532is test-only, and the rebase leaves the other 22 commits unchanged (range-diff against1c210cd21d).One request on the new skip. It fires when
UnchangedSinceCollectedreports a change after the dispatch, which is right for lavapipe, where device writes are CPU-thread stores that write-watch sees. But because it's keyed on the observed result, a later regression that makes the driver's own HTILE write look like a CPU write (or any stray CPU store into that range) would also turn this case into a skip on real GPUs, instead of failing at theStoredAllSincecheck.Could the skip be keyed on the device instead, for example
VK_PHYSICAL_DEVICE_TYPE_CPU? The fixture already readsdeviceTypewhen it picks the device, andBdaDevice.cppuses the same check. TheStoredAllSincerequirement would then stay unconditional on hardware GPUs. Since Linux CI runs on llvmpipe, a run of this case on a hardware GPU at the new head (showing it ran rather than skipped) would also help.Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-20T19:44:42Z.
@MarcZX10 @oneandonlydean completed the exact
8073c2e532hardware retest: DriverDispatch still skips on RTX 5080 and Radeon Graphics. Maintained results and the one-line CI skip-message proposal. The hardware-gating concern remains open; no lavapipe run claimed.AI-assisted: yes (Codex).
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-20T20:06:45Z.
@MarcZX10 @oneandonlydean results for 8073c2e532, the exact head on
main434e965d46.Setup: Linux 7.2.10, GCC 16.2.1, Release with
BUILD_TESTING=ON. I ran the test binaries directly, outside ctest, so without the ctest environment.lavapipe (Mesa 26.2.4, LLVM 23.1.1):
agc_driver_native_multisample_depth_tests --clearsskips (77) 3 of 3 with the new message, both with/dev/udmabufaccess and without it.agc_driver_native_depth_bda_clearskips 3 of 3 with its existing message.RTX 3080 (NVIDIA 615.78.08):
--clearsalso skips 3 of 3 with the new message, whileagc_driver_native_depth_bda_clearpasses 3 of 3.UnchangedSinceCollectedreturns false after the dispatch. That fits dean's point. I haven't separated a newer CPU stamp from lost coverage or a failed page walk. The probe covers scratch pages, not the HTILE range, and I didn't run this head with the skip removed.VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,--clearslogs noVUID-, and its subcase lines match the plain runs. It then aborts at shutdown (core dump after the host-import summary line), so its buffered skip or result line isn't in the log.Windows: the exact head also skips on Amoenus's RTX 5080 and Radeon, so no hardware GPU has run this case at this head yet. His control fa23b5820a (8073c2e532 without the skip) fails
DriverDispatch3 of 3 on both. So a skip keyed only onVK_PHYSICAL_DEVICE_TYPE_CPUwould turn those runs into the control's failures instead of skips.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-20T20:26:32Z.
I separated the skip cases on Linux at exact head
8073c2e532bca758fdd37c54c2626f6c9227f30a(Ubuntu 24.04, GCC 13.3 Release). Directagc_driver_native_multisample_depth_tests --clears, fresh processes, shader cache disabled,ANYPS5_REQUIRE_VULKAN=1:checked=27 unavailable=0Immediately after the dispatch and
UnchangedSinceCollectedcall, a temporary print gives:The diagnostic leaves
StoredAllSince, all clear-value/readback checks and the productionCompleteHtileDepthClearCPU-race guard intact. NVIDIA reaches and passes those checks, including DriverDispatch. Its current skip therefore hides a working clear; lost coverage is not the NVIDIA explanation. On RADV/lavapipe the metadata really leaves the watch, so a CPU-device-only gate would still expose a hardware RADV failure in this private host-pointer-import setup.I also tried collecting metadata writes immediately before the fixture's generation snapshot, retaining the new guard: NVIDIA still skips 3/3. That rules out fixing this merely by collecting pending writes before the call. I have not isolated the origin of the newer CPU-kind stamp; the successful completion guard uses the clear's later armed generation, while the fixture compares against its earlier pre-submit snapshot.
This is a diagnostic hardware pass, not a pass of the unmodified head. No production edits were made. All temporary fixture edits are removed; rebuilt stock head reproduces exit 77 again with a clean checkout. No Khronos validation layer is installed here, and no retail title was run.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T21:27:16Z.
Thanks for separating the diagnostic from the unmodified test result. This shows the current result-based gate skips the NVIDIA case even though bypassing only that gate reaches and passes the clear checks, while the same bypass fails on RADV/lavapipe in the reported host-import setup. I am treating that as a test-coverage gap to investigate; the diagnostic is not a pass of the current test or evidence of a RADV fix.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T21:34:10Z.
Rebased to current
mainat73b6a4cc71and pushed head374b3f9c97; the dispatch resolution preserves both mainline thread-group arguments and this PR’s HTILE completion argument. The test gate now skips only when both CPU-write stability and complete-store evidence are unavailable, so supported complete-store evidence should allow the NVIDIA clear case to run.Static diff and conventions checks pass. I have not run the AGC GPU regression locally on this head. @simonbbby, could you rerun
agc_driver_native_multisample_depth_tests --clearson374b3f9c97with the same NVIDIA/RADV/lavapipe setup and report the exact-head results?The overlap report also identifies open #8105 and #8126 touching intersecting dispatch/depth and direct-write completion lines. I have not folded either branch into this PR; merge order will need coordination.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T21:46:12Z.
@MarcZX10 thanks, the rebase looks right (the dispatch now carries both main's thread-group argument and the HTILE completion argument), and the new condition does let the NVIDIA clear case run.
One small test change is still needed. On RADV and lavapipe
storedAllis false, and that is exactly the failure the completed-HTILE assertion checks for, so!unchanged && !storedAllstill skips precisely when the assertion would fail. On a real GPU (RADV) that hides a reproducible failure as a skip. Could the skip key on the device instead, e.g. only forVK_PHYSICAL_DEVICE_TYPE_CPU(lavapipe)? If RADV's failure is a separate known gap, a named expected-fail tracked by an issue would also work; it just shouldn't turn into a skip on a GPU.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T21:48:09Z.
Thanks for the updated consumer-handoff report and for keeping the prerequisite Driver clear case separate from the passing matrix. I’ve recorded the 57 focused invocations and the documented Linux BDA write-watch skip. The report follows the
348a5345d3production commits; my current PR head also includes the later test-gate commit374b3f9c97, which only changes the regression-test gate.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T22:12:16Z.
Addressed the latest test-gate review request in
dc960cf765: the driver-dispatch evidence skip is now limited toVK_PHYSICAL_DEVICE_TYPE_CPU; on hardware GPU devices theStoredAllSinceassertion remains unconditional. I also rebased the branch onto currentmain(339217ebc9). Validation on this host:git diff --checkpassed,python3 tools/check_conventions.py --base upstream/mainpassed, and the changed test translation unit passed a C++20-fsyntax-onlycompile using the PR source and available dependency headers. I could not runagc_driver_native_multisample_depth_tests --clears: no compatible executable is present and only about 460 MiB is free. The build/test result for this head remains unverified locally.Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-20T22:23:31Z.
Exact-head runtime check of
dc960cf76594cf96ac07b804ddd3f310ecc47c9d, including the CPU-device-only gate and rebase onto339217ebc9. No local source changes.Ubuntu 24.04, GCC 13.3 Release, direct
agc_driver_native_multisample_depth_tests --clears,ANYPS5_REQUIRE_VULKAN=1, shader cache disabled, three fresh processes per ICD:Native depth completed clear cases checked=27 unavailable=0driver idle returned before recording the completed HTILE dispatchThe NVIDIA runs reach the final count after DriverDispatch and do not take the skip. On the previous
8073c2e532head all three ICDs skipped here, as in my earlier report. The new gate therefore restores stock NVIDIA coverage and exposes the RADV failure instead of hiding it as a hardware skip. RADV's failed assertion still needs resolution; this is not an all-GPU pass.No Khronos validation layer is installed here, and no retail title was run. Exact PR checkout remains clean.
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-20T22:25:01Z.
@MarcZX10 @oneandonlydean results for
dc960cf765, the exact head onmain339217ebc9. Linux 7.2.10, GCC 16.2.1, Release; I ran the test binaries directly, outside ctest, so without the ctest environment.RTX 3080 (NVIDIA 615.78.08):
agc_driver_native_multisample_depth_tests --clearspasses (exit 0) 3 of 3, without a skip. Each run prints two more case lines than the skipping runs on 8073c2e532, plus the summarychecked=27 unavailable=0, so theDriverDispatchcase runs and itsStoredAllSinceassertion holds.agc_driver_native_depth_bda_clearpasses 3 of 3.lavapipe (Mesa 26.2.4, LLVM 23.1.1):
--clearsskips (77) 3 of 3 with the same message as on 8073c2e532, both with/dev/udmabufaccess and without it.agc_driver_native_depth_bda_clearskips 3 of 3 with its existing message.Ryzen 9 7950X3D iGPU (gfx1036, RADV, Mesa 26.2.4):
--clearsfails (exit 1) 3 of 3 at "driver idle returned before recording the completed HTILE dispatch". That's what simonbbby saw on Mesa 25.2.8, so it holds on current Mesa too. Its probe reports "host imports resolve write protection: yes (4 of 4 scratch pages written after a GPU read, 4 after a GPU write, 4 after the import); imported ranges are compared".Validation layer: under
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationon the RTX,--clearslogs noVUID-. It aborts at shutdown (core dump after the host-import summary line), as on 8073c2e532, so its last buffered subcase lines aren't in the log. I haven't checked whethermaindoes the same.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T22:26:21Z.
Thanks for the exact-head cross-check. The CPU-only gate now runs the completed-clear case on both NVIDIA devices (3/3 each,
checked=27 unavailable=0), while RADV consistently reaches the assertion and fails 3/3 on Mesa 25.2.8 and 26.2.4; lavapipe takes the CPU evidence skip. This confirms the gate behavior and exposes a separate RADV HTILE completion/evidence failure, but it does not show that production path is fixed on RADV. I am keeping that distinction explicit and will not label the full GPU matrix as passing.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T22:37:07Z.
Thanks both for the exact-head runs. The independent NVIDIA results confirm the gate now reaches the DriverDispatch case (
checked=27, no skip), while RADV fails the same completed-HTILE assertion on Mesa 25.2.8 and 26.2.4; lavapipe remains an evidence skip. I will keep that RADV failure explicit and won’t characterize this as a cross-GPU pass. The validation run on NVIDIA had no VUIDs before its shutdown abort; do you have a matchingmainresult for that abort?Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T22:46:49Z.
I traced the current exact-head path:
Driver::WaitIdle()waits for accepted submissions;VulkanDevice::WaitIdle()callsRecorder::Sync()beforevkDeviceWaitIdle; and the recognized HTILE completion callback callsCompleteHtileDepthClear(), which validates no CPU race and thenMarkWritten()over the metadata range. So a falseStoredAllSinceon RADV means full-range completion evidence is absent or not recognized, but the present assertion does not identify where it drops. Could you capture, on the failing RADV run, whetherHtileDepthClearAddressmatches,NoteHtileDepthClearreturns a completion candidate, the recorded dispatch carrieshtileClear,ArmHtileDepthClearcollects a nonzero generation, and the completion callback callsMarkWrittenwith a nonzero result? Those checkpoints should distinguish recognition/arming from completion/evidence without weakening the GPU assertion. I have not changed production code or run a local GPU build.Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-20T23:02:34Z.
@MarcZX10 on the shutdown abort under the validation layer:
maindoesn't show it. It comes from the newDriverDispatchcase, and it isn't a VUID. Linux, RTX 4070 Ti (NVIDIA 595.99.02), GCC 13.3, Release, Khronos validation layer 1.4.363 (LunarG SDK),ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1:--clearsonmain339217ebc9checked=24, no VUID (ctest)dc960cf765checked=27checked=27, no VUIDchecked=27Backtrace of the abort:
SubmitDriverHtileClearstarts the global driver throughsceAgcDriverSubmitDcb, and the test never shuts it down. So the driver's static destructor runs at exit and callsvkDeviceWaitIdleafter the layer has dropped its device record, and the layer aborts. Thechecked=27line is lost because stdout is still buffered when the abort comes. Without the layer, NVIDIA's driver accepts the late call, which is why the plain runs pass.Other tests that submit through the driver end with
AgcDriverShutdown_nid_postfix(), for exampleAddressPasses.cpp. Doing the same after theDriverDispatchcase fixes it here:I didn't try it without the
unlock. Thereturn VulkanTestSkippedjust above also leaves the driver running, so lavapipe under the layer probably needs the same call on that path. I only ran NVIDIA.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T23:14:41Z.
Pushed
acaff99f44with a local shutdown guard around the DriverDispatch path. It shuts the singleton driver down when that case exits normally, takes the CPU-device evidence skip, or throws at the GPU assertion, so the validation layer does not see the driver static destructor call after its device record is gone. The guard runs afterSubmitDriverHtileClearhas returned fromWaitIdle; it does not unlock the fixture mutex again.git diff --checkandpython3 tools/check_conventions.py --base upstream/mainpass. I could not run the runtime test locally because this host has about 393 MiB free; hosted checks are pending.Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-20T23:23:17Z.
@MarcZX10 your checkpoints on the failing RADV runs, on the Ryzen 9 7950X3D iGPU (gfx1036, RADV, Mesa 26.2.4), with the RTX 3080 for comparison.
Build:
dc960cf765plus local prints.acaff99f44since adds only the five-line shutdown guard in the test, nothing on this path. Our prints are local. Both RADV runs show the same sequence for theDriverDispatchclear:HtileDepthClearAddressmatches the metadataNoteHtileDepthClearreturns a completion candidatehtileClearArmHtileDepthClearfinds the pending surfaceArmHtileDepthClear'sCollectWritesUncachedgenerationcoversfalseCompleteHtileDepthClearclearGeneration0)MarkWrittenreturns a nonzero generationStoredAllSince_nid_no_patch!tracker.coversSo on RADV recognition works and the arm finds the surface, but its collect returns 0: the metadata range is no longer covered when the clear arms, so it never gets a generation. All 79 earlier arms on the same metadata, before the driver dispatch, get nonzero generations on RADV too.
That fits RADV's host-import probe here: "host imports resolve write protection: yes (4 of 4 scratch pages written after a GPU read, 4 after a GPU write, 4 after the import); imported ranges are compared". With that result the host-pointer import path calls
ImportWatchedwithstaysWatchedfalse, so the import made for the driver dispatch takes the range out of the watch, as on lavapipe. RADV's dma-buf probe reports that dma-buf imports stay watched, but the fixture's private memory goes through the host-pointer path. Nothing prints at the import itself, so this step comes from the code path, not from a print.On the shutdown abort, milescoviello's comparison with
mainabove answers it, so I've dropped our queuedmainrun.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-20T23:25:53Z.
@MarcZX10
acaff99f44on the same host (RTX 4070 Ti, NVIDIA 595.99.02, Linux, GCC 13.3, Release, Khronos validation layer 1.4.363):--clearsunder the layer: passes 3 of 3,checked=27 unavailable=0, no VUID, no shutdown abort.--clearswithout it: passes 3 of 3,checked=27.ctest -R '^agc_driver_native_depth_(clears|bda_clear|clear_refusals|retirement)$'under the layer: 4 of 4 pass.So the guard works without unlocking the fixture mutex. Not run: RADV, lavapipe, Windows.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T23:27:35Z.
Thanks for the checkpoint report. It identifies the failure precisely: RADV recognizes and arms the clear, but its host-pointer import leaves this metadata range outside write-watch coverage, so the generation is zero before dispatch. The same range remains covered on NVIDIA.
I pushed
bfb76ebda5to the PR. The regression now checksGuestMemory::Watchedfor the actual metadata range and only skips the write-coverage assertion when that range is not tracked. In that case it continues through the test's clear-output checks, so the RADV path still exercises the dispatch and validates its result. The gate no longer infers tracking support from CPU versus GPU device type.git diff --checkand the conventions checker pass. I could not run the GPU test locally in this disk-constrained environment; please rerun the exact head on RADV and NVIDIA to confirm the RADV case reaches the output checks and the NVIDIA tracking assertion still passes.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T23:32:29Z.
@MarcZX10 Thanks,
bfb76ebda5is close to what we asked: the skip now keys on the write-watch coverage of the actual metadata range, says why, and the rest of the case (the completed-clear view checks, publication and refusals) still runs.One small change, so NVIDIA doesn't lose the assertion: today, if a later change dropped the HTILE range's coverage on a device whose host imports stay watched, this case would print the skip line and pass, where
acaff99f44failed. Could the skip branch also require that the device actually unwatches imports? Something like:(
PrepareImportWatchis cached per device, and BdaResources.cpp / Graphics.cpp already call it from tests.)Also, since the post-skip checks never ran on RADV or lavapipe before (RADV stopped at the storedAll assertion, lavapipe skipped the case), one RADV
--clearsrun on the new head would confirm they hold there. Linux CI covers lavapipe.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T23:35:49Z.
Added the requested policy guard in
e87e649a49: the write-coverage assertion is skipped only when the metadata range is unwatched andPrepareImportWatch(context)confirms this device's host imports useImportWatch::Unwatch. If the range becomes unwatched on a device that promises watched imports, the test now fails, preserving the NVIDIA-side assertion.git diff --checkand the conventions checker pass. I cannot run the GPU test locally in this container (the test binary is absent and only ~370 MiB of disk is free); Linux CI covers lavapipe. Could someone with RADV runagc_driver_native_multisample_depth_tests --clearson this exact head to confirm the post-skip output checks pass there?Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-20T23:44:33Z.
@MarcZX10 the NVIDIA side of
e87e649a49(RTX 4070 Ti, NVIDIA 595.99.02, Linux, GCC 13.3, Release):--clears: passes 3 of 3 without the validation layer and 3 of 3 with it (Khronos 1.4.363),checked=27 unavailable=0, no VUID.ctest -R '^agc_driver_native_depth_(clears|bda_clear|clear_refusals|retirement)$': 4 of 4 pass with the layer and 4 of 4 without.I have no RADV device here.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T23:45:29Z.
Thanks for the exact-head matrix. The six NVIDIA runs confirm the import-policy gate keeps
StoredAllSinceenabled on NVIDIA, withchecked=27, no skip, and no validation-layer VUID; the four related CTest cases also pass with and without the layer. This verifies the NVIDIA side of the guard. RADV still needs the requested exact-head output-check run; I will keep that result separate.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T23:55:36Z.
Cross-reference for the RADV/lavapipe side: issue #8759 reports that the generic host-pointer import path passes
staysWatched=falsewhen this device policy is selected. That un-watches HTILE, soCollectWritesUncachedyields generation 0 and the native clear completion path does not engage on those devices; it remains fail-safe and falls back to the import-window comparison path.This is separate from #7233's exact-store coverage change, and I am not treating it as a blocker to that narrower fix. Please make the device scope clear in the PR summary: NVIDIA confirms the tracked path, while RADV/lavapipe need the separate import-watch/HTILE completion work from #8759 before the native path is validated there.
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-20T23:57:30Z.
@MarcZX10 @oneandonlydean results for
e87e649a49, the exact head. Linux 7.2.10, GCC 16.2.1, Release; test binaries run directly, outside ctest.RTX 3080 (NVIDIA 615.78.08):
agc_driver_native_multisample_depth_tests --clearspasses 3 of 3 (checked=27 unavailable=0).VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationit passes too, with noVUID-and no shutdown abort, so the shutdown guard works here.agc_driver_native_depth_bda_clearpasses 3 of 3.lavapipe (Mesa 26.2.4, with and without
/dev/udmabuf) and RADV (gfx1036, Mesa 26.2.4):--clearsfails 3 of 3 at the new guard, "the HTILE metadata range lost write-watch coverage on a device whose host imports stay watched".Why the guard reads "watched" there, from a print at
PrepareImportWatch's entry and exit (local only):VulkanDevicedecides at creation (VulkanDevice.cpp:1988) withhostImportAlignment4096 and getsunwatchImports1.Deviceclass creates it with a plainvkCreateDevice, so itshostImportAlignmentis 0 and it can't host-import at all.decideImportWatchre-decides for that device, setsunwatchImportsto false and returns at thehostImportAlignment == 0check. So the guard getsWatch.So the guard needs the decision for the device that imported the metadata. That's the driver's: the fixture's device can't host-import. On Windows the same call returns
Unwatcheither way, so the guard can't fail there.This is separate from #8759, which is about the import policy itself. Here the test's guard misreads the policy that the driver already applied.
agc_driver_native_depth_bda_clearstill skips 3 of 3 on lavapipe with its existing message.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T00:07:00Z.
Thanks for the exact-head RTX 3080 run. This adds an independent NVIDIA result for the clear path: 3/3 runs with and without validation,
checked=27,unavailable=0, and no shutdown VUIDs. It does not change the platform gap from my prior note: the output-check path still needs a RADV/lavapipe run, where the import watcher behavior from #8759 changes the evidence available to this optimization.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T00:07:03Z.
@MarcZX10 @SleglJan thanks, SleglJan, your trace is right, and the mistake is in the guard I asked for.
decideImportWatchkeeps one decision for one device (GuestBufferMemory.cpp:1203). The guard inCheckDepthTargetpasses the fixture's ownvkCreateDevicecontext, which has nohostImportAlignment. So on Linux it re-decidesWatchfor a device that can't host-import, and it also replaces the driver's decision. Windows setsUnwatchbefore that check, which is why only RADV and lavapipe fail.Could you make the guard ask for the decision of the device that imported the metadata, i.e. the driver's
VulkanDevice::graphicsContext()? Pass it intoCheckDepthTargetfor the driver-dispatch case, and don't callPrepareImportWatchwith the fixture's context there. On RADV and lavapipe the run should then print the "skipped native HTILE write-coverage assertion" line and pass, while NVIDIA keeps theStoredAllSincecheck. Please also add your device-scope sentence to the summary: NVIDIA confirms the tracked path, and RADV/lavapipe depend on #8759. An exact-head--clearsrun on RADV or lavapipe after the change would close this.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T00:25:30Z.
Follow-up pushed as
077e2d43d523ec7433a01edfcb794e5f72ba73c2. The driver-dispatch--clearscase now captures the active driver device context and passes it intoCheckDepthTarget; the guard no longer re-evaluates import policy with the fixture device. That should preserve the driver’swatchDevicedecision, skip only the uncovered tracker assertion on RADV/lavapipe, and keepStoredAllSinceon NVIDIA. I could not rebuild/run the focused binary in this environment (no configured build for this worktree and only 378 MiB free on the filesystem), so the requested exact-head RADV/lavapipe run remains outstanding. The PR summary should also state the platform scope: NVIDIA confirms the tracked path; RADV/lavapipe depend on #8759.Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-21T00:27:07Z.
The new head
077e2d43d523ec7433a01edfcb794e5f72ba73c2does not build with GCC 13.3:The new
Driver::Get().device.Load()needs test access rather than direct private-member access.There is also a downstream runtime blocker after correcting the context access. Before that push, I independently tested the requested driver-device context correction against
e87e649a4904bb557922b1d37b5578ca753058feusing test-access helpers; the compiling patch and results follow. It fixes the policy guard, but RADV/lavapipe still do not pass the output-check path.Ubuntu 24.04, GCC 13.3 Release,
--clears,ANYPS5_REQUIRE_VULKAN=1, shader cache disabled:checked=27 unavailable=0, no assertion skipThe correction gets the driver's live
VulkanDeviceafterSubmitDriverHtileClear, returns itsgraphicsContext()to the caller and uses it forPrepareImportWatch; the fixture device no longer replaces the importer's decision. The tested patch is below (test access follows the existing VulkanDeviceTestAccess pattern).The new failure is:
The stdout/stderr lines can appear reversed because stdout is buffered. The causal path in the source is
ArmHtileDepthClear-> generation 0 on the unwatched metadata ->sampling.Refuse(...); after the assertion is skipped,DepthSurfaceHoldscallsCheckCurrent, which requires that refusal to be empty. Thus correcting the policy context alone cannot leave these output checks running successfully with #8759 unresolved. This is a partial fixture correction, not a fix for the production tracking gap.All existing completion/value checks were retained. Restoring the original files and rebuilding reproduces the original RADV policy-guard failure. Checkout is clean. No Khronos validation layer is installed here; no retail title was run.
Tested driver-context correction
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T00:33:34Z.
Thanks for the compile finding and exact-head matrix. I have not pushed another revision yet. I confirmed the RADV/lavapipe run exposes a second, expected production limitation after the guard: generation zero is rejected by
DepthSurface::ArmHtileDepthClear, and subsequentCheckCurrentrefuses sampling. I am revising the test to use the existing test-access friend pattern for the private driver device and to assert the safe refusal on uncovered HTILE imports, instead of claiming output checks pass there. That will keep the NVIDIA complete-store assertion and make the RADV/lavapipe behavior explicit. The import/HTILE tracking implementation remains #8759; I will not fold that wider behavior into this focused test/coverage PR.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T00:33:49Z.
Follow-up pushed as
eb55d58728f367f527253b3ae5b30ed45030fdf3. This uses the establishedDriverTestAccessfriend helper so the driver device is accessed legally, returns that device context fromSubmitDriverHtileClear, and queries import policy on that context. If the metadata is uncovered, the regression now asserts the observed production refusal (native multisample depth clear requires tracked HTILE generations) and exits that fixture case; it no longer claims output checks pass on RADV/lavapipe. The NVIDIA path still requires complete tracked-store evidence and continues through its existing output checks. The production import-watch support remains separate in #8759. I have not locally compiled or run this revision due the 378 MiB free disk constraint; hosted checks are starting.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T00:34:29Z.
Correction to the existing PR summary: its older tested section predates the RADV/lavapipe finding and should not be read as claiming that this new head passes those output checks. At exact head
077e2d43d523ec7433a01edfcb794e5f72ba73c2, simonbbby reports the intended write-coverage skip followed by the fail-safe production refusalnative multisample depth clear requires tracked HTILE generationson RADV and lavapipe; RTX 3090 completed 3/3 on that test correction. Commiteb55d58728f367f527253b3ae5b30ed45030fdf3now expects this refusal on uncovered HTILE ranges and uses theDriverTestAccessfriend helper, while keeping the NVIDIA complete-store check. The current PR body edit did not apply, so this comment is the authoritative scope note for the new head. Local build remains unavailable due to disk capacity; hosted compile/runtime jobs are path-skipped.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T00:41:38Z.
@MarcZX10 Thanks, the guard change does what we asked, and the uncovered-HTILE case now checks the fail-safe refusal. One small thing: the device-scope sentence didn't land in the PR description (the edit seems not to have applied). Could you add it there: NVIDIA confirms the tracked path, and RADV/lavapipe depend on #8759? Full CI is running on
eb55d58728now.Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-21T00:51:01Z.
@MarcZX10
eb55d58728builds and runs here (RTX 4070 Ti, NVIDIA 595.99.02, Linux, GCC 13.3, Release), so theDriverTestAccesschange compiles with GCC 13.3:--clears: passes 3 of 3 without the validation layer and 3 of 3 with it (Khronos 1.4.363),checked=27 unavailable=0, no VUID.ctest -R '^agc_driver_native_depth_(clears|bda_clear|clear_refusals|retirement)$': 4 of 4 pass with the layer and 4 of 4 without.No RADV here.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-21T00:52:17Z.
@MarcZX10 @oneandonlydean
eb55d58728, the exact head, builds here (GCC 16.2.1, Release) and passesagc_driver_native_multisample_depth_tests --clearson all three devices. Linux 7.2.10; test binaries run directly, outside ctest.--clears, 3 runs eachchecked=27 unavailable=0checked=27 unavailable=0/dev/udmabufchecked=19 unavailable=8On RADV and lavapipe the skip line is followed by the check this head adds, and it holds: sampling is refused with "native multisample depth clear requires tracked HTILE generations". The test prints nothing for that check, but a missing or different refusal would exit 1 before the summary line. The RTX takes the tracked-store branch.
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationon the RTX it passes with noVUID-.agc_driver_native_depth_bda_clear_testspasses 3 of 3 on the RTX and skips 3 of 3 on lavapipe with its existing message.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T00:55:57Z.
Updated the
Testedsection and GPU checklist to describe the exact-head reports and device scope. NVIDIA RTX 4070 Ti/RTX 3080 reports cover the tracked-clear path; RADV/lavapipe report the uncovered-HTILE fail-safe refusal, and full write-watch coverage on those drivers remains tied to #8759. Thanks for the exact-head runs and for flagging the missing scope sentence.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T03:26:06Z.
Thanks for the current consumer-handoff report. The fact that #7371 follows the rebased #7233 head directly, with its handoff commits unchanged and the focused Windows/Linux matrix passing, is useful integration evidence. I’ll keep the separate fixture-lock issue and its validation scoped to the reports already recorded here.
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T13:22:43Z.
@MarcZX10 @Amoenus, coordinating an upcoming follow-up to #6300 before opening it. The #6300 author confirmed that initial uncompressed stencil import and depth-only HTILE fills preserving raster-written stencil are separate from their planned work: https://github.com/boykopovar/AnyPS5/pull/6300#issuecomment-6316567312.
My follow-up accepts a separate uncompressed stencil plane only when every byte of its complete watched range equals
DB_STENCIL_CLEAR; depth-only HTILE fills then clear depth alone. Unknown or intervening writes still refuse sampling. It does not implement the possible/exact write accounting,ArmHtileDepthClear/completion lifecycle in #7233, or the queued-clear settling in #7371.The overlap tool reports shared
DepthSurface.cppandNativeMultisampleDepth.cpphunks with both PRs. I propose giving #7233 and #7371 precedence for those clear-lifecycle changes and adapting the stencil follow-up to preserve their pending/queued completion guards. Does that ordering fit your plans, or is there a specific dependency you would prefer? I will disclose these overlaps in the new PR rather than imply the changes merge independently.The earlier stencil stack passed focused paired RADV tests with required Vulkan and per-test Khronos validation; a fresh pair against current main is running. No Windows/BDA result, title unblock, or performance gain is claimed.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-21T21:47:38Z.
@JJenkx That ordering fits our side: #7233 first, then #7371, then the separate stencil follow-up adapted to both. Please retain the queued-clear completion guards and consumer-side settling in #7371; initial stencil import should not turn an armed or pending HTILE clear into completed sampling state. No additional dependency is requested on our side.
For the current-main adaptation, #9026 has also landed with range-limited depth-plane stores; please retain that writeback behavior while checking depth-only clears preserve stencil. #7371 currently merges cleanly with main
a6dcea9279; that is a source/merge check, not a fresh runtime result for the stencil composition. Our existing validation pins and the uncovered-HTILE limitation remain as recorded.Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-22T02:03:38Z.
@MarcZX10 a merge-order note for this one as its author: #9533 changes
NoteHtileDepthClearinDepthSurface.cppand the native multisample depth tests next to this PR, for native multisample D32S8 targets with a separate stencil plane. This one goes first: #9533 lists it under Depends on and rebases on it.