agc_driver_sgpr_pattern_fill_keys times out under parallel ctest load #8708
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 janzezno on 2026-10-20T21:42:29Z.
What
agc_driver_sgpr_pattern_fill_keysfails intermittently under parallelctest. It hits the 10 s deadline inReadAfterWrite(tests/execution/SgprPatternFillKeys.cpp):A passing run takes about 0.15 s, so the dispatch's write note never shows up at all; it isn't just slow.
ReadAfterWriteis called from 8 places with the same message, so the log doesn't show which step timed out.Reproduce
On
maine48bbff9f:ca74ef217it failed in about 3 of 15 fullctest -j12runs.ctest -R '^agc_driver_sgpr_pattern_fill_keys$' --repeat until-fail:20passes 20 of 20 one48bbff9f.agc_driver_guest_memory_lifetime(#7784, #7849),agc_driver_image_array_window_past_layer_limit(#8361) andagc_driver_tessellation(#5444).It isn't specific to this machine. The testing notes on #8066 list
sgpr_pattern_fill_keysfailing on both NVIDIA and AMD with the same-R "agc|shader|spirv|recomp"run, also as a flake under load.Environment
BUILD_TESTING=ONAI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T21:46:13Z.
One diagnostic improvement may make the next parallel failure easier to localize:
ReadAfterWriteis called from eight checkpoints, but each timeout currently reports “the submitted dispatch never became a pending write over the keys.” Passing a short checkpoint label (or submission sequence) intoReadAfterWriteand including it in the timeout would identify which pattern fill failed to produce a note. That would not establish the root cause, but it should distinguish an early setup/preparation failure from a later submission or recorder failure in the same test.Imported from boykopovar/AnyPS5. Originally posted by janzezno on 2026-10-20T21:56:29Z.
Found the cause; it's in the test, and any of the eight checkpoints can hit it.
ReadAfterWritewaits forRecorder::NewestWriteNoteover the keys, but that only scans the open and in-flight batches. If the queue worker submits the dispatch and the batch retires before the test thread takesGpuMutex, the note is gone and the loop can only wait out the 10 s. Under load the test thread is descheduled long enough for that to happen.Reproduced deterministically by adding a 200 ms sleep at the start of
ReadAfterWrite: it fails 3 of 3 with the same message after 10.2 s.APS5_NO_OPPORTUNISTIC_REAP=1doesn't help (3 of 3 still fail), so the end-of-submission drain retires it too.@MarcZX10 thanks, a label would have said which checkpoint. With the cause known I'd rather fix it than label it: I'll send a PR that puts a
WRITE_DATAlabel after the dispatch and resubmits the same fill when the label is written but no note is pending. The assertions stay as they are.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T21:58:58Z.
That diagnosis matches the current
ReadAfterWriteloop: once the queue retires the batch,NewestWriteNoteno longer provides evidence for the already-completed fill. The label-and-retry approach sounds appropriate for a test-side race. Please preserve the deterministic delayed-reader reproduction as regression coverage (or an equivalent controlled scheduling hook), and keep the retry bounded so a genuinely missing dispatch still fails instead of spinning. This will distinguish “write completed before observation” from a dispatch that never wrote.