Phase 5 tranche 1: ring reader protocol#9
Merged
Conversation
…s them
Completes the consumer half of the ring contract ahead of the
LuminalShine integration:
- core: RingPolicy::reconcile_shared absorbs host slot-state transitions
(PUBLISHED→READING protects a slot from overwrite; →FREE reuses it
without counting a drop); tests cover protection, reclaim, and
driver-owned/bogus states.
- host: RingView maps read-write and gains the reader API —
claim_latest() CASes the freshest PUBLISHED slot to READING (bounded
retry on driver races) returning {index, sequence, present_qpc,
generation}; release() CASes READING→FREE. The keyed mutex still only
guards pixels (key 1 after first publish), so metadata-only consumers
need no D3D device.
- driver: publish path reconciles every slot's shared state before
writer decisions.
- vgd-probe --consume: drains the ring at ~5 ms cadence during the hold.
Verified live: 2,012 frames published / 2,011 consumed over a 30 s
4K120 hold with drops frozen at 1 (single pre-attach overwrite).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
|
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.
Summary
core::ring::RingPolicy::reconcile_shared— the driver's slot policy absorbs host-written shared-state transitions:PUBLISHED→READINGprotects a slot from overwrite;→FREEreuses it without counting a drop. Tests cover overwrite protection, reclaim-without-drop, and driver-owned/bogus state handling.host::device::RingView— now maps read-write and implements the consumer side:claim_latest()(CAS the freshest PUBLISHED slot to READING, bounded retry against driver races, returns{index, sequence, present_qpc, generation}) andrelease()(CAS READING→FREE). Keyed mutex remains pixels-only (key 1 after first publish), so metadata-only consumers need no D3D device.vgd-probe --consumedrains the ring at ~5 ms cadence during the hold, exercising the full producer↔consumer loop without LuminalShine.Verification
Live on the dev box (driver 100.2607.1900.1702): 30 s hold at 4K120 — 2,012 published / 2,011 consumed / drops frozen at 1 (single overwrite before the consumer attached). 91/91 workspace tests green; clippy silent.
🤖 Generated with Claude Code