perf(graphics): retain vertex input layouts #1316

Merged
TibixDev merged 4 commits from upstream-pr/1316 into main 2026-10-14 14:46:44 +00:00
TibixDev commented 2026-10-07 23:26:44 +00:00 (Migrated from github.com)

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


What

Retain validated vertex layouts for stable shader variants, while bypassing inputs that do not benefit from reuse. Rebased onto main d146ec1b6, including the current vertex-fetch, null-descriptor and record-count behavior.

  • Empty vertex inputs keep the default empty layout; they perform no cache lookup, layout build or shared allocation.
  • A variant evicted from the 1,024-entry cache, or observed changing layout shape under the same ID, is bypassed before the cache mutex. The draw uses the original value-returning layout builder, with no cache allocation or LRU update. The bypass check is a small inline front end to the locked lookup.
  • The bounded 8 KiB bypass bitmap is conservative: hash collisions can suppress caching for another variant, which still receives normal validation. Bits last for the device lifetime. This favors avoiding repeated misses over re-admitting an evicted variant if it becomes hot later.
  • The shape key includes formatComponents and null-descriptor state. Live addresses are validated on each cache hit. Record counts, zero-fill decisions and copied guest bytes remain per-draw work. Draw recipes keep their existing value-owned layouts.

Depends on: none.

Tested

Fedora 44, GCC 16.2.1, Release: agc_vertex_input, agc_driver, agc_driver_pm4 and agc_driver_graphics pass. The cache test also passes with AddressSanitizer and leak detection (ANYPS5_ENABLE_ASAN=ON, ASAN_OPTIONS=detect_leaks=1:halt_on_error=1). Contribution checks and git diff --check pass.

Coverage includes 10,000 generated layouts compared with the original builder, live address rejection, null descriptors, format-component changes, record-count and zero-stride/OOB decisions, retained-layout lifetime after eviction, conservative bypass collisions, invalid bypassed inputs, concurrent reuse and concurrent eviction.

cmake --build build-fedora --target agc_vertex_input_tests agc_driver_tests agc_driver_graphics_tests agc_driver_pm4_tests --parallel 8
ctest --test-dir build-fedora -R '^(agc_vertex_input|agc_driver|agc_driver_graphics|agc_driver_pm4)$' --output-on-failure --timeout 30
ASAN_OPTIONS=detect_leaks=1:halt_on_error=1 ./build-asan-review/tests/agc_vertex_input_tests

Isolated CPU measurements

Ryzen 5 5600, pinned to CPU 3, identical Release executable and format-property callback. The baseline calls BuildVertexInputLayout, whose implementation is unchanged from main d146ec1b6; the cache mode uses the draw's revised layout-selection path. Three ABBA cycles, six processes per mode, one warm-up plus nine measured batches of 32,768 requests each. The table reports medians of process CPU nanoseconds per request; wall time is also printed by the harness. CPU time avoids charging unrelated scheduling delays to either implementation.

Attributes Workload Main, ns/call Revised cache, ns/call
0 Empty layout 4.76 0.49
1 1 reused variant 51.77 16.48
1 64 reused variants 52.26 18.57
1 2,048 cyclic variants 51.61 35.43
1 Already-evicted variants only 52.29 51.86
1 One variant alternating shape 55.08 52.98
4 1 reused variant 199.11 32.12
4 64 reused variants 199.45 34.10
4 2,048 cyclic variants 199.08 119.89
4 Already-evicted variants only 201.74 200.99
4 One variant alternating shape 197.49 201.36
8 1 reused variant 362.01 51.85
8 64 reused variants 361.76 55.54
8 2,048 cyclic variants 360.72 213.30
8 Already-evicted variants only 360.06 365.80
8 One variant alternating shape 363.21 364.23

All output checksums match. Measured reuse cases have 100% cache hits; the cyclic 2,048-variant cases settle at 50%; already-evicted and changing-shape cases take the bypass path with 0%. Empty layouts skip layout construction entirely. Fully bypassed cases are close to baseline: their measured median changes range from approximately -4% to +2%, with overlapping run ranges. The earlier empty-layout and eviction-every-reuse costs are removed.

These are synthetic layout-component measurements, not a saved title trace or frame-time claim. First-time admission still costs a lookup and cache insertion, and this does not establish a title-specific hit rate or a gain under contended multi-threaded draws. Windows runtime and full Linux/Windows CI still need validation.

taskset -c 3 ./build-fedora/tests/agc_vertex_input_tests --benchmark-vertex-input baseline
taskset -c 3 ./build-fedora/tests/agc_vertex_input_tests --benchmark-vertex-input cache

Checklist

  • Based on main at the revision above; related work checked.
  • One topic.
  • No new code comments.
  • Unsupported paths retain their errors.
  • No notes, logs, or images added to the repository.
  • No new third-party code.
  • General behavior.
  • Depends on: none.
  • AI-assisted: yes.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4779707039 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1316). Originally posted by [TibixDev](https://github.com/TibixDev) on 2026-10-07T23:26:44Z. --- ### What Retain validated vertex layouts for stable shader variants, while bypassing inputs that do not benefit from reuse. Rebased onto main `d146ec1b6`, including the current vertex-fetch, null-descriptor and record-count behavior. - Empty vertex inputs keep the default empty layout; they perform no cache lookup, layout build or shared allocation. - A variant evicted from the 1,024-entry cache, or observed changing layout shape under the same ID, is bypassed before the cache mutex. The draw uses the original value-returning layout builder, with no cache allocation or LRU update. The bypass check is a small inline front end to the locked lookup. - The bounded 8 KiB bypass bitmap is conservative: hash collisions can suppress caching for another variant, which still receives normal validation. Bits last for the device lifetime. This favors avoiding repeated misses over re-admitting an evicted variant if it becomes hot later. - The shape key includes `formatComponents` and null-descriptor state. Live addresses are validated on each cache hit. Record counts, zero-fill decisions and copied guest bytes remain per-draw work. Draw recipes keep their existing value-owned layouts. Depends on: none. ### Tested Fedora 44, GCC 16.2.1, Release: `agc_vertex_input`, `agc_driver`, `agc_driver_pm4` and `agc_driver_graphics` pass. The cache test also passes with AddressSanitizer and leak detection (`ANYPS5_ENABLE_ASAN=ON`, `ASAN_OPTIONS=detect_leaks=1:halt_on_error=1`). Contribution checks and `git diff --check` pass. Coverage includes 10,000 generated layouts compared with the original builder, live address rejection, null descriptors, format-component changes, record-count and zero-stride/OOB decisions, retained-layout lifetime after eviction, conservative bypass collisions, invalid bypassed inputs, concurrent reuse and concurrent eviction. ``` cmake --build build-fedora --target agc_vertex_input_tests agc_driver_tests agc_driver_graphics_tests agc_driver_pm4_tests --parallel 8 ctest --test-dir build-fedora -R '^(agc_vertex_input|agc_driver|agc_driver_graphics|agc_driver_pm4)$' --output-on-failure --timeout 30 ASAN_OPTIONS=detect_leaks=1:halt_on_error=1 ./build-asan-review/tests/agc_vertex_input_tests ``` ### Isolated CPU measurements Ryzen 5 5600, pinned to CPU 3, identical Release executable and format-property callback. The baseline calls `BuildVertexInputLayout`, whose implementation is unchanged from main `d146ec1b6`; the cache mode uses the draw's revised layout-selection path. Three ABBA cycles, six processes per mode, one warm-up plus nine measured batches of 32,768 requests each. The table reports medians of process CPU nanoseconds per request; wall time is also printed by the harness. CPU time avoids charging unrelated scheduling delays to either implementation. | Attributes | Workload | Main, ns/call | Revised cache, ns/call | | --- | --- | ---: | ---: | | 0 | Empty layout | 4.76 | 0.49 | | 1 | 1 reused variant | 51.77 | 16.48 | | 1 | 64 reused variants | 52.26 | 18.57 | | 1 | 2,048 cyclic variants | 51.61 | 35.43 | | 1 | Already-evicted variants only | 52.29 | 51.86 | | 1 | One variant alternating shape | 55.08 | 52.98 | | 4 | 1 reused variant | 199.11 | 32.12 | | 4 | 64 reused variants | 199.45 | 34.10 | | 4 | 2,048 cyclic variants | 199.08 | 119.89 | | 4 | Already-evicted variants only | 201.74 | 200.99 | | 4 | One variant alternating shape | 197.49 | 201.36 | | 8 | 1 reused variant | 362.01 | 51.85 | | 8 | 64 reused variants | 361.76 | 55.54 | | 8 | 2,048 cyclic variants | 360.72 | 213.30 | | 8 | Already-evicted variants only | 360.06 | 365.80 | | 8 | One variant alternating shape | 363.21 | 364.23 | All output checksums match. Measured reuse cases have 100% cache hits; the cyclic 2,048-variant cases settle at 50%; already-evicted and changing-shape cases take the bypass path with 0%. Empty layouts skip layout construction entirely. Fully bypassed cases are close to baseline: their measured median changes range from approximately -4% to +2%, with overlapping run ranges. The earlier empty-layout and eviction-every-reuse costs are removed. These are synthetic layout-component measurements, not a saved title trace or frame-time claim. First-time admission still costs a lookup and cache insertion, and this does not establish a title-specific hit rate or a gain under contended multi-threaded draws. Windows runtime and full Linux/Windows CI still need validation. ``` taskset -c 3 ./build-fedora/tests/agc_vertex_input_tests --benchmark-vertex-input baseline taskset -c 3 ./build-fedora/tests/agc_vertex_input_tests --benchmark-vertex-input cache ``` ### Checklist - [x] Based on main at the revision above; related work checked. - [x] One topic. - [x] No new code comments. - [x] Unsupported paths retain their errors. - [x] No notes, logs, or images added to the repository. - [x] No new third-party code. - [x] General behavior. - [x] Depends on: none. - [x] AI-assisted: yes.
TibixDev commented 2026-10-08 05:25:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-08T05:25:38Z.


Rebased again on c8a2f063 to preserve the new BDA test registration. The measured vertex code is unchanged. I compared the production headers at 5850a6cd with that upstream plus this PR alone, using the same CPU harness and a fixed format-property query. No other PR was included.

Fedora 44, GCC 16 -O3 -DNDEBUG, Ryzen 5 5600 pinned to CPU 3. Six runs per variant in ABBA order; one warmup and nine measured batches per run. Values are medians of the six run medians.

The saved 20,000-request layout trace fell from 165.5 to 19.8 ns/call, or 88.0% less time. Each timed batch repeated it eight times. Run medians ranged from 163.3–181.7 ns upstream and 19.7–20.0 ns with this PR.

Synthetic cases, ns/call (upstream → PR):

Attributes 1 variant 64 variants 2,048 variants
0 1.6 → 7.8 1.6 → 8.0 1.6 → 8.2
1 49.7 → 13.3 49.8 → 15.1 50.2 → 118.2
4 201.7 → 19.3 200.0 → 22.9 201.7 → 331.9
8 367.5 → 29.9 368.6 → 35.4 366.4 → 472.2

All output checksums match. The cache capacity is 1,024, so the 2,048-variant cases measure eviction on each reuse. Empty layouts and over-capacity workloads regress. These CPU measurements do not establish a frame-time gain.

The vertex-input, driver, graphics and PM4 tests pass. Windows was not tested.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6052985368 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1316#issuecomment-6052985368). Originally posted by [TibixDev](https://github.com/TibixDev) on 2026-10-08T05:25:38Z. --- Rebased again on `c8a2f063` to preserve the new BDA test registration. The measured vertex code is unchanged. I compared the production headers at `5850a6cd` with that upstream plus this PR alone, using the same CPU harness and a fixed format-property query. No other PR was included. Fedora 44, GCC 16 `-O3 -DNDEBUG`, Ryzen 5 5600 pinned to CPU 3. Six runs per variant in ABBA order; one warmup and nine measured batches per run. Values are medians of the six run medians. The saved 20,000-request layout trace fell from **165.5 to 19.8 ns/call**, or **88.0% less time**. Each timed batch repeated it eight times. Run medians ranged from 163.3–181.7 ns upstream and 19.7–20.0 ns with this PR. Synthetic cases, ns/call (upstream → PR): | Attributes | 1 variant | 64 variants | 2,048 variants | | --- | ---: | ---: | ---: | | 0 | 1.6 → 7.8 | 1.6 → 8.0 | 1.6 → 8.2 | | 1 | 49.7 → 13.3 | 49.8 → 15.1 | 50.2 → 118.2 | | 4 | 201.7 → 19.3 | 200.0 → 22.9 | 201.7 → 331.9 | | 8 | 367.5 → 29.9 | 368.6 → 35.4 | 366.4 → 472.2 | All output checksums match. The cache capacity is 1,024, so the 2,048-variant cases measure eviction on each reuse. Empty layouts and over-capacity workloads regress. These CPU measurements do not establish a frame-time gain. The vertex-input, driver, graphics and PM4 tests pass. Windows was not tested.
TibixDev commented 2026-10-08 06:36:58 +00:00 (Migrated from github.com)

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


Fixed the clean-build failure: the vertex-input test now includes the repository Vulkan headers explicitly. Rebased on 7a178e22. The production cache code is unchanged.

Linux Release test and convention checks pass. MinGW compiles the test source. The local Windows link is blocked by unresolved SjLj symbols in libc, so Windows runtime validation is left to CI.

I checked #1426: it handles short vertex buffers and does not replace this cache.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6054005364 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1316#issuecomment-6054005364). Originally posted by [TibixDev](https://github.com/TibixDev) on 2026-10-08T06:36:58Z. --- Fixed the clean-build failure: the vertex-input test now includes the repository Vulkan headers explicitly. Rebased on `7a178e22`. The production cache code is unchanged. Linux Release test and convention checks pass. MinGW compiles the test source. The local Windows link is blocked by unresolved SjLj symbols in libc, so Windows runtime validation is left to CI. I checked #1426: it handles short vertex buffers and does not replace this cache.
adriadam10 commented 2026-10-09 22:58:37 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


Thanks. The code reads fine and agc_vertex_input passes here (Linux, full ctest 420/420), but two things before this can land:

  • Your own numbers show regressions: 8 attributes with 2,048 variants goes 366.4 → 472.2 ns/call and empty layouts 1.6 → 8 ns/call, while the win is on a saved 20,000-request trace. Please show it helps on real draw streams (hit rate of the cache and frame/CPU time on a title, with the title ID), or limit it to the cases that win (e.g. skip the cache when it misses repeatedly or for empty layouts) and drop what measured slower.
  • It conflicts with main in core/libs/prx/libSceAgcDriver/CMakeLists.txt (test list). Please rebase and rerun agc_vertex_input and agc_driver_graphics afterwards.

Not verified on our side: Windows runtime and real-title performance.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5476159573 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1316#pullrequestreview-5476159573). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-09T22:58:37Z. **Review:** CHANGES_REQUESTED --- Thanks. The code reads fine and `agc_vertex_input` passes here (Linux, full ctest 420/420), but two things before this can land: - Your own numbers show regressions: 8 attributes with 2,048 variants goes 366.4 → 472.2 ns/call and empty layouts 1.6 → 8 ns/call, while the win is on a saved 20,000-request trace. Please show it helps on real draw streams (hit rate of the cache and frame/CPU time on a title, with the title ID), or limit it to the cases that win (e.g. skip the cache when it misses repeatedly or for empty layouts) and drop what measured slower. - It conflicts with `main` in `core/libs/prx/libSceAgcDriver/CMakeLists.txt` (test list). Please rebase and rerun `agc_vertex_input` and `agc_driver_graphics` afterwards. Not verified on our side: Windows runtime and real-title performance.
adriadam10 commented 2026-10-11 08:53:54 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


Thanks for the work. Following up on the earlier request, which has had no reply or push. Two things still block this:

  • No evidence on real draws. The win (165.5 → 19.8 ns/call) is a replay of a saved layout trace, while your own table shows two regressions (8 attributes × 2,048 variants 366.4 → 472.2 ns/call; empty layouts 1.6 → 8 ns/call). The most this can save is ~145 ns per draw, against a mutex, an LRU list and a shared_ptr on every draw. Please post the cache hit rate and CPU/frame time on a title (title ID, host), or make the cache pay only where it wins: leave empty layouts on the old path and don't take the lock for a variant that keeps missing.
  • It now conflicts with main in Graphics/include/VertexInput.hpp, Graphics/include/Context.hpp and libSceAgcDriver/CMakeLists.txt (the vertex-fetch changes from #1769 and the null-V# / record-count fixes touched the same functions). When you rebase, check that the cached layout keeps honouring those: the zero-fill and null-V# cases must still be validated per draw, not frozen into the cached shape. Rerun agc_vertex_input and agc_driver_graphics afterwards.

Not verified on our side: Windows runtime and real-title performance.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5482651348 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1316#pullrequestreview-5482651348). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T08:53:54Z. **Review:** CHANGES_REQUESTED --- Thanks for the work. Following up on the earlier request, which has had no reply or push. Two things still block this: - **No evidence on real draws.** The win (165.5 → 19.8 ns/call) is a replay of a saved layout trace, while your own table shows two regressions (8 attributes × 2,048 variants 366.4 → 472.2 ns/call; empty layouts 1.6 → 8 ns/call). The most this can save is ~145 ns per draw, against a mutex, an LRU list and a `shared_ptr` on every draw. Please post the cache hit rate and CPU/frame time on a title (title ID, host), or make the cache pay only where it wins: leave empty layouts on the old path and don't take the lock for a variant that keeps missing. - **It now conflicts with `main`** in `Graphics/include/VertexInput.hpp`, `Graphics/include/Context.hpp` and `libSceAgcDriver/CMakeLists.txt` (the vertex-fetch changes from #1769 and the null-V# / record-count fixes touched the same functions). When you rebase, check that the cached layout keeps honouring those: the zero-fill and null-V# cases must still be validated per draw, not frozen into the cached shape. Rerun `agc_vertex_input` and `agc_driver_graphics` afterwards. Not verified on our side: Windows runtime and real-title performance.
TibixDev commented 2026-10-12 04:20:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by TibixDev on 2026-10-12T04:20:35Z.


@adriadam10 addressed the rebase and cache-regression requests in d7718f8d4, based on main d146ec1b6.

Empty inputs now skip layout construction and the cache entirely. Evicted variants, and variants that change shape under the same ID, take an inline bypass before the mutex and use the original value-owned builder. The bounded bypass bitmap can conservatively suppress caching after a hash collision; that tradeoff and first-admission costs are documented in the body.

The rebase preserves per-draw address, record-count and zero-fill behavior, and adds formatComponents and null-descriptor state to shape matching. Regression tests cover those cases, retained lifetime, bypassed invalid inputs and concurrent eviction.

Fresh isolated CPU measurements (same executable, main's unchanged builder versus revised selection; six processes/mode, ABBA, CPU 3): eight-attribute reuse 362.0 → 51.8 ns/call, and 2,048 cyclic variants 360.7 → 213.3 ns/call. Empty selection skips construction; fully bypassed cases are near baseline (roughly -4% to +2%, overlapping ranges). The reproducible harness, full table and synthetic hit rates are in the body. These are component timings; title hit rates/frame-time gains remain unmeasured.

agc_vertex_input, agc_driver, agc_driver_graphics and agc_driver_pm4 pass; the vertex-input suite also passes ASan with leak detection. Contribution checks pass. Ready for another review; full Linux/Windows CI still needs a maintainer run.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6117683450 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1316#issuecomment-6117683450). Originally posted by [TibixDev](https://github.com/TibixDev) on 2026-10-12T04:20:35Z. --- @adriadam10 addressed the rebase and cache-regression requests in `d7718f8d4`, based on main `d146ec1b6`. Empty inputs now skip layout construction and the cache entirely. Evicted variants, and variants that change shape under the same ID, take an inline bypass before the mutex and use the original value-owned builder. The bounded bypass bitmap can conservatively suppress caching after a hash collision; that tradeoff and first-admission costs are documented in the body. The rebase preserves per-draw address, record-count and zero-fill behavior, and adds `formatComponents` and null-descriptor state to shape matching. Regression tests cover those cases, retained lifetime, bypassed invalid inputs and concurrent eviction. Fresh isolated CPU measurements (same executable, main's unchanged builder versus revised selection; six processes/mode, ABBA, CPU 3): eight-attribute reuse **362.0 → 51.8 ns/call**, and 2,048 cyclic variants **360.7 → 213.3 ns/call**. Empty selection skips construction; fully bypassed cases are near baseline (roughly -4% to +2%, overlapping ranges). The reproducible harness, full table and synthetic hit rates are in the body. These are component timings; title hit rates/frame-time gains remain unmeasured. `agc_vertex_input`, `agc_driver`, `agc_driver_graphics` and `agc_driver_pm4` pass; the vertex-input suite also passes ASan with leak detection. Contribution checks pass. Ready for another review; full Linux/Windows CI still needs a maintainer run.
oneandonlydean commented 2026-10-12 08:23:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T08:23:36Z.


Conflicts with main in Graphics/include/Context.hpp (c9e48e5ae2 added sampleLocationSampleCounts on the line after singlePassStorage); please rebase.

One question while you are there: Graphics/src/Draw.cpp:1117 now runs ValidateVertexAddresses on the recipe path, which main doesn't validate. That is a format decode per attribute on every recipe hit. What does it guard? If nothing, please drop it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6120511129 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1316#issuecomment-6120511129). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-12T08:23:36Z. --- Conflicts with main in `Graphics/include/Context.hpp` (c9e48e5ae2 added `sampleLocationSampleCounts` on the line after `singlePassStorage`); please rebase. One question while you are there: `Graphics/src/Draw.cpp:1117` now runs `ValidateVertexAddresses` on the recipe path, which `main` doesn't validate. That is a format decode per attribute on every recipe hit. What does it guard? If nothing, please drop it.
adriadam10 commented 2026-10-13 09:01:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T09:01:45Z.

Review: CHANGES_REQUESTED


Thanks for the rework; the bypass for empty and evicted layouts addresses the earlier regressions. Still open:

  • Conflict: Graphics/include/Context.hpp conflicts with main (sampleLocationSampleCounts was added after singlePassStorage). Please rebase and rerun the PR's tests afterwards.
  • Recipe path (Graphics/src/Draw.cpp:1117): ValidateVertexAddresses runs on every recipe hit, while main only copies recipe->vertexInput there. That is a behaviour change plus a format decode per attribute per draw, and it is the question @oneandonlydean asked. Please drop it, or say which case it guards and add a test that fails without it.
  • Evidence on real draws: the numbers are still synthetic, with no hit rate or CPU/frame time from a title. The most this saves is about 150 ns per draw (4 attributes), against a mutex and LRU update on every cached draw. Please post the hit rate and CPU time on a title (ID, host), or explain why the gain is worth the added state.
  • The bypass bitmap is never cleared and a hash collision silently disables caching for another variant; a short note on why that is acceptable for long sessions would help.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5501174332 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1316#pullrequestreview-5501174332). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-13T09:01:45Z. **Review:** CHANGES_REQUESTED --- Thanks for the rework; the bypass for empty and evicted layouts addresses the earlier regressions. Still open: - **Conflict**: `Graphics/include/Context.hpp` conflicts with main (`sampleLocationSampleCounts` was added after `singlePassStorage`). Please rebase and rerun the PR's tests afterwards. - **Recipe path** (`Graphics/src/Draw.cpp:1117`): `ValidateVertexAddresses` runs on every recipe hit, while main only copies `recipe->vertexInput` there. That is a behaviour change plus a format decode per attribute per draw, and it is the question @oneandonlydean asked. Please drop it, or say which case it guards and add a test that fails without it. - **Evidence on real draws**: the numbers are still synthetic, with no hit rate or CPU/frame time from a title. The most this saves is about 150 ns per draw (4 attributes), against a mutex and LRU update on every cached draw. Please post the hit rate and CPU time on a title (ID, host), or explain why the gain is worth the added state. - The bypass bitmap is never cleared and a hash collision silently disables caching for another variant; a short note on why that is acceptable for long sessions would help.
adriadam10 commented 2026-10-14 14:19:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T14:19:14Z.

Review: APPROVED


Picked this up from here since the branch had no push after the last review:

  • Rebased onto current main (conflicts in CMakeLists.txt, Context.hpp, Draw.cpp).
  • Recipe path: dropped ValidateVertexAddresses, a recipe hit copies recipe->vertexInput exactly as main does (@oneandonlydean's question).
  • Hit rate / title numbers: not available to us either; the synthetic table stands as the measured benefit, and the bypass removes the regressions seen before. The note about the never-cleared bypass bitmap is already in the PR body.

agc_vertex_input and the scoped ctest (714 tests) pass on the rebased head; agc_driver_tessellation segfaults inside RADV's pipeline-library link, as on main. Merging once the full build is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5519407874 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1316#pullrequestreview-5519407874). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T14:19:14Z. **Review:** APPROVED --- Picked this up from here since the branch had no push after the last review: - Rebased onto current main (conflicts in `CMakeLists.txt`, `Context.hpp`, `Draw.cpp`). - Recipe path: dropped `ValidateVertexAddresses`, a recipe hit copies `recipe->vertexInput` exactly as main does (@oneandonlydean's question). - Hit rate / title numbers: not available to us either; the synthetic table stands as the measured benefit, and the bypass removes the regressions seen before. The note about the never-cleared bypass bitmap is already in the PR body. `agc_vertex_input` and the scoped ctest (714 tests) pass on the rebased head; `agc_driver_tessellation` segfaults inside RADV's pipeline-library link, as on main. Merging once the full build is green.
github-actions[bot] commented 2026-10-14 14:26:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T14:26:52Z.


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
#4932 core/libs/prx/libSceAgcDriver/CMakeLists.txt L1420
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6170684805 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1316#issuecomment-6170684805). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-14T14:26:52Z. --- <!-- 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 | |---|---|---|---| | #4932 | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` [L1420](https://github.com/boykopovar/AnyPS5/blob/979ad7b6aaa0a3e0df120586230193e6f9a055b5/core/libs/prx/libSceAgcDriver/CMakeLists.txt#L1420) | | |
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!1316
No description provided.