fix(agc): accept a CPU write of expanded HTILE words over native multisample depth #25716
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/25716"
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 JJenkx on 2026-11-22T15:30:39Z.
What
Follow-up to #25561 and #25574. A guest CPU write over a native multisample depth target's HTILE plane still throws
guest writes over native multisample depth are not implementedwhen it leaves every HTILE word expanded. Resident Evil Village (PPSA01556) does this while loading its first level: the CPU rewrites a whole depth-only HTILE plane with0xfffc000f, and the depth plane is unchanged.At the end of
DepthSurface::CheckCurrent, the changed HTILE plane is accepted when either of these proofs succeeds:RebasePublication(1u)and preserves the native depth values.The depth and stencil planes must remain unchanged. Unsupported or mixed HTILE patterns still trigger the refusal.
The debt fragment
agc-cpu-expanded-htile-write.mdrecords the difference from the console. The console would expose the depth plane's raw bytes for tiles that held compressed data, while the host keeps the native depth values. Nothing measured this.The title has also been observed writing
0x00000000with clear depth 0. The acceptance check above is limited to the target's configured clear depth. #6808 covers the separate fast-clear handling discussed in the title investigation.Depends on: #25574 and its dependency #25561. The branch includes the original stacked commits. The current behavior includes the follow-ups in
cbb00f9656d9,8ccf7e260a27, andee65c17b6156.Tested
Linux 7.3.5, Ryzen 9 7950X, RX 6650 XT, RADV Mesa 26.3.1, Release.
New test cases in
NativeMultisampleDepth.cpp, mode--stored-repeat-fill, at 2, 4 and 8 samples:CheckCpuExpandedHtileWrite: a CPU write of expanded words over the whole HTILE plane keeps the native view, and the next lookup also succeeds. A later CPU write of one0x00000000word is refused.CheckCpuDepthPlaneWriteBesideExpandedHtile: a CPU write of expanded HTILE words together with a write to the depth plane is refused.The driver-path tests check the resulting sampled depth after a GPU clear-word store that was synchronized before lookup. They also check that both CPU and GPU clear-word writes revoke the bare descriptor after in-place expansion. Synced-store and bare-sampling tests
Focused suite:
ctest -R 'native_multisample_depth|native_depth|depth_surface|htile'passes 40 of 40.Negative control: with only the
DepthSurface.cppchange reverted,--stored-repeat-fillexits 1 onguest writes over native multisample depth are not implemented.Checks:
tools/check_conventions.py --base 47c6d0049fandtools/debt_fold.py --checkpass.Title evidence: PPSA01556 on
main1d1587ced3+ #9950 + #25561 + #25574. Each run is 900 s from a fresh save, skipping the opening movie (Options, then Cross).0xfffc000f(handled here) and one wrote all0x00000000(the clear-word observation).bcd243526f), one 900 s run reached the in-engine opening scene; a second ended with a kernel GPU ring timeout (VK_ERROR_DEVICE_LOST). The current head's clear-word acceptance is covered by the driver fixtures. A fresh title run on this head is still needed to determine whether PPSA01556 also requires #6808 on that route.Peer-reported, not my run: 4le22io's control on Windows 11, RTX 4060, driver 621.01, on head
49a06c2812merged into mainb09b3f76b2.main: 32 of 33 pass and 1 skips. This PR: the same.main'sDepthSurface.cpp): 30 pass, 1 skip and 2 fail, stopping at the external-GPU-write refusal. So the new cases depend on this change.VUIDlines.-j 8failure ofagc_driver_stencil_plane_memorypassed all 3 serial reruns.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)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T16:16:48Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation and tests support merging.
What I ran
Reviewed head
1e9b80e35d5f6aa4eaceee91bea76fb646ef02bcusing the prepared diff and the pinnedrepo_read.pyreader. No test commands were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The reported test suite, negative control, convention check, and debt check were not run by this review. Console behavior and the author’s game observations were not independently verified.
files.jsonwas unavailable; manifest lists five changed files, all marked included, and each was read.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T18:33:19Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation and regression cases support the described handling of expanded HTILE writes.
What I ran
49a06c281219852b4dad9f8a231690b27115f305.review/description.md,review/commits.md,review/manifest.json,review/diff.patch, andreview/README.md.DepthSurface.cpp,NativeMultisampleDepth.cpp, and the three debt change records, plus the relatedhtileProvesClear,expandedHtileWord,RebasePublication, andRecordClearValueimplementations.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The reported test suite, negative control, convention checks, and game runs were not independently run. No other changed or excluded files were listed in the manifest.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T09:17:44Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change based on the source reviewed; the reported test results were not independently run.
What I ran
Read the prepared diff and review bundle for head
9e87023f8344efc351e4bd575faa5319a5ffb7e3, then inspected the changed logic and targeted test setup throughrepo_read.py. No test or convention commands were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full test suite, focused tests, negative control, convention check, and debt check were not run. Linux console behavior and the reported Windows peer results were not independently confirmed. Read the description, commits, manifest, diff, README, both changed C++ files at the changed line ranges, and all three changed debt notes; no changed files were excluded.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-28T10:39:37Z.
Review: COMMENTED
Actionable comments posted: 5
fc3b2e82-09a9-4590-856c-d441b9ce8f4eReviewing files that changed from the base of the PR and between
f5b7e1d1acandcbb00f9656.core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cppdocs/dev/debt/changes/agc-cpu-expanded-htile-write.mddocs/dev/debt/changes/agc-expanded-htile-store-over-native-depth.mddocs/dev/debt/changes/agc-gpu-htile-clear-store.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T10:46:03Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the reviewed code handles recognized HTILE writes while preserving refusal for unsupported writes.
What I ran
Reviewed head
cbb00f9656d93f959582498a01550430f603e88cusing the prepared diff and the pinned repository reader. No tests or build commands were run by me.Results
Negative control
Not run by me; the description reports that reverting only the
DepthSurface.cppchange made--stored-repeat-fillfail.Findings
Blocking
None.
Non-blocking
None.
Sources
Behavior reviewed in
DepthSurface.cppand the changed execution coverage inNativeMultisampleDepth.cpp.Not verified
I read all five changed files listed as reviewed in
manifest.json:DepthSurface.cpp,NativeMultisampleDepth.cpp, and the three added debt notes. I did not run the claimed focused suite, convention/debt checks, game runs, or independently verify peer-reported Windows results. Files excluded by rule: none listed infiles.json.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-01T21:29:16Z.
Review: COMMENTED
🏛️ Architecture findings (2)
Advisory architecture findings (2)
💬 Code review
Actionable comments posted (3)
7cad3eb3-8c47-4c1f-87f9-56bfa37c035aReviewing files that changed from the base of the PR and between
cbb00f9656andac4b3e7c01.core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-01T23:24:40Z.
Review: COMMENTED
🏛️ Architecture findings (2)
Advisory architecture findings (2)
💬 Code review
Actionable comments posted (1)
bb9b532a-86cb-436c-a161-a1b2296ade4dReviewing files that changed from the base of the PR and between
ac4b3e7c01and8ccf7e260a.core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cppLimit details: You’ve used all 10 included reviews currently available.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-01T23:51:20Z.
Review: APPROVED
Reviewed — looks good
The changed code accepts expanded or clear HTILE updates only when the other depth and stencil planes remain unchanged, and I found no blocking defect.
What I ran
Reviewed head
8ccf7e260a275bdc990d8daad1c9c4504b8549fc. I usedrepo_read.pyto inspect the changed code and relevant context; I did not run tests or builds. The author reports focused tests and checks passed; I did not run them.Results
Negative control
Not run. The author reports reverting the
DepthSurface.cppchange makes--stored-repeat-fillfail with the expected refusal.Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
I did not run the test suite, convention or debt checks, or verify behavior on a physical console. I reviewed the changed hunks and relevant context, not every unchanged line of the large test and source files. The prepared
files.jsonlists no excluded files. The changed files reviewed werecore/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp,core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp, and the three changed debt notes underdocs/dev/debt/changes/.To get this to a good state
Nothing required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-02T00:08:56Z.
Review: COMMENTED
🏛️ Architecture findings (3)
Advisory architecture findings (3)
16fbf41d-3af4-45ca-aa57-27b3b9a7d085Reviewing files that changed from the base of the PR and between
8ccf7e260aandee65c17b61.core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-02T01:10:31Z.
Review: APPROVED
Reviewed — looks good
The reviewed changes at
ee65c17b6156a8ed4e70e06bac300079e6ea7875accept eligible expanded HTILE writes while retaining checks for other plane writes and unsupported HTILE contents.What I ran
I inspected the prepared diff and source at the pinned head using
repo_read.py; I did not run tests, a build, or compilation. The diff is againstmain; no merged-preview check was run. The author-reported Linux test results and peer-reported Windows results below were not runs I performed. The files reviewed wereDepthSurface.cpp(changed regions and relevant helpers),NativeMultisampleDepth.cpp(changed test regions and invocation), and all three added debt notes.files.jsonlists no excluded files.Results
Negative control
Not run by me. The author reports that reverting only the
DepthSurface.cppchange makes--stored-repeat-fillfail with the external GPU write refusal.Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
I did not run the test suite or verify console behavior. The author reports 40/40 focused tests passing on Linux; the Windows results and negative control are also author- or peer-reported. No files listed in
files.jsonas excluded were present.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T21:31:30Z.
Review: COMMENTED
The current head's CPU path also recognizes a depth-only clear after the recorder has already synced the GPU store. Please update the opening description, which still says clear words are outside this PR. Keep the CPU-only accepted case, mixed metadata refusal and depth-plane write refusal together, and include a sampled-value check for the CPU expanded case so that preserving the existing image is observable beyond its identity. The paired native-depth tests are queued on lavapipe.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T06:33:05Z.
Review: APPROVED
Reviewed — looks good
The reviewed head accepts qualifying expanded or clear HTILE rewrites and retains refusals for unsupported writes.
What I ran
Reviewed head
9b94bb9a01de6e2839f22ed20934e8bfacecab58; basemain. No merged preview check. I inspected the prepared diff and usedrepo_read.pyat the pinned head; no tests or build commands were run.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
The full test source was not included in the review folder because of its size; I inspected its changed hunks in the diff and the mode registration through the pinned reader. The three changed debt notes were read in full.
files.jsonlists no files excluded by its rules. I did not run the focused suite or reproduce the reported console behavior.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-04T06:37:33Z.
Review: COMMENTED
Actionable comments
4fdd7fc6-6672-450b-a04c-0a30fe00e995Reviewing files that changed from the base of the PR and between
ee65c17b61and9b94bb9a01.core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cppcore/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T09:21:50Z.
Review: APPROVED
Reviewed — looks good
The change at head
79a8be9b4c16f0f44c77b89e399a56879c165ab1accepts verified expanded or clear HTILE writes while retaining checks against writes to the depth and stencil planes.What I ran
I reviewed the prepared diff and metadata, then read the changed code paths and relevant helpers at the pinned head. No tests, builds, or other executable checks were run.
Results
Negative control
Not run by me. The author reports that reverting the
DepthSurface.cppchange makes--stored-repeat-fillfail with the expected refusal.Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
I did not run the focused suite, the negative control, or a fresh Resident Evil Village run. Hardware behavior beyond the author's reported Linux/RADV run and peer-reported Windows run is unverified. I read the changed ranges in both code files and the full text of all three added debt notes;
files.jsonlists no excluded files.To get this to a good state
Nothing is required.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.