fix(agc): depth fast clears through the HTILE metadata #374

Merged
MichonGoddijn231849 merged 4 commits from upstream-pr/374 into main 2026-10-11 08:27:15 +00:00
MichonGoddijn231849 commented 2026-10-02 16:15:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-02T16:15:36Z.


What

A title can fast-clear a depth surface by filling its HTILE metadata instead of drawing a clear. A ZMASK of 0 marks every tile as holding DB_DEPTH_CLEAR / DB_STENCIL_CLEAR.

  • Depth surfaces were only cleared when they were made, so every later frame kept the previous frame's depth and stencil. Most draws then failed the depth test.
  • The depth target now records DB_HTILE_DATA_BASE (0x005, high byte in 0x01e). Both registers join the draw key.
  • Uniform DMA_DATA immediate fills and buffer-fill kernels whose ZMASK is 0 and that cover a depth surface's HTILE mark the surface cleared.
  • The surface's next use, as a depth target or as a texture, clears it to that use's clear registers.

GTA V clears its G-buffer depth this way every frame: DMA_DATA fills of 0 over 0x48000 bytes of HTILE. Without this, only the first frame renders. From the second frame on, the G-buffer keeps the first frame's contents and the scene goes black.

Tested

Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0.

  • GTA V (PPSA04264), with #376, #375 and the depth-surface changes still in progress: the G-buffer fills every frame and the Prologue bank renders lit and textured. Before, only the first frame did.
  • Dreaming Sarah (PPSA02929): the title menu, its text and the first scene render as on main.
  • Demon's Souls (PPSA01342), with #231 and #232: it reaches the main menu.
  • ctest: all tests pass. agc_driver_depth_fast_clear_submit submits a DMA_DATA immediate fill and the fill kernel over the HTILE and checks the next depth-tested draw, and a stencil-tested draw after a depth-only fill. Sampling a surface after an HTILE fill is not covered by a test: the harness has no sampling shader with a depth T# yet.

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 in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes. Written with Claude (Anthropic) under my direction; I reviewed and tested it.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4718735383 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-02T16:15:36Z. --- ### What A title can fast-clear a depth surface by filling its HTILE metadata instead of drawing a clear. A ZMASK of 0 marks every tile as holding `DB_DEPTH_CLEAR` / `DB_STENCIL_CLEAR`. - Depth surfaces were only cleared when they were made, so every later frame kept the previous frame's depth and stencil. Most draws then failed the depth test. - The depth target now records `DB_HTILE_DATA_BASE` (`0x005`, high byte in `0x01e`). Both registers join the draw key. - Uniform `DMA_DATA` immediate fills and buffer-fill kernels whose ZMASK is 0 and that cover a depth surface's HTILE mark the surface cleared. - The surface's next use, as a depth target or as a texture, clears it to that use's clear registers. GTA V clears its G-buffer depth this way every frame: `DMA_DATA` fills of 0 over 0x48000 bytes of HTILE. Without this, only the first frame renders. From the second frame on, the G-buffer keeps the first frame's contents and the scene goes black. ### Tested Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0. - GTA V (PPSA04264), with #376, #375 and the depth-surface changes still in progress: the G-buffer fills every frame and the Prologue bank renders lit and textured. Before, only the first frame did. - Dreaming Sarah (PPSA02929): the title menu, its text and the first scene render as on `main`. - Demon's Souls (PPSA01342), with #231 and #232: it reaches the main menu. - `ctest`: all tests pass. `agc_driver_depth_fast_clear_submit` submits a `DMA_DATA` immediate fill and the fill kernel over the HTILE and checks the next depth-tested draw, and a stencil-tested draw after a depth-only fill. Sampling a surface after an HTILE fill is not covered by a test: the harness has no sampling shader with a depth T# yet. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes. Written with Claude (Anthropic) under my direction; I reviewed and tested it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
oneandonlydean commented 2026-10-04 05:43:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T05:43:22Z.


This looks right for depth-only surfaces. With a stencil plane, though, any fill whose ZMASK is 0 clears both aspects. In the depth plus stencil HTILE layout the stencil state is in its own SR0, SR1 and SMEM fields: radv's radv_get_htile_mask (radv_meta_clear.c) only touches zmask/zdelta/zbase for a depth clear and only sr0/sr1/smem for a stencil clear. So a fill that clears depth only would also reset the stencil to DB_STENCIL_CLEAR here. Could the stencil aspect be cleared only when the fill's stencil fields say cleared too, and the depth aspect alone otherwise? I'd also only take DB_HTILE_DATA_BASE when TILE_SURFACE_ENABLE is set. A small test for NoteDepthMetadataFill (depth only, depth plus stencil, a fill that doesn't cover the whole HTILE) would pin it down.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5977024630 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-5977024630). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-04T05:43:22Z. --- This looks right for depth-only surfaces. With a stencil plane, though, any fill whose ZMASK is 0 clears both aspects. In the depth plus stencil HTILE layout the stencil state is in its own SR0, SR1 and SMEM fields: radv's `radv_get_htile_mask` (radv_meta_clear.c) only touches zmask/zdelta/zbase for a depth clear and only sr0/sr1/smem for a stencil clear. So a fill that clears depth only would also reset the stencil to DB_STENCIL_CLEAR here. Could the stencil aspect be cleared only when the fill's stencil fields say cleared too, and the depth aspect alone otherwise? I'd also only take DB_HTILE_DATA_BASE when TILE_SURFACE_ENABLE is set. A small test for `NoteDepthMetadataFill` (depth only, depth plus stencil, a fill that doesn't cover the whole HTILE) would pin it down.
MichonGoddijn231849 commented 2026-10-04 08:36:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-04T08:36:46Z.


Thanks, both points are fixed in e3848242 (rebased onto main too):

  • Aspects: a fill covering the whole HTILE now clears the depth when ZMask (bits 0..3) is 0. When the HTILE holds the stencil state (DB_STENCIL_INFO.TILE_STENCIL_DISABLE clear), it also clears the stencil when SMem (bits 8..9) is 0. That matches radv's depth plus stencil layout and its fast-clear value (radv_get_htile_fast_clear_value, SMem 0, SR0/SR1 3). A fill that writes an aspect's fields as not cleared cancels that aspect's pending clear, so a depth-only clear no longer resets the stencil.
  • TILE_SURFACE_ENABLE: DB_HTILE_DATA_BASE is taken only when DB_Z_INFO.TILE_SURFACE_ENABLE is set.
  • Tests: the decode with and without TILE_SURFACE_ENABLE and TILE_STENCIL_DISABLE, plus HtileFillClears and HtileFillCovers. The cases are depth only, depth plus stencil, stencil only, an expanded 0xffffffff fill, a partial fill, a fill starting past the HTILE base, and no HTILE.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5978166444 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-5978166444). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-04T08:36:46Z. --- Thanks, both points are fixed in e3848242 (rebased onto `main` too): - **Aspects:** a fill covering the whole HTILE now clears the depth when ZMask (bits 0..3) is 0. When the HTILE holds the stencil state (`DB_STENCIL_INFO.TILE_STENCIL_DISABLE` clear), it also clears the stencil when SMem (bits 8..9) is 0. That matches radv's depth plus stencil layout and its fast-clear value (`radv_get_htile_fast_clear_value`, SMem 0, SR0/SR1 3). A fill that writes an aspect's fields as not cleared cancels that aspect's pending clear, so a depth-only clear no longer resets the stencil. - **TILE_SURFACE_ENABLE:** `DB_HTILE_DATA_BASE` is taken only when `DB_Z_INFO.TILE_SURFACE_ENABLE` is set. - **Tests:** the decode with and without `TILE_SURFACE_ENABLE` and `TILE_STENCIL_DISABLE`, plus `HtileFillClears` and `HtileFillCovers`. The cases are depth only, depth plus stencil, stencil only, an expanded `0xffffffff` fill, a partial fill, a fill starting past the HTILE base, and no HTILE.
oneandonlydean commented 2026-10-04 09:51:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T09:51:57Z.


Thanks, that matches radv's depth plus stencil HTILE layout (ZMask in bits 0 to 3, SMem in bits 8 and 9, and HTILE_ZS_CLEAR_REG writes SMem 0), and bit 29 of DB_Z_INFO and of DB_STENCIL_INFO are the right TILE_SURFACE_ENABLE and TILE_STENCIL_DISABLE bits. Cancelling an aspect's pending clear when a fill marks it as not cleared is a nice touch. Merged with current main it builds and passes the full ctest here. Since depth fast clears change what PPSA21564 renders, I'll run it there on my integration branch first; after that it's ready to merge from my side.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5978690987 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-5978690987). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-04T09:51:57Z. --- Thanks, that matches radv's depth plus stencil HTILE layout (ZMask in bits 0 to 3, SMem in bits 8 and 9, and `HTILE_ZS_CLEAR_REG` writes SMem 0), and bit 29 of DB_Z_INFO and of DB_STENCIL_INFO are the right TILE_SURFACE_ENABLE and TILE_STENCIL_DISABLE bits. Cancelling an aspect's pending clear when a fill marks it as not cleared is a nice touch. Merged with current main it builds and passes the full ctest here. Since depth fast clears change what PPSA21564 renders, I'll run it there on my integration branch first; after that it's ready to merge from my side.
github-actions[bot] commented 2026-10-07 11:45:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-07T11:45:38Z.


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
#454 core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClear.cpp
core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearHarness.hpp
core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearSubmit.cpp
#2076 core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClear.cpp
core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearHarness.hpp
core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearSubmit.cpp
#2121 core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClear.cpp
core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearHarness.hpp
core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearSubmit.cpp
#2132 core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClear.cpp
core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearHarness.hpp
core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearSubmit.cpp
#2169 core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClear.cpp
core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearHarness.hpp
core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearSubmit.cpp
#2490 core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClear.cpp
core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearHarness.hpp
core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearSubmit.cpp
#2491 core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClear.cpp
core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearHarness.hpp
core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearSubmit.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6037220147 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6037220147). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-07T11:45:38Z. --- <!-- pr-overlap --> 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 | |---|---|---|---| | #454 | | | `core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClear.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearHarness.hpp`<br>`core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearSubmit.cpp` | | #2076 | | | `core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClear.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearHarness.hpp`<br>`core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearSubmit.cpp` | | #2121 | | | `core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClear.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearHarness.hpp`<br>`core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearSubmit.cpp` | | #2132 | | | `core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClear.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearHarness.hpp`<br>`core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearSubmit.cpp` | | #2169 | | | `core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClear.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearHarness.hpp`<br>`core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearSubmit.cpp` | | #2490 | | | `core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClear.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearHarness.hpp`<br>`core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearSubmit.cpp` | | #2491 | | | `core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClear.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearHarness.hpp`<br>`core/libs/prx/libSceAgcDriver/tests/execution/DepthFastClearSubmit.cpp` |
adriadam10 commented 2026-10-07 13:57:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T13:57:37Z.

Review: CHANGES_REQUESTED


Built merged onto current main (e79c971f9): full ctest passes. The new checks cover the register decode and the two pure helpers. A few things before merging:

  • No test reaches the clear itself. Nothing calls NoteDepthMetadataFill, so ApplyFastClear and both triggers, the DMA_DATA immediate (PacketMemory.cpp:59-63) and the fill kernel (BufferFill.cpp:173), run in no test. Removing them leaves ctest green. Could you add an execution test (the Visual.cpp harness can draw with a depth target)? It would cover: a DMA_DATA fill of 0 over the HTILE, then a depth-tested draw that sees DB_DEPTH_CLEAR; a depth-only fill on a depth plus stencil HTILE that keeps the stencil; a fill shorter than the HTILE that clears nothing; and sampling the surface after a fill.
  • TechnicalDebt (Unknown function info). Two choices here are inferred, not measured, and should each get a line:
    • HtileFillCovers treats ceil(w/8) * ceil(h/8) * 4 bytes from the HTILE base as the whole surface. The real gfx10 HTILE is pipe-aligned and larger (addrlib), so a fill of only its first part would clear every tile.
    • The sampled path clears to DB_DEPTH_CLEAR. For a depth-only HTILE, the clear word also carries the value: radv writes minz = maxz = round(depth * 0x3fff) (HTILE_Z_CLEAR_REG, src/amd/common/ac_descriptors.h), and only allows TC-compatible fast clears to 0.0 or 1.0. Which of the two the texture unit returns for a cleared tile wasn't measured.
  • Reuse: PacketMemory.cpp:60-61 repeats dmaSource/dmaDestination from Pm4.cpp:82-88. Please expose those (or decode through Pm4) instead of a second copy of the bit layout.

@oneandonlydean you planned a PPSA21564 run on your integration branch before calling this ready. Did it go through?

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5443415523 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#pullrequestreview-5443415523). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-07T13:57:37Z. **Review:** CHANGES_REQUESTED --- Built merged onto current `main` (e79c971f9): full ctest passes. The new checks cover the register decode and the two pure helpers. A few things before merging: - **No test reaches the clear itself.** Nothing calls `NoteDepthMetadataFill`, so `ApplyFastClear` and both triggers, the `DMA_DATA` immediate (`PacketMemory.cpp:59-63`) and the fill kernel (`BufferFill.cpp:173`), run in no test. Removing them leaves ctest green. Could you add an execution test (the `Visual.cpp` harness can draw with a depth target)? It would cover: a `DMA_DATA` fill of 0 over the HTILE, then a depth-tested draw that sees `DB_DEPTH_CLEAR`; a depth-only fill on a depth plus stencil HTILE that keeps the stencil; a fill shorter than the HTILE that clears nothing; and sampling the surface after a fill. - **TechnicalDebt (Unknown function info).** Two choices here are inferred, not measured, and should each get a line: - `HtileFillCovers` treats `ceil(w/8) * ceil(h/8) * 4` bytes from the HTILE base as the whole surface. The real gfx10 HTILE is pipe-aligned and larger (addrlib), so a fill of only its first part would clear every tile. - The sampled path clears to `DB_DEPTH_CLEAR`. For a depth-only HTILE, the clear word also carries the value: radv writes `minz = maxz = round(depth * 0x3fff)` (`HTILE_Z_CLEAR_REG`, `src/amd/common/ac_descriptors.h`), and only allows TC-compatible fast clears to 0.0 or 1.0. Which of the two the texture unit returns for a cleared tile wasn't measured. - **Reuse:** `PacketMemory.cpp:60-61` repeats `dmaSource`/`dmaDestination` from `Pm4.cpp:82-88`. Please expose those (or decode through `Pm4`) instead of a second copy of the bit layout. @oneandonlydean you planned a PPSA21564 run on your integration branch before calling this ready. Did it go through?
MichonGoddijn231849 commented 2026-10-07 17:31:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-07T17:31:08Z.


Rebased onto current main (now 0b03ec84), no conflicts. #419 and #425 are restacked on these exact commits. Working on the review points next.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6043247784 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6043247784). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-07T17:31:08Z. --- Rebased onto current `main` (now 0b03ec84), no conflicts. #419 and #425 are restacked on these exact commits. Working on the review points next.
MichonGoddijn231849 commented 2026-10-07 18:22:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-07T18:22:23Z.


@adriadam10 changes:

  • eaecf06b: DMA_DATA's source and destination selectors decode through Pm4::DmaSource/Pm4::DmaDestination (now public) instead of a second copy of the bit layout. Two TechnicalDebt lines record the inferred parts: HtileFillCovers' surface size, and the value a cleared tile reads as.

  • d948c4ec: tests/execution/DepthFastClear.cpp draws with a D32 target and DB_DEPTH_CLEAR 1.0 and checks that:

    • a new surface starts cleared;
    • depth written at 0.5 holds against a LESS draw;
    • a fill one dword short of the HTILE, and an expanded fill (ZMask 0xf), clear nothing;
    • a whole-HTILE fill of ZMask 0 clears the depth back to 1.0, and a second one does it again.

    With NoteDepthMetadataFill emptied it fails at the first whole-HTILE fill.

The test calls NoteDepthMetadataFill directly, which is what both triggers call (the DMA_DATA immediate in PacketMemory.cpp and the fill kernel in BufferFill.cpp). Two cases are still covered only by the HtileFillClears checks, not by a draw: depth plus stencil (a depth-only fill keeping the stencil), and sampling after a fill.

Build and ctest pass. #419, #425, #1186 and #1189 are restacked on this.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6044137964 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6044137964). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-07T18:22:23Z. --- @adriadam10 changes: - eaecf06b: DMA_DATA's source and destination selectors decode through `Pm4::DmaSource`/`Pm4::DmaDestination` (now public) instead of a second copy of the bit layout. Two TechnicalDebt lines record the inferred parts: `HtileFillCovers`' surface size, and the value a cleared tile reads as. - d948c4ec: `tests/execution/DepthFastClear.cpp` draws with a D32 target and `DB_DEPTH_CLEAR` 1.0 and checks that: - a new surface starts cleared; - depth written at 0.5 holds against a LESS draw; - a fill one dword short of the HTILE, and an expanded fill (ZMask 0xf), clear nothing; - a whole-HTILE fill of ZMask 0 clears the depth back to 1.0, and a second one does it again. With `NoteDepthMetadataFill` emptied it fails at the first whole-HTILE fill. The test calls `NoteDepthMetadataFill` directly, which is what both triggers call (the DMA_DATA immediate in `PacketMemory.cpp` and the fill kernel in `BufferFill.cpp`). Two cases are still covered only by the `HtileFillClears` checks, not by a draw: depth plus stencil (a depth-only fill keeping the stencil), and sampling after a fill. Build and ctest pass. #419, #425, #1186 and #1189 are restacked on this.
adriadam10 commented 2026-10-07 19:58:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T19:58:58Z.

Review: DISMISSED


Thanks for the changes. The Pm4 reuse and both TechnicalDebt lines look good. Built merged onto current main: full ctest passes, and agc_driver_depth_fast_clear runs (not skipped). What's left:

  • The real triggers are still untested. DepthFastClear.cpp:135-143 calls NoteDepthMetadataFill directly, so deleting the DMA_DATA hook (PacketMemory.cpp:59-61) or the fill-kernel hook (BufferFill.cpp:173) still leaves ctest green. Those two lines decide when a clear happens: selectors, address, the & 0x3ffffff count, the uniform-pattern check. tests/Submit.cpp already submits DCBs, so one test could submit a DMA_DATA immediate fill of 0 over the HTILE and then check that the next depth-tested draw sees DB_DEPTH_CLEAR. The fill-kernel path needs a case too if it can be reached the same way.
  • Depth plus stencil isn't covered by a draw. A depth-only fill (ZMask 0, SMem 3) on an HTILE that holds stencil must keep the stencil. Right now that's only checked through HtileFillClears, not through ApplyFastClear's aspect mask. A stencil-tested draw after such a fill would pin it.
  • TechnicalDebt adjacency. The two lines at docs/dev/TechnicalDebt.md:204-205 are the last ones in "Unknown function info", where every PR appends. Moving them a few lines up avoids conflicts with the PRs stacked on this one and with others.

Sampling after a fill can stay untested if a draw that samples the surface is too much harness work. If so, please say that in the description.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5447628789 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#pullrequestreview-5447628789). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-07T19:58:58Z. **Review:** DISMISSED --- Thanks for the changes. The `Pm4` reuse and both TechnicalDebt lines look good. Built merged onto current `main`: full ctest passes, and `agc_driver_depth_fast_clear` runs (not skipped). What's left: - **The real triggers are still untested.** `DepthFastClear.cpp:135-143` calls `NoteDepthMetadataFill` directly, so deleting the `DMA_DATA` hook (`PacketMemory.cpp:59-61`) or the fill-kernel hook (`BufferFill.cpp:173`) still leaves ctest green. Those two lines decide when a clear happens: selectors, address, the `& 0x3ffffff` count, the uniform-pattern check. `tests/Submit.cpp` already submits DCBs, so one test could submit a `DMA_DATA` immediate fill of 0 over the HTILE and then check that the next depth-tested draw sees `DB_DEPTH_CLEAR`. The fill-kernel path needs a case too if it can be reached the same way. - **Depth plus stencil isn't covered by a draw.** A depth-only fill (ZMask 0, SMem 3) on an HTILE that holds stencil must keep the stencil. Right now that's only checked through `HtileFillClears`, not through `ApplyFastClear`'s aspect mask. A stencil-tested draw after such a fill would pin it. - **TechnicalDebt adjacency.** The two lines at `docs/dev/TechnicalDebt.md:204-205` are the last ones in "Unknown function info", where every PR appends. Moving them a few lines up avoids conflicts with the PRs stacked on this one and with others. Sampling after a fill can stay untested if a draw that samples the surface is too much harness work. If so, please say that in the description.
oneandonlydean commented 2026-10-07 20:47:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-07T20:47:33Z.


Not yet, sorry. #374 is in the queue for the regression run, together with #290 and #788, and I haven't got a result for it. I'll run it on the current head (including today's DMA_DATA and test changes) and post the result here.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6046554064 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6046554064). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-07T20:47:33Z. --- Not yet, sorry. #374 is in the queue for the regression run, together with #290 and #788, and I haven't got a result for it. I'll run it on the current head (including today's DMA_DATA and test changes) and post the result here.
MichonGoddijn231849 commented 2026-10-08 15:43:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-08T15:43:15Z.


Thanks. Rebased onto main. Added agc_driver_depth_fast_clear_submit: it submits the two real triggers as DCBs, a DMA_DATA immediate fill and a dispatch of the fill kernel over the HTILE, and checks the next depth-tested draw sees DB_DEPTH_CLEAR. Removing either hook line (PacketMemory.cpp, BufferFill.cpp) now fails it. A fill one dword short and a ZMask 0xf fill clear nothing. The same test covers depth plus stencil: a depth-only fill (SMem 3) over an HTILE holding stencil 5, then a stencil-tested EQUAL 5 draw still passes everywhere while a LESS draw shows the depth was cleared; widening the aspect mask fails it.

While writing it I found that a fill the device could not store (the CPU fallback) never reached the HTILE note; the note now follows that branch too. The TechnicalDebt lines moved up in the section, and one line records the stencil bit mapping the test pins, which is inferred from the HTILE layout. Sampling after a fill is still untested (no sampling shader with a depth T# in the harness); the description says so.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6063581194 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6063581194). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-08T15:43:15Z. --- Thanks. Rebased onto main. Added `agc_driver_depth_fast_clear_submit`: it submits the two real triggers as DCBs, a `DMA_DATA` immediate fill and a dispatch of the fill kernel over the HTILE, and checks the next depth-tested draw sees `DB_DEPTH_CLEAR`. Removing either hook line (`PacketMemory.cpp`, `BufferFill.cpp`) now fails it. A fill one dword short and a ZMask 0xf fill clear nothing. The same test covers depth plus stencil: a depth-only fill (SMem 3) over an HTILE holding stencil 5, then a stencil-tested EQUAL 5 draw still passes everywhere while a LESS draw shows the depth was cleared; widening the aspect mask fails it. While writing it I found that a fill the device could not store (the CPU fallback) never reached the HTILE note; the note now follows that branch too. The TechnicalDebt lines moved up in the section, and one line records the stencil bit mapping the test pins, which is inferred from the HTILE layout. Sampling after a fill is still untested (no sampling shader with a depth T# in the harness); the description says so.
orbz22 commented 2026-10-08 16:25:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by orbz22 on 2026-10-08T16:25:53Z.


Test evidence from Astro's Playroom (PPSA01325). The title clears its depth through HTILE every frame, but the clear takes a path the two hooks here do not cover.

Setup: Windows 11 Pro, RTX 3060 Laptop (6 GB), 32 GB RAM, MinGW-w64 GCC 15.2.0. Local branch with this PR's diff ported onto main 73ac9ef7, plus #1395, #757, #758, #759 and #570.

What the title does. The main depth surface is 0x517370000, 3840x2160 D32S8, with DB_Z_INFO 0xa0000183 (TILE_SURFACE_ENABLE set) and DB_STENCIL_INFO 0x20000181 (TILE_STENCIL_DISABLE set). Its HTILE is at 0x567f88000. The title never sends a DMA_DATA fill and never dispatches the 9-instruction fill kernel over it. Instead it dispatches a different 64-thread compute kernel twice per frame. The kernel ships in the title binary (it ran from a host address in the relinked exe), so it is probably an SDK toolkit kernel rather than one written for this game:

[dispatch-io] shader 0x7ff735e59100 67f88000 00040005 00028000 00014004 fffffff0 00000000 00000000 0000000a 00028000 00000001
[dispatch-io] 2560x1x1: buffer 0x567f88000+0xa0000

The user data, as I decoded it from the code (69 dwords, first dwords bfa00003 d7460002 04010c0a 7da80408 ..., ending in buffer_store_format_x with idxen):

SGPRs Contents
s[0:3] V#: stride 4, BUF_FMT_32_UINT, dst_sel X, num_records = dword count
s4..s7 Fill pattern
s8 Dword count
s9 Pattern length

Each thread i < s8 stores pattern[i % s9] to dword i. In this case s9 = 1 and s4 = 0xfffffff0, which is ZMASK 0 with min/max Z 0x3fff, the same value as HTILE_Z_CLEAR_REG(1.0). The same kernel also fills DCC keys (0x00000000, 0xffffffff and 0x40404040 patterns) and the shadow-map HTILEs.

Result. With this PR alone, NoteDepthMetadataFill never ran, so the depth surface kept every earlier frame's depth. Draws with DB_DEPTH_CONTROL 0x007007b2 (LEQUAL, no write) then failed where earlier frames had drawn. On the title screen this showed up as a permanent trail behind the flying 3D letters. I added a hook that matches this kernel and calls NoteDepthMetadataFill(base, count * 4, s4) when s9 is 1. With it the trail is gone in all four runs I made, including one started from a launcher script: the HTILE fill is noted about 2 times per frame (1411 times in about 700 frames), and stderr has no new errors.

A second finding, about array slices. The cascaded shadow map uses three 1536x1536 depth slices (0x529430000, 0x529c30000, 0x52a430000). All three draws keep the same DB_HTILE_DATA_BASE (0x5689a8000), and the title fills three HTILE ranges 0x40000 apart: 0x5689a8000, 0x5689e8000 and 0x568a28000. decodeDepth adds the DB_DEPTH_VIEW slice offset to the Z and stencil addresses but not to htileAddress. As a result, the first fill marks all three slices cleared, and the fills for slices 1 and 2 match no surface. For this title the outcome is still right, because the three fills come back to back before any slice is drawn. A title that clears one slice between draws to another would lose depth. The per-slice HTILE stride (0x40000 here, for 0x24000 bytes of tiles) is not derived anywhere yet.

I can open the kernel hook as a separate PR on top of this one if that helps. It is a few lines in BufferFill.cpp and Dispatch.cpp.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6064350675 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6064350675). Originally posted by [orbz22](https://github.com/orbz22) on 2026-10-08T16:25:53Z. --- Test evidence from Astro's Playroom (PPSA01325). The title clears its depth through HTILE every frame, but the clear takes a path the two hooks here do not cover. **Setup:** Windows 11 Pro, RTX 3060 Laptop (6 GB), 32 GB RAM, MinGW-w64 GCC 15.2.0. Local branch with this PR's diff ported onto main 73ac9ef7, plus #1395, #757, #758, #759 and #570. **What the title does.** The main depth surface is 0x517370000, 3840x2160 D32S8, with `DB_Z_INFO` 0xa0000183 (TILE_SURFACE_ENABLE set) and `DB_STENCIL_INFO` 0x20000181 (TILE_STENCIL_DISABLE set). Its HTILE is at 0x567f88000. The title never sends a `DMA_DATA` fill and never dispatches the 9-instruction fill kernel over it. Instead it dispatches a different 64-thread compute kernel twice per frame. The kernel ships in the title binary (it ran from a host address in the relinked exe), so it is probably an SDK toolkit kernel rather than one written for this game: ``` [dispatch-io] shader 0x7ff735e59100 67f88000 00040005 00028000 00014004 fffffff0 00000000 00000000 0000000a 00028000 00000001 [dispatch-io] 2560x1x1: buffer 0x567f88000+0xa0000 ``` The user data, as I decoded it from the code (69 dwords, first dwords `bfa00003 d7460002 04010c0a 7da80408 ...`, ending in `buffer_store_format_x` with idxen): | SGPRs | Contents | |---|---| | s[0:3] | V#: stride 4, `BUF_FMT_32_UINT`, dst_sel X, num_records = dword count | | s4..s7 | Fill pattern | | s8 | Dword count | | s9 | Pattern length | Each thread `i < s8` stores `pattern[i % s9]` to dword `i`. In this case s9 = 1 and s4 = 0xfffffff0, which is ZMASK 0 with min/max Z 0x3fff, the same value as `HTILE_Z_CLEAR_REG(1.0)`. The same kernel also fills DCC keys (0x00000000, 0xffffffff and 0x40404040 patterns) and the shadow-map HTILEs. **Result.** With this PR alone, `NoteDepthMetadataFill` never ran, so the depth surface kept every earlier frame's depth. Draws with `DB_DEPTH_CONTROL` 0x007007b2 (LEQUAL, no write) then failed where earlier frames had drawn. On the title screen this showed up as a permanent trail behind the flying 3D letters. I added a hook that matches this kernel and calls `NoteDepthMetadataFill(base, count * 4, s4)` when s9 is 1. With it the trail is gone in all four runs I made, including one started from a launcher script: the HTILE fill is noted about 2 times per frame (1411 times in about 700 frames), and stderr has no new errors. **A second finding, about array slices.** The cascaded shadow map uses three 1536x1536 depth slices (0x529430000, 0x529c30000, 0x52a430000). All three draws keep the same `DB_HTILE_DATA_BASE` (0x5689a8000), and the title fills three HTILE ranges 0x40000 apart: 0x5689a8000, 0x5689e8000 and 0x568a28000. `decodeDepth` adds the `DB_DEPTH_VIEW` slice offset to the Z and stencil addresses but not to `htileAddress`. As a result, the first fill marks all three slices cleared, and the fills for slices 1 and 2 match no surface. For this title the outcome is still right, because the three fills come back to back before any slice is drawn. A title that clears one slice between draws to another would lose depth. The per-slice HTILE stride (0x40000 here, for 0x24000 bytes of tiles) is not derived anywhere yet. I can open the kernel hook as a separate PR on top of this one if that helps. It is a few lines in `BufferFill.cpp` and `Dispatch.cpp`.
MichonGoddijn231849 commented 2026-10-09 08:33:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-09T08:33:33Z.


@orbz22 thanks for tracking this down. Yes please, open the fill-kernel hook as a separate PR on top of this one; matching the toolkit kernel and calling NoteDepthMetadataFill when the pattern length is 1 is the right shape. The per-slice HTILE address is a real gap too: decodeDepth should add the slice's HTILE offset the way it does for Z and stencil, once the stride is derived. I'll note it in TechnicalDebt.md.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077399603 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6077399603). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-09T08:33:33Z. --- @orbz22 thanks for tracking this down. Yes please, open the fill-kernel hook as a separate PR on top of this one; matching the toolkit kernel and calling `NoteDepthMetadataFill` when the pattern length is 1 is the right shape. The per-slice HTILE address is a real gap too: `decodeDepth` should add the slice's HTILE offset the way it does for Z and stencil, once the stride is derived. I'll note it in TechnicalDebt.md.
adriadam10 commented 2026-10-09 22:01:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-09T22:01:47Z.


Merged onto current main: build and full ctest pass here (agc_driver_graphics, agc_driver_depth_fast_clear, agc_driver_depth_fast_clear_submit all run, none skipped). Without the change the new tests don't build, and both hooks (PacketMemory.cpp, BufferFill.cpp) are exercised by the submit test. Nothing left to change from our side.

  • The red linux/windows jobs fail on spirv/unified1/spirv.hpp not found in VulkanTestDevice.hpp, which every execution test includes; it doesn't come from this diff.
  • Known gaps, all recorded: the fill-kernel variant Astro's Playroom uses (pattern length 1, per @orbz22) goes in a follow-up PR on top, and the per-slice HTILE address is in TechnicalDebt.

@oneandonlydean you said you would run this on PPSA21564 on your integration branch before giving it the go-ahead. Do you have a result on the current head (7e6f271)? Nine PRs are stacked on this one, so it blocks them.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6089985538 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6089985538). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-09T22:01:47Z. --- Merged onto current `main`: build and full ctest pass here (`agc_driver_graphics`, `agc_driver_depth_fast_clear`, `agc_driver_depth_fast_clear_submit` all run, none skipped). Without the change the new tests don't build, and both hooks (`PacketMemory.cpp`, `BufferFill.cpp`) are exercised by the submit test. Nothing left to change from our side. - The red `linux`/`windows` jobs fail on `spirv/unified1/spirv.hpp` not found in `VulkanTestDevice.hpp`, which every execution test includes; it doesn't come from this diff. - Known gaps, all recorded: the fill-kernel variant Astro's Playroom uses (pattern length 1, per @orbz22) goes in a follow-up PR on top, and the per-slice HTILE address is in TechnicalDebt. @oneandonlydean you said you would run this on PPSA21564 on your integration branch before giving it the go-ahead. Do you have a result on the current head (7e6f271)? Nine PRs are stacked on this one, so it blocks them.
oneandonlydean commented 2026-10-10 00:03:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T00:03:53Z.


Ran it on PPSA21564 at 3a99fa1880 (7e6f271 plus the main merge), with the copy of this change I'd been carrying swapped out for this head. The level loads in all runs with the same frame rate as before, no errors, and the title screen's depth-tested draws are clean (no trails). Dreaming Sarah passes on main + this. Fine by me, so I'll merge it once its full build is green.

One thing for a follow-up: agc_driver_depth_fast_clear_submit is flaky in the compute-fill case, on Linux too (2 failures in about 180 back-to-back runs here; popcoder565 saw 3/60 on Windows), always with a compute fill of 0 over the HTILE did not clear the depth to DB_DEPTH_CLEAR (1.0). The test draws on its own device while the fill-kernel submit creates the driver's device, so Recorder::Active() can switch devices between the fill and the draw. Giving the test one device, or creating the driver's device first, should fix it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6091375164 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6091375164). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T00:03:53Z. --- Ran it on PPSA21564 at 3a99fa1880 (7e6f271 plus the main merge), with the copy of this change I'd been carrying swapped out for this head. The level loads in all runs with the same frame rate as before, no errors, and the title screen's depth-tested draws are clean (no trails). Dreaming Sarah passes on main + this. Fine by me, so I'll merge it once its full build is green. One thing for a follow-up: `agc_driver_depth_fast_clear_submit` is flaky in the compute-fill case, on Linux too (2 failures in about 180 back-to-back runs here; popcoder565 saw 3/60 on Windows), always with `a compute fill of 0 over the HTILE did not clear the depth to DB_DEPTH_CLEAR (1.0)`. The test draws on its own device while the fill-kernel submit creates the driver's device, so `Recorder::Active()` can switch devices between the fill and the draw. Giving the test one device, or creating the driver's device first, should fix it.
oneandonlydean commented 2026-10-10 02:16:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T02:16:21Z.


This conflicts with main after today's merges. Could you rebase it along with the test fix? Its gate passed, so it can go in once it builds green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6092619091 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6092619091). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T02:16:21Z. --- This conflicts with main after today's merges. Could you rebase it along with the test fix? Its gate passed, so it can go in once it builds green.
MichonGoddijn231849 commented 2026-10-10 08:10:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-10T08:10:39Z.


Rebased onto main (af1a8edf), head 28414f92, as two commits.

  • dc13564b: this PR's change, squashed into one commit. #2229 landed overnight with the same mechanism for RADV's clear_htile_mask kernel, so the two are merged into one path:
    • NoteHtileDepthClear marks the matching surfaces' depth aspect pending, the same way an HTILE fill does here. A clear for a surface that doesn't exist yet still uses #2229's set, applied when the surface is first bound.
    • DepthSurface::ClearDepth is gone; the pending clear goes through ApplyFastClear, on bind and on sample.
    • The two HTILE address decodes are now one: TILE_SURFACE_ENABLE, a nonzero DB_HTILE_DATA_BASE and a depth format.
    • #2229's check that a surface without DB_HTILE_DATA_BASE decodes no HTILE address now erases the register itself. This PR's state test sets it earlier in the same function.
  • 28414f92: the flaky agc_driver_depth_fast_clear_submit, fixed in the driver rather than the test, as you described. A depth surface now records its clears into the active recorder only if that recorder belongs to its own device. Otherwise it submits on its own device. Two devices in one process can't put a clear in the wrong command buffer any more.

Tested on Windows, RTX 5080:

  • agc_driver_graphics, agc_driver_depth_fast_clear, agc_driver_depth_fast_clear_submit and agc_driver_dword_pattern_fill pass.
  • The submit test passes 200 runs in a row, with the compute-fill case running.
  • check_conventions.py passes.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095548599 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6095548599). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-10T08:10:39Z. --- Rebased onto `main` (af1a8edf), head `28414f92`, as two commits. - **dc13564b:** this PR's change, squashed into one commit. #2229 landed overnight with the same mechanism for RADV's `clear_htile_mask` kernel, so the two are merged into one path: - `NoteHtileDepthClear` marks the matching surfaces' depth aspect pending, the same way an HTILE fill does here. A clear for a surface that doesn't exist yet still uses #2229's set, applied when the surface is first bound. - `DepthSurface::ClearDepth` is gone; the pending clear goes through `ApplyFastClear`, on bind and on sample. - The two HTILE address decodes are now one: TILE_SURFACE_ENABLE, a nonzero DB_HTILE_DATA_BASE and a depth format. - #2229's check that a surface without DB_HTILE_DATA_BASE decodes no HTILE address now erases the register itself. This PR's state test sets it earlier in the same function. - **28414f92:** the flaky `agc_driver_depth_fast_clear_submit`, fixed in the driver rather than the test, as you described. A depth surface now records its clears into the active recorder only if that recorder belongs to its own device. Otherwise it submits on its own device. Two devices in one process can't put a clear in the wrong command buffer any more. Tested on Windows, RTX 5080: - `agc_driver_graphics`, `agc_driver_depth_fast_clear`, `agc_driver_depth_fast_clear_submit` and `agc_driver_dword_pattern_fill` pass. - The submit test passes 200 runs in a row, with the compute-fill case running. - `check_conventions.py` passes.
oneandonlydean commented 2026-10-10 09:42:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T09:42:35Z.


Both this and #425 passed testing and are ready to merge, but today's merges conflict with them in core/libs/prx/libSceAgcDriver/tests/Graphics.cpp. Could you rebase both on main? This one goes in first, then #425.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6096230704 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6096230704). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T09:42:35Z. --- Both this and #425 passed testing and are ready to merge, but today's merges conflict with them in `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp`. Could you rebase both on main? This one goes in first, then #425.
MichonGoddijn231849 commented 2026-10-10 09:52:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-10T09:52:17Z.


Rebased onto main (be403084), head 94d93e00. The tests/Graphics.cpp conflict was the include list. A third commit adapts the new tests to main's Mutation::Add gpu flag. agc_driver_graphics, agc_driver_depth_fast_clear, agc_driver_depth_fast_clear_submit (100 runs in a row) and agc_driver_dword_pattern_fill pass here, and so does check_conventions.py. #425 follows on this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6096300786 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6096300786). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-10T09:52:17Z. --- Rebased onto `main` (be403084), head `94d93e00`. The `tests/Graphics.cpp` conflict was the include list. A third commit adapts the new tests to main's `Mutation::Add` `gpu` flag. `agc_driver_graphics`, `agc_driver_depth_fast_clear`, `agc_driver_depth_fast_clear_submit` (100 runs in a row) and `agc_driver_dword_pattern_fill` pass here, and so does `check_conventions.py`. #425 follows on this head.
oneandonlydean commented 2026-10-10 18:08:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T18:08:35Z.


The manual build of 94d93e00 segfaults in agc_driver_depth_fast_clear_submit on Linux, with no output before the crash: https://github.com/boykopovar/AnyPS5/actions/runs/38047108506. Could you look at it? (The Windows job skips that test, and its guest_avplayer failure isn't from this PR.)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6100606783 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6100606783). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T18:08:35Z. --- The manual build of 94d93e00 segfaults in `agc_driver_depth_fast_clear_submit` on Linux, with no output before the crash: https://github.com/boykopovar/AnyPS5/actions/runs/38047108506. Could you look at it? (The Windows job skips that test, and its `guest_avplayer` failure isn't from this PR.)
orishamir commented 2026-10-10 18:47:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by orishamir on 2026-10-10T18:47:00Z.


On the Linux segfault in the manual run (38047108506): that job's device is llvmpipe (LLVM 20.1.2, ubuntu-24.04) under ctest --parallel 4, and the test's output stops right after the driver's own VulkanDevice comes up, before any [gpu] line, so the crash is in the first DMA_DATA submission or the draw after it, not in the compute-fill case the earlier flake was about.

It does not reproduce here on llvmpipe LLVM 21.1.8 (Ubuntu 26.04 in WSL2), 94d93e00 merged onto current main (57f96fd2): agc_driver_depth_fast_clear_submit passes 200 serial runs, 8 concurrent instances x 40 runs, 100 runs under CPU load, and the 256-test agc driver set at -j8 repeated 4 times. agc_driver_graphics, agc_driver_depth_fast_clear and agc_driver_dword_pattern_fill pass too. On this evidence the difference is the Mesa/LLVM build rather than load. The TechnicalDebt lines sit mid-section (:273-276).

AI-assisted: yes (Claude Code Fable 5.1 xhigh)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6100958563 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6100958563). Originally posted by [orishamir](https://github.com/orishamir) on 2026-10-10T18:47:00Z. --- On the Linux segfault in the manual run (38047108506): that job's device is llvmpipe (LLVM 20.1.2, ubuntu-24.04) under `ctest --parallel 4`, and the test's output stops right after the driver's own `VulkanDevice` comes up, before any `[gpu]` line, so the crash is in the first `DMA_DATA` submission or the draw after it, not in the compute-fill case the earlier flake was about. It does not reproduce here on llvmpipe LLVM 21.1.8 (Ubuntu 26.04 in WSL2), `94d93e00` merged onto current `main` (`57f96fd2`): `agc_driver_depth_fast_clear_submit` passes 200 serial runs, 8 concurrent instances x 40 runs, 100 runs under CPU load, and the 256-test agc driver set at `-j8` repeated 4 times. `agc_driver_graphics`, `agc_driver_depth_fast_clear` and `agc_driver_dword_pattern_fill` pass too. On this evidence the difference is the Mesa/LLVM build rather than load. The TechnicalDebt lines sit mid-section (`:273-276`). AI-assisted: yes (Claude Code Fable 5.1 xhigh)
Mouhand-Kaddo commented 2026-10-10 21:21:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Mouhand-Kaddo on 2026-10-10T21:21:29Z.


Additional current-main platform validation of head 94d93e00fb087f37d0dfc7b6ffa64a552c51ea51, with its three commits cherry-picked onto main 262c031692a0ce538707436fa1587b671ace682b (local integration 2e2f7243b). No additional behavior changes.

  • Arch WSL2, GCC 16.2.1, lavapipe / LLVM 23.1.1: agc_driver_graphics, agc_driver_depth_fast_clear, and agc_driver_depth_fast_clear_submit pass 3/3 (3.17 s). The submit test also passes three consecutive verbose repeats, including its compute-fill case.
  • Windows 11 x64, MinGW-w64 GCC 15.2.0, RX 6900 XT, driver 32.0.21045.5002: graphics and fast-clear pass. The initial submit run crashes with 0xc0000005 inside amdvlk64.dll+0x1bbfa4. After a fresh rebuild, that submit test passes 23 consecutive verbose repeats (3 followed by 20), including compute fill. The initial crash remains unexplained; these retries do not establish that it is resolved or identify its cause.

Release builds; repeats used ctest -R '^agc_driver_depth_fast_clear_submit$' -V --repeat until-fail:N. The initial run used the three-test selection above.

The Arch run uses software Vulkan. WSL asynchronous userfaultfd write protection is unavailable here, so the graphics test reports that its write-watch/import-mirror cases were not exercised. This is additional platform evidence, not a reproduction or resolution of the reported LLVM 20 CI failure.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6102305423 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6102305423). Originally posted by [Mouhand-Kaddo](https://github.com/Mouhand-Kaddo) on 2026-10-10T21:21:29Z. --- Additional current-main platform validation of head `94d93e00fb087f37d0dfc7b6ffa64a552c51ea51`, with its three commits cherry-picked onto main `262c031692a0ce538707436fa1587b671ace682b` (local integration `2e2f7243b`). No additional behavior changes. - **Arch WSL2**, GCC 16.2.1, lavapipe / LLVM 23.1.1: `agc_driver_graphics`, `agc_driver_depth_fast_clear`, and `agc_driver_depth_fast_clear_submit` pass 3/3 (3.17 s). The submit test also passes three consecutive verbose repeats, including its compute-fill case. - **Windows 11 x64**, MinGW-w64 GCC 15.2.0, RX 6900 XT, driver 32.0.21045.5002: graphics and fast-clear pass. The initial submit run crashes with `0xc0000005` inside `amdvlk64.dll+0x1bbfa4`. After a fresh rebuild, that submit test passes 23 consecutive verbose repeats (3 followed by 20), including compute fill. The initial crash remains unexplained; these retries do not establish that it is resolved or identify its cause. Release builds; repeats used `ctest -R '^agc_driver_depth_fast_clear_submit$' -V --repeat until-fail:N`. The initial run used the three-test selection above. The Arch run uses software Vulkan. WSL asynchronous userfaultfd write protection is unavailable here, so the graphics test reports that its write-watch/import-mirror cases were not exercised. This is additional platform evidence, not a reproduction or resolution of the reported LLVM 20 CI failure.
orishamir commented 2026-10-10 22:00:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by orishamir on 2026-10-10T22:00:40Z.


Follow-up on the manual-build segfault (run 38047108506), since nobody has reproduced it yet: I rebuilt the exact tree that job built, b5f5362d + 94d93e00 (merge 03038533), in a container matching the runner: ubuntu:24.04, mesa-vulkan-drivers 25.2.8-0ubuntu0.24.04.4 = llvmpipe (LLVM 20.1.2), GCC 13.3.0, cmake 3.28.3, the workflow's configure flags with ANYPS5_ENABLE_SPIRV_TOOLS=ON, ANYPS5_REQUIRE_VULKAN=1 GALLIUM_OVERRIDE_CPU_CAPS=avx, 4 CPUs, ctest --parallel 4 --timeout 120, and with the userfaultfd write watch active as in the job's output (Docker's default seccomp profile blocks userfaultfd, so a first set of runs had fallen back to comparing guest memory; the figures below are from runs with it allowed).

  • Full suite three times at --parallel 4: agc_driver_depth_fast_clear_submit passes in all three (699/700 each; the one failure is import_audit, which stamps its JSON with the source commit through git and gets none under the container's file ownership, nothing to do with this PR). The same three runs without the write watch: 700/700.
  • The submit test alone: 30/30 serial, and under gdb it exits normally.
  • Same recipe on current main 262c0316 + 94d93e00: 713/713 at --parallel 4, 30/30 serial.

So the crash does not follow from the job's image, device, compiler, flags, tree, write-watch mode or test parallelism. What is left is the hosted runner itself (CPU, kernel, load; llvmpipe generates code for the host CPU at run time). A re-run of the manual build would show whether it repeats there at all.

AI-assisted: yes (Claude Code Fable 5.1 xhigh)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6102631162 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6102631162). Originally posted by [orishamir](https://github.com/orishamir) on 2026-10-10T22:00:40Z. --- Follow-up on the manual-build segfault (run 38047108506), since nobody has reproduced it yet: I rebuilt the exact tree that job built, `b5f5362d` + `94d93e00` (merge `03038533`), in a container matching the runner: `ubuntu:24.04`, `mesa-vulkan-drivers` 25.2.8-0ubuntu0.24.04.4 = llvmpipe (LLVM 20.1.2), GCC 13.3.0, cmake 3.28.3, the workflow's configure flags with `ANYPS5_ENABLE_SPIRV_TOOLS=ON`, `ANYPS5_REQUIRE_VULKAN=1 GALLIUM_OVERRIDE_CPU_CAPS=avx`, 4 CPUs, `ctest --parallel 4 --timeout 120`, and with the userfaultfd write watch active as in the job's output (Docker's default seccomp profile blocks `userfaultfd`, so a first set of runs had fallen back to comparing guest memory; the figures below are from runs with it allowed). - Full suite three times at `--parallel 4`: `agc_driver_depth_fast_clear_submit` passes in all three (699/700 each; the one failure is `import_audit`, which stamps its JSON with the source commit through git and gets none under the container's file ownership, nothing to do with this PR). The same three runs without the write watch: 700/700. - The submit test alone: 30/30 serial, and under gdb it exits normally. - Same recipe on current `main` `262c0316` + `94d93e00`: 713/713 at `--parallel 4`, 30/30 serial. So the crash does not follow from the job's image, device, compiler, flags, tree, write-watch mode or test parallelism. What is left is the hosted runner itself (CPU, kernel, load; llvmpipe generates code for the host CPU at run time). A re-run of the manual build would show whether it repeats there at all. AI-assisted: yes (Claude Code Fable 5.1 xhigh)
MichonGoddijn231849 commented 2026-10-10 22:17:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-10T22:17:24Z.


Thanks all for the runs. I can't reproduce it either, and with @orishamir's container rebuild (the job's exact tree, ubuntu:24.04 image, llvmpipe LLVM 20.1.2, GCC 13.3, ctest --parallel 4, write watch on) passing the full suite three times and the test 30/30 alone, it doesn't follow from the tree, the image or the parallelism. The job log also has no output from the test before the segfault, so there is nothing to locate it by.

@oneandonlydean, could you re-run the manual build once? If it crashes again on the hosted runner, I'll add a line per case to the test so the log shows which submission it dies in, and a backtrace step for that test.

@Mouhand-Kaddo the one-off 0xc0000005 inside amdvlk64.dll on the first run, gone after a rebuild, I can't explain either; noted in case it shows up again.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6102767871 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6102767871). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-10T22:17:24Z. --- Thanks all for the runs. I can't reproduce it either, and with @orishamir's container rebuild (the job's exact tree, ubuntu:24.04 image, llvmpipe LLVM 20.1.2, GCC 13.3, `ctest --parallel 4`, write watch on) passing the full suite three times and the test 30/30 alone, it doesn't follow from the tree, the image or the parallelism. The job log also has no output from the test before the segfault, so there is nothing to locate it by. @oneandonlydean, could you re-run the manual build once? If it crashes again on the hosted runner, I'll add a line per case to the test so the log shows which submission it dies in, and a backtrace step for that test. @Mouhand-Kaddo the one-off `0xc0000005` inside `amdvlk64.dll` on the first run, gone after a rebuild, I can't explain either; noted in case it shows up again.
MichonGoddijn231849 commented 2026-10-10 22:38:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-10T22:38:44Z.


Rebased onto main 379d8b4e (6d0fe18c); the only conflict was an include list in PacketMemory.cpp next to main's 14c2eca3b (DMA_DATA copies into host-only memory), which does not touch the fill path this PR hooks. The agc tests pass on Windows (RTX 5080).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6102937836 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6102937836). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-10T22:38:44Z. --- Rebased onto main `379d8b4e` (`6d0fe18c`); the only conflict was an include list in `PacketMemory.cpp` next to main's 14c2eca3b (DMA_DATA copies into host-only memory), which does not touch the fill path this PR hooks. The agc tests pass on Windows (RTX 5080).
orishamir commented 2026-10-10 22:52:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by orishamir on 2026-10-10T22:52:15Z.


Replica run of the new head 6d0fe18c (same setup as above: the CI image rebuilt locally, ubuntu:24.04, GCC 13.3, llvmpipe LLVM 20.1.2, SPIRV-Tools on, CI env, userfaultfd write watch active; the tree as pushed on main 379d8b4e).

  • The rebase is clean: the patch content is identical to 94d93e00 (interdiff of added and removed lines empty; 14 files, +488/-15).
  • Build and libs clean. Full suite 729/729 three times at --parallel 4. agc_driver_depth_fast_clear_submit 30/30 serial.

AI-assisted: yes (Claude Code Fable 5.1 xhigh)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6103041653 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6103041653). Originally posted by [orishamir](https://github.com/orishamir) on 2026-10-10T22:52:15Z. --- Replica run of the new head `6d0fe18c` (same setup as above: the CI image rebuilt locally, ubuntu:24.04, GCC 13.3, llvmpipe LLVM 20.1.2, SPIRV-Tools on, CI env, userfaultfd write watch active; the tree as pushed on `main` 379d8b4e). - The rebase is clean: the patch content is identical to `94d93e00` (interdiff of added and removed lines empty; 14 files, +488/-15). - Build and `libs` clean. Full suite 729/729 three times at `--parallel 4`. `agc_driver_depth_fast_clear_submit` 30/30 serial. AI-assisted: yes (Claude Code Fable 5.1 xhigh)
oneandonlydean commented 2026-10-11 01:08:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T01:08:11Z.


Conflicts with main again in DepthSurface.hpp and DepthSurface.cpp after #1430; please rebase (and #425 on top). I'll run the manual build on the new head, which covers the re-run.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6104051747 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6104051747). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-11T01:08:11Z. --- Conflicts with main again in `DepthSurface.hpp` and `DepthSurface.cpp` after #1430; please rebase (and #425 on top). I'll run the manual build on the new head, which covers the re-run.
Amoenus commented 2026-10-11 05:54:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-11T05:54:05Z.


Independent validation found a concrete false positive in the documented HtileFillCovers approximation. Current #374 (6d0fe18c) and #419 (b75dc179) contain the same helper, byte-for-byte.

Reproducer: HtileFillCovers(0x10000, {16, 16}, 0x10000, 16) returns true unchanged. For GFX10 non-RB+, revision 0x82, GB_ADDR_CONFIG=0x00100044, pipe-aligned SW_64KB_Z_X, unchanged AMD PAL places a valid HTILE word at offset 260 (end 264). A 16-byte fill misses it. PAL reports a 32,768-byte physical extent. Checked for 1/2/4/8 samples and D16/D32. The current 16x8 unit example has contiguous valid words; 16x16 exposes the assumption.

Reference: pinned PAL HTILE info/address routines. This is an unchanged source reference, not a PS5 measurement. TechnicalDebt already acknowledges the approximation; this supplies a concrete counterexample.

Local correction tested: require the complete physical extent for the supported layout (32 KiB per 1024x512 metadata block). A partial overlapping fill makes the resident surface throw on its next use; a complete known fill permits recovery. This is conservative, does not model partial tile updates or other layouts, and any general adoption still needs its layout assumptions enforced.

Validation:

  • Unchanged PAL: 40 configurations/run, all logical tiles enumerated, five repetitions (1/2/4/8 samples, D16/D32, even/odd/large extents).
  • Exact extracted helper: original false positive and correction each confirmed five times; five controls restoring the linear bound failed as expected.
  • Adapted local #419/#374 stack on main 7f1dc965: all 120 libraries/full build and conventions passed; 102 relevant groups x5 = 510 passes, no skips, max 4.06 s, Vulkan/MSAA required and shader caching disabled.
  • Integrated draw tests check partial refusal/recovery through direct notification and DMA/compute submissions. The compute fixture uses 32 workgroups and X group ID; after FlushGpuWrites, every one of the 32,768 guest bytes is checked. This exercises the existing optimized fill route, not native execution of the AMD shader.

Windows 11 / RTX 5080, driver 32.0.16.1062, GCC 15.2.0. The aggregate includes previous local snapshot prerequisites, conflict repairs and the independently verified standard-8x table correction; this is not an unchanged full PR build or Linux/lavapipe validation. Controlled PPSA99902 runs still stop at raw PA_SC_AA_CONFIG=0x2030e003 (31.471/31.004 s, no timeout), so the title has not exercised the HTILE correction. No frame/gameplay or console-equivalence claim. Original dump/baseline runtime preserved. No new PR/push. AI-assisted investigation/local code: Codex.

Fork code and validation update (2026-10-11)

Proposed correction (fork only): partial HTILE-fill handling and regressions. Parent a55955fa is the adapted #374/#419 stack and includes the separate HTILE geometry helper. This is an extracted correction tested in the aggregate, not an isolated full topic build. It remains a conservative proposal for the pinned pipe-aligned layout; other metadata layouts still need enforced decoding guards before general adoption. Independent HTILE helper topic on main 0e90079f has no local MSAA prerequisites; 240 PAL configurations/run, 2,252,352 HTILE checks/run x5 and 15 mutation controls passed. It is source-backed, not a console measurement. AI-assisted: Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106007304 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6106007304). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-11T05:54:05Z. --- Independent validation found a concrete false positive in the documented `HtileFillCovers` approximation. Current #374 (`6d0fe18c`) and #419 (`b75dc179`) contain the same helper, byte-for-byte. **Reproducer:** `HtileFillCovers(0x10000, {16, 16}, 0x10000, 16)` returns true unchanged. For GFX10 non-RB+, revision `0x82`, `GB_ADDR_CONFIG=0x00100044`, pipe-aligned `SW_64KB_Z_X`, unchanged AMD PAL places a valid HTILE word at offset 260 (end 264). A 16-byte fill misses it. PAL reports a 32,768-byte physical extent. Checked for 1/2/4/8 samples and D16/D32. The current 16x8 unit example has contiguous valid words; 16x16 exposes the assumption. Reference: pinned [PAL HTILE info/address routines](https://github.com/GPUOpen-Drivers/pal/blob/c5e800072a32f68b6ccc4422936d96167c6e0728/src/core/imported/addrlib/src/gfx10/gfx10addrlib.cpp). This is an unchanged source reference, not a PS5 measurement. TechnicalDebt already acknowledges the approximation; this supplies a concrete counterexample. **Local correction tested:** require the complete physical extent for the supported layout (32 KiB per 1024x512 metadata block). A partial overlapping fill makes the resident surface throw on its next use; a complete known fill permits recovery. This is conservative, does not model partial tile updates or other layouts, and any general adoption still needs its layout assumptions enforced. Validation: - Unchanged PAL: 40 configurations/run, all logical tiles enumerated, five repetitions (1/2/4/8 samples, D16/D32, even/odd/large extents). - Exact extracted helper: original false positive and correction each confirmed five times; five controls restoring the linear bound failed as expected. - Adapted local #419/#374 stack on main `7f1dc965`: all 120 libraries/full build and conventions passed; 102 relevant groups x5 = 510 passes, no skips, max 4.06 s, Vulkan/MSAA required and shader caching disabled. - Integrated draw tests check partial refusal/recovery through direct notification and DMA/compute submissions. The compute fixture uses 32 workgroups and X group ID; after `FlushGpuWrites`, every one of the 32,768 guest bytes is checked. This exercises the existing optimized fill route, not native execution of the AMD shader. Windows 11 / RTX 5080, driver 32.0.16.1062, GCC 15.2.0. The aggregate includes previous local snapshot prerequisites, conflict repairs and the independently verified standard-8x table correction; this is not an unchanged full PR build or Linux/lavapipe validation. Controlled PPSA99902 runs still stop at raw `PA_SC_AA_CONFIG=0x2030e003` (31.471/31.004 s, no timeout), so the title has not exercised the HTILE correction. No frame/gameplay or console-equivalence claim. Original dump/baseline runtime preserved. No new PR/push. AI-assisted investigation/local code: Codex. ## Fork code and validation update (2026-10-11) **Proposed correction (fork only):** [partial HTILE-fill handling and regressions](https://github.com/Amoenus/AnyPS5/commit/c87313229c1b0acff310cace4820eca4d848cd81). Parent `a55955fa` is the adapted #374/#419 stack and includes the separate HTILE geometry helper. This is an extracted correction tested in the aggregate, not an isolated full topic build. It remains a conservative proposal for the pinned pipe-aligned layout; other metadata layouts still need enforced decoding guards before general adoption. [Independent HTILE helper topic on main `0e90079f`](https://github.com/Amoenus/AnyPS5/commit/0c67bb124596856ee3cded57c5af740ed1666542) has no local MSAA prerequisites; 240 PAL configurations/run, 2,252,352 HTILE checks/run x5 and 15 mutation controls passed. It is source-backed, not a console measurement. AI-assisted: Codex.
MichonGoddijn231849 commented 2026-10-11 07:59:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-11T07:59:34Z.


@Amoenus thanks, confirmed and fixed in 90e3c40d (credited): HtileFillCovers now requires the fill to span the pipe-aligned metadata extent, 32 KiB per 1024x512 block (HtileMetadataBytes), and the test has your 16x16 counterexample (a 16- or 264-byte fill covers nothing). The fast clear fixtures fill that extent; the compute fixture now dispatches one group per KiB with TGID_X. A partial fill is still ignored rather than refused (the surface keeps its contents); the TechnicalDebt line says so and names the layout it assumes.

@oneandonlydean #425 is re-stacked on it (847cccc6, 326/326 agc tests on Windows). Main is merging a PR every minute or two this morning, so I'll rebase both onto main once it has quietened down later today rather than now and again in an hour.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106913496 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6106913496). Originally posted by [MichonGoddijn231849](https://github.com/MichonGoddijn231849) on 2026-10-11T07:59:34Z. --- @Amoenus thanks, confirmed and fixed in `90e3c40d` (credited): `HtileFillCovers` now requires the fill to span the pipe-aligned metadata extent, 32 KiB per 1024x512 block (`HtileMetadataBytes`), and the test has your 16x16 counterexample (a 16- or 264-byte fill covers nothing). The fast clear fixtures fill that extent; the compute fixture now dispatches one group per KiB with TGID_X. A partial fill is still ignored rather than refused (the surface keeps its contents); the TechnicalDebt line says so and names the layout it assumes. @oneandonlydean #425 is re-stacked on it (`847cccc6`, 326/326 agc tests on Windows). Main is merging a PR every minute or two this morning, so I'll rebase both onto main once it has quietened down later today rather than now and again in an hour.
adriadam10 commented 2026-10-11 08:23:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T08:23:58Z.


Rebased onto current main: the only conflicts were adjacency in DepthSurface.hpp/DepthSurface.cpp (main's DepthSurfaceHolds next to this PR's HtileFill* helpers). I kept both sides, no logic changed.

  • Build + ctest of libSceAgcDriver on the rebased tree: 371/371 pass; agc_driver_graphics, agc_driver_depth_fast_clear and agc_driver_depth_fast_clear_submit run (not skipped), and the last two pass 20 repeats in a row.
  • Without the change the new tests don't build.
  • Third-party runs: PPSA21564 and Dreaming Sarah by @oneandonlydean, the CI image replica by @orishamir, WSL2 and Windows by @Mouhand-Kaddo, and the HtileFillCovers counterexample by @Amoenus (fixed in the head).

Merging once the manual full Build (linux and windows) is green on this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6107098937 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/374#issuecomment-6107098937). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T08:23:58Z. --- Rebased onto current `main`: the only conflicts were adjacency in `DepthSurface.hpp`/`DepthSurface.cpp` (main's `DepthSurfaceHolds` next to this PR's `HtileFill*` helpers). I kept both sides, no logic changed. - Build + ctest of `libSceAgcDriver` on the rebased tree: 371/371 pass; `agc_driver_graphics`, `agc_driver_depth_fast_clear` and `agc_driver_depth_fast_clear_submit` run (not skipped), and the last two pass 20 repeats in a row. - Without the change the new tests don't build. - Third-party runs: PPSA21564 and Dreaming Sarah by @oneandonlydean, the CI image replica by @orishamir, WSL2 and Windows by @Mouhand-Kaddo, and the `HtileFillCovers` counterexample by @Amoenus (fixed in the head). Merging once the manual full Build (linux and windows) is green on this head.
Sign in to join this conversation.
No reviewers
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!374
No description provided.