Skip to content

fix(agc): require full coverage only for metadata pass targets with CMASK or DCC keys - #9694

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
Tamalero:fix/agc-metadata-pass-coverage-without-metadata
Oct 27, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
Tamalero:fix/agc-metadata-pass-coverage-without-metadata

Conversation

@Tamalero

@Tamalero Tamalero commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What

With #8991, Marvel's Guardians of the Galaxy (PPSA01748) gets past its menus. After New Game and the first level load, it stops in presentation on:

AGC graphics: CB metadata pass over part of a color target

Cause: the pass is a fast-clear eliminate (CB_COLOR_CONTROL mode 2) over three 1920x1080 color targets that have no CMASK and no DCC keys. The viewport covers the targets (xs/xo = 960/960, ys/yo = 540/540), but PA_SC_MODE_CNTL_0 still enables the viewport scissor, and PA_SC_VPORT_SCISSOR_0 is left at 480x270 from an earlier pass. DecodeColorMetadataPass requires every target to be covered, so it refuses. For these targets the pass changes nothing: RunColorMetadataPass touches a target only through its CMASK clear or its DCC keys.

Fix: the coverage check applies only to targets with a CMASK or DCC keys. A partial pass over such a target is still refused as before, and FMASK decompress (which requires a CMASK) and resolves are unchanged.

Tested

