AGC: BDA span reads use stale guest bytes under native MSAA color storage #6625

Closed
opened 2026-10-15 23:25:41 +00:00 by Amoenus · 2 comments
Amoenus commented 2026-10-15 23:25:41 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-15T23:25:41Z.


Current candidate status — 27 October 2026

Keep open pending #6628: head 8814fff88a4ecf7ad6870532fa2db68930407572. The author's fixture correction uses a fresh pre-draw owner, preserving accessible-before-draw, refused-after-draw and ordinary-neighbor checks. Older fleet failures concern the preceding 691cb4 head.

Independently validated on Windows against main 4a6005955f: the clean main + #6628 composition passes all 45 selected processes, including seven GPU groups repeated 3/3 on both RTX 5080 and AMD RDNA2 iGPU, plus graphics/cache checks. Main passes its corresponding 45 processes. Restoring the four production files to main while retaining the PR tests produces all nine intended failures (three cache and three sampled-MSAA per GPU). Each GPU process verifies its physical device and loaded Khronos validation layer; no skips, timeouts, validation diagnostics or VUIDs. Native libraries/relinker and selected real fixtures build on all three arms; conventions pass. Report · logs, exact pins and control patch. Synthetic fixtures only; no new title-progress claim.

BunnyFl's independent Windows/RX9070XT report provides another physical AMD data point. Barrier/fault propagation remains separate in #6689. The original reproduction and earlier validation below are historical pins. AI-assisted maintenance: yes (Codex).

Reproduction

A public synthetic extension of tests/execution/SampleMultisampleTarget.cpp confirms that address-table BDA accesses are outside the native-MSAA guest-access refusal, even with #6498 applied.

Test pin: fixture 36dda4841, branch codex/test-native-msaa-bda-main5d. Composition: main 5d9dcc42d2ec5401aebd089028b8d4d7410a77b4 + #6498 head f9feba0b2f8915da712e3cf92af4a58c7769cc84 + the separate #6452 Windows fixture-alignment correction. The new work changes the existing test only. ShaderAddressResources.cpp, BdaResources.cpp and GuestBufferMemory.cpp are byte-identical to main. This is a tested composition, not a bare-main execution.

The fixture creates a 16x16 RGBA16F, four-sample native color target in a registered four-block allocation, draws, then applies a recognized full color fill. MIMG verifies all 1,024 native samples are ones. The ordinary guard rejects the native range. All six ordinary V# refusal cases from #6498 pass in the same processes.

It then recompiles the existing BdaSpanReads.cpp bounded span program, asserting an actual BdaPagetable binding. Four coherent/barrier combinations each run first in the adjacent ordinary 64KiB block, then in the native color block. Both are inside the same registered allocation. The span's first read starts at the surface base; its first output includes the stale zero DWORD at color+4. Stores replace seeded sentinels at color+0x8000 + mode*0x400 (512 bytes per mode, inside the owned color block). No access leaves the fixture allocation.

Every native dispatch succeeds and produces the exact guest-byte load/store results, despite the native samples remaining ones. Whole-block comparisons verify all results and unchanged bytes outside the intended output windows. The adjacent block also passes every mode. The final assertion intentionally reports:

native BDA controls: neighbor=passed source-samples=1024 missing=4
AGC graphics: native BDA spans missed 4 resident-image refusals

Expected: unsupported access to resident sample storage is refused until a sample-preserving path exists. The legitimate neighboring block in the same registered heap must remain usable.

Validation

Windows 11 Enterprise 26200, WinLibs GCC 15.2r7 Release; Vulkan required and shader cache disabled. Physical vendor/device verified in every fresh process:

GPU Driver Native BDA cases Adjacent/native-sample controls
NVIDIA RTX 5080 (10de:2c02) 32.0.16.1062 all 4 admitted, 5/5 processes all pass
AMD Radeon integrated graphics (1002:13c0) 32.0.21036.18 all 4 admitted, 5/5 processes all pass

All ten processes exit 1 solely at the missing-refusal assertion; no device loss or timeout. Maximum 1.617s. Changed target build, conventions and test registration pass. No full-build, Linux runtime, title replay or console-equivalence claim for this diagnostic pin.

To reproduce, build agc_driver_sample_multisample_target_tests at the pinned branch, select a GPU with ANYPS5_GPU, require Vulkan with ANYPS5_REQUIRE_VULKAN=1, disable shader cache with ANYPS5_NO_SHADER_CACHE=1, then run ctest --test-dir <build> -R '^agc_driver_sample_multisample_target$' -V. The expected diagnostic is a failing regression, not a passing test.

Scope and next correction

ShaderResources::prepareAddressBindings acquires registered heaps for BDA; GuestBufferMemory::UploadFinish/AddressRanges and the cached BDA table expose those ranges without the native-owner check used by the descriptor paths. This inspection identifies the separate route; it is not yet a validated fix. Rejecting an entire registered heap merely because it contains one native surface would also reject the passing neighbor control. Any table/range correction must account for owner creation/retirement and cached-table reuse.

