Skip to content

lab: Milestone 3 dext bring-up — ZTS timer chain, activation host, bench runbook#24

Merged
mrmidi merged 2 commits into
mrmidi:DICEfrom
boggspa:lab/m3-dext-bringup
Jun 10, 2026
Merged

lab: Milestone 3 dext bring-up — ZTS timer chain, activation host, bench runbook#24
mrmidi merged 2 commits into
mrmidi:DICEfrom
boggspa:lab/m3-dext-bringup

Conversation

@boggspa

@boggspa boggspa commented Jun 10, 2026

Copy link
Copy Markdown

What

Milestone 3 per the lab README: the dext becomes loadable and answers O1–O3 / C1–C4 with counters, not docs. Stacked on #23 (Step 6) — review the top two commits; the base commit is the Step 6 verifier this work runs under.

The dext clock model (commit 1)

  • ZTS timer chain: IOTimerDispatchSource on the work queue, kIOTimerClockMachAbsoluteTime (the clock CoreAudio host times use). Each fire anchors UpdateCurrentZeroTimestamp(n × period, fire_time) with raw values — nominal drift-free deadline chain (derived from the period index via mach_timebase_info, never from the previous jittered fire), actual fire times, host smooths via the clock algorithm. No driver-side extrapolation — the reference model from the README.
  • Packet pump: the same fire exposes the next period's packets via the controller — the lab analog of the IT-ring refill interrupt. WriteEnd only fills PCM into already-exposed packets (the Saffire one-buffer model).
  • Verifying(Fake) under real pacing: the Step 6 instrument + StickyCounterSink run for the whole IO session; StopIO dumps everything via IOLog (ADKLab[dump] prefix — never from the IO callback).
  • O/C instrumentation: anchors-before-first-WriteEnd (C1 — the lab proxy for the ASFW "no ZTS anchor → no IO cycle" bug), WriteEnd shape stats: min/max in_io_buffer_frame_size, sample-time continuity breaks, first-callback tuple (C3), callbacks/timer fires after StopIO counted-not-crashed and logged at free (O2), prepare-failure and other-op counters.
  • SetTransportType(FireWire) — the contract ASFW will live under.
  • Ring widened to 8 ZTS periods (4096 frames, matching the host scenario pump). The 1-period ring left the HAL zero headroom around the wrap anchor; kRingPeriods keeps C4 observable.

Info.plist matching fix — please audit

IOProviderClass was IOUserService; a hardware-free dext matches IOUserResources (+ IOResourceMatch: IOKit) — with the old value the personality should never match and the dext never starts. Flagging explicitly since it's your file; revert if it was intentional.

Bring-up harness (commit 2)

  • ADKLabHost: minimal SwiftUI activation app; xcodegen embeds the dext into Contents/Library/SystemExtensions; the dext identifier is discovered from the embedded bundle at launch so bundle-id-overriding signing lanes need no code edits.
  • Entitlements files for both targets (signing itself stays off by default, exactly as before — your lane is untouched).
  • BENCH.md: both signing lanes (ad-hoc SIP-off bench / provisioned SIP-on), activation, driving audio, reading the dump, and the counter → O1–O3/C1–C4 mapping with M3 exit criteria.

Verification

xcodegen generate
xcodebuild -scheme ADKVirtualAudioLabTests → BUILD SUCCEEDED; 17440 checks, 0 failures
xcodebuild -scheme ADKVirtualAudioLab      → BUILD SUCCEEDED (dext)
xcodebuild -scheme ADKLabHost              → BUILD SUCCEEDED (dext embedded correctly)

Every API claim verified against the DriverKit 25.2 SDK headers (IOLib.h ships mach_timebase_info/mach_absolute_time; IOTimerDispatchSource.iig; IOUserAudioClockDevice.iig) — no invented surfaces.

Runtime bring-up (activate + play + read dump) happens next on Chris's SIP-on machine with his DriverKit entitlements; results will be reported back so the README's O/C answers can be recorded.

🤖 Generated with Claude Code

boggspa and others added 2 commits June 10, 2026 11:38
…real pacing

Implements the Milestone 3 dext clock model per the lab README:

- IOTimerDispatchSource on the work queue fires once per ZTS period
  (512 frames @ 48k) in kIOTimerClockMachAbsoluteTime; each fire anchors
  UpdateCurrentZeroTimestamp(n*period, fire_time) with raw values — the
  deadline chain is nominal (derived from the period index via
  mach_timebase_info, drift-free), host times are actual fire times, the
  host smooths via the clock algorithm. No driver-side extrapolation.
- The same fire exposes the next period's packets through the controller
  (the lab analog of an IT-ring refill interrupt): hardware requests data
  on its interrupt; WriteEnd only fills PCM into already-exposed packets.
- Step 6 Verifying(Fake) + StickyCounterSink run for the whole IO session;
  StopIO dumps verifier counters, payload miss buckets, and the O/C
  instrumentation via IOLog (ADKLab[dump] prefix, never from the IO path).
- O/C instrumentation: anchors before first WriteEnd (C1), WriteEnd shape
  stats — min/max io size, sample-time continuity, first-callback tuple
  (C3), io/timer fires after StopIO counted not crashed (O2, logged at
  free), other-op counter, prepare-failure counter.
- SetTransportType(FireWire) — the contract ASFW will live under.
- Output ring widened to 8 ZTS periods (4096 frames, matches the host
  scenario pump); a 1-period ring left the HAL zero headroom (C4 stays
  observable by varying kRingPeriods).
- Info.plist: match on IOUserResources + IOResourceMatch IOKit (a
  hardware-free dext cannot match IOUserService as provider — it would
  never start); non-empty OSBundleUsageDescription.

All APIs verified against the DriverKit 25.2 SDK headers (IOLib.h
mach_timebase_info/mach_absolute_time, IOTimerDispatchSource.iig,
IOUserAudioClockDevice.iig). Dext + host tool targets build; host suite
17440 checks, 0 failures.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- ADKLabHost: minimal SwiftUI host that embeds the dext (xcodegen embeds
  driver-extension dependencies into Contents/Library/SystemExtensions)
  and submits OSSystemExtensionRequest activate/deactivate. The dext
  identifier is discovered from the embedded bundle at launch so signing
  lanes that override bundle ids need no code edits.
- Entitlements files for both targets (system-extension install; driverkit
  + family.audio) — referenced by the signing lanes, signing itself stays
  OFF by default exactly as before.
- BENCH.md: the M3 procedure — both signing lanes (ad-hoc SIP-off bench /
  provisioned SIP-on), activation, driving audio, reading the ADKLab[dump]
  output, and the counter -> O1-O3/C1-C4 mapping with the M3 exit criteria.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@boggspa boggspa changed the title lab: Milestone 3 dext bring-up — ZTS timer chain, activation host, bench runbook (stacked on #23) lab: Milestone 3 dext bring-up — ZTS timer chain, activation host, bench runbook Jun 10, 2026
@mrmidi mrmidi merged commit 57255cc into mrmidi:DICE Jun 10, 2026
2 checks passed
mrmidi added a commit that referenced this pull request Jun 10, 2026
lab: Milestone 2 — SYT realism: TxTimingModel, simulated timeline, P5 verification (stacked on #24)
mrmidi added a commit that referenced this pull request Jun 12, 2026
lab: Milestone 3 dext bring-up — ZTS timer chain, activation host, bench runbook
mrmidi added a commit that referenced this pull request Jun 12, 2026
lab: Milestone 2 — SYT realism: TxTimingModel, simulated timeline, P5 verification (stacked on #24)
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