fix(agc): retire host imports before range cuts #7849
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7849"
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 MarcZX10 on 2026-10-19T10:55:34Z.
What
Retire a host pointer import completely when
mprotectormunmapchanges any part of its imported range. The old trim path preserved the originalVkDeviceMemoryacross a partial cut, so Vulkan could retain an import whose host extent now included inaccessible or unmapped pages.VK_EXT_external_memory_hostrequires the imported range to remain valid and accessible until the memory object is destroyed (Vulkan specification). This matches the RADVEFAULTreport in #7784. Surviving ranges are imported afresh on next use; this trades the trim optimization for correct host pointer lifetime.The regression verifies that an import spanning a partial unmap is retired and that a retained prefix can be imported again. A separate partial-protection case verifies that the import does not cover the changed range. The cached-address-space fast path also retires any overlapping host import after dropping its cached lease.
Tested
mainatcecb540a63f614d2b06cbb557c6d1f6f02475fa3; all five are authored by MarcZX10. The budget-aware benchmark follow-up is also authored by MarcZX10.git diff --check upstream/main...HEADandpython3 tools/check_conventions.py --base upstream/main --head HEADpass.5338420704b0bdd9cb95055b11e6e76682184efd, before this rebase; they do not validate the current head:GuestBufferMemory.cppreproduced the host-import lifetime failure; the corrected prior head passed the targeted control cases.root-overtested PR headd96a03c62before this rebase. On that head, the 18 focusedguest_memory_lifetime|host_import|agc_driver_recordertests passed three times each on lavapipe and RADV Renoir with validation enabled and noVUID-lines; the RADVmaincontrol reproduced #7784. This report does not validate the current rebased head. Full report.d96a03c628ec1125972945c3ed6f4a230ba384c4on Linux x86-64 with GCC 12.2.0, Release,BUILD_TESTING=ON;agc_driver_guest_memory_lifetime_testsand its dependencies linked successfully (785 Ninja steps). This build does not validate the current head.agc_driver_guest_memory_lifetime_{copy,direct,locked,heap}under CTest withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationaborts before Vulkan initialization because this Intel Xeon E5-1620 v2 lacks LZCNT, BMI1, BMI2, MOVBE, AVX2 and FMA. This host could not provide a runtime or validation-layer result. Windows title behavior, performance and the full suite were not tested.cmake --build build-review --target agc_driver_recorder_tests -j4completed successfully on Linux x86-64 with GCC 12.2.0 (812 Ninja steps). CMake does not registeragc_reimport_benchon Linux; that benchmark is Windows-only, so its budget-skip path was not executed locally. It needs an exact-head Windows run on a host with less than 1,382 MiB of remaining host-import budget to verify the skip, plus a run with sufficient budget to verify normal benchmark behavior.git diff --checkandpython3 tools/check_conventions.py --base upstream/main --head HEADpass.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 github-actions[bot] on 2026-10-19T11:04:58Z.
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.
main)core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppL463-520, L2013-2022Some 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.
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/ARCHITECTURE.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/ARCHITECTURE.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtdocs/dev/ARCHITECTURE.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/ARCHITECTURE.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/ARCHITECTURE.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/ARCHITECTURE.mddocs/dev/ARCHITECTURE.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/ARCHITECTURE.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/ARCHITECTURE.mdcore/libs/prx/libSceAgcDriver/CMakeLists.txtImported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T14:32:24Z.
AMD and Intel Windows data: on
main85029a00f, this PR fixesagc_driver_host_import_lifetimeand, on AMD,agc_reimport_bench. Its updatedagc_driver_guest_memory_lifetimestill fails with the PR, on an AMD RX 9070 XT and an Intel UHD 770.Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built,
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, withVkCacheemptied first. This headffa5c41efmerged intomain85029a00f. "Without" means only this PR's diff totests/HostImportLifetime.cpp,tests/Recorder.cppandtests/execution/GuestMemoryLifetime.cpp, applied tomain85029a00f.main);agc_driver_guest_memory_lifetimefailsagc_driver_guest_memory_lifetimefailsagc_driver_host_import_lifetimefails:guest mutation reached host apply before vkFreeMemory completed;agc_driver_guest_memory_lifetimefailsagc_reimport_bench:a cut kept memory imported across the changed host range instead of importing the remaining side againagc_driver_guest_memory_lifetimefails the same way in all four runs:guest memory host import lifetime: middle unmap left the original host import alive across the unmapped range. Onmainalone, with its own copy of the test, it passes. So the updated assertion doesn't hold on currentmaineven with this change. Something merged after this PR's baseb62e0a8a7may keep the import across a middle unmap.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T15:59:06Z.
I rebased this PR onto current
main(d047690c63) without conflicts; updated head isd2902009ee. The focusedagc_driver_guest_memory_lifetime_teststarget and its fixture build successfully on Linux, and conventions plusgit diff --checkpass. I could not execute the runtime CTest here because this Xeon host lacks the LZCNT, BMI1/2, MOVBE, AVX2 and FMA features the test requires. The Windows report still identifies the exact assertion failure, so I have not marked it resolved. Could you rerunagc_driver_guest_memory_lifetimeon the updated head on either of the reported GPUs to check whether the current-main rebase changes that result?Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T17:38:13Z.
Thanks for the exact AMD and Intel results. I traced the current-main regression to the pin waiter’s cache-drop fast path: it returned immediately after dropping
Spaces().current, before retiring a host import that overlapped the mutation.I updated the path in
3648e3b1fdso it keeps the cache-only fast return when there is no overlapping import, and continues through normal retirement when there is one. The branch is rebased onto currentmainb6583dd868.The Linux Release builds for
agc_driver_guest_memory_lifetime_testsandagc_driver_recorder_testspass, as do conventions, diff-check and the overlap check. Both relevant CTests abort at startup on this Xeon because it lacks LZCNT, BMI1/2, MOVBE, AVX2 and FMA, before reaching assertions or Vulkan. Could you rerunagc_driver_guest_memory_lifetimeon either reported Windows GPU against this head to check whether the stale-import failure is fixed?Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T18:00:15Z.
Review: CHANGES_REQUESTED
Thanks for tracing this. Retiring the whole import on any cut is the right direction for
VK_EXT_external_memory_host, but the head still fails its own test on CI's driver.agc_driver_guest_memory_lifetimefails on lavapipe (the Linux CI configuration, this PR merged onto currentmain,agc_driver_guest_memory_lifetime_copy/_heap/_convertedetc. pass, and the test passes onmain):guest memory host import lifetime: middle unmap left the original host import alive across the unmapped range, from the new assertion attests/execution/GuestMemoryLifetime.cpp:115. Aftermunmap_nid_postfix(middle, BlockBytes),Imported(device, mapping)is still true, so the prefix import was not retired by the middle unmap on that path. Please check which branch ofWaitForLeasesAndImportsthe unmap takes there (the cache-drop fast path or the import loop) and why the overlap check orretireImportdoes not catch the prefix import.docs/dev/ARCHITECTURE.md:132still describesretireOrTrim,HostImports::trimmedandreattachTrimmed; it should say that a cut retires the import and the surviving ranges are imported again.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T19:15:58Z.
I traced the lavapipe failure to the test sequence rather than an import crossing the unmapped hole.
Imported(device, mapping)checks whether an import contains that address; after the test protects the middle block read-only and then callsFill(device, mapping),importRun()creates a valid import for the readable prefix. The later middle unmap does not overlap that prefix import, so the old assertion was testing the wrong condition. I split protection and middle-unmap coverage into independent cases: the unmap case starts with one import covering all three blocks and then asserts that no import covers the full range after the middle is unmapped; it separately confirms the retained prefix can be imported again. I also updated the stale architecture description. The updated head is rebased onto current main.git diff --checkandpython3 tools/check_conventions.py --base upstream/mainpass. I could not build/run the AGC execution target in this worktree: this configuration is relinker-only, and the full AGC configure is blocked by missing XRandR development support; no runtime result claimed.Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-19T19:42:11Z.
Hardware validation on AMD RX 6650 XT, RADV Mesa 26.2.4-arch1.1, Ryzen 9 7950X, Arch Linux 7.2.9, GCC 16.2.1 Release, 2026-10-19.
Compared main
da3ea52b53d9d0fb0b4938035798de7c765a2341with this PR's three commits at author head1ead0f921b72b97d0acf9140a55179063a79090e, applied onto that main as4a608ccfa9ad5f706a2bc84de1d972c5ae241c31. No other PR was included.Required Vulkan, shader cache disabled, Khronos validation enabled. Enabled the real execution sources for
GuestMemoryLifetime,HostImportAtMap,HostImportTeardown,HostImportWindowsandPipelinedDispatchbefore building. All 18 selected cases executed in each comparison; no skips or missing-layer messages.agc_driver_guest_memory_lifetimefails;VUID-vkResetFences-pFences-01123after device loss02fccad99dad296d047627df2ecc4fcd47525870)agc_driver_host_import_lifetime:guest mutation reached host apply before vkFreeMemory completedThe baseline GPU failure rejects a submission with
-14, then reportsguest prefix unmap failed. Both that hardware failure and the added retirement-order regression disappear with the complete patch. This verifies the tests catch the old behavior rather than merely passing on both builds. Includes graphics, import locking/readback, retirement, sparse imports, mutation race, map/teardown/windows, guest-memory variants and pipelined dispatch. Conventions check passes.Exact patch, test-only patch, build logs, full CTest output, environment and comparison manifests. SHA-256:
28cc01a04c4f85c952df4c65cf1ddbfd0cc4d59e8b21922b341a7260764011ad.Main has since advanced to
8075b6af190ff8f83c1bff9a7f74cd71e5902140; these results are pinned to the explicit main above. No native-title, FPS, Windows or full-suite claim.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T20:24:18Z.
Thanks for the independent AMD run and the test-only comparison. The full current PR head you tested (
1ead0f921b72b97d0acf9140a55179063a79090e) passes all 18 selected cases with no VUIDs, while the test-only patch reproduces the original failure and exposes the retirement-order regression. That supplies the supported runtime evidence I could not obtain on this Xeon. I see the baseline is pinned toda3ea52b53d9d0fb0b4938035798de7c765a2341, before currentmainadvanced to8075b6af; the PR head itself is the same head validated in your complete-PR run. Could you reassess the requested changes against that result and current diff? The local host still cannot run AGC tests because of its CPU-feature guard.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T21:19:49Z.
Rebased the three-commit series onto current
main(bf2c63f853e173c860d3469136dbe5a9f0739ef2) aftermainadvanced. The first commit retires imports on cuts, the second covers the cached-address-space fast path, and the third clarifies the partial-unmap regression. The changed driver and both requested test targets compile; conventions andgit diff --checkpass. The seven guest-memory CTest cases were attempted again: six stop at the Xeon CPU feature guard before Vulkan/assertions, and the converted wrapper cannot find the unbuilt relinker. The external 18/18 AMD/Intel report applies to the previous code-identical PR head, not this rebased commit. Could you reassess the updated head and advise if any changes remain?Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T21:36:09Z.
I rebased the three focused commits onto current
main(a700809679). The lavapipe failure report was against the earlier partial-unmap assertion, which queried whether any import contained the prefix address; the test had already re-imported that retained prefix, so that assertion could fail even after the original full-range import was retired. The latest test now checks the full three-block range, and adds a separate case that starts with one import spanning all three blocks, unmaps the middle block, asserts that no import still spans that range, then verifies the prefix can be imported again. The cached-address-space fast path also now checks for an overlapping import before taking its early return, and falls through to retirement when one exists. The new head is062d7c651d. Could you rerunagc_driver_guest_memory_lifetimeon this rebased head and let me know whether any failure remains? The local host cannot reach the Vulkan test past its CPU feature guard.Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-20T03:36:00Z.
Additional independent RX 6650 XT evidence: the existing guest-memory lifetime test reproduced a RADV submission failure before this fix, and passed after integrating the three commits from PR head
062d7c651d0a8704bdaaacf29d106b8036205fac.This is local integration evidence, not a run of the exact PR head or an unmodified current-main pair. Baseline
1b42c4f002f995846344a2112f11f4262aa42880is upstreamad61cafde066254980089a058ee2a93c99f773b4plus eight mesh/label prerequisite commits. Candidated3e69462efadds this PR's three commits, retaining MarcZX10 authorship. The integration retained newer eviction-refusal logic and resolved Windows-test context using imported extent checks. The separate budget-error-classification experiment was absent from both branches.agc_driver_guest_memory_lifetimefails withradv/amdgpu: The CS has been rejected ... (-14)followed byguest prefix unmap failed.BUILD_TESTING=ON.Built
agc_driver_recorder_testsandagc_driver_guest_memory_lifetime_tests, then ran the same command on both branches:Full baseline/change build and test logs, exact integration patch, and provenance.
The Windows-specific cut test was not run on Linux. No native-game result or performance claim is attached to this integration yet.
Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-20T07:28:55Z.
@MarcZX10 a Windows run of the current head
062d7c651, on an AMD GPU: RX 6700 XT (gfx1031, RDNA 2), AMD's Windows driver 32.0.21045.5002, Windows 11 26200, WinLibs GCC 15.2, Release. The head conflicts with today'smain(GuestBufferMemory.cppandRecorder.cpp), so both sides are on the head's basea70080967, so I didn't test a merge I resolved myself:a70080967with only this PR's changes toCMakeLists.txt,HostImportLifetime.cpp,Recorder.cppandGuestMemoryLifetime.cpp.062d7c651as pushed.All 69 tests built from
agc_driver_recorder_testsandagc_driver_guest_memory_lifetime_testsran 3 times each with--repeat until-fail:3, serially, withANYPS5_REQUIRE_VULKAN=1andANYPS5_NO_SHADER_CACHE=1, under the Khronos validation layer:agc_reimport_bencha cut kept memory imported across the changed host range instead of importing the remaining side againagc_host_import_cut_lifetimethe side of a page made inaccessible inside the import, nearer its start is served from the import that pinned the changed host rangeagc_driver_host_import_lifetimeguest mutation reached host apply before vkFreeMemory completedagc_driver_guest_memory_lifetimeand its_copy,_direct,_locked,_heap,_heap_uncachedvariantsSo the stale-import failure that savvaniss and I saw on the earlier heads is gone at
062d7c651on this driver. The updatedagc_driver_guest_memory_lifetimepasses here on both sides, so on AMD Windows the three tests above are what tell the base from the head.Validation layer: the same messages on both sides, 12
VUID-VkImageViewCreateInfo-usage-02275and 6VUID-vkCmdCopyBuffer-srcBuffer-00118, so none comes from this change. Nowas not found but was requestedline on either side.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T07:55:19Z.
Rebased #7849 onto current
mainat1edbe4b5e03b4f655021da3a74b87d2dc511476fand pushed the three MarcZX10-authored commits ase844204903. I resolved theGuestBufferMemory.cppandRecorder.cppconflicts while retaining main's current import-budget behavior and updating the tests to the current import metadata. The architecture text now describes full retirement after a cut.Local
git diff --checkand conventions pass. The current head has not been rebuilt or runtime-tested here: the Xeon CPU guard stops AGC tests before Vulkan, and only 1.3 GiB of disk was available for a rebuild. The prior RX 6700 XT run was against the old base/head062d7c651, so it does not validate this rebase. Current hosted conventions and labels are pending; platform jobs are skipped. Could you recheck the current head when convenient, especially the focused import lifetime cases on the supported GPU setup?Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T08:08:26Z.
I added a focused regression assertion after the middle unmap and before the prefix
Fill:HostImportCoversmust report that the prefix is not imported at that point. The existing assertion only ruled out an import spanning all three blocks, which could miss a retained prefix import like the review report describes. The nextFillstill verifies the surviving prefix can be imported again. Current-head diff and conventions checks pass; I could not rerun the Vulkan test here because this host fails the project CPU feature guard and has insufficient free space for a rebuild.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T08:11:42Z.
I confirmed the standard PR Build event skips the Linux job by workflow design. The repository provides a
workflow_dispatchroute to build selected PRs on its self-hosted Linux runner, but GitHub rejected my dispatch attempt with HTTP 403 (Must have admin rights to Repository). I also cannot run the test binary on this Xeon host because it lacks the project-required CPU features. So the current head still has no runtime result here; the supported-host run needs to be triggered by an account with repository admin access or another equipped reviewer.Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-20T08:27:40Z.
Build blocker, then supported-host results with a one-line local correction. Exact head
218ccd7cf3eeebcf1c8d27a2b333d1353904913cfails to compile on native Linux/GCC 13.3:importRunAtstill calls the helper, while this PR removes its definition andHostImports::trimmed. I removed only the stale call locally:That is the entire local diff against your head. The fixtures, runtime dependencies and converted guest fixture then build. The results below belong to this corrected local tree, not the unmodified pushed head.
On that tree, all nine registered cases matching
pass three times each, serially, on each restricted ICD: 27/27 NVIDIA, 27/27 RADV, 27/27 lavapipe, no skips or timeouts. This includes the strengthened assertion before the prefix
Fill, and the converted guest test. The device records name RTX 3090, RADV RAPHAEL_MENDOCINO and llvmpipe respectively.For a before/after control, I retained your current fixtures and restored only
GuestBufferMemory.cppto the exact main base1edbe4b5e03b4f655021da3a74b87d2dc511476f:agc_driver_guest_memory_lifetimeon RADV fails 3/3 withradv/amdgpu: The CS has been rejected ... (-14)followed byguest prefix unmap failed, reproducing #7784's symptom.agc_driver_graphicsalso passes; the one-line local diff passes conventions andgit diff --check.Ubuntu 24.04, kernel 7.0.0-38, Ryzen 9950X, Release; NVIDIA 595.99.02, gfx1036
1002:13c0/ Mesa 25.2.8, lavapipe LLVM 20.1.2. Vulkan required, shader cache disabled, unrelated AnyPS5/Vulkan overrides removed; CTest's per-mode lifetime settings retained. No Khronos validation layer is installed. Windows-only cut/reimport cases, titles, performance and the full suite were not tested. Raw build/test logs, JUnit and the one-line patch are retained.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T08:29:36Z.
I confirmed the Linux compiler failure at
GuestBufferMemory.cpp:1624:importRunAtcalls the removeddropTrimmedhelper, and no definition or trimmed-state field remains. I removed that stale call in the local worktree;python3 tools/check_conventions.py --base upstream/main --head HEADandgit diff --checkpass. I have not pushed this one-line correction because the PR also conflicts with currentmainand the supported-host results in the previous comment apply only to the locally corrected tree, not the published head. The next update needs a current-main conflict resolution plus the same targeted guest-memory/host-import suite on that exact head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T08:31:39Z.
Updated the branch to current upstream
main661f8b71718083fbac1c45b44f5d67dc39cb4624, preserving the original authors and adding a separatefix(agc): remove stale trimmed-import callcommit. The exact earlier tree with this same one-line correction passed Simon B.’s focused 9-case suite 3/3 each on NVIDIA, RADV and lavapipe; the corrected current-main rebase itself has not had a runtime run. On the rebased head, conventions andgit diff --checkpass. The PR description now distinguishes the earlier runtime evidence from the current rebased head. Please rerun the focused suite on the updated head when an equipped runner is available.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T08:43:03Z.
I rebased the corrected branch again onto the latest upstream
main35fa2bdd824f1a77d5d70e7feeae85fd6d9baf04because main had advanced in the AGC CMake test file. The five commits remain MarcZX10-authored. Conventions andgit diff --checkpass on the new head5338420704. The 27/27-per-ICD runtime report is still from the earlier one-line-corrected tree, not this latest rebase; could you rerun the focused host-import/guest-memory suite on this exact head when available?Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T09:02:12Z.
Follow-up on your review at
3648e3b1fd: the current branch includes changes since that reviewed head.ca64d72589makes the cache-drop path check for an overlapping host import and fall through to the import-retirement loop instead of returning early. The regression now checks that the whole import and its prefix are absent after middle unmap, before the prefix is imported again, and the current architecture text describes whole-import retirement rather than trimming.The current PR head is
5338420704b0bdd9cb95055b11e6e76682184efd. I cannot run the focused test here because this host lacks the required CPU extensions. Does the reported prefix-import failure still reproduce on this head? If it does, the import interval and whetherWaitForLeasesAndImportstook the cache-drop or mutex-held path would help narrow it down. I will keep the review finding open until the exact-head result is clear.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T10:22:37Z.
Supported-host follow-up on the prefix assertion and unmap failure:
!Imported(device, mapping)check after middle unmap 3/3 on each of NVIDIA, RADV and lavapipe. The same guest-memory lifetime test failed 3/3 on RADV with the main-only control. His corrected-tree test run was before my latest current-main rebase; it is not an exact run of head5338420704b0bdd9cb95055b11e6e76682184efd.062d7c651reportsagc_driver_guest_memory_lifetimepassing 3/3, including the middle-unmap/prefix case; that run also predates this rebase.5338420704b0bdd9cb95055b11e6e76682184efdshow conventions/eligibility/labels/report passing, while Linux and Windows build jobs are skipped. This host cannot run the Vulkan fixture because it fails the CPU-feature guard.The overlap check should see a whole-import entry that begins before the middle-unmap interval because its end extends past the interval start; the retirement loop then removes that entry before the registry applies the cut. The supported-host reports suggest the earlier failure is fixed, but I do not have an exact-head runtime result. @adriadam10, do these results address the prefix-import finding, or do you still see it on the current head?
Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-20T10:26:54Z.
Exact-head Linux follow-up: the prefix-import failure does not reproduce on
5338420704b0bdd9cb95055b11e6e76682184efd. This head builds without the localdropTrimmedcorrection needed by the earlier report.Ubuntu 24.04.3, GCC 13.3, Release. Rebuilt the recorder, graphics, guest-memory lifetime executable and converted guest fixture/runtime. Restricted each run to one ICD; loader logs confirm RTX 3090 (NVIDIA 595.99.02), gfx1036/RADV RAPHAEL_MENDOCINO (Mesa 25.2.8), and lavapipe (LLVM 20.1.2).
ctest -j1 -V --repeat until-fail:3 --no-tests=error -R '^agc_driver_(host_import_(lifetime|mutation_race)|guest_memory_lifetime(_(copy|direct|locked|heap|heap_uncached|converted))?)$', withANYPS5_REQUIRE_VULKAN=1andANYPS5_NO_SHADER_CACHE=1:No skips or timeouts. This includes the strengthened assertions that the whole import and its prefix are absent before the prefix is filled/imported again.
For a discriminating control, kept all PR fixtures and restored only
Graphics/src/GuestBufferMemory.cppfrom parent/main35fa2bdd824f1a77d5d70e7feeae85fd6d9baf04, then rebuilt the same targets:agc_driver_host_import_lifetimefails 3/3 on each ICD:guest mutation reached host apply before vkFreeMemory completed.agc_driver_guest_memory_lifetimefails 3/3 on RADV:The CS has been rejected ... (-14)followed byguest prefix unmap failed. It passes on NVIDIA and lavapipe, so that case alone does not discriminate there.Restored the exact, clean PR head and rebuilt: both cases then pass 3/3 on each ICD (18 further passes). The reported prefix failure is therefore resolved in this Linux scope, with a repeatable parent-production negative control.
The Khronos validation layer is unavailable on this runner; these are runtime results, not validation-layer results. No Windows, title, performance or full-suite claim.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T10:27:55Z.
Thanks for the exact-head run and parent-production control. The strengthened middle-unmap and prefix assertions pass 3/3 on each of NVIDIA, RADV and lavapipe, while restoring only
GuestBufferMemory.cppreproduces the host-import lifetime failure on all three and the RADV guest-prefix failure. This directly answers the reported prefix failure for head5338420704b0bdd9cb95055b11e6e76682184efd. I also verifieddocs/dev/ARCHITECTURE.mdnow says an overlapping cut retires the whole import and surviving ranges are imported again; the oldretireOrTrim/trimmed/reattachTrimmeddescription is gone. @adriadam10, could you reassess the review finding against this exact-head result?Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T10:43:29Z.
@adriadam10, simonbbby’s exact-head report addresses both points from the review. On
5338420704b0bdd9cb95055b11e6e76682184efd, the selected nine tests passed 27/27 on each of NVIDIA, RADV and lavapipe, including the assertion that the prefix import is absent before it is filled again. Restoring onlyGuestBufferMemory.cppfrom parent35fa2bddreproduces the reported failures; restoring the PR head passes the two discriminating cases 3/3 per ICD. The architecture text atdocs/dev/ARCHITECTURE.md:132now describes retiring the whole import and re-importing surviving ranges. The report notes the validation layer was unavailable and makes no Windows, title or full-suite claim. Could you reassess theCHANGES_REQUESTEDreview against this evidence?Imported from boykopovar/AnyPS5. Originally posted by Chuk49 on 2026-10-20T12:39:08Z.
Exact-head run of
5338420704b0bdd9cb95055b11e6e76682184efdon a GPU not covered so far: AMD Radeon 8060S (Strix Halo, RDNA 3.5), RADV STRIX_HALO, against its base35fa2bdd8as the control.Arch Linux (Omarchy), kernel 7.2.5, Mesa 26.2.2, GCC 16.2.1, Release,
BUILD_TESTING=ON, full rebuild for each commit. RADV is the only ICD installed.17 tests:
agc_driver_guest_memory_lifetimeand its_copy,_direct,_locked,_heap,_heap_uncachedand_convertedvariants, plusagc_driver_host_import_{lifetime,mutation_race,at_map,teardown,windows},agc_host_import_{unmap,retirement,retire,sparse}andguest_memory_lifetime. Three separate runs per commit.VUID-lines35fa2bdd8533842070agc_driver_guest_memory_lifetime, 3/3. It shows the same signature as #7784:radv/amdgpu: The CS has been rejected, see dmesg for more information (-14), thenguest memory host import lifetime: guest prefix unmap failed. BothVUID-lines areVUID-vkResetFences-pFences-01123, logged in that test right after the rejected submission.VUID-lines.Insert instance layer "VK_LAYER_KHRONOS_validation"in every Vulkan-using test of every run (15 inserts per run). No log containswas not found but was requested by env var VK_INSTANCE_LAYERS. No test skipped.Not covered: Windows, titles, performance, the rest of the suite.
Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-20T14:29:56Z.
Windows run of the cut/reimport cases on the exact head, with the negative control. It passes. This is the Windows result that adriadam10's review was waiting on.
Windows 11 Pro 26220, NVIDIA GeForce RTX 4070 (
10de:2786), driver 596.21, Ryzen 7 5700X, WinLibs MinGW-w64 GCC 15.2.0 r7, Release, full build. Head533842070merged ontomain1d4164552. The merge is clean. #7888 was stacked underneath for a separate run; the two PRs share no files.ANYPS5_REQUIRE_VULKAN=1, serial,--repeat until-fail:3:GuestBufferMemory.cppfrommainagc_reimport_bench(Windows only)a cut kept memory imported across the changed host range instead of importing the remaining side again(kept side was imported again after 0 of 5 cuts)agc_host_import_cut_lifetime(Windows only)the side of a page made inaccessible inside the import, nearer its start is served from the import that pinned the changed host rangeagc_driver_host_import_lifetimeguest mutation reached host apply before vkFreeMemory completedagc_driver_host_import_mutation_raceagc_driver_guest_memory_lifetimeand_copy,_direct,_locked,_heap,_heap_uncachedagc_write_tracking,agc_write_tracking_metadata_commitevery cut at the head, at the tail and inside the range retired the original import before importing the remaining side. The kept side was imported again after 5 of 5 cuts, for both tail and inside cuts.GuestBufferMemory.cppand rebuilt, the three tests that failed on the control passed 3/3 again.agc_driver_guest_memory_lifetimepasses on both sides here. On NVIDIA Windows it does not tell the two builds apart; the three tests above do._convertedis registered only on Linux x86_64, so it did not run.Also checked:
-j1 -R '^agc_driver_': 601/604 pass. The failures matchmain:image_array_window_past_layer_limitdoes not build (MinGWalignas(65536)), andpass_input_hazardfails with the same message onmain1d4164552. The third,pm4_replay_tool, failed because of my shell's PATH and passes on a rerun.-j8load passes when rerun serially.git diff --checkpass.mainagainst the PR: no stop line and novkQueueSubmitfailure on either side.Not checked:
main(d50ec76da; the merge is clean).Written with Claude Code assistance (validation by a subagent, reviewed in this session).
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T18:13:08Z.
@adriadam10, the exact-head follow-ups now cover both points from your review on
5338420704b0bdd9cb95055b11e6e76682184efd:GuestBufferMemory.cppfrom the base reproduces the lifetime failure on all three and the guest-prefix failure on RADV.Chuk49 also reports the exact head passing on an AMD Radeon 8060S (Strix Halo, RADV). Could you reassess the outstanding changes-requested review with these results in view, and let me know if you still see a specific gap?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T18:47:52Z.
Pushed the clean rebase to current main (
b85d972f4208). The series now has five focused commits, all authored by MarcZX10. The rebased head passes diff/conventions checks; I have not rerun the runtime tests, and the PR description now distinguishes the previous-head reports from current-head validation. Please reassess this head when convenient.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T18:51:53Z.
Upstream main advanced to
84870f8a, so I rebased the same five-commit series again. Its only intervening main change wasFileEvent.cpp; this PR does not touch that file. The new headd96a03c628passes diff and conventions checks. Runtime tests have not been rerun on this rebased head, and the PR description keeps the earlier-head reports separate. Please reassess when convenient.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T20:40:48Z.
The current head has follow-up commits
d96a03c628andfed5610a0efor the two points in your review. It removes the stale trimmed-import path and updatesdocs/dev/ARCHITECTURE.mdto describe retiring the whole import; the middle-unmap assertion now expects that retirement. The author also added a Windows exact-head run showing the cut/reimport cases pass and the negative controls fail as expected (comment from screamm, Oct 20). Could you recheck the latest head for the prior lavapipe failure and docs wording?Imported from boykopovar/AnyPS5. Originally posted by janzezno on 2026-10-20T20:58:35Z.
Run on RADV, where #7784 reproduces.
Host: Arch Linux, kernel 7.2.11, AMD Radeon RX 7900 GRE (RADV NAVI31), Mesa 26.2.5, GCC 16.2.1, Release,
BUILD_TESTING=ON.main50e0624d7; PR headd96a03c62applied on top.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -R 'guest_memory_lifetime|host_import|agc_driver_recorder' -Vmain:agc_driver_guest_memory_lifetimefails withradv/amdgpu: The CS has been rejected, see dmesg for more information (-14)andguest memory host import lifetime: guest prefix unmap failed; 2 ×VUID-vkResetFences-pFences-01123. The six otheragc_driver_guest_memory_lifetime_*variants pass.VUID-, no CS rejection.was not found but was requested).ctest -j12, 2 runs: no new failures. The two that remain also fail onmain:agc_driver_image_array_window_past_layer_limit(#8361) andagc_driver_tessellation(Mesa, #5444).Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T21:00:49Z.
@adriadam10, could you reassess the current head
d96a03c628ec1125972945c3ed6f4a230ba384c4against your review when convenient?The reviewer's two requested points appear addressed in the current diff: the overlap check now routes cuts through whole-import retirement, and
docs/dev/ARCHITECTURE.mddescribes retiring the import and re-importing surviving ranges. The PR also has exact-head reports on the earlier5338420704revision for the strengthened middle-unmap/prefix assertions, including the parent negative control on Linux GPU setups and Windows. Those runtime reports predate the current rebase; this host cannot run the AGC tests past its CPU-feature guard, and hosted Linux/Windows jobs are skipped. I have not treated those older reports as a runtime pass ford96a03c.Please let us know whether the requested code/docs changes are sufficient, or what specific gap remains on the current head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T21:24:35Z.
Thanks for running the current head on RADV with the validation layer enabled and comparing it with main. The 17/17 result across three runs, with no VUIDs or queue rejection, directly addresses the reported lavapipe/RADV failure and provides a useful exact-head control.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T21:48:04Z.
Thanks for the RADV run and the main control. The 17/17 focused passes across three repeats, with the validation-layer and queue-rejection findings absent on the PR head, are useful independent evidence that this change addresses the reported guest-memory lifetime failure. I’ve noted that the other two full-suite failures also reproduce on main.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T22:39:54Z.
The two requested follow-ups are now present on current head
d96a03c628ec1125972945c3ed6f4a230ba384c4:ARCHITECTURE.mddescribes whole-import retirement on a cut, and surviving ranges being imported again. A fresh RADV/Mesa 26.2.5 run reports the relevant 17/17 tests passing with validation and no VUIDs, but I understand that does not answer your earlier lavapipe failure on Mesa 25.2.8. Could you rerun the exact current head on lavapipe to confirm whether that assertion is resolved? Until then I’m leaving your CI-driver finding open.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T01:38:31Z.
I rechecked current head
d96a03c628ec1125972945c3ed6f4a230ba384c4and the CI checks. The Linux runtime job is skipped, and the available exact-head device reports are Windows/NVIDIA and RADV/RX 7900 GRE; I found no exact-head lavapipe run resolving the original CI-driver failure.WaitForLeasesAndImportsnow routes overlapping cuts through import retirement after dropping the cached address space, but I cannot verify the lavapipe branch locally (the saved worktree is absent and this host lacks the AGC runtime CPU/GPU requirements). Please add an exact-head lavapipe result or keep the reviewer’s driver-specific concern open.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T07:22:43Z.
I rechecked the current head
d96a03c628ec1125972945c3ed6f4a230ba384c4against the earlier middle-unmap report. The new regression now asserts that the import no longer covers the unmapped range, that the prefix import is retired too, and that a later GPU use reimports the retained prefix. The architecture note now describes whole-import retirement on a cut.I built
agc_driver_guest_memory_lifetime_testsand its dependencies with GCC 12.2.0, and the conventions and diff checks pass. I attempted the copy/direct/locked/heap modes, but all abort at startup because this host lacks the AVX2-era CPU features AnyPS5 requires; Vulkan initialization and validation did not run. I updated the Tested section with those exact results. Could you re-review the current code and documentation changes?Imported from boykopovar/AnyPS5. Originally posted by root-over on 2026-10-21T07:23:10Z.
@adriadam10 @MarcZX10 an exact-head lavapipe run, which is the case the review's first point was about, plus RADV on GCN as the control where #7784 reproduces.
Linux (Ubuntu, kernel 7.0), Ryzen 5 5625U, GCC 15.2.0, Release, one build directory.
mainb77bd5880against the samemainwith headd96a03c62merged (clean merge). One ICD per run viaVK_DRIVER_FILES; the logs name the device in every test:18 tests, each run 3 times:
mainmain+ this headVUID-VUID-agc_driver_guest_memory_lifetimefails on its first run withradv/amdgpu: The CS has been rejected, see dmesg for more information (-14)., thenguest prefix unmap failed, with 2VUID-vkResetFences-pFences-01123linesVUID-agc_driver_guest_memory_lifetimepasses 3/3 on this head, including the asserts atGuestMemoryLifetime.cppL123-L126: after the middle unmap, no import spans the range and the prefix is not imported, and the prefix is imported again by the nextFill. So the failure in the review (middle unmap left the original host import alive across the unmapped range) does not reproduce ond96a03c62.mainis the same failure as #7784, and this head removes it.was not found but was requested by env var VK_INSTANCE_LAYERS, and no test was skipped.docs/dev/ARCHITECTURE.mdon this head (L133) describes retiring the whole import, andretireOrTrim,trimmedandreattachTrimmedno longer appear in the docs or the driver, which covers the review's second point.Not run: a title.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T07:24:40Z.
Thanks @root-over for the exact-head controls. This directly answers the lavapipe report: the current head passes all 18 focused tests on lavapipe, and the RADV main control reproduces the reported prefix-unmap failure while this head passes 18/18 with no VUIDs. I’ve added the full environment and results to the Tested section. The architecture note also no longer describes the retired trim path. @adriadam10, could you re-review the current head and update the outstanding review if these address both points?
Imported from boykopovar/AnyPS5. Originally posted by DavidSamir on 2026-10-21T12:03:25Z.
AMD Radeon 680M data point (Windows 11, AMD 32.0.21030.2001, 12 GB RAM),
main27fabb6b7:agc_reimport_benchfails rather than skips there. The default host-import budget is 1236 MiB (HostImportBudgetwith a ~2.4 GB host heap), and the bench holds its 1126 MiB range live while it imports the 256 MiB inside cut (1 imports (256 MiB) refused), so it ends withthe smaller side of a cut inside the re-import bench range was not imported. WithAPS5_HOST_IMPORT_MIB=4096it passes. Since this PR rewrites the bench, a budget skip may belong here.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T16:54:24Z.
I rebased the five implementation commits onto current
mainand added a budget guard for the Windows-only re-import benchmark. It now returns the configured skip code when the current host-import budget has less than 1,382 MiB available, covering the reported 1,236 MiB Radeon 680M setup; otherwise the existing benchmark runs unchanged. The exact current headc566d31d1f472506518ad9490c5347141cdebf1abuildsagc_driver_recorder_testson Linux, and conventions/eligibility/labels/report pass. The benchmark cannot run on this Linux host because it is Windows-only. @DavidSamir, could you rerunagc_reimport_benchon the Radeon 680M at this head and confirm it reports a skip with the default budget, then still passes withAPS5_HOST_IMPORT_MIB=4096? Previous lavapipe/RADV runtime reports were ford96a03c62, before the rebase.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-21T18:10:27Z.
Re-checked both points against the new head:
WaitForLeasesAndImportsnow falls through to the import-retirement loop when an import overlaps the cut, and the middle-unmap test asserts that neither the whole import nor the prefix survives and that the prefix is imported again. The exact-head lavapipe and RADV runs from @root-over (with themaincontrol failing) cover the CI-driver case.docs/dev/ARCHITECTURE.mdnow describes whole-import retirement on a cut, with noretireOrTrim/trimmed/reattachTrimmedleft.The re-import bench skip below the host-import budget also covers the 680M report; merged.