#6480/#6498 concern ordinary buffer descriptors; #6579/#6590 concern fixed-function index inputs. This report concerns actual BDA span reads/stores through address tables. Existing BDA fault/unaligned-access work concerns different behavior. No equivalent native-owner table correction was found in the current source or reviewed open BDA PRs.

Found while extending public regressions for the PPSA99902 bring-up work. This does not identify that title's first failing writer/plane or explain another title's device loss. AI-assisted investigation and fixture: Codex.

Historical Windows validation of #6628

The proposed fix in #6628 passes the native-MSAA/neighbor regression five times on each physical GPU (RTX 5080 and AMD Radeon iGPU); restoring main production code fails five times on each. Independent review also found a new cache-hit descriptor-length regression and supplies a tested one-line correction plus its regression assertion. Full Windows build and repeated corrected tests pass. Validation, exact pins and proposed correction. Synthetic fixtures only; no new title-progress claim.

Barrier variants subsequently exposed #6689, independently reproduced with a test on main alone. The proposed compute fault-handling follow-up and its dependency on #6416 are tracked there.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5875496373 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6625). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-15T23:25:41Z. --- ### Current candidate status — 27 October 2026 **Keep open pending #6628:** head `8814fff88a4ecf7ad6870532fa2db68930407572`. [The author's fixture correction](https://github.com/boykopovar/AnyPS5/pull/6628#issuecomment-6434288017) uses a fresh pre-draw owner, preserving accessible-before-draw, refused-after-draw and ordinary-neighbor checks. Older fleet failures concern the preceding `691cb4` head. **Independently validated on Windows against main `4a6005955f`:** the clean main + #6628 composition passes all 45 selected processes, including seven GPU groups repeated 3/3 on both RTX 5080 and AMD RDNA2 iGPU, plus graphics/cache checks. Main passes its corresponding 45 processes. Restoring the four production files to main while retaining the PR tests produces all nine intended failures (three cache and three sampled-MSAA per GPU). Each GPU process verifies its physical device and loaded Khronos validation layer; no skips, timeouts, validation diagnostics or VUIDs. Native libraries/relinker and selected real fixtures build on all three arms; conventions pass. [Report](https://github.com/boykopovar/AnyPS5/pull/6628#issuecomment-6453727965) · [logs, exact pins and control patch](https://gist.github.com/Amoenus/0f230345d38f36a71bcaa1d068134f96). Synthetic fixtures only; no new title-progress claim. [BunnyFl's independent Windows/RX9070XT report](https://github.com/boykopovar/AnyPS5/pull/6628#issuecomment-6439796061) provides another physical AMD data point. Barrier/fault propagation remains separate in #6689. The original reproduction and earlier validation below are historical pins. AI-assisted maintenance: yes (Codex). ### Reproduction A public synthetic extension of `tests/execution/SampleMultisampleTarget.cpp` confirms that address-table BDA accesses are outside the native-MSAA guest-access refusal, even with #6498 applied. Test pin: [fixture `36dda4841`](https://github.com/Amoenus/AnyPS5/commit/36dda48416e2bef481de8513643c5b6d2eaa4d8b), branch `codex/test-native-msaa-bda-main5d`. Composition: main `5d9dcc42d2ec5401aebd089028b8d4d7410a77b4` + #6498 head `f9feba0b2f8915da712e3cf92af4a58c7769cc84` + the separate #6452 Windows fixture-alignment correction. The new work changes the existing test only. `ShaderAddressResources.cpp`, `BdaResources.cpp` and `GuestBufferMemory.cpp` are byte-identical to main. This is a tested composition, not a bare-main execution. The fixture creates a 16x16 RGBA16F, four-sample native color target in a registered four-block allocation, draws, then applies a recognized full color fill. MIMG verifies all 1,024 native samples are ones. The ordinary guard rejects the native range. All six ordinary V# refusal cases from #6498 pass in the same processes. It then recompiles the existing `BdaSpanReads.cpp` bounded span program, asserting an actual `BdaPagetable` binding. Four coherent/barrier combinations each run first in the adjacent ordinary 64KiB block, then in the native color block. Both are inside the same registered allocation. The span's first read starts at the surface base; its first output includes the stale zero DWORD at color+4. Stores replace seeded sentinels at color+`0x8000 + mode*0x400` (512 bytes per mode, inside the owned color block). No access leaves the fixture allocation. Every native dispatch succeeds and produces the exact guest-byte load/store results, despite the native samples remaining ones. Whole-block comparisons verify all results and unchanged bytes outside the intended output windows. The adjacent block also passes every mode. The final assertion intentionally reports: ```text native BDA controls: neighbor=passed source-samples=1024 missing=4 AGC graphics: native BDA spans missed 4 resident-image refusals ``` Expected: unsupported access to resident sample storage is refused until a sample-preserving path exists. The legitimate neighboring block in the same registered heap must remain usable. ### Validation Windows 11 Enterprise 26200, WinLibs GCC 15.2r7 Release; Vulkan required and shader cache disabled. Physical vendor/device verified in every fresh process: | GPU | Driver | Native BDA cases | Adjacent/native-sample controls | |---|---|---|---| | NVIDIA RTX 5080 (`10de:2c02`) | 32.0.16.1062 | all 4 admitted, 5/5 processes | all pass | | AMD Radeon integrated graphics (`1002:13c0`) | 32.0.21036.18 | all 4 admitted, 5/5 processes | all pass | All ten processes exit 1 solely at the missing-refusal assertion; no device loss or timeout. Maximum 1.617s. Changed target build, conventions and test registration pass. No full-build, Linux runtime, title replay or console-equivalence claim for this diagnostic pin. To reproduce, build `agc_driver_sample_multisample_target_tests` at the pinned branch, select a GPU with `ANYPS5_GPU`, require Vulkan with `ANYPS5_REQUIRE_VULKAN=1`, disable shader cache with `ANYPS5_NO_SHADER_CACHE=1`, then run `ctest --test-dir <build> -R '^agc_driver_sample_multisample_target$' -V`. The expected diagnostic is a failing regression, not a passing test. ### Scope and next correction `ShaderResources::prepareAddressBindings` acquires registered heaps for BDA; `GuestBufferMemory::UploadFinish`/`AddressRanges` and the cached BDA table expose those ranges without the native-owner check used by the descriptor paths. This inspection identifies the separate route; it is not yet a validated fix. Rejecting an entire registered heap merely because it contains one native surface would also reject the passing neighbor control. Any table/range correction must account for owner creation/retirement and cached-table reuse. #6480/#6498 concern ordinary buffer descriptors; #6579/#6590 concern fixed-function index inputs. This report concerns actual BDA span reads/stores through address tables. Existing BDA fault/unaligned-access work concerns different behavior. No equivalent native-owner table correction was found in the current source or reviewed open BDA PRs. Found while extending public regressions for the PPSA99902 bring-up work. This does not identify that title's first failing writer/plane or explain another title's device loss. AI-assisted investigation and fixture: Codex. ### Historical Windows validation of #6628 The proposed fix in #6628 passes the native-MSAA/neighbor regression five times on each physical GPU (RTX 5080 and AMD Radeon iGPU); restoring main production code fails five times on each. Independent review also found a new cache-hit descriptor-length regression and supplies a tested one-line correction plus its regression assertion. Full Windows build and repeated corrected tests pass. [Validation, exact pins and proposed correction](https://github.com/boykopovar/AnyPS5/pull/6628#pullrequestreview-5543176733). Synthetic fixtures only; no new title-progress claim. Barrier variants subsequently exposed #6689, independently reproduced with a test on main alone. The proposed compute fault-handling follow-up and its dependency on #6416 are tracked there.
MarcZX10 commented 2026-10-16 00:05:58 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T00:05:58Z.


