Repository navigation
fix(agc): finish an idle store's write-back before returning - #16011
Conversation
The idle flush (VulkanDevice::StoreIdleResults) records each pending storage image's write-back into the open recorder batch. FlushPending synced the recorder after an idle flush only when it published unit shadows, so a plain write-back into the host import stayed in the open batch until the store's final submit, unwaited. A CPU store made in between was then overwritten with the image. FlushPending now syncs after an idle flush that stored any image or depth or stencil plane, also when nothing is published. Other flush reasons are unchanged. Tests: agc_driver_storage_idle_store_completes (CPU stores made after the idle flush returns are not overwritten by its write-back) and agc_driver_depth_plane_cpu_store_after_idle_flush (the same for a depth plane). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e flush The depth-plane path of FlushPending took the GPU mutex for every flush reason that stored a plane, though only an idle flush waits. waitForIdlePublish now takes it itself after its idle check; its other callers already hold it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I tested the updated head
AI-assisted: yes. |
✅ NVIDIA GPU test: passedPR head
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Passed on retry (1, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)Validation IDs already present on main (9 IDs in 591 tests)Skipped (54)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
# Conflicts: # docs/dev/debt/libSceAgcDriver.md
|
Merged Re-checked on Arch Linux 7.2.11, RX 6650 XT (RADV Mesa 26.2.6): Correction (same day): the validation run quoted above did not load the layer: on this host it is only found with AI-assisted: yes |
✅ NVIDIA GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validated but not compared (1, not in the main baseline's validation pass)Validation IDs already present on main (9 IDs in 596 tests)Skipped (55)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
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.
Some 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.
|
|
Hi @JJenkx, The fix reads sound:
Could you:
Reviewed at 6956f9c. |
|
@oneandonlydean Addressed at Main now auto-registers all execution fixtures; the CTest JSON confirms this test and its inherited skip/runtime setup. The existing depth-plane case remains, with no new negative-control claim for it. Exact logs, fixture, controls and hash receipts, SHA-256 |
|
Fresh Linux qualification of unchanged topic On the same RX 6650 XT/RADV, with
Source pins, production diff, exact commands, raw logs, XML, linkage and hashes, SHA-256 This is focused ordering-regression evidence at those pins, with no new title-unblock or FPS claim. AI-assisted: yes. |
|
Windows NVIDIA check of head Setup: Windows 11 Home 10.0.26300, i9-13900K, WinLibs GCC 15.2.0, Release, RTX 4080 (
AI-assisted: yes |
What
The idle store (
VulkanDevice::StoreIdleResults→StorageTexture::FlushAllPendingUntil("idle")) records each pending storage image's write-back into the open recorder batch.FlushPendingsynced the recorder after an idle flush only when it published unit shadows (db3af40). A plain write-back into the host import publishes none, so its copies stayed in the open batch until the store's final submit, and nothing waited for them. The same held for depth and stencil planes, whichFlushDepthPlanesstores inside the idleFlushPendingunder the reason "depth plane store".Nothing ties the idle store to a point the title can observe. A CPU store made after the idle flush returned and before the GPU ran the copy was overwritten with the image's contents.
FlushPendingnow syncs after an idle flush that stored any image or any depth or stencil plane, also when nothing is published. Other flush reasons are unchanged; the access that triggers them orders them.One window remains, recorded in the queue-idle debt entry: a CPU store made while a piece's copies are running is still not ordered against them.
#13863 and #13920 re-indent the same block in
FlushPending. That is a textual conflict only; neither changes this condition.#6926 is related but separate. It orders host writes (
GuestArena::HostWrite: file and APR reads,recv) after the GPU writes pending over their destination. This PR makes the idle store itself complete before it returns, which also covers the title's own CPU stores. Those do not go through a host-write scope.Tested
Current integration and regression qualification — 2026-11-09. Head
71aae52449a184e854753088f04a77cbe16d1c93includes main7259cce11195f360698772da8c0b3af756bf7c8fand preserves the production idle-store fix. The storage fixture now compiles a real image-store shader and drives a retainedVulkanDeviceon the flushing thread. After the idle flush returns it asserts that the active recorder has no pending write for the stored range. It drains pending work before reporting a failure, so the old-source control has safe cleanup.Linux 7.2.14-arch1-1, GCC 16.2.1 Release, AMD Radeon RX 6650 XT / RADV NAVI23, Mesa 26.2.6. With required Vulkan, no shader cache and the confirmed Khronos layer, the strengthened fixture passes 3/3, fails against exact main's
Texture.cppat the outstanding-write assertion, then passes 3/3 after exact restoration. Zero skips or VUIDs; all ten recorded source, module and executable hashes match after restoration. This addresses the later review that the earlier fixtures could pass without the fix; their old observations below retain their original pins and are not reliable negative controls on this refreshed tree. An initial attempt without the validation layer is explicitly excluded from this qualification.Current main automatically registers execution fixtures. The recorded CTest JSON confirms
agc_driver_storage_idle_store_completesis registered; the shared registration suppliesSKIP_RETURN_CODE 77and the Windows runtime PATH setup. No duplicateadd_testwas added. The existing depth-plane case is preserved, but no new negative-control claim is made for that case.Build logs, frozen fixture, main/source control, exact restoration and validation receipts, SHA-256
e3db99d95de12d09ea6dbd5d1345dacd3b0cc58054b68cd5256ca6a65135ff9a(download and all 36 manifest files verified). No new Windows, title, FPS, full-SDK or hosted-CI pass is claimed; current full CI needs a maintainer dispatch.Earlier qualifications retain their stated source/platform scope.
Linux 7.2.11, AMD RX 6650 XT (RADV Mesa 26.2.6), Release. The tests ran on
main1e24993fa3with this commit. The branch is the same commit cherry-picked cleanly onto7ad9749ed0; thereTexture.cppdiffers only by #12813's log gating.Historical tests at the original pins
agc_driver_storage_idle_store_completes: a CPU store made after the idle flush returns must survive the image's write-back.mainit fails 5 of 5 runs: 983,040 of 1,048,576 bytes are overwritten over 8 rounds.agc_driver_depth_plane_cpu_store_after_idle_flush(a new case inDepthPlanePartialStore): the same check for a depth plane.mainit fails: unit 0 holds 0 of its 16,384 CPU-written texels.agc_driver_depth_plane*tests.Full suites with this change
agc_driver*,video_out*,vulkan*): 996 of 996 passed. Rerun on head4ff434e1a4(the follow-up that takes the GPU mutex in the idle wait only for an idle flush): 996 of 996, including both new tests.Windows, RDNA3 (report by @DonRyuzaki): head
4ff434e1a4onmaind23df92b38, Windows 11, RX 7800 XT, WinLibs GCC 15.2, Release, validation layer on.agc_driver_storage_idle_store_completespassed 5 runs andagc_driver_depth_plane_cpu_store_after_idle_flushpassed 3. Their layer reported onlyVUID-VkDeviceCreateInfo-pNext-pNextat device creation, also on amaincontrol. They did not repeat themain-side failure.Cost check on a slow title: Thymesia (PPSA05213) runs at about 6 FPS here. Its frame gaps exceed the 50 ms idle threshold, so idle stores start between frames, which is where this change adds waits. Eight 185 s runs with the same input, alternating in two orders,
main1e24993fa3against the same base with this change, no compiler running. Median FPS after 90 s:main6.47, 5.76, 5.60, 6.38 (mean 6.05); this change 6.29, 5.70, 6.38, 5.62 (mean 6.00). That is -0.9%, inside the spread of either arm, so I measured no cost. All eight runs exit 0. No performance claim either way.Not claimed: no title result or performance change. I found the race while investigating an intermittent ASTRONEER (PPSA27623) load crash (#8746). This change does not stop that crash: 3 of 12 runs crashed with it, against about 4 of 11 on
main.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)