Skip to content

fix(agc): check whole storage views for native surface overlap - #10368

Open
Ondra97 wants to merge 1 commit into
boykopovar:mainfrom
Ondra97:codex/fix-storage-native-overlap-span
Open

Ondra97 wants to merge 1 commit into
boykopovar:mainfrom
Ondra97:codex/fix-storage-native-overlap-span

Conversation

@Ondra97

@Ondra97 Ondra97 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

What

A storage-image lookup without a precomputed surface size checked only its first byte against native multisample owners. A native depth surface inside a larger cached view was missed, so the cache could return stale guest bytes and keep the overlapping native owner active.

Resolve the viewed surface's complete size before the overlap check and use that range before either the native-depth storage path or a cached storage lookup. The regression seeds a cached linear view, creates an unwritten native multisample depth surface inside it, checks a disjoint view ending at the depth boundary, then requires the complete view to retire the intersecting owner without changing guest bytes.

Tested

Windows 11 Pro build 26300, WinLibs GCC 15.2.0, Release, NVIDIA GeForce RTX 4070 Ti SUPER, NVIDIA 617.42.

Overlap review: 31 shared-file PR diffs checked. #10049 adds overwrite coverage while retaining the one-byte fallback; this fix uses the complete span and needs a small textual merge with that call-site change. #10064 changes committed 3D slabs. The native-depth fixture additions in #6808/#9950 cover other behavior. None implements this full-span check.
Independent validation of the published commit: Published head 87bdf5445d747ddc76f0cedcb31579e9900aa9c1: full Windows Release build and native multisample depth, depth-storage dispatch, native-depth BDA clear/retirement/clear/refusal checks and patched-library validation pass on a clean tracked tree without overlays (7/7, zero skips). Vulkan is required, shader caches are disabled, and loader logs confirm actual Khronos instance/device validation layers; no VUIDs. Hardware and toolchain are the Windows/NVIDIA configuration listed above. This independently validates the published commit in addition to the earlier integration runs. The complete CTest suite was not run.

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: none
  • GPUs tested: NVIDIA GeForce RTX 4070 Ti SUPER, NVIDIA 617.42, Windows 11 Pro build 26300
  • AI-assisted: yes

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

Reviewed current head 87bdf54. Resolving viewedBytes before RequireNoMultisampleTarget closes the first-byte-only gap for callers that have not precomputed a surface size, and the check now precedes both native-depth storage handling and cached lookup. The regression exercises an overlapping cached range and an adjacent disjoint range ending exactly at the native depth boundary, then checks owner retirement and byte preservation. The author reports 47 focused Windows GPU checks with Vulkan required, shader cache disabled and validation layers confirmed, no new VUIDs; I did not run the GPU test locally. Hosted eligibility, conventions, intake, labels and report pass; product jobs are skipped by path policy. git diff --check upstream/main...upstream/pr/10368 passes. I found no blocking issue.

@github-actions

github-actions Bot commented Oct 23, 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 8105 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp L674-675
PR 9533 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp L674-675
PR 9717 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp L674-675
PR 9742 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp L674-675
PR 9950 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp L1306

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 6192 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6194 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6202 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6223 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6300 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 6412 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6808 core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
PR 7484 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7618 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7689 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 8998 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9400 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9508 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9592 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9674 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9852 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9897 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10049 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10194 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp

@oneandonlydean oneandonlydean self-assigned this Oct 23, 2026
@github-actions github-actions Bot added the agc libSceAgc* label Oct 23, 2026
@BKlaasWerkman

Copy link
Copy Markdown

Intel run, a second vendor next to the RTX 4070 Ti SUPER.

Setup: Intel Arc Graphics (Meteor Lake, 0x7d55, Windows driver 101.9150), Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0 r7, Release. Head 87bdf54 was merged into main ec5b89a (clean merge). Environment: ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (1.4.363). The run uses ctest -R 'native_multisample_depth|native_depth' -j1 -V.

  • Results. This PR passes 5 of 5 and main passes 5 of 5. Neither log has a VUID- line or was not found but was requested.
  • The new case runs on this device. agc_driver_native_multisample_depth prints cached storage span retires only intersecting native depth owners, which main doesn't have. Its other lines are the same as on main, apart from the storage upload log lines of the new case.

AI-assisted: yes (Claude Code)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants