fix(agc): build one compute pipeline when results differ only in a table's size #8212

Merged
Ryongen merged 16 commits from upstream-pr/8212 into main 2026-11-14 03:28:54 +00:00
Ryongen commented 2026-10-20 03:26:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Ryongen on 2026-10-20T03:26:12Z.


What

Compute pipelines and their journal modules were keyed on RecompileResult::Identity(), which includes the element count of every binding. DescribeSetLayouts gives image, storage image and sampler tables a fixed-capacity layout, so two results that differ only in a table's size build the same pipeline, but each size got its own VkPipeline and its own module in pipelines.journal. Compute pipelines and the journal's compute records now key on DescribedPipelineIdentity: the same hash with the element count of those three table roles left out. Other binding counts, kinds, specialization constants and the subgroup width still count. The hash lives in the driver, so the shader cache version is unchanged. The journal format goes from 9 to 10, so existing journals are started over. #6612, #6959 and draft #6947 also move the journal format; whichever lands first keeps 10 and the others take the next free number.

Tested

  • Windows 10 22H2 (19045.6466), NVIDIA GeForce RTX 2070 SUPER, driver 617.42.
  • Ghost of Yōtei (PPSA26344), this change on an older main. Before it, one 1,539,381-word compute pipeline was created 327 times from byte-identical inputs (118 times by the journal replay, 209 in game), and the journal held that module 118 times: 1,328 MiB, 65 % of a 2 GiB cap, 976 modules of which 755 were distinct. With it, over three runs every compute pipeline was created once per distinct pipeline, and the journal kept one copy of each module.
  • New checks in agc_pipeline_journal: the described identity ignores the element count of each table role, still changes with a buffer binding's count, with specialization constants and between a sampled and a storage image table, and equals Identity() for results without tables. Two compute results that differ only in an image table's size are recorded as one pipeline and one module and reload without drops. Negative control: with the count put back into the described identity, agc_pipeline_journal fails ("a table's element count entered the described identity").
  • On main (cecb540a6) and on this change, same machine, with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation:
    ctest --test-dir build -R "agc_pipeline_journal|agc_driver_pipeline_journal|agc_pipeline_cache|compute" -V. 20 of 20 pass on both and the layer loads on both. Both logs have the same validation messages and no new ones: 102 × VUID-VkDeviceCreateInfo-pNext-pNext and 51 × VUID-VkPhysicalDeviceProperties2-pNext-pNext. (ImageArrayWindowPastLayerLimit.cpp from main does not compile with MinGW GCC 15 here, "requested alignment '65536' exceeds object file maximum 8192", on main as well; it is not one of these tests.)
  • ctest -R agc -j8 on this change before this rebase (a020d0256): 816 of 819. The three failures fail the same way on main on this machine: agc_driver_msaa_dcc_clear_4 and agc_driver_pass_input_hazard ("multisampled DCC target reuse requires watched guest memory", checked on 500cc640b), and agc_driver_indirect_arguments_pending_producer (device lost in a host import's settle wait, 3 of 3 on a020d0256).

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: none
  • Fixes: none
  • Unblocks: PPSA26344 #675
  • GPUs tested: NVIDIA GeForce RTX 2070 SUPER, driver 617.42, Windows 10 22H2 (19045.6466)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4930561575 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8212). Originally posted by [Ryongen](https://github.com/Ryongen) on 2026-10-20T03:26:12Z. --- ### What Compute pipelines and their journal modules were keyed on `RecompileResult::Identity()`, which includes the element count of every binding. `DescribeSetLayouts` gives image, storage image and sampler tables a fixed-capacity layout, so two results that differ only in a table's size build the same pipeline, but each size got its own `VkPipeline` and its own module in `pipelines.journal`. Compute pipelines and the journal's compute records now key on `DescribedPipelineIdentity`: the same hash with the element count of those three table roles left out. Other binding counts, kinds, specialization constants and the subgroup width still count. The hash lives in the driver, so the shader cache version is unchanged. The journal format goes from 9 to 10, so existing journals are started over. #6612, #6959 and draft #6947 also move the journal format; whichever lands first keeps 10 and the others take the next free number. ### Tested - Windows 10 22H2 (19045.6466), NVIDIA GeForce RTX 2070 SUPER, driver 617.42. - Ghost of Yōtei (PPSA26344), this change on an older `main`. Before it, one 1,539,381-word compute pipeline was created 327 times from byte-identical inputs (118 times by the journal replay, 209 in game), and the journal held that module 118 times: 1,328 MiB, 65 % of a 2 GiB cap, 976 modules of which 755 were distinct. With it, over three runs every compute pipeline was created once per distinct pipeline, and the journal kept one copy of each module. - New checks in `agc_pipeline_journal`: the described identity ignores the element count of each table role, still changes with a buffer binding's count, with specialization constants and between a sampled and a storage image table, and equals `Identity()` for results without tables. Two compute results that differ only in an image table's size are recorded as one pipeline and one module and reload without drops. Negative control: with the count put back into the described identity, `agc_pipeline_journal` fails ("a table's element count entered the described identity"). - On `main` (cecb540a6) and on this change, same machine, with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`: `ctest --test-dir build -R "agc_pipeline_journal|agc_driver_pipeline_journal|agc_pipeline_cache|compute" -V`. 20 of 20 pass on both and the layer loads on both. Both logs have the same validation messages and no new ones: 102 × `VUID-VkDeviceCreateInfo-pNext-pNext` and 51 × `VUID-VkPhysicalDeviceProperties2-pNext-pNext`. (`ImageArrayWindowPastLayerLimit.cpp` from `main` does not compile with MinGW GCC 15 here, "requested alignment '65536' exceeds object file maximum 8192", on `main` as well; it is not one of these tests.) - `ctest -R agc -j8` on this change before this rebase (a020d0256): 816 of 819. The three failures fail the same way on `main` on this machine: `agc_driver_msaa_dcc_clear_4` and `agc_driver_pass_input_hazard` ("multisampled DCC target reuse requires watched guest memory", checked on 500cc640b), and `agc_driver_indirect_arguments_pending_producer` (device lost in a host import's settle wait, 3 of 3 on a020d0256). ### 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: none - [x] Fixes: none - [x] Unblocks: PPSA26344 #675 - [x] GPUs tested: NVIDIA GeForce RTX 2070 SUPER, driver 617.42, Windows 10 22H2 (19045.6466) - [x] AI-assisted: yes
Ryongen commented 2026-10-20 04:12:16 +00:00 (Migrated from github.com)

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


Checked the pull requests the overlap check could not compare. None changes how compute pipelines are keyed. #5925 moves ComputePipelineKey with ComputePipelineKey::Of still on shader.Identity(), so whichever of the two lands second needs Of to use DescribedPipelineIdentity; if #5925 goes first I'll rebase this one onto it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6283196153 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8212#issuecomment-6283196153). Originally posted by [Ryongen](https://github.com/Ryongen) on 2026-10-20T04:12:16Z. --- Checked the pull requests the overlap check could not compare. None changes how compute pipelines are keyed. #5925 moves `ComputePipelineKey` with `ComputePipelineKey::Of` still on `shader.Identity()`, so whichever of the two lands second needs `Of` to use `DescribedPipelineIdentity`; if #5925 goes first I'll rebase this one onto it.
wachi35676 commented 2026-10-20 12:31:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by wachi35676 on 2026-10-20T12:31:46Z.


Ran on the two GPUs not yet covered here: Windows 11 26300, RTX 5070 Ti (617.42) and AMD Radeon iGPU 1002:13c0 (RDNA 2, AMD Windows driver 32.0.21042.62, ANYPS5_GPU=AMD). WinLibs GCC 15.2.0, Release, BUILD_TESTING=ON, ANYPS5_REQUIRE_VULKAN=1, main 02fb1ce53 with this PR (01bbd93c8) merged.

  • The layout side holds: DescribeSetLayouts takes the ImageTable and ImageStorageTable bindings at imageTableCapacity / StorageTableCapacity(context) and SamplerTable at samplerTableCapacity. Table counts don't add to stageResources, so they can't flip updateAfterBind. So mainKey, and with it the ComputePipelineObjects::layout a reused pipeline carries, doesn't depend on a table's count.
  • ctest -R "agc_pipeline_journal|agc_driver_pipeline_journal|agc_pipeline_cache|compute": 20/20 pass on each GPU.
  • Negative control: with the count put back for the table roles in DescribedPipelineIdentity, agc_pipeline_journal fails: a table's element count entered the described identity, which the fixed-capacity layout does not see.
  • ctest -R "agc|shader|spirv|recomp" -j6, 833 tests: RTX fails agc_driver_pass_input_hazard and agc_driver_sgpr_pattern_fill_keys, the iGPU fails agc_driver_mul_lo_u16_high_half and agc_driver_sgpr_pattern_fill_keys. Both sets are the same as main on this machine, so no new failures.

Not run here: a title (no PPSA26344).

AI-assisted: yes (Claude Code); results above were run on this machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6290901563 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8212#issuecomment-6290901563). Originally posted by [wachi35676](https://github.com/wachi35676) on 2026-10-20T12:31:46Z. --- Ran on the two GPUs not yet covered here: Windows 11 26300, RTX 5070 Ti (617.42) and AMD Radeon iGPU `1002:13c0` (RDNA 2, AMD Windows driver 32.0.21042.62, `ANYPS5_GPU=AMD`). WinLibs GCC 15.2.0, Release, `BUILD_TESTING=ON`, `ANYPS5_REQUIRE_VULKAN=1`, `main` `02fb1ce53` with this PR (`01bbd93c8`) merged. - The layout side holds: `DescribeSetLayouts` takes the `ImageTable` and `ImageStorageTable` bindings at `imageTableCapacity` / `StorageTableCapacity(context)` and `SamplerTable` at `samplerTableCapacity`. Table counts don't add to `stageResources`, so they can't flip `updateAfterBind`. So `mainKey`, and with it the `ComputePipelineObjects::layout` a reused pipeline carries, doesn't depend on a table's count. - `ctest -R "agc_pipeline_journal|agc_driver_pipeline_journal|agc_pipeline_cache|compute"`: 20/20 pass on each GPU. - Negative control: with the count put back for the table roles in `DescribedPipelineIdentity`, `agc_pipeline_journal` fails: `a table's element count entered the described identity, which the fixed-capacity layout does not see`. - `ctest -R "agc|shader|spirv|recomp" -j6`, 833 tests: RTX fails `agc_driver_pass_input_hazard` and `agc_driver_sgpr_pattern_fill_keys`, the iGPU fails `agc_driver_mul_lo_u16_high_half` and `agc_driver_sgpr_pattern_fill_keys`. Both sets are the same as `main` on this machine, so no new failures. Not run here: a title (no PPSA26344). AI-assisted: yes (Claude Code); results above were run on this machine.
BunnyFl commented 2026-11-02 21:43:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-02T21:43:37Z.

Review: APPROVED


Reads right. On current main, DescribeSetLayouts (core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp) describes the three table roles with fixed counts (context.samplerTableCapacity, context.imageTableCapacity, StorageTableCapacity(context)), and only the other roles use binding.count. The image table's VARIABLE_DESCRIPTOR_COUNT is chosen at descriptor-set allocation, not in the pipeline. So a table's element count never reaches the pipeline layout, and keying compute pipelines and their journal records on DescribedPipelineIdentity merges only results the driver would build identically. The new identity mixes the same SPIR-V hash, specialization constants, subgroup settings, workgroup memory and per-binding set/binding/kind as before, leaving out only those three roles' counts, and the test checks that it equals Identity() for a result without tables. main's journal FileFormat is still 15 (Graphics/src/PipelineJournal.cpp), so the bump to 16 doesn't collide today.

Tested on Windows 11, WinLibs GCC 15.2.0, with this head merged onto main: agc_pipeline_journal, agc_pipeline_journal_long_paths and agc_pipeline_journal_extended_paths pass, nothing skipped; the long-path run loads its journals through a \?\ path.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5743815438 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8212#pullrequestreview-5743815438). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-02T21:43:37Z. **Review:** APPROVED --- Reads right. On current `main`, `DescribeSetLayouts` (`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`) describes the three table roles with fixed counts (`context.samplerTableCapacity`, `context.imageTableCapacity`, `StorageTableCapacity(context)`), and only the other roles use `binding.count`. The image table's `VARIABLE_DESCRIPTOR_COUNT` is chosen at descriptor-set allocation, not in the pipeline. So a table's element count never reaches the pipeline layout, and keying compute pipelines and their journal records on `DescribedPipelineIdentity` merges only results the driver would build identically. The new identity mixes the same SPIR-V hash, specialization constants, subgroup settings, workgroup memory and per-binding set/binding/kind as before, leaving out only those three roles' counts, and the test checks that it equals `Identity()` for a result without tables. `main`'s journal `FileFormat` is still 15 (`Graphics/src/PipelineJournal.cpp`), so the bump to 16 doesn't collide today. Tested on Windows 11, WinLibs GCC 15.2.0, with this head merged onto `main`: `agc_pipeline_journal`, `agc_pipeline_journal_long_paths` and `agc_pipeline_journal_extended_paths` pass, nothing skipped; the long-path run loads its journals through a `\?\` path.
XairRrR commented 2026-11-02 22:02:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T22:02:03Z.

Review: APPROVED


Reviewed — approved

Compute pipelines and their journal records now use DescribedPipelineIdentity, which leaves out the element count of image, storage image and sampler tables. The pipeline layout never sees those counts, so the change merges only pipelines that would be built identically. It builds, the focused tests pass, and both negative controls fail.

What I ran

Head b7954ac0acd413365165ec38de60ebd5f8850a02, main 9090972b7e91fd266819cbd77a8b058e177b5682, merged with --no-ff (tree 40c2dc871ed96e087eb833ee320cfadebc7a6316). Debian 13 VM (Xeon Gold 6136), GCC 14.2.0, Release, Vulkan on lavapipe (Mesa 26.1.6).

git diff --check 9090972b7e91fd266819cbd77a8b058e177b5682...b7954ac0acd413365165ec38de60ebd5f8850a02
python3 tools/check_conventions.py --base 9090972b7e91fd266819cbd77a8b058e177b5682
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_pipeline_journal|agc_pipeline_journal_long_paths|agc_driver_pipeline_journal|agc_pipeline_cache)$"
# negative control 1: PipelineJournal.cpp and VulkanDevice.cpp from main, DescribedPipelineIdentity kept
ninja -C build -j32 -l32 agc_driver_graphics_tests agc_driver_pipeline_journal_tests
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_pipeline_journal|agc_pipeline_journal_long_paths|agc_driver_pipeline_journal)$"
# negative control 2: merged tree, with the table count put back into DescribedPipelineIdentity
ninja -C build -j32 -l32 agc_driver_graphics_tests
build/tests/agc_driver_graphics_tests --pipeline-journal
# restored the merged files, rebuilt, re-ran agc_pipeline_journal and agc_pipeline_journal_long_paths
git status --porcelain

Results

Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Build (script) ok, libs ok
Selected tests (script, 2038 run) 0 new failures, 0 timeouts. The 7 known failures (agc_driver_division, the denormal-mode tests, unwrap_self, vector_constant_factor_tininess) also fail on main
Vulkan validation (script, 757 tests, layer loaded in 756, none missing) 0 tests with new VUID- lines compared with main
agc_pipeline_journal, agc_pipeline_journal_long_paths pass (0.02–0.04 s)
agc_pipeline_cache pass
agc_driver_pipeline_journal pass, 44.1 s (45.1 s with main's journal and device files, so this is not the PR's; see Non-blocking)
Journal FileFormat 16 here, 15 on main: no collision
Worktree after the controls git status --porcelain empty

Negative control

  1. Keying reverted. I restored PipelineJournal.cpp and VulkanDevice.cpp from main and kept the new DescribedPipelineIdentity so the test still compiles. agc_pipeline_journal and agc_pipeline_journal_long_paths fail:

    output
    AGC graphics: compute results that differ only in their image table's element count were recorded as two pipelines
    
  2. Table count put back. I put binding.count back for the table roles in DescribedPipelineIdentity. --pipeline-journal fails:

    output
    AGC graphics: a table's element count entered the described identity, which the fixed-capacity layout does not see
    

This confirms the author's negative control and wachi35676's. After restoring the merged files, both tests pass again and the worktree is clean.

Findings

Blocking

None.

Non-blocking

  1. The copied hash has already drifted from RecompileResult::Identity(). DescribedPipelineIdentity repeats the mixing code of Identity(), but its subgroup word (core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp:2522, at head) leaves out the functionLdsBuffer (0x20000) and meshWindowBuffer (0x40000) bits that Identity() now mixes (core/shader/recompiler/Recompiler.hpp:839, at head). Those bits came in from main (287b149950) after this branch first wrote the copy.
    • No effect today. Both flags are set only for pixel and mesh stages (SpirvEmitter.cpp, and), and the described identity is used only for compute.
    • Why it matters. The next field added to Identity() that does matter for compute would be silently missing from the compute key. The PR's equality check ("described identity of a result without tables differs from its identity") only covers a result with these flags off, so it would not catch that. The ARCHITECTURE.md sentence "the same hash with the element count ... left out" is also not quite true now.
    • Suggested fix. Keep one implementation, for example a RecompileResult::Identity(bool tableCounts) overload or a shared helper with a per-binding count filter. Or at least mix the same flag bits, and extend the equality check to a result with functionLdsBuffer set.
  2. agc_driver_pipeline_journal is over the 30 s rule. It takes about 44 s here, and the NVIDIA and AMD CI comments show 120 s. It takes the same time with this PR's journal and device changes reverted, and this PR adds its new checks to the fast agc_pipeline_journal (0.02 s). So it does not count against this PR. I mention it only because the runs above show it.

