Skip to content

Phase 5 tranche 1: ring reader protocol#9

Merged
NorthernLights merged 1 commit into
mainfrom
feat/phase5-reader-protocol
Jul 19, 2026
Merged

Phase 5 tranche 1: ring reader protocol#9
NorthernLights merged 1 commit into
mainfrom
feat/phase5-reader-protocol

Conversation

@NorthernLights

Copy link
Copy Markdown
Member

Summary

  • core::ring::RingPolicy::reconcile_shared — the driver's slot policy absorbs host-written shared-state transitions: PUBLISHED→READING protects a slot from overwrite; →FREE reuses 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}) and release() (CAS READING→FREE). Keyed mutex remains pixels-only (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, 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

…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>
@NorthernLights
NorthernLights merged commit a5401c4 into main Jul 19, 2026
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants