perf(agc): handle uniform pattern-fill kernels as clears #1335

Merged
TibixDev merged 1 commit from upstream-pr/1335 into main 2026-10-09 23:20:53 +00:00
TibixDev commented 2026-10-07 23:48:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-07T23:48:26Z.


What

Recognize the exact typed pattern-fill kernel. Use the existing clear path when its pattern is uniform and the destination is aligned and does not alias its inputs. Keep shader execution for other cases.

Preserve dispatch bounds, descriptor bounds, queued labels, and partial workgroups. #1201/#1202 change fill scheduling but do not recognize this kernel.

Tested

Fedora 44, Release, RX 6600: graphics and PM4 tests; real dispatch tests with Vulkan validation, HLE on and off, wave32/wave64, indirect and partial dispatches, default import settings and forced copies, and GPU-to-label ordering.

Semantics: 16 native RX 6600 cases checked typed R32_UINT loads/stores, execution masks, and descriptor bounds. PS5 hardware was not tested. Isolated comparison: upstream e9846679 versus the same revision plus this PR. Complete fill-and-publish medians fell from 0.592 → 0.303 ms at 4 KiB, 1.175 → 0.431 ms at 1 MiB, and 92.070 → 7.370 ms at 64 MiB. Six pinned processes per variant in ABBA order; the pattern changes each fill and every output word is checked. These are component timings, not title frame time. Windows was not tested.

Checklist

  • Current main; no duplicate open PR.
  • One topic.
  • No new code comments.
  • Unsupported paths still throw; UI stubs are documented.
  • No notes, logs, or images in the repository.
  • No new third-party code.
  • General behavior.
  • Depends on: none.
  • AI-assisted: yes.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4779855237 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1335). Originally posted by [TibixDev](https://github.com/TibixDev) on 2026-10-07T23:48:26Z. --- ### What Recognize the exact typed pattern-fill kernel. Use the existing clear path when its pattern is uniform and the destination is aligned and does not alias its inputs. Keep shader execution for other cases. Preserve dispatch bounds, descriptor bounds, queued labels, and partial workgroups. #1201/#1202 change fill scheduling but do not recognize this kernel. ### Tested Fedora 44, Release, RX 6600: graphics and PM4 tests; real dispatch tests with Vulkan validation, HLE on and off, wave32/wave64, indirect and partial dispatches, default import settings and forced copies, and GPU-to-label ordering. Semantics: 16 native RX 6600 cases checked typed R32_UINT loads/stores, execution masks, and descriptor bounds. PS5 hardware was not tested. Isolated comparison: upstream `e9846679` versus the same revision plus this PR. Complete fill-and-publish medians fell from 0.592 → 0.303 ms at 4 KiB, 1.175 → 0.431 ms at 1 MiB, and 92.070 → 7.370 ms at 64 MiB. Six pinned processes per variant in ABBA order; the pattern changes each fill and every output word is checked. These are component timings, not title frame time. Windows was not tested. ### Checklist - [x] Current `main`; no duplicate open PR. - [x] One topic. - [x] No new code comments. - [x] Unsupported paths still throw; UI stubs are documented. - [x] No notes, logs, or images in the repository. - [x] No new third-party code. - [x] General behavior. - [x] Depends on: none. - [x] AI-assisted: yes.
TibixDev commented 2026-10-08 06:10:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-08T06:10:56Z.


Rebased on e9846679 with no production changes.

Measured upstream e9846679 against the same revision plus this PR (ce280a19). Fedora 44, GCC 16 Release, Ryzen 5 5600, CPU 3, RX 6600 with host RADV and its matching host library directory. Supporting libc and libkernel binaries are identical between variants.

The same fixture submits the real wave32 pattern-fill command stream to each driver. Each size has one warmup and nine measured fills. The uniform pattern alternates each time, so an unchanged result cannot satisfy the next fill. The timer includes submission, wait-idle, and publication to the host buffer; every output word is checked after the timer. Buffers are ordinary unregistered host allocations, with default import settings. Six processes per variant in ABBA × 3 order. Validation is off for timing, and no game or build ran alongside it.

Bytes filled Upstream median (ms) PR median (ms) Less time Upstream range PR range
4,096 0.592 0.303 48.9% 0.563–0.716 0.297–0.307
1,048,576 1.175 0.431 63.3% 1.003–1.212 0.369–0.451
67,108,864 92.070 7.370 92.0% 89.539–96.021 7.190–7.521

Both variants pass the command-stream correctness cases under RADV core and sync validation. The PR's full pattern-fill suite also passes with default imports, host imports disabled, and HLE disabled. It covers wave32/wave64, indirect and partial dispatches, bounds, nonuniform fallback, and GPU-to-label ordering. Graphics, PM4, and contribution checks pass.

This is not title frame time. PS5 hardware and Windows were not tested. AI-assisted.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6053591341 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1335#issuecomment-6053591341). Originally posted by [TibixDev](https://github.com/TibixDev) on 2026-10-08T06:10:56Z. --- Rebased on `e9846679` with no production changes. Measured upstream `e9846679` against the same revision plus this PR (`ce280a19`). Fedora 44, GCC 16 Release, Ryzen 5 5600, CPU 3, RX 6600 with host RADV and its matching host library directory. Supporting `libc` and `libkernel` binaries are identical between variants. The same fixture submits the real wave32 pattern-fill command stream to each driver. Each size has one warmup and nine measured fills. The uniform pattern alternates each time, so an unchanged result cannot satisfy the next fill. The timer includes submission, wait-idle, and publication to the host buffer; every output word is checked after the timer. Buffers are ordinary unregistered host allocations, with default import settings. Six processes per variant in ABBA × 3 order. Validation is off for timing, and no game or build ran alongside it. | Bytes filled | Upstream median (ms) | PR median (ms) | Less time | Upstream range | PR range | |---:|---:|---:|---:|---:|---:| | 4,096 | 0.592 | 0.303 | 48.9% | 0.563–0.716 | 0.297–0.307 | | 1,048,576 | 1.175 | 0.431 | 63.3% | 1.003–1.212 | 0.369–0.451 | | 67,108,864 | 92.070 | 7.370 | 92.0% | 89.539–96.021 | 7.190–7.521 | Both variants pass the command-stream correctness cases under RADV core and sync validation. The PR's full pattern-fill suite also passes with default imports, host imports disabled, and HLE disabled. It covers wave32/wave64, indirect and partial dispatches, bounds, nonuniform fallback, and GPU-to-label ordering. Graphics, PM4, and contribution checks pass. This is not title frame time. PS5 hardware and Windows were not tested. AI-assisted.
popcoder565 commented 2026-10-09 19:42:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T19:42:57Z.


Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head ce280a19, merged onto main 8b393b6e in one build with 31 other PRs that had no Windows run.

  • This PR's tests pass: agc_driver_pattern_buffer_fill.
  • Full ctest in that build: 520 of 521. The one failure is guest_offline_imports, broken by #2359 (reported there).

No title was run.

🤖 Addressed by Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6088026162 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1335#issuecomment-6088026162). Originally posted by [popcoder565](https://github.com/popcoder565) on 2026-10-09T19:42:57Z. --- Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head `ce280a19`, merged onto `main` 8b393b6e in one build with 31 other PRs that had no Windows run. - This PR's tests pass: `agc_driver_pattern_buffer_fill`. - Full ctest in that build: 520 of 521. The one failure is `guest_offline_imports`, broken by #2359 (reported there). No title was run. _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
github-actions[bot] commented 2026-10-09 22:03:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T22:03:48Z.


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
#2081 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/BufferFill.cpp L91-98, L100-104
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6090011650 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1335#issuecomment-6090011650). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-09T22:03:48Z. --- <!-- 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 | |---|---|---|---| | #2081 | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/BufferFill.cpp` [L91-98](https://github.com/boykopovar/AnyPS5/blob/5cb747c146c67ffd498ab7ebaced9395035a50f6/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/BufferFill.cpp#L91-L98), [L100-104](https://github.com/boykopovar/AnyPS5/blob/5cb747c146c67ffd498ab7ebaced9395035a50f6/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/BufferFill.cpp#L100-L104) | | |
adriadam10 commented 2026-10-09 23:20:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-09T23:20:50Z.


Checked the exact-kernel match (code words, descriptor strides/formats, thread shape), the uniform/alignment/alias conditions and the dispatch/descriptor clamps against the diff; agc_driver_pattern_buffer_fill passes on Linux (Vulkan) and CI is green on the current head, plus @popcoder565's Windows run. Merging.

Note for whoever lands second between this and #2081: both touch fillBuffer in BufferFill.cpp and will need a small rebase.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6090927180 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1335#issuecomment-6090927180). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-09T23:20:50Z. --- Checked the exact-kernel match (code words, descriptor strides/formats, thread shape), the uniform/alignment/alias conditions and the dispatch/descriptor clamps against the diff; `agc_driver_pattern_buffer_fill` passes on Linux (Vulkan) and CI is green on the current head, plus @popcoder565's Windows run. Merging. Note for whoever lands second between this and #2081: both touch `fillBuffer` in `BufferFill.cpp` and will need a small rebase.
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!1335
No description provided.