fix(agc): align recorded fast-clear access scopes #4362
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4362"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by krishalivaibhav on 2026-10-12T07:40:37Z.
What
Align the recorded DCC fast-clear access scopes in
Texture.cppwith the other clear paths: add color-attachment read/write and transfer-read access to the pre-clear source scope and post-clear destination scope. The final code diff consists of these two barrier lines only.This is access-scope consistency, not a demonstrated race fix. No original synchronization failure has been reproduced, and no game-unblocking or performance claim is made.
The
agc_driver_recorded_clear_attachmentfixture and its CMake registration have been removed as requested by oneandonlydean, because it passes with both original and proposed masks and does not guard this change.Tested
git diff --checkandpython3 tools/check_conventions.py --base 436e310ddpass after the removal; final diff independently reviewed.a55472cf9f36f2b033b30fddcb010c7dbcfdcb92; full Linux/Windows jobs there were skipped, not successful full builds.The gameplay recording shows a combined local runtime reaching gameplay with later crashes. It does not isolate these masks or establish stability or stock-main compatibility.
Checklist
436e310dwhen preparedImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T07:43:34Z.
The conventions job fails only on PR-template structure: it reports
What,Tested, andChecklistmissing/empty. The checker recognizes###headings (as in.github/pull_request_template.md), while this body uses##. Could you change those three headings to###and make sure the checklist includesDepends on: noneandAI-assisted: yes/no? The test evidence and validation limitation can stay as written.Imported from boykopovar/AnyPS5. Originally posted by krishalivaibhav on 2026-10-12T07:56:26Z.
Gameplay follow-up: the tester reports normal enemy sprites and expected character trails after the local barrier candidate with asynchronous clears. The human validation run exited normally (177 seconds), and the focused GPU clear/LOAD/blend fixture passed 12 iterations on M2.
A subsequent longer/manual recording run exposed a separate blocker:
AGC graphics: subgroup capability 61 is unsupported for shader stage 1(GroupNonUniform in the vertex stage). The process aborted after approximately 64 seconds. This means gameplay is demonstrated, but sustained-session compatibility is not yet established. There is no evidence that screen recording caused the failure. We are investigating whether the shader has live subgroup operations or unnecessary declarations; we will not bypass the device capability check.The uploaded-code PR covers only clear synchronization. The local game build additionally includes experimental macOS runtime and barycentric fallback changes. A gameplay recording has been captured locally and will be attached separately.
Imported from boykopovar/AnyPS5. Originally posted by krishalivaibhav on 2026-10-12T08:01:44Z.
Checked #1359: its production change completes pending copied CPU writes before direct reads. This PR changes recorded fast-clear Vulkan barrier access scopes; it does not use #1359’s additions and has no dependency on it.
The reported overlap is the CMake insertion point after the CMASK test. I moved this PR’s independent test registration after the recorder test block to avoid that insertion collision. The test target, sources, links and behavior are unchanged.
Depends on: noneremains accurate.Imported from boykopovar/AnyPS5. Originally posted by krishalivaibhav on 2026-10-12T08:02:34Z.
https://github.com/user-attachments/assets/7e89df5e-c0bd-43ea-8812-9253eaf908e9
M2, 16 GB RAM, modified local AnyPS5 build. Gameplay works; a later vertex-subgroup crash remains under investigation.
(quality degraded due to compression).
;-;
Imported from boykopovar/AnyPS5. Originally posted by krishalivaibhav on 2026-10-12T08:32:55Z.
This PR is now ready for review. All executed checks passed at
a55472cf9f. The full Linux/Windows jobs are skipped by the pull_request workflow condition, and the workflow requires a collaborator with write access to manually dispatch Build with pr=4362. Could a maintainer start that full build/test run? The focused GPU fixture has passed locally on M2; clean-main cross-platform GPU validation remains pending.Imported from boykopovar/AnyPS5. Originally posted by kr4y4 on 2026-10-12T17:36:38Z.
Windows run, as asked above.
Setup: Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release, CI configure flags, an RTX 4070 Laptop GPU and an Intel Raptor Lake-S iGPU. The head
a55472cf9merged intomain2a5eca11c.agc_driver_recorded_clear_attachmentpasses on both GPUs with--repeat until-fail:3.ctest --timeout 120 --parallel 4): 974 of 974 on the RTX 4070. On the iGPU 973 of 974; the one failure,agc_driver_f32_dot2_rounding, fails the same way onmain(noshaderFloat64, #4528).agc_driver_graphicsfailed once in three on the RTX 4070 withwrite-watched arena contained no host exclusion to test. That check depends on the process's address layout and fails with other changes too (see #4584), so it isn't this PR.Whether the fixture catches the missing access bits:
main'sTexture.cppthe new test also passes on both GPUs. The recorded clear path does run: a temporary print before its barriers fired 12 times per run, once per frame.VK_KHRONOS_VALIDATION_VALIDATE_SYNC=true), logging errors and warnings. There were no messages on either GPU, withmain'sTexture.cppor with this change.TOP_OF_PIPEas its source stage produces 10SYNC-HAZARD-WRITE-AFTER-WRITEin the same run, so the layer does track this path.So on Windows, as far as the layer can tell,
main's barriers already order this clear before the blended draw, and the fixture doesn't reproduce a hazard. I can't say whether MoltenVK behaves differently.Written with AI assistance.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T20:31:51Z.
Thanks for the Windows run. Since the focused fixture passes unchanged on
mainon both GPUs and synchronization validation reports no hazard in either version, the current evidence does not demonstrate that the added barrier fixes a live race on those drivers. The TOP_OF_PIPE control shows the layer can detect an injected hazard, but it does not establish one in the original path. I’d keep this open for a MoltenVK/console-specific reproduction or other evidence before merging.Imported from boykopovar/AnyPS5. Originally posted by krishalivaibhav on 2026-10-12T20:56:56Z.
MoltenVK follow-up: I ran a controlled local A/B on Apple M2, changing only the two access masks in this PR while keeping the other local macOS runtime changes identical. With Vulkan required (no skip),
agc_driver_recorded_clear_attachmentpassed three consecutive runs with the original masks and three with the candidate masks. The candidate source and library were restored afterward.This agrees with the Windows result: the current fixture does not establish a live race or demonstrate that these masks caused the gameplay improvement. The earlier gameplay recording used additional local runtime/graphics changes and should not be treated as an isolated reproduction of this PR.
The draw path also records a separate transfer-write to attachment-read/write dependency before a new render pass, which may explain the passing clear-to-LOAD/blend result. I am checking the prior-draw-to-clear dependency and whether a stronger fixture or a controlled gameplay A/B can reproduce a missing dependency. Until then, I agree that merging this as a demonstrated race fix would be premature.
AI-assisted: yes. These are local focused test results, not a clean-main full-suite run.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T21:22:23Z.
The runs above settle the test:
agc_driver_recorded_clear_attachmentpasses onmainon Windows and on MoltenVK, so it doesn't guard the change. Please drop it.The two barrier lines stand without it: the recorded DCC fast clear in
Texture.cppis the one clear path there whose barriers lack the attachment read/write and transfer read access the others carry. With the test removed and the description saying that instead of claiming a fixed race, I'll build and merge it.Imported from boykopovar/AnyPS5. Originally posted by krishalivaibhav on 2026-10-12T21:28:01Z.
Done at
0b54425e3fe0b389007c429133e89eac95389645: removed the fixture and its CMake registration. The PR net diff is now only the twoTexture.cppaccess-mask lines. Title/body describe access-scope consistency, with no fixed-race, game-unblocking or performance claim.git diff --checkand conventions passed; independent review checked the isolated final diff and stage/access compatibility. The revised build is pending your offered run. Thank you for the clarification.AI-assisted: yes.