On the layout side, I agree with wachi35676 and BunnyFl:

  • DescribeSetLayouts and ShaderResources describe the three table bindings at imageTableCapacity, StorageTableCapacity(context) and samplerTableCapacity.
  • Table counts never add to stageResources, so they cannot flip updateAfterBind.
  • verifySetLayouts (core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp:5866) would catch a resident pipeline whose set layout differs from the dispatch's.

Not verified

  • The title result (PPSA26344: 327 pipeline creations down to one per distinct pipeline, journal deduplication). I did not launch any title.
  • Hardware GPUs: this machine has only lavapipe. NVIDIA and AMD runs are in the author's description and the CI comments.
  • A dispatch-level test where two table sizes hit the same resident VkPipeline on a real device. The new tests cover the key and the journal, not VulkanDevice::computePipeline reuse.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5744020846 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8212#pullrequestreview-5744020846). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-02T22:02:03Z. **Review:** APPROVED --- # Reviewed — approved Compute pipelines and their journal records now use `DescribedPipelineIdentity`, which leaves out the element count of image, storage image and sampler tables. The pipeline layout never sees those counts, so the change merges only pipelines that would be built identically. It builds, the focused tests pass, and both negative controls fail. ## What I ran Head `b7954ac0acd413365165ec38de60ebd5f8850a02`, `main` `9090972b7e91fd266819cbd77a8b058e177b5682`, merged with `--no-ff` (tree `40c2dc871ed96e087eb833ee320cfadebc7a6316`). Debian 13 VM (Xeon Gold 6136), GCC 14.2.0, Release, Vulkan on lavapipe (Mesa 26.1.6). ``` git diff --check 9090972b7e91fd266819cbd77a8b058e177b5682...b7954ac0acd413365165ec38de60ebd5f8850a02 python3 tools/check_conventions.py --base 9090972b7e91fd266819cbd77a8b058e177b5682 ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_pipeline_journal|agc_pipeline_journal_long_paths|agc_driver_pipeline_journal|agc_pipeline_cache)$" # negative control 1: PipelineJournal.cpp and VulkanDevice.cpp from main, DescribedPipelineIdentity kept ninja -C build -j32 -l32 agc_driver_graphics_tests agc_driver_pipeline_journal_tests ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_pipeline_journal|agc_pipeline_journal_long_paths|agc_driver_pipeline_journal)$" # negative control 2: merged tree, with the table count put back into DescribedPipelineIdentity ninja -C build -j32 -l32 agc_driver_graphics_tests build/tests/agc_driver_graphics_tests --pipeline-journal # restored the merged files, rebuilt, re-ran agc_pipeline_journal and agc_pipeline_journal_long_paths git status --porcelain ``` ## Results | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | All conventions checks passed | | Build (script) | ok, `libs` ok | | Selected tests (script, 2038 run) | 0 new failures, 0 timeouts. The 7 known failures (`agc_driver_division`, the denormal-mode tests, `unwrap_self`, `vector_constant_factor_tininess`) also fail on `main` | | Vulkan validation (script, 757 tests, layer loaded in 756, none missing) | 0 tests with new `VUID-` lines compared with `main` | | `agc_pipeline_journal`, `agc_pipeline_journal_long_paths` | pass (0.02–0.04 s) | | `agc_pipeline_cache` | pass | | `agc_driver_pipeline_journal` | pass, 44.1 s (45.1 s with main's journal and device files, so this is not the PR's; see Non-blocking) | | Journal `FileFormat` | 16 here, 15 on `main`: no collision | | Worktree after the controls | `git status --porcelain` empty | ## Negative control 1. **Keying reverted.** I restored `PipelineJournal.cpp` and `VulkanDevice.cpp` from `main` and kept the new `DescribedPipelineIdentity` so the test still compiles. `agc_pipeline_journal` and `agc_pipeline_journal_long_paths` fail: <details><summary>output</summary> ``` AGC graphics: compute results that differ only in their image table's element count were recorded as two pipelines ``` </details> 2. **Table count put back.** I put `binding.count` back for the table roles in `DescribedPipelineIdentity`. `--pipeline-journal` fails: <details><summary>output</summary> ``` AGC graphics: a table's element count entered the described identity, which the fixed-capacity layout does not see ``` </details> This confirms the author's negative control and wachi35676's. After restoring the merged files, both tests pass again and the worktree is clean. ## Findings ### Blocking None. ### Non-blocking 1. **The copied hash has already drifted from `RecompileResult::Identity()`.** `DescribedPipelineIdentity` repeats the mixing code of `Identity()`, but its subgroup word (`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp:2522`, [at head](https://github.com/boykopovar/AnyPS5/blob/b7954ac0acd413365165ec38de60ebd5f8850a02/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L2465-L2465)) leaves out the `functionLdsBuffer` (`0x20000`) and `meshWindowBuffer` (`0x40000`) bits that `Identity()` now mixes (`core/shader/recompiler/Recompiler.hpp:839`, [at head](https://github.com/boykopovar/AnyPS5/blob/b7954ac0acd413365165ec38de60ebd5f8850a02/core/shader/recompiler/Recompiler.hpp#L833-L833)). Those bits came in from `main` (287b149950) after this branch first wrote the copy. - **No effect today.** Both flags are set only for pixel and mesh stages ([SpirvEmitter.cpp](https://github.com/boykopovar/AnyPS5/blob/b7954ac0acd413365165ec38de60ebd5f8850a02/core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp#L287-L288), [and](https://github.com/boykopovar/AnyPS5/blob/b7954ac0acd413365165ec38de60ebd5f8850a02/core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp#L327-L327)), and the described identity is used only for compute. - **Why it matters.** The next field added to `Identity()` that does matter for compute would be silently missing from the compute key. The PR's equality check ("described identity of a result without tables differs from its identity") only covers a result with these flags off, so it would not catch that. The ARCHITECTURE.md sentence "the same hash with the element count ... left out" is also not quite true now. - **Suggested fix.** Keep one implementation, for example a `RecompileResult::Identity(bool tableCounts)` overload or a shared helper with a per-binding count filter. Or at least mix the same flag bits, and extend the equality check to a result with `functionLdsBuffer` set. 2. **`agc_driver_pipeline_journal` is over the 30 s rule.** It takes about 44 s here, and the NVIDIA and AMD CI comments show 120 s. It takes the same time with this PR's journal and device changes reverted, and this PR adds its new checks to the fast `agc_pipeline_journal` (0.02 s). So it does not count against this PR. I mention it only because the runs above show it. On the layout side, I agree with wachi35676 and BunnyFl: - `DescribeSetLayouts` and `ShaderResources` describe the three table bindings at `imageTableCapacity`, `StorageTableCapacity(context)` and `samplerTableCapacity`. - Table counts never add to `stageResources`, so they cannot flip `updateAfterBind`. - `verifySetLayouts` (`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp:5866`) would catch a resident pipeline whose set layout differs from the dispatch's. ## Not verified - The title result (PPSA26344: 327 pipeline creations down to one per distinct pipeline, journal deduplication). I did not launch any title. - Hardware GPUs: this machine has only lavapipe. NVIDIA and AMD runs are in the author's description and the CI comments. - A dispatch-level test where two table sizes hit the same resident `VkPipeline` on a real device. The new tests cover the key and the journal, not `VulkanDevice::computePipeline` reuse. <!-- anyps5-bots job=2564 head=b7954ac0acd413365165ec38de60ebd5f8850a02 -->
BunnyFl commented 2026-11-06 14:02:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-06T14:02:15Z.

Review: APPROVED


@Ryongen re-approved at d8cb9cd4fc. My approval was on b7954ac0ac; the new head only merges main 653b8efef0 into it, and git range-diff shows your own commits unchanged. I re-ran everything on this head merged into current main anyway.

What I ran. Head merged onto main 1ff0fe98aa (merge 9aa590d82b, clean), Windows 11 Pro, WinLibs GCC, Release, AMD Radeon RX 9070 XT, with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and ctest -V:

  • agc_pipeline_journal, agc_pipeline_journal_long_paths, agc_pipeline_journal_extended_paths and agc_driver_pipeline_journal: 4 of 4 pass, none unbuilt or skipped.
  • No missing-layer line, no VUID- and no SYNC-HAZARD ids.
  • Negative control: the same merge with only Graphics/src/PipelineJournal.cpp taken from main fails the three agc_pipeline_journal* tests with compute results that differ only in their image table's element count were recorded as two pipelines, while agc_driver_pipeline_journal still passes. So the journal test reaches the change.
  • tools/pr_overlap.py --branch at this head: no line or export conflicts with any pull request it could compare. 77 pull requests that touch the same AGC files conflict with main and could not be compared, which is usual for these files.

One note, not blocking

Your branch bumps the journal's FileFormat from 15 to 16, and main made the same bump on its own in d1915dd746 (line widths). Git merges two identical edits silently, so the merged tree has FileFormat = 16u (Graphics/src/PipelineJournal.cpp:54 on main), the same number as a journal written by main today. Your bump no longer starts such a journal over.

From reading the load path, that looks harmless rather than wrong: when the load decodes a compute module record, it keeps it only if the decoded result's key equals the stored one (PipelineJournal.cpp:939-944 at this head), and for a result with a table the old Identity() key differs from DescribedPipelineIdentity, so such a record is dropped rather than reused. I haven't run a main-written journal through this build, so that is a reading, not a measurement. If you meant the bump to discard those records up front, it would need to be 17 now.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5801128760 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8212#pullrequestreview-5801128760). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-06T14:02:15Z. **Review:** APPROVED --- @Ryongen re-approved at `d8cb9cd4fc`. My approval was on `b7954ac0ac`; the new head only merges `main` `653b8efef0` into it, and `git range-diff` shows your own commits unchanged. I re-ran everything on this head merged into current `main` anyway. **What I ran.** Head merged onto `main` `1ff0fe98aa` (merge `9aa590d82b`, clean), Windows 11 Pro, WinLibs GCC, Release, AMD Radeon RX 9070 XT, with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` and `ctest -V`: - `agc_pipeline_journal`, `agc_pipeline_journal_long_paths`, `agc_pipeline_journal_extended_paths` and `agc_driver_pipeline_journal`: 4 of 4 pass, none unbuilt or skipped. - No missing-layer line, no `VUID-` and no `SYNC-HAZARD` ids. - Negative control: the same merge with only `Graphics/src/PipelineJournal.cpp` taken from `main` fails the three `agc_pipeline_journal*` tests with `compute results that differ only in their image table's element count were recorded as two pipelines`, while `agc_driver_pipeline_journal` still passes. So the journal test reaches the change. - `tools/pr_overlap.py --branch` at this head: no line or export conflicts with any pull request it could compare. 77 pull requests that touch the same AGC files conflict with `main` and could not be compared, which is usual for these files. ## One note, not blocking Your branch bumps the journal's `FileFormat` from 15 to 16, and `main` made the same bump on its own in `d1915dd746` (line widths). Git merges two identical edits silently, so the merged tree has `FileFormat = 16u` (`Graphics/src/PipelineJournal.cpp:54` on `main`), the same number as a journal written by `main` today. Your bump no longer starts such a journal over. From reading the load path, that looks harmless rather than wrong: when the load decodes a compute module record, it keeps it only if the decoded result's key equals the stored one (`PipelineJournal.cpp:939-944` at this head), and for a result with a table the old `Identity()` key differs from `DescribedPipelineIdentity`, so such a record is dropped rather than reused. I haven't run a `main`-written journal through this build, so that is a reading, not a measurement. If you meant the bump to discard those records up front, it would need to be 17 now. AI-assisted: yes (Claude Code)
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!8212
No description provided.