feat(agc): draw partial writes of multisampled 4_4_4_4 targets into a temporary target #11557

Merged
JAB-dev merged 6 commits from upstream-pr/11557 into main 2026-11-03 19:10:53 +00:00
JAB-dev commented 2026-10-26 19:21:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JAB-dev on 2026-10-26T19:21:56Z.


What

Arcade Game Zone (PPSA19015) stops at its LOADING screen on current main, 14 to 16 seconds after the start, on two refusals of the 2-sample 4_4_4_4 partial write. Such writes are now drawn through the render pipeline into a temporary target and merged afterwards, so both refusals go away.

Current main, first stop:

AGC graphics: partial writes of a multisampled 4_4_4_4 unorm color target run the pixel shader once per sample, so a shader the guest runs once per pixel cannot read the ancillary word or, unless every sample sits at the pixel centre, centroid, sample-located or pull-model barycentrics, Z, 1/W or a position at the centroid or a sample: they would follow the invocation's sample (SPI_PS_INPUT_ENA 0x402, SPI_PS_INPUT_ADDR 0x402, SPI_BARYC_CNTL 0x1000000, sample 1 location 0xc4)

With that relaxed, the second stop:

ShaderRecompiler::Recompile: a partial write of a packed color target merges inside the pixel shader after early depth and stencil tests, which a shader that kills pixels under late tests of a draw writing depth or stencil, exports depth, stencil or coverage, or runs with a quad sample mask cannot use

A partial write of a 2-, 4- or 8-sample 4_4_4_4 UNORM target merged inside the pixel shader: it ran once per sample under a pixel interlock with forced early tests, so the merge could not follow a shader that kills pixels after the depth test or whose inputs follow the sample. The draw now runs at the guest's shading rate into a temporary R32_UINT target of the same size and sample count, with the draw's own depth, stencil, kill and coverage state, cleared to a marker no packed word has. A compute pass then replaces the written bits of the samples the draw wrote, inside its scissor. A pixel the depth test rejects or the shader kills never reaches the temporary, and the last fragment to pass wins, whatever the order of fragments inside the draw. A color logic operation, blending and a device that puts the guest's samples in order still throw.

One-sample partial writes keep their in-shader merge and its refusals. The recompiler's multisample merge variant is no longer reached by the driver; it is still exercised by the recompiler tests in agc_driver_graphics, and removing it changes the request serializer and cache versions, so it is left for its own PR.

After this change Arcade Game Zone stops at its next step, native multisample stencil or depth format import is not implemented, which the open native multisample depth work covers.

Tested

Windows 11, NVIDIA RTX 4070 SUPER, driver 610.88.

  • agc_driver_packed_unorm4444_multisample_partial_write: 2, 4 and 8 samples, a merge, a full write over it and two merges back to back, each sample checked against its location in the triangles. New cases at 2, 4 and 8 samples: a checkerboard kill under late tests, a merge inside an offset scissor smaller than the target (the pixels outside keep their word), a shader that reads POS_Z over a sloped depth (every sample of a pixel must hold the same word, and running the shader per sample fails it). At 2 samples with a depth target: a second merge at the same depth that must land only where the first draw killed (a killed pixel writes no depth). Merging every sample, written or not, fails the test.
  • agc_driver_graphics: the 2-sample target decodes as staged at the guest's shading rate for every input the old merge refused (centroid and sample barycentrics, pull model, ancillary, Z, 1/W, positions at a sample, SAMPLE_COVERAGE), LINEAR_SAMPLE, and a color logic operation throws. The test's sample-count gate checks the R32_UINT staging image as well as the R16_UINT target.
  • The 79 agc_driver tests that touch draws, targets, multisampling and pipelines, and check_conventions.py.
  • Validation layers (VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1, ctest -V, same machine and GPU): 32 focused tests give the same VUID sets on main and on this change. The multisample partial write test gains VUID-VkGraphicsPipelineCreateInfo-renderPass-06053, which main already reports for every test that draws with a depth target (this test draws with one now). The message is identical to main's for the multisampled pass order test: has fragment state and a depth format (VK_FORMAT_D32_SFLOAT) or stencil format (VK_FORMAT_UNDEFINED) and an invalid pDepthStencilState structure.
  • Arcade Game Zone, current main: LOADING screen after 14 to 16 s, the two lines above. This change: the next stop above at about 16 s.

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. It overlaps the open change that draws alpha-tested packed-target merges that write depth, https://github.com/boykopovar/AnyPS5/pull/9335, in State.hpp, State.cpp, DrawRegisterKey.cpp and docs/dev/debt/shader.md. The agreed order is this one first: that pull request's author wrote there on 2026-10-29 that it will merge main again on top of this one once it lands
  • Fixes: none
  • Unblocks: PPSA19015 https://github.com/boykopovar/AnyPS5/discussions/8562
  • GPUs tested: NVIDIA RTX 4070 SUPER, driver 610.88, Windows 11
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5023320738 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11557). Originally posted by [JAB-dev](https://github.com/JAB-dev) on 2026-10-26T19:21:56Z. --- ### What Arcade Game Zone (PPSA19015) stops at its LOADING screen on current main, 14 to 16 seconds after the start, on two refusals of the 2-sample 4_4_4_4 partial write. Such writes are now drawn through the render pipeline into a temporary target and merged afterwards, so both refusals go away. Current main, first stop: `AGC graphics: partial writes of a multisampled 4_4_4_4 unorm color target run the pixel shader once per sample, so a shader the guest runs once per pixel cannot read the ancillary word or, unless every sample sits at the pixel centre, centroid, sample-located or pull-model barycentrics, Z, 1/W or a position at the centroid or a sample: they would follow the invocation's sample (SPI_PS_INPUT_ENA 0x402, SPI_PS_INPUT_ADDR 0x402, SPI_BARYC_CNTL 0x1000000, sample 1 location 0xc4)` With that relaxed, the second stop: `ShaderRecompiler::Recompile: a partial write of a packed color target merges inside the pixel shader after early depth and stencil tests, which a shader that kills pixels under late tests of a draw writing depth or stencil, exports depth, stencil or coverage, or runs with a quad sample mask cannot use` A partial write of a 2-, 4- or 8-sample 4_4_4_4 UNORM target merged inside the pixel shader: it ran once per sample under a pixel interlock with forced early tests, so the merge could not follow a shader that kills pixels after the depth test or whose inputs follow the sample. The draw now runs at the guest's shading rate into a temporary R32_UINT target of the same size and sample count, with the draw's own depth, stencil, kill and coverage state, cleared to a marker no packed word has. A compute pass then replaces the written bits of the samples the draw wrote, inside its scissor. A pixel the depth test rejects or the shader kills never reaches the temporary, and the last fragment to pass wins, whatever the order of fragments inside the draw. A color logic operation, blending and a device that puts the guest's samples in order still throw. One-sample partial writes keep their in-shader merge and its refusals. The recompiler's multisample merge variant is no longer reached by the driver; it is still exercised by the recompiler tests in `agc_driver_graphics`, and removing it changes the request serializer and cache versions, so it is left for its own PR. After this change Arcade Game Zone stops at its next step, `native multisample stencil or depth format import is not implemented`, which the open native multisample depth work covers. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows 11, NVIDIA RTX 4070 SUPER, driver 610.88. - `agc_driver_packed_unorm4444_multisample_partial_write`: 2, 4 and 8 samples, a merge, a full write over it and two merges back to back, each sample checked against its location in the triangles. New cases at 2, 4 and 8 samples: a checkerboard kill under late tests, a merge inside an offset scissor smaller than the target (the pixels outside keep their word), a shader that reads POS_Z over a sloped depth (every sample of a pixel must hold the same word, and running the shader per sample fails it). At 2 samples with a depth target: a second merge at the same depth that must land only where the first draw killed (a killed pixel writes no depth). Merging every sample, written or not, fails the test. - `agc_driver_graphics`: the 2-sample target decodes as staged at the guest's shading rate for every input the old merge refused (centroid and sample barycentrics, pull model, ancillary, Z, 1/W, positions at a sample, SAMPLE_COVERAGE), LINEAR_SAMPLE, and a color logic operation throws. The test's sample-count gate checks the R32_UINT staging image as well as the R16_UINT target. - The 79 `agc_driver` tests that touch draws, targets, multisampling and pipelines, and `check_conventions.py`. - Validation layers (`VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1`, `ctest -V`, same machine and GPU): 32 focused tests give the same VUID sets on main and on this change. The multisample partial write test gains `VUID-VkGraphicsPipelineCreateInfo-renderPass-06053`, which main already reports for every test that draws with a depth target (this test draws with one now). The message is identical to main's for the multisampled pass order test: `has fragment state and a depth format (VK_FORMAT_D32_SFLOAT) or stencil format (VK_FORMAT_UNDEFINED) and an invalid pDepthStencilState structure`. - Arcade Game Zone, current main: LOADING screen after 14 to 16 s, the two lines above. This change: the next stop above at about 16 s. ### 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. It overlaps the open change that draws alpha-tested packed-target merges that write depth, https://github.com/boykopovar/AnyPS5/pull/9335, in State.hpp, State.cpp, DrawRegisterKey.cpp and docs/dev/debt/shader.md. The agreed order is this one first: that pull request's author wrote there on 2026-10-29 that it will merge `main` again on top of this one once it lands <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: PPSA19015 https://github.com/boykopovar/AnyPS5/discussions/8562 <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: NVIDIA RTX 4070 SUPER, driver 610.88, Windows 11 <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no --> 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-26 22:04:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T22:04:47Z.

Review: CHANGES_REQUESTED


I reviewed the implementation and the reported overlap against current main 3ae0fb5601542063bd2748ea10aa70598672eed2. Both branches merge cleanly into main independently, but a three-way merge of #11557 with open #9335 conflicts in Execution/src/Driver/Draw/DrawRegisterKey.cpp, Graphics/include/State.hpp, Graphics/src/State.cpp, and docs/dev/debt/shader.md. The description acknowledges the overlap but says Depends on: none and only that the second PR to land rebases.

CONTRIBUTING.md requires authors to agree which overlapping change lands first and declare the required order with Depends on. Please coordinate the order with #9335’s author and update the checklist to name the dependency if one must land first. I’m holding approval on that integration requirement; this is not a finding against the reported GPU results.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5659733821 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11557#pullrequestreview-5659733821). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T22:04:47Z. **Review:** CHANGES_REQUESTED --- I reviewed the implementation and the reported overlap against current `main` `3ae0fb5601542063bd2748ea10aa70598672eed2`. Both branches merge cleanly into `main` independently, but a three-way merge of #11557 with open #9335 conflicts in `Execution/src/Driver/Draw/DrawRegisterKey.cpp`, `Graphics/include/State.hpp`, `Graphics/src/State.cpp`, and `docs/dev/debt/shader.md`. The description acknowledges the overlap but says `Depends on: none` and only that the second PR to land rebases. `CONTRIBUTING.md` requires authors to agree which overlapping change lands first and declare the required order with `Depends on`. Please coordinate the order with #9335’s author and update the checklist to name the dependency if one must land first. I’m holding approval on that integration requirement; this is not a finding against the reported GPU results.
jotitadev commented 2026-10-27 03:54:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-27T03:54:47Z.

Review: COMMENTED


Linux run of head c249f30fe: the build breaks on Linux/GCC. With that fixed, the new staged path passes on NVIDIA and lavapipe.

Linux build

Merged onto main cb45ae2dd (no conflicts), libSceAgcDriver stops compiling:

core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp:41:29: error: static assertion failed: State changed: update CanonicalPipelineState and the recipe codec
note: the comparison reduces to '(848 == 840)'

The check sits under #if defined(__linux__) && defined(__x86_64__) && defined(__GLIBCXX__), so it doesn't fire on Windows, and the linux CI job doesn't run on this PR. The three new ColorTarget fields (staged, stagedMask, stagedFormat) make State 8 bytes larger through State::color. The recipe codec and CanonicalPipelineState still carry only format, exportIndex, componentMapping and partialWriteMask per color. A staged target's format is already R32_UINT, so that looks enough, but you're in a better position to confirm it. For the runs below I only changed the number to 848.

Tested

Ubuntu 26.04, GCC 15.2.0, Release, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1, device chosen with VK_ICD_FILENAMES, -j1. This PR merged onto main cb45ae2dd, plus the sizeof(State) change above.

Focused tests, --repeat until-fail:3: agc_driver_packed_unorm4444_multisample_partial_write, agc_driver_packed_unorm4444_partial_write, agc_driver_packed_unorm4444_color_target, agc_driver_packed_unorm_color_target and agc_driver_graphics pass 3/3 on both devices. The multisample test runs every case on both, with no skip:

4_4_4_4 unorm 2-sample partial writes that kill under late tests: 128 surviving pixels merged and kept the first merge past a depth tie, 128 killed pixels took the second merge
4_4_4_4 unorm 4-sample partial writes that kill under late tests: 128 surviving pixels merged, 128 killed pixels kept their word
4_4_4_4 unorm 8-sample partial write inside a scissor: the 42 pixels inside it merged and the rest kept their word
4_4_4_4 unorm 8-sample partial write of a depth read by the shader merged one depth per pixel into all its samples

ctest -R "^agc" without display/flip/lds_atomics64, --timeout 30:

NVIDIA RTX 3070 (595.99.02) lavapipe (Mesa 26.0.3, LLVM 21.1.8)
main cb45ae2dd 1029/1030 1028/1030
this PR (+ size fix) 1030/1030 1029/1030

No new failures. On main, NVIDIA's one failure is agc_driver_sgpr_pattern_fill_keys, which passed on later runs. lavapipe fails agc_driver_multisample_retirement on main and with this PR.

I couldn't run a negative control. Both updated test files use the new ColorTarget::staged/stagedMask/stagedFormat and StagedMergeTarget, so they don't build against main's driver sources.

GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02, Linux) and lavapipe (Mesa 26.0.3, LLVM 21.1.8), Ubuntu 26.04.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5662027828 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11557#pullrequestreview-5662027828). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-27T03:54:47Z. **Review:** COMMENTED --- Linux run of head `c249f30fe`: the build breaks on Linux/GCC. With that fixed, the new staged path passes on NVIDIA and lavapipe. ### Linux build Merged onto `main` `cb45ae2dd` (no conflicts), `libSceAgcDriver` stops compiling: ``` core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp:41:29: error: static assertion failed: State changed: update CanonicalPipelineState and the recipe codec note: the comparison reduces to '(848 == 840)' ``` The check sits under `#if defined(__linux__) && defined(__x86_64__) && defined(__GLIBCXX__)`, so it doesn't fire on Windows, and the `linux` CI job doesn't run on this PR. The three new `ColorTarget` fields (`staged`, `stagedMask`, `stagedFormat`) make `State` 8 bytes larger through `State::color`. The recipe codec and `CanonicalPipelineState` still carry only `format`, `exportIndex`, `componentMapping` and `partialWriteMask` per color. A staged target's `format` is already `R32_UINT`, so that looks enough, but you're in a better position to confirm it. For the runs below I only changed the number to `848`. ### Tested Ubuntu 26.04, GCC 15.2.0, Release, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1`, device chosen with `VK_ICD_FILENAMES`, `-j1`. This PR merged onto `main` `cb45ae2dd`, plus the `sizeof(State)` change above. Focused tests, `--repeat until-fail:3`: `agc_driver_packed_unorm4444_multisample_partial_write`, `agc_driver_packed_unorm4444_partial_write`, `agc_driver_packed_unorm4444_color_target`, `agc_driver_packed_unorm_color_target` and `agc_driver_graphics` pass 3/3 on both devices. The multisample test runs every case on both, with no skip: ``` 4_4_4_4 unorm 2-sample partial writes that kill under late tests: 128 surviving pixels merged and kept the first merge past a depth tie, 128 killed pixels took the second merge 4_4_4_4 unorm 4-sample partial writes that kill under late tests: 128 surviving pixels merged, 128 killed pixels kept their word 4_4_4_4 unorm 8-sample partial write inside a scissor: the 42 pixels inside it merged and the rest kept their word 4_4_4_4 unorm 8-sample partial write of a depth read by the shader merged one depth per pixel into all its samples ``` `ctest -R "^agc"` without display/flip/`lds_atomics64`, `--timeout 30`: | | NVIDIA RTX 3070 (595.99.02) | lavapipe (Mesa 26.0.3, LLVM 21.1.8) | |---|---|---| | `main` `cb45ae2dd` | 1029/1030 | 1028/1030 | | this PR (+ size fix) | 1030/1030 | 1029/1030 | No new failures. On `main`, NVIDIA's one failure is `agc_driver_sgpr_pattern_fill_keys`, which passed on later runs. lavapipe fails `agc_driver_multisample_retirement` on `main` and with this PR. I couldn't run a negative control. Both updated test files use the new `ColorTarget::staged`/`stagedMask`/`stagedFormat` and `StagedMergeTarget`, so they don't build against `main`'s driver sources. GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02, Linux) and lavapipe (Mesa 26.0.3, LLVM 21.1.8), Ubuntu 26.04. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
XairRrR commented 2026-10-29 05:37:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T05:37:49Z.

Review: APPROVED


Reviewed — approved

The staged R32_UINT draw plus compute merge builds on Linux/GCC, passes its focused tests with validation layers on an RTX 4070 Ti SUPER with no new VUID- lines, and a mutation of the merge kernel makes the new test fail. I found nothing blocking.

What I ran

Head 173ce1f14d939714d6c4c54a2c090b1ecfb672cd, merged with --no-ff onto main 52c09d567d2fa453494dd720fcf53a98149468e4 (no conflicts), in a clean worktree. Arch Linux 7.2.11-zen, GCC 16.2.1, Release, Ninja, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08).

git diff --check origin/main...pr-11557
python3 tools/check_conventions.py --base origin/main
cmake --build build -j10 --target agc_driver_packed_unorm4444_multisample_partial_write_tests \
  agc_driver_graphics_tests agc_driver_packed_unorm4444_partial_write_tests \
  agc_driver_packed_unorm4444_color_target_tests agc_driver_multisampled_pass_order_tests libs
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \
  VK_LOADER_DEBUG=error,warn,layer ctest --test-dir build -V --output-on-failure -j4 \
  -R '^agc_driver_(graphics|packed_unorm4444_multisample_partial_write|packed_unorm4444_partial_write|packed_unorm4444_color_target|multisampled_pass_order)$'
# same build and ctest command on main 52c09d567d
# negative controls: see below

Results

Check Result
Merge into main clean
git diff --check clean
check_conventions.py All conventions checks passed.
Build (5 test targets + libs), merged tree OK. The Linux sizeof(State) == 920 guard in PipelineJournal.cpp holds with GCC 16.2.1, so the build break jotitadev reported on c249f30fe is fixed at this head
Focused tests, merged tree, validation on 5/5 passed
Focused tests, main, validation on 5/5 passed
VUID- lines 0 on main, 0 on the merged tree
was not found but was requested by env var VK_INSTANCE_LAYERS absent from both logs; the loader logs Insert instance layer "VK_LAYER_KHRONOS_validation" in both
Longest test agc_driver_graphics 4.91 s; the multisample partial write test 0.97 s

The description says the multisample test gains VUID-VkGraphicsPipelineCreateInfo-renderPass-06053 on Windows. On this Linux host and driver neither side logs any VUID- line, so I could not reproduce it.

Multisample partial write test, merged tree
4_4_4_4 unorm 2-sample partial write tests passed: 17 partly merged pixels kept bits 15..12 merged into their covered samples only, a full write drawn right after covered 7 merged samples, and 41 samples kept both of two merges drawn back to back
4_4_4_4 unorm 2-sample partial writes that kill under late tests: 128 surviving pixels merged and kept the first merge past a depth tie, 128 killed pixels took the second merge
4_4_4_4 unorm 2-sample partial write inside a scissor: the 42 pixels inside it merged and the rest kept their word
4_4_4_4 unorm 2-sample partial write of a depth read by the shader merged one depth per pixel into all its samples
4_4_4_4 unorm 4-sample partial write tests passed: 24 partly merged pixels kept bits 15..12 merged into their covered samples only, a full write drawn right after covered 15 merged samples, and 81 samples kept both of two merges drawn back to back
4_4_4_4 unorm 4-sample partial writes that kill under late tests: 128 surviving pixels merged, 128 killed pixels kept their word
4_4_4_4 unorm 4-sample partial write inside a scissor: the 42 pixels inside it merged and the rest kept their word
4_4_4_4 unorm 4-sample partial write of a depth read by the shader merged one depth per pixel into all its samples
4_4_4_4 unorm 8-sample partial write tests passed: 28 partly merged pixels kept bits 15..12 merged into their covered samples only, a full write drawn right after covered 34 merged samples, and 172 samples kept both of two merges drawn back to back
4_4_4_4 unorm 8-sample partial writes that kill under late tests: 128 surviving pixels merged, 128 killed pixels kept their word
4_4_4_4 unorm 8-sample partial write inside a scissor: the 42 pixels inside it merged and the rest kept their word
4_4_4_4 unorm 8-sample partial write of a depth read by the shader merged one depth per pixel into all its samples
ctest summaries
merged:
1/5 Test #1277: agc_driver_multisampled_pass_order ......................   Passed    0.74 sec
2/5 Test #1294: agc_driver_packed_unorm4444_multisample_partial_write ...   Passed    0.97 sec
3/5 Test #1295: agc_driver_packed_unorm4444_partial_write ...............   Passed    1.11 sec
4/5 Test #1293: agc_driver_packed_unorm4444_color_target ................   Passed    0.73 sec
5/5 Test  #948: agc_driver_graphics .....................................   Passed    4.91 sec
main:
1/5 Test #1277: agc_driver_multisampled_pass_order ......................   Passed    0.72 sec
2/5 Test #1293: agc_driver_packed_unorm4444_color_target ................   Passed    0.92 sec
3/5 Test #1295: agc_driver_packed_unorm4444_partial_write ...............   Passed    1.18 sec
4/5 Test #1294: agc_driver_packed_unorm4444_multisample_partial_write ...   Passed    0.56 sec
5/5 Test  #948: agc_driver_graphics .....................................   Passed    5.09 sec

Negative control

  1. I put the PR's tests/execution/PackedUnorm4444MultisamplePartialWrite.cpp on top of main's production files. It does not compile because ColorTarget has no staged, stagedMask or stagedFormat there. That shows the test depends on the new code, but it says nothing about behaviour.

  2. On the merged tree I changed PackedMerge.comp so it merges every sample, written or not (if (false && word == unwritten) continue;). The test then fails on its first check:

    AGC graphics: sample 0 of pixel (0, 0) holds 0xf69c, neither the merged word, the first draw's word nor the last draw's word
    1294 - agc_driver_packed_unorm4444_multisample_partial_write (Failed)
    

    After restoring the shader, the test passes again. This confirms the description's claim that merging unwritten samples fails the test.

Findings

Blocking

None.

Non-blocking

  1. The temporary pool never evicts. StagedMerges::Acquire adds a device-local multisampled R32_UINT image for every new extent and sample count, and keeps it until the device is torn down. An 8-sample 1920×1080 temporary is about 66 MB. A title with dynamic resolution or several such targets would keep accumulating them. The debt entry documents this ("kept per size and sample count"). The comparable copy cache in SampleOrder.cpp is bounded to 4 entries with LRU eviction; the same pattern would fit here. Recorded batches already hold the temporaries they use through recorder->Keep(write.temporary), so evicting one is safe.
  2. The existing doc comment for RecordedDraw now sits above StagedWrite. In Draw.cpp:2066-2078, the new struct was inserted between the "What recordDraw records from…" comment and struct RecordedDraw. Moving StagedWrite above the comment fixes it.
  3. The new Require cannot fail, and the recorded image handle can be stale. In Draw.cpp:2834-2836, MultisampleTargetView captures binding.multisampleImage first. MultisampleTargetStorageView then runs Storage, which already throws with a clear message when the form cannot be stored. Otherwise it calls makeStorable, which on the first storage access retires the image and replaces it.
    • The Require(MultisampleTargetStorable(...)) added after review therefore always passes: Storage has either thrown or made the image storable.
    • On the first staged draw into a target, record.multisampleImages (which feeds the pass's passAttachments) gets the retired handle. The harm is limited because the staged draw forces a new pass and the merge closes it.
    • Fix: call MultisampleTargetStorageView before MultisampleTargetView(..., &binding.multisampleImage), as main's order did, and drop the redundant Require.
  4. The order with #9335 looks consistent. MarcZX10 asked for the order with #9335 to be declared. #9335 currently reports CONFLICTING against main and this PR merges cleanly. The description proposes that this PR lands first and #9335 rebases on it, which matches Depends on: none under CONTRIBUTING.md. The agreement itself still has to come from #9335's author.

Not verified

  • Other GPU vendors. I did not run on AMD, Intel or lavapipe; JulesB40 and jotitadev reported Intel, NVIDIA and lavapipe results on earlier heads.
  • Windows, and the renderPass-06053 message the description mentions.
  • The title itself (PPSA19015) and the claimed next stop. I ran no titles.
  • The full agc_ suite. I ran only the five focused tests above.
  • Several command buffers on different queues using the same pooled temporary at once. This follows the same sharing pattern as the SampleOrder copies, and I did not test it.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5693329560 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11557#pullrequestreview-5693329560). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-29T05:37:49Z. **Review:** APPROVED --- # Reviewed — approved The staged R32_UINT draw plus compute merge builds on Linux/GCC, passes its focused tests with validation layers on an RTX 4070 Ti SUPER with no new `VUID-` lines, and a mutation of the merge kernel makes the new test fail. I found nothing blocking. ## What I ran Head `173ce1f14d939714d6c4c54a2c090b1ecfb672cd`, merged with `--no-ff` onto `main` `52c09d567d2fa453494dd720fcf53a98149468e4` (no conflicts), in a clean worktree. Arch Linux 7.2.11-zen, GCC 16.2.1, Release, Ninja, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08). ``` git diff --check origin/main...pr-11557 python3 tools/check_conventions.py --base origin/main cmake --build build -j10 --target agc_driver_packed_unorm4444_multisample_partial_write_tests \ agc_driver_graphics_tests agc_driver_packed_unorm4444_partial_write_tests \ agc_driver_packed_unorm4444_color_target_tests agc_driver_multisampled_pass_order_tests libs VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \ VK_LOADER_DEBUG=error,warn,layer ctest --test-dir build -V --output-on-failure -j4 \ -R '^agc_driver_(graphics|packed_unorm4444_multisample_partial_write|packed_unorm4444_partial_write|packed_unorm4444_color_target|multisampled_pass_order)$' # same build and ctest command on main 52c09d567d # negative controls: see below ``` ## Results | Check | Result | |---|---| | Merge into `main` | clean | | `git diff --check` | clean | | `check_conventions.py` | `All conventions checks passed.` | | Build (5 test targets + `libs`), merged tree | OK. The Linux `sizeof(State) == 920` guard in `PipelineJournal.cpp` holds with GCC 16.2.1, so the build break jotitadev reported on `c249f30fe` is fixed at this head | | Focused tests, merged tree, validation on | 5/5 passed | | Focused tests, `main`, validation on | 5/5 passed | | `VUID-` lines | 0 on `main`, 0 on the merged tree | | `was not found but was requested by env var VK_INSTANCE_LAYERS` | absent from both logs; the loader logs `Insert instance layer "VK_LAYER_KHRONOS_validation"` in both | | Longest test | `agc_driver_graphics` 4.91 s; the multisample partial write test 0.97 s | The description says the multisample test gains `VUID-VkGraphicsPipelineCreateInfo-renderPass-06053` on Windows. On this Linux host and driver neither side logs any `VUID-` line, so I could not reproduce it. <details><summary>Multisample partial write test, merged tree</summary> ``` 4_4_4_4 unorm 2-sample partial write tests passed: 17 partly merged pixels kept bits 15..12 merged into their covered samples only, a full write drawn right after covered 7 merged samples, and 41 samples kept both of two merges drawn back to back 4_4_4_4 unorm 2-sample partial writes that kill under late tests: 128 surviving pixels merged and kept the first merge past a depth tie, 128 killed pixels took the second merge 4_4_4_4 unorm 2-sample partial write inside a scissor: the 42 pixels inside it merged and the rest kept their word 4_4_4_4 unorm 2-sample partial write of a depth read by the shader merged one depth per pixel into all its samples 4_4_4_4 unorm 4-sample partial write tests passed: 24 partly merged pixels kept bits 15..12 merged into their covered samples only, a full write drawn right after covered 15 merged samples, and 81 samples kept both of two merges drawn back to back 4_4_4_4 unorm 4-sample partial writes that kill under late tests: 128 surviving pixels merged, 128 killed pixels kept their word 4_4_4_4 unorm 4-sample partial write inside a scissor: the 42 pixels inside it merged and the rest kept their word 4_4_4_4 unorm 4-sample partial write of a depth read by the shader merged one depth per pixel into all its samples 4_4_4_4 unorm 8-sample partial write tests passed: 28 partly merged pixels kept bits 15..12 merged into their covered samples only, a full write drawn right after covered 34 merged samples, and 172 samples kept both of two merges drawn back to back 4_4_4_4 unorm 8-sample partial writes that kill under late tests: 128 surviving pixels merged, 128 killed pixels kept their word 4_4_4_4 unorm 8-sample partial write inside a scissor: the 42 pixels inside it merged and the rest kept their word 4_4_4_4 unorm 8-sample partial write of a depth read by the shader merged one depth per pixel into all its samples ``` </details> <details><summary>ctest summaries</summary> ``` merged: 1/5 Test #1277: agc_driver_multisampled_pass_order ...................... Passed 0.74 sec 2/5 Test #1294: agc_driver_packed_unorm4444_multisample_partial_write ... Passed 0.97 sec 3/5 Test #1295: agc_driver_packed_unorm4444_partial_write ............... Passed 1.11 sec 4/5 Test #1293: agc_driver_packed_unorm4444_color_target ................ Passed 0.73 sec 5/5 Test #948: agc_driver_graphics ..................................... Passed 4.91 sec main: 1/5 Test #1277: agc_driver_multisampled_pass_order ...................... Passed 0.72 sec 2/5 Test #1293: agc_driver_packed_unorm4444_color_target ................ Passed 0.92 sec 3/5 Test #1295: agc_driver_packed_unorm4444_partial_write ............... Passed 1.18 sec 4/5 Test #1294: agc_driver_packed_unorm4444_multisample_partial_write ... Passed 0.56 sec 5/5 Test #948: agc_driver_graphics ..................................... Passed 5.09 sec ``` </details> ## Negative control 1. I put the PR's `tests/execution/PackedUnorm4444MultisamplePartialWrite.cpp` on top of `main`'s production files. It does not compile because `ColorTarget` has no `staged`, `stagedMask` or `stagedFormat` there. That shows the test depends on the new code, but it says nothing about behaviour. 2. On the merged tree I changed `PackedMerge.comp` so it merges every sample, written or not (`if (false && word == unwritten) continue;`). The test then fails on its first check: ``` AGC graphics: sample 0 of pixel (0, 0) holds 0xf69c, neither the merged word, the first draw's word nor the last draw's word 1294 - agc_driver_packed_unorm4444_multisample_partial_write (Failed) ``` After restoring the shader, the test passes again. This confirms the description's claim that merging unwritten samples fails the test. ## Findings ### Blocking None. ### Non-blocking 1. **The temporary pool never evicts.** [`StagedMerges::Acquire`](https://github.com/boykopovar/AnyPS5/blob/173ce1f14d939714d6c4c54a2c090b1ecfb672cd/core/libs/prx/libSceAgcDriver/Graphics/src/StagedMerge.cpp#L90-L99) adds a device-local multisampled R32_UINT image for every new extent and sample count, and keeps it until the device is torn down. An 8-sample 1920×1080 temporary is about 66 MB. A title with dynamic resolution or several such targets would keep accumulating them. The debt entry documents this ("kept per size and sample count"). The comparable copy cache in `SampleOrder.cpp` is [bounded to 4 entries with LRU eviction](https://github.com/boykopovar/AnyPS5/blob/52c09d567d2fa453494dd720fcf53a98149468e4/core/libs/prx/libSceAgcDriver/Graphics/src/SampleOrder.cpp#L464-L467); the same pattern would fit here. Recorded batches already hold the temporaries they use through `recorder->Keep(write.temporary)`, so evicting one is safe. 2. **The existing doc comment for `RecordedDraw` now sits above `StagedWrite`.** In [Draw.cpp:2066-2078](https://github.com/boykopovar/AnyPS5/blob/173ce1f14d939714d6c4c54a2c090b1ecfb672cd/core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp#L2066-L2078), the new struct was inserted between the "What recordDraw records from…" comment and `struct RecordedDraw`. Moving `StagedWrite` above the comment fixes it. 3. **The new `Require` cannot fail, and the recorded image handle can be stale.** In [Draw.cpp:2834-2836](https://github.com/boykopovar/AnyPS5/blob/173ce1f14d939714d6c4c54a2c090b1ecfb672cd/core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp#L2834-L2836), `MultisampleTargetView` captures `binding.multisampleImage` first. `MultisampleTargetStorageView` then runs [`Storage`](https://github.com/boykopovar/AnyPS5/blob/173ce1f14d939714d6c4c54a2c090b1ecfb672cd/core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp#L382-L384), which already throws with a clear message when the form cannot be stored. Otherwise it calls [`makeStorable`](https://github.com/boykopovar/AnyPS5/blob/173ce1f14d939714d6c4c54a2c090b1ecfb672cd/core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp#L283-L287), which on the first storage access retires the image and replaces it. - The `Require(MultisampleTargetStorable(...))` added after review therefore always passes: `Storage` has either thrown or made the image storable. - On the first staged draw into a target, `record.multisampleImages` (which feeds the pass's `passAttachments`) gets the retired handle. The harm is limited because the staged draw forces a new pass and the merge closes it. - Fix: call `MultisampleTargetStorageView` before `MultisampleTargetView(..., &binding.multisampleImage)`, as `main`'s order did, and drop the redundant `Require`. 4. **The order with #9335 looks consistent.** MarcZX10 asked for the order with #9335 to be declared. #9335 currently reports `CONFLICTING` against `main` and this PR merges cleanly. The description proposes that this PR lands first and #9335 rebases on it, which matches `Depends on: none` under CONTRIBUTING.md. The agreement itself still has to come from #9335's author. ## Not verified - Other GPU vendors. I did not run on AMD, Intel or lavapipe; JulesB40 and jotitadev reported Intel, NVIDIA and lavapipe results on earlier heads. - Windows, and the `renderPass-06053` message the description mentions. - The title itself (PPSA19015) and the claimed next stop. I ran no titles. - The full `agc_` suite. I ran only the five focused tests above. - Several command buffers on different queues using the same pooled temporary at once. This follows the same sharing pattern as the `SampleOrder` copies, and I did not test it.
MarcZX10 commented 2026-10-29 08:54:52 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


Re-reviewed exact head 173ce1f14d939714d6c4c54a2c090b1ecfb672cd. The reported Windows/validation runs and the Linux size-guard correction address the prior technical test concern. The current-main merge preview is clean. The remaining blocker is the shared edit with open #9335: your proposed order is #11557 first, but #9335’s author has not confirmed it, and this PR still records Depends on: none. The current overlap requires an agreement on which lands first and the second PR’s rebase/retained hunks; please record the agreed order in both checklists. I am holding approval for that repository integration requirement, not questioning the reported GPU results. I did not run a local GPU suite.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5695085276 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11557#pullrequestreview-5695085276). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T08:54:52Z. **Review:** CHANGES_REQUESTED --- Re-reviewed exact head `173ce1f14d939714d6c4c54a2c090b1ecfb672cd`. The reported Windows/validation runs and the Linux size-guard correction address the prior technical test concern. The current-main merge preview is clean. The remaining blocker is the shared edit with open #9335: your proposed order is #11557 first, but #9335’s author has not confirmed it, and this PR still records `Depends on: none`. The current overlap requires an agreement on which lands first and the second PR’s rebase/retained hunks; please record the agreed order in both checklists. I am holding approval for that repository integration requirement, not questioning the reported GPU results. I did not run a local GPU suite.
XairRrR commented 2026-11-02 20:02:24 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


Re-checked — changes still requested

Since my last review the branch was rebuilt as one feature commit plus two merges of main, and the merged tree no longer compiles with Linux/GCC. main and this PR each raised the sizeof(State) guard from 920 to 928, and git keeps that line without a conflict. The real size is now 936. When I patch the guard by hand, the code builds and the focused tests pass on lavapipe with validation on.

What changed since my last review

  • 173ce1f14d, the separate "update the Linux State size guard" commit, is gone. Its change from 920 to 928 is now inside 7ef4e4a696.
  • 7ef4e4a696 follows main's rename of ExportTargetMerge to ExportTargetMerges (it now returns a vector). It also takes main's wording for the "another merged color target" refusal, adds other.staged to that refusal, and updates the two debt entries to match. The tests use ExportTargetMerges(...).empty() / .size() == 1u in place of mask == 0u.
  • Two merges of main (3fde7f528a, 734d8d19d7). The description now records the agreed order with #9335.

What I ran

Head 734d8d19d75fe80f1b5608c0a6c27aaffaee6d80, merged with --no-ff onto main aeae1aebe7dd76d37e620f1c57e211ad6e13f337, in a clean worktree. Debian 13 VM, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6, LLVM 19).

