Skip to content

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

Merged
oneandonlydean merged 9 commits into
boykopovar:mainfrom
VicRaster:fix/storage-edge-import-touches
Nov 26, 2026
Merged

oneandonlydean merged 9 commits into
boykopovar:mainfrom
VicRaster:fix/storage-edge-import-touches

Conversation

@VicRaster

@VicRaster VicRaster commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

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: fix(agc): publish multisample depth over pages only an import window touched #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

@VicRaster
VicRaster marked this pull request as ready for review November 17, 2026 12:27
@milescoviello

milescoviello commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Linux run of this head, since the description only covers Windows.

Setup: Ubuntu 26.04.1 (kernel 7.0), GCC 15.2, Ninja, Release, RTX 4070 Ti on NVIDIA 615.71. Built main b179497 with this head f21a7ef merged (clean merge, 4dd3016129).

test result
agc_storage_import_touch passed, 3 runs. It runs on the GPU here, not skipped: stored image beside an import touch, CPU changed=0: ok and CPU changed=1: ok
agc_write_tracking, _generation_wrap, _mark_order passed, 3 runs. These are the three of the 11 tracking variants that are registered on Linux; in agc_write_tracking_tests.cmake the others sit under if(WIN32), plus one under if(APPLE)

I couldn't run a negative control with only main's GuestMemory.cpp, because DepthSurface.cpp here calls the new StoreUnchangedSinceLastCollect, so that build doesn't link.

From reading GuestMemory.cpp:

@domx4q

domx4q commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Ran the storage-import and write-tracking tests this PR touches with the Khronos validation layer on Linux and NVIDIA's proprietary driver, since the PR was tested on Windows only.

Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (vendor 0x10de, device 0x2684, Ada), proprietary driver 620.70.06, Vulkan 1.4.357, Khronos validation layer 1.4.363.1. Head f21a7ef7dc merged onto main 89b0eef7ab with --no-ff, clean merge. Main baseline is a Release build of 89b0eef7ab on the same machine.

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer \
ctest --test-dir build -R '^(agc_storage_import_touch|agc_storage_import_segment_memo|agc_write_tracking.*|agc_driver_recorder|agc_driver_native_multisample_depth)$' -V
main 89b0eef7ab this PR
Result 6 passed (6) 7 passed (7)
Insert instance layer "VK_LAYER_KHRONOS_validation" 7 8
was not found but was requested by env var VK_INSTANCE_LAYERS 0 0
VUID- none none

New on the PR side and absent on main: agc_storage_import_touch; it passes. Only three agc_write_tracking* tests are registered on Linux. Every device selection picked the RTX 4090.

No new VUID- errors; all focused tests pass on Ada.

AI-assisted: yes (Claude Code)

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1368 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 4448 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 5925 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6186 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 6188 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6192 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6209 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6808 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 9289 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 9508 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 9712 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 9852 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 9895 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 9950 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 10442 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 11444 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 11551 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 13251 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 13863 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 13920 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 13928 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 13929 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 14262 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 14473 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 15136 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 15570 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 15621 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 16831 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 16879 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 18173 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 18390 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 19557 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 19686 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 20084 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 20315 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 21238 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 22028 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 22190 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 22434 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 22531 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 22647 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 23058 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 24083 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 25610 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
PR 26036 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 26340 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 26706 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 27133 core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake

@rafaconvaitis

rafaconvaitis commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Windows + AMD run; I found no AMD run in the description or in the comments. Head f21a7ef7dc merged alone onto main 9a50e1014e with git merge --no-ff (clean merge).

Setup: Windows 11 25H2 (build 26200), AMD Radeon 760M integrated graphics (1002:15bf, Vulkan device name Radeon 5), AMD Software 26.11.2 (driver 32.0.32029.2010, Vulkan 1.4.359), selected with ANYPS5_GPU=Radeon, WinLibs GCC 15.2.0 r7 UCRT, Release, BUILD_TESTING=ON, Khronos validation layer 1.4.363 (LunarG SDK 1.4.363.1). Only the focused test targets were built; the other execution tests were left out with ANYPS5_AGC_EXECUTION_TESTS.

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer, ctest -R '^(<the 30 test names of this comment>)$' -V -j 1, 3 runs per side.

