Shader: compressed FMASK/CMASK image reads remain unsupported (PPSA99902) #3219
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-11T01:54:17Z.
PR coverage and remaining scope - 1 November 2026
Already merged: #6674 fixes the original constant-result bug for supported uncompressed FMASK; #8429 extends uncompressed reads to storage widths/sample modes up to8 samples; our #7948 provides the expanded FMASK view for an exact tracked eight-fragment native color owner.
Open narrower extension: #10233 adds the corresponding compressed native-owner path for two-sample targets. It does not implement general standalone guest FMASK/CMASK metadata decoding. The older metadata-snapshot proposal #4790 is closed and unmerged; it is historical reference, not a pending merge candidate.
Remaining gap: compressed FMASK without a matching resident native target still throws on source-checked main
26fa1212b82f. General standalone compressed decoding/publication remains unsupported; the exact native-owner limitations are recorded in debt. No currently verified PR resolves that complete remaining scope.The lack of a closing PR does not mean this issue received no implementation work. Keep open for the remaining compressed paths. Later Sonic observations in #3036/#4443 are composed-fork results and do not demonstrate that this whole capability is supported on main. This is a PR/source status audit, not a new GPU or title run. AI-assisted: yes (Codex).
Focused native-owner candidate — final qualification, 2026-10-19 UTC: a69c022c3a, one commit on main
88a6b34bc5, is pushed to our fork. Full Windows default and explicit libraries/relinker builds pass. Three fresh native-FMASK processes per actual GPU pass, including direct/registered/prepared dispatches, repeated lookup, recipe exclusion, descriptor mismatches, native sample/guest metadata preservation and same-value FMASK-store refusal, including previously prepared work.Final matrix: 36 passes (27 verified GPU, 9 CPU), plus nine unchanged AMD DCC-clear baseline assertions (#7936). GPU runs require Vulkan, disable application shader caching, load Khronos validation and retain verbose output; zero VUID/errors/warnings. The fixture-only control leaves main
7b18fa8d5dproduction unchanged and refuses the capability in all six processes. Controls remain at their actual pins; older extra regression runs are not claimed as current-main comparisons. Candidate regressions cover raw FMASK, native sample reads, all three DCC sizes, graphics/descriptor decoding, shader memory and request serialization.Cppcheck then clang-tidy cover all seven changed C++ units: no parse/configuration failures or clang-tidy diagnostics. Three Cppcheck findings were inspected: existing conditional batch flow, a throwing-Require allocation-check false positive and an unchanged pass-by-value suggestion. Conventions pass. Executable-code insertion conflicts reported by the overlap tool were removed; nearby debt text and stale shared-file comparisons were reviewed separately. Attribution to #4790 is retained; standalone compressed decoding/publication remains unsupported, so the general gap stays open.
Publication: native-owner-only PR #7948 is now open at this qualified fork commit; the same creation request succeeded after a short wait. There is no new unchanged-PR-head game-run claim. Main subsequently reached
c017549dc1(host-import eviction bookkeeping); a clean merge was checked, but these results remain pinned to the tested head/base. Earlier Sonic menu/movie/loading evidence is a separate integration result, with its Mesh-preparation stop and guest-wait symptoms retained. AI-assisted: yes (Codex).Native-owner-only extraction is now complete and qualified on the fork; see the maintained control/candidate block above and central title record. The earlier integration retains separately attributed standalone decoder work and reaches Sonic menu/movie/loading before a distinct Mesh-preparation stop. That historical result is not a current candidate title-run claim. General compressed FMASK decoding and console equivalence remain open.
Current remaining gap (2026-10-19 UTC)
Merged #6674 fixes the synthetic constant for supported uncompressed FMASK reads and adds the missing refusal for compression. Compressed FMASK/CMASK reads remain unimplemented, so this issue stays open for that part; the original fixed-result observations below are historical.
Fresh ordinary Sonic Unleashed Recompiled PPSA99902 / 01.003.000 startup now reaches the refusal with unmodified mainb7a75819f3 runtime libraries from a separate clean source/build:
22.334s, natural0xC0000409; Sonic Team/Hedgehog Engine logos and a final black capture, no menu/gameplay. RTX5080/driver610.62, Windows11 Enterprise26200, Khronos1.4.363. This retains thea515 converted app/guestlibc and original assets/configs; not a fresh main conversion. All127 archived libraries match the main build;145 prior files restored;562 expected hashes verified. Main also logs10mip-chain validation errors (
VUID-VkImageCreateInfo-mipLevels-00958) and10fragment-output warnings: this is not validation-clean. The composed115d/mainb7 run separately reaches the same refusal at NOW LOADING after30.448s with0VUID/errors/warnings. No timings are treated as a speed comparison.Full current observations, log hashes and test pins are maintained in7260. Existing closed #4790 contains the earlier metadata-aware subset; its maintainer requested a title/log before reopening. The author is being contacted with this evidence, preserving the original work rather than opening a duplicate. This does not validate the old PR on current main or establish its title effect, hardware semantics or performance.
The current materializer refusal is deliberate. Any follow-up needs supported metadata interpretation backed by the pinned PAL/Mesa references and hardware evidence, exact-main/control tests and title replay; removing the throw or restoring a constant is not a fix. Mainc82ffb0f20 arrived after the frozen tests and does not edit this materializer; no c82 runtime result is claimed.
AI-assisted validation/report: yes, Codex.
Historical analysis and conditional observations, retained at their original source pins
Source-defined correctness gap
A direct FMASK image read currently emits a fixed identity sample mapping even when its CMASK metadata describes a DCC fast-clear state. The metadata should be modeled, or the unsupported state should throw.
Confirmed by source inspection on current upstream
d31b57a4cae47a966b74cde9a83b692261df8930:0x76543210,0xfedcba98, zero, zero for a 32-bit image read.AMD PAL
c5e800072a32f68b6ccc4422936d96167c6e0728Gfx9Cmask::FastClearValueDcc defines CMASK0xCCfor a DCC fast-clear state with zero FMASK pointers across the tile. GFX10 FMASK SRD construction supplies CMASK as the metadata of a compressed, shader-readable FMASK view.Conditional startup evidence
PPSA99902, Windows 11 / RTX 5080. Runtime used local diagnostic stack
27dd8c5cbased on upstream2a38c0bd, with raw graphics and local library fixes. Currentd31b57a4was inspected statically; stock current-main startup was not tested.Two uncached runs captured the matching FMASK/MSAA shader descriptors before binding. The subsequent refused sampler descriptor was correlated with that snapshot:
0x76543210.0xCC.This CMASK state differs from PAL's eight-sample/eight-fragment initialization value,
0xFF. Identity bytes in raw FMASK alone therefore do not establish the logical sampled mapping.Both runs stopped at the unchanged compressed-MSAA binding refusal tracked in #3036 (28.855 / 28.707 s). The affected shader did not execute. Hardware FMASK image-load outputs and a gameplay effect are unmeasured. CMASK geometry follows the existing GFX10 non-RB+ 16-pipe source assumption; the console configuration and complete DCC extent remain unknown. Private descriptors, addresses, shaders and captures are retained locally.
Validation and coverage
Temporary diagnostics were removed byte-for-byte. Full 120-library and 71 selected-target rebuilds completed; 79 test groups x five cold repeats = 395 passes, zero skips, maximum 4.17 s, Vulkan/all-MSAA cases required on RTX 5080. Two unchanged PAL initial/expanded-pattern functions also passed 135 source-only checks; a changed pattern was detected. These checks are not hardware FMASK decoding validation.
Suggested behavioral coverage: identity raw FMASK plus CMASK
0xCC; transition from0xFFto0xCCat unchanged addresses; mixed tiles and metadata-write invalidation. Handle supported metadata states from exact sources/hardware evidence and throw for cases whose semantics remain unknown.The reviewed issue search found #3036 for descriptor shape/binding and #2755 for AMD pipeline-LTO tests. #2470 models single-sample color-target CMASK clears; #419 explicitly leaves guest FMASK unread/unwritten; #2258 covers compilation. No matching FMASK/CMASK read fix was established in this bounded review, which does not exhaust all forks.
AI-assisted investigation and diagnostic harness. No PR accompanies this report.
Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-11T02:07:27Z.
Isolated native FMASK reproducer
A synthetic compute shader now reproduces this independently of the title's compressed-color sampler. It uses ordinary
IMAGE_LOAD(f0001f08 00020602) and stores all four result words for 32 lanes. FMASK format is 166 (32-bit, eight samples/eight fragments), 128x64, 2D/Z_64KB_X, identity swizzle. FMASK and CMASK allocations retain the same addresses across cases; no game code/data is included.Observed first result word:
76543210FF, enabled7654321076543210CC, enabled7654321000000000765432101111111176543210111111007654321076543210FF, enabled76543210The remaining FMASK result words are always
fedcba98,0,0. Ordinary R32_UINT controls at the same data address correctly read two different values before and after these cases, so the fixture verifies real memory reads and result stores.The expected sample mapping comes from exact reference source: PAL's CMASK CC definition, Mesa's CMASK/FMASK codes and uncompressed-versus-expanded distinction, and logical-to-physical sample extraction. The correctness modes compare only the first result word; unspecified remaining-channel behavior is not asserted.
Windows 11 / RTX 5080 / GCC 15.2: five repetitions yielded 5,120 successful observation comparisons, 20 expected correctness failures (four contracts x five), and five caught deliberately wrong ordinary-texture controls. Longest process was 0.262 s; Vulkan required, shader cache disabled,
request.useCache=false. The observation mode records the bug; it is not a passing correctness test.Runtime is the local experimental stack at
27dd8c5cd70a25c2bba781c2bddf6150732a00d3, based on2a38c0bd. Current main6040a9626e6f5c6bac7ffac2085c0a07994d8b45was reviewed statically: emitter/materializer are identical after newline normalization; binding differs only in multisampled image dimensions, which this 2D FMASK fixture does not exercise. Current main was not runtime rebuilt. This measures AnyPS5's generated Vulkan shader, not PS5/AMD hardware FMASK semantics or game rendering.No production edits, guard bypass, PR or push. Source is clean and the 123 baseline runtime files, guest module and original eboot were rehashed. AI-assisted investigation.
Standalone synthetic probe
Save as
FmaskRuntimeProbe.cppoutside the repository. Compile with the existingagc_driver_runtime_images_teststarget's include/link flags (the probe uses its existing Vulkan test helper). The tested Windows invocation is below the source.Windows command, from a configured repository with the full
build-reviewlibraries already built and the supported Winlibs toolchain on PATH:Observation exits 0; each source-contract mode and the negative control exits 1 on the tested stack. These expected failures should become passing behavioral coverage when the general FMASK implementation is added. Linux/lavapipe was not tested.
Follow-up: source-derived CMASK addressing validated
For pipe-aligned
SW_64KB_Z_X, GFX10 non-RB+ with 16 pipes and 256-byte interleave, PAL's unchanged CMASK address implementation gives the same x/y equation for all 13 FMASK sample/fragment formats. Array layers add nibble XOR((z & 8) << 6) | ((z & 4) << 8) | ((z & 2) << 10) | ((z & 1) << 12); pipe XOR adds(pipeXor & 15) << 9in nibble units, wherepipeXoris in 256-byte units. The slice stride remains twice the CMASK slice byte size in nibble units.Local addressing helpers matched that reference across 171,012,400 coordinate comparisons, including selected boundary coordinates for every layer through 8191 and all 256 pipe/bank XOR unit values. Invalid inputs were rejected; three mutated addressing variants were caught. This is source comparison for the specified configuration, not a console measurement or coverage of other GPU configurations.
On the Windows/RTX 5080 validation stack based on upstream
84cc975e, full libraries built and 90 regression groups passed five times each, with no skips and a 4.17-second maximum per run. A controlled game comparison changed only the graphics driver: before 29.21 seconds / after 29.23 seconds, both stopping at the existing compressed multisampled texture refusal, without timeout. FMASK resource binding and metadata-aware decoding remain unimplemented; this addressing component does not resolve the issue or advance startup. No PR was opened.Follow-up: local metadata-aware FMASK read subset validated
A local implementation based on upstream
aac0f1b8now bindsFmask32_S8_F8as a per-pixel integer texture snapshot instead of emitting the fixed FMASK constant. It synchronizes and reads FMASK plus CMASK: CMASK0xCyields zero fragment indices, while0xFyields the stored indices. The implementation covers 2D/2D-array images, one mip, zero/X destination selectors and the source-derived GFX10 non-RB+ 16-pipeSW_64KB_Z_Xconfiguration. Unsupported formats, selectors, compression codes and reserved fragment indices throw. Compressed color decoding is still unsupported.Sources: PAL's FMASK-to-surface layout conversion, PAL's 32-bit FMASK destination selectors, the CMASK address and clear-state sources above, and Mesa's fragment-index extraction. PAL's public FMASK address entry point is unimplemented; the reference uses the unchanged surface address implementation with PAL's own FMASK layout conversion, rather than treating that entry point as an oracle.
Validation on Windows/RTX 5080 with shader caching disabled:
The controlled game replay changed only the graphics driver; 119 libraries were byte-identical. Before 29.52 seconds / after 29.25 seconds, both reached the same compressed multisampled color-texture refusal without timeout. Therefore this subset corrects the synthetic FMASK reads but has not advanced game startup or resolved this issue in full. Baseline runtime files were restored and hash verified.
This work was AI assisted and remains local. No PR was opened. These are source-reference and NVIDIA-host execution results, not AMD/PS5 hardware measurements or Linux/lavapipe validation.