Linux (CachyOS, kernel 7.2.9), GCC 16.2.1, Release, BUILD_TESTING=ON, RTX 4090 (NVIDIA 615.78.08).

  • metadataPassTests (agc_driver_graphics): the two partial-coverage cases (a scissor and a viewport that miss part of the target) now first check that a target without CMASK or DCC keys decodes with its target. Then they add DCC keys to the same state and require the refusal as before.
  • Negative check: with State.cpp restored to main, agc_driver_graphics fails on the new expectation. With the change, agc_driver_graphics and agc_driver_graphics_maps_fallback pass. ctest -R '^agc_' (866 tests): 862 pass and 1 skips. The three agc_driver_sample_order* tests fail ("2x scene with the standard locations: the slopes did not leave depth both at and below the clear value"), and they fail the same way on main d6eafa5 on this machine.
  • python3 tools/check_conventions.py --base origin/main: passes.
  • PPSA01748 (content 01.006.000), New Game into the first level:
    • Before the change (main 6830c91 plus fix(recompiler): match image-table T# halves offset before and after readfirstlane #8991's change, one run): stops on the refusal above at the end of the first-level load.
    • With the check relaxed this way (a local build that logs each partial pass and then runs it over the whole target): the run went past that point: the rest of the load, then the playable prologue (Peter's bedroom; picking up and inspecting an object works), then the load into the next chapter. No other stop in about an hour. All 200 logged partial passes were fast-clear eliminates over targets with cmask=0, dcc=0 under the 480x270 viewport scissor.

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: PPSA01748 Marvel's Guardians of the Galaxy (PPSA01748) #9704 (first level after New Game)
  • GPUs tested: NVIDIA GeForce RTX 4090, driver 615.78.08, Linux (CachyOS, kernel 7.2.9)
  • AI-assisted: yes

Tested and written by Claude (AI assistant) on a contributor's machine.

image image

…MASK or DCC keys

A CB fast-clear eliminate or DCC decompress pass whose viewport or scissor
did not cover a color target was refused ("CB metadata pass over part of a
color target") even when that target had no CMASK and no DCC keys. Such a
pass leaves the target's texels unchanged: RunColorMetadataPass touches a
target only through its CMASK clear or its DCC keys, so for a target with
neither, the covered area does not matter.

Marvel's Guardians of the Galaxy (PPSA01748) issues fast-clear eliminates
over three 1920x1080 targets without CMASK or DCC while PA_SC_MODE_CNTL_0
still enables a 480x270 viewport scissor left from an earlier pass, and
stopped in its first level on that refusal.

The coverage check now applies only to targets with a CMASK or DCC keys;
FMASK decompress (which requires a CMASK) and resolves are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Oct 22, 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.

The one-line relaxation is consistent with RunColorMetadataPass: targets with neither CMASK nor DCC metadata have no metadata work to perform, while the full-coverage refusal remains for targets whose metadata may be changed. The added negative assertions retain the refusal for keyed targets. I ran the current-main conventions check and git diff --check; both passed. A pairwise merge-tree with open #9597 is clean; that PR changes mipmapped DCC target decoding in a separate area, not this coverage condition.

Two repository requirements still need attention before approval:

  1. This changes the AGC driver. CONTRIBUTING requires the same focused test(s) on main and the PR with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1 and ANYPS5_REQUIRE_VULKAN=1, using ctest -V, plus confirmation the layer was loaded and no new VUID- errors were introduced. The report includes the focused tests and GPU, but not those validation-layer runs or the main/change VUID comparison. Please attach both logs/results. The hosted product jobs are skipped on this PR; I could not run the AGC target in this checkout.
  2. The checklist says Unblocks: PPSA01748 (first level after New Game), but the repo requires the Game bring-up discussion number as well. I could not find a Game bring-up discussion for PPSA01748; #8991 is a merged PR, not that discussion. Please create or locate the title's Game bring-up discussion, link it on this line, and keep its open-PR/blocker summary current.

I found no code defect in the changed condition. These requests are for the required AGC validation evidence and title-tracking checklist.

@Tamalero

Copy link
Copy Markdown
Contributor Author

@MarcZX10 thanks for the review. Both items:

1. Validation-layer runs. Same machine as the description (RTX 4090, NVIDIA 615.78.08, Linux). main d6eafa5 and this PR (793e51a), each a full build. Run as:

VK_LOADER_DEBUG=layer VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \
  ctest -V -R '^(agc_driver_graphics|agc_driver_graphics_maps_fallback|agc_metadata_pass|agc_driver_cmask_fast_clear)$'

agc_driver_graphics (which holds metadataPassTests) and its maps_fallback variant decode registers on a CPU-side Graphics::Context, so they create no Vulkan device. I added the two tests that run metadata passes on the GPU: agc_metadata_pass (agc_driver_recorder_tests --metadata-pass-only) and agc_driver_cmask_fast_clear. Validation-layers package: 1.4.363.0.

main d6eafa5 this PR
tests 4/4 pass 4/4 pass
layer loaded (Insert instance layer "VK_LAYER_KHRONOS_validation" and Inserted device layer from the loader) yes, in both GPU tests yes, in both GPU tests
VUID- messages VUID-vkCreateDevice-ppEnabledExtensionNames-01387 ×1 in each GPU test the same, ×1 in each GPU test
new VUID- — none

The one VUID on both sides is at device creation and comes before any of this PR's code runs: ppEnabledExtensionNames[13] Missing extension required to enable device extension VK_KHR_present_mode_fifo_latest_ready: VK_KHR_swapchain. It comes from these tests creating the device without a swapchain. It's pre-existing and unrelated to this change, but I can open a separate issue for it if you want.

Loader and result lines (PR run)
[Vulkan Loader] WARNING | LAYER: env var 'VK_INSTANCE_LAYERS' defined and adding layers "VK_LAYER_KHRONOS_validation"
[Vulkan Loader] INFO | LAYER:   Insert instance layer "VK_LAYER_KHRONOS_validation" (/usr/lib/libVkLayer_khronos_validation.so)
[Vulkan Loader] INFO | LAYER:   Inserted device layer "VK_LAYER_KHRONOS_validation" (/usr/lib/libVkLayer_khronos_validation.so)
Vulkan device: NVIDIA GeForce RTX 4090
Color metadata pass tests passed
CMASK fast clear draw and eliminate tests passed
Graphics validation tests passed
100% tests passed out of 4

2. Game bring-up discussion. There wasn't one for PPSA01748, so I opened it: #9704. The checklist line now links it.

Tested and written by Claude (AI assistant) on a contributor's machine.

@github-actions

github-actions Bot commented Oct 22, 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 1395 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5925 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 6194 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6235 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6280 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6481 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6548 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6804 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6959 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6970 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6977 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7310 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7410 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7642 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 8246 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 8395 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9020 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9193 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9335 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9356 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9387 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9431 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 9432 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 9489 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9508 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9672 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 9673 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 9674 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 9675 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9676 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 9748 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9842 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 9891 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 9892 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 9893 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 9895 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 9897 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10049 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10193 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10249 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
PR 10348 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10435 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10556 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 11551 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 11557 core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp

@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.

Thanks for adding the title's Game bring-up discussion and the focused validation-layer comparison. The new report documents same-machine runs on main and this PR, confirms the requested layer was loaded for both GPU tests, and shows no new VUIDs. The checklist now links PPSA01748 to #9704, whose current blocker section records the remaining AMD/RADV issue separately from this AnyPS5 fix. I independently rechecked the exact head: current-main conventions pass, is clean, and a merge-tree with current main is clean. I did not rerun the AGC binaries locally because this checkout has no configured AGC build and the filesystem is full; I am relying on the clearly attributed contributor-machine results for those runs. I found no remaining blocker in the diff or required validation evidence.

@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.

The requested title tracking and validation evidence are now present. I reviewed the code path and focused test additions, verified conventions, diff cleanliness and current-main mergeability, and found no remaining blocker.

@ycbuzi

ycbuzi commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

A Windows run of this head: Windows 11 Home 10.0.26200, WinLibs GCC 15.2.0 r7 (MinGW-w64 UCRT), Release. 793e51a915 merged onto main 2e773bff38 with no conflicts.

  • The build has no errors. Its two __builtin_memcmp bound warnings (stl_algobase.h:1889) don't come from this PR's files. Rebuilding State.cpp alone gives none, and compiling the merged tests/Graphics.cpp on its own gives none either.
  • agc_driver_graphics passes both runs of ctest --repeat until-fail:2, three times over.
  • Negative control: Graphics/src/State.cpp taken from main, with the test unchanged. It then fails with AGC graphics: CB metadata pass over part of a color target, the refusal from the description.

agc_driver_graphics opens no Vulkan device: none of the three runs logs a Selected GPU line, and none of its sources creates a device. So this is a Windows run of the CPU-side state checks, not a GPU result, even though I ran it with ANYPS5_GPU set to an RTX 4070 SUPER, a GTX 1650 SUPER and a Radeon iGPU in turn.

Not run: agc_driver_graphics_maps_fallback (not registered in this Windows build), Linux, the PPSA01748 run.

This PR and #9604 both change tests/Graphics.cpp; they merge with each other without conflicts.

AI-assisted: yes (Claude Code)

@wachi35676

Copy link
Copy Markdown
Contributor

First AMD run, and first NVIDIA-on-Windows run, of the device metadata-pass tests. Windows 11 10.0.26300, WinLibs GCC 15.2.0, Release, full build; this head 793e51a915 merged onto main f822d74 (clean); ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1; NVIDIA RTX 5070 Ti (621.01) and AMD Radeon RDNA2 iGPU (AMD proprietary 2026.04.17, ANYPS5_GPU=AMD).

  • 45 metadata/CMASK/DCC/FMASK/resolve/graphics entries, including agc_metadata_pass and agc_driver_cmask_fast_clear on the device: 45/45 on both GPUs.
  • Control, with main's State.cpp (shared .prx, so all 45 entries ran on it): only agc_driver_graphics fails on both GPUs, with CB metadata pass over part of a color target.
  • check_conventions.py --base f822d74d42d passes.

AI-assisted: yes (Claude Code); results above were run on this machine.

@oneandonlydean
oneandonlydean merged commit 9260711 into boykopovar:main Oct 27, 2026
15 checks passed
orezraey added a commit to orezraey/AnyPS5 that referenced this pull request Oct 27, 2026
Keep boykopovar#9694's coverage check for targets without CMASK or DCC keys and skip it only for a fast-clear eliminate over a CMASK target without DCC keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants