fix(agc): keep a context with no settle queue off the settle path #26652
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/26652"
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 Plyxen on 2026-11-24T13:34:12Z.
What
On Windows
importRunAtsettled a private writable import at the import whenever the cached watch decision said private imports settle and the import was at or above the settle floor. It did not ask whether the context has a settle queue.settleImportstarts by locking*context.settleQueueMutex, so a context without one threwstd::system_error(EPERM) from the lock.That context exists in the tests: a bare
Devicehas no settle queue. It reached the settle path becausedecideImportWatchkeeps its decision under theVkDevicehandle and the decision outlives the device, so a bare device created at the handle of a destroyed driver device inherits "private imports settle". Since #10443 the floor is just over 64 KiB, and the 128 KiB import ofagc_driver_native_multisample_depthtakes that path whenever the AMD driver reuses the handle (#26649 has the logs).settlesPrivateImportsnow asks the context for a settle queue and its mutex as well as the decision. It replacesstate.watchPrivateImportsat the two places that act on it for one import: the settle at the import (importWatching) and the queueing of a deferred settle. Such an import stays compared, which is what a context with no settle queue gets from a decision of its own. The deferred settle rounds and the dma-buf settle already made the same check.agc_import_settle_deferredgains a case: it imports 128 KiB through a copy of its context with the settle queue cleared and requires a compared import and no settle.The cached decision outliving its device is not changed here and is recorded in the debt fragment: resetting it in
ClearHostImportswould also drop a mode forced withSetImportWatchin tests that clear the imports afterwards.Tested
Windows 11 Pro 10.0.26200, WinLibs GCC 15.2.0 r7, Release. The table was measured with
mainate68be05111, before the rebase ontoeb4300802c.agc_driver_native_multisample_depth,mainagc_driver_native_multisample_depth, this PRmain(test only, no fix)St12system_errormainctest --test-dir build -R '^agc_.*(import|settle)|native_multisample_depth|native_depth|^windows_write_watch' -V -j 2withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationandVK_LOADER_DEBUG=layer, validation layer 1.4.363. Each of the four logs shows the loader inserting the layer 141 times, none haswas not found but was requested, and none has aVUID-line.eb4300802c:agc_driver_native_multisample_depthpasses 20 of 20 on the Radeon and 3 of 3 on the RTX 5080, the new case passes on both, and no log has aVUID-line. The focused set and the overlap check were not run again; the diff is the same.agc_driver_linear_target_import_creation, the same onmainand here and on both GPUs (#26650). It passes withAPS5_SETTLE_FLOOR_KIB=1024.agc_host_import_sparse,agc_host_import_retire_snapshot, the threeagc_driver_msaa_dcc_compared_importtests andagc_driver_native_depth_driver_queued_fill).python3 tools/check_conventions.pyandpython3 tools/debt_fold.py --checkpass.python3 tools/pr_overlap.py --names ClearHostImports decideImportWatch importWatchinglists no export.--branchcould not compare 46 pull requests that conflict withmain. In their diffs only #22550 edits a line this PR edits (thesettledcondition inimportWatching, where it adds aneedsWatchterm), and none adds the settle queue check.maineb4300802cand this branch both build, andctest -R '^agc_.*(import|settle)|native_multisample_depth|native_depth'gives the same result on both: 89 tests, 79 pass and the same 10 skip. The source change and the new case are inside#ifdef _WIN32, so this shows only that the branch builds there and changes nothing. Not built or run on macOS.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)1002:13c0(Adrenalin 26.11.2, Vulkan driver 2.0.353) and NVIDIA RTX 5080 (621.24), Windows 11; lavapipe (LLVM 20.1.2), Ubuntu 24.04.5 under WSL 2🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by mihiii1337 on 2026-11-25T04:35:47Z.
Review: COMMENTED
Hardware coverage note only — no code verdict on exact head
ccafed0d8f7d877e78d69def729ad38b8eb6adc8.I built two isolated Windows 11 Release arms with WinLibs GCC 15.2/Ninja:
Graphics/src/GuestBufferMemory.cpprestored from parenteb4300802c52ef268e7e0c4038bd6f91ac4a2667.On physical Intel RaptorLake-S Mobile/UHD (
8086:a78b, Intel driver32.0.101.6127), I ranagc_import_settle_deferredandagc_import_settle_deferred_other_familyas three fresh serial CTest processes per test and arm (12 processes total). Every process selected the Intel device, inserted Khronos validation 1.4.369 at instance and device level, and had no missing-layer line, VUID or synchronization-hazard diagnostic.All 12 were capability skips (
SKIP_RETURN_CODE=77), not passes:host imports within 64 KiB, a settle queue or write watching unavailable;no other queue family to settle imports on.A separate pinned-ICD capability probe reported 4 KiB external-host-memory alignment and one combined graphics/compute/transfer queue family; the remaining families were video-decode only. Therefore neither arm reached the new queueless-settle assertion or production guard, and I did not run the optional repeated native-depth case. This Intel adapter cannot add a functional A/B verdict for this fix, but it identifies the exact third-vendor coverage limit.
The candidate and control source scope and all 47 dependency pins were rechecked after the runs. No console or title was exercised.
AI-assisted: yes (OpenAI Codex); exact source arms, isolated builds, artifact/source hashes, 12 fresh CTest/JUnit logs, GPU selection, driver/ICD capability, validation-layer insertion, skip markers and diagnostics were checked directly and independently reviewed.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T05:09:46Z.
Review: APPROVED
Reviewed — looks good
Nothing in the inspected change shows a blocking defect; the new guard prevents private import settling when the context has no settle queue.
What I ran
Read the prepared diff and the changed source ranges at head
ccafed0d8f7d877e78d69def729ad38b8eb6adc8usingrepo_read.pytools. No tests or build commands were run during this review.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full 8,566-line
GuestBufferMemory.cppand 19,384-lineRecorder.cppwere not read; only ranges relevant to the changed hunks were inspected.review/files.jsonwas not available; the manifest identifies both source files as excluded from the prepared folder because they are too large, and the five-line debt fragment as included and read. Tests, build, CI results, and console behavior were not independently verified. Author-reported test results are inreview/description.md.To get this to a good state
Nothing is required.