You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(core): gate QueueEmpty on the wait outcome instead of re-reading the fence
Per review feedback, the extra fence read existed only to service the
defensive assert. Instead, capture the previously ignored `Ok(bool)` wait
outcome and only report `QueueEmpty` when the wait did not time out. A
timed-out wait racing a concurrent poller resolves to `WaitSucceeded` or
`Timeout` instead, and the next poll observes the empty queue. This makes
the documented `PollStatus::QueueEmpty` contract ("implies that the given
Wait was satisfied") actually hold.
The gate excludes only the timed-out case (`!= Some(false)`) rather than
requiring a successful wait, so `PollType::Poll` keeps its ability to
report `QueueEmpty`, which `poll_all(force_wait: false)` and non-blocking
drain loops rely on. With the gate in place, the existing fence sample is
provably at or above the wait index whenever the assert runs: it was read
after the successful wait, and the fence is monotonic.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ Bottom level categories:
80
80
81
81
- Zero-initialize padding (if any) at the end of a buffer allocation. This was application-visible in rare cases on Vulkan when a shader read beyond the valid range of a vertex buffer. By @andyleiserson in [#9791](https://github.com/gfx-rs/wgpu/pull/9791).
82
82
- Fix required immediate slots calculation and remove `naga::valid::FunctionInfo::immediate_slots_used`. By @beicause in [#9725](https://github.com/gfx-rs/wgpu/pull/9725).
83
-
- Fix a panic on the queue-empty assert in `Device::maintain` when more than one thread polls the same device. By @AdrianEddy in [#9958](https://github.com/gfx-rs/wgpu/pull/9958).
83
+
- Fix a panic on the queue-empty assert in `Device::maintain` when more than one thread polls the same device. A timed-out `Wait` poll that races a concurrent poll on another thread now returns `WaitSucceeded` or `Timeout` instead of `QueueEmpty`; `QueueEmpty` is only returned when the poll itself proved it, as its documentation already promised. Polling again reports the empty queue. By @AdrianEddy in [#9958](https://github.com/gfx-rs/wgpu/pull/9958).
0 commit comments