feat(agc): publish native color for read-only shader buffers #7002
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7002"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-17T03:41:09Z.
What
Publish supported native MSAA color before read-only shader-buffer uploads and prepared/cached/moved consumers. Writable aliases preflight first; moved ranges remain available through recording. Preserve synchronizeGuestBuffers(moved), EpochProofs() && !perUseTextures and main's patched-data template reuse. #6989/#6995 are merged; #10497 remains a dependency.
Review correction: require
valid && moved.has_value()before a draw-cache hit. An engaged moved-buffer vector no longer bypasses failed resource revalidation. Publication still happens before the proof with the moved ranges; existing invalidation/refusal paths remain. Still draft for the separate AMD intermittence and foreign-depth/concurrent-consumer qualification.Tested
4 December: head
59a680b610, frozen main2fbf8b4391. Resolved the two address-draw fixture/registration conflicts by retaining our failed-revalidation case and main's new shadow-publish, shadow-cpu-overwrite and shadow-fresh checks (18 DefaultCases). Main's pending-old-input dispatch protections and multisample draw recipes are retained. The corrected draw-cache gate and regression body are unchanged from 3 December.Full native libraries/relinker and selected real fixtures build on both pins; ordinary/profiling Graphics host suites pass. 68/68 focused CTests pass (64 clean; four retain main's depth-plane warnings). Main passes 56/56; 56 common processes have identical error/warning IDs. The shadow, dispatch-move/depth and failed-revalidation checks pass on both physical GPUs. Matrix nonzero exits: none. The separately repeated AMD moved-template assertion follows successful current-word/output-boundary checks; by itself it does not establish stale output, and its cause is unisolated. Required Vulkan/cache disabled, actual devices and Khronos 1.4.363 insertion verified, no new VUIDs/skips; all selected GPU processes below 30 seconds. Exact commands, source/executable hashes and complete logs.
Predetermined epoch repeats: NVIDIA 6/6, AMD 4/6; all attempts retained. Still draft: the AMD cause and foreign-depth/concurrent-consumer qualification remain unresolved; #10497 remains a dependency. No assertion relaxation, retries-until-green or new fallback.
The 3 December rendering counterexample and correction retain their actual control
6573319e1d/ fix2bbb29ed2fpins. The old condition rendered stale 150 instead of 75 on both GPUs; the correction passed. Those negative controls were not rerun or relabeled as this merge. The added regression is absent on unchanged main.Windows Build, portability, report and eligibility passed on previous head2bbb; skipped jobs are not passes and that CI is not CI for this new merge. The latest review found no blocker in its inspected ranges, but was partial, COMMENTED and ran no tests. The older formal change request remains for reviewer action.
Windows 11 Enterprise 26300, RTX 5080 621.01/32.0.16.2101, AMD Radeon Graphics 32.0.21045.16010, WinLibs GCC15.2 UCRTr7 Release. Conventions/template/whitespace pass. No fresh Sonic/FPS/Linux/full-CTest/analyzer/cache-executable or console-equivalence claim; quarantined executables remain unbuilt/unrun.
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)Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-17T08:19:31Z.
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 3d457b9a8, all binaries rebuilt on this head, ctest serial:
18/18 pass on Ampere — read-only shader-buffer publication and the buffer-refusal boundary hold.
Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-18T16:18:14Z.
Data point for the publication series: Assassin's Creed Mirage (PPSA13960) accesses 4x MSAA color memory every frame through single-sample views at twice the extent (960x540x4 ↔ 1920x1080x1 in SW_64KB_S; an R11G11B10F storage write from compute shader 0x10b4f58600 and an R16F texture read). With this PR's head merged on
mainit still stops ata storage image access ... whose samples are only on the host: guest access to it is not implemented. Are storage image views of a native MSAA target's memory in this series' scope?Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-18T16:51:05Z.
@hugodearaujo Thanks for the concrete case. The single-sample image aliases you describe are outside #7002's current scope. Its read-only handoff is for logical buffer descriptors, not every read-only shader resource. At published head
d9b584e423,synchronizeGuestBufferspublishes read-only buffers and refuses writable ones first. The separatecachedStorageTexturepath still callsRequireNoMultisampleTargetfor the storage-image access. Your reported stop is therefore consistent with that unchanged refusal.This is narrower than saying all native-MSAA storage views are unsupported: merged #5881 already handles a compatible multisampled storage view with matching format, extent and sample count. The
960x540x4 -> 1920x1080x1image alias, and the R11G11B10F/R16F reinterpretations, do not use that matching-view path. This series' guest publication also currently requires uncompressed single-layer R_X storage; itsColorSnapshotcheck does not establish SW_64KB_S sample layout.I would keep the guard until the sample/byte mapping and write-to-next-consumer coherency are implemented and tested; dropping it or treating this as an ordinary resolve would not demonstrate correctness. There is also a distinction to settle before opening a duplicate tracker: #5933 covers memory reused after an MSAA target is dead, while a still-live alias needs an actual coherency path. Does the original4x target get drawn to/read again after the1x storage write? If available, please add the exact tested main/dependency SHAs. The full stop already recorded in #7533 plus your per-frame observation provide useful context.
I checked public source at this published head and main13e48ed290; I have not run Mirage and am not claiming its workaround, write coverage or title unblock. I have also clarified this PR's description. AI-assisted: yes (Codex).
Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-18T19:24:20Z.
@Amoenus Exact SHAs of that test:
main6efb7261b, with #7532 at51e5eae15, #7533 at bfcb8fcdf, #6343 atce5b0c395and this PR at d9b584e423.Yes, both 4x targets are drawn to again after the 1x accesses. In a local run with the guard retired instead of throwing (the same idea as #6808), with a print where a host multisampled target is created and where a 1x access retires a guard, the log has the same four events 45 times in a row:
The next cycle then creates both 4x targets again for the same memory, so this is a live alias reused every cycle, not memory reused after the target is dead. My prints covered only those two points, so I can't say whether a cycle starts with a clear, or whether the 4x targets are also read as multisampled resources between the steps.
Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-18T22:58:08Z.
@hugodearaujo Recorded your exact pins and repeated live-alias sequence in the PR report. Drawing to both 4x targets again distinguishes this from dead-allocation reuse.
The important scope boundary is that #7002 handles read-only shader buffers; it does not establish coherence from the 1x storage write back into subsequent 4x use. The guard-retirement experiment therefore does not by itself validate that handoff. Clears before reuse and any intervening multisample reads remain unknown, as you noted. This belongs in the broader #6480 alias work; I have kept it separate from this PR's supported paths and validation claims.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T10:14:44Z.
@Amoenus this PR is stacked on #6973 and inherits its conflicts with
maininTexture.hppandMultisampleTarget.cpp; see the note on #6973. Please rebase it after #6973 is reworked on currentmain.Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:59:36Z.
Review: COMMENTED
Correction (2026-11-01): the title-ID/log demand below is not a CONTRIBUTING requirement;
Unblocks: noneis allowed. The technical points below are unaffected.1. Work before command-buffer binding. "Preparation, final upload, compute reuse validation and moved draw snapshots request the sample-preserving handoff before command-buffer binding." That is a GPU readback and publication (GPU mutex, CPU copy) on the draw/dispatch recording path, for any read-only buffer binding that overlaps a native MSAA owner. How often does it run per frame in a real scene, and what is the cost when no owner overlaps (one range check per binding)? The description makes no performance claim, but the placement is in the per-draw path; please give a counter plus
tools/trace_digest.pysummaries ofmainand this head on a scene that has native MSAA colour.2. No title reaches this on
main. "Unblocks: none"; the PPSA99902 ledger and the Mirage comment say no unblock is claimed. Please name a title and a log line showing a read-only buffer binding overlapping a native colour target.3. Cumulative stack. The head carries #6973, #6987, #6989 and #6995 (about 110 commits, most of them refresh merges) against
main, so the 1837-line diff is not reviewable as this change. Retarget onto #6995's branch or rebase once it lands.4. Order of checks. The body explains that read-only aliases processed first could retire a native owner and let a later writable overlap through, and fixes it by checking writable bindings first. That is a correctness hazard found by a test; is there a test for the same hazard through the compute reuse validation and moved draw snapshot paths (they are separate callers), or only through preparation?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T20:30:22Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the one optional point below may help clarify the cache fallback behavior.
What I ran
Reviewed head
5e9ad0ea99645d0201a1e144ffa92ba26f9a291cagainst the prepared diff and targeted source reads throughrepo_read.py. No tests or builds were run; the GPU and CPU results in the description are author-reported.Results
Findings
Blocking
None.
Non-blocking
Draw.cpp:2255treats inability to prove a moved-buffer candidate asmoveRefused, then takes the miss path while retaining the cached entry. Consider documenting or asserting the intended fallback here; the behavior is not immediately evident from this branch.Not verified
The two changed files
VulkanDevice.cppandShaderResources.cppwere not present in the review folder; their changed hunks were read through the pinned reader. Other full file text was not read beyond changed-line hunks and targeted callers. No local tests, build, physical-console behavior, Linux joint-stack qualification, or large-title costs were verified. Author-reported GPU and CPU results were not independently run.To get this to a good state
Nothing is required. The fallback branch comment is optional.
Files reviewed: all 10 changed files listed in the manifest; files read directly from the review folder or pinned reader:
VulkanDevice.cpp,MultisampleTarget.hpp,ShaderResources.hpp,Draw.cpp,MultisampleTarget.cpp,ShaderResources.cpp,agc_driver_sample_multisample_target_tests.cmake,MultisampleSrgbTwin.cpp,SampleMultisampleTarget.cpp, andnative-color-publication.md. Excluded files: none listed by rule infiles.json; the two large source files were reader-accessible and their changed hunks were inspected.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T05:59:55Z.
Review: COMMENTED
Reviewed — comments
The publication and moved-buffer paths have material integration and concurrency uncertainty, so this review does not establish that the change is ready to merge.
What I ran
The prepared bundle identifies head
86d06f9dccfea73c0605c1f744b9245dfc6684ee. I read the description, manifest, and selected diff hunks; I did not run commands or tests.Results
Findings
Blocking
None verified.
Non-blocking
Sources
MultisampleTarget.cpp:291-293, publication locking inMultisampleTarget.cpp:318-390, and guest-buffer synchronization inShaderResources.cpp:448-462.Not verified
I read
description.md,commits.md,manifest.json, and selected ranges ofdiff.patch. Changed files listed in the manifest but not read includeVulkanDevice.cpp,ShaderResources.cpp, andtests/Graphics.cpp; I also did not read all included changed files or all diff hunks. The manifest marks the full text of those three files as excluded for size. I did not inspect test output, run tests, or verify the author-reported results.To get this to a good state
Nothing is required. Optional: qualify the lock ordering and concurrent publication/read behavior, then provide the resulting test evidence.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T06:30:11Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this review, but the author’s reported concurrent stage-A/read/publication qualification remains unverified.
What I ran
Reviewed head
636a5fb907322dfc82a8f09eec760614d08ed4f2using the prepared diff and the pinnedrepo_read.pyreader. No build or test commands were run; the test results below are reported by the author or CI.Results
Findings
Blocking
None.
Non-blocking
Not verified
DisplayBuffer.cpp,MultisampleTarget.hpp,ShaderResources.hpp,State.hpp,Draw.cpp,MultisampleTarget.cpp,State.cpp,agc_driver_sample_multisample_target_tests.cmake,MultisampleSrgbTwin.cpp,SampleMultisampleTarget.cpp, andnative-color-publication.mdfrom the prepared diff and/or pinned reader. Read the changed regions ofVulkanDevice.cpp,ShaderResources.cpp, andGraphics.cppthrough the pinned reader; these three files were excluded fromfiles/as too large. Read the PR description, commit list, manifest, diff, and review-folder README. No changed file listed in the manifest was left unread.To get this to a good state
Nothing is required. The concurrency and foreign-depth qualifications are optional follow-up points.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T06:24:22Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed head is
133f48c9b794c863d88b3a9ceb8cc92ed46528f6; I found no verified blocking defect, but an intermittent AMD moved-template failure remains unresolved, so a formal approval is not justified.What I ran
Read the prepared diff and targeted source at the pinned head. No commands or tests were run during this review; test results below are author-reported.
Results
Findings
Blocking
None verified.
Non-blocking
Not verified
Execution/src/VulkanDevice.cppfull text was excluded for size; only the changed dispatch region was read.Graphics/src/ShaderResources.cppfull text was excluded for size; only changed synchronization/revalidation regions were read.tests/Graphics.cppfull text was excluded for size; the changed test hunk was read.Graphics/include/MultisampleTarget.hpp,Graphics/include/ShaderResources.hpp,Graphics/include/State.hpp,Graphics/src/State.cpp,tests/cmake/agc_driver_sample_multisample_target_tests.cmake,tests/execution/MultisampleSrgbTwin.cpp,tests/execution/SampleMultisampleTarget.cpp, anddocs/dev/debt/changes/native-color-publication.md.DisplayBuffer.cpp,Graphics/src/Draw.cpp, and targeted ranges inGraphics/src/MultisampleTarget.cppwere read. Test execution, Linux, console equivalence, game behavior, concurrent stage-A/read/publication, current foreign-depth qualification, and the intermittent AMD case were not independently verified.To get this to a good state
Nothing is required. Optional: isolate the intermittent AMD moved-template rebuild and report repeat results for the current head before relying on the epoch path.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T05:56:53Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change based on the source reviewed; optional follow-up is to isolate the reported AMD moved-template assertion before removing draft status.
What I ran
Reviewed head
e6a28438bba5c167f98c097df20f644f898e2cc5. No commands or tests were run in this review;repo_read.pywas used to inspect the prepared diff and targeted source ranges.Results
Findings
Blocking
None identified in the source reviewed.
Non-blocking
buffer_publicationandbuffer_publication_epoch, with the cause still unisolated. Keep this qualification visible and investigate before treating the behavior as stable.Not verified
The full text was read for 10 of 13 changed files; targeted ranges and the diff were read for the remaining three:
Execution/src/VulkanDevice.cpp,Graphics/src/ShaderResources.cpp, andtests/Graphics.cpp. The author reports builds and test results, but they were not rerun here. Linux, full CTest, physical-console behavior, and the outstanding concurrency and foreign-depth cases were not verified.To get this to a good state
Nothing is required. Optional: isolate the reported AMD moved-template assertion and record the result before promoting the draft.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T09:45:15Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change based on the source reviewed; the author-reported AMD intermittence remains unresolved.
What I ran
Reviewed head
24df0bccdd7344be25106d14a00f41bd1b969ec4. Read the prepared description, commits, manifest, diff, and every changed line listed in the review folder. Inspected targeted callers and implementations with the pinned repository reader. No tests or builds were run by me.Results
Findings
Blocking
None identified in the code reviewed.
Non-blocking
Not verified
No tests or builds were run in this review. The full source text of
VulkanDevice.cppandShaderResources.cppwas excluded from the review folder; only relevant ranges were read throughrepo_read.py. The changed-line ranges forSampleMultisampleTarget.cppwere supplied in the diff and read. No other repository paths were read.To get this to a good state
Nothing is required. Optional: resolve and document the AMD intermittent moved-template failure before claiming it is fixed.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-02T01:48:16Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: gate moved-buffer cache reuse on successful revalidation.
What I ran
Reviewed head
a19727c48a03ef7588e593354354964eb9d1584e. No merged-preview check or tests were run. I inspected the prepared diff and targeted source ranges usingrepo_read.pyat the pinned head; no build or compile was run.Results
Negative control
Not run; no non-compiling negative control was available for this review.
Findings
Blocking
MovedReadOnlyBuffersnow runs beforeRevalidate, so it can return a vector even when revalidation fails. The subsequent cache-hit branch checks onlymoved.has_value()and can therefore reuse stale cached resources despitevalid == false. Gate that branch on successful revalidation; move refusals can continue through the existing fallback. This regresses the prior behavior, where moved buffers were computed only after successful revalidation. Draw.cpp:2543 Draw.cpp:2545Non-blocking
None.
Sources
The finding is based on the moved-buffer lookup and revalidation flow in Draw.cpp at the reviewed commit. The dispatch path’s separate guard is visible in VulkanDevice.cpp at the reviewed commit.
Not verified
Inspected the changed hunks and relevant context in all seven paths listed as reviewed in
files.json:VulkanDevice.cpp,ShaderResources.hpp,Draw.cpp,ShaderResources.cpp,agc_driver_sample_multisample_target_tests.cmake,SampleMultisampleTarget.cpp, andnative-color-publication.md.files.jsonlists no excluded paths. Unchanged portions of these files and runtime behavior were not reviewed or verified. The description reports 46 focused CTests passing, NVIDIA 6/6 and AMD 5/6 epoch repeats, and unqualified foreign-depth/concurrency behavior; these are author-reported and were not independently checked.To get this to a good state
Require
validas well asmoved.has_value()before taking the draw cache-hit branch. Then rerun the focused draw recipe and native buffer publication checks on the updated head, including a revalidation-failure case.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T23:05:29Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
2bbb29ed2f5bef0eceb997be20f8472a0ec4773dusing the pinnedrepo_read.pyreader and the prepared diff. I ran no builds or tests.Results
Negative control
Not run. The description reports an old-condition control failing on both GPUs; I did not verify it.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
files.jsonlists nine changed files for review and none excluded. I inspected the changed paths and targeted ranges, includingSampleMultisampleTarget.cppthrough line 2560; I did not inspect the remainder of that large changed test section. Builds, tests, console behavior, and the reported intermittent AMD assertion were not independently verified. The description reports 57/58 focused CTests passing and an AMD publication assertion failure.To get this to a good state
Nothing is required. Optional: inspect the remaining added test code and provide a stable AMD repeat or isolate the reported assertion.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T16:27:08Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
59a680b61091aa11ab50e41b6c7a34988f42791eagainstmain. I inspected the prepared review artifacts and targeted source ranges usingrepo_read.py; I did not run tests, builds, or hardware checks.Results
Findings
Blocking
None.
Non-blocking
The description reports an intermittent AMD moved-template assertion after current-word and output-boundary checks pass, and leaves foreign-depth/concurrent-consumer qualification unresolved. These are disclosed limitations, not verified defects in the inspected changes. Keep the qualification record explicit about their status and scope.
Sources
Not verified
No tests, builds, CI jobs, or physical GPU checks were run. The AMD intermittence cause and foreign-depth/concurrent-consumer behavior remain unverified. I read targeted ranges, not the full contents, of the large source and test files. All nine paths listed under
reviewedinfiles.jsonwere inspected;files.jsonlists no additionally excluded paths.To get this to a good state
Nothing is required.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.