fix(agc): preserve resident multisample baselines before unwatch #16483
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16483"
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 cookie42073-cmd on 2026-11-06T20:29:24Z.
What
Preserve an already resident multisampled DCC target when a host import removes write watching from its guest memory. Previously, later reuse could refuse unchanged data because the original watch proof was gone.
The shared unwatch callback now saves a complete baseline for each affected tracked range only when its write generation, mapping, metadata and pending-write checks still prove it current. Owner tracking, an import preflight and a publication hold coordinate target registration with concurrent imports while preserving GPU/import lock order. Failed proof and changed data retain their refusal paths. Two focused fixtures cover preservation/refusal cases and publication/import ordering.
This addresses the resident-MSAA DCC portion of #12522; it does not close that multi-failure issue. Same-value CPU stores after watch removal remain unobservable by byte comparison alone. The original contribution
0635d91d793758ee6705fe33a996acfe92191b96and Blazing Cook's authorship are retained in history.Tested
Native AGC execution fixtures on the same Windows 11 Pro machine, OS 10.0.26300, GCC 15.2 Release. Tests ran serially on each GPU listed below.
6fd097073810784f8e3455d36320542cd59252bf.d0aced879ffb5a0ba1922b819de013cb4d46c2de.Both new tests,
agc_driver_msaa_dcc_unwatchandagc_driver_msaa_dcc_publish_gate, pass on both GPUs in both candidate runs. Intelagc_driver_msaa_dcc_clear_2changes from the watched-memory reuse refusal to PASS. Every other common passing case remains passing.Intel
agc_driver_native_depth_publicationstill fails withnative D32S8 publication lost live samples, HTILE, padding or guest writes, identically on main and both candidate runs. Intelagc_import_settle_initial_dccstill skips because no second settle queue is available; the skip is not counted as a pass. These separate outcomes are unchanged by this patch.Runs used
ctest -V,ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. Verbose logs confirm the selected GPU and actual Khronos layer insertion for every invocation; the new cases and controls also enableAPS5_ASSERT_GPU_LOCK=1. There are no VUID/SYNC diagnostics or new validation errors/warnings. Three pre-existing loader errors for missing third-party implicit-layer manifests remain identical; validation still loads. The logs are not error-free.Three single-mechanism mutations were separately built and exercised on both GPUs:
All six controls fail for their intended mechanism, without skip, timeout, device loss or validation diagnostic. Both source files were restored byte-for-byte, all four targets rebuilt, and the complete 19-case selection repeated on both GPUs. Independent review audited all 116 test invocations and all 47 original evidence files.
Tracked AnyPS5 source is clean for the unmutated runs. The checkout retains an identical QuickJS submodule dirty marker from 153 missing JavaScript fixtures in nested test262, with its commit pin unchanged. QuickJS/NKWebKit/test262 are not inputs to these four AGC targets; this is not a globally clean recursive-checkout claim.
The candidate cleanly merges with newer main
9e432fbfa47ea68a70cfc10c507d9b252684a891in a source-only preview. No AGC production file changed between tested main and that preview base. The combined newer tree was not runtime-tested. The pre-push conventions check passed without warnings. No title, native-console, Linux/macOS, AMD, performance or full-suite result is claimed.Overlap review: the official scan against main
578dd09c42edb71eb17e9ad7b6fa7fea7978e7ffexamined 1,901 open PRs and 164 relevant merge comparisons. It exited 2, reporting five confirmed conflicts and 62 unresolved shared-file comparisons. All 67 have explicit pinned manual dispositions in the evidence; no duplicate implementation or prerequisite for this standalone change was found. The official result remains exit 2.Existing author coordination supports a separate main-based fix. For future combinations, preserve DCC owner/refusal tracking alongside the plain-color publication stack (#6987/#6989/#6995/#7002). #13963 ordering is storage-result flush, then
DccPublication, thenTargetsLock. #10233's two-sample native FMASK expansion must extend both the publication span and owner-bearing guard; #6808's older blanket retirement must not replace current DCC lifetime/refusal rules. These are future integration requirements, not dependencies or tested combinations.Logs, receipts, manifests and independent reviews. The public manifest maps normalized/redacted evidence to original hashes; receipt log hashes refer to the originals.
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)Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-08T17:09:50Z.
Review: COMMENTED
Ran
d0aced879fmerged onmain302864d48con Windows 11 x64 (WinLibs GCC 15.2), on an NVIDIA laptop GPU (Turing, driver 621) and an Intel iGPU (driver 101.70xx), withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(Khronos validation layer 1.4.368),ctest -R 'alpha_to_coverage|agc_driver_msaa_dcc' -V.main(17 tests)Texture.cpphook calls (19)MultisampleDccUnwatchLocksGpufromUnwatchHookLocksGpuandSaveMultisampleDccBeforeUnwatchfromSaveBeforeUnwatch. On both GPUs, the newmsaa_dcc_unwatchandmsaa_dcc_publish_gatefail, and so domsaa_dcc_clear_2/4/8with "multisampled DCC target reuse requires watched guest memory". With the calls back in, all of them pass every time.main,agc_driver_msaa_dcc_clear_2failed once on the Intel iGPU with the same "requires watched guest memory" message (color range, 2 samples). The change passed it in both Intel runs. I ranmainonly once, so I can't say how often it fails there.msaa_dcc_compared_import_2/4/8skip on both GPUs in every build, so this run doesn't cover them.was not found but was requested by env var VK_INSTANCE_LAYERS, and no log on either side has aVUID-. To be sure validation messages reach these logs, the same layer with best practices on printed 28BestPractices-warnings into anagc_driver_recorderlog on each GPU.AI-assisted: yes.