Skip to content

feat(agc): import uniform multisampled DCC fast clears - #5939

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
Amoenus:codex/msaa-dcc-main5a6
Oct 16, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
Amoenus:codex/msaa-dcc-main5a6

Conversation

@Amoenus

@Amoenus Amoenus commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

What

Import uniform initial DCC fast clears (00/40/80/c0) into native 2×/4×/8× color targets. Supported targets are pipe-aligned, single-layer, level-zero SW_64KB_R_X with supported clear conversion and uniform CMASK states.

Color/DCC/CMASK ranges must remain watched and unchanged. Same-value CPU stores invalidate reuse. Metadata release invalidates reuse while retaining the resident color owner. Unsupported compression, register-clear DCC contents, layouts, transforms, lossy modes, writes and guest publication throw.

Addresses the initial-clear subset of #5336; tracking/coherence work remains in #3036. This rebase retains merged #4767 FMASK decompression and #4820 native color sampling. FMASK decode now carries DCC control to the importer rather than hiding unsupported flags.

Geometry follows pinned AMD Addrlib and pinned PS5 Mesa configuration. Clear conversion reuses DccMetadata/TextureFormat. This is source-backed geometry, not a PS5 console measurement.

Tested

Head 3851b712c, base main 1db84d5748573165ccb241618bf5e1ccd91095c4. One topic commit; the prior published347d and earlier checkpoints are preserved. The rebase corrects the newly added createFilled call to pass created.metadataValid, as the existing acquire call does.

  • Windows11 Enterprise26200, WinLibs GCC15.2.0r7 Release, bundled dependencies/SPIRV-Tools ON: full app/libs, selected fixtures, conventions and test registration pass.
  • Sixteen groups pass once + five repeats per NVIDIA/AMD selector:192 executions, no failures/skips, maximum8.01s. Per-run logs verify the requested vendor for eight runtime groups, including2x/4x/8x DCC and native sampling. agc_multisample_guest_access and agc_metadata_pass ignore the AMD request and select NVIDIA; those two groups are NVIDIA-only evidence. CPU groups are not GPU coverage.
  • Numeric/refusal coverage retains the72 sample/clear/alpha-position/CMASK combinations, pixel/channel/undrawn/scissor checks, eight initial-refusal modes per sample count, same-value stores, unwatch and metadata release/recreation, and existing non-DCC FMASK materialization/reuse.
  • Ubuntu24.04 WSL2/GCC13.3/lavapipe (llvmpipe LLVM20.1.2): all four fixture executables build; five supported groups pass once + five repeats, maximum3.44s. The once-only seven-group selection explicitly skips2x/8x attachments unsupported by this software device. No full Linux app/suite claim.
  • Before the one-line correction, the rebased source reproduces the reported guard argument-count error with the recorded Windows compiler command; the same command passes afterward. This is a PR compatibility correction, not a main-branch defect.
  • All four changed C++ translation units parse under clang-tidy23.1.3 with zero selected findings. Cppcheck2.20 reports one recorder/batch branch warning discharged by the construction invariant, plus three copy-cost advisories in existing fixture lambdas; no source changes made for those advisories.

Historical main8f51 test-only red controls and the225-case x5 PAL geometry/configuration controls retain their original pins; they were not rerun on this base. The current runs above exercise the unchanged numeric/refusal tests. The later main a08de6827f217115078660b9f47201edae59668b merge check is clean; that merged composition is untested. Each selected CTest has a30s bound. Full upstream CI requires maintainer dispatch.

Sonic Unleashed Recompiled PPSA99902, 01.003.000 stops during descriptor decoding on main:

AGC graphics: DCC over a multisampled color target is unsupported

The fresh original-input replay of earlier tested capability8d375dd9d advances past that stop and reaches initial multisampled DCC contents require watched guest memory after29.343s (0xC0000409,no timeout). Exact126-module profile, loader5/5; originals/runtime/guest libc/user data restored and hash-verified, cleanup errors empty. No retained integration/dependent depth patches. This is not a title replay of3851b712c, proof of the game's clear codes, gameplay or FPS evidence. Bring-up#4443 retains the separate integration frontier.

Independent Linux title checks

