fix(agc): compare a multisampled DCC copy's bytes when only its stamp moved #22950
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22950"
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 Lyrnc on 2026-11-18T14:23:55Z.
What
MultisampleTarget::copyCurrentrejected a compared DCC, CMASK or FMASK copy as soon as the newest write stamp of its range differed from the stamp taken with the copy, without looking at the bytes. On Windows a host import refresh restamps every page of the import. Inagc_driver_msaa_dcc_unwatchmode 7 (8 samples, CMASK fast clear, FMASK), unwatching the FMASK makes the imports stale. The second resolve'sCachedStorageSurfacefor the destination then refreshes them, and that moves the stamp of the neighbouring DCC metadata page from 288 to 322 while its bytes stay0xc0.checkDccCurrentthen refuses the resident target withwrites to a resident multisampled DCC target or its metadata are not implemented (DCC range ..., 8 samples).When the stamp changes,
GuestMemory::OnlyRewatchedSincemust attribute the change to restoring the write watch before the code compares the saved bytes. The copy takes the new stamp only if the bytes match. A driver store still invalidates the compared copy when it writes the same value.agc_driver_msaa_dcc_unwatchtests unchanged data after the refresh, changed metadata, and a same-value driver store.The Windows failure was observed on the RTX 5080 here, the RTX 4060 in #22930, and the RTX 2060 in #22931. Linux also uses compared imports. The update preserves its behavior when a driver store moves the stamp.
Tested
Current head
3840cf5c95maind89f26516cmerged locally. The RTX 5080 (610.88) and Radeon iGPU (32.0.21042.62) each passed 66 tests in the graphics and DCC batch, including the same-value store regression. The three Linux-only tests skipped. Khronos validation 1.4.363 reported zero VUIDs and the same three alpha-to-coverage warnings seen on the baseline. Focused verification and regression detailsEarlier Windows runs
Windows 11 Pro 10.0.26200, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON, rebased onmainat the time of the PR.ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1. These earlier runs did not load the Khronos validation layer.agc_driver_msaa_dcc_unwatch:mainfails every run on the RTX 5080. This branch passes 5 of 5 on the RTX 5080 and 5 of 5 on the AMD iGPU.agc_driver_msaa_dcc*andagc_driver_alpha_to_coverage*(15 tests): all pass on both GPUs.-j 8): two failures, both also failing onmainand tracked elsewhere:performance_bisect(symlink privilege, #22162) andagc_driver_stencil_plane_memory(#22427).NewestStamparound each step of the second resolve. That logging is not part of this PR.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
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-18T23:44:24Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the inspected logic and added regression case support the described moved-stamp behavior.
What I ran
Reviewed head
ddf6fe1346a2cbf7b5742ba0269e400cfb30aa46from the prepared diff. I did not run tests; the hardware results in the description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No programmatic checks were run. I did not verify the reported Windows/NVIDIA or AMD runs, the full test suite, or excluded files; the manifest lists both changed files as included, and the prepared folder listing showed no excluded changed files.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by thalesdot1dot1 on 2026-11-19T02:35:53Z.
Review: COMMENTED
Reviewed
3840cf5c95. I checked the rewatch decision with an isolated Windows probe using the project'sGuestMemoryfunctions. The probe covers the stamp and byte checks incopyCurrent. AI-assisted with Codex.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T07:07:06Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed change at head
3840cf5c9543c22401bc087452f2c2be236a71a1appears correct from the inspected code, but I could not run the reported tests in this review environment.What I ran
Inspected the prepared diff and targeted source using
repo_read.py’s reader interface. No tests or build commands were run.Results
Negative control
Not run. The changed test adds a same-value driver store case, but I did not execute it.
Findings
Blocking
None identified in the inspected code.
Non-blocking
Test results in the PR description are author-reported and were not independently confirmed here.
Sources
MultisampleTarget.cppat reviewed headAlphaToCoverage.cppat reviewed headNot verified
Tests, builds, and GPU behavior were not run. Read the description, commits, manifest, diff, the changed lines around
copyCurrentandDccUnwatchTests, and targetedGuestMemory.cppimplementations forOnlyRewatchedSince,EqualsCommittedUnsynced, andStoreOwnBytes. The manifest lists two included changed files and no excluded files;files.jsonwas unavailable in the review folder.To get this to a good state
Nothing is required. Optional: run the focused regression tests on the reviewed head to independently confirm the reported results.
Imported from boykopovar/AnyPS5. Originally posted by einfachama on 2026-11-20T16:36:57Z.
Review: APPROVED
Tested head
fb5c1fbfb9(includesretain unwatched driver stores across a rewatch) on Windows/NVIDIA: it fixesagc_driver_msaa_dcc_unwatchon an RTX 4060 with driver 621.24, and the selected tests show no new failures.System: Windows 11 Pro 26H2 (10.0.26300), AMD Ryzen 7 5800X, NVIDIA GeForce RTX 4060 (
10de:2882, desktop), driver 621.24 (Vulkan 1.4.357), MSYS2 UCRT64 GCC 16.2.0-7, Release,BUILD_TESTING=ON. Khronos validation layer 1.4.363.Trees:
main7fa48cd1c6, and the samemainwith this PR's headfb5c1fbfb9merged (git merge --no-ff, clean merge). The PR's based62bf7cafeis 1720 commits behindmain, so I tested the merge instead of the base.main7fa48cd1c6main+fb5c1fbfb9agc_driver_msaa_dcc_unwatch, run alone 10 times,--timeout 120DCC unwatch did not preserve unchanged data or refused a real write incorrectlyagc_driver_(msaa_dcc|alpha_to_coverage)(15 tests) withVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layer,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1,ctest -Vagc_driver_msaa_dcc_unwatch), 3 skipInsert instance layer "VK_LAYER_KHRONOS_validation"was not found but was requested by env var VK_INSTANCE_LAYERSVUID-linesUndefined-Value-ShaderOutputNotConsumed-DynamicRenderingwarnings inagc_driver_alpha_to_coverageThe 3 skips on both sides are
agc_driver_msaa_dcc_compared_import_2/_4/_8(Linux comparison mode only).Selected tests (
tools/select_tests.pyfromupstream/main...HEAD,ctest --timeout 120 -j16) on the merged tree: 3336 of 6508 selected; 3313 passed, 21 skipped, 2 failed.agc_driver_stencil_plane_memoryandagc_storage_write_back_host_retile, also fail onmainon this machine (#22427, #23708).mainhere (Linux-only dma-buf/udmabuf paths, features this device lacks, display, environment).agc_driver_store_over_untrackedpassed in this run. It fails intermittently onmainhere (5 of 10 alone), so one pass says nothing about this PR.I compared the selected run with a full
mainrun on this machine at0a025bd3c6instead of rerunning the selected set onmain.Note: the description's Tested section still names head
3840cf5c95. The results above are forfb5c1fbfb9.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T01:24:49Z.
Review: APPROVED
Reviewed — looks good
The reviewed head is
fb5c1fbfb9eb60b497ed048551dd19c960587a63; the inspected implementation and regression cases support the stated compared-copy behavior.What I ran
Read the prepared diff and all three changed files at the pinned head through
repo_read.py. No tests or builds were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No tests or build were run in this review. The author-reported hardware and CI runs were not independently verified.
files.jsonwas unavailable; the manifest lists three changed files, all marked included, and each was read. No other changed files were excluded in the manifest.To get this to a good state
Nothing is required.