Skip to content

fix(agc): apply completion-proven native depth clears - #5554

Merged
adriadam10 merged 7 commits into
boykopovar:mainfrom
Amoenus:codex/native-depth-htile-clears
Oct 15, 2026
Merged

adriadam10 merged 7 commits into
boykopovar:mainfrom
Amoenus:codex/native-depth-htile-clears

Conversation

@Amoenus

@Amoenus Amoenus commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What

Apply a completed, recognized HTILE mask clear to a sampling-eligible native multisampled depth owner. Keep the native image, attachment and sampled-view identities.

The clear requires exact direct-dispatch bounds for the existing 17-word mask kernel, complete tracked driver-store coverage since notification, no pending GPU or intervening CPU/depth write, and every HTILE word proving the current zero/one clear. StoredOver remains an overlap query; StoredAllSince proves coverage and does not prove fence completion.

Partial, unproven, overlapping and raced clears throw. Guest publication, metadata-fill transitions, arbitrary producers and lost tracking remain unsupported. The strict native path is separate from generic HTILE range notification.

Parent #5524 and prerequisite #5496 are merged. The current head retains main's single HTILE notification after the pipeline drain, with the bounded native producer extent as its third argument.

The conditional Sonic Unleashed Recompiled PPSA99902 need is recorded in #3262 and bring-up #4443: native multisample depth fast-clear transition is not implemented after the sampling prerequisites. This head has not been replayed on the title.

Current head: c9a96a548cd7e63161f069433cdfc56cbae26ac6, refreshed by @adriadam10 on main b3f9f89e62979d7328ff0dec2d14b006f8c2c0ab. Independent validation below uses composition213cd7dc6: this exact head plus #6333's unchanged one-line PM4 build dependency, now merged. The published PR branch is unchanged.

Tested

Composition213cd7dc6: #5554 c9 + merged #6333, Windows11 Enterprise26200, WinLibs GCC15.2.0 Release, bundled dependencies/SPIRV-Tools enabled:

  • Full Windows app/libs build, patched-library validation, conventions and test registration pass. Before fix(agc): link agc_driver_pm4_tests against the shader recompiler #6333, the full build reproduced its missing Recompiler.hpp failure in tests/Pm4.cpp; red/green evidence.
  • Twenty-seven selected groups pass once plus five repeats per NVIDIA/AMD selector: 324 executions, no failures/skips/timeouts, maximum 5.73s,30s per-test limit, caches disabled and serial runs. No execution-test build stubs.
  • Fourteen runtime groups report the expected physical GPU per vendor. Other groups, including the three PM4 Windows groups, are not counted as GPU coverage. Native depth sampling, retirement/lifetime, completed-clear/refusal cases and sampled-MSAA fixtures report their selected adapters.
  • Coverage also includes depth-plane/storage/BDA, complete StoredAllSince coverage, draw-write ranges, pipelined fill/DMA and predication ordering. D16/D32 completed-clear and partial/raced/unproven-producer refusal tests pass.
  • Fresh Cppcheck2.20/clang-tidy23.1.3 analysis of the relocated Dispatch.cpp parses without configuration errors/timeouts (8.785s analyzer time). Cppcheck has no selected diagnostic; clang reports an existing PerformanceTimer null-metric warning. Its path assumes a null constructor frame and later a nonnull unchanged frame; the private-frame/metric initialization invariant was inspected. No new defect was reproduced and no analyzer-clean claim is made. Prior six-TU analysis and earlier288-pass matrix remain pinned to a6abeafb0.

Historical title/source/fault evidence retains its pins. This composition has no new title replay, Linux or full-suite result; it does not prove console equivalence or arbitrary producers. Full upstream CI still requires maintainer dispatch.

Checklist

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 14, 2026
@Amoenus
Amoenus force-pushed the codex/native-depth-htile-clears branch from f31230c to e3eeeba Compare October 14, 2026 01:02
@github-actions github-actions Bot added build docs agc libSceAgc* and removed needs rebase Conflicts with main, rebase needed labels Oct 14, 2026
@Amoenus
Amoenus force-pushed the codex/native-depth-htile-clears branch 2 times, most recently from 537ef29 to a73ae3e Compare October 14, 2026 03:18
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 14, 2026
@Amoenus
Amoenus force-pushed the codex/native-depth-htile-clears branch from a73ae3e to 20589c4 Compare October 14, 2026 12:28
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 14, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 14, 2026
@github-actions

github-actions Bot commented Oct 15, 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
#6346 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp L912-915
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp L102, L836

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
#1341 core/libs/prx/libSceAgcDriver/CMakeLists.txt
#1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
#1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
#1747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#1896 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#3891 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4048 core/libs/prx/libSceAgcDriver/CMakeLists.txt
#4156 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4396 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4397 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4422 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4423 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4424 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4448 core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
docs/dev/debt/libSceAgcDriver.md
#4520 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4521 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4522 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4523 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4566 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4599 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4650 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
#4718 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4740 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4749 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4760 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4813 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#4891 core/libs/prx/libSceAgcDriver/CMakeLists.txt
#4943 core/libs/prx/libSceAgcDriver/CMakeLists.txt
#5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
#5390 docs/dev/debt/libSceAgcDriver.md
#5426 core/libs/prx/libSceAgcDriver/CMakeLists.txt
#5431 core/libs/prx/libSceAgcDriver/CMakeLists.txt
#5480 core/libs/prx/libSceAgcDriver/CMakeLists.txt
#5497 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp
#5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/DepthSurface.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
docs/dev/debt/libSceAgcDriver.md
#5609 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
#5656 core/libs/prx/libSceAgcDriver/CMakeLists.txt
#5761 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
docs/dev/debt/libSceAgcDriver.md
#5781 core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp
#5867 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#5875 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
#5881 core/libs/prx/libSceAgcDriver/CMakeLists.txt
#5884 docs/dev/debt/libSceAgcDriver.md
#5905 docs/dev/debt/libSceAgcDriver.md
#5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp
docs/dev/debt/libSceAgcDriver.md
#6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
#6180 core/libs/prx/libSceAgcDriver/CMakeLists.txt
#6187 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#6208 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#6209 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/GuestMemory.hpp
core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
#6222 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
docs/dev/debt/libSceAgcDriver.md

@Amoenus

Amoenus commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

@adriadam10 Independent Windows validation is green for your refreshed c9a96a548, composed with #6333's unchanged PM4 dependency (now merged): 213cd7dc6.

Full app/libs build and repository checkers pass. The27 selected groups pass once plus five repeats per NVIDIA/AMD selector:324 executions, no skips/timeouts, maximum5.73s. Fourteen runtime groups per vendor report the actual GPU. The post-drain notification retains the third native-extent argument. Exact pins, analysis advisory and scope are in the updated description; no new title/Linux/full-suite claim. Your published PR head is unchanged. AI-assisted: Codex.

@adriadam10
adriadam10 merged commit a61c8a3 into boykopovar:main Oct 15, 2026
10 checks passed
TheBlenDed pushed a commit to TheBlenDed/AnyPS5 that referenced this pull request Oct 25, 2026
Main brings the pipelined-draw stack (boykopovar#1193/boykopovar#1201/boykopovar#1202), boykopovar#6316 after boykopovar#6060, boykopovar#5893, boykopovar#5910 and depth/HTILE work (boykopovar#454, boykopovar#5496, boykopovar#5554, boykopovar#5524, boykopovar#5627, 626cff7). Our SharedSpirv / cold-SPIR-V storage is replaced by main's mapped cache entries (CreateFileMappingW on Windows), so cached variants' words are views into the cache files instead of heap copies; APS5_COLD_SPIRV, APS5_COLD_SPIRV_FILE and APS5_CACHE_SPIRV_BACKING are gone. Kept local: lane hang fixes, boykopovar#5815, boykopovar#6227, table stores and storage tables, option 1 substitutes (.slots), stencil remap and alias path (a written storage view our alias path serves seeds from the depth surface instead of retiring it), 10_11_11 blending next to main's reversed-order blending, VRAM share/spill/fallbacks, diagnostics. Versions: FormatVersion 43, RuntimeAbi 17, request serializer v31. Notes in work/sync-20261013/*-4.md.

AI-assisted: yes
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