fix(agc): ignore unchanged import touches in stored-range checks #22306

Merged
VicRaster merged 9 commits from upstream-pr/22306 into main 2026-11-26 04:26:11 +00:00
VicRaster commented 2026-11-17 11:30:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by VicRaster on 2026-11-17T11:30:02Z.


What

An unchanged host-import touch can make StoredOver report a CPU store after a neighbouring page in the same 64 KiB block is written. A storage image can then retain stale guest bytes instead of publishing its GPU result in the shared edge block.

Use #22062's real-store accounting for StoredOver. This branch carries that prerequisite and keeps the storage and tracker regressions from published head b54ec28cc5. The GPU regression follows the device's actual import policy; comparison-mode imports skip after draining recorder work, preserving the published RADV correction.

The local current-main update resolves the depth-publication conflict using frankea's tested composition: retain the page/byte StoreUnchangedSinceLastCollect check before main's cause != DepthReadCause::Access && cause != DepthReadCause::Write refusal and guest-byte copy. Main's #21719 strict writable-buffer refusal and guest-write retirement remain intact. The native publication test runs its ShaderBufferWrite, GuestWriteAfterRead and UndecidedShaderBufferWrite controls. Debt changes use fragments, retain current main's entry and measured-driver information, and remove the duplicate entries produced by the automatic merge.

Status: #22062 remains open and is still the prerequisite. This branch carries its accounting; the additional StoredOver correction remains a separate follow-up.

Tested

23 November 2026, main f5b7e1d1ac816c41cb798d09ecbf42cf2e7e9edf versus head 62bcbcf0bd7533ee8b944cf4a5b23992775e4336. Windows 11 build 26300, WinLibs GCC 15.2.0 Release, NVIDIA GeForce RTX 3080 Ti driver 610.88, Khronos validation 1.4.363 (pinned Vulkan-Headers 1.4.335).

Built the focused targets from pinned dependency sources in a fresh build tree, then rebuilt the candidate in the same tree. Ran all agc_write_tracking*, agc_driver_native_depth_*, agc_driver_native_multisample_depth, agc_storage_import_segment_memo, and the candidate's added agc_storage_import_touch with verbose CTest output, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, and VK_LOADER_DEBUG=layer.

Implementation Passed Failed Skipped Validation layer insertions VUIDs
Main 43 0 1 67 0
Local candidate 44 0 1 68 0

The one added case is agc_storage_import_touch; it executes and passes. No existing case changes result. agc_driver_native_depth_driver_queued_fill skips on both revisions because the device's import policy does not support that case. Every passing GPU case logs actual validation-layer insertion and selects the RTX 3080 Ti. Neither log has a missing-layer message, Validation Error, VUID-, or SYNC-HAZARD.

Negative control: ran the candidate recorder executable from a separate directory with the exact archived main driver and dependencies. The storage-import regression exits 1 with an import-window touch beside a store dropped 57344 new GPU texels after an earlier write-back. It passes with the candidate driver. This compares the full stacked candidate with main; it is not a new main-plus-#22062 control.

Conventions, whitespace and debt-fragment checks pass. The name lookup completed across 2,501 open PRs, but the names are internal functions and the export lookup reports them as undeclared; it does not establish globally clean overlap. This is a focused Windows validation, not a full-suite, Linux, macOS, RADV or title rerun.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #22062 (carried in this local stack; still open)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 3080 Ti, driver 610.88, Windows 11 build 26300
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5355994339 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22306). Originally posted by [VicRaster](https://github.com/VicRaster) on 2026-11-17T11:30:02Z. --- ### What An unchanged host-import touch can make `StoredOver` report a CPU store after a neighbouring page in the same 64 KiB block is written. A storage image can then retain stale guest bytes instead of publishing its GPU result in the shared edge block. Use #22062's real-store accounting for `StoredOver`. This branch carries that prerequisite and keeps the storage and tracker regressions from published head `b54ec28cc5`. The GPU regression follows the device's actual import policy; comparison-mode imports skip after draining recorder work, preserving the published RADV correction. The local current-main update resolves the depth-publication conflict using [frankea's tested composition](https://github.com/boykopovar/AnyPS5/pull/22062#issuecomment-7073208239): retain the page/byte `StoreUnchangedSinceLastCollect` check before main's `cause != DepthReadCause::Access && cause != DepthReadCause::Write` refusal and guest-byte copy. Main's #21719 strict writable-buffer refusal and guest-write retirement remain intact. The native publication test runs its ShaderBufferWrite, GuestWriteAfterRead and UndecidedShaderBufferWrite controls. Debt changes use fragments, retain current main's entry and measured-driver information, and remove the duplicate entries produced by the automatic merge. **Status:** #22062 remains open and is still the prerequisite. This branch carries its accounting; the additional StoredOver correction remains a separate follow-up. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> 23 November 2026, main `f5b7e1d1ac816c41cb798d09ecbf42cf2e7e9edf` versus head `62bcbcf0bd7533ee8b944cf4a5b23992775e4336`. Windows 11 build 26300, WinLibs GCC 15.2.0 Release, NVIDIA GeForce RTX 3080 Ti driver 610.88, Khronos validation 1.4.363 (pinned Vulkan-Headers 1.4.335). Built the focused targets from pinned dependency sources in a fresh build tree, then rebuilt the candidate in the same tree. Ran all `agc_write_tracking*`, `agc_driver_native_depth_*`, `agc_driver_native_multisample_depth`, `agc_storage_import_segment_memo`, and the candidate's added `agc_storage_import_touch` with verbose CTest output, `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, and `VK_LOADER_DEBUG=layer`. | Implementation | Passed | Failed | Skipped | Validation layer insertions | VUIDs | | --- | ---: | ---: | ---: | ---: | ---: | | Main | 43 | 0 | 1 | 67 | 0 | | Local candidate | 44 | 0 | 1 | 68 | 0 | The one added case is `agc_storage_import_touch`; it executes and passes. No existing case changes result. `agc_driver_native_depth_driver_queued_fill` skips on both revisions because the device's import policy does not support that case. Every passing GPU case logs actual validation-layer insertion and selects the RTX 3080 Ti. Neither log has a missing-layer message, `Validation Error`, `VUID-`, or `SYNC-HAZARD`. Negative control: ran the candidate recorder executable from a separate directory with the exact archived main driver and dependencies. The storage-import regression exits 1 with `an import-window touch beside a store dropped 57344 new GPU texels after an earlier write-back`. It passes with the candidate driver. This compares the full stacked candidate with main; it is not a new main-plus-#22062 control. Conventions, whitespace and debt-fragment checks pass. The name lookup completed across 2,501 open PRs, but the names are internal functions and the export lookup reports them as undeclared; it does not establish globally clean overlap. This is a focused Windows validation, not a full-suite, Linux, macOS, RADV or title rerun. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #22062 (carried in this local stack; still open) <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: NVIDIA GeForce RTX 3080 Ti, driver 610.88, Windows 11 build 26300 <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
MarcZX10 commented 2026-11-19 00:54:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T00:54:49Z.

Review: COMMENTED


Reviewed — no blocking findings

The change addresses the reported import-touch accounting issue, and the inspected code and regression coverage support the fix; no checks were run in this review.

What I ran

Reviewed head f21a7ef7dc0345ac390cc9c18856ce7ec2fe8c0c. No commands or tests were run; this session provided the pinned reader only. The author reports focused tests passing on Windows with an RTX 3080 Ti; that result was not independently verified.

Read the prepared description, commit list, manifest, and diff. Read the changed code and relevant context in GuestMemory.hpp, GuestMemory.cpp, DepthSurface.cpp, WriteTracking.cpp, Recorder.cpp, agc_driver_recorder_tests.cmake, and NativeMultisampleDepth.cpp, plus the added debt fragment. Recorder.cpp full text was excluded from the review folder; its relevant changed section was read through the pinned reader. No other changed file was excluded.

Results

Check Result Note
Code review passed No verified defect found
Tests in this review not run Reader-only environment
Author-reported tests not run Windows results reported in PR description

Findings

Blocking

None.

Non-blocking

None.

Not verified

The reported builds, focused tracking and storage tests, Vulkan validation, Linux behavior, and other GPU behavior were not independently run or confirmed. No merged-preview check was performed.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5967664123 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22306#pullrequestreview-5967664123). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-19T00:54:49Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The change addresses the reported import-touch accounting issue, and the inspected code and regression coverage support the fix; no checks were run in this review. ## What I ran Reviewed head `f21a7ef7dc0345ac390cc9c18856ce7ec2fe8c0c`. No commands or tests were run; this session provided the pinned reader only. The author reports focused tests passing on Windows with an RTX 3080 Ti; that result was not independently verified. Read the prepared description, commit list, manifest, and diff. Read the changed code and relevant context in `GuestMemory.hpp`, `GuestMemory.cpp`, `DepthSurface.cpp`, `WriteTracking.cpp`, `Recorder.cpp`, `agc_driver_recorder_tests.cmake`, and `NativeMultisampleDepth.cpp`, plus the added debt fragment. `Recorder.cpp` full text was excluded from the review folder; its relevant changed section was read through the pinned reader. No other changed file was excluded. ## Results | Check | Result | Note | |---|---|---| | Code review | passed | No verified defect found | | Tests in this review | not run | Reader-only environment | | Author-reported tests | not run | Windows results reported in PR description | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The reported builds, focused tracking and storage tests, Vulkan validation, Linux behavior, and other GPU behavior were not independently run or confirmed. No merged-preview check was performed. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-19 11:54:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T11:54:48Z.

Review: COMMENTED


Reviewed — no blocking findings

The inspected changes consistently separate import-window touches from CPU stores and use that distinction in stored-range and depth-publication checks; no blocking defect was verified.

What I ran

Reviewed head a54f5a0b43a08a90c6691c2378ee6deeafa1cb0c. No build or tests were run in this review.

Results

Check Result Note
Diff and targeted source review passed Tracked the accounting and publication changes
Build and tests not run Author reports focused checks; not independently verified

Findings

Blocking

None verified in the inspected code.

Non-blocking

None.

Sources

Reviewed the prepared diff and pinned-head source for GuestMemory.hpp, GuestMemory.cpp, DepthSurface.cpp, Recorder.cpp, WriteTracking.cpp, agc_driver_recorder_tests.cmake, NativeMultisampleDepth.cpp, and docs/dev/debt/libSceAgcDriver.md.

Not verified

Build and test results in the description were not independently run. Full-file context beyond the relevant changed hunks was not read. files.json was not available; the review-folder listing reports eight changed files, all of which were inspected at relevant hunks. The large Recorder.cpp file was read through the pinned-head reader around its changed function and dispatch path.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5974509722 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22306#pullrequestreview-5974509722). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-19T11:54:48Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The inspected changes consistently separate import-window touches from CPU stores and use that distinction in stored-range and depth-publication checks; no blocking defect was verified. ## What I ran Reviewed head `a54f5a0b43a08a90c6691c2378ee6deeafa1cb0c`. No build or tests were run in this review. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted source review | passed | Tracked the accounting and publication changes | | Build and tests | not run | Author reports focused checks; not independently verified | ## Findings ### Blocking None verified in the inspected code. ### Non-blocking None. ## Sources Reviewed the prepared diff and pinned-head source for `GuestMemory.hpp`, `GuestMemory.cpp`, `DepthSurface.cpp`, `Recorder.cpp`, `WriteTracking.cpp`, `agc_driver_recorder_tests.cmake`, `NativeMultisampleDepth.cpp`, and `docs/dev/debt/libSceAgcDriver.md`. ## Not verified Build and test results in the description were not independently run. Full-file context beyond the relevant changed hunks was not read. `files.json` was not available; the review-folder listing reports eight changed files, all of which were inspected at relevant hunks. The large `Recorder.cpp` file was read through the pinned-head reader around its changed function and dispatch path. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-22 23:27:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T23:27:44Z.

Review: COMMENTED


Reviewed — no blocking findings

The changed accounting and publication paths are internally consistent with the stated import-touch behavior; the supplied test report supports the exercised paths, while I did not run checks in this review.

What I ran

  • Reviewed head b54ec28cc5f7c0ed1e14467fa723c20ade0970dd using the prepared diff and the pinned repository reader.
  • No build or test commands were run. The test results in the description are author-reported.

Results

Check Result Note
Changed code review passed Relevant logic and context inspected
Build and tests not run Author reports focused checks passing

Findings

Blocking

None.

Non-blocking

None.

Not verified

  • I read all changed files listed in the manifest except core/libs/prx/libSceAgcDriver/tests/Recorder.cpp, whose full text was excluded from the review folder. I inspected its added hunk in the prepared diff only; surrounding implementation and callers in that file were not verified.
  • I did not independently rerun the reported Windows or RADV checks, including the GPU import policy and skip-drain behavior.
  • The provided bundle did not include review/files.json; excluded-file details are therefore based on the manifest and supplied description.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6015096774 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22306#pullrequestreview-6015096774). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T23:27:44Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The changed accounting and publication paths are internally consistent with the stated import-touch behavior; the supplied test report supports the exercised paths, while I did not run checks in this review. ## What I ran - Reviewed head `b54ec28cc5f7c0ed1e14467fa723c20ade0970dd` using the prepared diff and the pinned repository reader. - No build or test commands were run. The test results in the description are author-reported. ## Results | Check | Result | Note | |---|---|---| | Changed code review | passed | Relevant logic and context inspected | | Build and tests | not run | Author reports focused checks passing | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified - I read all changed files listed in the manifest except `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp`, whose full text was excluded from the review folder. I inspected its added hunk in the prepared diff only; surrounding implementation and callers in that file were not verified. - I did not independently rerun the reported Windows or RADV checks, including the GPU import policy and skip-drain behavior. - The provided bundle did not include `review/files.json`; excluded-file details are therefore based on the manifest and supplied description. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-23 09:38:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T09:38:24Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change based on the code inspected; the focused regressions align with the tracker and publication changes.

What I ran

No commands were run. The bundle reports focused Windows tests and a negative control; these results are author-reported, not independently verified. Head reviewed: 62bcbcf0bd7533ee8b944cf4a5b23992775e4336.

Results

Check Result Note
Code review passed Inspected tracker, publication, and regression changes
Focused tests not run Only author-reported results available
Negative control not run Only author-reported result available

Findings

Blocking

None identified in the inspected changes.

Non-blocking

None.

Not verified

The changed core/libs/prx/libSceAgcDriver/tests/Recorder.cpp was read only around its new regression and dispatch; its full text was excluded from the review folder. The rest of the changed files listed in the manifest were read from the bundle or at the pinned head. No tests were run independently, and the reported Windows validation, other operating systems, GPUs, and title behavior were not verified. review/files.json was not available through the reader; exclusion status was taken from review/manifest.json.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6019316918 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22306#pullrequestreview-6019316918). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-23T09:38:24Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change based on the code inspected; the focused regressions align with the tracker and publication changes. ## What I ran No commands were run. The bundle reports focused Windows tests and a negative control; these results are author-reported, not independently verified. Head reviewed: `62bcbcf0bd7533ee8b944cf4a5b23992775e4336`. ## Results | Check | Result | Note | | --- | --- | --- | | Code review | passed | Inspected tracker, publication, and regression changes | | Focused tests | not run | Only author-reported results available | | Negative control | not run | Only author-reported result available | ## Findings ### Blocking None identified in the inspected changes. ### Non-blocking None. ## Not verified The changed `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` was read only around its new regression and dispatch; its full text was excluded from the review folder. The rest of the changed files listed in the manifest were read from the bundle or at the pinned head. No tests were run independently, and the reported Windows validation, other operating systems, GPUs, and title behavior were not verified. `review/files.json` was not available through the reader; exclusion status was taken from `review/manifest.json`. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-25 06:08:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T06:08:29Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the focused implementation and regression cases support the stated fix, while platform and title coverage remains limited.

What I ran

Reviewed head 3d8d444998c3a5e9e924261354026971ddf5a86b. No commands or tests were run in this review; the Windows validation and negative control described in the PR are author-reported.

Results

Check Result Note
Diff and targeted source review passed Reviewed all changed lines
Tests run by reviewer not run No execution environment available
Author-reported focused validation not run Windows 11, RTX 3080 Ti

Findings

Blocking

None.

Non-blocking

  • The new tracking and depth-publication cases are narrowly targeted and cover unchanged import touches, adjacent stores, and same-value stores. The PR description reports focused Windows coverage; Linux, macOS, RADV, and title behavior remain unverified here.

Not verified

No build or tests were run by the reviewer. The PR description’s test results and negative control were not independently verified. Reviewed all changed files listed in the manifest, including Recorder.cpp and NativeMultisampleDepth.cpp through the pinned repository reader; none were excluded. The review folder did not provide files.json, so its exclusion list could not be independently checked.

To get this to a good state

Nothing is required. Optional: run the focused cases on Linux and macOS, and on RADV, to broaden platform coverage.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6052651864 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22306#pullrequestreview-6052651864). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T06:08:29Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the focused implementation and regression cases support the stated fix, while platform and title coverage remains limited. ## What I ran Reviewed head `3d8d444998c3a5e9e924261354026971ddf5a86b`. No commands or tests were run in this review; the Windows validation and negative control described in the PR are author-reported. ## Results | Check | Result | Note | | --- | --- | --- | | Diff and targeted source review | passed | Reviewed all changed lines | | Tests run by reviewer | not run | No execution environment available | | Author-reported focused validation | not run | Windows 11, RTX 3080 Ti | ## Findings ### Blocking None. ### Non-blocking - The new tracking and depth-publication cases are narrowly targeted and cover unchanged import touches, adjacent stores, and same-value stores. The PR description reports focused Windows coverage; Linux, macOS, RADV, and title behavior remain unverified here. ## Not verified No build or tests were run by the reviewer. The PR description’s test results and negative control were not independently verified. Reviewed all changed files listed in the manifest, including `Recorder.cpp` and `NativeMultisampleDepth.cpp` through the pinned repository reader; none were excluded. The review folder did not provide `files.json`, so its exclusion list could not be independently checked. ## To get this to a good state Nothing is required. Optional: run the focused cases on Linux and macOS, and on RADV, to broaden platform coverage.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!22306
No description provided.