A focused fix is in PR #6628. It filters active native multisample color spans from the BDA table while preserving neighboring ranges, and restores access after the owner is cleared. The regression warms the BDA table before target creation and checks both refusal and adjacent-range access. The reported focused Mesa llvmpipe test passed; the platform CI jobs were skipped.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6204902441 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6625#issuecomment-6204902441). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T00:05:58Z. --- A focused fix is in [PR #6628](https://github.com/boykopovar/AnyPS5/pull/6628). It filters active native multisample color spans from the BDA table while preserving neighboring ranges, and restores access after the owner is cleared. The regression warms the BDA table before target creation and checks both refusal and adjacent-range access. The reported focused Mesa llvmpipe test passed; the platform CI jobs were skipped.
MarcZX10 commented 2026-10-18 02:16:23 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T02:16:23Z.


I tried building agc_driver_sample_multisample_target_tests on Linux at #6628 current head 2705518fe721eee5a89d856242e45f0f426c829a. Configuration succeeds, but GCC 12 stops in the existing shader recompiler dependency at core/shader/recompiler/Optimization/src/SrtWalker/SrtDescriptorEvaluation.cpp:183: read.read->Flags<MemoryFlags>() needs the dependent template disambiguator. This happens before the fixture links, so it is not Linux validation of the #6628 regression. The worktree is clean. Windows coverage and the exact fix remain in #6628.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6244633085 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6625#issuecomment-6244633085). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T02:16:23Z. --- I tried building `agc_driver_sample_multisample_target_tests` on Linux at #6628 current head `2705518fe721eee5a89d856242e45f0f426c829a`. Configuration succeeds, but GCC 12 stops in the existing shader recompiler dependency at `core/shader/recompiler/Optimization/src/SrtWalker/SrtDescriptorEvaluation.cpp:183`: `read.read->Flags<MemoryFlags>()` needs the dependent `template` disambiguator. This happens before the fixture links, so it is not Linux validation of the #6628 regression. The worktree is clean. Windows coverage and the exact fix remain in #6628.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#6625
No description provided.