test main this PR this PR's tests on main's sources (1 run)
28 tests (names below) passes 3/3 passes 3/3 passes
agc_driver_native_depth_driver_queued_fill skipped 3/3 skipped 3/3 skipped
agc_driver_native_depth_publication passes 3/3 passes 3/3 fails
  • Negative control: with the tests of this PR built on main's sources (without the 3 production files this PR changes), agc_driver_native_depth_publication does not pass, so on this driver the test detects the change. It fails with AGC graphics: a page an import window resolved without changing its bytes was not published with the host's depth.
  • agc_driver_native_depth_driver_queued_fill is skipped on both sides on this device: skipped, host imports are compared here, not write-watched, and a queued fill's HTILE proof needs a write-watched import.
  • VUID- lines: 0 in the main and PR logs. Every run logs Selected GPU name=Radeon 5 vendor=0x1002 device=0x15bf and Insert instance layer "VK_LAYER_KHRONOS_validation", and none logs was not found but was requested.
Test names

28 tests: agc_driver_native_depth_aliased_depth_depth_only, agc_driver_native_depth_aliased_depth_no_stencil, agc_driver_native_depth_aliased_depth_stencil, agc_driver_native_depth_aliased_stencil, agc_driver_native_depth_bare_publication, agc_driver_native_depth_buffer_clear, agc_driver_native_depth_clear_refusals, agc_driver_native_depth_clears, agc_driver_native_depth_covered_owner, agc_driver_native_depth_driver_path, agc_driver_native_depth_expand_gate, agc_driver_native_depth_htile_plane_alias, agc_driver_native_depth_initial_owner, agc_driver_native_depth_overwritten_planes, agc_driver_native_depth_overwritten_published, agc_driver_native_depth_pending_units, agc_driver_native_depth_publication_without_htile, agc_driver_native_depth_retirement, agc_driver_native_depth_separate_stencil, agc_driver_native_depth_single_sample_view, agc_driver_native_depth_smaller_extent, agc_driver_native_depth_stencil, agc_driver_native_depth_stencil_view, agc_driver_native_depth_stored_repeat_fill, agc_driver_native_depth_uneven_plane, agc_driver_native_depth_uniform_plane_alias, agc_driver_native_depth_uniform_planes, agc_driver_native_multisample_depth

Update: re-run on the new head. Head a54f5a0b43 merged alone onto main 046d99ed28, same setup and commands as for f21a7ef7dc above, 3 runs per side. Results for this head:

test main this PR this PR's tests on main's sources (1 run)
28 tests (names below) passes 3/3 passes 3/3 passes
agc_driver_native_depth_driver_queued_fill skipped 3/3 skipped 3/3 skipped
agc_driver_native_depth_publication passes 3/3 passes 3/3 fails
  • Negative control: with the tests of this PR built on main's sources (without the 3 production files this PR changes), agc_driver_native_depth_publication does not pass, so on this driver the test detects the change. It fails with AGC graphics: a page an import window resolved without changing its bytes was not published with the host's depth.
  • agc_driver_native_depth_driver_queued_fill is skipped on both sides on this device: skipped, host imports are compared here, not write-watched, and a queued fill's HTILE proof needs a write-watched import.
  • VUID- lines: 0 in the main and PR logs. Every run logs Selected GPU name=Radeon 5 vendor=0x1002 device=0x15bf and Insert instance layer "VK_LAYER_KHRONOS_validation", and none logs was not found but was requested.
Test names

28 tests: agc_driver_native_depth_aliased_depth_depth_only, agc_driver_native_depth_aliased_depth_no_stencil, agc_driver_native_depth_aliased_depth_stencil, agc_driver_native_depth_aliased_stencil, agc_driver_native_depth_bare_publication, agc_driver_native_depth_buffer_clear, agc_driver_native_depth_clear_refusals, agc_driver_native_depth_clears, agc_driver_native_depth_covered_owner, agc_driver_native_depth_driver_path, agc_driver_native_depth_expand_gate, agc_driver_native_depth_htile_plane_alias, agc_driver_native_depth_initial_owner, agc_driver_native_depth_overwritten_planes, agc_driver_native_depth_overwritten_published, agc_driver_native_depth_pending_units, agc_driver_native_depth_publication_without_htile, agc_driver_native_depth_retirement, agc_driver_native_depth_separate_stencil, agc_driver_native_depth_single_sample_view, agc_driver_native_depth_smaller_extent, agc_driver_native_depth_stencil, agc_driver_native_depth_stencil_view, agc_driver_native_depth_stored_repeat_fill, agc_driver_native_depth_uneven_plane, agc_driver_native_depth_uniform_plane_alias, agc_driver_native_depth_uniform_planes, agc_driver_native_multisample_depth

