Repository navigation
test(agc): resubmit an SGPR pattern fill whose batch retired before the read saw it - #8715
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
The retry logic matches the reported race, but the deterministic regression described in Tested is not in this diff: the 200 ms post-submit delay was explicitly “not part of this PR.” As a result, normal CI can pass without reaching the new Finished == Submitted recovery branch. Please add a controlled test path that lets one fill retire before ReadAfterWrite begins (for example, an optional test helper that waits for the completion label and queue retirement before polling), then assert that SubmitAndRead resubmits and the original key assertions still pass. That would make the race fix a deterministic regression rather than relying on parallel scheduling.
…imes and cover it deterministically
|
Thanks, |
|
Both reviews are addressed in the second commit, along with the bound from your comment on #8708:
On the final code: 20 of 20 alone with the validation layer (no |
|
Thanks, that confirms the deterministic path and mutation failure. One validation detail remains: did the unmodified |
|
Yes. Rerun on head Arch Linux, kernel 7.2.11, GCC 16.2.1, CMake/CTest 4.4.4, Release, Unmodified head
Mutation (local, not pushed)
|
MarcZX10
left a comment
There was a problem hiding this comment.
The exact-head report resolves my remaining validation request: the unmodified bc49073a2bd7 passed 20 focused Vulkan runs and all 15 parallel selections, and disabling resubmission makes the deterministic retirement case fail as intended. The test diff now forces retirement, asserts a resubmit, and bounds retries at 16. Hosted CI on this head covers conventions/labels only, so I am relying on the author-reported Arch/RADV runtime runs for execution coverage.
|
Follow-up: the author supplied exact-head runtime evidence for |
What
agc_driver_sgpr_pattern_fill_keystimes out under parallelctest(#8708).ReadAfterWritewaits forRecorder::NewestWriteNoteover the keys, which only scans the open and in-flight batches. When the queue worker submits the dispatch and its batch retires before the test thread takesGpuMutex, the note is gone and the loop waits out its 10 s deadline.Submitnow appends aWRITE_DATAof a sequence number after the dispatch.SubmitAndReadreplaces eachSubmit+ReadAfterWritepair. If the note isn't pending but the label already holds the latest sequence number, the dispatch was recorded (it comes before the label in the DCB) and has retired, so the same fill is submitted again, at most 16 times; past that the test fails withthe dispatch completed N times without a pending write over the keys, so a dispatch that never notes its write fails at once instead of at the deadline. The existing assertions are unchanged.A new case makes the race deterministic:
SubmitAndRead(..., retireFirst = true)callsSettle()after the submit, so the fill has retired before the first poll. It asserts the fill was submitted again, then the same pending-0001 key assertions as the main loop.Tested
Arch Linux, kernel 7.2.11, GCC 16.2.1, Release,
BUILD_TESTING=ON, onmaine48bbff9f.mainfails 3 of 3 withthe submitted dispatch never became a pending write over the keysafter 10.2 s; the first commit passes 3 of 3 in 2.45 s.retireFirstcase fails at the 10 s deadline; with the note looked up at the wrong address (a dispatch that never notes), the test fails in 0.09 s withthe dispatch completed 17 times without a pending write over the keys.ctest --test-dir build -j12 -R 'agc|shader|spirv|recomp' --output-on-failure:mainfailed this test in run 7 of 7; the first commit passes it in 15 of 15 runs (0.10 to 0.13 s), the second in 15 of 15 (0.08 to 0.11 s). The other failures in those runs also fail onmainhere:agc_driver_guest_memory_lifetime(agc_driver_guest_memory_lifetime fails on RADV since the host-import cut larger-side keep (16473dbbe, #6499 family) #7784),agc_driver_image_array_window_past_layer_limit(test(agc): match array sample expectations to the view #8361),agc_driver_tessellation(agc_driver_tessellation segfaults on RADV with Mesa 26.2+: nir_opt_varyings corrupts the TCS input offset's use list (Mesa bug) #5444), and the occasionalagc_driver_pixel_interlockandagc_driver_storage_read_during_idle_store.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -R '^agc_driver_sgpr_pattern_fill_keys$' -V --repeat until-fail:20: 20 of 20 onmain, on the first commit and on the second, noVUID-in either log, nowas not found but was requested.python3 tools/check_conventions.py --base origin/mainpasses.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)