perf(shader): keep up to three IR operands inside the value #11820

Merged
milescoviello merged 3 commits from upstream-pr/11820 into main 2026-10-29 11:58:07 +00:00
milescoviello commented 2026-10-27 08:52:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-27T08:52:22Z.


What

Every IR value keeps its operands in a std::vector<IrValue*>, which the constructor reserves to the opcode's operand count. So almost every value makes a second heap allocation, and each operand read follows a pointer away from the value itself.

This change replaces the vector with IrOperands. It holds up to three operands inside the value and moves to a heap array only when a value gets more, for example a phi with many predecessors.

On 152 Crimson Desert (PPSA25286 01.000.568) shader requests:

  • agc_shader_replay --prepare uses 19.2 % less CPU time (8 of 8 rounds, rotating order) and 2.8 % less peak memory.
  • With #11798 (the IR value pool) also applied, the two together use 33.5 % less CPU time than main, so the gains stack.

All 65 Crimson Desert and 302 MXGP 26 (PPSA30839 01.003.000) SPIR-V outputs are byte-identical.

How

IrOperands (in IrValue.hpp):

  • Layout: a 32-bit size, a 32-bit capacity, and a union of three inline pointers with a heap pointer. It is 8 bytes larger than the vector it replaces (IrValue goes from 128 to 136 bytes) and needs no allocation for up to three operands.
  • Growth: past three operands, it allocates an array of the requested size and doubles from there. It frees that array on destruction.
  • Interface: size, empty, begin/end, operator[], at, front, back, push_back, reserve, clear, and assignment from the vector SetDetachedOperands takes. That covers every use of Arguments(), which only iterates, indexes or copies the operands into a vector.

IrValue::Arguments() now returns const IrOperands&. Nothing else changes: same operand order, and the same use lists, IDs and dumps.

ShaderDiskCache.cpp asserts sizeof(IrValue) as a reminder for the plan value encoder. The encoder writes operands one at a time through ArgumentCount() and Arguments(), so the disk format doesn't change; only the asserted size moves to 136.

Where the time goes: one DWARF profile per side (perf record --call-graph dwarf -F 199, same input) shows:

  • Samples fall from 3451 to 2956.
  • Allocator functions fall from 861 to 753.
  • IrValue accessors fall from 482 to 355. For example, Argument drops from 28 to 6 and HasUses from 169 to 115.

The operands now sit next to the rest of the value.

Tested

Linux, i7-13700K, GCC 15.2, Release with ANYPS5_ENABLE_SPIRV_TOOLS=OFF. I built cmake --build build-rel --target agc_shader_replay at main 13926067ac, at this change, and at this change merged with #11798.

  • Equivalence: I ran ANYPS5_NO_SHADER_CACHE=1 agc_shader_replay --spv over the same 152 Crimson Desert and 305 MXGP 26 requests as #11719 (input hashes in #11719). Each binary ran in an empty directory per set, and I diffed the sha256sum * | sort -k2 lists. All 65 and 302 SPIR-V outputs are byte-identical to main's, with and without #11798.
  • CPU time and memory: each run was ANYPS5_NO_SHADER_CACHE=1 /usr/bin/time -f %M perf stat -x, -e task-clock agc_shader_replay --prepare <the 152 requests> in a fresh empty directory, with four binaries per round in a rotating order:
Round Order main (ms) this PR (ms) change #11798 (ms) both (ms) main RSS (KB) this PR RSS (KB)
1 main, #11798, this, both 15568 12563 -19.3 % 12716 10479 271348 264896
2 both, this, #11798, main 15712 12526 -20.3 % 12888 10425 271492 264200
3 this, main, both, #11798 15715 12784 -18.6 % 12976 10518 271736 264144
4 #11798, both, main, this 15726 12919 -17.8 % 12794 10469 271332 263808
5 main, #11798, this, both 15860 12805 -19.3 % 12896 10509 271804 263840
6 both, this, #11798, main 15840 12878 -18.7 % 12916 10529 271568 263452
7 this, main, both, #11798 16014 12822 -19.9 % 12864 10592 272060 263644
8 #11798, both, main, this 15775 12638 -19.9 % 12983 10472 270948 263180

Means over the 8 rounds:

Build CPU time vs main Mean max RSS
main 15.78 s (SD 0.13) — 271.5 MB
this PR 12.74 s (SD 0.15) −19.2 % 263.9 MB
#11798 12.88 s −18.4 % 269.5 MB
both 10.50 s −33.5 % 263.0 MB

This PR is lower than main in all 8 rounds. The binaries' sha256 prefixes are 50c1220f47cc (main), c78ab132d352 (this PR) and 576b021a843d (both). These numbers use glibc's allocator, which titles use on Linux; I haven't measured Windows' default heap.

  • Tests: I ran the 19 AGC test targets whose sources use IrProgram (the same set as #11798, 20 ctest entries) and agc_shader_disk_cache_tests (7 entries), because of the size assert. Each passes 3 of 3 (--repeat until-fail:3) on an RTX 4070 Ti (NVIDIA 615.71.09) at this head. This PR also extends agc_ir_reclaim:

    • a value with seven operands, checking each operand and its use;
    • ReplaceArgument on heap-stored operands;
    • SetDetachedOperands with five operands;
    • a reclaim that must remove exactly the detached value and the operand that lost its last use, leaving the live value's operands intact.

    On Windows 11 (WinLibs GCC 15.2, Release, GT 1030 with NVIDIA R580), the same 26 ctest entries pass 3 of 3 at this head and at its base 13926067ac. Under AddressSanitizer (ANYPS5_ENABLE_ASAN=ON, RelWithDebInfo), agc_ir_reclaim, including the new grown-operand cases, and agc_validate_program pass 3 of 3 at this head with no ASan report.

This is a CPU-only shader-compilation change with byte-identical SPIR-V, like #11719, #9132 and #9198. It therefore uses the paired CPU replay that oneandonlydean accepted for those (#11719) instead of title captures.

Rebased head e339f57e4d (on main ca0e9557aa), after review:

  • agc_shader_memory's compaction check now asserts Arguments().capacity() == max(ArgumentCount(), IrOperands::InlineCapacity), meaning no spare heap operand storage. SetDetachedOperands gives detached operands exactly the storage they need, as the vector it replaced did.
  • I built all 46 test targets whose sources use the IR API (Arguments(), OperandUses(), the IR value types), agc_shader_memory_tests and agc_ir_reclaim_tests included. All 75 of their ctest entries pass 3 of 3 (--repeat until-fail:3) on an RTX 4070 Ti, the 7 disk-cache entries among them.
  • AddressSanitizer: agc_ir_reclaim, agc_validate_program and agc_shader_memory pass 3 of 3 with no report.
  • Against main's agc_shader_replay rebuilt at the same base ca0e9557aa, all 65 Crimson Desert and 302 MXGP 26 SPIR-V outputs are byte-identical. Four alternating --prepare rounds give 15.59/15.72/15.59/15.39 s for main and 12.54/12.91/12.40/12.57 s for this PR (means 15.57 and 12.61 s, −19.0 %).
  • Windows 11 VM, rebased head: queued; I'll add the result.

Merge order

  • #9132 (mine): it moves IrValue's trivial accessors, Arguments() among them, into the header, so the two touch the same lines of IrValue.cpp. #9132 lands first, and this PR gets rebased onto it so that Arguments() returns const IrOperands& in the header.
  • #7689 (MarcZX10): it changes the IrResourcePlan size assert on the line above this PR's IrValue assert, a one-line textual conflict with no behavioural dependency. MarcZX10 agreed on #7689 (comment) that whichever of the two lands second keeps both new values, so neither depends on the other.
  • #12039 (mine): it also changes the IrValue size assert from 128 to 136, for its use-list allocator. The two edits are identical, so git merges them without a conflict, but together IrValue is 144 bytes. #12039 declares Depends on: #11820, so it lands after this one and sets the assert to 144 when it's rebased (the combined layout is validated in #12039's description).

Title captures: Super Meat Boy 3D, main 9af563f33d + #11580 (608dd76843) against the same + this PR (4f3d1e1d88), 5 interleaved rounds, recompiler cache off. Shader.PrepareArtifact worker time over each run's first 400 worker artifacts is 8,696 ms → 7,335 ms (-15.6 %, lower in 5 of 5) and title-thread time over the first 350 is 5,781 ms → 5,337 ms (-7.7 %, 4 of 5); over the whole window, leaving out rounds 2 and 4 where the PR run reached a later scene, workers are 12,018 ms → 10,397 ms (-13.5 %) (table and traces). Round 3's summary lines:

{"commit":"608dd7684303","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"0:60"},"gpu":"NVIDIA GeForce RTX 4070 Ti","driver":"NVIDIA 615.71.09","os":"Linux 7.0.0-38-generic","cpu":"13th Gen Intel(R) Core(TM) i7-13700K","cpu_threads":24,"memory_mib":30993,"title_id":"PPSA31162","title":"Super Meat Boy 3D","content_version":"02.000.001","resolution":"3840x2160","window":{"spec":"seconds 0:60","first_present":0,"ms":60083.567},"presents":410,"frame_ms":{"p50":130.925,"p90":145.249,"p99":1415.722,"max":4010.583},"gpu_busy_ms_per_present":90.480,"worker_busy_pct":{"queue worker 0x0":86.259,"queue worker 0x20":83.401},"top_phases_ms_per_frame":{"Driver.Packet":248.556,"Driver.Packet.memory_wait":122.360,"Driver.Packet.dispatch":57.426,"Driver.Dispatch":57.237,"Driver.Packet.pipeline_drain":43.140,"Shader.PrepareArtifact":42.567,"Recorder.Sync":40.107,"Graphics.Draw":34.456},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":39.507,"events_lost":311938,"totals_full":false}},"trace":"aps5-trace-608dd7684303-3.json.gz"}
{"commit":"4f3d1e1d888f","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"0:60"},"gpu":"NVIDIA GeForce RTX 4070 Ti","driver":"NVIDIA 615.71.09","os":"Linux 7.0.0-38-generic","cpu":"13th Gen Intel(R) Core(TM) i7-13700K","cpu_threads":24,"memory_mib":30993,"title_id":"PPSA31162","title":"Super Meat Boy 3D","content_version":"02.000.001","resolution":"3840x2160","window":{"spec":"seconds 0:60","first_present":0,"ms":60041.991},"presents":416,"frame_ms":{"p50":127.514,"p90":145.863,"p99":1424.379,"max":3983.692},"gpu_busy_ms_per_present":88.201,"worker_busy_pct":{"queue worker 0x0":86.397,"queue worker 0x20":84.361},"top_phases_ms_per_frame":{"Driver.Packet":246.394,"Driver.Packet.memory_wait":121.039,"Driver.Packet.dispatch":58.239,"Driver.Dispatch":58.088,"Driver.Packet.pipeline_drain":40.545,"Recorder.Sync":39.036,"GpuMutex.wait.hook":37.480,"Shader.PrepareArtifact":36.561},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":39.199,"events_lost":334373,"totals_full":false}},"trace":"aps5-trace-4f3d1e1d888f-3.json.gz"}

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #9132 (textual overlap in IrValue.cpp; it lands first and this PR rebases onto it)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA RTX 4070 Ti (Linux, 615.71.09) for the AGC tests; the replay itself is CPU-only
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5031148460 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11820). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-27T08:52:22Z. --- ### What Every IR value keeps its operands in a `std::vector<IrValue*>`, which the constructor reserves to the opcode's operand count. So almost every value makes a second heap allocation, and each operand read follows a pointer away from the value itself. This change replaces the vector with `IrOperands`. It holds up to three operands inside the value and moves to a heap array only when a value gets more, for example a phi with many predecessors. On 152 Crimson Desert (PPSA25286 01.000.568) shader requests: - `agc_shader_replay --prepare` uses **19.2 % less CPU time** (8 of 8 rounds, rotating order) and 2.8 % less peak memory. - With #11798 (the IR value pool) also applied, the two together use **33.5 % less** CPU time than `main`, so the gains stack. All 65 Crimson Desert and 302 MXGP 26 (PPSA30839 01.003.000) SPIR-V outputs are byte-identical. ### How `IrOperands` (in `IrValue.hpp`): - **Layout:** a 32-bit size, a 32-bit capacity, and a union of three inline pointers with a heap pointer. It is 8 bytes larger than the vector it replaces (`IrValue` goes from 128 to 136 bytes) and needs no allocation for up to three operands. - **Growth:** past three operands, it allocates an array of the requested size and doubles from there. It frees that array on destruction. - **Interface:** `size`, `empty`, `begin`/`end`, `operator[]`, `at`, `front`, `back`, `push_back`, `reserve`, `clear`, and assignment from the vector `SetDetachedOperands` takes. That covers every use of `Arguments()`, which only iterates, indexes or copies the operands into a vector. `IrValue::Arguments()` now returns `const IrOperands&`. Nothing else changes: same operand order, and the same use lists, IDs and dumps. `ShaderDiskCache.cpp` asserts `sizeof(IrValue)` as a reminder for the plan value encoder. The encoder writes operands one at a time through `ArgumentCount()` and `Arguments()`, so the disk format doesn't change; only the asserted size moves to 136. **Where the time goes:** one DWARF profile per side (`perf record --call-graph dwarf -F 199`, same input) shows: - Samples fall from 3451 to 2956. - Allocator functions fall from 861 to 753. - `IrValue` accessors fall from 482 to 355. For example, `Argument` drops from 28 to 6 and `HasUses` from 169 to 115. The operands now sit next to the rest of the value. ### Tested Linux, i7-13700K, GCC 15.2, Release with `ANYPS5_ENABLE_SPIRV_TOOLS=OFF`. I built `cmake --build build-rel --target agc_shader_replay` at `main` 13926067ac, at this change, and at this change merged with #11798. - **Equivalence:** I ran `ANYPS5_NO_SHADER_CACHE=1 agc_shader_replay --spv` over the same 152 Crimson Desert and 305 MXGP 26 requests as #11719 (input hashes in [#11719](https://github.com/boykopovar/AnyPS5/pull/11719#issuecomment-6435622726)). Each binary ran in an empty directory per set, and I diffed the `sha256sum * | sort -k2` lists. All 65 and 302 SPIR-V outputs are byte-identical to `main`'s, with and without #11798. - **CPU time and memory:** each run was `ANYPS5_NO_SHADER_CACHE=1 /usr/bin/time -f %M perf stat -x, -e task-clock agc_shader_replay --prepare <the 152 requests>` in a fresh empty directory, with four binaries per round in a rotating order: | Round | Order | `main` (ms) | this PR (ms) | change | #11798 (ms) | both (ms) | `main` RSS (KB) | this PR RSS (KB) | |---|---|---|---|---|---|---|---|---| | 1 | main, #11798, this, both | 15568 | 12563 | -19.3 % | 12716 | 10479 | 271348 | 264896 | | 2 | both, this, #11798, main | 15712 | 12526 | -20.3 % | 12888 | 10425 | 271492 | 264200 | | 3 | this, main, both, #11798 | 15715 | 12784 | -18.6 % | 12976 | 10518 | 271736 | 264144 | | 4 | #11798, both, main, this | 15726 | 12919 | -17.8 % | 12794 | 10469 | 271332 | 263808 | | 5 | main, #11798, this, both | 15860 | 12805 | -19.3 % | 12896 | 10509 | 271804 | 263840 | | 6 | both, this, #11798, main | 15840 | 12878 | -18.7 % | 12916 | 10529 | 271568 | 263452 | | 7 | this, main, both, #11798 | 16014 | 12822 | -19.9 % | 12864 | 10592 | 272060 | 263644 | | 8 | #11798, both, main, this | 15775 | 12638 | -19.9 % | 12983 | 10472 | 270948 | 263180 | Means over the 8 rounds: | Build | CPU time | vs `main` | Mean max RSS | |---|---|---|---| | `main` | 15.78 s (SD 0.13) | — | 271.5 MB | | this PR | 12.74 s (SD 0.15) | −19.2 % | 263.9 MB | | #11798 | 12.88 s | −18.4 % | 269.5 MB | | both | 10.50 s | −33.5 % | 263.0 MB | This PR is lower than `main` in all 8 rounds. The binaries' sha256 prefixes are `50c1220f47cc` (`main`), `c78ab132d352` (this PR) and `576b021a843d` (both). These numbers use glibc's allocator, which titles use on Linux; I haven't measured Windows' default heap. - **Tests:** I ran the 19 AGC test targets whose sources use `IrProgram` (the same set as #11798, 20 ctest entries) and `agc_shader_disk_cache_tests` (7 entries), because of the size assert. Each passes 3 of 3 (`--repeat until-fail:3`) on an RTX 4070 Ti (NVIDIA 615.71.09) at this head. This PR also extends `agc_ir_reclaim`: - a value with seven operands, checking each operand and its use; - `ReplaceArgument` on heap-stored operands; - `SetDetachedOperands` with five operands; - a reclaim that must remove exactly the detached value and the operand that lost its last use, leaving the live value's operands intact. On Windows 11 (WinLibs GCC 15.2, Release, GT 1030 with NVIDIA R580), the same 26 ctest entries pass 3 of 3 at this head and at its base `13926067ac`. Under AddressSanitizer (`ANYPS5_ENABLE_ASAN=ON`, RelWithDebInfo), `agc_ir_reclaim`, including the new grown-operand cases, and `agc_validate_program` pass 3 of 3 at this head with no ASan report. This is a CPU-only shader-compilation change with byte-identical SPIR-V, like #11719, #9132 and #9198. It therefore uses the paired CPU replay that oneandonlydean accepted for those ([#11719](https://github.com/boykopovar/AnyPS5/pull/11719#issuecomment-6435583235)) instead of title captures. **Rebased head `e339f57e4d` (on `main` `ca0e9557aa`), after review:** - `agc_shader_memory`'s compaction check now asserts `Arguments().capacity() == max(ArgumentCount(), IrOperands::InlineCapacity)`, meaning no spare heap operand storage. `SetDetachedOperands` gives detached operands exactly the storage they need, as the vector it replaced did. - I built all 46 test targets whose sources use the IR API (`Arguments()`, `OperandUses()`, the IR value types), `agc_shader_memory_tests` and `agc_ir_reclaim_tests` included. All 75 of their ctest entries pass 3 of 3 (`--repeat until-fail:3`) on an RTX 4070 Ti, the 7 disk-cache entries among them. - AddressSanitizer: `agc_ir_reclaim`, `agc_validate_program` and `agc_shader_memory` pass 3 of 3 with no report. - Against `main`'s `agc_shader_replay` rebuilt at the same base `ca0e9557aa`, all 65 Crimson Desert and 302 MXGP 26 SPIR-V outputs are byte-identical. Four alternating `--prepare` rounds give 15.59/15.72/15.59/15.39 s for `main` and 12.54/12.91/12.40/12.57 s for this PR (means 15.57 and 12.61 s, −19.0 %). - Windows 11 VM, rebased head: queued; I'll add the result. ### Merge order - **#9132 (mine):** it moves `IrValue`'s trivial accessors, `Arguments()` among them, into the header, so the two touch the same lines of `IrValue.cpp`. #9132 lands first, and this PR gets rebased onto it so that `Arguments()` returns `const IrOperands&` in the header. - **#7689 (MarcZX10):** it changes the `IrResourcePlan` size assert on the line above this PR's `IrValue` assert, a one-line textual conflict with no behavioural dependency. MarcZX10 agreed on #7689 ([comment](https://github.com/boykopovar/AnyPS5/pull/7689#issuecomment-6440183745)) that whichever of the two lands second keeps both new values, so neither depends on the other. - **#12039 (mine):** it also changes the `IrValue` size assert from 128 to 136, for its use-list allocator. The two edits are identical, so git merges them without a conflict, but together `IrValue` is 144 bytes. #12039 declares `Depends on: #11820`, so it lands after this one and sets the assert to 144 when it's rebased (the combined layout is validated in #12039's description). **Title captures:** Super Meat Boy 3D, `main` `9af563f33d` + #11580 (`608dd76843`) against the same + this PR (`4f3d1e1d88`), 5 interleaved rounds, recompiler cache off. `Shader.PrepareArtifact` worker time over each run's first 400 worker artifacts is 8,696 ms → 7,335 ms (-15.6 %, lower in 5 of 5) and title-thread time over the first 350 is 5,781 ms → 5,337 ms (-7.7 %, 4 of 5); over the whole window, leaving out rounds 2 and 4 where the PR run reached a later scene, workers are 12,018 ms → 10,397 ms (-13.5 %) ([table and traces](https://github.com/milescoviello/AnyPS5/releases/tag/pr11820-smb3d-captures)). Round 3's summary lines: ``` {"commit":"608dd7684303","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"0:60"},"gpu":"NVIDIA GeForce RTX 4070 Ti","driver":"NVIDIA 615.71.09","os":"Linux 7.0.0-38-generic","cpu":"13th Gen Intel(R) Core(TM) i7-13700K","cpu_threads":24,"memory_mib":30993,"title_id":"PPSA31162","title":"Super Meat Boy 3D","content_version":"02.000.001","resolution":"3840x2160","window":{"spec":"seconds 0:60","first_present":0,"ms":60083.567},"presents":410,"frame_ms":{"p50":130.925,"p90":145.249,"p99":1415.722,"max":4010.583},"gpu_busy_ms_per_present":90.480,"worker_busy_pct":{"queue worker 0x0":86.259,"queue worker 0x20":83.401},"top_phases_ms_per_frame":{"Driver.Packet":248.556,"Driver.Packet.memory_wait":122.360,"Driver.Packet.dispatch":57.426,"Driver.Dispatch":57.237,"Driver.Packet.pipeline_drain":43.140,"Shader.PrepareArtifact":42.567,"Recorder.Sync":40.107,"Graphics.Draw":34.456},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":39.507,"events_lost":311938,"totals_full":false}},"trace":"aps5-trace-608dd7684303-3.json.gz"} {"commit":"4f3d1e1d888f","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"0:60"},"gpu":"NVIDIA GeForce RTX 4070 Ti","driver":"NVIDIA 615.71.09","os":"Linux 7.0.0-38-generic","cpu":"13th Gen Intel(R) Core(TM) i7-13700K","cpu_threads":24,"memory_mib":30993,"title_id":"PPSA31162","title":"Super Meat Boy 3D","content_version":"02.000.001","resolution":"3840x2160","window":{"spec":"seconds 0:60","first_present":0,"ms":60041.991},"presents":416,"frame_ms":{"p50":127.514,"p90":145.863,"p99":1424.379,"max":3983.692},"gpu_busy_ms_per_present":88.201,"worker_busy_pct":{"queue worker 0x0":86.397,"queue worker 0x20":84.361},"top_phases_ms_per_frame":{"Driver.Packet":246.394,"Driver.Packet.memory_wait":121.039,"Driver.Packet.dispatch":58.239,"Driver.Dispatch":58.088,"Driver.Packet.pipeline_drain":40.545,"Recorder.Sync":39.036,"GpuMutex.wait.hook":37.480,"Shader.PrepareArtifact":36.561},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":39.199,"events_lost":334373,"totals_full":false}},"trace":"aps5-trace-4f3d1e1d888f-3.json.gz"} ``` ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #9132 (textual overlap in `IrValue.cpp`; it lands first and this PR rebases onto it) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA RTX 4070 Ti (Linux, 615.71.09) for the AGC tests; the replay itself is CPU-only - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-27 08:56:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T08:56:54Z.

Review: CHANGES_REQUESTED


Requesting changes: the current IR API change breaks the existing AGC shader-memory test. In core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp:759, agc_shader_memory_tests calls value.Arguments().capacity(). The new IrOperands type has no public capacity() method; its capacity field is private. I reproduced the compile error against the exact PR header with GCC 12.2: the call resolves to the private uint32_t field and cannot be invoked as a function. CMake includes ShaderMemory.cpp in agc_shader_memory_tests and registers that target for BUILD_TESTING, so this prevents the target from compiling. Please update the compaction assertion to express the intended no-spare-heap-storage invariant for inline operands, or provide a suitable public API and adjust the assertion for inline capacity, then rerun this target at the exact updated head. The hosted relinker jobs do not compile this target, and the full product jobs are skipped, so current green/pending checks do not cover the failure.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5664451762 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11820#pullrequestreview-5664451762). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T08:56:54Z. **Review:** CHANGES_REQUESTED --- Requesting changes: the current IR API change breaks the existing AGC shader-memory test. In core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp:759, agc_shader_memory_tests calls value.Arguments().capacity(). The new IrOperands type has no public capacity() method; its capacity field is private. I reproduced the compile error against the exact PR header with GCC 12.2: the call resolves to the private uint32_t field and cannot be invoked as a function. CMake includes ShaderMemory.cpp in agc_shader_memory_tests and registers that target for BUILD_TESTING, so this prevents the target from compiling. Please update the compaction assertion to express the intended no-spare-heap-storage invariant for inline operands, or provide a suitable public API and adjust the assertion for inline capacity, then rerun this target at the exact updated head. The hosted relinker jobs do not compile this target, and the full product jobs are skipped, so current green/pending checks do not cover the failure.
MarcZX10 commented 2026-10-27 09:28:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T09:28:29Z.

Review: DISMISSED


Follow-up review of the updated head 3c6629017d1c3ffe96b0c5c037a3cac20913075f: the earlier compile issue I found (Arguments().capacity() missing on the new type) appears addressed by the new public capacity() and the inline-capacity-aware assertion. The updated Windows/product and relinker CI jobs are still pending, so I cannot yet verify the fix in the project targets.

Three repository requirements still block approval:

  1. This is titled perf(shader) and carries the perf numbers missing label. The report contains useful replay timings and allocator data, but not the required two valid aps5-summary.jsonl lines from different commits or the attached traces described by the Performance report form. Please add that required evidence or have maintainers record an applicable exception.
  2. The branch base is 5bc84038c490a0427ff272e39e2a1cdf6fdc3c0e, while current main is 801d5b9bc11049e6274daca09d70690bd5b8d0a9. Rebase/update to current main and rerun the affected tests.
  3. The body identifies overlap with open #9132 and #7689, but says either can land second and leaves Depends on: none. CONTRIBUTING asks authors to agree with the overlapping PR authors on landing order and declare the dependency. Please record the agreed order and update the checklist.

I did not run the full shader build or tests locally. I am requesting changes for the missing performance evidence, stale base, and unresolved overlap order; the earlier API compile finding appears fixed, but the current CI run has not completed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5664855997 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11820#pullrequestreview-5664855997). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T09:28:29Z. **Review:** DISMISSED --- Follow-up review of the updated head `3c6629017d1c3ffe96b0c5c037a3cac20913075f`: the earlier compile issue I found (`Arguments().capacity()` missing on the new type) appears addressed by the new public `capacity()` and the inline-capacity-aware assertion. The updated Windows/product and relinker CI jobs are still pending, so I cannot yet verify the fix in the project targets. Three repository requirements still block approval: 1. This is titled `perf(shader)` and carries the `perf numbers missing` label. The report contains useful replay timings and allocator data, but not the required two valid `aps5-summary.jsonl` lines from different commits or the attached traces described by the Performance report form. Please add that required evidence or have maintainers record an applicable exception. 2. The branch base is `5bc84038c490a0427ff272e39e2a1cdf6fdc3c0e`, while current `main` is `801d5b9bc11049e6274daca09d70690bd5b8d0a9`. Rebase/update to current `main` and rerun the affected tests. 3. The body identifies overlap with open #9132 and #7689, but says either can land second and leaves `Depends on: none`. CONTRIBUTING asks authors to agree with the overlapping PR authors on landing order and declare the dependency. Please record the agreed order and update the checklist. I did not run the full shader build or tests locally. I am requesting changes for the missing performance evidence, stale base, and unresolved overlap order; the earlier API compile finding appears fixed, but the current CI run has not completed.
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!11820
No description provided.