Update: re-run on the new head. Head b54ec28cc5 merged alone onto main b40cb057af, same setup and commands as for f21a7ef7dc above, 3 runs per side. Results for this head:

test main this PR this PR's tests on main's sources (1 run)
28 tests (names below) passes 3/3 passes 3/3 passes
agc_driver_native_depth_driver_queued_fill skipped 3/3 skipped 3/3 skipped
agc_driver_native_depth_publication passes 3/3 passes 3/3 fails
  • Negative control: with the tests of this PR built on main's sources (without the 3 production files this PR changes), agc_driver_native_depth_publication does not pass, so on this driver the test detects the change. The failing run of agc_driver_native_depth_publication logs AGC graphics: a page an import window resolved without changing its bytes was not published with the host's depth.
  • VUID- lines: 0 in the main and PR logs. Every run logs Selected GPU name=Radeon 5 vendor=0x1002 device=0x15bf and Insert instance layer "VK_LAYER_KHRONOS_validation", and none logs was not found but was requested.
Test names

28 tests: agc_driver_native_depth_aliased_depth_depth_only, agc_driver_native_depth_aliased_depth_no_stencil, agc_driver_native_depth_aliased_depth_stencil, agc_driver_native_depth_aliased_stencil, agc_driver_native_depth_bare_publication, agc_driver_native_depth_buffer_clear, agc_driver_native_depth_clear_refusals, agc_driver_native_depth_clears, agc_driver_native_depth_covered_owner, agc_driver_native_depth_driver_path, agc_driver_native_depth_expand_gate, agc_driver_native_depth_htile_plane_alias, agc_driver_native_depth_initial_owner, agc_driver_native_depth_overwritten_planes, agc_driver_native_depth_overwritten_published, agc_driver_native_depth_pending_units, agc_driver_native_depth_publication_without_htile, agc_driver_native_depth_retirement, agc_driver_native_depth_separate_stencil, agc_driver_native_depth_single_sample_view, agc_driver_native_depth_smaller_extent, agc_driver_native_depth_stencil, agc_driver_native_depth_stencil_view, agc_driver_native_depth_stored_repeat_fill, agc_driver_native_depth_uneven_plane, agc_driver_native_depth_uniform_plane_alias, agc_driver_native_depth_uniform_planes, agc_driver_native_multisample_depth

AI-assisted: yes (build and runs scripted with an AI assistant, on the hardware above).

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Colewiz7

Copy link
Copy Markdown
Contributor

Head f21a7ef7dc on Linux 7.3.4, GCC 16.2.1 Release, Mesa 26.2.6 RADV, RX 7900 XT (gfx1100) and 7800X3D iGPU (gfx1036), with /dev/udmabuf access, built on its own and merged onto main 26604382a5: agc_storage_import_touch fails on both GPUs, 0/3 solo each, where main passes it 3/3.

an import-window touch beside a store dropped 1048576 new GPU texels after an earlier write-back

The rest of the full suite and -R '^agc' with the validation layer show no other new failures.

AI-assisted: yes

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 19, 2026
@VicRaster
VicRaster force-pushed the fix/storage-edge-import-touches branch from f21a7ef to a54f5a0 Compare November 19, 2026 11:50
@VicRaster

Copy link
Copy Markdown
Contributor Author

@Colewiz7 thank you — your two RADV failures exposed a problem in the new GPU test's setup.

The test was overriding the device probe with ImportWatch::Watch. On both of your RADV devices, GPU imports resolve write protection, so GPU stores can be reported through the write watch like CPU stores. Production selects comparison mode there; the test had forced a configuration production refuses.

I corrected that in a54f5a0b43: the test now keeps the real device policy, runs only when the resulting import is genuinely write-watched, and otherwise returns the registered CTest skip. The platform-independent agc_write_tracking regression still exercises the production StoredOver change everywhere.

