fix(agc): copy a linked pipeline's color sample counts only when it has color attachments #7985

Merged
milescoviello merged 1 commit from upstream-pr/7985 into main 2026-11-01 04:06:23 +00:00
milescoviello commented 2026-10-19 16:55:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T16:55:09Z.


What

This PR's first two commits reached main through #8115 as identical patches: LinkPipelineFromLibraries copies a linked pipeline's attachment sample counts and chains them to the link's and relink's create info. What is left is the follow-up from @MarcZX10's review:

  • Pipeline.cpp gives a depth-only merged-coverage pipeline a VkAttachmentSampleCountInfo with colorAttachmentCount 0 and a null pColorAttachmentSamples, which Vulkan allows.
  • Copying the counts built a vector from the range [null, null). The range constructor passes that null source to memmove, which requires non-null pointers even for 0 bytes.
  • The color counts are now copied only when there are color attachments. The struct then carries an empty vector, and attachmentSamples already chains a null pColorAttachmentSamples for it.

Tested

Current head 5d1e214ce3 (the one commit, rebased onto main 52c09d567d without conflicts; git range-diff shows it unchanged), Ubuntu 26.04.1, GCC 15.2, RTX 4070 Ti, NVIDIA 615.71.09:

  • Focused tests: 85 of the 86 tests matching the regex below pass in each of 3 runs. agc_driver_pipeline_journal fails on main too, as described below.
  • Validation layer, over the same 86, on main 52c09d567d and at this head: 85 of 86 on both, with the same journal failure. Neither log has a missing-layer line, the layer checked 104 devices on each side, and neither has a VUID- message.

Previous head e6d81fbe9b (on main 3a2b919816), same machine:

  • Focused tests: of the 86 tests matching pipeline_library|^agc_driver_prepared|^agc_driver_graphics$|sample_coverage|msaa|multisample|pipeline_cache|journal, 85 pass in each of 3 runs. agc_driver_pipeline_journal fails the same way on main 3a2b919816. On this machine its 11th Vulkan device can't load the NVIDIA driver (libnvidia-tls.so.615.71.09: cannot allocate memory in static TLS block, with VK_LOADER_DEBUG=error) and falls back to llvmpipe. It passes with GLIBC_TUNABLES=glibc.rtld.optional_static_tls=8192, so it isn't this change.
  • Validation layer: VK_LAYER_PATH=<LunarG SDK 1.4.363>/layers VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest -V over the same 86, on main 3a2b919816 and on this head.
    • Both give 85 of 86, with the same journal failure.
    • Neither log contains was not found but was requested by env var VK_INSTANCE_LAYERS.
    • The layer checked 104 devices on each side, with no VUID- messages on either.

Previous head 6346c5f2fe (on main cf528e78c6): on Ubuntu 26.04.1, GCC 15.2, RTX 4070 Ti, 615.71.09, the 71 tests matching pipeline_library|^agc_driver_prepared|^agc_driver_graphics$|sample_coverage|msaa|multisample|pipeline_cache|journal pass 3 of 3. Khronos validation 1.4.363 over the same 71 (VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest -V) gives 71 of 71 on main and on this head. Neither log has a layer-missing line. Both sides report the same pre-existing 14 VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605, and nothing is new in the head.

Windows, on the current head e6d81fbe9b and on main 3a2b919816: Windows 11 VM, GeForce GT 1030 (NVIDIA R580), WinLibs GCC 15.2, Release, ANYPS5_REQUIRE_VULKAN=1. The 88 tests matching the same regex there pass 3 of 3 on both, agc_driver_pipeline_journal included. (On the earlier head ff61956e21 and its merge base eb8dcfebaa, the 68 tests the regex selected then passed 3 of 3 on both.)

@ycbuzi ran the previous head on AMD (comment): 6346c5f2fe merged onto main 1da5d1a757, Windows 11 Home, WinLibs GCC 15.2.0, Release, AMD Radeon RDNA2 iGPU (driver 32.0.21030.2001), with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1. The same regex selects 72 tests there, and they pass 72 of 72 on main and 72 of 72 with this PR. The validation layer was not run on that device.

Earlier results, on the three-commit heads named in them:

Ubuntu 24.04, GCC 13.3, NVIDIA RTX 4070 Ti (595.99.02).

  • Khronos validation, as CONTRIBUTING.md asks, with the LunarG SDK's 1.4.363 layer loaded through VK_LAYER_PATH: VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest -V -R sample_coverage. main 1126abbfac reports VUID-vkCmdDraw-multisampledRenderToSingleSampled-07285 ×2. With this change it reports nothing, and neither log reports the layer missing. That holds both for 6bf4a39f25, which chained the counts under VkPipelineLibraryCreateInfoKHR (outside its allowed pNext chain, as @ebosido444-ai pointed out), and for c46005c996, which chains them to the create info.

  • With APS5_NO_GPL=1, main already reports nothing, so only the library path was affected.

  • The 58 tests matching pipeline_library|^agc_driver_prepared|^agc_driver_graphics$|sample_coverage|msaa|multisample|pipeline_cache|journal pass with this change, as on main.

  • e9c9857eae, after @MarcZX10's review: the color sample counts are copied only when colorAttachmentCount is non-zero. A depth-only pipeline's VkAttachmentSampleCountInfoNV (zero colors, and a null array, as Pipeline.cpp builds it) then never reads pColorAttachmentSamples. On Ubuntu 26.04.1 (GCC 15.2, NVIDIA 615.71.09), the same 58-test set passes 2 of 2 on this head. Khronos validation 1.4.363 over sample_coverage: the merge base 1126abbfac reports VUID-vkCmdDraw-multisampledRenderToSingleSampled-07285 ×2. This head reports no VUID, and neither run reports the layer missing.

Overlaps (checked 10-28 against the current heads): neither still edits the lines this PR changes.

  • #9508's head 6275369b6c merges with this PR without a conflict.
  • #5925's head 3339ddd3af predates the sample-count copy this guard sits in (7c63ee6970, which reached main with #8115). It doesn't edit these three lines. It conflicts with main itself in PipelineLibrary.cpp and other files, so its rebase meets this code either way.

So there's no order to agree, and Depends on stays none.

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: none
  • GPUs tested: NVIDIA GeForce RTX 4070 Ti, driver 595.99.02, Ubuntu 24.04; AMD Radeon RDNA2 iGPU, driver 32.0.21030.2001, Windows 11 (tests, by @ycbuzi)
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4924399840 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7985). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-19T16:55:09Z. --- ### What This PR's first two commits reached `main` through #8115 as identical patches: `LinkPipelineFromLibraries` copies a linked pipeline's attachment sample counts and chains them to the link's and relink's create info. What is left is the follow-up from @MarcZX10's review: - `Pipeline.cpp` gives a depth-only merged-coverage pipeline a `VkAttachmentSampleCountInfo` with `colorAttachmentCount` 0 and a null `pColorAttachmentSamples`, which Vulkan allows. - Copying the counts built a vector from the range [null, null). The range constructor passes that null source to `memmove`, which requires non-null pointers even for 0 bytes. - The color counts are now copied only when there are color attachments. The struct then carries an empty vector, and `attachmentSamples` already chains a null `pColorAttachmentSamples` for it. ### Tested **Current head** `5d1e214ce3` (the one commit, rebased onto `main` `52c09d567d` without conflicts; `git range-diff` shows it unchanged), Ubuntu 26.04.1, GCC 15.2, RTX 4070 Ti, NVIDIA 615.71.09: - **Focused tests:** 85 of the 86 tests matching the regex below pass in each of 3 runs. `agc_driver_pipeline_journal` fails on `main` too, as described below. - **Validation layer**, over the same 86, on `main` `52c09d567d` and at this head: 85 of 86 on both, with the same journal failure. Neither log has a missing-layer line, the layer checked 104 devices on each side, and neither has a `VUID-` message. **Previous head** `e6d81fbe9b` (on `main` `3a2b919816`), same machine: - **Focused tests:** of the 86 tests matching `pipeline_library|^agc_driver_prepared|^agc_driver_graphics$|sample_coverage|msaa|multisample|pipeline_cache|journal`, 85 pass in each of 3 runs. `agc_driver_pipeline_journal` fails the same way on `main` `3a2b919816`. On this machine its 11th Vulkan device can't load the NVIDIA driver (`libnvidia-tls.so.615.71.09: cannot allocate memory in static TLS block`, with `VK_LOADER_DEBUG=error`) and falls back to llvmpipe. It passes with `GLIBC_TUNABLES=glibc.rtld.optional_static_tls=8192`, so it isn't this change. - **Validation layer:** `VK_LAYER_PATH=<LunarG SDK 1.4.363>/layers VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest -V` over the same 86, on `main` `3a2b919816` and on this head. - Both give 85 of 86, with the same journal failure. - Neither log contains `was not found but was requested by env var VK_INSTANCE_LAYERS`. - The layer checked 104 devices on each side, with no `VUID-` messages on either. **Previous head** `6346c5f2fe` (on `main` cf528e78c6): on Ubuntu 26.04.1, GCC 15.2, RTX 4070 Ti, 615.71.09, the 71 tests matching `pipeline_library|^agc_driver_prepared|^agc_driver_graphics$|sample_coverage|msaa|multisample|pipeline_cache|journal` pass 3 of 3. Khronos validation 1.4.363 over the same 71 (`VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest -V`) gives 71 of 71 on `main` and on this head. Neither log has a layer-missing line. Both sides report the same pre-existing 14 `VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605`, and nothing is new in the head. **Windows**, on the current head `e6d81fbe9b` and on `main` `3a2b919816`: Windows 11 VM, GeForce GT 1030 (NVIDIA R580), WinLibs GCC 15.2, Release, `ANYPS5_REQUIRE_VULKAN=1`. The 88 tests matching the same regex there pass 3 of 3 on both, `agc_driver_pipeline_journal` included. (On the earlier head `ff61956e21` and its merge base eb8dcfebaa, the 68 tests the regex selected then passed 3 of 3 on both.) @ycbuzi ran the previous head on AMD ([comment](https://github.com/boykopovar/AnyPS5/pull/7985#issuecomment-6395709194)): `6346c5f2fe` merged onto `main` 1da5d1a757, Windows 11 Home, WinLibs GCC 15.2.0, Release, AMD Radeon RDNA2 iGPU (driver 32.0.21030.2001), with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1`. The same regex selects 72 tests there, and they pass 72 of 72 on `main` and 72 of 72 with this PR. The validation layer was not run on that device. Earlier results, on the three-commit heads named in them: Ubuntu 24.04, GCC 13.3, NVIDIA RTX 4070 Ti (595.99.02). - Khronos validation, as CONTRIBUTING.md asks, with the LunarG SDK's 1.4.363 layer loaded through `VK_LAYER_PATH`: `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest -V -R sample_coverage`. `main` 1126abbfac reports `VUID-vkCmdDraw-multisampledRenderToSingleSampled-07285` ×2. With this change it reports nothing, and neither log reports the layer missing. That holds both for 6bf4a39f25, which chained the counts under `VkPipelineLibraryCreateInfoKHR` (outside its allowed `pNext` chain, as @ebosido444-ai pointed out), and for c46005c996, which chains them to the create info. - With `APS5_NO_GPL=1`, `main` already reports nothing, so only the library path was affected. - The 58 tests matching `pipeline_library|^agc_driver_prepared|^agc_driver_graphics$|sample_coverage|msaa|multisample|pipeline_cache|journal` pass with this change, as on `main`. - e9c9857eae, after @MarcZX10's review: the color sample counts are copied only when `colorAttachmentCount` is non-zero. A depth-only pipeline's `VkAttachmentSampleCountInfoNV` (zero colors, and a null array, as `Pipeline.cpp` builds it) then never reads `pColorAttachmentSamples`. On Ubuntu 26.04.1 (GCC 15.2, NVIDIA 615.71.09), the same 58-test set passes 2 of 2 on this head. Khronos validation 1.4.363 over `sample_coverage`: the merge base 1126abbfac reports `VUID-vkCmdDraw-multisampledRenderToSingleSampled-07285` ×2. This head reports no VUID, and neither run reports the layer missing. **Overlaps (checked 10-28 against the current heads):** neither still edits the lines this PR changes. - #9508's head `6275369b6c` merges with this PR without a conflict. - #5925's head `3339ddd3af` predates the sample-count copy this guard sits in (`7c63ee6970`, which reached `main` with #8115). It doesn't edit these three lines. It conflicts with `main` itself in `PipelineLibrary.cpp` and other files, so its rebase meets this code either way. So there's no order to agree, and `Depends on` stays none. ### 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: none - [x] GPUs tested: NVIDIA GeForce RTX 4070 Ti, driver 595.99.02, Ubuntu 24.04; AMD Radeon RDNA2 iGPU, driver 32.0.21030.2001, Windows 11 (tests, by @ycbuzi) - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ebosido444-ai commented 2026-10-19 22:10:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ebosido444-ai on 2026-10-19T22:10:42Z.


VkAttachmentSampleCountInfoNV may only extend VkGraphicsPipelineCreateInfo and VkCommandBufferInheritanceInfo, so chaining it off VkPipelineLibraryCreateInfoKHR::pNext (both at the link and in the deferred relink) is outside the allowed chain even though the validation layer stayed quiet — layers walk nested pNext chains transitively and do not reject a struct under a parent it is not allowed to extend.

Put the counts on the graphics create info instead: counts.pNext = create.pNext; create.pNext = &counts; (counts first, then the library list where it belongs), in both the link and the relink, and re-run the sample_coverage validation command. If 07285 stays gone with the struct on the create info, that is the conformant form of the same fix.

The copy-out and the by-value capture that keeps the array alive across the deferred relink are right — only the chain placement needs to move.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6278488377 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7985#issuecomment-6278488377). Originally posted by [ebosido444-ai](https://github.com/ebosido444-ai) on 2026-10-19T22:10:42Z. --- `VkAttachmentSampleCountInfoNV` may only extend `VkGraphicsPipelineCreateInfo` and `VkCommandBufferInheritanceInfo`, so chaining it off `VkPipelineLibraryCreateInfoKHR::pNext` (both at the link and in the deferred relink) is outside the allowed chain even though the validation layer stayed quiet — layers walk nested pNext chains transitively and do not reject a struct under a parent it is not allowed to extend. Put the counts on the graphics create info instead: `counts.pNext = create.pNext; create.pNext = &counts;` (counts first, then the library list where it belongs), in both the link and the relink, and re-run the `sample_coverage` validation command. If 07285 stays gone with the struct on the create info, that is the conformant form of the same fix. The copy-out and the by-value capture that keeps the array alive across the deferred relink are right — only the chain placement needs to move. AI-assisted: yes.
milescoviello commented 2026-10-19 22:15:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T22:15:06Z.


@ebosido444-ai thanks, you're right. VkAttachmentSampleCountInfoNV extends only VkGraphicsPipelineCreateInfo and VkCommandBufferInheritanceInfo, and the layer didn't flag it under VkPipelineLibraryCreateInfoKHR. c46005c996 chains the counts to the create info in both the link and the relink (counts.pNext = create.pNext; create.pNext = &counts), and the library list stays where it was. Reran VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest -V -R sample_coverage with the 1.4.363 layer: main 1126abbfac still reports 07285 ×2, and c46005c996 reports nothing, with the layer loaded on both. The description says this now.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6278557785 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7985#issuecomment-6278557785). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-19T22:15:06Z. --- @ebosido444-ai thanks, you're right. `VkAttachmentSampleCountInfoNV` extends only `VkGraphicsPipelineCreateInfo` and `VkCommandBufferInheritanceInfo`, and the layer didn't flag it under `VkPipelineLibraryCreateInfoKHR`. c46005c996 chains the counts to the create info in both the link and the relink (`counts.pNext = create.pNext; create.pNext = &counts`), and the library list stays where it was. Reran `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest -V -R sample_coverage` with the 1.4.363 layer: `main` 1126abbfac still reports 07285 ×2, and c46005c996 reports nothing, with the layer loaded on both. The description says this now. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-22 00:03:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T00:03:41Z.

Review: CHANGES_REQUESTED


Two issues block approval:

  1. Please handle a zero-color-attachment pipeline safely. Vulkan permits dynamic rendering with colorAttachmentCount == 0; a depth-only pipeline may still carry VkAttachmentSampleCountInfoNV, with no color-sample array. The current sampleCounts.emplace evaluates counts.pColorAttachmentSamples + counts.colorAttachmentCount and constructs a vector from that range. If the valid zero-count pointer is null, this forms a null-pointer range. Guard the copy on colorAttachmentCount != 0 and cover or otherwise verify the zero-color case. The struct is also valid in the VkGraphicsPipelineCreateInfo chain: https://docs.vulkan.org/refpages/latest/refpages/source/VkAttachmentSampleCountInfoAMD.html

  2. Please coordinate the Depends on order with the authors of open #9508 and #5925. The current overlap scan reports direct same-line edits with #9508 in PipelineLibrary.cpp (link creation and the deferred relink capture). Manual comparison also shows #5925 changes the same link-creation setup and relink lambda. #7642's edits in this file are confined to the split-layout handling and appear disjoint. The checklist currently says Depends on: none; after the authors agree which changes land first, update it to match the integration order. This follows the repository's overlap rule in CONTRIBUTING.md.

The current hosted eligibility, conventions, labels, and report checks pass. The focused validation results are author-reported; I did not run a local build or GPU test.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5607700440 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7985#pullrequestreview-5607700440). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T00:03:41Z. **Review:** CHANGES_REQUESTED --- Two issues block approval: 1. Please handle a zero-color-attachment pipeline safely. Vulkan permits dynamic rendering with `colorAttachmentCount == 0`; a depth-only pipeline may still carry `VkAttachmentSampleCountInfoNV`, with no color-sample array. The current `sampleCounts.emplace` evaluates `counts.pColorAttachmentSamples + counts.colorAttachmentCount` and constructs a vector from that range. If the valid zero-count pointer is null, this forms a null-pointer range. Guard the copy on `colorAttachmentCount != 0` and cover or otherwise verify the zero-color case. The struct is also valid in the `VkGraphicsPipelineCreateInfo` chain: https://docs.vulkan.org/refpages/latest/refpages/source/VkAttachmentSampleCountInfoAMD.html 2. Please coordinate the `Depends on` order with the authors of open #9508 and #5925. The current overlap scan reports direct same-line edits with #9508 in `PipelineLibrary.cpp` (link creation and the deferred relink capture). Manual comparison also shows #5925 changes the same link-creation setup and relink lambda. #7642's edits in this file are confined to the split-layout handling and appear disjoint. The checklist currently says `Depends on: none`; after the authors agree which changes land first, update it to match the integration order. This follows the repository's overlap rule in `CONTRIBUTING.md`. The current hosted eligibility, conventions, labels, and report checks pass. The focused validation results are author-reported; I did not run a local build or GPU test.
milescoviello commented 2026-10-22 00:06:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-22T00:06:01Z.


@Raghav314 @adriadam10, @MarcZX10 pointed out that this PR edits the same lines in PipelineLibrary.cpp as #9508 and #5925: the link-time create info in LinkPipelineFromLibraries and the deferred relink lambda. git merge-tree confirms both conflict with this head.

This change is small. It finds the VkAttachmentSampleCountInfoNV in the rendering info's chain, keeps a copy, and chains it in front of the link's and the relink's VkPipelineLibraryCreateInfoKHR. The relink lambda also captures the copy. So whichever lands second only has to re-add those few lines.

I'm happy to go either way:

  • If this lands first, your rebase keeps sampleCounts / attachmentSamples and the pNext chaining in both places.
  • If either of yours lands first, I'll rebase this onto it and list it under Depends on.

Is there an order you'd prefer?

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6329359642 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7985#issuecomment-6329359642). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-22T00:06:01Z. --- @Raghav314 @adriadam10, @MarcZX10 pointed out that this PR edits the same lines in `PipelineLibrary.cpp` as #9508 and #5925: the link-time create info in `LinkPipelineFromLibraries` and the deferred relink lambda. `git merge-tree` confirms both conflict with this head. This change is small. It finds the `VkAttachmentSampleCountInfoNV` in the rendering info's chain, keeps a copy, and chains it in front of the link's and the relink's `VkPipelineLibraryCreateInfoKHR`. The relink lambda also captures the copy. So whichever lands second only has to re-add those few lines. I'm happy to go either way: - If this lands first, your rebase keeps `sampleCounts` / `attachmentSamples` and the `pNext` chaining in both places. - If either of yours lands first, I'll rebase this onto it and list it under Depends on. Is there an order you'd prefer? AI-assisted: yes (Claude Code)
milescoviello commented 2026-10-22 00:17:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-22T00:17:57Z.


Thanks @MarcZX10.

  1. Done in e9c9857eae: the color sample array is copied only when colorAttachmentCount != 0. The struct then carries an empty vector, and attachmentSamples already chains a null pColorAttachmentSamples for it. Our only producer, Pipeline.cpp, passes count 0 with a null pointer for a depth-only merged-coverage pipeline, so that's the case this covers. The PR's 58-test set passes 2 of 2 on this head. A validation-layer comparison of the sample_coverage tests is queued, and I'll add it when it's done.

    I left the scan on the rendering info's chain on purpose. The driver only ever puts the struct there, and these create infos never come from a title.

  2. I've asked @Raghav314 and @adriadam10 about the order above, and the body now lists both overlaps. I'll set Depends on once there's an answer.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6329527709 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7985#issuecomment-6329527709). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-22T00:17:57Z. --- Thanks @MarcZX10. 1. Done in e9c9857eae: the color sample array is copied only when `colorAttachmentCount != 0`. The struct then carries an empty vector, and `attachmentSamples` already chains a null `pColorAttachmentSamples` for it. Our only producer, `Pipeline.cpp`, passes count 0 with a null pointer for a depth-only merged-coverage pipeline, so that's the case this covers. The PR's 58-test set passes 2 of 2 on this head. A validation-layer comparison of the `sample_coverage` tests is queued, and I'll add it when it's done. I left the scan on the rendering info's chain on purpose. The driver only ever puts the struct there, and these create infos never come from a title. 2. I've asked @Raghav314 and @adriadam10 about the order above, and the body now lists both overlaps. I'll set Depends on once there's an answer. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-28 22:24:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T22:24:30Z.

Review: CHANGES_REQUESTED


The zero-color guard addresses the null-range issue, and the current one-commit diff is limited to copying color sample counts only when colorAttachmentCount is nonzero. The author reports Linux NVIDIA validation tests and Windows AMD focused tests passing against corresponding main baselines; no new validation IDs were introduced. Hosted policy checks pass, while product jobs are skipped. I did not run a local GPU test.

The current thread still describes overlap with open #5925 and #9508 in PipelineLibrary.cpp; the checklist says Depends on: none, and I found no agreed landing order from their authors. Please confirm whether the exact current heads still overlap this guard. If they do, coordinate which change lands first and record the order in the relevant checklists; if they no longer overlap, update the description/overlap record. I cannot complete approval until the repository's overlap-order rule is resolved.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5690485505 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7985#pullrequestreview-5690485505). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T22:24:30Z. **Review:** CHANGES_REQUESTED --- The zero-color guard addresses the null-range issue, and the current one-commit diff is limited to copying color sample counts only when `colorAttachmentCount` is nonzero. The author reports Linux NVIDIA validation tests and Windows AMD focused tests passing against corresponding main baselines; no new validation IDs were introduced. Hosted policy checks pass, while product jobs are skipped. I did not run a local GPU test. The current thread still describes overlap with open #5925 and #9508 in `PipelineLibrary.cpp`; the checklist says `Depends on: none`, and I found no agreed landing order from their authors. Please confirm whether the exact current heads still overlap this guard. If they do, coordinate which change lands first and record the order in the relevant checklists; if they no longer overlap, update the description/overlap record. I cannot complete approval until the repository's overlap-order rule is resolved.
MarcZX10 commented 2026-10-29 00:50:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T00:50:46Z.

Review: CHANGES_REQUESTED


Re-checked — changes requested for current-main rerun

Your exact-head comparisons resolve the earlier overlap question: #9508 merges cleanly, and #5925's changes are separate from this guard. The remaining blocker is that this branch is still based on cf528e78c6, while current main is 3a2b91981651569163768854a1fcdc7193b6667b.

What I ran

  • Reviewed exact head 6346c5f2fefef8eed6745f5cf4399d868876d50f and inspected the overlap update.
  • Compared #7985 with current #9508 and #5925 heads, checked the merge preview onto current main, and inspected changes to PipelineLibrary.cpp since the branch base.
  • Ran git diff --check and the current conventions checker against this head.

Results

Check Result
Current-main merge preview
Raw outputmerge-tree-exit=0; tree e48d0cae9d46132348bbb808db1538f2a48553fa
Overlap update
Raw status#9508 merges cleanly; #5925's link-creation/relink changes are separate from the three-line sample-count guard, though #5925 itself needs a main rebase.
Whitespace check
Raw outputgit diff --check upstream/main...refs/review/pr-7985 — no output; exit status 0
Conventions
Raw outputAll conventions checks passed.
Author-reported GPU validation
Reported resultThe PR body reports the focused pipeline/sample-count tests on NVIDIA and AMD with validation on the prior base cf528e78c6; these were not independently rerun here.
Branch freshness
Raw valuesMerge base cf528e78c6c8fd30696ccfca6c097f9828be2cf6; current main is 4,703 commits ahead. Current main also changes the optimization key and pipeline flags in PipelineLibrary.cpp.

Negative control

The author reports that a depth-only pipeline with a null color-sample pointer previously triggered the invalid range construction, and that the guard fixes it. I did not independently run the depth-only Vulkan case on this head.

Findings

Blocking

  • CONTRIBUTING.md requires keeping the branch up to date with main. Because current main has since changed PipelineLibrary.cpp, the earlier focused comparison on cf528e78c6 does not cover the current integration. Please rebase and rerun the same focused tests on current main and the updated PR with the required validation-layer settings.

Non-blocking

  • The updated overlap note is adequate for the guard: #9508 is compatible, and #5925's stale-base conflicts are outside the guarded sample-count range. Keep the explanation in the PR description.

Sources

  • PR head: 6346c5f2fefef8eed6745f5cf4399d868876d50f.
  • Current main: 3a2b91981651569163768854a1fcdc7193b6667b.
  • CONTRIBUTING.md at current main.

Not verified

I did not build or run Vulkan tests locally. The focused GPU results and negative control are author-reported on the older base. Hosted policy checks pass; full product and specialized hosted jobs are skipped.

To get this to a good state

Rebase on current main, run the focused depth-only/pipeline tests on the same GPU on main and the PR with validation enabled, and report the exact revisions and VUID comparison.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5691559758 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7985#pullrequestreview-5691559758). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T00:50:46Z. **Review:** CHANGES_REQUESTED --- # Re-checked — changes requested for current-main rerun Your exact-head comparisons resolve the earlier overlap question: #9508 merges cleanly, and #5925's changes are separate from this guard. The remaining blocker is that this branch is still based on `cf528e78c6`, while current `main` is `3a2b91981651569163768854a1fcdc7193b6667b`. ## What I ran - Reviewed exact head `6346c5f2fefef8eed6745f5cf4399d868876d50f` and inspected the overlap update. - Compared #7985 with current #9508 and #5925 heads, checked the merge preview onto current `main`, and inspected changes to `PipelineLibrary.cpp` since the branch base. - Ran `git diff --check` and the current conventions checker against this head. ## Results | Check | Result | |---|---| | Current-main merge preview | <details><summary>Raw output</summary><code>merge-tree-exit=0</code>; tree `e48d0cae9d46132348bbb808db1538f2a48553fa`</details> | | Overlap update | <details><summary>Raw status</summary>#9508 merges cleanly; #5925's link-creation/relink changes are separate from the three-line sample-count guard, though #5925 itself needs a `main` rebase.</details> | | Whitespace check | <details><summary>Raw output</summary><code>git diff --check upstream/main...refs/review/pr-7985</code> — no output; exit status 0</details> | | Conventions | <details><summary>Raw output</summary><code>All conventions checks passed.</code></details> | | Author-reported GPU validation | <details><summary>Reported result</summary>The PR body reports the focused pipeline/sample-count tests on NVIDIA and AMD with validation on the prior base `cf528e78c6`; these were not independently rerun here.</details> | | Branch freshness | <details><summary>Raw values</summary>Merge base `cf528e78c6c8fd30696ccfca6c097f9828be2cf6`; current `main` is 4,703 commits ahead. Current `main` also changes the optimization key and pipeline flags in `PipelineLibrary.cpp`.</details> | ## Negative control The author reports that a depth-only pipeline with a null color-sample pointer previously triggered the invalid range construction, and that the guard fixes it. I did not independently run the depth-only Vulkan case on this head. ## Findings ### Blocking - `CONTRIBUTING.md` requires keeping the branch up to date with `main`. Because current `main` has since changed `PipelineLibrary.cpp`, the earlier focused comparison on `cf528e78c6` does not cover the current integration. Please rebase and rerun the same focused tests on current `main` and the updated PR with the required validation-layer settings. ### Non-blocking - The updated overlap note is adequate for the guard: #9508 is compatible, and #5925's stale-base conflicts are outside the guarded sample-count range. Keep the explanation in the PR description. ## Sources - PR head: `6346c5f2fefef8eed6745f5cf4399d868876d50f`. - Current `main`: `3a2b91981651569163768854a1fcdc7193b6667b`. - `CONTRIBUTING.md` at current `main`. ## Not verified I did not build or run Vulkan tests locally. The focused GPU results and negative control are author-reported on the older base. Hosted policy checks pass; full product and specialized hosted jobs are skipped. ## To get this to a good state Rebase on current `main`, run the focused depth-only/pipeline tests on the same GPU on `main` and the PR with validation enabled, and report the exact revisions and VUID comparison.
MarcZX10 commented 2026-10-29 05:49:22 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


Re-checked — changes requested

The focused GPU and validation-layer report is detailed, including the same 85/86 result on base and candidate. However, the tested base is main 3a2b919816, while current main is 52c09d567d2fa453494dd720fcf53a98149468e4; this head is 36 commits behind. The contribution checklist requires the branch to be based on current main.

What I ran

  • Reviewed exact head e6d81fbe9bf70441ed4fc17b5b2c4848c8e9298a against current main.
  • Ran git merge-tree --write-tree and git diff --check.
  • Checked the author’s exact-head GPU/validation report and current hosted checks.

Results

Check Result
Current-main merge preview Clean; current main is not in the branch history
git diff --check Passed
Focused GPU tests Author reports 85/86 on the old base and head in three runs, with the same known TLS failure
Validation layer Author reports matching results and no VUID- messages on that old base/head pair
Current-main run Not reported

Please refresh onto current main and rerun the focused test and validation comparison there. I did not run a local GPU build, so I cannot treat the earlier base/head comparison as current integration evidence.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5693411383 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7985#pullrequestreview-5693411383). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T05:49:22Z. **Review:** CHANGES_REQUESTED --- # Re-checked — changes requested The focused GPU and validation-layer report is detailed, including the same 85/86 result on base and candidate. However, the tested base is `main` `3a2b919816`, while current `main` is `52c09d567d2fa453494dd720fcf53a98149468e4`; this head is 36 commits behind. The contribution checklist requires the branch to be based on current `main`. ## What I ran - Reviewed exact head `e6d81fbe9bf70441ed4fc17b5b2c4848c8e9298a` against current `main`. - Ran `git merge-tree --write-tree` and `git diff --check`. - Checked the author’s exact-head GPU/validation report and current hosted checks. ## Results | Check | Result | |---|---| | Current-main merge preview | Clean; current `main` is not in the branch history | | `git diff --check` | Passed | | Focused GPU tests | Author reports 85/86 on the old base and head in three runs, with the same known TLS failure | | Validation layer | Author reports matching results and no `VUID-` messages on that old base/head pair | | Current-main run | Not reported | Please refresh onto current `main` and rerun the focused test and validation comparison there. I did not run a local GPU build, so I cannot treat the earlier base/head comparison as current integration evidence.
MarcZX10 commented 2026-10-29 06:38:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T06:38:21Z.

Review: APPROVED


Re-reviewed — approved

I reviewed exact head 5d1e214ce3de525b07e5328cb87993fc91d46439 against current main 2960e9a6e7e1fc99c4ed180c71495b5eb83464c7.

What I ran

  • Inspected the sole production change in PipelineLibrary.cpp: it avoids forming a vector range from pColorAttachmentSamples when colorAttachmentCount is zero, and retains the existing values when the count is nonzero.
  • Ran git merge-tree --write-tree refs/remotes/upstream/main refs/review/upstream-7985; it returned clean tree 8e92f48dd104208d3fc7de172916833f5a6a510b.
  • Ran git diff --check refs/remotes/upstream/main...refs/review/upstream-7985; exit 0, no output.
  • Confirmed current main has no later change to PipelineLibrary.cpp since the author's tested base 52c09d567d.
  • I did not run a local build or GPU tests.

Results

Check Result
Current-main merge preview Clean
Diff check Pass
Focused GPU/validation comparison Author reports the same 85/86 result on base and head over three runs; agc_driver_pipeline_journal fails identically on both due to the NVIDIA static-TLS limit
Validation layer Author reports it checked 104 devices on each side with no missing-layer or VUID- messages
Hosted checks Windows, conventions, eligibility, labels and report pass; Linux and specialized jobs are skipped

Negative control

No dedicated control for the zero-color-attachment input is reported. The author-reported base/head run is a regression sweep, not a targeted assertion for that input. I did not run a local control.

Findings

Blocking

None. The guard is limited to the zero-count case and avoids constructing the color-sample range from a null pointer; nonzero counts preserve the previous behavior.

Non-blocking

A focused zero-color-attachment regression would strengthen coverage. The current PR changes only the implementation file, so the exact null-pointer case is not directly asserted by a new test.

Sources

Not verified

I did not independently run the GPU tests, validation layer, or a title. The test results above are author-reported. The unrelated agc_driver_pipeline_journal environment failure remains visible on both baseline and candidate.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5693790607 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7985#pullrequestreview-5693790607). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T06:38:21Z. **Review:** APPROVED --- # Re-reviewed — approved I reviewed exact head `5d1e214ce3de525b07e5328cb87993fc91d46439` against current `main` `2960e9a6e7e1fc99c4ed180c71495b5eb83464c7`. ## What I ran - Inspected the sole production change in `PipelineLibrary.cpp`: it avoids forming a vector range from `pColorAttachmentSamples` when `colorAttachmentCount` is zero, and retains the existing values when the count is nonzero. - Ran `git merge-tree --write-tree refs/remotes/upstream/main refs/review/upstream-7985`; it returned clean tree `8e92f48dd104208d3fc7de172916833f5a6a510b`. - Ran `git diff --check refs/remotes/upstream/main...refs/review/upstream-7985`; exit 0, no output. - Confirmed current `main` has no later change to `PipelineLibrary.cpp` since the author's tested base `52c09d567d`. - I did not run a local build or GPU tests. ## Results | Check | Result | |---|---| | Current-main merge preview | Clean | | Diff check | Pass | | Focused GPU/validation comparison | Author reports the same 85/86 result on base and head over three runs; `agc_driver_pipeline_journal` fails identically on both due to the NVIDIA static-TLS limit | | Validation layer | Author reports it checked 104 devices on each side with no missing-layer or `VUID-` messages | | Hosted checks | Windows, conventions, eligibility, labels and report pass; Linux and specialized jobs are skipped | ## Negative control No dedicated control for the zero-color-attachment input is reported. The author-reported base/head run is a regression sweep, not a targeted assertion for that input. I did not run a local control. ## Findings ### Blocking None. The guard is limited to the zero-count case and avoids constructing the color-sample range from a null pointer; nonzero counts preserve the previous behavior. ### Non-blocking A focused zero-color-attachment regression would strengthen coverage. The current PR changes only the implementation file, so the exact null-pointer case is not directly asserted by a new test. ## Sources - [Implementation at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/5d1e214ce3de525b07e5328cb87993fc91d46439/core/libs/prx/libSceAgcDriver/Graphics/src/PipelineLibrary.cpp) - [Author's exact-head GPU and validation report](https://github.com/boykopovar/AnyPS5/pull/7985#issuecomment-6488035042) - [Current contribution rules](https://github.com/boykopovar/AnyPS5/blob/2960e9a6e7e1fc99c4ed180c71495b5eb83464c7/CONTRIBUTING.md) ## Not verified I did not independently run the GPU tests, validation layer, or a title. The test results above are author-reported. The unrelated `agc_driver_pipeline_journal` environment failure remains visible on both baseline and candidate.
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!7985
No description provided.