test(agc): measure address passes over settled host imports #7414
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7414"
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 thuanquang on 2026-10-18T05:15:36Z.
What
agc_driver_address_passesfails onmainon Windows with a GPU since #6678 was merged:I bisected it on an RX 6700 XT over the merges since
1e2d9b369:a84027dcb, the merge before #6678, passes 3 of 3;755fecb33, #6678's merge, fails, and so doesmain4566cc337on every run I made (seven runs, with and without unrelated changes).CI doesn't show it: the Windows jobs have no Vulkan device, and the Linux jobs never settle imports.
The test's guest blocks are 64 KiB host imports. Since #6678, the driver settles an import under 1 MiB without waiting for it, and keeps the import compared until the settle's fence signals. The draws in
ReadersShareAPasscome right after the imports are made, while their settles are still pending:APS5_TRACE_DRAWS);With
APS5_NO_DEFERRED_SETTLES=1the same build passes 3 of 3.The test measures how draws through the BDA table share passes (#7184), not how imports settle. So it now turns deferred settles off with
SetHostImportDeferredSettles(false), as #6678 did forRunHintedImportinDccKeysFirstWrite.cpp. The function does nothing off Windows. Settles are still covered by #6678's own tests.What this leaves open, for @EagleBearerYS to judge: on Windows, a draw over memory that was imported moments before now begins a new pass until the import's settle completes. That is the cost #6678's description accepts for not waiting.
Tested
Windows 11 26200, AMD Radeon RX 6700 XT (gfx1031), driver 32.0.21045.5002, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON,ANYPS5_REQUIRE_VULKAN=1:agc_driver_address_passespasses 5 of 5 with this change onmainbb2624a53, and fails without it.agc_driver_address_passes_targets_splitpasses 5 of 5.ctest --parallel 4 --timeout 120onmainbb2624a53with this change: 1469 tests. The only failures are three AMD GPU tests that fail without it too:agc_driver_lds_mixed_width_atomics(#6976),agc_driver_lds_lock_budget(#7344) andagc_driver_layered_volume_vertex_no_gpl(#4768).python tools/check_conventions.py --base origin/mainwith this title and body passes.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-18T05:24:42Z.
Thanks @thuanquang for the bisect and the trace. Your reading matches #6678's code. On Windows, an import under 1 MiB of write-watched private memory now starts out compared and queues a settle. Settles are polled from host-import lookups (
HostImportForandimportAllocation), at most every 100 µs and only on a thread that holds the GPU lock: one lookup submits the settle batch, and a later one, after the batch's fence signals, returns the import to the write watch.ReadersShareAPassdraws right after its blocks are imported, with no lookup between that could settle them, so both draws read compared memory and the second one can't continue the first one's pass.The test change is right. The test is about how draws through the BDA table share passes, and turning deferred settles off there is what #6678 did for
RunHintedImportinDccKeysFirstWrite.cpp. Waiting for the blocks to return to the write watch before drawing would also work, but your change keeps the test about passes.On the cost: the extra passes and compared reads last only while a new import's settle is pending, so they fall on the first draws over memory imported moments before, not on draws over memory imported a while ago. A title that maps new memory every frame would pay it every frame. We're running
agc_driver_address_passeson an NVIDIA RTX 3070 tonight, with and withoutAPS5_NO_DEFERRED_SETTLES=1, and will add the result here.Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-18T08:55:55Z.
@thuanquang the NVIDIA run matches yours, and it shows something our reading above missed. On an NVIDIA GeForce RTX 3070 Laptop GPU (driver 617.42), Windows 11, with a MinGW Release build of
main3de84fa106,agc_driver_address_passesfails in 3 of 3 runs with the same two lines, and passes 3 of 3 withAPS5_NO_DEFERRED_SETTLES=1.agc_driver_address_passes_targets_splitpasses 3 of 3 either way.Before the two lines, each failing run prints:
That is a bug in #6678, not only the compared window after a fresh import that we described above. On Windows, an import under 1 MiB returns to the write watch after its deferred settle, and the return marks its blocks as stored by the CPU. A storage image that took its generation before the return, and whose draw marked its GPU results pending after it, has those results dropped at its next refresh, which uploads the guest bytes instead.
#7476 fixes it: a settled import under a live storage image stays compared, as it did before #6678. With #7476,
agc_driver_address_passespasses 3 of 3 on the same RTX 3070 with deferred settles on and without this PR's opt-out. So once #7476 is in, the opt-out isn't needed for the test to pass; whether to keep it, so the test stays about passes, is up to you.Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-18T12:37:28Z.
Closing in favour of #7476, which fixes the race behind this failure. Thanks @EagleBearerYS for finding it, and @jacob6769 for the 40-run table showing this opt-out would only have hidden it. With #7476 in,
agc_driver_address_passespasses onmain3e3e8b905on my RX 6700 XT with deferred settles on, so the test keeps covering that path.Pull request closed