AGC: fixed-function vertex buffers bypass the native MSAA guest-access guard #7015

Closed
opened 2026-10-17 05:21:25 +00:00 by Amoenus · 0 comments
Amoenus commented 2026-10-17 05:21:25 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-17T05:21:25Z.


Submitted fix: #7016, depending on #6590. Exact tested head 15eb12009 and current-main impact checks are maintained in the PR.

What

Fixed-function vertex input can read the old guest bytes of a live native MSAA color target through a host import. The ordinary guest-read guard refuses that range, but prepareDrawInputs goes through InPlaceDrawInput without checking it. The vertex shader observes stale values instead of refusing the unsupported access.

Reproducer and validation

Test-only main16 reproducer 9cc558f4a leaves production identical to main 16c607a93. It creates a 16x16 RGBA16F 4x native target, verifies all 1024 host samples are ones, and exercises fixed-function RGBA32F vertex fetches with strides 0 and 16 at the target base and across its end. All four reads accept the old guest values: twelve recorded components per attempt. Neighboring reads in the same host import work; native samples remain unchanged.

Device / OS Driver Main16 reproduction Corrected current head
NVIDIA RTX 5080 / Windows 11 Enterprise 26200, GCC 15.2r7 32.0.16.1062 3/3 expose four missing refusals 3/3 pass
AMD Radeon(TM) Graphics / same Windows toolchain 32.0.21036.18 3/3 expose four missing refusals 3/3 pass
llvmpipe LLVM 20.1.2 / Ubuntu 24.04 WSL, GCC 13.3 Mesa 25.2.8 3/3 expose four missing refusals 3/3 pass

Exact #6590 head 1271998d4 still reproduces the vertex gap once per device at df5179db4 (main16 plus index guard and this test). Updated parent control 8980d77e0, on main 661a1118c plus #6590, reproduces all four once more on NVIDIA. Thus the index guard does not cover this vertex path. 13 expected failing processes across these explicit pins.

Proposed fix

Focused follow-up 15eb12009, own diff, adds one RequireNoMultisampleTarget call for each planned vertex range before import binding or snapshot reuse. It is based on main 661a1118c and exact #6590, preserving @MarcZX100's work and shared fixture corrections. Own scope: four files, +128/-2, mostly tests.

At this exact fixed pin, nine new-case runs and fifteen related GPU regressions pass across the three devices above, plus one llvmpipe core-validation-layer run: 25 passes, maximum 0.68s, actual adapters verified, no whole-test or alias subtest skips. Full relinker/libraries and selected fixtures build on both OSes. Core layer 1.4.363 reports no validation errors; synchronization validation and Windows layers were not run. The test's instruction pattern comes from the existing ZeroStrideVertexFetch fixture.

Related: #6480/#6498 cover shader-buffer descriptors; #6579/#6590 cover fixed-function indices; #6175 covers pass hazard ordering; #6763 changes Windows import/copy selection. None supplies this vertex guard. Found while extending public component validation for #4443; no fresh PPSA99902 title stop, FPS or console-equivalence claim. This correction restores the existing refusal contract; sample publication remains separate. AI-assisted: Codex; author responsible.

Integration follow-up — 2026-10-17

Submitted as #7016; its tested head 15eb12009 is unchanged and depends on #6590. The experimental fork integration 9b9e7a0b66 now includes main f8b22edfb7, this exact fix, #6590 and our earlier color-publication progress. Relinker/libraries and selected fixtures build on Windows and Linux. Ten GPU fixture groups pass once on each verified RTX 5080, Radeon Graphics and llvmpipe (30 GPU processes); the device-profile CPU fixture passes in all three invocations. Maximum process time 1.55s; no skips. Four vertex refusals, neighboring values in the same import and 1,024 unchanged native samples pass on every device. Selected checks also cover index boundaries, color publication/refusal, moved raster, draw recipes, offset/indirect draws, packed-half denormals and preparation settling. Conventions, whitespace and registration checks pass (932 executables registered).

