feat(agc): snapshot resident multisample color bytes #6987

Merged
Amoenus merged 9 commits from upstream-pr/6987 into main 2026-11-15 10:48:23 +00:00
Amoenus commented 2026-10-17 01:51:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-17T01:51:30Z.


What

11 November later source: 694877799d7a645a2492fca43af2473894e566c6 on tested main 2ecc68bda2642fbd5b4c9fb799bc1da4aa3df191. Focused topic diff. 10 GPU testcase passes, 0 failures, 0 skips on physical RTX5080/AMD iGPU. Original four #15964 recurrence cases pass on both; native-depth fixture remains identical to main. Production AGC/libc/kernel/relinker, real selected fixtures, Graphics/cache CPU, conventions and whitespace pass. Source pins, commands, device/layer proof and full logs. No fresh all-library/full-suite or title/FPS claim; unaffected earlier initializer/control/analyzer evidence retains its original pins.

AI-assisted: yes, Codex.

Use the saved guest footprint supplied by the merged first-draw initializer (#15985/#15986/#16086); this path adds no constructor-time guest read. Retain and account for that baseline during the resident target's lifetime, read completed native samples through an unsigned array view, then retile them over the original footprint or a recognized full fill. Preserve padding, guest bytes and native access guards; this prepares bytes without publishing or retiring ownership.

The current GENERAL layout contract is retained. View-only creation with no baseline refuses guest-footprint snapshots; unsupported snapshot metadata/tiling, EQAA/array/volume/mip readback, invalid capabilities/subresources, another active recorder and completion reentry throw. Callers must keep mappings alive during comparisons; concurrent unsynchronized changes and console equivalence remain unverified in library debt.

Next consumer: #6989's publisher consumes ColorSnapshot's original/current pair; #6995 and #7002 wire automatic readers afterward. The refreshed publisher supplies short mapping leases around comparisons and preserves precommit checks. CPU/buffer consumers are refreshed separately; #7002 retains its declared foreign-depth integration gate.

Focused snapshot topic against tested main. The initializer prerequisite is merged; this PR now depends on main. The history before the initializer split is archived. #9508 remains heap integration coordination; no duplicate snapshot or combined heap result is claimed. Host behavior follows image-copy rules, compatible views and completion before host invalidation, using the existing readback kernel/layout.

Tested

Earlier 7/8 November qualification retains its own source pins below; the current 11 November qualification is above.

Final head 3ef1d53197127bc18238c98b95dfe19391656d9f includes tested main 090f57166adb9692d27d16662a89ccc33a502406. 14 final-head physical-GPU processes pass on NVIDIA RTX5080 and AMD Radeon Graphics iGPU. The earlier head bc49e63a184b402e749d195a7305cd4c79da582e passed18 processes on main 4977f640527d606eacae4d948c3be22262a40e77; those are separate source pins. The source-specific selections, commands and logs are in the recurrence/sweep report. Matched main runs46 processes at the first pin and18 at the final pin across the whole sweep; new capability registrations absent on main are counted separately.

All4 #15964 regression groups pass on both GPUs at this final head. Their refusal helper, expected alias message and aliased-depth/publication assertion bodies are unchanged from the final main. The initializer merge removed no lines from that fixture and added owner-survival checks. This does not restore the reverted ordinary-constructor guest capture or use changed expected errors to hide its failure. Current main and all6 pending PR heads pass these same cases; the historical original-restoration control retains its earlier8 expected failures and source pin.

Configured native libraries/relinker and selected real execution fixtures build. Graphics/cache CPU checks, conventions and whitespace pass. Windows11 Enterprise26200,GCC15.2/UCRT Release; RTX5080/621.01(32.0.16.2101),AMD1002:13c0/26.10.1(32.0.21045.16010). Required Vulkan, app shader cache/journal off, loaded Khronos1.4.363 instance/device layers and physical devices verified per GPU process. No qualified skips/timeouts,VUID/SYNC hazards or validation warning/error. Successful observed tests are below30s; inherited explicit180s readback/snapshot/publication properties retain the maintainer's setting.

Earlier controls and independent Linux/RADV reports retain their actual heads. The upstream initializer-merge Linux log shows all4 old cases and7 initializer groups pass before cancellation; its full job remains cancelled, and Windows CI skipped those GPU cases. Fresh local hardware evidence is separate from full hosted CI, updated independent RADV timing, console equivalence or a title/FPS claim. No new full-stack claim.

This focused topic has the same stable patch ID as the preceding submitted contribution; main and its already merged initializer prerequisites were refreshed. The earlier consumer/control evidence and publisher controls keep their original pins. #7002’s foreign-depth port/joint qualification and heap coordination remain separate.

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 5080, driver621.01 /32.0.16.2101; AMD Radeon Graphics iGPU, Vulkan26.10.1 /Windows32.0.21045.16010; Windows11 Enterprise26200; loaded Khronos1.4.363.
  • AI-assisted: yes (Codex); author responsible
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4896325731 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6987). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-17T01:51:30Z. --- ### What <!-- codex-current-sweep-20261111-later --> **11 November later source:** `694877799d7a645a2492fca43af2473894e566c6` on tested main `2ecc68bda2642fbd5b4c9fb799bc1da4aa3df191`. [Focused topic diff](https://github.com/Amoenus/AnyPS5/compare/2ecc68bda2642fbd5b4c9fb799bc1da4aa3df191...694877799d7a645a2492fca43af2473894e566c6). **10 GPU testcase passes, 0 failures, 0 skips** on physical RTX5080/AMD iGPU. Original four #15964 recurrence cases pass on both; native-depth fixture remains identical to main. Production AGC/libc/kernel/relinker, real selected fixtures, Graphics/cache CPU, conventions and whitespace pass. [Source pins, commands, device/layer proof and full logs](https://gist.github.com/Amoenus/89a3275734beae2da7247ce33dbff8c5#file-report-md). No fresh all-library/full-suite or title/FPS claim; unaffected earlier initializer/control/analyzer evidence retains its original pins. AI-assisted: yes, Codex. <!-- /codex-current-sweep-20261111-later --> Use the saved guest footprint supplied by the merged first-draw initializer (#15985/#15986/#16086); this path adds no constructor-time guest read. Retain and account for that baseline during the resident target's lifetime, read completed native samples through an unsigned array view, then retile them over the original footprint or a recognized full fill. Preserve padding, guest bytes and native access guards; this prepares bytes without publishing or retiring ownership. The current GENERAL layout contract is retained. View-only creation with no baseline refuses guest-footprint snapshots; unsupported snapshot metadata/tiling, EQAA/array/volume/mip readback, invalid capabilities/subresources, another active recorder and completion reentry throw. Callers must keep mappings alive during comparisons; concurrent unsynchronized changes and console equivalence remain unverified in library debt. Next consumer: #6989's publisher consumes ColorSnapshot's original/current pair; #6995 and #7002 wire automatic readers afterward. The refreshed publisher supplies short mapping leases around comparisons and preserves precommit checks. CPU/buffer consumers are refreshed separately; #7002 retains its declared foreign-depth integration gate. [Focused snapshot topic against tested main](https://github.com/Amoenus/AnyPS5/compare/2ecc68bda2642fbd5b4c9fb799bc1da4aa3df191...694877799d7a645a2492fca43af2473894e566c6). The initializer prerequisite is merged; this PR now depends on main. The [history before the initializer split is archived](https://github.com/Amoenus/AnyPS5/tree/codex/archive-pr6987-before-initial-split-20261105). #9508 remains heap integration coordination; no duplicate snapshot or combined heap result is claimed. Host behavior follows [image-copy rules](https://docs.vulkan.org/refpages/latest/refpages/source/vkCmdCopyImage.html), [compatible views](https://docs.vulkan.org/refpages/latest/refpages/source/VkImageViewCreateInfo.html) and [completion before host invalidation](https://docs.vulkan.org/refpages/latest/refpages/source/vkInvalidateMappedMemoryRanges.html), using the existing readback kernel/layout. ### Tested **Earlier 7/8 November qualification retains its own source pins below; the current 11 November qualification is above.** <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Final head `3ef1d53197127bc18238c98b95dfe19391656d9f` includes tested main `090f57166adb9692d27d16662a89ccc33a502406`. **14 final-head physical-GPU processes pass** on NVIDIA RTX5080 and AMD Radeon Graphics iGPU. The earlier head `bc49e63a184b402e749d195a7305cd4c79da582e` passed18 processes on main `4977f640527d606eacae4d948c3be22262a40e77`; those are separate source pins. The source-specific selections, commands and logs are in the [recurrence/sweep report](https://gist.github.com/Amoenus/0f6c3566c06e8b806efcea2186a6dac6#file-report-md). Matched main runs46 processes at the first pin and18 at the final pin across the whole sweep; new capability registrations absent on main are counted separately. All4 #15964 regression groups pass on both GPUs at this final head. Their refusal helper, expected alias message and aliased-depth/publication assertion bodies are unchanged from the final main. The initializer merge removed no lines from that fixture and added owner-survival checks. This does not restore the reverted ordinary-constructor guest capture or use changed expected errors to hide its failure. Current main and all6 pending PR heads pass these same cases; the historical original-restoration control retains its [earlier8 expected failures and source pin](https://gist.github.com/Amoenus/7d44274711ab0a121a58dd635c135c83#file-report-md). Configured native libraries/relinker and selected real execution fixtures build. Graphics/cache CPU checks, conventions and whitespace pass. Windows11 Enterprise26200,GCC15.2/UCRT Release; RTX5080/621.01(32.0.16.2101),AMD1002:13c0/26.10.1(32.0.21045.16010). Required Vulkan, app shader cache/journal off, loaded Khronos1.4.363 instance/device layers and physical devices verified per GPU process. No qualified skips/timeouts,VUID/SYNC hazards or validation warning/error. Successful observed tests are below30s; inherited explicit180s readback/snapshot/publication properties retain the maintainer's setting. Earlier controls and independent Linux/RADV reports retain their actual heads. The upstream initializer-merge Linux log shows all4 old cases and7 initializer groups pass before cancellation; its full job remains cancelled, and Windows CI skipped those GPU cases. Fresh local hardware evidence is separate from full hosted CI, updated independent RADV timing, console equivalence or a title/FPS claim. No new full-stack claim. This focused topic has the same stable patch ID as the preceding submitted contribution; main and its already merged initializer prerequisites were refreshed. The earlier [consumer/control evidence](https://gist.github.com/Amoenus/c1a2540a5d761406361cb85d338c2593#file-report-md) and [publisher controls](https://gist.github.com/Amoenus/a21b8d408b1de9d928ee6de016834a75#file-report-md) keep their original pins. #7002’s foreign-depth port/joint qualification and heap coordination remain separate. ### 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: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> NVIDIA GeForce RTX 5080, driver621.01 /32.0.16.2101; AMD Radeon Graphics iGPU, Vulkan26.10.1 /Windows32.0.21045.16010; Windows11 Enterprise26200; loaded Khronos1.4.363. - [x] AI-assisted: <!-- yes / no --> yes (Codex); author responsible
akkadbakkad89 commented 2026-10-17 08:12:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-17T08:12:50Z.


