fix(agc): preserve authoritative stencil plane ownership #19428
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19428"
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 IvanFogel on 2026-11-13T09:20:43Z.
What
November 22, after the cross-identity depth retirement change. Standalone
dff79672b07eincludes main70cca973b49fand preserves the stencil patch in all four files. It passed 30/30 (24 real Vulkan, 6 host) focused executions. Main passed all 16/16 (10 real Vulkan, 6 host) shared controls. The selection covers stencil ownership transfer, clear, copy failure, CPU writes, read-only owners and retirement across depth identities. Clear and failed-copy cases were also repeated with guest write watching disabled.A private composition
167ff94d5e0fwith the current #15058,f4a1b9408504, passed 31/31 (24 real Vulkan, 7 host). Its owner-transfer resolution retains the peer's depth snapshot at the compatible-owner handoff, including a newly cleared destination, and preserves stencil publication after successful copy work. The three color-memo claim cases reported failing on the previous peer head (disabled, enabled and verify) passed on main, standalone and this composition. Coverage also includes the peer's committed-memory and guarded multisample-owner checks. The four compared shared-depth cases require the Windows direct-mapping backend. The earlier Win64 Wine result below retains its original revision. The current combination still needs native Windows GPU qualification and a landing-order agreement. This PR stays Draft.Every GPU case used an NVIDIA GeForce RTX 3070 Ti, driver 620.73.04, on CachyOS Linux with Khronos validation 1.4.363. The verbose logs recorded 25 layer insertions on the standalone commit and 11 on main, with 25 on the composition. All selected hardware runs completed without skips or VUID or synchronization diagnostics. The seven public-header and skip checks passed, and 11 AGC headers compiled independently. Shader caching was disabled in every GPU case.
November 21 refresh. I integrated main
6f5c412af786into this branch. The standalone candidate7439af5a0ef5passed all 19 focused Linux GPU executions. Those cover stencil ownership transfer, clear, failed copy, stale and fresh CPU writes, D16 depth, independent planes and read-only owners. Two executions repeated clear and copy-failure with guest write watching disabled. The same machine passed the 5 shared depth and stencil controls on main.This PR is still Draft and depends on #15058. The earlier Windows shared-backing joint test ran under Wine. A native Windows hardware run combining these changes and agreement on landing order are still outstanding.
Test machine: NVIDIA GeForce RTX 3070 Ti, driver 620.73.04, CachyOS Linux, GCC 16.2.1, Khronos validation 1.4.363. Every GPU case required real Vulkan and logged validation-layer insertion (19 insertions on this branch). Both hardware runs had zero skips and zero VUID or synchronization diagnostics. The six skip-audit cases and public-header audit passed, and 11 AGC headers compiled independently. The shader cache was disabled in every GPU case.
Joint runtime with #15058, November 20. I combined the then-submitted head (
f9a5bdf969) with mainfd7fe562edand #15058 at8378a3d27cin a local checkout (1cefc2a882). The shared ownership-transfer function takes the previous owner's snapshot for compatible depth surfaces, including a newly cleared depth surface. On the stencil path it transfers the published bytes, baseline and generation before retiring the previous owner.Retain compatible authoritative stencil publication, generation, pending clear state and the unwatched guest-memory baseline when shared planes change ownership. Fresh and reused read-only owners preserve CPU/GPU write order; potentially throwing copy and baseline work finishes before the source is retired.
Earlier integration note (superseded selector dependency)
Draft: proposed landing order is #15058 first; no author agreement is claimed. The submitted branch contains the stencil fix, its regressions and the one-line #20367 validation prerequisite. A separate combined branch preserves #15058's depth snapshots and performs stencil publication transfer after potentially throwing copy work, including created/cleared destinations. That composition is tested on Linux; it is evidence for the eventual rebase, not an import of the dependency into this PR.
Current Draft integration gate: proposed #15058 first, with no author agreement claimed. #20367 was superseded by upstream #20282 and is removed from both this branch and its dependencies. The separate composition preserves the depth snapshot transfer and stencil handoff ordering. The November 20 joint checkout passed its Windows shared-backing tests under Wine. Native Windows execution of the joint checkout remains open.
2026-11-17 integration: submitted head
f9a5bdf96981f22011a756069cf779cf595aa146merges tested main050cdf95addcb05b1c663587ab921216707623feand preserves the full original prerequisite histories. The feature and regression code are unchanged by this mechanical main integration.Tested
November 22 tested revisions. Standalone
dff79672b07e3ad18a4c9b93a78c64b82901b852and main70cca973b49f92baf7e731f85f6b6c3fed775a25, with private composition167ff94d5e0f47013bbe543502dfb5c4e37df4d0against #15058 atf4a1b94085046d5fa1cac888bfc96099b592fd79.November 20 joint validation. On CachyOS Linux, GeForce RTX 3070 Ti, driver 620.70.06, all five matched GPU controls passed on main and on the joint branch. All twelve additional stencil ownership cases also passed on the joint branch (17/17 total). Every test log shows the requested Khronos layer 1.4.363 inserted with real Vulkan required and the shader cache disabled. There were zero skips, missing layers or VUID/SYNC diagnostics. The longest joint case took 2.87 seconds. The separate Windows comparison follows below.
November 20 Windows shared-backing tests under Wine. On the same RTX 3070 Ti, I built x86-64 Windows binaries with MinGW-w64 GCC 16.2.0 and ran them under Wine 11.22 (Staging). All four
agc_driver_depth_compared_sharedcases passed on #15058 plus mainfd7fe562ed(baselineb3830edf58) and on the joint checkout1cefc2a882, with zero skips. The base case checks private and aliased section views and transfer between owners. The other cases check an unmap during completion, a CPU write between depth-unit reads, and a large unit. The fixture checks the Win32 mapping type and protection, guest write tracking, and the resulting GPU depth values.Every case selected the RTX 3070 Ti with real Vulkan required, the shader cache disabled and Khronos validation 1.4.363 inserted. Each of the eight executions logged
VUID-vkCreateDevice-ppEnabledExtensionNames-01387once. The validation layer reportedVK_EXT_external_memory_dma_bufwithoutVK_KHR_external_memory_fdat device creation. The two commits produced the same diagnostic and no synchronization hazards. Native Windows hardware execution of this exact joint checkout and landing order with #15058 remain open.2026-11-17 exact-head qualification:
f9a5bdf96981f22011a756069cf779cf595aa146against main050cdf95addcb05b1c663587ab921216707623fe.VUID-/SYNC-diagnostics. Raw logs contain no such validation errors on either side, and every selected case finishes below 30 seconds.Exact pins, matched controls, per-test results and full verbose validation logs.
Keep Draft for proposed #15058 ordering and the recorded Windows shared-backing composition gate. No agreed landing order is claimed. Native Windows/macOS, another GPU vendor, commercial titles, console parity and performance improvements were not established. Older external and peer-composition receipts below retain their original pins.
Historical exact-head qualification
2026-11-15 cleanup — exact submitted commit
b6e08256c086798fef7cb07fd09117efff0e58e0, based on tested main4da77d3353c9c9f59f15436af86f44e4bb3ee074. The AGC/shader code, tests and build inputs are byte-identical to previously reviewed head4c4fde00ef5329fcd3b18f59707bac9aad5c74d2; only the main merge and superseded documentation dependency change.Headless NVIDIA RTX 3070 Ti / 620.70.06 / CachyOS Linux 7.3.4-1-cachyos, Khronos validation 1.4.363: 5/5 matched main controls, 17/17 standalone cases, 2/2 additional unwatched controls and 17/17 composition cases pass. Every real GPU execution inserts validation, with no skips, missing layers or VUID/SYNC errors; shader cache is off and fifo_latest_ready requested. All test times are below 30 seconds.
Composition
529b1af6416cd0d3ac9ad170508fd8bf7a58ca7eincludes #15058 at6b7ff32a1174a58b462061b8362f023f405f4838. Its two Windows-only compared-shared controls skip on Linux as expected; those are not native Windows execution proof. Draft/order/platform gates remain. No old external GPU report is treated as a rerun. No title or speed claim.Current conventions, whitespace and debt-fold checks pass. Mechanical merges of both exact heads with later main
6ad1fe8a7196823f1048a10f4713e355a6f61afeare clean; no intervening relevant AGC/shader or replay allocator/write-watch changes. Full exact-head GPU logs, controls, source equivalence and independent review.Historical qualification (original exact commits)
Latest local qualification (2026-11-15): exact submitted head
4c4fde00ef5329fcd3b18f59707bac9aad5c74d2contains mainecd019f60180f2a0bfa0a0038743b1ffaa35ce15and the one-line #20367 debt-selector prerequisite.35c736b1fbdaae5a8f50822a4c4d3b9d0a72df58over the earlier mechanical main1bdf1d5e46a9752977a9f645f3672113e87235ec; later-CPU and later-GPU controls passed. All four pass on this submitted head. Existing copy-failure and independent-depth coverage remains intact.421cd9ad327df105a5583d7506404e91b1b34d72preserves exact latest #15058 head6b7ff32a1174a58b462061b8362f023f405f4838: all 17 focused GPU cases pass without validation diagnostics. The dependency's two Windows-only compared-shared cases skip on Linux and provide no Windows execution proof. The composition preserves depth snapshots before fresh-clear handling and transfers stencil ownership after successful inheritance.Exact pins, full Vulkan logs, RED/GREEN, source reviews and overlap evidence. Keep Draft and the proposed #15058/#20367 dependencies. No landing-order agreement, native Windows rerun, console/title unblock, destination-allocation rollback or performance improvement is claimed.
Historical qualification at earlier exact commits
Latest local qualification (2026-11-13): submitted head
9ee0e35cbc7edc1a8644da0434709a9b251e86a8contains main snapshot496d57b47a9b2771146d2882c48d599aca8ce883, including upstream CES revertbbc937d05536ad0dce4e7a91b90e0d20cbd21360. Feature implementation/tests and all existing non-merge commits are unchanged; conventions and whitespace checks pass. All 13 focused GPU CTests pass, with 13 actual Khronos validation-layer insertions and no selected skips or missing layers. Full per-test logs were compared with the matched fresh-main selection; no new VUID/SYNC errors. NVIDIA GeForce RTX 3070 Ti, driver 620.70.06, CachyOS/Arch Linux 7.3.3-1-cachyos; real Vulkan required, shader cache off, fifo_latest_ready requested, layer1.4.363. This refresh retests the standalone feature only; earlier dependency-composition results remain tied to their recorded commits. Keep Draft and the current proposed dependency.Exact pins and full qualification logs. Prior external Windows/macOS reports below remain historical; this update does not claim hosted full CI on the new head, author agreement, a commercial-title unblock or FPS improvement.
Fresh 2026-11-13 qualification: CachyOS/Arch Linux 7.3.3-1-cachyos, GCC 16.2.1 Release, NVIDIA GeForce RTX 3070 Ti driver 620.70.06. Main snapshot
cddfa7e6628510af42a785d4e2aff1011b916b04: 5 focused baseline tests pass. Submitted candidate922835da2d7bffa23f031055382c52e8714e0664: all 13 tests pass, with 13 validation-layer insertions and no skips. The new copy-failure regression injects a missingvkCmdCopyImageresolution, checks that the source remains authoritative, then verifies publication and successful retry. It fails against the rejected pre-copy retirement experiment and passes against the submitted post-copy handoff.Combined dependency head
1693715b7140a8c00d8478a60e195a0b149a8486also passes all 13 Linux cases against the same fresh-main baseline. Its integration branch preserves the exact #15058 head280ba62f5b8acfeb8cdd5d91f905b9e6ea8a7f8fand authorship. The dependency's two compared-shared-memory tests skip on Linux; they do not verify Windows behavior. The combined branch includes an unrelated textual collision inherited from #15058 and is not the proposed PR head.GPU logs confirm real Khronos 1.4.363 insertion with
ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_DEBUG=layerandANYPS5_PRESENT_MODE=fifo_latest_ready. Full per-test log comparisons find no new VUID/SYNC diagnostics. Conventions and whitespace checks pass. No commercial-title unblock, FPS improvement, Windows runtime or software-driver result is claimed.The standalone overlap scan still reports #15058's complementary edit to ownership transfer. Other uncompared peers were reviewed from frozen heads and their own merge bases. The proposed order remains explicit until the dependency lands and this branch is rebased.
Refresh validation (2026-11-13): based on main
c76eb6a26433216e2219fa9937e9cd57254be272, tested PR head3077ee2da6b1251177868983829242db576dec96.All 13 focused CTests passed with 13 actual Khronos validation-layer insertions and no selected-test skips. Full per-test logs were compared with the matched fresh-main baseline: no new VUID/SYNC validation errors and no missing layers. GPU: NVIDIA GeForce RTX 3070 Ti, driver 620.70.06, CachyOS/Arch Linux 7.3.3-1-cachyos. Real Vulkan required, shader cache disabled and fifo_latest_ready requested. This is correctness validation; no new FPS or commercial-title claim.
Fresh evidence-only dependency composition
2a25156dd6f9085c182b92927832a6d2c5b892ccpreserves exact #15058 head280ba62f5b8acfeb8cdd5d91f905b9e6ea8a7f8f: all 13 selected Linux GPU tests passed, with 13 actual Khronos insertions and no new VUID/SYNC diagnostics relative to matched main. Its updated evidence branch is linked above. The submitted feature branch remains separate and Draft, with proposed dependency #15058; no agreed landing order or Windows-only peer test result is claimed.Refresh logs and installation/validation evidence. Earlier results above remain evidence for their explicitly recorded commits; old Windows/macOS CI reports were not rerun by this local validation. Fresh platform CI results are separate.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T07:33:41Z.
Review: APPROVED
Reviewed — looks good
Nothing in the inspected change shows a verified defect; the author should retain the documented integration and platform limits.
What I ran
Reviewed head
f9a5bdf96981f22011a756069cf779cf595aa146and its prepared diff. No commands or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The description reports Linux GPU and test results; these were not independently rerun. Windows shared-backing behavior and native console/title behavior remain unverified, as the change documentation states. All four changed files listed in the manifest were included and read; no changed files were excluded.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:17:06Z.
Review: COMMENTED
I trial-merged
dff79672b0cleanly ontoa1b75b0947. The key ordering intakePlaneis to carry over the guest baseline with the stencil contents, mark the new owner stale, and then retire the previous owner. The copy-failure and CPU-after-handoff cases check distinct ways that ownership can get out of sync. Please keep the failure case when composing this with #15058. My review is source-based and the reported hardware results are from the author.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.