feat(agc): publish native color before guest memory reads #6995

Merged
Amoenus merged 187 commits from upstream-pr/6995 into main 2026-11-29 07:42:59 +00:00
Amoenus commented 2026-10-17 03:06:11 +00:00 (Migrated from github.com)

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 main 72a366bbe44057f7c5cc3e348b08aa46cb247292: 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 f6861a6919 failed 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 / 4cc7d22168 plus main 3bf7091b75 pins; requested RTX 4090 confirmation remains outstanding.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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: #6989
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 5080 (10de:2c02), 621.01 / Windows 32.0.16.2101; AMD Radeon(TM) Graphics (1002:13c0), Windows 32.0.21045.16010; Windows 11 Enterprise 10.0.26200; Khronos validation 1.4.363
  • AI-assisted: yes (Codex); author responsible
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4896741613 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6995). Originally posted by [Amoenus](https://github.com/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 main `72a366bbe44057f7c5cc3e348b08aa46cb247292`: 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](https://gist.github.com/Amoenus/f1b72cd86791eb05b3badabc1377df11). 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](https://gist.github.com/Amoenus/3cfc704437e977bdb9b99f30f46763bc). The first unpushed merge f6861a6919 failed 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` / `4cc7d22168` plus main `3bf7091b75` pins; requested RTX 4090 confirmation remains outstanding. <!-- 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. --> ### 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) and the licence notice of code adapted from upstream (see AGENTS.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 --> #6989 - [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 (10de:2c02), 621.01 / Windows 32.0.16.2101; AMD Radeon(TM) Graphics (1002:13c0), Windows 32.0.21045.16010; Windows 11 Enterprise 10.0.26200; Khronos validation 1.4.363 - [x] AI-assisted: <!-- yes / no --> yes (Codex); author responsible
akkadbakkad89 commented 2026-10-17 08:16:00 +00:00 (Migrated from github.com)

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:

Test Result
agc_driver_native_color_cpu_publication pass
agc_driver_native_color_publication pass
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

15/15 pass on Ampere — CPU-side publication for guest reads holds.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6231627251 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6995#issuecomment-6231627251). Originally posted by [akkadbakkad89](https://github.com/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: | Test | Result | |---|---| | agc_driver_native_color_cpu_publication | pass | | agc_driver_native_color_publication | pass | | 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 | 15/15 pass on Ampere — CPU-side publication for guest reads holds.
oneandonlydean commented 2026-10-21 10:14:42 +00:00 (Migrated from github.com)

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 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:6313515627 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6995#issuecomment-6313515627). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-21T10:14:42Z. --- @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:35 +00:00 (Migrated from github.com)

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: none is 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 ReadCommittedUnsynced keeps 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, and tools/trace_digest.py summaries of main and 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?

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729955779 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6995#pullrequestreview-5729955779). Originally posted by [CnRJay](https://github.com/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: none` is 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 `ReadCommittedUnsynced` keeps 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, and `tools/trace_digest.py` summaries of `main` and 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?
XairRrR commented 2026-11-03 18:18:16 +00:00 (Migrated from github.com)

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_reuse test always skips on lavapipe (the only GPU CI uses), and its skip message is not one tools/check_skips.py accepts, so the skip check fails and CI never runs this regression.

What I ran

Head 5677a2a2fcd637e856dfa37d75ffbfe70c7330d7, main 1e658521a0a599872612bb91949311e2956b5283, merged with --no-ff in a clean worktree. Debian 13 VM, Xeon Gold 6136, GCC 14.2.0, lavapipe (Mesa 26.1.6, LLVM 19), no GPU.

git diff --check 1e658521a0a599872612bb91949311e2956b5283...5677a2a2fcd637e856dfa37d75ffbfe70c7330d7
python3 tools/check_conventions.py --base 1e658521a0a599872612bb91949311e2956b5283
ctest --test-dir build -R "agc_driver_native_color|agc_driver_msaa_dcc_recreate|agc_driver_sample_multisample_target" --output-on-failure -j8 --test-load 32
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 build/tests/agc_driver_sample_multisample_target_tests --initial-reuse
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -R "^agc_driver_native_color_(snapshot|publication|cpu_publication|initial)$" -j1
ctest --test-dir build -R "agc_driver_native_color_(cpu_publication|reuse_.*_cpu)|alpha_to_coverage" -j8 --test-load 32
ctest --test-dir build -R "^agc_driver_alpha_to_coverage_sample_mask_export$"   (3 times)
# negative control: see below

Results

Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Build (script) configure, build and libs OK
Selected tests (script, 2234 run) 0 new failures, 0 timeouts; 7 known failures that fail on main too
Skip check (script, check_skips.py) failed: agc_driver_native_color_initial_reuse skipped
Validation layer (script, 786 tests, layer loaded in 785, none missing) 0 new VUID- vs main
15 native color / DCC recreate / sample target tests 14 passed, 1 skipped (initial_reuse)
Native color tests with validation, serial snapshot 10.6 s, publication 4.7 s, cpu_publication 4.7 s, initial 2.4 s
agc_driver_alpha_to_coverage_sample_mask_export (passed only on rerun in the script's run) passed 3/3 alone in 28.8 s, 24.7 s and 23.0 s. This PR does not change it, but it is close to the 30 s limit.
initial_reuse skip on lavapipe
skipped native color initialization subcase: format=97 samples=2 is unavailable
exit=77

check_skips.py:

error: agc_driver_native_color_initial_reuse skipped
1 test(s) skipped for a reason that is not expected: the job lost that coverage and ctest still reports every test as passed

Negative control

  • Full revert: restoring the four production files (MultisampleTarget.hpp/.cpp, Texture.hpp/.cpp) from main doesn't compile the tests: ReadMultisampleTargetSamples_nid_no_patch, ReadMultisampleTargetColorSnapshot_nid_no_patch and PublishMultisampleTargetColor_nid_no_patch are not declared. The CI comments report the same thing.
  • Narrower revert: on the merged tree I reverted only this PR's headline change: guardReads calls RequireNoMultisampleTarget(address, bytes, "a CPU read") again instead of SynchronizeMultisampleTargetRead_nid_no_patch.
    • agc_driver_native_color_cpu_publication, agc_driver_native_color_reuse_live_cpu and agc_driver_native_color_reuse_written_cpu failed.
    • agc_driver_native_color_reuse_claimed_cpu still passed, so it does not depend on the CPU read wiring.
  • Restore: I put the merged file back and rebuilt; all four pass again. git status --porcelain is empty.

Findings

Blocking

  1. agc_driver_native_color_initial_reuse always skips on lavapipe, and the skip check rejects it.
    • Where: core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp:1220 requires 2-sample R16G16B16A16_SFLOAT color, because the wide owner at line 1224 is built with sampleShift = 1. lavapipe has no 2-sample color attachments.
    • Why the check fails: the skip line printed at line 1007 (skipped native color initialization subcase: ... is unavailable) does not match the device-limitation format tools/check_skips.py expects (check_skips.py#L7: skipped, the device lacks|has no|...).
    • Why it matters: the skip check fails, and CI never runs the regression for "claim reused color memory before initialization" (225b170a9dd7).
    • Fix:
      • Build the wide owner with a sample count lavapipe supports (4, with a matching extent for a two-block footprint), so the test runs on CI.
      • Otherwise, print the skip in the accepted form, e.g. skipped, the device lacks two-sample R16G16B16A16_SFLOAT color attachments, as --dithered2 in the alpha-to-coverage tests does.
    • Code: SampleMultisampleTarget.cpp#L1002-L1009, #L1217-L1224.

Non-blocking

  1. New targets that used to be cleared now throw in some cases (behaviour change carried in from the stack).
    • Before: on main, a newly created native color target was always cleared with initialDccClear(target).
    • Now: MultisampleTarget.cpp:185 routes targets without DCC and without a CMASK fast clear through initialColorContents. That throws:
      • for any CMASK address (MultisampleTarget.cpp:884);
      • for a non-uniform footprint that is not RenderTarget tiled (MultisampleTarget.cpp:899).
    • Why it matters: both follow the "unimplemented paths throw" rule, but a title that creates such a target over non-uniform memory now stops where it used to run. Only component tests cover this.
    • Suggested fix: state in the description or debt entry that these cases now throw where they did not before, so title testers recognise the message.
  2. agc_driver_native_color_reuse_claimed_cpu passes without the CPU read wiring (negative control above).
    • Why it matters: it is registered as the CPU-path variant, but it does not show the guard is involved.
    • Suggested fix: make it depend on the guard, or drop the cpu variant for claimed.
  3. On CnRJay's cost question (point 1): when no native owner overlaps, the cost is the same as on main.
    • SynchronizeMultisampleTargetRead_nid_no_patch (MultisampleTarget.cpp:1754) calls RequireNoResidentDepthRead_nid_no_patch and then loads anyGuarded(). main's RequireNoMultisampleTarget does the same two steps.
    • When an owner does overlap, the read waits on the GPU, reads the samples back and retires the owner. That cost is still not measured, as CnRJay said.

Not verified

  • Hardware GPUs: only lavapipe here. The latest AMD CI comment reports an agc_driver_native_color_snapshot timeout on RADV NAVI24, also when re-run alone. It takes 10.6 s with validation here, so I could not reproduce or explain it.
  • 2-sample paths: every 2-sample subcase skips on lavapipe.
  • Concurrency: the GpuMutex → targetsMutex lock order and the read guard re-entering from the constructor's GuestMemory::Read under targetsMutex were checked by reading only, not with a stress test.
  • No title was run.

To get this to a good state

  • Make agc_driver_native_color_initial_reuse run on lavapipe (preferred), or give it an accepted device-limitation skip message, so check_skips.py passes.
  • Optionally address the non-blocking points above.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5757371320 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6995#pullrequestreview-5757371320). Originally posted by [XairRrR](https://github.com/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_reuse` test always skips on lavapipe (the only GPU CI uses), and its skip message is not one `tools/check_skips.py` accepts, so the skip check fails and CI never runs this regression. ## What I ran Head `5677a2a2fcd637e856dfa37d75ffbfe70c7330d7`, `main` `1e658521a0a599872612bb91949311e2956b5283`, merged with `--no-ff` in a clean worktree. Debian 13 VM, Xeon Gold 6136, GCC 14.2.0, lavapipe (Mesa 26.1.6, LLVM 19), no GPU. ``` git diff --check 1e658521a0a599872612bb91949311e2956b5283...5677a2a2fcd637e856dfa37d75ffbfe70c7330d7 python3 tools/check_conventions.py --base 1e658521a0a599872612bb91949311e2956b5283 ctest --test-dir build -R "agc_driver_native_color|agc_driver_msaa_dcc_recreate|agc_driver_sample_multisample_target" --output-on-failure -j8 --test-load 32 ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 build/tests/agc_driver_sample_multisample_target_tests --initial-reuse VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -R "^agc_driver_native_color_(snapshot|publication|cpu_publication|initial)$" -j1 ctest --test-dir build -R "agc_driver_native_color_(cpu_publication|reuse_.*_cpu)|alpha_to_coverage" -j8 --test-load 32 ctest --test-dir build -R "^agc_driver_alpha_to_coverage_sample_mask_export$" (3 times) # negative control: see below ``` ## Results | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | All conventions checks passed | | Build (script) | configure, build and `libs` OK | | Selected tests (script, 2234 run) | 0 new failures, 0 timeouts; 7 known failures that fail on `main` too | | Skip check (script, `check_skips.py`) | **failed**: `agc_driver_native_color_initial_reuse skipped` | | Validation layer (script, 786 tests, layer loaded in 785, none missing) | 0 new `VUID-` vs `main` | | 15 native color / DCC recreate / sample target tests | 14 passed, 1 skipped (`initial_reuse`) | | Native color tests with validation, serial | snapshot 10.6 s, publication 4.7 s, cpu_publication 4.7 s, initial 2.4 s | | `agc_driver_alpha_to_coverage_sample_mask_export` (passed only on rerun in the script's run) | passed 3/3 alone in 28.8 s, 24.7 s and 23.0 s. This PR does not change it, but it is close to the 30 s limit. | <details><summary>initial_reuse skip on lavapipe</summary> ``` skipped native color initialization subcase: format=97 samples=2 is unavailable exit=77 ``` `check_skips.py`: ``` error: agc_driver_native_color_initial_reuse skipped 1 test(s) skipped for a reason that is not expected: the job lost that coverage and ctest still reports every test as passed ``` </details> ## Negative control - **Full revert:** restoring the four production files (`MultisampleTarget.hpp/.cpp`, `Texture.hpp/.cpp`) from `main` doesn't compile the tests: `ReadMultisampleTargetSamples_nid_no_patch`, `ReadMultisampleTargetColorSnapshot_nid_no_patch` and `PublishMultisampleTargetColor_nid_no_patch` are not declared. The CI comments report the same thing. - **Narrower revert:** on the merged tree I reverted only this PR's headline change: `guardReads` calls `RequireNoMultisampleTarget(address, bytes, "a CPU read")` again instead of `SynchronizeMultisampleTargetRead_nid_no_patch`. - `agc_driver_native_color_cpu_publication`, `agc_driver_native_color_reuse_live_cpu` and `agc_driver_native_color_reuse_written_cpu` **failed**. - `agc_driver_native_color_reuse_claimed_cpu` still **passed**, so it does not depend on the CPU read wiring. - **Restore:** I put the merged file back and rebuilt; all four pass again. `git status --porcelain` is empty. ## Findings ### Blocking 1. **`agc_driver_native_color_initial_reuse` always skips on lavapipe, and the skip check rejects it.** - **Where:** `core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp:1220` requires 2-sample `R16G16B16A16_SFLOAT` color, because the wide owner at line 1224 is built with `sampleShift = 1`. lavapipe has no 2-sample color attachments. - **Why the check fails:** the skip line printed at line 1007 (`skipped native color initialization subcase: ... is unavailable`) does not match the device-limitation format `tools/check_skips.py` expects ([check_skips.py#L7](https://github.com/boykopovar/AnyPS5/blob/1e658521a0a599872612bb91949311e2956b5283/tools/check_skips.py#L7-L7): `skipped, the device lacks|has no|...`). - **Why it matters:** the skip check fails, and CI never runs the regression for "claim reused color memory before initialization" (`225b170a9dd7`). - **Fix:** - Build the wide owner with a sample count lavapipe supports (4, with a matching extent for a two-block footprint), so the test runs on CI. - Otherwise, print the skip in the accepted form, e.g. `skipped, the device lacks two-sample R16G16B16A16_SFLOAT color attachments`, as `--dithered2` in the alpha-to-coverage tests does. - **Code:** [SampleMultisampleTarget.cpp#L1002-L1009](https://github.com/boykopovar/AnyPS5/blob/5677a2a2fcd637e856dfa37d75ffbfe70c7330d7/core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp#L1002-L1009), [#L1217-L1224](https://github.com/boykopovar/AnyPS5/blob/5677a2a2fcd637e856dfa37d75ffbfe70c7330d7/core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp#L1217-L1224). ### Non-blocking 1. **New targets that used to be cleared now throw in some cases** (behaviour change carried in from the stack). - **Before:** on `main`, a newly created native color target was always cleared with `initialDccClear(target)`. - **Now:** `MultisampleTarget.cpp:185` routes targets without DCC and without a CMASK fast clear through `initialColorContents`. That throws: - for any CMASK address (`MultisampleTarget.cpp:884`); - for a non-uniform footprint that is not `RenderTarget` tiled (`MultisampleTarget.cpp:899`). - **Why it matters:** both follow the "unimplemented paths throw" rule, but a title that creates such a target over non-uniform memory now stops where it used to run. Only component tests cover this. - **Suggested fix:** state in the description or debt entry that these cases now throw where they did not before, so title testers recognise the message. 2. **`agc_driver_native_color_reuse_claimed_cpu` passes without the CPU read wiring** (negative control above). - **Why it matters:** it is registered as the CPU-path variant, but it does not show the guard is involved. - **Suggested fix:** make it depend on the guard, or drop the `cpu` variant for `claimed`. 3. **On CnRJay's cost question (point 1):** when no native owner overlaps, the cost is the same as on `main`. - `SynchronizeMultisampleTargetRead_nid_no_patch` (`MultisampleTarget.cpp:1754`) calls `RequireNoResidentDepthRead_nid_no_patch` and then loads `anyGuarded()`. `main`'s `RequireNoMultisampleTarget` does the same two steps. - When an owner does overlap, the read waits on the GPU, reads the samples back and retires the owner. That cost is still not measured, as CnRJay said. ## Not verified - Hardware GPUs: only lavapipe here. The latest AMD CI comment reports an `agc_driver_native_color_snapshot` timeout on RADV NAVI24, also when re-run alone. It takes 10.6 s with validation here, so I could not reproduce or explain it. - 2-sample paths: every 2-sample subcase skips on lavapipe. - Concurrency: the `GpuMutex` → `targetsMutex` lock order and the read guard re-entering from the constructor's `GuestMemory::Read` under `targetsMutex` were checked by reading only, not with a stress test. - No title was run. ## To get this to a good state - Make `agc_driver_native_color_initial_reuse` run on lavapipe (preferred), or give it an accepted device-limitation skip message, so `check_skips.py` passes. - Optionally address the non-blocking points above. <!-- anyps5-bots job=3030 head=5677a2a2fcd637e856dfa37d75ffbfe70c7330d7 -->
MarcZX10 commented 2026-11-16 16:57:13 +00:00 (Migrated from github.com)

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

  • Reviewed head c94853da9853bbf09a3457ca93f28c9c0f40891d using the prepared description, commit list, diff, manifest, and pinned reader repo_read.py.
  • No commands or tests were run.

Results

Check Result Note
Diff and source review not run Partial review only
Tests not run No local test execution

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.json under reviewed. 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5923965209 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6995#pullrequestreview-5923965209). Originally posted by [MarcZX10](https://github.com/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 - Reviewed head `c94853da9853bbf09a3457ca93f28c9c0f40891d` using the prepared description, commit list, diff, manifest, and pinned reader `repo_read.py`. - No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Diff and source review | not run | Partial review only | | Tests | not run | No local test execution | ## 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.json` under `reviewed`. 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.
MarcZX10 commented 2026-11-19 12:41:11 +00:00 (Migrated from github.com)

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 except Graphics.cpp, whose relevant added lines were read through the pinned reader. files.json was not available as a review document; the reader’s file listing identified the excluded file. No changed files were excluded from inspection.

Results

Check Result Note
Code review passed Changed paths inspected
Tests not run Author reports GPU and host-suite runs
Build not run No local build performed

Findings

Blocking

None.

Non-blocking

  • The description and debt entry explicitly leave multisample scanout/resolve equivalence, unsynchronized CPU stores during commit, and shader-buffer consumers unverified. Keep those limitations visible when describing the scope of this change.

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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5975188058 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6995#pullrequestreview-5975188058). Originally posted by [MarcZX10](https://github.com/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 except `Graphics.cpp`, whose relevant added lines were read through the pinned reader. `files.json` was not available as a review document; the reader’s file listing identified the excluded file. No changed files were excluded from inspection. ## Results | Check | Result | Note | |---|---|---| | Code review | passed | Changed paths inspected | | Tests | not run | Author reports GPU and host-suite runs | | Build | not run | No local build performed | ## Findings ### Blocking None. ### Non-blocking - The description and debt entry explicitly leave multisample scanout/resolve equivalence, unsynchronized CPU stores during commit, and shader-buffer consumers unverified. Keep those limitations visible when describing the scope of this change. ## 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.
MarcZX10 commented 2026-11-21 01:23:25 +00:00 (Migrated from github.com)

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 pinned repo_read.py reader.

Results

Check Result Note
Diff and source audit passed Core publication paths inspected
Build and tests not run Outcomes in the PR description are author-reported
Physical console behavior not run Console equivalence remains unverified

Findings

Blocking

None.

Non-blocking

  • The author reports Windows GPU and WSL2 llvmpipe coverage, but native Linux RTX 4090 confirmation and the quarantined shader-memory/cache executables remain outstanding.
  • Automatic publication intentionally excludes compressed native owners and shader-buffer consumers; the PR description and debt entry document these limits.

Not verified

  • No build or test command was run during this review. The reported build and test outcomes were not independently verified.
  • core/libs/prx/libSceAgcDriver/tests/Graphics.cpp was 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.
  • Native Linux RTX 4090 behavior, physical-console equivalence, quarantined shader-memory/cache executables, and title-level impact were not verified.

To get this to a good state

Nothing is required. Optional: provide the outstanding Linux GPU confirmation and run the quarantined executables when practical.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6001756761 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6995#pullrequestreview-6001756761). Originally posted by [MarcZX10](https://github.com/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 pinned `repo_read.py` reader. ## Results | Check | Result | Note | |---|---|---| | Diff and source audit | passed | Core publication paths inspected | | Build and tests | not run | Outcomes in the PR description are author-reported | | Physical console behavior | not run | Console equivalence remains unverified | ## Findings ### Blocking None. ### Non-blocking - The author reports Windows GPU and WSL2 `llvmpipe` coverage, but native Linux RTX 4090 confirmation and the quarantined shader-memory/cache executables remain outstanding. - Automatic publication intentionally excludes compressed native owners and shader-buffer consumers; the PR description and debt entry document these limits. ## Not verified - No build or test command was run during this review. The reported build and test outcomes were not independently verified. - `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` was 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. - Native Linux RTX 4090 behavior, physical-console equivalence, quarantined shader-memory/cache executables, and title-level impact were not verified. ## To get this to a good state Nothing is required. Optional: provide the outstanding Linux GPU confirmation and run the quarantined executables when practical.
MarcZX10 commented 2026-11-25 06:25:39 +00:00 (Migrated from github.com)

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

Check Result Note
Diff and targeted source review passed Core publication, guard and test paths inspected
Programmatic checks not run No build or tests run
Author-reported test matrix not run Windows GPU and host results not independently verified

Findings

Blocking

None.

Non-blocking

None.

Not verified

I read all changed lines in the prepared diff, including the seven added Graphics.cpp lines through the pinned reader. The files/ 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6052810136 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6995#pullrequestreview-6052810136). Originally posted by [MarcZX10](https://github.com/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 | Check | Result | Note | |---|---|---| | Diff and targeted source review | passed | Core publication, guard and test paths inspected | | Programmatic checks | not run | No build or tests run | | Author-reported test matrix | not run | Windows GPU and host results not independently verified | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified I read all changed lines in the prepared diff, including the seven added `Graphics.cpp` lines through the pinned reader. The `files/` 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.
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!6995
No description provided.