Skip to content

Sketch: semantic quiescence for .modelTesting (design proposal, no code) - #72

Closed
mansbernhardt wants to merge 4 commits into
mainfrom
docs/quiescence-sketch
Closed

mansbernhardt wants to merge 4 commits into
mainfrom
docs/quiescence-sketch

Conversation

@mansbernhardt

Copy link
Copy Markdown
Collaborator

Design sketch only — no implementation, nothing to merge. Opened as a draft so it renders and can be commented on inline.

The idea: decide settle() / expect from SwiftModel's own registry of work (running / parked / finished) rather than by observing executor and queue idleness. The registry already spans every node.task / forEach / onChange from creation to return; the drive just asks it the wrong question ("has it started" instead of "is it still running"). That closes the yield, background-QoS and clock blind spots by construction rather than one patch at a time, and makes the invariant deterministically testable instead of needing a starved machine to reproduce.

The question that decides viability is §6 tier 2: SwiftModel defines no clock, so a clock.sleep is invisible to it. Nearly every .modelTesting suite sleeps on a TestClock, so if those cannot be marked parked the design is dead. That spike goes first, before the inventory audit.

Also inside: the inventory the soundness rests on, a first-pass audit that already found two unregistered work sources (one of which would break the rule outright if counted naively), what the design deletes, why a wall clock returns only as a reporter of unfinished work, and a staged plan that runs both answers side by side before any verdict depends on the new one.

Read Docs/test-quiescence-redesign.md.

mansbernhardt and others added 4 commits September 7, 2026 16:59
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…mitive at the source is not

parallel-apple defines its own Clock protocol, so wrapping values that conform
to _Concurrency.Clock would match nothing. Any type-recognition mechanism is
fragile for the same reason. Replaced with a single public primitive that the
input source wraps its own suspension in — for their clocks that is one default
implementation plus two overrides, covering every clock.sleep in every model.

Also records Mans's point that unmarked work is bounded by test teardown
cancellation, not only by the backstop, which is what makes adoption
incremental: unmarked suspensions produce a settle() failure naming what to
mark, never a wedged process.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… and async-algorithms

The adoption question answered concretely: node.forEach can mark around its
own next() whatever the sequence is, so debounce/throttle and every other
third-party operator park correctly with zero user action — that is why the
design is cheap in practice. A sequence wrapper covers hand-written loops; a
source wrapping its own await covers a bare clock.sleep, which for
parallel-apple's Clock is three edits because the protocol already funnels
every caller through one method. Third-party library authors need do nothing.

Also records that 'parked' currently conflates waiting-for-the-test with
waiting-for-wall-time, which matches today's behaviour but is a conflation
worth naming.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…is enough

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@mansbernhardt

Copy link
Copy Markdown
Collaborator Author

Closing: the design's implementation (#74) was measured and rejected on cost; not merging the sketch into Docs/ so a rejected design doesn't read as current guidance. Branch kept for the record.

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.

1 participant