Skip to content

feat(agc): preserve initial native multisample color contents - #6973

Open
Amoenus wants to merge 9 commits into
boykopovar:mainfrom
Amoenus:codex/feat-msaa-initial-samples-main402
Open

Amoenus wants to merge 9 commits into
boykopovar:mainfrom
Amoenus:codex/feat-msaa-initial-samples-main402

Conversation

@Amoenus

@Amoenus Amoenus commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What

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 samples it does not cover. The regression checks untouched samples through the existing guest MIMG load path.

Pending prerequisite: #6971, exact head f65cecddabd9bf40a49960b48873ca938754c1d6, adapted at 996316cdfbf3bd5b787a9bd7f4740142c9edb17c originally prepared on main 8b3e39832a, with MarcZX100's authorship preserved. Former prerequisites are merged. This qualifies the adapted dependency composition; standalone #6971 is unchanged.

The #8847 composition retains twin views, per-format resolve passes and cleanup. Initialization chooses storage flags before the twin capability query, which uses those flags plus MUTABLE_FORMAT, matching the intended allocation. Vulkan defines the query usage/flags as corresponding to image creation (API contract); EXTENDED_USAGE permits compatible views to supply usage support (image creation). No new console format semantics.

Related: #6480 and PPSA99902 bring-up discussion #4443. Preserve upstream's proven undrawn/HTILE clears independently of color bytes; unresolved metadata import still throws. General metadata import and completion-safe guest publication are unfinished; no native readback getter or fresh title improvement is included.

Adapted prerequisite refreshed with current main at 02e02f29185ba5bf06fda4546766cc21cc345012, retaining MarcZX100's original commit/authorship. #7948 is now merged; its native-owner FMASK behavior and regressions remain intact.

Tested

FMASK merge refresh, 2026-10-22: head d09283a1299a668b96cfac164d3bc9af0f75ff0a, main 3bbd2321de9a4d7e83b21ad6d5964c0404421c49. Refreshed adapted #6971 first, then the owned stack parent-first after #7948 merged. Every previous published head remains an ancestor; those heads are also archived in our fork. Pending #6971 and #7002's #6498 dependency remain explicit.

PR Refreshed head Passing processes
#6973 d09283a129 11
#6987 8e4373d3aa 6
#6989 a69f11aabe 4
#6995 795585e15c 4
#7002 5cfa3b21e2 20

Across the five exact heads: 45 passing processes (1 CPU +44 verified physical GPU). Literal main 3bbd2321de passes CPU graphics plus FMASK, native vertex-input and original sRGB-twin groups on both GPUs (7 processes). Candidate-only publication/initialization modes absent from main are not counted as main passes. All four child topic deltas retain exactly the same added/removed code lines; root fixture helpers already absorbed by main are shared. Conflicts retain both independent fixture sections and both required includes. No guard or capability change.

Actual groups here: agc_driver_graphics x1, agc_driver_native_color_initial x6, agc_driver_native_fmask x2, agc_driver_multisample_srgb_twin x2.

Windows11 Enterprise26200, WinLibs GCC15.2r7/UCRT Release, SPIRV-Tools enabled. NVIDIA RTX5080 (610.62 /32.0.16.1062), AMD Radeon Graphics (32.0.21036.18). Real selected devices and Khronos1.4.363 layer verified per GPU fixture. Required Vulkan, no application shader cache/journal, verbose serial CTest,30s bounds; driver caches uncontrolled. Zero VUIDs, validation errors/warnings, whole-test skips/timeouts. Affected libraries and actual fixture executables rebuild at each head. Prior full-runtime builds, controls and title runs retain their original pins; this mechanical refresh claims no fresh full suite, gameplay or FPS result.

Cppcheck then clang-tidy of the resolved MultisampleTarget and SampleMultisampleTarget units at final tip completes in39.29 analyzer seconds. Four advisories (batch-pointer, allocation, two header pointer-size reports), all in seven-line contexts already on this main; no parser/configuration failure, timeout or automatic fix. No static-clean claim. An initial orchestration invocation built successfully but selected three nonexistent test names; it stopped before tests. Only corrected, registered real-fixture runs are counted above. Conventions and whitespace pass.

Previous main8499 qualification is preserved at its exact source pins in the prior description/edit history and archived branch; it is not relabeled as current-head evidence. Earlier independent controls/peer evidence remain below.

Remaining review gate: maintainer comment6350560582 requests #8223 first, then applying its claimed/write-since-use retirement check before synchronization/publication, with one regression for each cause. That behavior is not in this refresh or its counts; this stack is not ready for its final gate until addressed.

Prior qualification at older pins and peer reports

Prior qualification, 2026-10-22: main 8b3e39832af85f404c6195418d11b3e1ebd1924d, this head 9290696549855f4a54346e4c2ca5105b085ba60a. Parent-first stack #6973 -> #6987 -> #6989 -> #6995 -> #7002 retains pending #6971 at its root.

Source Head Passing processes
Literal main 8b3e39832a 11 (3 CPU +8 GPU)
#6973 9290696549 23
#6987 fb76b9823c 16
#6989 139ca64a4a 10
#6995 470e4e0c81 10
#7002 47613d5d23 26

Windows11 Enterprise26200, WinLibs GCC15.2r7/UCRT Release, SPIRV-Tools enabled. NVIDIA GeForce RTX5080 10de:2c02, 610.62 /32.0.16.1062; AMD Radeon(TM) Graphics 1002:13c0, 32.0.21036.18. Actual devices and real execution sources verified. Required Vulkan, ANYPS5_NO_SHADER_CACHE=1, APS5_NO_PIPELINE_JOURNAL=1, loaded Khronos1.4.363, verbose serial CTest, 30s timeout. Driver caches uncontrolled.

This head's groups (counts include both GPUs; CPU groups identified separately): agc_driver_graphics x1; agc_write_tracking x1; guest_memory x1; agc_driver_multisample_readback x2; agc_driver_sample_multisample_target x2; agc_driver_multisample_retirement x2; agc_driver_multisample_srgb_twin x2; agc_driver_native_color_initial x6; agc_driver_msaa_dcc_recreate_layout x6.

The shared current-main/control matrix in #6973 covers all five heads: 96 passes (6 CPU +90 GPU), plus six expected fixture-only control failures. Main runs readback, ordinary sampling, retirement and its original twin fixture on both GPUs, plus CPU graphics/write-tracking/guest-memory. New initial-content and DCC-recreation groups run 3/3 per GPU on #6973.

Changed final-case expectation after #8847: literal main's twin fixture passes on both GPUs, including its creation of a separate unrelated-format image. Prepared initializer a877ad4cf4 instead reaches the existing CPU-read/native-owner refusal in that final case: guest bytes do not contain the newest host samples. The refresh retains that refusal, documents it in debt, and changes only that final case to require the specific overlap refusal, unchanged image/view/owner and unchanged zero samples. Twin-sharing and fill checks remain. The identical revised fixture on main alone fails the missing-refusal assertion 3/3 per GPU. This is an explicit unsupported-path expectation, not an unchanged-fixture pass or general live-alias coherence. Maintained finding in #6480.

Across102 qualified processes: zero VUIDs, validation errors/warnings, whole-test skips or timeouts; maximum 6.094s. Capability-specific subcases/refusals retain their fixture scope; this is not a claim that every format/sample count is available.

All runtime libraries and relinker build at the identical final tip #7002 (47613d5d23) in the warm N build, WinLibs Release with SPIRV-Tools enabled. Every listed head separately builds its AGC driver and selected real execution targets in E with SPIRV-Tools enabled. The duplicate full-runtime E build was intentionally stopped to reuse the warm runtime build; no success is claimed for that interrupted attempt. No full-default all-test-executables build, full-suite result, fresh Linux/Intel/macOS/title replay, console-equivalence or FPS claim. Earlier grid/depth-reference failures remain historical; this focused rebase does not retest them.

Cppcheck2.20 then clang-tidy23.1.3 on resolved MultisampleTarget.cpp and revised MultisampleSrgbTwin.cpp at final tip: 4 advisories in 28.069s analyzer time. All four diagnostic contexts match main or the prior published tip. The allocation advisory follows an existing throwing Require; the batch-pointer and sizeof-pointer advisories retain prior triage. No new defect was established in the resolved source or revised assertion. No parser/configuration errors, timeouts, automatic fixes or static-clean claim. Unchanged child production patches retain their prior analysis at its stated pins.

Conventions/title/template and whitespace pass. Source merges cleanly with newer main b7d1d47a5f9f32c9c388ad8d47a0055a90ae6e33; its merged #7371 and barycentric-strip work do not change these topic deltas. That newer composition is source-checked, not runtime-tested here. Reproduce the named groups with ctest --test-dir <build> -V -j1 --timeout 30 -R <exact-group-regex> and the settings above. Maintainer-triggered CI is separate.

External Intel validation boundary

@savvaniss tested older head b64742f863x on Intel UHD770 (8086:a780,32.0.101.7088) and AMD RX9070XT (32.0.31041.1004), Windows11 Pro26300. Intel passes27/28 multisample groups; the upload/readback case fails on R8_UINT (format13), byte1 expected0x1f/actual0. AMD passes all28. They relate the remaining Intel boundary to existing #6957: sampling a GENERAL-layout image immediately after storage writes; their read-only-layout/barrier experiment passes both GPUs. This is their evidence on that pin, not a new local Intel/current-head result. No driver-specific fallback is included; a descriptor-layout change also needs the production #6987 caller transition. Current local hardware remains NVIDIA/AMD.

Earlier refresh repetitions are consolidated here. Older qualification remains at its stated pins in the review/edit history; the previous published source is preserved. It is not counted as current-head validation.

Checklist

@MarcZX10

MarcZX10 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

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 MultisampleTarget.cpp and the sampled Texture view path, including your new initial-sample upload. #6971 is already waiting for #6635 to land per its author’s requested order. A source-level git merge-tree check against #6973 confirms content conflicts in MultisampleTarget.hpp and MultisampleTarget.cpp; I have not resolved or validated the combined implementation. I will keep #6971 draft and verify that the layout tracking preserves this initializer/upload path before marking it ready. Please let me know if you prefer a specific merge order for the two changes.

@Amoenus

Amoenus commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Newer-composition qualification, 2026-10-20 UTC: the refreshed main e25333e39a composition now retains an AMD numeric recreation failure. The original 419ad899c6/main aa1b1bfcea qualification below stays valid at its recorded pin.

Matched #6973/main parent 73a96cb5df and snapshot head 6185950ed7, then rebuilt/restored the snapshot head. AlphaToCoverage.cpp is byte-identical in both. In every arm, agc_driver_msaa_dcc_recreate_layout passes 3/3 on RTX 5080 and fails 3/3 on Radeon Graphics at a sampled DCC target recreated with another pipe-bank XOR did not resolve its new samples. Earlier per-sample probes complete; the failure is in the final resolved-image comparison. All arms have zero VUIDs/validation errors/warnings, skips or timeouts. The two production layout calls remain intact.

The separate 4x DCC-clear group also passes 3/3 on NVIDIA and fails 3/3 on AMD in each arm at #7936's existing undrawn-samples/channels/scissor assertion. The two assertions are distinct; a shared cause is unconfirmed. Actual 10de:2c02/610.62 and 1002:13c0/32.0.21036.18, Windows 11 Enterprise 26200; loaded Khronos 1.4.363, Vulkan required, app shader cache/journal disabled, driver caches/implicit layers uncontrolled.

#6987 is now pushed at 6185950ed7 with 33 positive focused checks and the three parent-reproduced AMD recreation failures disclosed. Remaining #6989/#6995/#7002 refreshes are prepared but not yet qualified/pushed; no all-GPU numeric pass is claimed for the newer stack. AI-assisted: yes (Codex).

Original 419ad89/main-aa qualification, removal controls and manual-oracle boundary

@oneandonlydean @MarcZX10
Recreation-layout review correction and qualification

Review correction at 419ad899c6, based on main aa1b1bfcea (2026-10-20). This incorporates main while retaining #6971 authorship and the previous merge resolutions. It is a main merge, not a claim that the dependency stack was independently rebased. The only production follow-up is ensureGeneralLayout() before the recreation clear and PrepareForColorAttachment(use) on its acquire-return path, as requested in review. The clear obeys the Vulkan image-layout requirement.

  • Manual validation-layer regression (agc_driver_msaa_dcc_recreate_layout): render, sample drawn/untouched native samples, change DCC clear metadata and pipe-bank XOR, render/sample again, then resolve and compare every pixel/channel. CTest treats logged Vulkan validation errors as a failure. The distinguishing layout-failure oracle requires a loaded Khronos validation layer; CI without that layer does not exercise that oracle.
  • Identical regression without the two production calls (2ca5bcc28f): 3/3 expected failures per physical GPU, each with VUID-vkCmdDispatch-imageLayout-00344 and VUID-vkCmdDraw-None-09600, despite successful scalar checks. Fixed: 3/3 passes per GPU, no validation errors/warnings.
  • Literal-main production aa1b1bfcea plus the identical new test body: NVIDIA 3/3 passes; AMD 3/3 resolved-output assertion failures, no validation errors/warnings. That separate AMD baseline failure is absent in the dependency composition before this follow-up; the two calls alone are not credited for resolving it.
  • Full Windows default build passes (1244.860 s), explicit libs/relinker succeeds; enabling the real depth-storage-reuse fixture also passes an incremental full build (12.504 s). 54 physical-GPU checks plus 9 CPU/mock checks pass. Nine GPU groups repeated 3x on each adapter: recreation layout, native-color initialization, native multisample sampling/vertex input/retirement/pass order, depth-storage dispatch/reuse, and multisample guest access. CPU/mock groups agc_driver_msaa_layout, agc_driver_graphics, agc_shader_memory each pass 3x. An initial depth-storage-reuse skip-stub attempt is excluded and replaced by the real fixture; it is not counted as a pass.
  • Actual adapters verified: NVIDIA RTX 5080 10de:2c02, driver 610.62/32.0.16.1062; AMD Radeon(TM) Graphics 1002:13c0, 32.0.21036.18; Windows 11 Enterprise 26200. Required Vulkan, loaded Khronos 1.4.363, application shader cache and pipeline journal disabled, serial verbose CTest with 30 s bounds. Final selected matrix has zero VUIDs, validation errors/warnings, whole-test skips or timeouts. Driver caches uncontrolled; loader notices retained.
  • Cppcheck 2.20 then clang-tidy 23.1.3, two actual compilation-database translation units: 23.914 s analyzer time, no parser/configuration failures/timeouts. One Cppcheck conditional-batch warning and one header sizeof advisory (emitted in both tidy runs) remain. Both function bodies are byte-identical on main and this head: make_unique constructs the batch on the branch that dereferences it or throws; the shader-module range divides a byte count into uint32 elements before pointer addition. No suppressions, automatic fixes, or static-clean claim.
  • Conventions and whitespace pass. Source merges cleanly with checked newer main 73b6a4cc71; this is not runtime validation of that newer merge. Dependencies remain feat(agc): upload individual multisample image samples #6965 and fix(agc): sample multisampled targets in read-only layout #6971 (feat(agc): add fragment-preserving R_X and Z_X layouts #6588 transitive); their authorship and agreed order are preserved. Fresh maintainer-dispatched full Linux/Windows CI is requested. No fresh title-startup/FPS, Linux, Intel, console-equivalence or full-suite claim.

Reproduce: ctest --test-dir <build> -V -R '^agc_driver_msaa_dcc_recreate_layout$' with the validation settings above. AI-assisted: yes (Codex); author responsible.

Previous upstream-head qualification at cafd4f7

@MarcZX10 #6973 is refreshed at cafd4f749f on main 1e774a3b22, retaining exact #6965 9861b0d775 and your original #6971 f65cecddab ancestry/authorship. Your sampled-layout/usage work remains a declared prerequisite: #6971, then this initializer; #6588 is transitive through #6965.

The two new-main conflicts were adjacent method insertions. Source comparison preserves our initializer/import/ownership/layout bodies and main's metadata-fill tracking methods. The new refill flow retains your existing return-to-GENERAL transition before clearing. Original initializer fixtures are unchanged. No separate readback-layout work was taken into this refresh; your three-file follow-up and the reporter's offered Intel rerun remain separate.

Full Windows builds pass. The new candidate has72 focused passes plus the same nine AMD DCC assertion failures independently reproduced on literal main1e774 (#7936); all selected logs have zero VUID/errors/warnings or unsupported/skipped/timed-out cases. After baseline comparison, the exact candidate rebuilds and nine restoration checks pass. The PR body records source pins, actual GPUs, current main comparisons and the inherited analyzer advisory. Earlier initializer-negative controls retain their original pins. This validates the adapted composition; no local Intel, fresh title/FPS, current-head Linux or full-suite result. AI-assisted: yes (Codex); author responsible.

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6628 core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp L954
PR 9186 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp L768-769
PR 9260 core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp L230

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.

Pull request Shared files not compared
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 4448 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 4449 docs/dev/debt/libSceAgcDriver.md
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5431 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6169 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6187 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6194 docs/dev/debt/libSceAgcDriver.md
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6202 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6209 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6273 docs/dev/debt/libSceAgcDriver.md
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6292 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6501 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6539 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6548 docs/dev/debt/libSceAgcDriver.md
PR 6549 docs/dev/debt/libSceAgcDriver.md
PR 6615 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6741 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 6788 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6804 docs/dev/debt/libSceAgcDriver.md
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6867 docs/dev/debt/libSceAgcDriver.md
PR 6868 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6960 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6977 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7275 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7457 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7604 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/MultisampleRetirement.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7705 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7803 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampleMultisampleTarget.cpp
docs/dev/debt/libSceAgcDriver.md
PR 8246 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 8281 docs/dev/debt/libSceAgcDriver.md
PR 8365 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 8395 docs/dev/debt/libSceAgcDriver.md
PR 8424 docs/dev/debt/libSceAgcDriver.md
PR 8484 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 8527 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 8542 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 8552 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8592 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 8672 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 8998 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/MultisampleTarget.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 9020 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 9077 docs/dev/debt/libSceAgcDriver.md
PR 9335 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 9348 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 9387 docs/dev/debt/libSceAgcDriver.md
PR 9412 docs/dev/debt/libSceAgcDriver.md
PR 9431 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9432 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9508 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/execution/MultisampleRetirement.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9592 docs/dev/debt/libSceAgcDriver.md
PR 9672 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9673 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9674 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9675 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9676 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9748 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/debt/libSceAgcDriver.md
PR 9856 docs/dev/debt/libSceAgcDriver.md
PR 9891 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9892 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9893 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9895 core/libs/prx/libSceAgcDriver/Graphics/include/Texture.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md

@akkadbakkad89

Copy link
Copy Markdown
Contributor

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:

Test Result
agc_driver_native_color_initial pass
agc_driver_msaa_layout pass
agc_driver_multisample_readback_uint8 pass
agc_driver_multisample_readback_uint16 pass
agc_driver_multisample_readback_uint64 pass
agc_driver_multisample_readback_uint128 pass
agc_driver_multisample_readback_depth pass
agc_driver_multisample_readback_upload pass
agc_driver_sample_multisample_target pass
agc_driver_sample_mask_multisample pass
agc_driver_native_multisample_depth pass
agc_driver_native_depth_retirement / clears / clear_refusals pass

All pass on Ampere — the guest-initial-content path into native MSAA color holds.

@savvaniss

Copy link
Copy Markdown
Contributor

Intel and AMD Windows data for head 82bfd5250. It no longer merges into main: tests/Graphics.cpp conflicts with 5f61879a9. So I ran the head as published. It predates #6452, so agc_driver_gpu_indirect_arguments_misaligned_writer_ahead doesn't build on Windows; everything else built.

Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, ANYPS5_NO_SHADER_CACHE=1, serial CTest. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31041.1004, with VkCache emptied first. All 27 multisample tests of this head, agc_driver_graphics included:

Test UHD 770 RX 9070 XT
agc_driver_sample_multisample_target (#6957) pass ×5 pass ×5
agc_driver_multisampled_pass_order fails 4 of 4: initial multisample color footprint is not implemented fails 4 of 4, same
agc_driver_multisample_readback_upload fails 4 of 4: readback mismatch: format=13 first=0 byte=1 expected=0x1f actual=0x00 pass 8 of 8
the other 24 pass ×5 pass ×5

multisampled_pass_order comes from #6175 (f52e3f5). It stops at the refusal that 8c639dc adds in MultisampleTarget.cpp:382. Neither is on main, so the two only meet in this composition. multisample_readback_upload fails only on the UHD 770; the RTX 3070 run above passes it.

AI-assisted: yes (Claude Code)

@blawesom

Copy link
Copy Markdown
Contributor

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 main re-anchors the whole series; they should rebase onto it rather than onto main individually.

The rebase (22 commits, one resolved empty and dropped — its content was already carried by an earlier resolution) is on blawesom:rebase/6973 (1c33df60d): the conflicted commits were reconciled against main's newer allocate()/Allocation/makeStorable architecture — Allocation now carries the bytes your reclaim needs, and MultisampleTarget.cpp/.hpp end up byte-identical to your head. One intermediate commit in the series does not build on its own (the dca54b2 state, also true of your own integration history — it self-heals two commits later), so per-commit builds will show that one red.

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds; conventions pass; full suite 1333/1336 — beyond the known main regression (agc_driver_tessellation segfault, #4727), two failures, and I checked them against your original head as a control: both fail identically there (agc_driver_multisampled_pass_order throws "initial multisample color footprint is not implemented" in 0.01 s; agc_driver_depth_storage_dispatch fails too), so they are the series' own on this device rather than rebase artifacts — possibly resolved by the upper stack PRs, but the base alone carries them.

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/6973
git checkout <your branch>
git merge --ff-only FETCH_HEAD

@Amoenus
Amoenus force-pushed the codex/feat-msaa-initial-samples-main402 branch from 82bfd52 to b64742f Compare October 17, 2026 09:25
@Amoenus

Amoenus commented Oct 17, 2026

Copy link
Copy Markdown
Contributor Author

@blawesom thanks for the rebase handoff; I adopted it, reviewed the range diff and incorporated main through ef674f5af3e4d0fe44fda10e46d36ead2c262c0e. The refreshed head is b64742f8679010aba1209c01f1155f91f27ec860.

@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.

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 17, 2026
@savvaniss

Copy link
Copy Markdown
Contributor

Retest of head b64742f86 on the Intel UHD 770, with the cause of the remaining upload failure.

Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, ANYPS5_NO_SHADER_CACHE=1, serial CTest. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31041.1004, with VkCache emptied first. The head is tested as published: it conflicts with main 23f142350 in SampleMultisampleTarget.cpp.

28 multisample tests, ×3 UHD 770 RX 9070 XT
b64742f86 27 pass; agc_driver_multisample_readback_upload fails: readback mismatch: format=13 first=0 byte=1 expected=0x1f actual=0x00 28 pass

agc_driver_multisampled_pass_order and agc_driver_depth_storage_dispatch now pass on both GPUs.

The upload failure is #6957 on the fixture's verification read. CheckReadback runs DispatchMultisampleReadback, which binds the array view as a sampled image in GENERAL. It runs right after DispatchMultisampleImage has written the same image with storage stores, also in GENERAL. This is the pattern this driver gets wrong. I made a local experiment, not a proposal: the readback descriptor uses SHADER_READ_ONLY_OPTIMAL (DEPTH_STENCIL_READ_ONLY_OPTIMAL for D32), and CheckReadback moves the image to that layout before the dispatch and back to GENERAL after it. With that change, agc_driver_multisample_readback_upload passes 3 of 3 on the UHD 770, and all seven agc_driver_multisample_readback* tests pass 3 of 3 on both GPUs. The diff is below.

At this head, DispatchMultisampleReadback has no caller outside tests. #6987 (8e8afdc68) adds one at MultisampleTarget.cpp:341, which samples a snapshot filled by vkCmdCopyImage in GENERAL. At that head the 30 multisample tests pass 3 of 3 on the UHD 770, except the same upload test. So the copy-filled snapshot reads correctly on this driver; the failure needs storage stores into the sampled image itself. The descriptor change in the diff would also need #6987's caller to move its snapshot to the read-only layout.

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)

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@Amoenus a heads-up for the native colour publish stack (#6973 → #6987 → #6989 → #6995 → #7002). main's MSAA sample-order work, most recently #6683, changed the code this stack builds on, so the conflicts in Texture.hpp and MultisampleTarget.cpp need rework, not just a text merge:

  • The depth-image Texture constructor on main now takes owner and usage (Texture.hpp:66). feat(agc): preserve initial native multisample color contents #6973 adds a second overload with an imageLayout argument (:67). Please fold the layout into main's constructor or add it there, without a parallel overload.
  • MultisampleTarget now creates its image with allocate(usage, orderFlags) (MultisampleTarget.cpp:105), so the image can also be viewed in the sample-order format, and it adds OrderView() (:295). feat(agc): preserve initial native multisample color contents #6973's PrepareForColorAttachment() (:335) sits in the same place and calls allocate(usage, flags). It has to keep orderFlags and work alongside OrderView().

Since every PR above #6973 inherits those hunks, the order is: rework #6973 on current main first, then rebase #6987, #6989, #6995 and #7002 on it in turn. We'll review each one as it lands, starting with #6973.

@Amoenus
Amoenus force-pushed the codex/feat-msaa-initial-samples-main402 branch from 419ad89 to 549983f Compare October 21, 2026 14:12
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 21, 2026
@Amoenus

Amoenus commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Refreshed after merged #8847: #6973 is now 9290696549 on main 8b3e39832a. Its description holds the shared five-head qualification: 96 passes (6 CPU +90 GPU), six expected fixture-only control failures, and the exact source/device/setup scope. The complete runtime libraries and relinker build at final tip 47613d5d23; each head builds and runs its selected real AGC fixtures.

Explicit fixture change: the final unrelated-format/live-owner case now requires the existing native-owner refusal and preservation of its image/view/owner and zero samples. The actual sRGB twin-sharing/fill cases remain required. This is not a claim that the old fixture passed unchanged or that general live image-alias coherence is implemented. Finding and controls in #6480.

#6971 remains pending at f65cecddab; the fork adaptation 996316cdfb preserves MarcZX100's authorship. This is validation of the declared adapted stack, not the standalone prerequisite branch. #9533 follows #6973 and now-merged #7371 by agreement with EagleBearerYS.

The four child production patches retain identical changed-line sequences. All conventions checks pass; four resolved-source analyzer advisories retain matching main/prior contexts. No new title replay, FPS or current Intel/Linux/macOS result. Older qualification remains at its original pins and archived fork sources. AI-assisted maintenance: yes.

@EagleBearerYS

Copy link
Copy Markdown
Contributor

@Amoenus a merge-order note for this stack (#6973 → #6987 → #6989 → #6995 → #7002) and #9533, which has #9717 and #9742 stacked on it. They meet in MultisampleTarget.cpp, in the constructor and in Recreate, through #6973's lines; the four PRs above it conflict with #9533 only there.

#9533 goes after #6973 and rebases over it, as well as after #7371 as agreed.

@Amoenus

Amoenus commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author

@EagleBearerYS Agreed: #9533 should follow #6973 as well as #7371. I checked the constructor and Recreate against our published #6973 head 77dd406ddb. The constructor can import guest sample contents, so that path must leave cleared empty; only the known-clear/DCC/CMASK branches can supply clear provenance. Please retain ensureGeneralLayout() together with your cleared and drawn assignments in Recreate.

The four child PRs inherit that constructor change; they do not need separate implementations of the composition. This is source review of the proposed ordering, not a combined runtime result. Thanks for keeping the attribution and dependencies explicit.

Refresh is now published at 9290696549 on main 8b3e39832a, retaining that constructor provenance distinction and ensureGeneralLayout(). #8847's twin views/per-format resolve passes are retained. The shared current qualification and explicit unrelated-alias refusal expectation are in this PR's updated description; #7371 has now merged.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 22, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

@Amoenus a heads-up for this stack: #8847 merged a few minutes ago (8b3e398) and also changes Graphics/src/MultisampleTarget.cpp, so #6973 through #7002 no longer merge cleanly. git merge-tree against current main shows two hunks, both from #6973:

The four PRs above #6973 only conflict through #6973's lines, so rebasing #6973 and replaying the others should be enough. Once the stack is up again, I'll run the full CI on the new heads and then the stack gate.

MarcZX100 and others added 5 commits October 22, 2026 16:38
Consolidate the previously published initializer and its fault/regression coverage onto the refreshed layout/uploader foundations and the credited boykopovar#6971 dependency composition. Preserve the full snapshot and supported uniform/nonuniform paths, restrict borrowed sampled-view usage and keep current main ownership/device/CMASK handling. Original initializer and test work is preserved at published8068 and its archived history; boykopovar#6971 f65cecd remains an original ancestor. Written with AI assistance.
@Amoenus
Amoenus force-pushed the codex/feat-msaa-initial-samples-main402 branch from 77dd406 to 9290696 Compare October 22, 2026 14:33
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 22, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 22, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

@Amoenus your #7948 (expanded FMASK for native owners) merged today, and the whole stack (#6973 → #6987 → #6989 → #6995 → #7002) now conflicts with main. I didn't resolve it for you because part of it needs your judgment, so here is what I see against main a0900b9.

What conflicts textually

Why it isn't a mechanical union

  • About 100 lines of feat(agc): expose expanded FMASK for tracked native owners #7948's FMASK code merged in automatically in MultisampleTarget.cpp, in the areas the stack also reworks: around NoteColorMetadataFill, and new members in the MultisampleTarget class's public and private sections. Git accepts it, but whether the FMASK paths still hold with the stack's target layout and readback changes is a question only you can answer.
  • In the test file, both sides add fixtures and argv cases at the same spot, so the order and shared helpers need a decision, not just concatenation.

Order: rebase #6973 onto main first, then each PR onto the one below it, as the stack is built. #6987 to #7002 each contain the PR below them, so the test-file blocks should shrink to the cases each one adds. Once the rebased heads are up, we'll review the delta against #7948, run CI and the gate the stack still needs. We'll gate the rebased #7002 head.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@Amoenus one more thing for the rebase you're doing: we'd like to merge #8223 first, so the stack can pick up its owner retirement in the same pass.

#8223 retires a resident multisampled colour owner when its guest memory was claimed by something else (a single-sample draw or a depth surface over it) or written since the owner's last stampUse. Today it checks that only inside RequireNoMultisampleColorTarget. The stack's read path (SynchronizeMultisampleTargetRead / PublishMultisampleTargetColor) publishes the owner's colour into guest memory, and its only staleness check compares the guest bytes with a snapshot taken in the same call, so it can't see an earlier claim or write. Composed as they are, a claimed or overwritten owner would either publish stale colour over the newer data or throw "guest color changed".

Could you apply the same check before publishing: if the owner's use is claimed, or its memory was written since stampUse, retire it instead of publishing? A test row for each case (claimed, then written) on the publish path would cover it.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 22, 2026
@Amoenus

Amoenus commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author

@oneandonlydean Provisional owner-retirement adaptation is prepared on the fork, building on @savvaniss's #8223 (263ec0a2ba). The published five-PR stack is unchanged and still waits for #8223 first; this is not the final-gate head.

Composed candidate e23d5c5d9a combines frozen main eb8dcfebaa015115bc054cfb37001a334b8e4f61, our published #7002 head 5cfa3b21e2, and exact #8223 head 263ec0a2ba. Prerequisite commits/authorship are preserved. Our changes after the dependency composition:

  • Reuse fix(agc): retire a multisampled color target the title wrote over #8223's claimed/write-since-use proof before the publication snapshot and again before writing guest color. A proved reused owner retires without publishing stale samples; CPU synchronization reaches the same check. Writes that invalidate an in-progress snapshot retain its strict refusal.
  • The merge needed an additional ordering correction: a replacement multisample binding must claim overlapping owners before our initialization read checks. Without it, fix(agc): retire a multisampled color target the title wrote over #8223's wide-2x to narrow-4x case stops at our initialization guard. This is a composition gap, not a failure attributed to fix(agc): retire a multisampled color target the title wrote over #8223 alone. Guards are retained.
  • Separate live/claimed/written cases exercise explicit publication and CPU reads. On the test-only composed baseline a51c8828bd, all 8 reused-owner executions fail for the intended reasons: claimed owners overwrite guest data; written owners throw instead of retiring. The 4 live controls pass.
  • On e23d5c5d9a, 44/44 GPU processes pass: the six new modes 3/3 per GPU, plus native-FMASK, the broader multisample-target fixture and existing explicit/CPU publication groups once per GPU. Actual RTX5080 and Radeon identities and the inserted validation layer verified; zero validation warnings/errors/VUIDs, skips or timeouts; every process under2.01s. The prerequisite's broader retirement cases run too.

Windows11 Enterprise26200, WinLibs GCC15.2r7/UCRT Release; NVIDIA GeForce RTX5080/610.62 and AMD Radeon(TM) Graphics/32.0.21036.18. Verbose serial CTest,30s limit, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, APS5_NO_PIPELINE_JOURNAL=1, Khronos1.4.363. Full native-library/affected fixture builds pass. Conventions pass. Scoped Cppcheck/clang-tidy completed with advisories in unchanged contexts, no configuration failure or timeout.

These are composed-fork comparisons, not unchanged-main, title-playability or console-equivalence claims. After #8223 merges, I will carry the needed changes into the appropriate existing stack PRs parent-first, rerun affected checks and report the exact head for the requested final gate. No changes to #8223's branch.

Title follow-up: the 13763c6097 integration, on main24c6cc33f0 with #8223 and this adaptation, now reaches controlled Sonic daytime gameplay: movement,12 rings and tutorial interaction. Both SRT verifiers/draw profiling are unset. The900s capped run has no driver/guest-wait failure,14 disclosed validation warnings and0 VUIDs/errors. Full scope and source/runtime evidence. This is composed-title validation, not proof of this fix's isolated effect; the published stack still awaits #8223.

AI-assisted implementation/validation/reporting: yes (Codex); author responsible.

Earlier published-stack FMASK refresh and source-pinned validation

@oneandonlydean The parent-first FMASK refresh is pushed for all five heads, through #7002 5cfa3b21e2. Both includes and the independent fixture/argv paths are retained. The existing native-FMASK regression passes on every refreshed head alongside that head’s affected initialization/readback/publication modes, on actual RTX5080 and Radeon hardware with Khronos validation loaded. Across the exact five heads:45 passes; literal main3bbd2321de:7 reference passes. Zero VUIDs, validation errors/warnings, skips or timeouts. Current descriptions hold the pins and scope; unchanged historical controls retain their old pins. Published history is preserved for downstream users.

Agreed on #8223 first. I added it to this root’s dependency line and recorded your claimed/write-since-stamp review item throughout the stack. That behavior is not covered by the refresh above, so I am not presenting #7002 as ready for the final gate yet. Once #8223 lands, I’ll carry its owner-retirement check into the synchronization/publication path and add separate claimed-owner and written-owner regressions, preserving the still-live-owner controls. Then I’ll refresh parent-first and report the exact gated head. No changes to your #8223 branch.

AI-assisted implementation/validation/reporting:yes (Codex); author responsible.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build docs shader core/shader

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants