fix(agc): reclaim published native depth owners safely #10469
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10469"
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 Ondra97 on 2026-10-24T02:11:07Z.
What
A guest access to GPU-written native multisample D32 depth with HTILE needs both its sample bytes and expanded metadata. This PR publishes both planes before making the owner inactive, then uses main's inactive/unwritten-owner reclamation and sampled-view lifetime checks. Owner maps retire before removal, and recorded work retains its resources.
The November 16 main sync used
38c924f1deceb20374844f72faf5ba6d07822678. Main's bare D32 path without HTILE keeps its retained-owner behaviour, as does D32S8 with and without HTILE. Allocation leases, snapshot/racing-write checks, overwritten-plane proofs, colour-alias retirement and pending-unit checks are retained. The carried #9950 implementation retains Ethan Barr's authored commit2767cce0cea4c3ef792ea7d34c414ac4ed94b61a.The four reviewed HTILE-clear publication-refusal assertions were already D32-only at the previous public head
5d28444d420c8bc3b6c76c4bece81f590051671c; this refresh keeps that adjustment, the remaining safety checks and production D16 refusal. It does not add D16 publication. The six publication/held-view/reclamation/rebinding fixtures are unchanged.#9950 remains open at
9db462e0671b972f6fa380b5bc819348771f8954; that exact head is not an ancestor of this branch. Its carried implementation is adapted to the shared publisher on main. The existing order remains #9950 -> (#10469/#10492) -> #10497 -> #7002. The related branches were not changed.The November 19 main sync preserves the reuse rule from #15941. A reuse that takes a guest byte still retires an owner, while a reuse that takes no byte retains a bare D32 or D32S8 owner. HTILE D32 retires after both planes commit, and recorded work and held views keep their existing lifetime protections.
Tested
November 19 Windows Release validation used main
3f4693be439f05ffe3961733357f445e8488bd87and PR head2ade1d253ee1505300c4dcf2f01bd128cba20276. On Windows 11 Pro 10.0.26300, Ryzen 9 7900X, 31.66 GiB RAM and NVIDIA RTX 4070 Ti SUPER driver 621.24, both runtime builds produced the relinker, all patched libraries and the selected AGC test executables.The same 31 focused Vulkan CTests passed on each revision. Each logged insertion of Khronos validation 1.4.335 and selected the NVIDIA GPU. Shader caches were disabled and synchronization validation was enabled. No VUID or synchronization hazard was logged. All six D32 HTILE publication and reclamation cases ran on the PR head. The additional mock graphics fixture passed on each revision. The queued-fill fixture skipped on both revisions because its host import was compared. Two internal HTILE write-coverage assertions also skipped in each run.
The latest main at the publication check was
b68affac18ca39391a3800d5cb51735d085c014d. The two intervening commits touch only UserService and Fios2 tests, and main merges cleanly with this head. The Windows results above cover the exact built revisions listed above.Automated local validation on November 16, 2026 (Europe/Prague): main
38c924f1deceb20374844f72faf5ba6d07822678and submitted sourcedf36ea58024006c8bfd006b87c533e3a7a8bda8d.Pre-push main
87fdadcd1ebed6d6582457e0f9d5e69d26b5d7b6is 21 commits ahead of the validated base. Its test merge is clean and it changes none of this PR's files. The later main+PR composition is outside these local binaries' qualification and still needs completed full CI results for that composition.Windows 11 Pro 10.0.26300; Ryzen 9 7900X; 31.66 GiB RAM; NVIDIA GeForce RTX 4070 Ti SUPER, driver 621.24. WinLibs GCC 15.2.0 r7 UCRT, CMake 4.3.1, Ninja 1.13.2 and native Python 3.14.7. Separate Release full-runtime builds produced the relinker, all patched libraries and four focused fixture targets, with SPIRV-Tools enabled. The final refresh used two top-level compiler jobs and one inherited job for nested builds; the build arms and GPU tests ran serially.
The unchanged official
tools/vulkan_validation_gate.pycompleted a fresh-output run at main45f6d379cc5/ fixd681cf4fe95, exiting 0 for these 31 GPU CTests twice per revision. That report, logs and all hash-inventoried runtime/staging files are archived. After the final current-main merge, both exclusively owned build roots were fully rebuilt incrementally using BUILD.md's configure/build workflow, and the same tests ran again in main/fix then fix/main order. The separate final report uses the unchanged gate's strict timeout, layer/skip/error parsing, comparison, source-identity and before/after artifact-hash helpers; it records the final commits above. Both arms require Vulkan, disable normal shader caches, enableAPS5_VERIFY_SHAPE_MEMO=1, and use explicit Khronos validation 1.4.335 withVK_LAYER_VALIDATE_SYNC=1and loader logging. Every selected GPU test shows the inserted Khronos layer. Actual device logs name the RTX 4070 Ti SUPER; there is no missing requested layer, VUID or SYNC-HAZARD in either revision's logs.All six D32 publication/reclamation fixtures execute in each fix iteration: 2/4/8 samples at 5x3 and 70x67, with HTILE/XOR variation, exact samples/padding/metadata, held-view retention, reclamation and address rebinding. Current main's bare D32, D32S8 two/three-plane publication, race/unmap, overwritten-plane, single-sample-view, alias and pending-unit tests remain in the selection. A separate negative control runs the fix fixture executable with the hash-identified main runtime and fails at the expected unsupported D32 guest-publication guard.
Coverage limits are explicit.
agc_driver_graphicsuses mock Vulkan and is validated as a host fixture, so it cannot prove insertion of a real layer.agc_driver_native_depth_driver_queued_fillopens the real device and layer, then returns the project's registered skip code 77 because host imports are compared rather than write-watched on this Windows/device path. In both revisions,agc_driver_native_depth_clearsandagc_driver_native_depth_buffer_clearalso omit one internal HTILE write-coverage assertion per iteration for that capability; their remaining checks run. The project Windows skip audit accepts the explicit CTest skip on both supplemental reports; these acceptance paths remain unverified here. The earlier broad 33-test report at maindcf3d15978c/ fixe209ad10f2fretains exit 1 for the host fixture's absent real layer and the explicit queued-fill skip; it is not presented as a passed gate.Conventions and whitespace checks pass (one debt-length warning on this PR's 1002-character debt entry, zero errors). The isolated overlap run inspected 1,779 open PR heads and exits 2: one confirmed overlap with #15941 and 29 incomplete shared-file comparisons. The #15941 author's existing agreement permits either order while retaining both rules; the second branch must keep D32 retirement and its separate reuse policy. The declared publisher, owned follow-ups and related shared-file diffs were reviewed manually. No clean full-overlap result or combined foreign-stack qualification is claimed. No full CTest, title/console run, cross-vendor result or performance claim is made.
SHA256 provenance
Build and test-staging driver hashes match in each arm, and the final validation compares the selected runtime hashes before and after testing. The negative control uses the main driver's hash and the fix executable's hash below.
3f79c61bf6d57c152c8d495c7686155ab58c40638db95318dafaee8e14fe128ee132ca0899161b79e0633d436b981bf41a3983cf013b379a79fad26bdb5cb7bb0dfe2196406cdac742eb657206f48baa822f981a72e13d720b4c840ff2ec500162cdca54b13e4cf816b92329680fef975899fe96c860efead5bcac7f20ca0be438328322ee284da29a870222be1f4b7854da27f8876facd639e6446c761be6e9c9de9fae54db3f1ffb4621c1ffaba93504fb4195c133335e2fe4f243d5008d11d8357c198a28484ed1c43839582b8b20e72d077b011cd03cc07f4e424f33dde68a6ce6a7f5261f2c9e544cf0d79c235d606921277f83d050a53894c98c55c60dTracked-source manifest SHA256: main
e938d97ab196659c7a37dd90c34678eaca8fb759567ba8c131f70129c97eee28, fixe9cebdfa98e8374d7531a2f434d728bfdeecff3539cab4c2a1d118fa41a57740. Other dynamic host libraries and ignored source files are outside the official tool's inventory.Reproduce the real-GPU selection
With clean initialized source roots at the two commits above, run from the fix root. Select WinLibs GCC 15.2.0 r7 on
PATH; use the matching Khronos layer directory and an available pinned FFmpeg package per BUILD.md.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-10-24T19:54:12Z.
Review: APPROVED
Reviewed exact head
4f64dee52dbfc4dc4c4cf374e6f24dccbf8e670e.PublishToGuestlimits readback to supported D32 multisample surfaces, synchronizes prior recorder work, writes tiled samples and expanded HTILE back to guest memory, and marks publication complete only after both writes. Reclamation requires that publication, an inactive owner, and no remaining sampled views; it retires the owner maps before releasing the surface. The regression covers sample counts, padding, HTILE, retained views, reclamation, and rebinding.Local diff-check and conventions pass. I did not run the GPU suite here; the PR reports paired current-main/candidate builds and six focused CTests on an RTX 4070 Ti SUPER with validation enabled and no VUIDs. Product CI is skipped by path policy. The declared dependency on the exact open prerequisite head is retained.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T19:41:24Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected changes add D32 HTILE publication and owner retirement after both guest planes commit; I found no concrete blocking defect in the reviewed code.
What I ran
Reviewed head
2ade1d253ee1505300c4dcf2f01bd128cba20276. I read the prepared description, commits, manifest and diff, then targeted source ranges withrepo_read.py. No build or tests were run; test results in the description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The complete contents of the large changed test source were not read; I reviewed the added publication fixture and the changed test hunks. No local checks were run. The report’s hardware and CI results were not independently confirmed. All three changed files are included in the review folder;
files.jsonwas not present in the prepared folder listing.To get this to a good state
Nothing is required.
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.