feat(agc): blend into 10_11_11 unorm color targets in the pixel shader #9748

Open
Celegans12 wants to merge 1 commit from upstream-pr/9748 into main
Celegans12 commented 2026-10-22 12:14:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-22T12:14:28Z.


What

A blended or partial write into a 10_11_11 unorm color target threw. It now goes through the pixel-interlock target merge that #9020 added for 11_11_10 float targets, instead of a second path.

  • Decode moves the blend into mergeBlend and maps red to bits 10..0, green to 21..11 and blue to 31..22 of the word. Partial writes merge only those fields.
  • The merge unpacks the stored word, clamps source color and alpha to [0, 1] (NaN to 0), blends in fp32 with destination alpha 1 and packs to nearest even. The 11_11_10 float path emits the same SPIR-V as before.
  • Still throwing: blends without BLEND_CLAMP, constant or dual-source factors, multisampled or volume targets, devices without pixel interlock.
  • Console clamp and rounding for this format are not measured; the debt line states the assumption.

Since #9020 and #7243 merged, main has the merge path and the replacement-blend rule; this PR adds only the 10_11_11 unorm case. #11684's unclamped normalized blend still refuses packed targets, so blends without BLEND_CLAMP keep throwing. The request, shader cache and journal layouts do not change, so this takes no new version numbers.

Tested

Based on main b4a82720a8. Windows 11, MinGW-w64 GCC 15.2.0, Release, -DBUILD_TESTING=ON, touched targets only. On an RTX 3080 Laptop (621.14), with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (layer 1.4.363, insertion confirmed in each log): agc_driver_packed_unorm_blend, agc_driver_graphics, and the neighbours agc_driver_packed_float_blend, agc_driver_packed_float_color_target, agc_driver_packed_unorm_color_target, agc_driver_packed_unorm4444_partial_write, agc_driver_packed_unorm4444_multisample_partial_write and agc_driver_unclamped_normalized_blend. All 8 passed in each of three runs, with no skips and no VUID- errors; the layer only reported ShaderOutputNotConsumed warnings.

The two tests this PR changes, agc_driver_graphics and agc_driver_packed_unorm_blend, are unchanged since they were shown to fail without the change, apart from the shaderStorageImageReadWithoutFormat skip that main's float blend test now has. I didn't rerun them on main this round; main's own Graphics.cpp still expects these blends to throw. Not tested: Linux (CI), AMD and Intel GPUs, title runs, console behaviour. No performance claim.

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 RTX 3080 Laptop, 621.14, Windows 11
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4967166187 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9748). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-22T12:14:28Z. --- ### What A blended or partial write into a 10_11_11 unorm color target threw. It now goes through the pixel-interlock target merge that #9020 added for 11_11_10 float targets, instead of a second path. - Decode moves the blend into `mergeBlend` and maps red to bits 10..0, green to 21..11 and blue to 31..22 of the word. Partial writes merge only those fields. - The merge unpacks the stored word, clamps source color and alpha to [0, 1] (NaN to 0), blends in fp32 with destination alpha 1 and packs to nearest even. The 11_11_10 float path emits the same SPIR-V as before. - Still throwing: blends without BLEND_CLAMP, constant or dual-source factors, multisampled or volume targets, devices without pixel interlock. - Console clamp and rounding for this format are not measured; the debt line states the assumption. Since #9020 and #7243 merged, main has the merge path and the replacement-blend rule; this PR adds only the 10_11_11 unorm case. #11684's unclamped normalized blend still refuses packed targets, so blends without BLEND_CLAMP keep throwing. The request, shader cache and journal layouts do not change, so this takes no new version numbers. ### Tested Based on `main` b4a82720a8. Windows 11, MinGW-w64 GCC 15.2.0, Release, `-DBUILD_TESTING=ON`, touched targets only. On an RTX 3080 Laptop (621.14), with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` (layer 1.4.363, insertion confirmed in each log): `agc_driver_packed_unorm_blend`, `agc_driver_graphics`, and the neighbours `agc_driver_packed_float_blend`, `agc_driver_packed_float_color_target`, `agc_driver_packed_unorm_color_target`, `agc_driver_packed_unorm4444_partial_write`, `agc_driver_packed_unorm4444_multisample_partial_write` and `agc_driver_unclamped_normalized_blend`. All 8 passed in each of three runs, with no skips and no `VUID-` errors; the layer only reported `ShaderOutputNotConsumed` warnings. The two tests this PR changes, `agc_driver_graphics` and `agc_driver_packed_unorm_blend`, are unchanged since they were shown to fail without the change, apart from the `shaderStorageImageReadWithoutFormat` skip that main's float blend test now has. I didn't rerun them on main this round; main's own `Graphics.cpp` still expects these blends to throw. Not tested: Linux (CI), AMD and Intel GPUs, title runs, console behaviour. No performance claim. ### 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 RTX 3080 Laptop, 621.14, Windows 11 - [x] AI-assisted: yes
MarcZX10 commented 2026-10-22 14:57:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T14:57:11Z.

Review: DISMISSED


I reviewed the last commit only, as requested. The new packed-target path needs the repository's GPU validation evidence before it is ready to approve: CONTRIBUTING.md requires the same focused tests on main and the change, with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1, via ctest -V from the same machine/GPU, and a comparison showing no new VUID errors. The report has ctest totals and says there were no VUID errors on the change, but it does not give a paired main run, the exact environment/verbose test details, or a baseline comparison. Please add that evidence after refreshing from current main, or say clearly if this cannot be run. Current hosted PR checks cover conventions, intake and labels; they do not run this GPU comparison.\n\nThere is also an acknowledged test integration follow-up: #7243 is still open, and its graphics tests currently expect additive blending into this 10_11_11 unorm target to throw. When both changes land, that expectation must be updated. Please coordinate via the existing Depends on/overlap convention so the result does not leave a failing test.\n\nLocal review checks: and All conventions checks passed. passed (the diff-check emitted an existing trailing blank line warning in docs/dev/debt/libSceContentExport.md). could not run because this checkout has no configured build directory. I could not run Vulkan execution tests here because no configured build/dependencies are available and disk space is insufficient for a new build. The submitted Windows RTX 3080 and WSL lavapipe runs are recorded in the PR description, but I did not independently reproduce them.\n\nI did not find a substantiated defect in the last commit's merge logic or new test in this review. This request is limited to the repository-required validation evidence and integration coordination.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5616241719 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9748#pullrequestreview-5616241719). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T14:57:11Z. **Review:** DISMISSED --- I reviewed the last commit only, as requested. The new packed-target path needs the repository's GPU validation evidence before it is ready to approve: CONTRIBUTING.md requires the same focused tests on main and the change, with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1, via ctest -V from the same machine/GPU, and a comparison showing no new VUID errors. The report has ctest totals and says there were no VUID errors on the change, but it does not give a paired main run, the exact environment/verbose test details, or a baseline comparison. Please add that evidence after refreshing from current main, or say clearly if this cannot be run. Current hosted PR checks cover conventions, intake and labels; they do not run this GPU comparison.\n\nThere is also an acknowledged test integration follow-up: #7243 is still open, and its graphics tests currently expect additive blending into this 10_11_11 unorm target to throw. When both changes land, that expectation must be updated. Please coordinate via the existing Depends on/overlap convention so the result does not leave a failing test.\n\nLocal review checks: and All conventions checks passed. passed (the diff-check emitted an existing trailing blank line warning in docs/dev/debt/libSceContentExport.md). could not run because this checkout has no configured build directory. I could not run Vulkan execution tests here because no configured build/dependencies are available and disk space is insufficient for a new build. The submitted Windows RTX 3080 and WSL lavapipe runs are recorded in the PR description, but I did not independently reproduce them.\n\nI did not find a substantiated defect in the last commit's merge logic or new test in this review. This request is limited to the repository-required validation evidence and integration coordination.
MarcZX10 commented 2026-10-22 14:57:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T14:57:21Z.


Correction to my local-check wording above: git diff --check reported a trailing blank line at EOF in docs/dev/debt/libSceContentExport.md; python tools/check_conventions.py --base b7d1d47 --head 28d4f1b0d130eaa56381f8adb2e31581b8d27f96 passed. python tools/check_test_registration.py could not run because there is no configured build/CMakeCache.txt. I could not run Vulkan execution tests here because no configured build/dependencies are available and disk space is insufficient for a new build. The reported RTX 3080 and WSL lavapipe test runs are from the PR description; I did not independently reproduce them.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6343856247 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9748#issuecomment-6343856247). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T14:57:21Z. --- Correction to my local-check wording above: `git diff --check` reported a trailing blank line at EOF in `docs/dev/debt/libSceContentExport.md`; `python tools/check_conventions.py --base b7d1d47 --head 28d4f1b0d130eaa56381f8adb2e31581b8d27f96` passed. `python tools/check_test_registration.py` could not run because there is no configured `build/CMakeCache.txt`. I could not run Vulkan execution tests here because no configured build/dependencies are available and disk space is insufficient for a new build. The reported RTX 3080 and WSL lavapipe test runs are from the PR description; I did not independently reproduce them.
MarcZX10 commented 2026-10-22 17:04:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T17:04:40Z.

Review: COMMENTED


I rechecked the current head 28d4f1b0d130eaa56381f8adb2e31581b8d27f96. The PR reports a Windows RTX 3080 run and WSL/lavapipe run, but neither is a paired current-main versus final-head comparison with the required environment and layer-found confirmation; the Windows report only says no VUIDs on the change. The #9020 dependency and #7243 overlap also need to be stated in the checklist/merge order. Against live main 11f976b27c16ed91633f00039dba5dfd97dd7cc1, the merge tree conflicts in docs/dev/debt/shader.md; the branch is 619 commits behind its base snapshot. Please rebase onto current main, resolve that debt conflict and the #7243 test expectation with its author, then run the same focused Vulkan tests on main and the final head with VK_INSTANCE_LAYERS, ANYPS5_NO_SHADER_CACHE=1, and ANYPS5_REQUIRE_VULKAN=1; confirm the layer loaded and compare VUIDs. If unavailable, state the limitation. I found no additional functional defect in the blend path inspected, but those repository-required integration checks remain.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5617950530 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9748#pullrequestreview-5617950530). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T17:04:40Z. **Review:** COMMENTED --- I rechecked the current head `28d4f1b0d130eaa56381f8adb2e31581b8d27f96`. The PR reports a Windows RTX 3080 run and WSL/lavapipe run, but neither is a paired current-main versus final-head comparison with the required environment and layer-found confirmation; the Windows report only says no VUIDs on the change. The #9020 dependency and #7243 overlap also need to be stated in the checklist/merge order. Against live main `11f976b27c16ed91633f00039dba5dfd97dd7cc1`, the merge tree conflicts in `docs/dev/debt/shader.md`; the branch is 619 commits behind its base snapshot. Please rebase onto current main, resolve that debt conflict and the #7243 test expectation with its author, then run the same focused Vulkan tests on main and the final head with `VK_INSTANCE_LAYERS`, `ANYPS5_NO_SHADER_CACHE=1`, and `ANYPS5_REQUIRE_VULKAN=1`; confirm the layer loaded and compare VUIDs. If unavailable, state the limitation. I found no additional functional defect in the blend path inspected, but those repository-required integration checks remain.
adriadam10 commented 2026-10-28 14:34:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-28T14:34:11Z.

Review: CHANGES_REQUESTED


Reviewed the last commit (16a82db7af) only; the base is #9020.

  • The commit itself looks right: the 10_11_11 unorm blend goes through the same merge as 11_11_10 float, PackedWriteMask fields (10..0, 21..11, 31..22) match the format, BLEND_CLAMP is required and source color/alpha are clamped to [0, 1] before the blend. agc_driver_graphics pins the decode and agc_driver_packed_unorm_blend the result, and both fail without the change.
  • It can't land yet: #9020 and #7243 are still open, and the stack conflicts with main. Once they merge, please rebase and take the next free shader disk cache / request serializer numbers, as @oneandonlydean asked.
  • After #7243 lands, an additive 10_11_11 unorm blend no longer throws only for ONE/ZERO/ADD; re-check the Graphics.cpp expectations you changed (0x40050504) against its decode, and rerun agc_driver_packed_unorm_blend with the validation layer on the rebased head.

Not verified here: the console's rounding and clamp for this format (the debt line states the assumption).

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5684384485 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9748#pullrequestreview-5684384485). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-28T14:34:11Z. **Review:** CHANGES_REQUESTED --- Reviewed the last commit (16a82db7af) only; the base is #9020. - The commit itself looks right: the 10_11_11 unorm blend goes through the same merge as 11_11_10 float, `PackedWriteMask` fields (10..0, 21..11, 31..22) match the format, `BLEND_CLAMP` is required and source color/alpha are clamped to [0, 1] before the blend. `agc_driver_graphics` pins the decode and `agc_driver_packed_unorm_blend` the result, and both fail without the change. - It can't land yet: #9020 and #7243 are still open, and the stack conflicts with `main`. Once they merge, please rebase and take the next free shader disk cache / request serializer numbers, as @oneandonlydean asked. - After #7243 lands, an additive 10_11_11 unorm blend no longer throws only for ONE/ZERO/ADD; re-check the `Graphics.cpp` expectations you changed (`0x40050504`) against its decode, and rerun `agc_driver_packed_unorm_blend` with the validation layer on the rebased head. Not verified here: the console's rounding and clamp for this format (the debt line states the assumption).
XairRrR commented 2026-10-29 04:02:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-29T04:02:30Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The last commit behaves as described: it builds, its tests pass under the validation layer with no VUID- errors, and both negative controls fail. It cannot land yet, though: the head conflicts with current main in 7 files, and the PRs it depends on (#9020, #7243) are still open.

What I ran

  • Head: 16a82db7af80158594b47341820f9e7c269ed573 (one commit on #9020's head 5f7287406a069f053e70a86b4e79220d12f2fece)
  • main: b433c40f2f46aa2e59e19806010a839ac8572d64
  • Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), Release, Ninja, BUILD_TESTING=ON
git fetch origin main pull/9748/head:refs/review/9748
git checkout --detach origin/main
git merge --no-ff --no-edit refs/review/9748      # conflicts, aborted; reviewed the head instead
git checkout --detach refs/review/9748
git diff --check origin/main...refs/review/9748
python3 tools/check_conventions.py --base origin/main
cmake -S . -B build
cmake --build build -j10 --target agc_driver_graphics_tests agc_driver_packed_unorm_blend_tests \
  agc_driver_packed_float_blend_tests agc_driver_packed_unorm_color_target_tests \
  agc_driver_packed_float_color_target_tests agc_driver_packed_unorm4444_partial_write_tests \
  agc_shader_memory_tests request_serializer_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 -j4 -V --output-on-failure \
  -R '^(request_serializer|agc_shader_memory|agc_driver_graphics|agc_driver_packed_float_blend|agc_driver_packed_float_color_target|agc_driver_packed_unorm4444_partial_write|agc_driver_packed_unorm_blend|agc_driver_packed_unorm_color_target)$'
# same build and ctest on origin/main for the 6 of those tests that exist there

Results

Check Result
Merge into main b433c40f2f Conflicts in 7 files (list below)
git diff --check clean
tools/check_conventions.py --base origin/main All conventions checks passed.
Build of the 8 test targets (head) OK
Focused tests, head, validation layer 8/8 passed, each under 5 s
Focused tests, main, validation layer 6/6 passed (the float and unorm blend tests don't exist on main)
VUID- lines 0 on head, 0 on main
was not found but was requested by env var VK_INSTANCE_LAYERS absent from both logs; the loader inserted VK_LAYER_KHRONOS_validation for every test that opens a device (5 on head, 3 on main)
Other layer messages Undefined-Value-ShaderOutputNotConsumed-DynamicRendering: 10 on main (4_4_4_4 partial write), 30 on head (10 each from 4_4_4_4 partial write, float blend and unorm blend)
Merge conflicts with main b433c40f2f (hunk count)
core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp           2
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp                         1  (include list)
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp                     4
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp             3
core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp           1  (include list)
core/shader/recompiler/tests/RequestSerializerTests.cpp                 10
docs/dev/debt/libSceAgcDriver.md                                         1  (main's new "11_11_10 float CB resolve" line vs this stack's two blend lines)

Only the debt hunk touches a line of the last commit; the other hunks come from #9020.

Head test run (excerpt)
1012: 11_11_10 float blend tests passed: 11 single blends, 2 partial writes, a back-to-back chain and 2 same-draw overdraws of 16 layers into a 256x128 tiled target, the unscissored pixels kept, and 3 merges into mips and slices of 2D arrays
1020: 10_11_11 unorm blend tests passed: 14 single blends, 2 partial writes, a back-to-back chain and 2 same-draw overdraws of 16 layers into a 256x128 tiled target, the unscissored pixels kept
6/8 Test #1020: agc_driver_packed_unorm_blend ...............   Passed    0.47 sec
8/8 Test  #685: agc_driver_graphics .........................   Passed    4.28 sec
100% tests passed out of 8
main test run (excerpt)
5/6 Test #1295: agc_driver_packed_unorm4444_partial_write ...   Passed    0.82 sec
6/6 Test  #948: agc_driver_graphics .........................   Passed    4.25 sec
100% tests passed out of 6

Negative control

The last commit is measured against its parent, #9020's head 5f7287406a.

  1. I restored Graphics/include/State.hpp, Graphics/src/State.cpp, SpirvModuleEmitter.cpp and ShaderInputInfoBuilder.cpp from the parent. agc_driver_graphics then fails with AGC graphics: blending into a 10_11_11 unorm color target is unsupported. agc_driver_packed_unorm_blend does not compile, because it calls the new PackedBlendControl(packing, control) overload.
  2. I kept the new State.hpp and State.cpp, so the execution test compiles, and restored only SpirvModuleEmitter.cpp and ShaderInputInfoBuilder.cpp. agc_driver_packed_unorm_blend then fails with ShaderInputInfoBuilder: a color target merge into an unsupported packing.

I then restored the head's files.

Findings

Blocking

  • The head conflicts with main. The 7 files are listed above. MarcZX10 and oneandonlydean already reported conflicts on earlier main commits. This confirms them on main b433c40f2f, where docs/dev/debt/libSceAgcDriver.md also collides with main's new "11_11_10 float CB resolve" entry. The request-serializer, disk-cache and journal conflicts belong to #9020. They still block this PR, because its head carries them.
  • Dependencies are still open. #9020 has conflicts and #7243 is mergeable but not merged. The Graphics.cpp expectation for an additive 10_11_11 unorm blend has to be reconciled with #7243's test once that lands, as adriadam10 already noted. I have nothing to add there.

Non-blocking

  • Clamping before MIN and MAX is not tested. BlendPackedColor clamps the source to [0, 1] before every combine function (SpirvModuleEmitter.cpp:525-530), and that includes MIN and MAX (lines 555-556). The MIN and MAX cases in the test only use sources inside [0, 1] (PackedUnormBlend.cpp:450-451), so a regression that skipped the clamp for MIN or MAX would still pass. One MIN case and one MAX case with a component above 1 or below 0 would cover it.
  • The debt line doesn't say what happens to a NaN source. NMax and NMin turn a NaN source component into 0. The console's behaviour for NaN under BLEND_CLAMP isn't stated anywhere, and the debt line (libSceAgcDriver.md:166) could name this assumption next to the rounding one.

Otherwise I found nothing in the last commit itself:

  • The PackedWriteMask fields (0x7ff, 0x3ff800, 0xffc00000) match the Format11_11_10UNorm layout of the plain export, which uses offsets 0, 11 and 22 and widths 11, 11 and 10.
  • BLEND_CLAMP (bit 15 of CB_COLOR_INFO) is required before the merge takes the blend (State.cpp:1721). That check is needed: the general unclamped-normalized check further down only runs while blendEnable is still set, and the merge clears it. BLEND_BYPASS is already handled where blendEnable is decoded.
  • The relaxed check in ShaderInputInfoBuilder (packing == None) refuses exactly the one remaining packing.

Not verified

  • The console's blend precision, its rounding, and how it clamps out-of-range and NaN sources for 10_11_11 unorm. The CPU reference in the test models the same assumptions as the implementation.
  • A merged tree. Because of the conflict, the head was built and tested on its own. That build used the submodule commits from main for SPIRV-Headers, SPIRV-Tools and vorbis, not the head's.
  • AMD and Intel GPUs, Windows, and the full test suite.

To get this to a good state

  1. Once #9020 is rebased on current main and merged, rebase this commit onto it. In the debt file, keep main's "11_11_10 float CB resolve" line next to the two blend lines.
  2. Once #7243 lands, update its additive 10_11_11 unorm expectation, as agreed in the thread.
  3. Optionally, add MIN and MAX cases with out-of-range sources, and state the NaN assumption in the debt line.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5692700539 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9748#pullrequestreview-5692700539). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-29T04:02:30Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The last commit behaves as described: it builds, its tests pass under the validation layer with no `VUID-` errors, and both negative controls fail. It cannot land yet, though: the head conflicts with current `main` in 7 files, and the PRs it depends on (#9020, #7243) are still open. ## What I ran - Head: `16a82db7af80158594b47341820f9e7c269ed573` (one commit on #9020's head `5f7287406a069f053e70a86b4e79220d12f2fece`) - `main`: `b433c40f2f46aa2e59e19806010a839ac8572d64` - Machine: Arch Linux 7.2.11-zen, GCC 16.2.1, Intel Core i9-14900KF, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.78.08), Release, Ninja, `BUILD_TESTING=ON` ```sh git fetch origin main pull/9748/head:refs/review/9748 git checkout --detach origin/main git merge --no-ff --no-edit refs/review/9748 # conflicts, aborted; reviewed the head instead git checkout --detach refs/review/9748 git diff --check origin/main...refs/review/9748 python3 tools/check_conventions.py --base origin/main cmake -S . -B build cmake --build build -j10 --target agc_driver_graphics_tests agc_driver_packed_unorm_blend_tests \ agc_driver_packed_float_blend_tests agc_driver_packed_unorm_color_target_tests \ agc_driver_packed_float_color_target_tests agc_driver_packed_unorm4444_partial_write_tests \ agc_shader_memory_tests request_serializer_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 -j4 -V --output-on-failure \ -R '^(request_serializer|agc_shader_memory|agc_driver_graphics|agc_driver_packed_float_blend|agc_driver_packed_float_color_target|agc_driver_packed_unorm4444_partial_write|agc_driver_packed_unorm_blend|agc_driver_packed_unorm_color_target)$' # same build and ctest on origin/main for the 6 of those tests that exist there ``` ## Results | Check | Result | |---|---| | Merge into `main` b433c40f2f | **Conflicts** in 7 files (list below) | | `git diff --check` | clean | | `tools/check_conventions.py --base origin/main` | `All conventions checks passed.` | | Build of the 8 test targets (head) | OK | | Focused tests, head, validation layer | 8/8 passed, each under 5 s | | Focused tests, `main`, validation layer | 6/6 passed (the float and unorm blend tests don't exist on `main`) | | `VUID-` lines | 0 on head, 0 on `main` | | `was not found but was requested by env var VK_INSTANCE_LAYERS` | absent from both logs; the loader inserted `VK_LAYER_KHRONOS_validation` for every test that opens a device (5 on head, 3 on `main`) | | Other layer messages | `Undefined-Value-ShaderOutputNotConsumed-DynamicRendering`: 10 on `main` (4_4_4_4 partial write), 30 on head (10 each from 4_4_4_4 partial write, float blend and unorm blend) | <details><summary>Merge conflicts with main b433c40f2f (hunk count)</summary> ``` core/libs/prx/libSceAgcDriver/Graphics/src/PipelineJournal.cpp 2 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp 1 (include list) core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp 4 core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp 3 core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp 1 (include list) core/shader/recompiler/tests/RequestSerializerTests.cpp 10 docs/dev/debt/libSceAgcDriver.md 1 (main's new "11_11_10 float CB resolve" line vs this stack's two blend lines) ``` Only the debt hunk touches a line of the last commit; the other hunks come from #9020. </details> <details><summary>Head test run (excerpt)</summary> ``` 1012: 11_11_10 float blend tests passed: 11 single blends, 2 partial writes, a back-to-back chain and 2 same-draw overdraws of 16 layers into a 256x128 tiled target, the unscissored pixels kept, and 3 merges into mips and slices of 2D arrays 1020: 10_11_11 unorm blend tests passed: 14 single blends, 2 partial writes, a back-to-back chain and 2 same-draw overdraws of 16 layers into a 256x128 tiled target, the unscissored pixels kept 6/8 Test #1020: agc_driver_packed_unorm_blend ............... Passed 0.47 sec 8/8 Test #685: agc_driver_graphics ......................... Passed 4.28 sec 100% tests passed out of 8 ``` </details> <details><summary>main test run (excerpt)</summary> ``` 5/6 Test #1295: agc_driver_packed_unorm4444_partial_write ... Passed 0.82 sec 6/6 Test #948: agc_driver_graphics ......................... Passed 4.25 sec 100% tests passed out of 6 ``` </details> ## Negative control The last commit is measured against its parent, #9020's head `5f7287406a`. 1. I restored `Graphics/include/State.hpp`, `Graphics/src/State.cpp`, `SpirvModuleEmitter.cpp` and `ShaderInputInfoBuilder.cpp` from the parent. `agc_driver_graphics` then fails with `AGC graphics: blending into a 10_11_11 unorm color target is unsupported`. `agc_driver_packed_unorm_blend` does not compile, because it calls the new `PackedBlendControl(packing, control)` overload. 2. I kept the new `State.hpp` and `State.cpp`, so the execution test compiles, and restored only `SpirvModuleEmitter.cpp` and `ShaderInputInfoBuilder.cpp`. `agc_driver_packed_unorm_blend` then fails with `ShaderInputInfoBuilder: a color target merge into an unsupported packing`. I then restored the head's files. ## Findings ### Blocking - **The head conflicts with `main`.** The 7 files are listed above. MarcZX10 and oneandonlydean already reported conflicts on earlier `main` commits. This confirms them on `main` b433c40f2f, where `docs/dev/debt/libSceAgcDriver.md` also collides with `main`'s new "11_11_10 float CB resolve" entry. The request-serializer, disk-cache and journal conflicts belong to #9020. They still block this PR, because its head carries them. - **Dependencies are still open.** #9020 has conflicts and #7243 is mergeable but not merged. The `Graphics.cpp` expectation for an additive 10_11_11 unorm blend has to be reconciled with #7243's test once that lands, as adriadam10 already noted. I have nothing to add there. ### Non-blocking - **Clamping before MIN and MAX is not tested.** `BlendPackedColor` clamps the source to [0, 1] before every combine function ([SpirvModuleEmitter.cpp:525-530](https://github.com/boykopovar/AnyPS5/blob/16a82db7af80158594b47341820f9e7c269ed573/core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp#L525-L530)), and that includes MIN and MAX (lines 555-556). The MIN and MAX cases in the test only use sources inside [0, 1] ([PackedUnormBlend.cpp:450-451](https://github.com/boykopovar/AnyPS5/blob/16a82db7af80158594b47341820f9e7c269ed573/core/libs/prx/libSceAgcDriver/tests/execution/PackedUnormBlend.cpp#L450-L451)), so a regression that skipped the clamp for MIN or MAX would still pass. One MIN case and one MAX case with a component above 1 or below 0 would cover it. - **The debt line doesn't say what happens to a NaN source.** `NMax` and `NMin` turn a NaN source component into 0. The console's behaviour for NaN under `BLEND_CLAMP` isn't stated anywhere, and the debt line ([libSceAgcDriver.md:166](https://github.com/boykopovar/AnyPS5/blob/16a82db7af80158594b47341820f9e7c269ed573/docs/dev/debt/libSceAgcDriver.md#L166-L166)) could name this assumption next to the rounding one. Otherwise I found nothing in the last commit itself: - The `PackedWriteMask` fields (0x7ff, 0x3ff800, 0xffc00000) match the `Format11_11_10UNorm` layout of the plain export, which uses offsets 0, 11 and 22 and widths 11, 11 and 10. - `BLEND_CLAMP` (bit 15 of `CB_COLOR_INFO`) is required before the merge takes the blend ([State.cpp:1721](https://github.com/boykopovar/AnyPS5/blob/16a82db7af80158594b47341820f9e7c269ed573/core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp#L1721-L1721)). That check is needed: the general unclamped-normalized check further down only runs while `blendEnable` is still set, and the merge clears it. `BLEND_BYPASS` is already handled where `blendEnable` is decoded. - The relaxed check in `ShaderInputInfoBuilder` (`packing == None`) refuses exactly the one remaining packing. ## Not verified - The console's blend precision, its rounding, and how it clamps out-of-range and NaN sources for 10_11_11 unorm. The CPU reference in the test models the same assumptions as the implementation. - A merged tree. Because of the conflict, the head was built and tested on its own. That build used the submodule commits from `main` for SPIRV-Headers, SPIRV-Tools and vorbis, not the head's. - AMD and Intel GPUs, Windows, and the full test suite. ## To get this to a good state 1. Once #9020 is rebased on current `main` and merged, rebase this commit onto it. In the debt file, keep `main`'s "11_11_10 float CB resolve" line next to the two blend lines. 2. Once #7243 lands, update its additive 10_11_11 unorm expectation, as agreed in the thread. 3. Optionally, add MIN and MAX cases with out-of-range sources, and state the NaN assumption in the debt line.
adriadam10 commented 2026-10-29 17:15:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-29T17:15:43Z.

Review: CHANGES_REQUESTED


Reviewed the last commit again; nothing new in it to fix, and the points of the previous comment stand. It still can't land:

  • It sits on #9020 (head moved to 237ede9d9, request serializer 50) and #7243, both still open, and conflicts with main in PipelineJournal.cpp, ShaderMemory.cpp, RequestSerializer.cpp, ShaderDiskCache.hpp, RequestSerializerTests.cpp and the debt file.
  • Once #9020 and #7243 are merged, please rebase and take the next free request serializer / shader disk cache numbers, re-chaining the legacy-reader tests.
  • After #7243 lands, an additive 10_11_11 unorm blend no longer throws only for ONE/ZERO/ADD: update the 0x40050504 expectation in Graphics.cpp and rerun agc_driver_packed_unorm_blend with the validation layer on the rebased head.

Feel free to ping when the base has merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5701980351 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9748#pullrequestreview-5701980351). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-29T17:15:43Z. **Review:** CHANGES_REQUESTED --- Reviewed the last commit again; nothing new in it to fix, and the points of the previous comment stand. It still can't land: - It sits on #9020 (head moved to `237ede9d9`, request serializer 50) and #7243, both still open, and conflicts with `main` in `PipelineJournal.cpp`, `ShaderMemory.cpp`, `RequestSerializer.cpp`, `ShaderDiskCache.hpp`, `RequestSerializerTests.cpp` and the debt file. - Once #9020 and #7243 are merged, please rebase and take the next free request serializer / shader disk cache numbers, re-chaining the legacy-reader tests. - After #7243 lands, an additive 10_11_11 unorm blend no longer throws only for ONE/ZERO/ADD: update the `0x40050504` expectation in `Graphics.cpp` and rerun `agc_driver_packed_unorm_blend` with the validation layer on the rebased head. Feel free to ping when the base has merged.
XairRrR commented 2026-11-02 20:29:55 +00:00 (Migrated from github.com)

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

Review: APPROVED


Re-checked — approved

What changed: the head is rebased onto current main. It carries the #9020 prerequisite as its own commit and follows the merged #7243. It takes request format 56, disk cache format 53 and pipeline journal format 16. It also adds MIN/MAX cases with sources outside [0, 1] and records the NaN-to-0 assumption in the debt file. The merged tree builds, the focused tests pass under the validation layer with no VUID- errors, and both negative controls fail as expected.

What changed since my last review

  • I last reviewed 16a82db7af, which was one commit on #9020's head. The head is now two commits on main 2a429a3108:
    • 01f8649dec: the attributed #9020 prerequisite, adapted to the current API.
    • 7b05c47249: the 10_11_11 unorm blend.
  • Depends on is now none. #7243 has been merged (per the thread), and the 0x40050504 expectation in Graphics.cpp now decodes to a merged target instead of throwing.
  • Format numbers:
    • Request serializer: writes 56. It still reads main's 52 and 51, and rejects 50 and 53–55 (RequestSerializer.cpp:971).
    • ShaderDiskCache FormatVersion: 53, against 51 on main.
    • Pipeline journal: FileFormat 16 (main is at 15), and sizeof(State) 936. The journal test checks that format 15 is rejected.
  • PackedUnormBlend.cpp:456-457 adds a MIN and a MAX case with a source component outside [0, 1].
  • docs/dev/debt/libSceAgcDriver.md:228 now states "NaN to 0".
  • As oneandonlydean asked, the assertions that pinned unimplemented blend modes were removed from Graphics.cpp.

What I ran

Head 7b05c472495812cdda97ffc68a4d7c835a44d9bc, main 096c45570f516de76a43bbe1b97781381c84f55f, merged tree b6e01669bdba872bdc210df69ffce2ba88703f42.

Machine: Debian 13 VM, 32 vCPU Xeon Gold 6136, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6, LLVM 19).

git diff --check 096c45570f516de76a43bbe1b97781381c84f55f...7b05c472495812cdda97ffc68a4d7c835a44d9bc
python3 tools/check_conventions.py --base 096c45570f516de76a43bbe1b97781381c84f55f
env 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 '^(request_serializer|agc_shader_memory|agc_driver_graphics|agc_driver_packed_float_blend|agc_driver_packed_unorm_blend|agc_driver_pipeline_journal|agc_driver_packed_unorm_color_target|agc_driver_packed_float_color_target)$'
# negative control 1: SpirvModuleEmitter.cpp, ShaderInputInfoBuilder.cpp from 01f8649dec
ninja -C build -j32 -l32 agc_driver_packed_unorm_blend_tests
ctest --test-dir build --output-on-failure -R '^agc_driver_packed_unorm_blend$'
# negative control 2: Graphics/src/State.cpp from 01f8649dec
ninja -C build -j32 -l32 agc_driver_graphics_tests
ctest --test-dir build --output-on-failure -R '^agc_driver_graphics$'
# restored from b6e01669bd, rebuilt, git status --porcelain empty
ctest --test-dir build -j4 -R '^(agc_driver_packed_unorm_blend|agc_driver_graphics|agc_driver_pipeline_journal)$'
Check Result
Merge into main 096c45570f clean
git diff --check clean
check_conventions.py All conventions checks passed.
Build and selected tests (script) 2101 ran: 0 new failures, 0 timeouts, 7 known main failures
Validation comparison (script) 759 tests; the layer loaded in 758, missing in none; 0 tests with new VUID-
Focused 8 tests, validation layer 8/8 passed, 0 VUID- lines, no was not found but was requested
Negative control 1 (shader side) agc_driver_packed_unorm_blend fails: ShaderInputInfoBuilder: a color target merge into an unsupported packing
Negative control 2 (decode) agc_driver_graphics fails: AGC graphics: blending into a 10_11_11 unorm color target is unsupported
Worktree after restore clean; the three tests pass again
Focused run (excerpt)
1218: 10_11_11 unorm blend tests passed: 16 single blends, 2 partial writes, a back-to-back chain and 2 same-draw overdraws of 16 layers into a 256x128 tiled target, the unscissored pixels kept
5/8 Test #1218: agc_driver_packed_unorm_blend ..........   Passed    1.89 sec
6/8 Test #1997: agc_shader_memory ......................   Passed    7.93 sec
7/8 Test #1590: agc_driver_graphics ....................   Passed   34.66 sec
8/8 Test #1228: agc_driver_pipeline_journal ............   Passed   42.96 sec
100% tests passed, 0 tests failed out of 8

The negative controls compare against the carried parent 01f8649dec, not main. With all production files restored from main, the tests could not compile: they need the prerequisite's API.

Previous findings

  • Head conflicts with main: Resolved. The script merged the head into main 096c45570f without conflicts. The debt file keeps main's "11_11_10 float CB resolve" entry next to the two blend entries (lines 227–229).
  • Dependencies still open: No longer applies.
    • #7243 merged, per the thread.
    • #9020's change is carried as 01f8649dec with attribution, and the checklist says Depends on: none.
    • The 0x40050504 expectation now expects a merged target, as adriadam10 asked.
  • Clamp before MIN/MAX untested: Resolved. PackedUnormBlend.cpp:456-457 adds MIN and MAX cases with components at -0.25 and 1.5, and the test reports 16 single blends (it was 14). As the description says, these cases check the final packed value, not the order of clamping.
  • NaN assumption missing from the debt line: Resolved. docs/dev/debt/libSceAgcDriver.md:228 states "NaN to 0", matching the NMax/NMin clamp at SpirvModuleEmitter.cpp:542-549.

New findings

Blocking

None.

Non-blocking

  • Two focused tests run over 30 s on lavapipe here. agc_driver_pipeline_journal took 43 s and agc_driver_graphics took 35–37 s, with or without the layer. The author reports 38 s for the journal test on main, and the NVIDIA CI comments show both tests near or above 30 s on earlier heads. I did not time main on this machine, so I don't count this against the PR. Still, Graphics.cpp grows by about 100 lines here, and splitting it would keep it under the CONTRIBUTING limit.
  • Format numbers will need reconciling at landing time. The author and oneandonlydean already say so: other open PRs claim request versions 53–55 and nearby disk cache numbers. Rejecting 53–55 explicitly (RequestSerializer.cpp:971) keeps those versions from being misread as 52 in the meantime.

Other code I checked:

  • State.cpp:1850 requires BLEND_CLAMP (bit 15 of CB_COLOR_INFO at 0x31c + slot * 0xf, the same addressing as line 1890) before taking a unorm blend.
  • With the partial-write Require removed, every WordPacked packing (4_4_4_4, 11_11_10, 10_11_11) is handled by PackedWriteMask, which still throws for any other packing.
  • The unorm field masks (0x7ff, 0x3ff800, 0xffc00000) are unchanged from what I checked last time.
  • Version 56 reads the merge fields only when version >= 56u, and the v52 fixture covers the legacy layout.

Not verified

  • Console clamp, rounding and NaN behaviour for 10_11_11 unorm blending. The debt line records these as assumptions, and the CPU reference in the test models the same ones.
  • AMD, Intel and NVIDIA hardware, and Windows. I only ran lavapipe; the NVIDIA and Windows results are as the author reported them.
  • Timing of the two slow tests on main on this machine.
  • Title behaviour (PPSA26344).
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5742895184 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9748#pullrequestreview-5742895184). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-02T20:29:55Z. **Review:** APPROVED --- # Re-checked — approved What changed: the head is rebased onto current `main`. It carries the #9020 prerequisite as its own commit and follows the merged #7243. It takes request format 56, disk cache format 53 and pipeline journal format 16. It also adds MIN/MAX cases with sources outside [0, 1] and records the NaN-to-0 assumption in the debt file. The merged tree builds, the focused tests pass under the validation layer with no `VUID-` errors, and both negative controls fail as expected. ## What changed since my last review - I last reviewed `16a82db7af`, which was one commit on #9020's head. The head is now two commits on `main` 2a429a3108: - `01f8649dec`: the attributed #9020 prerequisite, adapted to the current API. - `7b05c47249`: the 10_11_11 unorm blend. - `Depends on` is now `none`. #7243 has been merged (per the thread), and the `0x40050504` expectation in `Graphics.cpp` now decodes to a merged target instead of throwing. - Format numbers: - Request serializer: writes 56. It still reads `main`'s 52 and 51, and rejects 50 and 53–55 (`RequestSerializer.cpp:971`). - `ShaderDiskCache` `FormatVersion`: 53, against 51 on `main`. - Pipeline journal: `FileFormat` 16 (`main` is at 15), and `sizeof(State)` 936. The journal test checks that format 15 is rejected. - `PackedUnormBlend.cpp:456-457` adds a MIN and a MAX case with a source component outside [0, 1]. - `docs/dev/debt/libSceAgcDriver.md:228` now states "NaN to 0". - As oneandonlydean asked, the assertions that pinned unimplemented blend modes were removed from `Graphics.cpp`. ## What I ran Head `7b05c472495812cdda97ffc68a4d7c835a44d9bc`, `main` `096c45570f516de76a43bbe1b97781381c84f55f`, merged tree `b6e01669bdba872bdc210df69ffce2ba88703f42`. Machine: Debian 13 VM, 32 vCPU Xeon Gold 6136, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6, LLVM 19). ```sh git diff --check 096c45570f516de76a43bbe1b97781381c84f55f...7b05c472495812cdda97ffc68a4d7c835a44d9bc python3 tools/check_conventions.py --base 096c45570f516de76a43bbe1b97781381c84f55f env 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 '^(request_serializer|agc_shader_memory|agc_driver_graphics|agc_driver_packed_float_blend|agc_driver_packed_unorm_blend|agc_driver_pipeline_journal|agc_driver_packed_unorm_color_target|agc_driver_packed_float_color_target)$' # negative control 1: SpirvModuleEmitter.cpp, ShaderInputInfoBuilder.cpp from 01f8649dec ninja -C build -j32 -l32 agc_driver_packed_unorm_blend_tests ctest --test-dir build --output-on-failure -R '^agc_driver_packed_unorm_blend$' # negative control 2: Graphics/src/State.cpp from 01f8649dec ninja -C build -j32 -l32 agc_driver_graphics_tests ctest --test-dir build --output-on-failure -R '^agc_driver_graphics$' # restored from b6e01669bd, rebuilt, git status --porcelain empty ctest --test-dir build -j4 -R '^(agc_driver_packed_unorm_blend|agc_driver_graphics|agc_driver_pipeline_journal)$' ``` | Check | Result | |---|---| | Merge into `main` 096c45570f | clean | | `git diff --check` | clean | | `check_conventions.py` | `All conventions checks passed.` | | Build and selected tests (script) | 2101 ran: 0 new failures, 0 timeouts, 7 known `main` failures | | Validation comparison (script) | 759 tests; the layer loaded in 758, missing in none; 0 tests with new `VUID-` | | Focused 8 tests, validation layer | 8/8 passed, 0 `VUID-` lines, no `was not found but was requested` | | Negative control 1 (shader side) | `agc_driver_packed_unorm_blend` fails: `ShaderInputInfoBuilder: a color target merge into an unsupported packing` | | Negative control 2 (decode) | `agc_driver_graphics` fails: `AGC graphics: blending into a 10_11_11 unorm color target is unsupported` | | Worktree after restore | clean; the three tests pass again | <details><summary>Focused run (excerpt)</summary> ``` 1218: 10_11_11 unorm blend tests passed: 16 single blends, 2 partial writes, a back-to-back chain and 2 same-draw overdraws of 16 layers into a 256x128 tiled target, the unscissored pixels kept 5/8 Test #1218: agc_driver_packed_unorm_blend .......... Passed 1.89 sec 6/8 Test #1997: agc_shader_memory ...................... Passed 7.93 sec 7/8 Test #1590: agc_driver_graphics .................... Passed 34.66 sec 8/8 Test #1228: agc_driver_pipeline_journal ............ Passed 42.96 sec 100% tests passed, 0 tests failed out of 8 ``` </details> The negative controls compare against the carried parent `01f8649dec`, not `main`. With all production files restored from `main`, the tests could not compile: they need the prerequisite's API. ## Previous findings - **Head conflicts with `main`**: Resolved. The script merged the head into `main` 096c45570f without conflicts. The debt file keeps `main`'s "11_11_10 float CB resolve" entry next to the two blend entries (lines 227–229). - **Dependencies still open**: No longer applies. - #7243 merged, per the thread. - #9020's change is carried as `01f8649dec` with attribution, and the checklist says `Depends on: none`. - The `0x40050504` expectation now expects a merged target, as adriadam10 asked. - **Clamp before MIN/MAX untested**: Resolved. `PackedUnormBlend.cpp:456-457` adds MIN and MAX cases with components at -0.25 and 1.5, and the test reports 16 single blends (it was 14). As the description says, these cases check the final packed value, not the order of clamping. - **NaN assumption missing from the debt line**: Resolved. `docs/dev/debt/libSceAgcDriver.md:228` states "NaN to 0", matching the `NMax`/`NMin` clamp at `SpirvModuleEmitter.cpp:542-549`. ## New findings ### Blocking None. ### Non-blocking - **Two focused tests run over 30 s on lavapipe here.** `agc_driver_pipeline_journal` took 43 s and `agc_driver_graphics` took 35–37 s, with or without the layer. The author reports 38 s for the journal test on `main`, and the NVIDIA CI comments show both tests near or above 30 s on earlier heads. I did not time `main` on this machine, so I don't count this against the PR. Still, `Graphics.cpp` grows by about 100 lines here, and splitting it would keep it under the CONTRIBUTING limit. - **Format numbers will need reconciling at landing time.** The author and oneandonlydean already say so: other open PRs claim request versions 53–55 and nearby disk cache numbers. Rejecting 53–55 explicitly (`RequestSerializer.cpp:971`) keeps those versions from being misread as 52 in the meantime. Other code I checked: - `State.cpp:1850` requires `BLEND_CLAMP` (bit 15 of CB_COLOR_INFO at `0x31c + slot * 0xf`, the same addressing as line 1890) before taking a unorm blend. - With the partial-write `Require` removed, every `WordPacked` packing (4_4_4_4, 11_11_10, 10_11_11) is handled by `PackedWriteMask`, which still throws for any other packing. - The unorm field masks (`0x7ff`, `0x3ff800`, `0xffc00000`) are unchanged from what I checked last time. - Version 56 reads the merge fields only when `version >= 56u`, and the v52 fixture covers the legacy layout. ## Not verified - Console clamp, rounding and NaN behaviour for 10_11_11 unorm blending. The debt line records these as assumptions, and the CPU reference in the test models the same ones. - AMD, Intel and NVIDIA hardware, and Windows. I only ran lavapipe; the NVIDIA and Windows results are as the author reported them. - Timing of the two slow tests on `main` on this machine. - Title behaviour (PPSA26344). <!-- anyps5-bots job=1906 head=7b05c472495812cdda97ffc68a4d7c835a44d9bc -->
MarcZX10 commented 2026-11-23 02:17:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T02:17:51Z.

Review: COMMENTED


Reviewed — no blocking findings

The inspected changes add single-sample 10_11_11 unorm blend and partial-write merges; I found no concrete defect, but did not run the checks needed to justify approval.

What I ran

Reviewed head 84d9a641da0d26ee62600afce924b1c72b90c10b using the prepared diff, manifest, and pinned reader. No build, test, or negative-control commands were run. The hardware test results in the PR description are author-reported.

Results

Check Result Note
Changed-line review passed All eight changed files read
Build and tests not run Author-reported runs not independently verified
Negative control not run No test code was altered

Findings

Blocking

None.

Non-blocking

  • The new execution test does not appear to include NaN source or alpha cases, although the implementation and debt note specify NaN-to-zero clamping. Adding those cases would exercise that documented behavior (core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp:551).

Sources

Behavior claims were checked against the changed implementation and tests at the pinned head. The PR description reports three successful Windows/NVIDIA runs; those results were not independently verified.

Not verified

Build and test execution, Linux CI, AMD and Intel GPUs, physical console behavior, and the PR’s reported hardware runs. core/libs/prx/libSceAgcDriver/tests/Graphics.cpp was read only at its changed lines; the rest of that file was excluded as too large. No changed files were excluded from changed-line review.

To get this to a good state

Nothing is required. Optional: add NaN input cases to the execution test.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6015872483 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9748#pullrequestreview-6015872483). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-23T02:17:51Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The inspected changes add single-sample 10_11_11 unorm blend and partial-write merges; I found no concrete defect, but did not run the checks needed to justify approval. ## What I ran Reviewed head `84d9a641da0d26ee62600afce924b1c72b90c10b` using the prepared diff, manifest, and pinned reader. No build, test, or negative-control commands were run. The hardware test results in the PR description are author-reported. ## Results | Check | Result | Note | |---|---|---| | Changed-line review | passed | All eight changed files read | | Build and tests | not run | Author-reported runs not independently verified | | Negative control | not run | No test code was altered | ## Findings ### Blocking None. ### Non-blocking - The new execution test does not appear to include NaN source or alpha cases, although the implementation and debt note specify NaN-to-zero clamping. Adding those cases would exercise that documented behavior (`core/shader/recompiler/SpirvBackend/src/SpirvModuleEmitter.cpp:551`). ## Sources Behavior claims were checked against the changed implementation and tests at the pinned head. The PR description reports three successful Windows/NVIDIA runs; those results were not independently verified. ## Not verified Build and test execution, Linux CI, AMD and Intel GPUs, physical console behavior, and the PR’s reported hardware runs. `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` was read only at its changed lines; the rest of that file was excluded as too large. No changed files were excluded from changed-line review. ## To get this to a good state Nothing is required. Optional: add NaN input cases to the execution test.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/9748:upstream-pr/9748'
git switch 'upstream-pr/9748'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/9748'
git switch 'upstream-pr/9748'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/9748'
git switch 'upstream-pr/9748'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/9748'
git switch 'main'
git merge --squash 'upstream-pr/9748'
git switch 'main'
git merge --ff-only 'upstream-pr/9748'
git switch 'main'
git merge 'upstream-pr/9748'
git push origin 'main'
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!9748
No description provided.