Repository navigation
feat(agc): preserve initial native multisample color contents - #6973
oneandonlydean merged 60 commits into
Conversation
|
Integration note: my draft #6971 addresses #6957 by tracking the native multisample image layout across storage writes, sampled reads, and later attachment/storage use. It overlaps this branch in |
|
@oneandonlydean Initialization/publication review-gate proposals, 28 October 2026: I isolated the initialization claim and the publisher reuse check from the preserved integration. The latter uses #8223's existing claimed/write-generation evidence before snapshot and before commit, retires only that owner and leaves newer guest bytes intact. Live owners retain the checked publication path. The production changes are one call and 17 added lines; the obsolete initialization-refusal debt sentence is removed. Exact three-stage evidence and full logs, on tested main
Both physical GPUs reproduce initialization refusal, claimed-owner byte corruption and CPU-written snapshot refusal without the relevant fix. With both fixes, each new case and the live-publication control passes 3/3 per GPU. The ordinary sample group also passes 3/3 per GPU, with #8223's overwrite/claim/live-again/FMASK controls; initial/readback/snapshot/publication/CPU/buffer/draw-recipe/FMASK checks pass. Actual RTX5080/NVIDIA621.01 and Radeon gfx1036/AMD26.10.1, Windows11Enterprise26200, loaded Khronos1.4.363 verified. Zero validation diagnostics/skips/timeouts; max3.639s. Full native/relinker/real fixture builds, conventions and reviewed advisory analysis are recorded. These are separate fork proposals, not yet applied to the five submitted heads. They depend on #8223. After it lands, put initialization and its fixture in #6973, publication and its three fixtures in #6989, refresh children in order, then gate those actual heads. This does not make the current standalone submissions merge-ready. The test-only composition checkpoint is not a two-topic submission. No new title/performance claim; the last ordinary Sonic run remains separate. Historical results and checkpoints remain preserved. AI-assisted: yes (Codex); author responsible. |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
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 82bfd52, all binaries rebuilt on this head, ctest serial:
All pass on Ampere — the guest-initial-content path into native MSAA color holds. |
|
Intel and AMD Windows data for head Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release,
AI-assisted: yes (Claude Code) |
|
Rebase handoff for the stack base — since #6973 is the base your four follow-ups (#6987, #6989, #6995, #7002) are commit-stacked on, rebasing it onto The rebase (22 commits, one resolved empty and dropped — its content was already carried by an earlier resolution) is on Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, To pick it up: |
82bfd52 to
b64742f
Compare
|
@blawesom thanks for the rebase handoff; I adopted it, reviewed the range diff and incorporated main through @savvaniss I reproduced the pass-order failure, and the depth-storage failure @blawesom reported, on NVIDIA, AMD and llvmpipe. Both fixtures still described their MSAA color target as linear, so they stopped at initial import before reaching their intended assertions. The fixture-only correction gives them RenderTarget geometry and a complete 64 KiB color allocation; production refusals and existing test assertions are unchanged. Both corrected tests and initial-samples pass 3/3 on all three devices (27/27 fresh processes). Windows and Linux relinker/libs builds and conventions pass. Exact pins, devices, the failing pre-correction control and analysis limitations are in the updated description. The Intel upload mismatch is still open evidence: upload passes 3/3 on each of our three devices, which does not validate the Intel case. AI-assisted implementation and validation. |
|
Retest of head Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release,
The upload failure is #6957 on the fixture's verification read. At this head, Experiment diff (local, against b64742f)--- a/core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleReadback.cpp
+++ b/core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleReadback.cpp
@@ -92,7 +92,7 @@
- const VkDescriptorImageInfo image{VK_NULL_HANDLE, arrayView, VK_IMAGE_LAYOUT_GENERAL};
+ const VkDescriptorImageInfo image{VK_NULL_HANDLE, arrayView, format == VK_FORMAT_D32_SFLOAT ? VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL : VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL};
--- a/core/libs/prx/libSceAgcDriver/tests/execution/MultisampleReadback.cpp
+++ b/core/libs/prx/libSceAgcDriver/tests/execution/MultisampleReadback.cpp
@@ -293,10 +293,26 @@ std::vector<std::byte> CheckReadback(...)
RecordMemoryBarrier(...);
+ const bool experimentDepth = surface.format == VK_FORMAT_D32_SFLOAT;
+ const auto experimentLayout = [&](VkImageLayout from, VkImageLayout to) {
+ VkImageMemoryBarrier barrier{VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER};
+ barrier.srcAccessMask = VK_ACCESS_MEMORY_WRITE_BIT;
+ barrier.dstAccessMask = VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT;
+ barrier.oldLayout = from;
+ barrier.newLayout = to;
+ barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
+ barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
+ barrier.image = surface.image;
+ barrier.subresourceRange = {static_cast<VkImageAspectFlags>(experimentDepth ? VK_IMAGE_ASPECT_DEPTH_BIT : VK_IMAGE_ASPECT_COLOR_BIT), 0u, 1u, 0u, VK_REMAINING_ARRAY_LAYERS};
+ surface.context.Function<PFN_vkCmdPipelineBarrier>("vkCmdPipelineBarrier")(batch.Handle(), VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0u, 0u, nullptr, 0u, nullptr, 1u, &barrier);
+ };
+ const auto readLayout = experimentDepth ? VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL : VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
+ experimentLayout(VK_IMAGE_LAYOUT_GENERAL, readLayout);
for (std::uint32_t repeat = 0u; repeat < repetitions; ++repeat) {
reader.DispatchMultisampleReadback(...);
...
}
+ experimentLayout(readLayout, VK_IMAGE_LAYOUT_GENERAL);
RecordMemoryBarrier(..., VK_PIPELINE_STAGE_HOST_BIT, ...);AI-assisted: yes (Claude Code) |
✅ NVIDIA GPU test: passedPR head
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validated but not compared (3, not in the main baseline's validation pass)Validation IDs already present on main (4 IDs in 517 tests)Skipped (45)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
✅ NVIDIA GPU test: passedPR head
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validated but not compared (3, not in the main baseline's validation pass)Validation IDs already present on main (4 IDs in 517 tests)Skipped (48)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
Hi Amoenus, In the current #6973 head, SampleMultisampleTarget.cpp:1686 adds a test that requires a valid D_X guest sample layout to throw because non-uniform tiling is not implemented. The review rule says tests must not pin unfinished valid calls to throw. Could you remove this refusal assertion while keeping the implemented-path coverage? |
✅ NVIDIA GPU test: passedPR head
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validated but not compared (2, not in the main baseline's validation pass)Validation IDs already present on main (13 IDs in 548 tests)Skipped (49)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
Hi MarcZX10,
Thanks for the re-check. Both blocking points are done at ef2bcde6b3: the agc_driver_msaa_dcc_recreate_layout registration no longer sets the blanket FAIL_REGULAR_EXPRESSION "Validation Error:", and the exact-head NVIDIA GPU run passed on this head (2026-11-04 22:02 UTC, merged onto current main), which covers the new multisample initialization path. The earlier D_X throw pin is also gone. We are dismissing this change request as done; please re-request if you see anything left.
✅ AMD GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (9, not counted against this PR)Validated but not compared (2, not in the main baseline's validation pass)Validation IDs already present on main (4 IDs in 557 tests)Skipped (60)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
Main fails linux since 24ed2d9: agc_driver_native_depth_aliased_depth_{depth_only,stencil,no_stencil} and native_depth_publication now refuse sampling an aliased multisample target earlier, with a message the HTILE-alias path in NativeMultisampleDepth.cpp does not expect. The parent c42e3a0 is green. Reverting so main is green again; #6973 can re-land together with the test update.
revert(agc): back out #6973 MSAA initial samples
What
Review snapshot — 4 November:
ef2bcde6b320fbd0ae33f898c3873d6f2fc6bf2eincludes tested mainc37bd59e6f08a1a0eb3ad4573f1c9273da42e8e2. This pass enlarges the address-reuse fixture allocation to cover its entire 64KiB multisample surface placed at +32KiB; production topic code is unchanged.Remaining gates: Reviewer reassessment of the earlier change request and current-head hosted CI.
Current qualification, controls and limitations. Clean merge preview against later main
9ab6a281ea61c9e62a7eb07eb4cef8f19ede1c5c; its AGC driver/shader trees and relevant memory primitives are unchanged.Preserve guest-written color samples when a native multisample target is first created. Main clears a target without DCC to zero, so a partial first draw loses untouched samples.
Credited carried layout work: #6971, original head f65cecd, original authorship preserved. Its remaining sampled-layout transition is carried here under the maintainer's landing plan; that PR was closed unmerged as a duplicate and is not a standalone prerequisite. #6215's owner/retirement and merged #7948/#8847 behavior remain.
The lifetime follows the existing DepthSurface recorder-upload pattern and changes no console format semantics. Image/view usage follows Vulkan view usage and image-format query contracts.
Related: #6480 and PPSA99902 bring-up #4443. This capability is carried in the Sonic composition, but its necessity for an isolated Sonic stop/wrong result remains unproved. General metadata import/publication is outside this root change.
Removed the regression pinning a valid nonuniform D_X initial target to refusal. The corrected drawn-owner replacement regression is in #6995, where automatic publication is implemented.
Tested
Full configured native libraries, relinker and actual selected fixtures build at the head above; conventions against origin/main and whitespace checks pass. This head: 10 physical-GPU fixture passes, no skip, timeout or selected validation error/warning/VUID. Main comparison: 8 common physical-GPU passes. Capability tests absent on main are recorded separately.
Windows11 Enterprise26200; NVIDIA GeForce RTX5080 /621.01 (32.0.16.2101), AMD Radeon Graphics 1002:13c0 /26.10.1 (32.0.21045.16010). Required Vulkan, shader cache off, pipeline journal off, loaded Khronos1.4.363, verbose serial CTest, 30-second limit. Exact pins, commands and raw logs.
Historical evidence retains its original sources: earlier descriptions and independent runs. No new title/FPS, full-suite, console-equivalence or combined foreign-stack claim.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)