Shorten enqueue_barrier and queue_empty loops #1260
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.40) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 281 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.338
Real PR Conversation Timeline
1 comments
"Review active on #1260"
general
weight: 0.35
bader
Summary
oneapi_enqueue_barrierandoneapi_queue_emptykeep the device busy withsingle_taskloops of 1M/3M and 10M iterations. This change reduces them to 1000/3000 and 10000 iterations in all builds.Problem
A
single_taskkernel is one work-group with one work-item. A GPU that supports only work-group (thread-group) preemption can't preempt it until the whole loop has finished. On Windows, when the OS asks the GPU to preempt and it doesn't respond within TdrDelay (2 s by default), the OS resets the device (TDR). The test then fails with device-lost style errors, for exampleUR_RESULT_ERROR_OUT_OF_RESOURCES/PI_ERROR_DEVICE_NOT_AVAILABLEand unwritten kernel results.We see this on Intel GPUs whose default preemption mode is thread-group, e.g. Meteor Lake and Arrow Lake (hw_info_mtl.cpp, hw_info_arl.cpp). The O0/debug variants of both tests fail on most runs there, and so does the optimized
queue_emptyvariant (two chained 10M-iteration kernels, ending withUR_RESULT_ERROR_IN_EVENT_LIST_EXEC_STATUS). GPUs with mid-thread preemption (e.g. Panther Lake, hw_info_ptl.cpp) pass. In our measurements on a thread-group-preemption configuration, the O0enqueue_barriertest passed once TdrDelay was raised to 120 s, but it took about 140 s in total (about 6 µs per loop iteration at O0).Why the change is safe
queue_emptychecks!ext_oneapi_empty()only while the event is not complete yet, so a shorter kernel can't make it fail. It just exercises the "not empty" branch less often.enqueue_barrierchecks ordering through the barrier, which must hold for any kernel duration. Shorter loops make a broken barrier less likely to be caught, which was accepted in review.Testing