These are additional integration results at the linked pin, not retests of the submitted PR head. No title replay, FPS or console claim. Earlier progress and validation pins remain preserved.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5895220884 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7015). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-17T05:21:25Z. --- <!-- native-vertex-msaa-gap-v1 --> **Submitted fix:** [#7016](https://github.com/boykopovar/AnyPS5/pull/7016), depending on #6590. Exact tested head `15eb12009` and current-main impact checks are maintained in the PR. ### What Fixed-function vertex input can read the old guest bytes of a live native MSAA color target through a host import. The ordinary guest-read guard refuses that range, but `prepareDrawInputs` goes through `InPlaceDrawInput` without checking it. The vertex shader observes stale values instead of refusing the unsupported access. ### Reproducer and validation [Test-only main16 reproducer `9cc558f4a`](https://github.com/Amoenus/AnyPS5/commit/9cc558f4a444fe39093b7f84c4c885afbaf43802) leaves production identical to main `16c607a93`. It creates a 16x16 RGBA16F 4x native target, verifies all 1024 host samples are ones, and exercises fixed-function RGBA32F vertex fetches with strides 0 and 16 at the target base and across its end. All four reads accept the old guest values: twelve recorded components per attempt. Neighboring reads in the **same host import** work; native samples remain unchanged. | Device / OS | Driver | Main16 reproduction | Corrected current head | |---|---|---|---| | NVIDIA RTX 5080 / Windows 11 Enterprise 26200, GCC 15.2r7 | 32.0.16.1062 | 3/3 expose four missing refusals | 3/3 pass | | AMD Radeon(TM) Graphics / same Windows toolchain | 32.0.21036.18 | 3/3 expose four missing refusals | 3/3 pass | | llvmpipe LLVM 20.1.2 / Ubuntu 24.04 WSL, GCC 13.3 | Mesa 25.2.8 | 3/3 expose four missing refusals | 3/3 pass | Exact #6590 head `1271998d4` still reproduces the vertex gap once per device at `df5179db4` (main16 plus index guard and this test). Updated [parent control `8980d77e0`](https://github.com/Amoenus/AnyPS5/commit/8980d77e059f58312affe0791a1fa105666248ba), on main `661a1118c` plus #6590, reproduces all four once more on NVIDIA. Thus the index guard does not cover this vertex path. **13 expected failing processes across these explicit pins.** ### Proposed fix [Focused follow-up `15eb12009`](https://github.com/Amoenus/AnyPS5/commit/15eb12009cf68b68bc223939c1ad132f5b3db506), [own diff](https://github.com/Amoenus/AnyPS5/compare/e62e2801de063e0b7d9500d2090c4e914b3f117c...15eb12009cf68b68bc223939c1ad132f5b3db506), adds one `RequireNoMultisampleTarget` call for each planned vertex range before import binding or snapshot reuse. It is based on main `661a1118c` and exact #6590, preserving @MarcZX100's work and shared fixture corrections. Own scope: four files, +128/-2, mostly tests. At this exact fixed pin, nine new-case runs and fifteen related GPU regressions pass across the three devices above, plus one llvmpipe core-validation-layer run: **25 passes**, maximum 0.68s, actual adapters verified, no whole-test or alias subtest skips. Full relinker/libraries and selected fixtures build on both OSes. Core layer 1.4.363 reports no validation errors; synchronization validation and Windows layers were not run. The test's instruction pattern comes from the existing `ZeroStrideVertexFetch` fixture. Related: #6480/#6498 cover shader-buffer descriptors; #6579/#6590 cover fixed-function indices; #6175 covers pass hazard ordering; #6763 changes Windows import/copy selection. None supplies this vertex guard. Found while extending public component validation for #4443; no fresh PPSA99902 title stop, FPS or console-equivalence claim. This correction restores the existing refusal contract; sample publication remains separate. AI-assisted: Codex; author responsible. <!-- integration-vertex-9b9 --> ### Integration follow-up — 2026-10-17 Submitted as #7016; its tested head `15eb12009` is unchanged and depends on #6590. The [experimental fork integration `9b9e7a0b66`](https://github.com/Amoenus/AnyPS5/commit/9b9e7a0b66a2a5e3e1e1e744ce0c1df9b45fa08b) now includes main `f8b22edfb7`, this exact fix, #6590 and our earlier color-publication progress. Relinker/libraries and selected fixtures build on Windows and Linux. Ten GPU fixture groups pass once on each verified RTX 5080, Radeon Graphics and llvmpipe (30 GPU processes); the device-profile CPU fixture passes in all three invocations. Maximum process time 1.55s; no skips. Four vertex refusals, neighboring values in the same import and 1,024 unchanged native samples pass on every device. Selected checks also cover index boundaries, color publication/refusal, moved raster, draw recipes, offset/indirect draws, packed-half denormals and preparation settling. Conventions, whitespace and registration checks pass (932 executables registered). These are additional integration results at the linked pin, not retests of the submitted PR head. No title replay, FPS or console claim. Earlier progress and validation pins remain preserved. <!-- /integration-vertex-9b9 -->
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#7015
No description provided.