Repository navigation
Conversation
The transfer queue can finish copying a picture before the decode queue signals its fence. Keep the fences from both successful submissions and wait for them together before releasing the slot.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A copied picture's slot could be reused while its decode fence was still pending. The completion thread waited only for the most recent fence of each picture, the copy's
transfer_fence. The next decode into that slot then reset the decode fence, and the validation layer reportsVUID-vkResetFences-pFences-01123("is in use").Waiting on the copy alone isn't enough. The copy waits on the decode's timeline semaphore, so the decode's GPU work has finished, but the decode submission's fence is a separate signal operation and isn't ordered before a waiter on that semaphore proceeds.
This keeps the fence of each successful decode and copy submission for a picture, and the completion thread waits for both before releasing the slot.
Testing (RTX 4080 SUPER, NVIDIA 620.70.06)
The race needs load to show up. Pinning the process to two CPUs (
taskset -c 6-7) made it reliable:bframes.264, copying pathtests/decode_streams.rs: decodes and flushes 64 full H.264 streams on the forced-copy path, checks every frame, and withPIXELFORGE_VALIDATION=1fails on the reset message. Onmainit failed with five of them; it passes with the fix.drop_non_dropClippy warnings thatmainalso has.cargo test -- --ignoredpasses.main.🤖 Investigated and fixed with GPT-6.2 Astra in Codex, reviewed with Claude Opus 5.5 in Claude Code.