Runtime datapoint on NVIDIA hardware. RTX 3070, Ampere, driver 617.42, Windows 11 26200, WinLibs GCC 15.2.0, Release, ANYPS5_NO_SHADER_CACHE=1. Head d577c265e, all binaries rebuilt on this head, ctest serial:

Test Result
agc_driver_native_color_snapshot pass
agc_driver_native_color_readback pass
agc_driver_native_color_initial pass
agc_driver_msaa_layout pass
agc_driver_multisample_readback_* (uint8/16/64/128, depth, upload) pass x6
agc_driver_sample_multisample_target pass
agc_driver_sample_mask_multisample pass

13/13 pass on Ampere — snapshot machinery holds on a second NVIDIA family.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6231598996 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6987#issuecomment-6231598996). Originally posted by [akkadbakkad89](https://github.com/akkadbakkad89) on 2026-10-17T08:12:50Z. --- Runtime datapoint on NVIDIA hardware. RTX 3070, Ampere, driver 617.42, Windows 11 26200, WinLibs GCC 15.2.0, Release, ANYPS5_NO_SHADER_CACHE=1. Head d577c265e, all binaries rebuilt on this head, ctest serial: | Test | Result | |---|---| | agc_driver_native_color_snapshot | pass | | agc_driver_native_color_readback | pass | | agc_driver_native_color_initial | pass | | agc_driver_msaa_layout | pass | | agc_driver_multisample_readback_* (uint8/16/64/128, depth, upload) | pass x6 | | agc_driver_sample_multisample_target | pass | | agc_driver_sample_mask_multisample | pass | 13/13 pass on Ampere — snapshot machinery holds on a second NVIDIA family.
oneandonlydean commented 2026-10-21 10:14:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T10:14:39Z.


@Amoenus this PR is stacked on #6973 and inherits its conflicts with main in Texture.hpp and MultisampleTarget.cpp; see the note on #6973. Please rebase it after #6973 is reworked on current main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6313514623 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6987#issuecomment-6313514623). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-21T10:14:39Z. --- @Amoenus this PR is stacked on #6973 and inherits its conflicts with `main` in `Texture.hpp` and `MultisampleTarget.cpp`; see the note on #6973. Please rebase it after #6973 is reworked on current `main`.
CnRJay commented 2026-11-01 19:59:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:59:34Z.

Review: COMMENTED


Correction (2026-11-01): the title-ID/log demand below is not a CONTRIBUTING requirement; Unblocks: none is allowed. The technical points below are unaffected.

1. No title reaches this on main. The body says "No ... title-unblock, startup/FPS or performance claim" and "Unblocks: none"; the Sonic tracking link points at a PPSA99902 bring-up ledger, not at a log line showing a title that reaches native multisample colour snapshots on main. This PR adds code that "prepares bytes" and publishes nothing, so by its own description it has no guest-visible effect yet. Without a title ID plus a log line it will be hard to justify merging a 1100-line foundation ahead of its consumers.

2. Review surface. The head carries every commit of #6973 beneath it (the list is about 80 commits, most titled "chore: refresh ... on current main" or a merge of an earlier head) while targeting main. The effective change is "retile uncompressed single-layer R_X samples into the saved guest footprint" plus the readback helper, but the diff on main shows the lot. Please retarget onto #6973's branch, or rebase once it lands, so the diff shows the readback and retile code alone.

3. Exact-or-throw coverage. The description lists explicit refusals (capability, subresource, metadata, another active recorder, readback in a completion callback). Which of these have a test that fails if the refusal is removed? Only "chunks and bounds" and the half-float exceptional bits are described as checked against an independent MIMG sample read; the padding/"recognized full-fill pattern" preservation in the retile has no stated negative control.

4. Validation. The 12 GPU passes are described as "shared initial-lifetime/contents/reuse/DCC checks plus this child's focused behavior"; no mention of VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation against a main log. The new readback copies native samples through an unsigned sampled array view and returns the source to GENERAL layout, which is where layout/aspect VUIDs would show up.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729955711 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6987#pullrequestreview-5729955711). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-11-01T19:59:34Z. **Review:** COMMENTED --- **Correction (2026-11-01):** the title-ID/log demand below is not a CONTRIBUTING requirement; `Unblocks: none` is allowed. The technical points below are unaffected. **1. No title reaches this on `main`.** The body says "No ... title-unblock, startup/FPS or performance claim" and "Unblocks: none"; the Sonic tracking link points at a PPSA99902 bring-up ledger, not at a log line showing a title that reaches native multisample colour snapshots on `main`. This PR adds code that "prepares bytes" and publishes nothing, so by its own description it has no guest-visible effect yet. Without a title ID plus a log line it will be hard to justify merging a 1100-line foundation ahead of its consumers. **2. Review surface.** The head carries every commit of #6973 beneath it (the list is about 80 commits, most titled "chore: refresh ... on current main" or a merge of an earlier head) while targeting `main`. The effective change is "retile uncompressed single-layer R_X samples into the saved guest footprint" plus the readback helper, but the diff on `main` shows the lot. Please retarget onto #6973's branch, or rebase once it lands, so the diff shows the readback and retile code alone. **3. Exact-or-throw coverage.** The description lists explicit refusals (capability, subresource, metadata, another active recorder, readback in a completion callback). Which of these have a test that fails if the refusal is removed? Only "chunks and bounds" and the half-float exceptional bits are described as checked against an independent MIMG sample read; the padding/"recognized full-fill pattern" preservation in the retile has no stated negative control. **4. Validation.** The 12 GPU passes are described as "shared initial-lifetime/contents/reuse/DCC checks plus this child's focused behavior"; no mention of `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` against a `main` log. The new readback copies native samples through an unsigned sampled array view and returns the source to GENERAL layout, which is where layout/aspect VUIDs would show up.
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!6987
No description provided.