fix(agc): collect fresh CPU writes before a retiring depth surface stores its stale units #16368
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16368"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-11-06T12:25:23Z.
What
A depth surface retired for an unmatched view (
retireStoringStale) decides which stale units to store fromWrittenUnits, whose collect of the plane is memoized. A guest write that lands after the thread's earlier walk of the plane in the same collect epoch is not stamped, the unit reads as unwritten, and the store goes over the write. #11690 fixed this decision in the flush path, whereFlushDepthPlanescollects uncached first. This is the same write at the retire path.test(agc): a mode of theagc_driver_depth_plane_partial_store_testsexecutable, registered asagc_driver_depth_plane_cpu_write_after_memo_retire. A depth draw covers the plane and the guest fills one unit, so the plane reads as overwritten in memory; the collect epoch moves and the plane is collected; the guest then writes descriptors into another unit; a view with two levels, which the surface does not serve, retires it. On main it fails withAGC graphics: the retire of a depth surface overwrote CPU descriptors written after a memoized collect. Without a write watch it skips like the flush-path step (agc_driver_depth_plane_cpu_write_after_memo).fix(agc): one uncached collect of the plane beforeWrittenUnitsinretireStoringStale, the call #11690 added to the flush path.Cost: one walk of the plane per retire of this kind.
Related: #14969 (open) covers the stale stencil plane of the same retire; it changes other lines. #15058 changes
WrittenUnitsitself, for shared memory; this PR adds a call in front of it. #15404 and #9895 add callers ofretireStoringStale. #15059 changes the line two above the inserted one. #16011 adds a mode and its registration at the same place in the same test file and fragment; #15015 changes the same test file and adds a line to the fragment. I am happy to rebase behind any of them.Tested
Head
4a5b07ede6is this PR's two commits on upstream/main75a1ced878.ctest -V -R '^agc_driver_depth_plane_cpu_write_after_memo'withVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1, on an AMD Radeon RX 9070 XT (RADV GFX1201, Mesa 26.2.4) and on lavapipe (llvmpipe, LLVM 23.1.1, Mesa 26.2.4). The pattern matches the new step and the flush-path step of #11690.main+ the test commit: on both driversagc_driver_depth_plane_cpu_write_after_memo_retirefails with the line above, and it is a failure, not a skip;agc_driver_depth_plane_cpu_write_after_memopasses. NoVUID-.VUID-.VK_LAYER_KHRONOS_validationinserted; no log reportswas not found but was requested by env var VK_INSTANCE_LAYERS.ctest -R '^agc'on the RX 9070 XT, without the validation layer: 2 of 1342 fail with the test commit, 1 of 1342 with the fix. The new step is the only difference in the failed list.agc_driver_tessellationfails (segmentation fault) on both sides, and the same 23 tests skip on both.python3 tools/check_conventions.py --base upstream/main: passes.No title effect is claimed.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code