Skip to content

fix(agc): verify refreshed draw stage data - #8372

Open
JJenkx wants to merge 1 commit into
boykopovar:mainfrom
JJenkx:fix/agc-verify-refreshed-stage-data
Open

JJenkx wants to merge 1 commit into
boykopovar:mainfrom
JJenkx:fix/agc-verify-refreshed-stage-data

Conversation

@JJenkx

@JJenkx JJenkx commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What

With APS5_VERIFY_DRAW_ENTRIES=1, a draw-cache hit whose constant data changes can report a stage mismatch even when the refreshed data is correct. lookupDraw puts the refreshed words and compiled result in StageDataHit, but the verifier compares the original cached variant against a fresh capture.

Pass the effective stage data to the verifier and compare the refreshed words and compilation when present. Keep both content and forwarded-word comparisons. The ordinary rendering path is unchanged.

Add a Vulkan regression that caches a constant-color draw, changes the constant from 0.25 to 1.0, requires a verified stage-data hit with no new mismatch, and checks the rendered bytes change from 64 to 255.

Overlap review: this is independent of #5609 and #6539, whose relocation work also edits the verification condition; those branches will need to retain this effective-data selection when rebasing. #6188 changes cache admission and verification too. None implements this refreshed-stage-data regression/fix. The test's Windows PATH setup is separate from the list edited by #5656.

Tested

Linux, AMD Radeon RX 6650 XT, RADV Mesa 26.2.4-arch1.1, Arch Linux. Built agc_driver_draw_cache_reuse_tests in Release with BUILD_TESTING=ON and ANYPS5_AGC_EXECUTION_TESTS=DrawCacheReuse.

Matched main b9a097353cc387d643a810594ed8dd60601109bb with this PR's test/CMake changes only, against main plus the implementation change, on the same machine/GPU:

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 \
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
ctest --test-dir build-full -R '^agc_driver_draw_cache_reuse' -V --timeout 60

Both runs explicitly selected the RADV ICD and the installed validation-layer paths. Main: four existing tests pass; the new agc_driver_draw_cache_reuse_entry_verify fails with draw-entry verification: refreshed stage data differed from a fresh capture. Candidate: all five pass (2.90 seconds total), including refreshed-color GPU readback. Neither log has VUID-, a missing-layer warning, or a skipped test. python3 tools/check_conventions.py --base origin/main passes.

No performance or title-bring-up claim. Windows was not tested locally; the new test has the same DLL PATH setup as the existing Vulkan tests.

Independent Windows validation by @xXPBSXx (report), at this exact head bd017bc3ab, on Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, NVIDIA RTX 4080 SUPER, WinLibs GCC 15.2.0 (MinGW-w64 UCRT), Release: all five agc_driver_draw_cache_reuse tests pass three times each. With only the three production driver files restored from merge base b9a097353c, retaining this PR's test/CMake changes, the new _entry_verify test fails three times with the refreshed-stage-data mismatch; the other four pass. The contributor restored the PR sources afterward. This is attributed contributor evidence: no title, full-suite or other-GPU coverage was reported, and the report does not establish Khronos validation-layer coverage on Windows.

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
  • 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: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 6650 XT; RADV Mesa 26.2.4-arch1.1; Arch Linux. Independent contributor @xXPBSXx: NVIDIA RTX 4080 SUPER, Windows 10 Pro, exact head bd017bc3ab; see attributed limitations above.
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6946 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp L169
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp L436
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp L155-156
PR 9243 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp L155-156
core/libs/prx/libSceAgcDriver/tests/execution/DrawCacheReuse.cpp L242-245
PR 9248 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp L155-156
core/libs/prx/libSceAgcDriver/tests/execution/DrawCacheReuse.cpp L242-245
PR 9508 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp L169
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp L436
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp L155-156

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/CMakeLists.txt
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1896 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5431 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
PR 5441 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
PR 5609 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6146 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6187 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
core/libs/prx/libSceAgcDriver/tests/execution/DrawCacheReuse.cpp
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6209 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6292 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6501 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 6539 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
PR 6615 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 6642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6788 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6868 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6977 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
PR 7275 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 7457 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7508 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7604 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
PR 7705 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7800 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8014 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8246 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8484 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8527 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8552 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8592 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8672 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8999 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9431 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9432 core/libs/prx/libSceAgcDriver/CMakeLists.txt

@github-actions github-actions Bot added build agc libSceAgc* labels Oct 20, 2026
@xXPBSXx

xXPBSXx commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Independent Windows run of this PR with a baseline (data only).

Environment: Windows 10 Pro 10.0.19045, Ryzen 7 5800X3D, NVIDIA GeForce RTX 4080 SUPER (the log shows Selected GPU name=NVIDIA GeForce RTX 4080 SUPER vendor=0x10de device=0x2702 subgroup=32, picked with ANYPS5_GPU=4080), WinLibs GCC 15.2.0 (MinGW-w64 UCRT), Release. PR head bd017bc3ab; merge-tree against main is clean. I built agc_driver_draw_cache_reuse_tests; ctest -R '^agc_driver_draw_cache_reuse' lists five tests (agc_driver_draw_cache_reuse, _off, _verify, _entry_verify, _inline).

Results (3 runs each):

  • PR head: all five tests pass 3/3.
  • Baseline: I kept the PR's tests/execution/DrawCacheReuse.cpp and CMakeLists.txt and replaced only Execution/include/Driver/Driver.hpp, Execution/src/Driver/Draw/Draw.cpp and Execution/src/Driver/Draw/DrawCapture.cpp with their versions from the merge base b9a097353c, then rebuilt. agc_driver_draw_cache_reuse_entry_verify fails 3/3 with [draw-cache] verify: stage 1 (...) of a hit captured differently: 1 runs / 1 words matched, 1 / 1 fresh and AGC graphics: draw-entry verification: refreshed stage data differed from a fresh capture; the other four pass. I restored the PR's sources afterwards.

Not run: other GPUs (I did not run an AMD card for this PR), other platforms, the other tests, the full repository CTest, and any title or console run.

AI-assisted (Claude Code).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants