test(agc): keep the queue-idle store out of the file write cases #7745
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7745"
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 jotitadev on 2026-10-19T05:42:40Z.
What
agc_driver_storage_file_writefailed on the Linux job of an unrelated pull request (#6690, which only touchesGuestSceNet.cpp; job 117871904717, lavapipe, 0.81 s against about 0.1 s for a normal run):The test expects the
unrelatedsurface's image to stay pending through all twelve cases, and the source image to stay pending until the write flushes it. Queue 0 stores every pending image once the queues stay quiet for 50 ms (IdleResultsQuietPeriodinQueueWorker.cpp, fromafbc3c8eb), so a pause of 50 ms or more anywhere in the test, which a loaded runner can cause, flushes both images and fails one of those checks. #7535 (open) wakes queue 0 sooner when storage results are pending, so it would make this more likely, not less.Each case now takes the GPU mutex right after its producer.
StoreIdleResultstakes the same mutex, and it is recursive, so the write and the readback under the hold run as before. If the idle store reached an image before the hold, the case produces it again. Theunrelatedcheck moves inside the case, under the same hold. The file contents check is unchanged.Tested
Intel i7-8700, Ubuntu 26.04, GCC 15.2, Release,
BUILD_TESTING=ON, measured onmain3904ce6cf(the test file is the same on currentmain). lavapipe is Mesa 26.0.3 withGALLIUM_OVERRIDE_CPU_CAPS=avx, as the CI job sets it. The CI log shows/dev/udmabufis not usable there, so the lavapipe runs deny it through anLD_PRELOADshim, which prints the same[gpu] open /dev/udmabuf: Permission deniedline as the CI log.Without load, the test does not fail on
mainon this machine (0 of 1400 runs, 4 copies at a time). To reproduce a loaded runner, each copy is stopped withSIGSTOPfor 70 ms every 20 ms while it runs:mainmainmost of the failures are the CI message (58 of the 64 on lavapipe). The others arean empty or invalid write flushed its source(2),the GPU producer left no pending image(1) andthe GPU producer wrote only zeros(3).main, a 60 ms sleep after the first producer is enough to get the CI message every time. 40 ms passes.FlushGpuWritestaken out ofPrepareHostRead, every case reports 85957 incorrect file bytes and the test fails, on lavapipe and on the RTX 3070.python3 tools/check_conventions.py --base origin/mainpasses.Not checked: Windows, where the test also runs. The change uses only the cross-platform
GpuMutex.Separate from this change: the
wrote only zerosfailures come from a host read that overlaps the idle store.FlushPendingmoves an image frompending.texturestopending.flushingbefore it writes it back, so a host read on another thread (GuestMemory::Read, a file write) finds nothing pending, returns without waiting, and reads guest memory before the write-back lands. A small fixture that runsFlushAllPendingunder the GPU mutex on one thread andGuestMemory::Readon another sees zeros in 190 of 200 reads on lavapipe and in 191 of 200 on the RTX 3070. This change keeps that race out of the test, but it does not fix it.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 jotitadev on 2026-10-19T05:42:47Z.
The product-side race mentioned in the description is now tracked in #7744 (a host read on another thread does not wait for an image the queue-idle store is writing back). This PR only keeps the test deterministic.
Written with AI assistance (Claude Code).