git diff --check aeae1aebe7dd76d37e620f1c57e211ad6e13f337...734d8d19d75fe80f1b5608c0a6c27aaffaee6d80
python3 tools/check_conventions.py --base aeae1aebe7dd76d37e620f1c57e211ad6e13f337
git merge-base 734d8d19d7 aeae1aebe7     # 69bfe76785, guard there: 920
git log -S"sizeof(State) == 928" 69bfe76785..aeae1aebe7 -- .../PipelineJournal.cpp   # 372d688b87 on main
# diagnostic only: guard set locally to 936
ninja -C build libs agc_driver_packed_unorm4444_multisample_partial_write_tests agc_driver_graphics_tests \
  agc_driver_multisampled_pass_order_tests agc_driver_packed_unorm4444_color_target_tests agc_driver_packed_unorm4444_partial_write_tests
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -j8 -V -R '^agc_driver_(graphics|packed_unorm4444_multisample_partial_write|packed_unorm4444_partial_write|packed_unorm4444_color_target|multisampled_pass_order)$'
# mutation: PackedMerge.comp `if (false && word == unwritten) continue;`, rebuild, rerun the multisample test
# restored both files from the merged tree; git status --porcelain is empty
Check Result
git diff --check clean
check_conventions.py All conventions checks passed.
Build of the merged tree fails: PipelineJournal.cpp:44: static assertion failed ... the comparison reduces to '(936 == 928)'
Focused tests, guard patched to 936 locally, validation on 5/5 passed. The layer was inserted in every process, no was not found but was requested line, and 0 VUID- lines
Multisample partial write test on lavapipe 4- and 8-sample cases ran (merge, kill under late tests, scissor, depth read by the shader). lavapipe printed no 2-sample lines
Mutation of the merge kernel the test fails: sample 0 of pixel (0, 0) holds 0xf69c, neither the merged word, ...
Build error (merged tree, unmodified)
../core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp:44:29: error: static assertion failed: State changed: update CanonicalPipelineState and the recipe codec
   44 | static_assert(sizeof(State) == 928, "State changed: update CanonicalPipelineState and the recipe codec");
note: the comparison reduces to '(936 == 928)'
Focused tests with the guard patched
1/5 Test #1194: agc_driver_multisampled_pass_order ......................   Passed    0.25 sec
2/5 Test #1214: agc_driver_packed_unorm4444_color_target ................   Passed    1.18 sec
3/5 Test #1216: agc_driver_packed_unorm4444_partial_write ...............   Passed    2.00 sec
4/5 Test #1215: agc_driver_packed_unorm4444_multisample_partial_write ...   Passed    1.83 sec
5/5 Test #1588: agc_driver_graphics .....................................   Passed   39.52 sec
4_4_4_4 unorm 4-sample partial writes that kill under late tests: 128 surviving pixels merged, 128 killed pixels kept their word
4_4_4_4 unorm 8-sample partial write inside a scissor: the 42 pixels inside it merged and the rest kept their word
4_4_4_4 unorm 8-sample partial write of a depth read by the shader merged one depth per pixel into all its samples

agc_driver_graphics took 39.5 s under -j8 with validation on lavapipe. TechLevelZero's NVIDIA runs report this test over 30 s on main as well, so I am not counting it against this PR.

Previous findings

  1. Temporary pool never evicts: Still open (non-blocking). StagedMerge.cpp:90 Acquire still only adds entries, and only device teardown (StagedMerge.cpp:273) removes them.
  2. RecordedDraw doc comment sits above StagedWrite: Still open (non-blocking). The comment is at Draw.cpp:2209, struct StagedWrite at 2213 and struct RecordedDraw at 2221.
  3. Redundant Require and a possibly stale multisampleImage handle: Still open (non-blocking). Draw.cpp:2983-2985 still calls MultisampleTargetView(..., &binding.multisampleImage) before MultisampleTargetStorageView, then Require(MultisampleTargetStorable(...)).
  4. Order with #9335: Resolved. The checklist now records that #9335's author agreed to merge main on top of this PR. That comes from the author's description, and I did not check it on #9335.

New findings

Blocking

  1. The merged tree does not build with Linux/GCC (sizeof(State) guard). The guard is at PipelineJournal.cpp:44. At the merge base 69bfe76785 it read 920. main raised it to 928 in 372d688b87 for its own State growth, and this PR raised it from 920 to 928 for the three staged ColorTarget fields. Both sides changed the line identically, so git merged it silently. With both growths, State is 936 bytes, and libSceAgcDriver fails to compile on Linux x86_64 with libstdc++, which is what the linux CI job uses. The test results reported on 734d8d19d7 were all on trees that did not have both growths, or on Windows, where the guard is compiled out. Fix: merge current main again, set the guard to the size measured on the merged tree (936 against aeae1aebe7), and check that the recipe codec still needs no new field. My earlier review accepted that point for the staged fields. I did not check what main added.

Non-blocking

None beyond the three still-open items above.

Not verified

  • 2-sample cases on this machine (lavapipe printed only 4- and 8-sample lines). Other GPU vendors, Windows, and the title PPSA19015.
  • A validation comparison against main in this run: the bot's comparison was skipped because the build failed. I ran the five focused tests on the patched merged tree with the layer active and saw no VUID- lines, but I did not run main again.
  • Negative control by restoring production files from main: the tests use ColorTarget::staged and StagedMergeTarget, so they do not compile against main. I used the merge-kernel mutation above instead.

To get this to a good state

  • Merge current main, update the sizeof(State) guard to the size GCC reports on the merged tree, and confirm a Linux/GCC build of libs.
  • Optionally, address the three non-blocking items from the previous review.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5742573654 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11557#pullrequestreview-5742573654). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-02T20:02:24Z. **Review:** CHANGES_REQUESTED --- # Re-checked — changes still requested Since my last review the branch was rebuilt as one feature commit plus two merges of `main`, and the merged tree no longer compiles with Linux/GCC. `main` and this PR each raised the `sizeof(State)` guard from 920 to 928, and git keeps that line without a conflict. The real size is now 936. When I patch the guard by hand, the code builds and the focused tests pass on lavapipe with validation on. ## What changed since my last review - `173ce1f14d`, the separate "update the Linux State size guard" commit, is gone. Its change from 920 to 928 is now inside `7ef4e4a696`. - `7ef4e4a696` follows `main`'s rename of `ExportTargetMerge` to `ExportTargetMerges` (it now returns a vector). It also takes `main`'s wording for the "another merged color target" refusal, adds `other.staged` to that refusal, and updates the two debt entries to match. The tests use `ExportTargetMerges(...).empty()` / `.size() == 1u` in place of `mask == 0u`. - Two merges of `main` (`3fde7f528a`, `734d8d19d7`). The description now records the agreed order with #9335. ## What I ran Head `734d8d19d75fe80f1b5608c0a6c27aaffaee6d80`, merged with `--no-ff` onto `main` `aeae1aebe7dd76d37e620f1c57e211ad6e13f337`, in a clean worktree. Debian 13 VM, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6, LLVM 19). ``` git diff --check aeae1aebe7dd76d37e620f1c57e211ad6e13f337...734d8d19d75fe80f1b5608c0a6c27aaffaee6d80 python3 tools/check_conventions.py --base aeae1aebe7dd76d37e620f1c57e211ad6e13f337 git merge-base 734d8d19d7 aeae1aebe7 # 69bfe76785, guard there: 920 git log -S"sizeof(State) == 928" 69bfe76785..aeae1aebe7 -- .../PipelineJournal.cpp # 372d688b87 on main # diagnostic only: guard set locally to 936 ninja -C build libs agc_driver_packed_unorm4444_multisample_partial_write_tests agc_driver_graphics_tests \ agc_driver_multisampled_pass_order_tests agc_driver_packed_unorm4444_color_target_tests agc_driver_packed_unorm4444_partial_write_tests VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -j8 -V -R '^agc_driver_(graphics|packed_unorm4444_multisample_partial_write|packed_unorm4444_partial_write|packed_unorm4444_color_target|multisampled_pass_order)$' # mutation: PackedMerge.comp `if (false && word == unwritten) continue;`, rebuild, rerun the multisample test # restored both files from the merged tree; git status --porcelain is empty ``` | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | `All conventions checks passed.` | | Build of the merged tree | **fails**: `PipelineJournal.cpp:44: static assertion failed ... the comparison reduces to '(936 == 928)'` | | Focused tests, guard patched to 936 locally, validation on | 5/5 passed. The layer was inserted in every process, no `was not found but was requested` line, and 0 `VUID-` lines | | Multisample partial write test on lavapipe | 4- and 8-sample cases ran (merge, kill under late tests, scissor, depth read by the shader). lavapipe printed no 2-sample lines | | Mutation of the merge kernel | the test fails: `sample 0 of pixel (0, 0) holds 0xf69c, neither the merged word, ...` | <details><summary>Build error (merged tree, unmodified)</summary> ``` ../core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp:44:29: error: static assertion failed: State changed: update CanonicalPipelineState and the recipe codec 44 | static_assert(sizeof(State) == 928, "State changed: update CanonicalPipelineState and the recipe codec"); note: the comparison reduces to '(936 == 928)' ``` </details> <details><summary>Focused tests with the guard patched</summary> ``` 1/5 Test #1194: agc_driver_multisampled_pass_order ...................... Passed 0.25 sec 2/5 Test #1214: agc_driver_packed_unorm4444_color_target ................ Passed 1.18 sec 3/5 Test #1216: agc_driver_packed_unorm4444_partial_write ............... Passed 2.00 sec 4/5 Test #1215: agc_driver_packed_unorm4444_multisample_partial_write ... Passed 1.83 sec 5/5 Test #1588: agc_driver_graphics ..................................... Passed 39.52 sec 4_4_4_4 unorm 4-sample partial writes that kill under late tests: 128 surviving pixels merged, 128 killed pixels kept their word 4_4_4_4 unorm 8-sample partial write inside a scissor: the 42 pixels inside it merged and the rest kept their word 4_4_4_4 unorm 8-sample partial write of a depth read by the shader merged one depth per pixel into all its samples ``` </details> `agc_driver_graphics` took 39.5 s under `-j8` with validation on lavapipe. TechLevelZero's NVIDIA runs report this test over 30 s on `main` as well, so I am not counting it against this PR. ## Previous findings 1. Temporary pool never evicts: **Still open** (non-blocking). `StagedMerge.cpp:90` `Acquire` still only adds entries, and only device teardown (`StagedMerge.cpp:273`) removes them. 2. `RecordedDraw` doc comment sits above `StagedWrite`: **Still open** (non-blocking). The comment is at `Draw.cpp:2209`, `struct StagedWrite` at 2213 and `struct RecordedDraw` at 2221. 3. Redundant `Require` and a possibly stale `multisampleImage` handle: **Still open** (non-blocking). `Draw.cpp:2983-2985` still calls `MultisampleTargetView(..., &binding.multisampleImage)` before `MultisampleTargetStorageView`, then `Require(MultisampleTargetStorable(...))`. 4. Order with #9335: **Resolved**. The checklist now records that #9335's author agreed to merge `main` on top of this PR. That comes from the author's description, and I did not check it on #9335. ## New findings ### Blocking 1. **The merged tree does not build with Linux/GCC (`sizeof(State)` guard).** The guard is at [`PipelineJournal.cpp:44`](https://github.com/boykopovar/AnyPS5/blob/734d8d19d75fe80f1b5608c0a6c27aaffaee6d80/core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp#L44). At the merge base `69bfe76785` it read 920. `main` raised it to 928 in `372d688b87` for its own `State` growth, and this PR raised it from 920 to 928 for the three staged `ColorTarget` fields. Both sides changed the line identically, so git merged it silently. With both growths, `State` is 936 bytes, and `libSceAgcDriver` fails to compile on Linux x86_64 with libstdc++, which is what the `linux` CI job uses. The test results reported on `734d8d19d7` were all on trees that did not have both growths, or on Windows, where the guard is compiled out. Fix: merge current `main` again, set the guard to the size measured on the merged tree (936 against `aeae1aebe7`), and check that the recipe codec still needs no new field. My earlier review accepted that point for the staged fields. I did not check what `main` added. ### Non-blocking None beyond the three still-open items above. ## Not verified - 2-sample cases on this machine (lavapipe printed only 4- and 8-sample lines). Other GPU vendors, Windows, and the title PPSA19015. - A validation comparison against `main` in this run: the bot's comparison was skipped because the build failed. I ran the five focused tests on the patched merged tree with the layer active and saw no `VUID-` lines, but I did not run `main` again. - Negative control by restoring production files from `main`: the tests use `ColorTarget::staged` and `StagedMergeTarget`, so they do not compile against `main`. I used the merge-kernel mutation above instead. ## To get this to a good state - Merge current `main`, update the `sizeof(State)` guard to the size GCC reports on the merged tree, and confirm a Linux/GCC build of `libs`. - Optionally, address the three non-blocking items from the previous review. <!-- anyps5-bots job=1904 head=734d8d19d75fe80f1b5608c0a6c27aaffaee6d80 -->
XairRrR commented 2026-11-02 20:42:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T20:42:22Z.

Review: APPROVED


Re-checked — approved

The new commit f8112e0de6 changes the Linux sizeof(State) guard from 928 to 936, and 3ffeb212b0 merges current main again. The merged tree now builds with GCC, which fixes my one blocking finding. The focused tests pass on lavapipe with validation on, and the merge-kernel mutation still makes the multisample test fail.

What changed since my last review

  • f8112e0de6 (new): a one-line change at PipelineJournal.cpp:44, sizeof(State) == 928 → 936. Nothing else in the commit.
  • 3ffeb212b0: a merge of current main. The range-diff shows the feature commit 7ef4e4a696 is unchanged.
  • The author's reply (2026-11-02) gives the reason for the fix and says the three non-blocking items are unchanged. I confirmed that in the code.

What I ran

Head f8112e0de6628a9fb48a10c7a8d652661a1f42dc, merged with --no-ff onto main 9090972b7e91fd266819cbd77a8b058e177b5682 (merged tree ce0cc84f8f4d25d691fffb36568e048b81efbf88), in a clean worktree. Debian 13 VM, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6, LLVM 19).

git diff --check 9090972b7e91fd266819cbd77a8b058e177b5682...f8112e0de6628a9fb48a10c7a8d652661a1f42dc
python3 tools/check_conventions.py --base 9090972b7e91fd266819cbd77a8b058e177b5682
git show f8112e0de6
git show 372d688b87      # main's guard change 920 -> 928
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -j8 --test-load 32 -V -R '^agc_driver_(graphics|packed_unorm4444_multisample_partial_write|packed_unorm4444_partial_write|packed_unorm4444_color_target|multisampled_pass_order|pipeline_journal)$'
# mutation: PackedMerge.comp `if (false && word == unwritten) continue;`
ninja -C build -j32 -l32 agc_driver_packed_unorm4444_multisample_partial_write_tests
ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_driver_packed_unorm4444_multisample_partial_write$'
# restored PackedMerge.comp from the merged tree, rebuilt, reran (passed); git status --porcelain is empty
Check Result
git diff --check clean
check_conventions.py All conventions checks passed.
Build of the merged tree (libs and the selected tests, from the bot's run) passed
Selected tests (bot's run, 2102 tests) no new failures and no timeouts. The 7 known failures also fail on main
Validation comparison with main (bot's run, 757 tests) layer loaded in 756 tests and missing in none, 0 tests with new VUID- lines
Focused tests, validation on (my run) 6/6 passed. Layer inserted 25 times, no was not found but was requested line, 0 VUID- lines
Merge-kernel mutation the test fails. After restoring the kernel, it passes
Focused run
1/6 Test #1194: agc_driver_multisampled_pass_order ......................   Passed    0.19 sec
2/6 Test #1214: agc_driver_packed_unorm4444_color_target ................   Passed    1.07 sec
3/6 Test #1215: agc_driver_packed_unorm4444_multisample_partial_write ...   Passed    1.53 sec
4/6 Test #1216: agc_driver_packed_unorm4444_partial_write ...............   Passed    1.78 sec
5/6 Test #1588: agc_driver_graphics .....................................   Passed   34.72 sec
6/6 Test #1226: agc_driver_pipeline_journal .............................   Passed   40.41 sec
4_4_4_4 unorm 4-sample partial writes that kill under late tests: 128 surviving pixels merged, 128 killed pixels kept their word
4_4_4_4 unorm 8-sample partial write inside a scissor: the 42 pixels inside it merged and the rest kept their word
4_4_4_4 unorm 8-sample partial write of a depth read by the shader merged one depth per pixel into all its samples
Mutation
1/1 Test #1215: agc_driver_packed_unorm4444_multisample_partial_write ...***Failed    0.32 sec
2-sample R16_UINT storage color targets skipped, the device lacks them
AGC graphics: sample 0 of pixel (0, 0) holds 0xf69c, neither the merged word, the first draw's word nor the last draw's word

agc_driver_graphics and agc_driver_pipeline_journal took more than 30 s with validation on under -j8. TechLevelZero's NVIDIA runs report both over 30 s on main as well, so I am not counting them against this PR.

Previous findings

  1. Merged tree does not build with Linux/GCC (sizeof(State) guard): Resolved (blocking). PipelineJournal.cpp:44 now reads 936, and the merged tree compiles with GCC 14 on x86_64 Linux with libstdc++. main's own guard change, 372d688b87, edits only that line. Whether main's own State growth needs a recipe field is a question for main, not for this PR.
  2. Temporary pool never evicts: Still open (non-blocking). StagedMerge.cpp:90 Acquire only adds entries. Only device teardown at line 273 removes them.
  3. RecordedDraw doc comment sits above StagedWrite: Still open (non-blocking). The comment is at Draw.cpp:2209, struct StagedWrite is at 2213 and struct RecordedDraw at 2221.
  4. Redundant Require and a possibly stale multisampleImage handle: Still open (non-blocking). See Draw.cpp:2983-2985.
  5. Landing order with #9335: Resolved in the previous round. Nothing changed here.

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • The 2-sample cases: lavapipe lacks 2-sample R16_UINT storage targets and skips them. I also did not check other GPU vendors, Windows, or the title PPSA19015. The author's Windows/NVIDIA runs and the other contributors' runs are author-reported or third-party.
  • A negative control that restores production files from main: the tests use ColorTarget::staged and StagedMergeTarget, so they do not compile against main. I used the merge-kernel mutation instead.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5743037252 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11557#pullrequestreview-5743037252). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-02T20:42:22Z. **Review:** APPROVED --- # Re-checked — approved The new commit `f8112e0de6` changes the Linux `sizeof(State)` guard from 928 to 936, and `3ffeb212b0` merges current `main` again. The merged tree now builds with GCC, which fixes my one blocking finding. The focused tests pass on lavapipe with validation on, and the merge-kernel mutation still makes the multisample test fail. ## What changed since my last review - `f8112e0de6` (new): a one-line change at `PipelineJournal.cpp:44`, `sizeof(State) == 928` → `936`. Nothing else in the commit. - `3ffeb212b0`: a merge of current `main`. The range-diff shows the feature commit `7ef4e4a696` is unchanged. - The author's reply (2026-11-02) gives the reason for the fix and says the three non-blocking items are unchanged. I confirmed that in the code. ## What I ran Head `f8112e0de6628a9fb48a10c7a8d652661a1f42dc`, merged with `--no-ff` onto `main` `9090972b7e91fd266819cbd77a8b058e177b5682` (merged tree `ce0cc84f8f4d25d691fffb36568e048b81efbf88`), in a clean worktree. Debian 13 VM, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6, LLVM 19). ``` git diff --check 9090972b7e91fd266819cbd77a8b058e177b5682...f8112e0de6628a9fb48a10c7a8d652661a1f42dc python3 tools/check_conventions.py --base 9090972b7e91fd266819cbd77a8b058e177b5682 git show f8112e0de6 git show 372d688b87 # main's guard change 920 -> 928 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -j8 --test-load 32 -V -R '^agc_driver_(graphics|packed_unorm4444_multisample_partial_write|packed_unorm4444_partial_write|packed_unorm4444_color_target|multisampled_pass_order|pipeline_journal)$' # mutation: PackedMerge.comp `if (false && word == unwritten) continue;` ninja -C build -j32 -l32 agc_driver_packed_unorm4444_multisample_partial_write_tests ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_driver_packed_unorm4444_multisample_partial_write$' # restored PackedMerge.comp from the merged tree, rebuilt, reran (passed); git status --porcelain is empty ``` | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | `All conventions checks passed.` | | Build of the merged tree (`libs` and the selected tests, from the bot's run) | passed | | Selected tests (bot's run, 2102 tests) | no new failures and no timeouts. The 7 known failures also fail on `main` | | Validation comparison with `main` (bot's run, 757 tests) | layer loaded in 756 tests and missing in none, 0 tests with new `VUID-` lines | | Focused tests, validation on (my run) | 6/6 passed. Layer inserted 25 times, no `was not found but was requested` line, 0 `VUID-` lines | | Merge-kernel mutation | the test fails. After restoring the kernel, it passes | <details><summary>Focused run</summary> ``` 1/6 Test #1194: agc_driver_multisampled_pass_order ...................... Passed 0.19 sec 2/6 Test #1214: agc_driver_packed_unorm4444_color_target ................ Passed 1.07 sec 3/6 Test #1215: agc_driver_packed_unorm4444_multisample_partial_write ... Passed 1.53 sec 4/6 Test #1216: agc_driver_packed_unorm4444_partial_write ............... Passed 1.78 sec 5/6 Test #1588: agc_driver_graphics ..................................... Passed 34.72 sec 6/6 Test #1226: agc_driver_pipeline_journal ............................. Passed 40.41 sec 4_4_4_4 unorm 4-sample partial writes that kill under late tests: 128 surviving pixels merged, 128 killed pixels kept their word 4_4_4_4 unorm 8-sample partial write inside a scissor: the 42 pixels inside it merged and the rest kept their word 4_4_4_4 unorm 8-sample partial write of a depth read by the shader merged one depth per pixel into all its samples ``` </details> <details><summary>Mutation</summary> ``` 1/1 Test #1215: agc_driver_packed_unorm4444_multisample_partial_write ...***Failed 0.32 sec 2-sample R16_UINT storage color targets skipped, the device lacks them AGC graphics: sample 0 of pixel (0, 0) holds 0xf69c, neither the merged word, the first draw's word nor the last draw's word ``` </details> `agc_driver_graphics` and `agc_driver_pipeline_journal` took more than 30 s with validation on under `-j8`. TechLevelZero's NVIDIA runs report both over 30 s on `main` as well, so I am not counting them against this PR. ## Previous findings 1. Merged tree does not build with Linux/GCC (`sizeof(State)` guard): **Resolved** (blocking). [`PipelineJournal.cpp:44`](https://github.com/boykopovar/AnyPS5/blob/f8112e0de6628a9fb48a10c7a8d652661a1f42dc/core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp#L44-L44) now reads 936, and the merged tree compiles with GCC 14 on x86_64 Linux with libstdc++. `main`'s own guard change, `372d688b87`, edits only that line. Whether `main`'s own `State` growth needs a recipe field is a question for `main`, not for this PR. 2. Temporary pool never evicts: **Still open** (non-blocking). [`StagedMerge.cpp:90`](https://github.com/boykopovar/AnyPS5/blob/f8112e0de6628a9fb48a10c7a8d652661a1f42dc/core/libs/prx/libSceAgcDriver/Graphics/src/StagedMerge.cpp#L90-L90) `Acquire` only adds entries. Only device teardown at line 273 removes them. 3. `RecordedDraw` doc comment sits above `StagedWrite`: **Still open** (non-blocking). The comment is at [`Draw.cpp:2209`](https://github.com/boykopovar/AnyPS5/blob/f8112e0de6628a9fb48a10c7a8d652661a1f42dc/core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp#L2209-L2221), `struct StagedWrite` is at 2213 and `struct RecordedDraw` at 2221. 4. Redundant `Require` and a possibly stale `multisampleImage` handle: **Still open** (non-blocking). See [`Draw.cpp:2983-2985`](https://github.com/boykopovar/AnyPS5/blob/f8112e0de6628a9fb48a10c7a8d652661a1f42dc/core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp#L2983-L2985). 5. Landing order with #9335: **Resolved** in the previous round. Nothing changed here. ## New findings ### Blocking None. ### Non-blocking None. ## Not verified - The 2-sample cases: lavapipe lacks 2-sample `R16_UINT` storage targets and skips them. I also did not check other GPU vendors, Windows, or the title PPSA19015. The author's Windows/NVIDIA runs and the other contributors' runs are author-reported or third-party. - A negative control that restores production files from `main`: the tests use `ColorTarget::staged` and `StagedMergeTarget`, so they do not compile against `main`. I used the merge-kernel mutation instead. <!-- anyps5-bots job=2412 head=f8112e0de6628a9fb48a10c7a8d652661a1f42dc -->
XairRrR commented 2026-11-03 09:17:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T09:17:19Z.

Review: APPROVED


Re-checked — approved

The only change since my last review is 1b12e6f302, a merge of current main that resolves a conflict in libSceAgcDriver/CMakeLists.txt. The resolution is correct, and the merged tree builds with GCC. The focused tests pass on lavapipe with validation on. The one new VUID- line in the bot's run comes from code on main, not from this PR.

What changed since my last review

  • 1b12e6f302: a merge of origin/main with a conflict in core/libs/prx/libSceAgcDriver/CMakeLists.txt. The range-diff shows 7ef4e4a696 and f8112e0de6 unchanged.
  • No new author comments after my review. The description and checklist are unchanged.

What I ran

Head 1b12e6f30246623db99280731c3690e9f004bd52, merged with --no-ff onto main 4f41f4c375f5abb487dbd184fbc150f31994d762 (merged tree 3e6306140a9b8ffff933ba17e9b433d018fb3435), in a clean worktree. Debian 13 VM, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6, LLVM 19).

git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...1b12e6f30246623db99280731c3690e9f004bd52
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
git diff 4f41f4c375f5abb487dbd184fbc150f31994d762 3e6306140a9b8ffff933ba17e9b433d018fb3435 -- core/libs/prx/libSceAgcDriver/CMakeLists.txt
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -j8 --test-load 32 -V -R '^agc_driver_(graphics|packed_unorm4444_multisample_partial_write|packed_unorm4444_partial_write|packed_unorm4444_color_target|multisampled_pass_order|pipeline_journal)$'
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -V -R '^agc_driver_native_depth_uniform_planes$'
git status --porcelain   # empty at the end
Check Result
git diff --check clean
check_conventions.py All conventions checks passed.
CMakeLists.txt against main Only the PR's additions remain: the PackedMerge.comp SPIR-V rule, StagedMerge.cpp and ${agcPackedMergeShaderHeader} in agcDriverSources. main's new StagingCopyBack and TextureDetileWords entries are kept
Build (libs and selected tests, bot's run) passed
Selected tests (bot's run, 2233) no new failures and no timeouts. The 7 known failures also fail on main
Validation comparison (bot's run, 770 tests) Layer loaded in 769 tests and missing in none. One test has new VUID- lines, agc_driver_native_depth_uniform_planes; see below
Focused tests, validation on (my run) 6/6 passed. Layer inserted 25 times, 0 VUID- lines, no was not found but was requested line
Focused run
1/6 Test #1356: agc_driver_multisampled_pass_order ......................   Passed    0.19 sec
2/6 Test #1376: agc_driver_packed_unorm4444_color_target ................   Passed    1.10 sec
3/6 Test #1377: agc_driver_packed_unorm4444_multisample_partial_write ...   Passed    1.53 sec
4/6 Test #1378: agc_driver_packed_unorm4444_partial_write ...............   Passed    1.80 sec
5/6 Test #1759: agc_driver_graphics .....................................   Passed   34.38 sec
6/6 Test #1388: agc_driver_pipeline_journal .............................   Passed   43.29 sec

The new VUID-vkCmdDispatch-groupCountX-00386 comes from main. The bot marks it (test not run on main): main's baseline d1ae628bc2 has no agc_driver_native_depth_uniform_planes. main added that test after the baseline, through the uniform-depth branch merged in fec9ceae93. The error is groupCountX (69144) exceeds device limit maxComputeWorkGroupCount[0] (65535). This PR changes neither DepthSurface.cpp, nor the test, nor the detiler. Its only new dispatch, StagedMerge.cpp:122, uses (width + 7) / 8 by (height + 7) / 8 groups for the scissor area, so it cannot reach 69144 groups in X. I tried to confirm this by rebuilding with the PR's production files taken from main. The sandbox could not reconfigure CMake, so that rebuild did not happen. The conclusion therefore rests on the code, not on a run. The worktree was restored, git status --porcelain is empty, and the build directory was not changed.

Previous findings

  1. Merged tree does not build with Linux/GCC (sizeof(State) guard): Resolved earlier. The merged tree still builds with GCC 14.
  2. Temporary pool never evicts: Still open (non-blocking). Graphics/src/StagedMerge.cpp:90: Acquire only adds entries. No code changed.
  3. The RecordedDraw doc comment sits above StagedWrite: Still open (non-blocking). The comment is at Graphics/src/Draw.cpp:2218-2221 and struct StagedWrite at 2223. Only the line numbers moved, from main's changes.
  4. Redundant Require and a possibly stale multisampleImage handle: Still open (non-blocking). See Graphics/src/Draw.cpp:2990-2993.
  5. Landing order with #9335: Resolved earlier.

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • Proof by a run that the uniform-planes VUID- line also appears without this PR. The sandbox could not regenerate the build, so this rests on the code reasoning above.
  • I did not rerun the merge-kernel mutation. PackedMerge.comp and the test are unchanged since my last review, where the mutation made the test fail.
  • 2-sample cases: lavapipe has no 2-sample R16_UINT storage targets. Other GPU vendors, Windows, and title PPSA19015 were not run here; those results are reported by the author or by other contributors.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5749610224 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11557#pullrequestreview-5749610224). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T09:17:19Z. **Review:** APPROVED --- # Re-checked — approved The only change since my last review is `1b12e6f302`, a merge of current `main` that resolves a conflict in `libSceAgcDriver/CMakeLists.txt`. The resolution is correct, and the merged tree builds with GCC. The focused tests pass on lavapipe with validation on. The one new `VUID-` line in the bot's run comes from code on `main`, not from this PR. ## What changed since my last review - `1b12e6f302`: a merge of `origin/main` with a conflict in `core/libs/prx/libSceAgcDriver/CMakeLists.txt`. The range-diff shows `7ef4e4a696` and `f8112e0de6` unchanged. - No new author comments after my review. The description and checklist are unchanged. ## What I ran Head `1b12e6f30246623db99280731c3690e9f004bd52`, merged with `--no-ff` onto `main` `4f41f4c375f5abb487dbd184fbc150f31994d762` (merged tree `3e6306140a9b8ffff933ba17e9b433d018fb3435`), in a clean worktree. Debian 13 VM, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6, LLVM 19). ``` git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...1b12e6f30246623db99280731c3690e9f004bd52 python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 git diff 4f41f4c375f5abb487dbd184fbc150f31994d762 3e6306140a9b8ffff933ba17e9b433d018fb3435 -- core/libs/prx/libSceAgcDriver/CMakeLists.txt VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -j8 --test-load 32 -V -R '^agc_driver_(graphics|packed_unorm4444_multisample_partial_write|packed_unorm4444_partial_write|packed_unorm4444_color_target|multisampled_pass_order|pipeline_journal)$' VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -V -R '^agc_driver_native_depth_uniform_planes$' git status --porcelain # empty at the end ``` | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | `All conventions checks passed.` | | `CMakeLists.txt` against `main` | Only the PR's additions remain: the `PackedMerge.comp` SPIR-V rule, `StagedMerge.cpp` and `${agcPackedMergeShaderHeader}` in `agcDriverSources`. `main`'s new `StagingCopyBack` and `TextureDetileWords` entries are kept | | Build (`libs` and selected tests, bot's run) | passed | | Selected tests (bot's run, 2233) | no new failures and no timeouts. The 7 known failures also fail on `main` | | Validation comparison (bot's run, 770 tests) | Layer loaded in 769 tests and missing in none. One test has new `VUID-` lines, `agc_driver_native_depth_uniform_planes`; see below | | Focused tests, validation on (my run) | 6/6 passed. Layer inserted 25 times, 0 `VUID-` lines, no `was not found but was requested` line | <details><summary>Focused run</summary> ``` 1/6 Test #1356: agc_driver_multisampled_pass_order ...................... Passed 0.19 sec 2/6 Test #1376: agc_driver_packed_unorm4444_color_target ................ Passed 1.10 sec 3/6 Test #1377: agc_driver_packed_unorm4444_multisample_partial_write ... Passed 1.53 sec 4/6 Test #1378: agc_driver_packed_unorm4444_partial_write ............... Passed 1.80 sec 5/6 Test #1759: agc_driver_graphics ..................................... Passed 34.38 sec 6/6 Test #1388: agc_driver_pipeline_journal ............................. Passed 43.29 sec ``` </details> **The new `VUID-vkCmdDispatch-groupCountX-00386` comes from `main`.** The bot marks it `(test not run on main)`: `main`'s baseline `d1ae628bc2` has no `agc_driver_native_depth_uniform_planes`. `main` added that test after the baseline, through the uniform-depth branch merged in `fec9ceae93`. The error is `groupCountX (69144) exceeds device limit maxComputeWorkGroupCount[0] (65535)`. This PR changes neither `DepthSurface.cpp`, nor the test, nor the detiler. Its only new dispatch, `StagedMerge.cpp:122`, uses `(width + 7) / 8` by `(height + 7) / 8` groups for the scissor area, so it cannot reach 69144 groups in X. I tried to confirm this by rebuilding with the PR's production files taken from `main`. The sandbox could not reconfigure CMake, so that rebuild did not happen. The conclusion therefore rests on the code, not on a run. The worktree was restored, `git status --porcelain` is empty, and the build directory was not changed. ## Previous findings 1. Merged tree does not build with Linux/GCC (`sizeof(State)` guard): **Resolved** earlier. The merged tree still builds with GCC 14. 2. Temporary pool never evicts: **Still open** (non-blocking). `Graphics/src/StagedMerge.cpp:90`: `Acquire` only adds entries. No code changed. 3. The `RecordedDraw` doc comment sits above `StagedWrite`: **Still open** (non-blocking). The comment is at `Graphics/src/Draw.cpp:2218-2221` and `struct StagedWrite` at 2223. Only the line numbers moved, from `main`'s changes. 4. Redundant `Require` and a possibly stale `multisampleImage` handle: **Still open** (non-blocking). See `Graphics/src/Draw.cpp:2990-2993`. 5. Landing order with #9335: **Resolved** earlier. ## New findings ### Blocking None. ### Non-blocking None. ## Not verified - Proof by a run that the uniform-planes `VUID-` line also appears without this PR. The sandbox could not regenerate the build, so this rests on the code reasoning above. - I did not rerun the merge-kernel mutation. `PackedMerge.comp` and the test are unchanged since my last review, where the mutation made the test fail. - 2-sample cases: lavapipe has no 2-sample `R16_UINT` storage targets. Other GPU vendors, Windows, and title PPSA19015 were not run here; those results are reported by the author or by other contributors. <!-- anyps5-bots job=3243 head=1b12e6f30246623db99280731c3690e9f004bd52 -->
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!11557
No description provided.