milescoviello's latest comparison uses main 5d9dcc42d, Linux/RTX 4070 Ti/NVIDIA 595.99, scripted pad input and two runs per title/build with a 60-second limit. With this head 3851b712c, Rush 2 (PPSA69423) reaches the CMASK/register-clear refusal once and the resident-write refusal once; Wave Race 64 (PPSA69424) reaches the CMASK refusal twice. Adding existing #6543 at 2fc4fe5e0 makes both titles reach the resident-target/metadata-write refusal 2/2. Adding #6669 as well produces the same stop. These are external runs, not local title validation.

The dispatch/write-tracking correction offered earlier is already #6543; no duplicate follow-up is needed. #6669 handles the other CMASK state exposed in Ruffle (PPSA68091), as the reviewer reports there. The #6669 overlap is now resolved and independently component-tested in composition 13ed9df on main 5d9dcc42d (+ #6452 for Windows tests), retaining both this PR's DCC exclusion/metadata guard and #6669's raw CMASK reader. Full Windows build/checks and 70 component processes pass; selected Linux tests and an additional classifier test also pass. The central report records exact pins, test counts, GPU identities and limitations. These component results do not reproduce the external title runs. This PR's production dependency remains unchanged; these are related follow-ups and workload interactions.

The reviewer also corrected the earlier same-target claim: the accepted/refused imports concerned different targets. The queued-fill observations do not establish invalid title metadata or justify admitting zero CMASK. The earlier MGS4 launcher-manual result still ends at the CMASK/register-clear refusal; no revised MGS4 result is available. Initial uniform clears remain this PR's scope; resident-target writes and successful gameplay remain unimplemented/unverified respectively.

Separate resident-range diagnostic proposal: fork 99a159a16, based on main5d + this PR, preserves the refusals and identifies the affected color/DCC/CMASK range and sample count. Maintained validation report: full Windows build, both physical GPUs, pre-diagnostic control/restoration and selected Linux tests. This is a fork proposal, not a change to this PR's published head or a repeated-clear implementation. No new title run or first-writer attribution.

Checklist

  • Based on recent main (standalone tested1db; main5d combination tested separately above); 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; remaining limitations are in libSceAgcDriver technical debt
  • No notes, investigation files, images or generated reports added to the repository
  • New third-party code is a submodule built from source: n/a, none added
  • Generic behaviour, not specific to one title
  • Depends on: none (fix(agc): handle FMASK decompress on MSAA targets #4767/feat(agc): sample a multisampled color target through its 2D MSAA texture #4820 merged)
  • Unblocks: PPSA99902 Sonic Unleashed Recompiled#4443 — initial DCC decoding stop; title scope remains conditional
  • GPUs tested: NVIDIA GeForce RTX5080 (10de:2c02),610.62/32.0.16.1062,Windows11 Enterprise26200; AMD Radeon(TM) Graphics (1002:13c0),32.0.21036.18,same OS; Mesa lavapipe/llvmpipe (LLVM20.1.2,256bits),Mesa25.2.8-0ubuntu0.24.04.4,Ubuntu24.04 WSL2. Per-fixture Windows coverage is described above.
  • AI-assisted: yes, Codex; author responsible for the change

@github-actions

github-actions Bot commented Oct 14, 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 5915 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp L3128
PR 6535 core/libs/prx/libSceAgcDriver/CMakeLists.txt L1419
PR 6628 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp L347, L351, L367
PR 6635 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp L298
PR 6669 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp L397-398

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 1341 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 1896 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4048 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4339 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 4650 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 4891 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5390 docs/dev/debt/libSceAgcDriver.md
PR 5426 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5431 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5441 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5480 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 5500 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5761 docs/dev/debt/libSceAgcDriver.md
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 5987 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6222 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6235 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6252 docs/dev/debt/libSceAgcDriver.md
PR 6259 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6297 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6373 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 6503 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6548 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6553 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
PR 6612 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6718 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6762 core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6763 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md

@milescoviello

Copy link
Copy Markdown
Contributor

Merged onto current main d92a8da (no textual conflict), this head 347d11b93 no longer compiles on Linux (GCC 13.3, Release):

core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp:396:10: error: too few arguments to function 'void AgcDriver::Graphics::{anonymous}::guard(const Context&, const ColorTarget&, const std::shared_ptr<std::atomic<bool>>&, const std::shared_ptr<std::atomic<bool>>&)'

The three-argument call at line 396 came in on main with 03e6cbf ("pass the created target's active flag to guard after the merge with main"), after this PR's base 8f51d3b; this PR gives guard the extra metadataValid parameter.

Two titles stop on main d92a8da at the check this PR targets, AGC graphics: DCC over a multisampled color target is unsupported (Linux, RTX 4070 Ti, NVIDIA 595.99):

I can run both on a rebased head.

AI-assisted: yes

@Amoenus
Amoenus force-pushed the codex/msaa-dcc-main5a6 branch from 347d11b to 3851b71 Compare October 15, 2026 10:03
@Amoenus

Amoenus commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

@milescoviello Fixed and rebased in 3851b712c: createFilled now passes the target's metadataValid flag to guard.

I reproduced the compiler error before that correction. The updated head passes the full Windows build and selected NVIDIA/AMD tests; Ubuntu24.04/GCC13.3 builds all four fixture executables and passes the five supported lavapipe groups once plus five repeats. The description has exact pins, hardware limits and the2x/8x software-device skips.

Could you retest Rush2 and the MGS4 manual at this head? I have not independently run those titles. AI-assisted: Codex.

@milescoviello

Copy link
Copy Markdown
Contributor

Thanks for the quick fix. 3851b712c merged onto main a08de68 builds on Linux (GCC 13.3, Release). Same setup as before (RTX 4070 Ti, NVIDIA 595.99, pad input):

Title main 0afa6a6 with this head
Rush 2 Recompiled (PPSA69423) 2 of 2 stop at 1 s: DCC over a multisampled color target is unsupported 2 of 2 stop at 1 s, one with writes to a resident multisampled DCC target or its metadata are not implemented, one with multisampled DCC CMASK compression or register clear is not implemented
MGS4 (PPSA18194), launcher's Online Manual 3 of 3 stop at 45-46 s: DCC over a multisampled color target is unsupported 2 of 2 stop at 45 s: multisampled DCC CMASK compression or register clear is not implemented

So both titles get past the check on main and then reach this PR's own unimplemented paths: CMASK compression or a register clear in both, and in Rush 2 also a write to a resident multisampled DCC target. Happy to rerun them on a later head.

AI-assisted: yes

@Amoenus

Amoenus commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

@milescoviello Thanks for the scalar measurements. They distinguish two states that the combined refusal message did not.

I checked Mesa's pinned CMASK definitions: the zero MSAA CMASK code denotes a register color clear plus FMASK clear, and is marked illegal with DCC. I am retaining the Rush 2 refusal rather than admitting that combination solely because both snapshots are uniform. This does not prove the title submitted invalid metadata; an earlier missing operation or ordering discrepancy could still produce the observed state.

For MGS4, cmaskFastClear=0 alone does not establish that CMASK is unused: CMASK also describes FMASK compression. At this PR's head, DecodeColorBuffer populates the CMASK range for multisampling when CB_COLOR_INFO.COMPRESSION (bit 14) is set, independently of FAST_CLEAR (bit 13). Mixed bytes therefore do not, by themselves, establish uninitialised memory or justify ignoring the range. Whether uniform numeric DCC clears make that mapping irrelevant still needs source or hardware evidence.

If your captured scalar state includes the complete CB_COLOR_INFO value, FMASK-address-present boolean and FMASK swizzle, those would help distinguish the remaining mode without sharing raw addresses. No capability change is selected from the combined error or uniformity alone. AI-assisted: Codex.

@milescoviello

Copy link
Copy Markdown
Contributor

They didn't, so I captured them. This is a throwaway print at the top of MultisampledDccClear, before the CMASK check, on 3851b712c merged onto main f633042 (Linux, RTX 4070 Ti). Two runs per title, and the values repeat:

Call samples extent VkFormat element cmaskFastClear CMASK bytes / first / uniform DCC bytes / first / uniform dccControl Result
Rush 2 (PPSA69423), 1st 2 320x241 37 4 1 4096 / 0xcc / yes 4096 / 0x40 / yes 0x100038 accepted
Rush 2 (PPSA69423), 2nd 2 320x241 37 4 1 4096 / 0x00 / yes 4096 / 0x00 / yes 0x100038 refused
MGS4 (PPSA18194) manual 2 1920x1080 37 4 0 24576 / 0xaf, then 0x06 / no 81920 / 0x00 / yes 0x48 refused
  • Rush 2 is refused on a uniform 0x00 CMASK with fast clear enabled, with a uniform 0x00 DCC. The call before it, on the same target, has 0xcc / 0x40 and passes.
  • The MGS4 manual's target has cmaskFastClear 0, and its CMASK is mixed, with a first byte that changes between runs. That reads like CMASK memory nothing initialised (inferred). Its DCC is a uniform 0x00.

AI-assisted: yes

@milescoviello

Copy link
Copy Markdown
Contributor

A correction and the values you asked for. In my last comment I wrote that Rush 2's accepted call and its refused call are on the same target. That's wrong. They are two different targets, with their own CMASK and DCC. Wave Race 64 Recompiled (PPSA69424, 00.001.000), new in the catalog, behaves the same: on main 5d9dcc4 it stops at 1 s on DCC over a multisampled color target is unsupported, and with 3851b712c merged onto 5d9dcc4 it stops at 2 s on the CMASK refusal.

Registers. These come from a throwaway print in DecodeColorBuffer that logs each distinct multisampled DCC state. Both titles print one state, used by all three of their multisampled targets:

Field Value
CB_COLOR_INFO 0x1802e028
CB_COLOR_ATTRIB 0x00009000 (2 samples, 2 fragments)
CB_COLOR_ATTRIB3 0x4dc6c000 (FMASK_SW_MODE 24, CMASK and DCC pipe-aligned)
FMASK address present yes
CB_COLOR_CLEAR_WORD0/1 0 / 0
CB_COLOR_DCC_CONTROL 0x00100038

Where the zeros come from. APS5_TRACE_DISPATCH_IO=2 shows each target being cleared the same way in both titles, with one compute shader that takes an address, a size and a 32-bit pattern in its user data. The dispatches are decoded on a different thread from the draw's import:

  1. CMASK 0xdddddddd
  2. FMASK 0x02020202
  3. DCC 0x00000000
  4. CMASK 0xcccccccc
  5. DCC 0x40404040

For the refused target all five dispatches are logged before the draw thread's import. The import still reads 0x00 in both CMASK and DCC, so none of them had landed yet. Recorder::PendingWriteOverlaps reports nothing for those ranges, I think because the shader is address-based and its writes reach guest memory at the batch's write-back. After a full recorder->Sync() the same read returns 0x40.

With a sync at the top of the import, ahead of the generation collect:

         if (use.cmaskAddress != 0) dccRanges.push_back({use.cmaskAddress, use.cmaskBytes, 0});
+        if (auto* recorder = Recorder::Active(); recorder != nullptr) {
+            Recorder::CountSync(1);
+            recorder->Sync();
+        }
         for (auto& range : dccRanges) {

all three targets import with CMASK 0xcc and DCC 0x40, in both titles. Both then stop at 2 s on writes to a resident multisampled DCC target or its metadata are not implemented. They run the same five fills again on a target that is already resident, which your checkDccCurrent refuses. So with the read ordered, neither title reaches the zero CMASK / DCC state on these targets. I haven't checked whether a full sync is the right granularity, or how the MGS4 manual's mixed CMASK was produced.

Linux (Ubuntu 24.04, GCC 13.3, Release), RTX 4070 Ti, NVIDIA 595.99. Two runs of each title per build, same results.

AI-assisted: yes

@milescoviello

Copy link
Copy Markdown
Contributor

A follow-up on the ordering, plus an offer.

The clear dispatches in Rush 2 and Wave Race 64 run the same 11-word compute kernel, and so do Ruffle's (PPSA68091) CMASK/FMASK/DCC clears. Its user data is 0, 0, address low, address high, last offset, pattern. Each of the 64 threads of a group stores the 16-byte pattern with global_store_dwordx4 at address + min(16 * thread, last offset):

d7460000 04010c06 7e080205 7e0a0205 7e0c0205 7e0e0205 34000084 26000004 dc788000 00020400 bf810000

Because the stores are address-based, the recorder notes no pending write for them, so a CPU-side read of that memory doesn't wait for them. I matched the kernel into fillBuffer as one more DwordPatternFill, next to MatchConstantDwordFill. With that on 3851b712c + main 5d9dcc4, and without the sync I suggested above, both titles import all three targets as 0xcc / 0x40 and stop at 2 s on writes to a resident multisampled DCC target or its metadata are not implemented, the same as with the sync.

On main alone the same match changes Ruffle. Its target's CMASK seed now sees the pending 0xcc fill, and Ruffle stops at 11 s on the CMASK 0x4004600000 of a multisampled color target reads as mixed, which is not modeled. On main 5d9dcc4 it runs (0 of 6 runs today stopped) because the seed read normally lands before the fill and sees zeros. Older main builds stopped there in 2 of my 6 sweep runs, presumably when the fill won the race. So the HLE needs the 0xcc CMASK state modeled first, and your branch does that for DCC targets.

I haven't opened it as a PR because of that. Would you rather I open it after #5939 lands, or carry it in here? The match and its test (AddressPatternFill.cpp: the matcher's cases, and the fill followed by a CP DMA copy of the range through the submit path) are on a local branch. I can push it to my fork if you want to look.

Linux, RTX 4070 Ti, NVIDIA 595.99.

AI-assisted: yes

@Amoenus

Amoenus commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor Author

@milescoviello The range diagnostic is now proposed upstream in #6869, explicitly depending on #5939. Its own two-file change (+30/-3) is pushed on codex/fix-msaa-dcc-range-diagnostic-main896. The composition includes main 896e1b2b7 and exact parent 3851b712c; the parent PR's head stays unchanged. After the parent lands, the follow-up can be reduced to its own commit.

The existing refusal prefixes and predicates remain. Details identify the color/DCC/CMASK plane, address, byte count and sample count; they do not identify the writer or implement resident writes.

Fresh application/library (relinker, libs) builds pass on Windows 11/GCC 15.2r7 and Ubuntu 24.04 WSL2/GCC 13.3. Linux selected targets build; DCC state and llvmpipe 4x clear each pass 3/3 (six processes, max 0.40 s), with actual runtime device identity verified and no selected omissions/skips/timeouts. Software 2x/8x are unavailable and excluded. Conventions and registration pass.

The complete source tree differs from the tested/analyzed fa1161690 only in Linux executable runtime linkage and CI configuration, so unchanged Windows GPU and static-analysis evidence is retained at that pin below. The Linux checks were repeated because the linkage change can affect exception handling. This is not a new full-suite, title-run, writer-attribution or resident-publication claim. If you retest the parent on Rush 2/Wave Race with the diagnostic, please retain the full refusal text. AI-assisted: Codex.

Earlier main82 and main5d validation, negative controls and full-build evidence

@milescoviello Refreshed the diagnostic on clean main82ddae75b plus exact #5939 head3851b712c: focused changefa1161690, fork branchcodex/fix-msaa-dcc-range-diagnostic-main82. It remains two files,+30/-3 relative to that dependency composition. Both complete files are byte-identical to the original99a159a16 proposal.

It keeps every existing refusal condition and adds the affected color/DCC/CMASK plane, address, byte count and sample count to reuse errors. It does not identify the writer or enable resident writes.

  • Windows11 Enterprise26200 / GCC15.2r7: selected targets and required libraries build; state test3/3, each2x/4x/8x clear group3/3 on each physical RTX5080 (610.62/32.0.16.1062) and AMD Radeon Graphics (32.0.21036.18):21 passes.
  • Ubuntu24.04/WSL2 / GCC13.3 / Mesa25.2.8 llvmpipe: selected targets build; state3/3,4x clear3/3, then restored4x clear3/3:9 passes. Known-unavailable2x/8x software cases are not claimed.
  • One Linux control keeps the new tests but restores the exact parent production file: the new range-detail assertion fails as expected. Restoring the proposed source and rebuilding passes3/3. Original refusal behavior stays intact.
  • Actual runtime device identity checked in every clear process. Maximum1.11s; no selected skips/timeouts/internal omissions. Project shader cache disabled; driver caches uncontrolled. Conventions/registration pass. Cppcheck2.20 then clang-tidy23.1.3 complete in33.97s analyzer time, without parser errors/timeouts. Clang-tidy has no selected findings. Cppcheck reports the unchanged recorder/batch warning; the recorder-null branch constructs the batch before Handle(). Reviewed without suppressions or unrelated rewrites.

This prepares the focused follow-up for #5939's merge. Its combined CI failure is the independently confirmed #6792 CPU fixture, addressed by #6789. No fresh title run, writer attribution, raw console measurement or current full-app claim follows from this selected campaign. AI-assisted: Codex.

Earlier diagnostic, ordering and full-build/control evidence at original pins

@milescoviello The #5939/#6543/#6669 combination is independently component-tested; the central report on #6669 records its one conflict resolution and 70 passing Windows processes. Your title comparisons remain external evidence; I have not reproduced those title runs.

A focused diagnostic for the remaining refusal: 99a159a16 is a 30-line addition/three-line replacement on main 5d9dcc42d plus #5939 head 3851b712c. It retains all refusal conditions and appends the affected color/DCC/CMASK plane, address, byte count and sample count to the watched-memory, changed-generation and pending-write errors. It formats the details only on failure. The existing fixture now asserts exact range details for color/DCC/CMASK writes and an unwatched DCC range.

Validation:

  • Full Windows application/libs build and conventions pass at 3a6a580e3, which adds only test(agc): align the indirect arguments block at run time #6452 for Windows test-build alignment. Ten CPU/mock processes and 60 runtime processes pass (six groups x five repetitions per GPU); every runtime group verifies the selected physical device. Maximum 11.15 seconds, including the CPU groups.
  • Control 3aabd9e22 keeps the new tests but restores the exact pre-diagnostic production file: the new diagnostic assertion fails 5/5 per GPU. Restoring the positive composition passes all three clear groups 5/5 per GPU, another 30 processes. This control is main5d + feat(agc): import uniform multisampled DCC fast clears #5939 + the Windows build correction, not unmodified main.
  • Ubuntu 24.04/WSL2, GCC 13.3, Mesa 25.2.8 llvmpipe: selected targets build at 99a159a16 without test(agc): align the indirect arguments block at run time #6452; graphics, msaa_dcc_state and msaa_dcc_clear_4 each pass five repetitions, 15 processes, maximum 3.59 seconds. No whole-test skips or full Linux app claim.
  • Cppcheck 2.20.0 then clang-tidy 23.1.3 complete in 20.06 seconds without parser failures/timeouts. Clang-tidy has no selected findings. Cppcheck reports the unchanged recorder/batch warning; the recorder-null branch constructs the batch before dereference. No suppressions or unrelated rewrites.

Physical GPUs: RTX 5080 (10de:2c02, driver 610.62) and AMD Radeon(TM) Graphics (1002:13c0, driver 32.0.21036.18), Windows 11 Enterprise 10.0.26200. Project shader cache disabled; driver caches uncontrolled.

I excluded a separate repeated-clear fixture attempt: creating its private metadata GPU import loses the watched-memory prerequisite, including when done before the initial target snapshot. That arrangement does not isolate the intended metadata-transition gap and does not identify a title writer. No production guard was relaxed, and no new capability fix is claimed.

The diagnostic is available on our fork for a future Rush 2/Wave Race retest; please include the full refusal if you use it. Resident writes remain unsupported. #6543 already covers the dispatch correction; no duplicate PR is needed for it. AI-assisted: Codex.

@milescoviello

milescoviello commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Thanks @Amoenus, and thanks for the credit. The dispatch part of my branch turned out to be the same change as #6543 (karanvora2599: RADV's fill-memory kernel as a buffer fill), which was already open when I found it. So I'd rather not open a second PR for it, and #6543 is the follow-up I'd point review at.

I ran it with this PR on main 5d9dcc4 instead, 60 s with scripted pad input, two runs each:

Build Rush 2 (PPSA69423) Wave Race 64 (PPSA69424)
#5939 3851b71 1 of 2 multisampled DCC CMASK compression or register clear is not implemented, 1 of 2 writes to a resident multisampled DCC target or its metadata are not implemented 2 of 2 the CMASK one
+ #6543 2fc4fe5 2 of 2 the resident-write one 2 of 2 the resident-write one
+ #6543 + #6669 2 of 2 the resident-write one 2 of 2 the resident-write one

With #6543, both titles reach the resident-write stop every time. That fits the fills being ordered before the import, as with the full sync I tried earlier. Without it, which stop you get depends on that race. On Ruffle (PPSA68091), #6543 makes the race go the other way: it then stops on the CMASK ... reads as mixed, which #6669 handles (numbers there). #6669 doesn't change these two titles. #5939 and #6543 merge cleanly. #6669 conflicts with #5939 on the CMASK seed line, and keeping both conditions resolves it.

AI-assisted: yes

@adriadam10

Copy link
Copy Markdown
Collaborator

Checked on Linux (GCC, merged onto current main): agc_driver_msaa_dcc_state, agc_driver_msaa_dcc_clear_{2,4,8} and the existing alpha-to-coverage tests pass; with MultisampleTarget.cpp/State.cpp reverted to main the four new tests fail. Unsupported DCC/CMASK states throw and the TechnicalDebt entry matches the code. Merging once the full Build is green.

@Amoenus

Amoenus commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor Author

@adriadam10 The previously observed Linux fixture blocker is now resolved on main. Main 66e290f1c includes #6889, whose sole patch is identical to #6789's already validated storage correction.

On plain main66, Ubuntu24.04 WSL2 / GCC13.3 / Release, the real CPU graphics target builds and agc_driver_graphics passes3/3 fresh processes (maximum3.29s); the journal control passes1/1 (0.02s). The two unavailable heap-mirror checks per graphics process remain excluded. #6792 is being closed for this observed failure. No GPU, title or DCC runtime claim follows from these CPU/mock checks.

This removes the specific failure seen in the earlier seven-PR Build below. A fresh maintainer-triggered combined Build for #5939 on updated main is still needed before calling the PR's full CI green. The separate main66 Build does not include #5939. This report does not replace either CI result; no upstream merge or workflow dispatch was performed.

Latest plain-main CI: main93 Build38941524429 has successful Windows and Linux jobs. The Windows log reports zero failures among1321 CTest results, including agc_shader_helpers (0.04s) and agc_driver_pm4_ring_invalid (0.03s). Skipped tests are excluded from coverage. In particular, Windows configures only three real AGC execution fixtures and compiles ExecutionTestNotBuilt.cpp for the others; this is not a full AGC execution-fixture build/run. This plain-main result excludes #5939. A fresh maintainer-triggered combined Build remains needed; it must disclose the selected fixtures. The single passing main run does not resolve #6791's intermittent hang.

Earlier main66 CI follow-up: the Linux job passes. The completed Windows job also passes agc_driver_graphics (7.89s), then has one separate failure among1321 results: agc_driver_pm4_ring_invalid prints its success message but times out at30.01s. This matching post-success timeout is reported on existing #6791; its lock/root cause is unconfirmed. This is plain-main CI, not a combined #5939 result.

Earlier combined Build38901085129, before the main66 correction

@adriadam10 The combined Build38901085129 has finished. Windows passes. Linux builds the application and libraries, then fails only agc_driver_graphics (1302 tests total). This PR's DCC state and4x clear groups pass; the2x/8x clear groups skip and are excluded from coverage.

The failing serialized request is vertex stage, address0x10000,12 zero words, matching #6792. Its decoded payload is byte-identical to our main control. Existing #6789 corrects that CPU fixture's storage; our independent review records exact-head Linux3/3 passes against main3/3 failures. This CI failure is not evidence against the DCC change. For the next combined run, including #6789 or merging it first should address this observed failure.

This was a seven-PR composition on main82ddae75b, including exact #5939 head3851b712c, rather than a standalone #5939 run. AI-assisted: Codex; CI logs inspected, no merge/workflow action performed.

AI-assisted: Codex; fresh CPU checks run locally.

@adriadam10

Copy link
Copy Markdown
Collaborator

Re-checked on Linux (GCC, merged onto current main): agc_driver_msaa_dcc_state, agc_driver_msaa_dcc_clear_{2,4,8}, agc_driver_graphics and the alpha-to-coverage tests pass; without the change the new tests do not build. Unsupported DCC/CMASK states throw and the TechnicalDebt entry matches the code. Merging once the full Build is green.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 16, 2026
@adriadam10

Copy link
Copy Markdown
Collaborator

Rebased onto current main (conflict with #5881 in MultisampleTarget.cpp: the target initialisation now uses recordToGeneral from main and clears with the PR's initial DCC value). Built and ran the libSceAgcDriver tests on the rebased tree: agc_driver_msaa_dcc_state, agc_driver_msaa_dcc_clear_{2,4,8}, agc_driver_graphics and the alpha-to-coverage tests pass; the only failure is agc_driver_tessellation (segfault), which also fails on unrelated PRs. Merging once the full Build is green.

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.

3 participants