feat(agc): publish native color before guest memory reads #6995
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6995"
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:06:11Z.
What
Publish supported native MSAA color before guarded CPU reads and prepared replacement capture; both display-buffer entry points guard before flush/copy. Shader-buffer consumers remain in #7002.
Integrate main #17956 without losing either ownership rule: depth-only owners can publish for an attachment import, while an overlapping color owner must be refused before depth publication. Color-only replacement still publishes the old supported color owner. The three alias tests, depth-only import and color-only reuse checks cover these distinct cases.
Tested
25 November head
abc237313831b1f242f893e77acfa00184c2ceec, tested main72a366bbe44057f7c5cc3e348b08aa46cb247292: full native libraries/relinker and selected real fixtures build; 94 physical-GPU testcase processes plus one Graphics host suite pass. No failures, skips or validation warnings/errors. The matched main matrix passes 54 GPU processes plus one host suite, including DCC-unwatch after merged #22950. Capability fixtures absent on main are reported separately from common cases.Windows 11 Enterprise 10.0.26200, WinLibs GCC 15.2.0 UCRT r7, Release. NVIDIA RTX 5080 (10de:2c02), 621.01/32.0.16.2101; AMD Radeon Graphics (1002:13c0), 32.0.21045.16010. Required Vulkan, application shader cache off, Khronos 1.4.363; actual device/layer verified per process.
Exact sources, commands, raw logs and limits. The four native-depth recurrence cases use the unchanged main fixture; the matrix also includes main's new depth-to-color initial-owner and cold 2x/8x FMASK cases. Historical 20 November controls retain their own pins in the earlier report.
The first unpushed merge
f6861a6919failed three depth-alias tests on each GPU. Restoring color-owner preflight before attachment-depth publication makes all six pass; no fixture or refusal assertion changed. The failed composition and logs are retained as a sensitivity control.No fresh Linux execution of this head, console-equivalence, game/FPS, full CTest or analyzer-clean result is claimed. Quarantined shader-memory/cache executables remain unbuilt/unrun. Earlier independent Linux Pascal results on #6989/#6995 retain the old
2ecf7da072/4cc7d22168plus main3bf7091b75pins; requested RTX 4090 confirmation remains outstanding.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:16:00Z.
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 2e8ebc372, all binaries rebuilt on this head, ctest serial:
15/15 pass on Ampere — CPU-side publication for guest reads holds.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-21T10:14:42Z.
@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:35Z.
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. Cost on the guest-read path is not measured. The description says the read guard "pins overlapping native owners, releases the cache mutex, and publishes each owner under the GPU mutex before the caller copies guest bytes", and that
ReadCommittedUnsyncedkeeps running this guard. What does the guard cost when there is no native owner overlapping (the common case), i.e. is it one range lookup under the cache mutex per guest read? And when an owner does overlap, publication waits on the GPU mutex and a readback on the caller's thread. A counter for guards run / owners published per 10 s, andtools/trace_digest.pysummaries ofmainand this head on a scene that has native MSAA colour, would answer that. The body states no performance claim, but this is a synchronous GPU->CPU round trip placed in the guest-memory read path, so the cost needs a number.2. No title reaches this on
main. "Unblocks: none" and the PPSA99902 ledger link is not a log line. Please name a title and the log line showing a guest read hitting a resident native MSAA target.3. Stack of five against
main. The head contains all of #6973, #6987 and #6989 (roughly 100 commits, mostly "refresh ... on current main" and merges), so the 1475-line diff is cumulative. Retarget or rebase so only the read-guard wiring shows.4. Throws on common cases. "Unsupported metadata, overlapping owners, pending writes, unsupported readback layouts and publication from recorder completions throw." Publication from a recorder completion callback calling a guest read is plausible for a title-driven read; is there a test that shows the throw is reached through a real completion path and not only through a direct call?
Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T18:18:16Z.
Review: DISMISSED
Reviewed — changes requested
The guest-read publication wiring builds and its tests pass on lavapipe, and reverting it makes three of the four CPU-path tests fail. But the new
agc_driver_native_color_initial_reusetest always skips on lavapipe (the only GPU CI uses), and its skip message is not onetools/check_skips.pyaccepts, so the skip check fails and CI never runs this regression.What I ran
Head
5677a2a2fcd637e856dfa37d75ffbfe70c7330d7,main1e658521a0a599872612bb91949311e2956b5283, merged with--no-ffin a clean worktree. Debian 13 VM, Xeon Gold 6136, GCC 14.2.0, lavapipe (Mesa 26.1.6, LLVM 19), no GPU.Results
git diff --checkcheck_conventions.pylibsOKmaintoocheck_skips.py)agc_driver_native_color_initial_reuse skippedVUID-vsmaininitial_reuse)agc_driver_alpha_to_coverage_sample_mask_export(passed only on rerun in the script's run)initial_reuse skip on lavapipe
check_skips.py:Negative control
MultisampleTarget.hpp/.cpp,Texture.hpp/.cpp) frommaindoesn't compile the tests:ReadMultisampleTargetSamples_nid_no_patch,ReadMultisampleTargetColorSnapshot_nid_no_patchandPublishMultisampleTargetColor_nid_no_patchare not declared. The CI comments report the same thing.guardReadscallsRequireNoMultisampleTarget(address, bytes, "a CPU read")again instead ofSynchronizeMultisampleTargetRead_nid_no_patch.agc_driver_native_color_cpu_publication,agc_driver_native_color_reuse_live_cpuandagc_driver_native_color_reuse_written_cpufailed.agc_driver_native_color_reuse_claimed_cpustill passed, so it does not depend on the CPU read wiring.git status --porcelainis empty.Findings
Blocking
agc_driver_native_color_initial_reusealways skips on lavapipe, and the skip check rejects it.core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp:1220requires 2-sampleR16G16B16A16_SFLOATcolor, because the wide owner at line 1224 is built withsampleShift = 1. lavapipe has no 2-sample color attachments.skipped native color initialization subcase: ... is unavailable) does not match the device-limitation formattools/check_skips.pyexpects (check_skips.py#L7:skipped, the device lacks|has no|...).225b170a9dd7).skipped, the device lacks two-sample R16G16B16A16_SFLOAT color attachments, as--dithered2in the alpha-to-coverage tests does.Non-blocking
main, a newly created native color target was always cleared withinitialDccClear(target).MultisampleTarget.cpp:185routes targets without DCC and without a CMASK fast clear throughinitialColorContents. That throws:MultisampleTarget.cpp:884);RenderTargettiled (MultisampleTarget.cpp:899).agc_driver_native_color_reuse_claimed_cpupasses without the CPU read wiring (negative control above).cpuvariant forclaimed.main.SynchronizeMultisampleTargetRead_nid_no_patch(MultisampleTarget.cpp:1754) callsRequireNoResidentDepthRead_nid_no_patchand then loadsanyGuarded().main'sRequireNoMultisampleTargetdoes the same two steps.Not verified
agc_driver_native_color_snapshottimeout on RADV NAVI24, also when re-run alone. It takes 10.6 s with validation here, so I could not reproduce or explain it.GpuMutex→targetsMutexlock order and the read guard re-entering from the constructor'sGuestMemory::ReadundertargetsMutexwere checked by reading only, not with a stress test.To get this to a good state
agc_driver_native_color_initial_reuserun on lavapipe (preferred), or give it an accepted device-limitation skip message, socheck_skips.pypasses.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T16:57:13Z.
Review: COMMENTED
Reviewed — comments
The change adds native multisample color publication before selected guest-memory reads and replacement capture; review was limited to the core implementation and supporting debt note, so a formal approval is not justified.
What I ran
c94853da9853bbf09a3457ca93f28c9c0f40891dusing the prepared description, commit list, diff, manifest, and pinned readerrepo_read.py.Results
Findings
Blocking
None identified in the source reviewed.
Non-blocking
None.
Not verified
The change is incomplete for review: I did not read every changed file in
files.jsonunderreviewed. The changed header, CMake test registration, execution tests, and full implementation context were not reviewed. No behavior or test claims from the PR description were independently verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T12:41:11Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
58110a88be815470b4dff250e47bea64dfd6a9c9. No commands or tests were run. I read the description, commits, diff, manifest, review README, and all changed source files exceptGraphics.cpp, whose relevant added lines were read through the pinned reader.files.jsonwas not available as a review document; the reader’s file listing identified the excluded file. No changed files were excluded from inspection.Results
Findings
Blocking
None.
Non-blocking
Not verified
No tests, build, physical console behavior, multisample scanout/resolve equivalence, shader-buffer consumers, or unsynchronized CPU stores during commit were independently verified. Author-reported test results were not run by this review.
To get this to a good state
Nothing is required. The unverified areas above are optional follow-up work.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T01:23:25Z.
Review: COMMENTED
Reviewed — comments
The changed read and publication paths look coherent in the inspected code, but I did not run the reported checks and the oversized changed test file was only read around its added test block, so formal approval is not justified.
What I ran
Reviewed head
4cc7d22168ff62e64859f076c51e104a349cd162. No build or test commands were run. Targeted source reads used the pinnedrepo_read.pyreader.Results
Findings
Blocking
None.
Non-blocking
llvmpipecoverage, but native Linux RTX 4090 confirmation and the quarantined shader-memory/cache executables remain outstanding.Not verified
core/libs/prx/libSceAgcDriver/tests/Graphics.cppwas excluded from the review bundle because it was too large; its changed lines were read through the pinned reader. The other changed files were included in the bundle, and their relevant source ranges were inspected.To get this to a good state
Nothing is required. Optional: provide the outstanding Linux GPU confirmation and run the quarantined executables when practical.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T06:25:39Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation and the inspected regression coverage support the stated native color publication behavior.
What I ran
No commands or tests were run by this reviewer. I inspected the prepared diff and pinned source at head
abc237313831b1f242f893e77acfa00184c2ceec; no merged-preview check was performed. The PR description reports Windows GPU and host test runs, but those results were not independently reproduced.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I read all changed lines in the prepared diff, including the seven added
Graphics.cpplines through the pinned reader. Thefiles/directory was empty, so changed-file text was read through the pinned reader where needed. I did not run tests, builds, analyzers, a Linux environment, or physical-console checks; the author’s reported runs remain unverified.To get this to a good state
Nothing is required.