I also rebuilt the complete stack on current main 907fe8fd31. The 15 focused checks pass locally, including all 11 write-tracking variants. The four GPU-facing checks loaded validation eight times with no missing-layer message and no VUID- line.

Could you rerun agc_storage_import_touch on either RADV device at the current head? The expected result is a skip with host imports are compared, not watched: storage import touch not tested; the rest of your AGC run should remain unchanged.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 19, 2026
@Colewiz7

Copy link
Copy Markdown
Contributor

agc_storage_import_touch still fails at a54f5a0b43 on both RADV devices: it prints the skip message, then exits 1. PR head alone, not merged, with the layer:

RX 7900 XT iGPU (gfx1036)
agc_storage_import_touch Failed, exit 1 Failed, exit 1
VUID- lines 2 2
host imports are compared, not watched: storage import touch not tested
Validation Error: [ VUID-vkEndCommandBuffer-commandBuffer-00059 ] ... VkDescriptorSet ... was destroyed ... VkPipeline ... was destroyed
radv/amdgpu: The CS has been rejected, see dmesg for more information (-2).
Validation Error: [ VUID-vkResetFences-pFences-01123 ]
AGC graphics: vkQueueSubmit recorder: Vulkan result -4

By the time the skip check runs, StorageTexture::Create has recorded work into the recorder that uses the local TextureDetiler's pipeline and descriptor set. The early return false destroys the detiler, so the next submit carries a command buffer with destroyed objects, the CS is rejected and the binary exits 1, not 77. Without the layer it fails the same way.

Draining the recorder before the return fixes it locally:

            recorder.Submit();
            device.WaitQueue();
            recorder.Sync();
            std::cout << "host imports are compared, not watched: storage import touch not tested\n";
            return false;

With that, both GPUs report Skipped with 0 VUID- lines, and the loader inserted the layer in each run.

@VicRaster, can you add the drain, or move the watch check ahead of StorageTexture::Create if HostImportFor can be asked before the image exists?

AI-assisted: yes

ycbuzi and others added 5 commits November 20, 2026 03:47
…touched

An import window marks pages the write watch saw dirty during a host import
whose bytes did not change as possible CPU touches. Native multisample depth
publication counted those marks as CPU stores and threw when such a page held
host-changed bytes equal to its snapshot. The tracker now keeps the pages it
noted as real CPU stores apart from those touches, and publication asks
StoreUnchangedSinceLastCollect, so a touched page takes the host result while a
real same-value CPU store still throws.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ublication

StoreUnchangedSinceLastCollect still read import window touches through
storedOver once any other page of the same 64 KiB block had a stamped
store, so a touched page beside a stored page threw again. The store
query now reads only real CPU stores there too, and publication asks it
once per page before falling back to per-byte queries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@VicRaster
VicRaster force-pushed the fix/storage-edge-import-touches branch from a54f5a0 to b54ec28 Compare November 19, 2026 17:54
@VicRaster

Copy link
Copy Markdown
Contributor Author

@Colewiz7 fixed in b54ec28cc5, using the drain sequence you verified: submit the recorded storage-image setup, wait for the queue, and sync the recorder before the local TextureDetiler is destroyed.

I also rebased the five-commit stack onto current main 711ab41a6e because the recorder and several related AGC paths had changed upstream. On the rebuilt head:

  • all 15 focused storage, depth-publication, and write-tracking checks pass;
  • the four GPU-facing checks logged eight actual validation-layer insertions;
  • there are zero missing-layer messages and zero VUID- lines;
  • conventions and whitespace checks pass.

Your local run already proves this exact drain makes both RADV devices return CTest Skipped with zero VUIDs. Could you confirm the published head behaves the same when convenient?

@Colewiz7

Copy link
Copy Markdown
Contributor

Confirmed at b54ec28cc5 (the PR head alone, not merged): agc_storage_import_touch now skips cleanly on both RADV devices.

RX 7900 XT iGPU (gfx1036)
agc_storage_import_touch Skipped Skipped
VUID- lines 0 0
layer inserted / not found 1 / 0 1 / 0

Both print host imports are compared, not watched: storage import touch not tested. Run with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer and ctest -V, Mesa 26.2.6.

AI-assisted: yes

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 23, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 24, 2026
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 25, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@oneandonlydean
oneandonlydean merged commit 1c185cb into boykopovar:main Nov 26, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants