Expand description
timing.v1: a stream’s cadence, its deadline and its lifespan
(spec/profiles/timing/v1.md, #908).
The profile’s session-free half: the declaration read from a resolved resource (§2.2, §2.3), a reader’s deadline tracker for one provider and resource (§2.5), the lifespan of each sample a reader judges (§2.6), the period over a tool’s window (§2.7), and §5’s three questions.
declaration(kind, annotations) ─▶ declared {period, deadline, lifespan, below_period} │ invalid [reasons] │ ignored │ not this profile's
Tracker::observe(at, event) ─▶ missed {due, by, owner} │ met │ ended {gone, forgotten} │ beyond_bound §2.5
events: start │ arrival(member, expired) │ owner(present, unconfirmed, absent) │ member_gone │ tick
LifespanReader::judge(stamp) ─▶ live │ expired │ unobservable │ not asked │ not this profile's, + reason §2.6
period_window(period, window, …) ─▶ kept │ not_kept │ too_short │ not_heard §2.7
Holding::observe(tracker, reports, at) ─▶ each member's held time: while heard, missed or waited for, to its first end §2.7
deadline_met / period_kept / lifespan_expired ─▶ yes │ no │ unobservable │ not_asked │ not_this_profiles §5
roll_up / roll_up_first ─▶ a resource's or a run's answer, and its first member's reason §5There is no I/O and no clock here. A reader takes each arrival’s instant
on its monotonic clock and each sample’s age on its wall clock, follows
its provider’s presence, and hands them over as values: the runtime
drives Tracker from its subscription and a one-shot timer at
Tracker::next_due, and a tool drives the same tracker over its
window. A sample’s age is
freshness::StampAge, and a clock that
falsified the deployment’s word is found as freshness.v1 §2.6 finds
one, with freshness::ClockMeasure.
Structs§
- Deadline
Account - The tracker’s account of one member over the window (§2.7).
- Declared
- A timed resource’s values (§2.2), each
Nonewhen its key is absent. - Held
Span - How long a tool held one member in its window, so far (§2.7): its
longest unbroken stretch, see
Holding. - Holding
- How long a tool held each member of one tracker in its window (§2.7;
text 0.5, F-278, F-280): the account
DeadlineAccount::heldreads, the longest unbroken stretch it held the member, never the sum of its stretches. - Judged
- An answer and its reason.
- Lifespan
Reader - One reader’s lifespan judgement over one reading of one provider’s resource (§2.6): the subscription’s lifetime, or a tool’s window. It remembers, per stamping clock, the stamp furthest ahead, so that a clock that falsified the deployment’s word stays unobservable for the rest of the reading.
- Mono
- An instant on the reader’s monotonic clock (§0): the time since an origin of the reader’s choosing, which never steps backwards.
- Period
Reading period_window’s answer: the verdict, the arrivals in the span, and the span’s length (Nonewhen not heard).- Sample
- One sample’s lifespan judgement (§2.6).
- Stamped
- A sample’s stamp as a lifespan reader sees it (§2.6).
- Tracker
- One reader’s deadline tracker for one provider address and one resource
(§2.5): a pure state machine over (instant, event) inputs. At each
event it first judges every member it holds at that instant, then
applies the event;
Tracker::next_dueis when a miss is next due, for a one-shot timer that meets the detection bound. - Window
- What a tool’s window establishes of every member (§2.7).
Enums§
- Answer
- A question of §5, answered in the three states: a pole of each established kind, and the unestablished kinds apart (core O5).
- Declaration
- What a reader reads of a resolved resource or a requirement (§2.2, §2.3).
- EndReason
- Why a reader stopped judging a member (§2.5).
- Event
- What a reader hands its tracker, at an instant (§2.5).
- Invalid
- Why a declaration is invalid (§2.2), in the order checked.
- Member
State - Where a held member stands (§2.5).
- Owner
State - The owner’s token as the reader observes it (§0).
- Period
Verdict - What one member’s arrivals over a window say of its period (§2.7).
- Question
- §5’s three questions, each with the pole that is its finding.
- Reason
- Why an answer is what it is: the fixtures’ reasons (§2.6, §5).
- Report
- A report a tracker makes (§2.5).
- Sample
Verdict - The answer of one sample’s lifespan (§2.6).
Constants§
- BOUND_
FLOOR - The floor of the detection bound (§2.5): 1 ms.
- DEADLINE_
MS timing.deadline_ms(§4).- FORGET_
AFTER - How long after its last arrival a member that is not known, once missed, is forgotten (§2.5): an hour, core §2.7’s liveness span of a stream member.
- LIFESPAN_
MS timing.lifespan_ms(§4).- MAX_MS
- The largest value, in milliseconds: 2^53−1, the canonical domain’s bound (§2.2, core §9.5).
- NAME
- The profile’s name, as an annotation key’s prefix carries it.
- PERIOD_
MS timing.period_ms(§4).- PROFILE
- The profile’s id, as a contract lists it in
uses. - VOCABULARY
- The published vocabulary (§4): the keys under
timing., which W105 reads in place of core Appendix D’s interim row (core 0.53), unchanged.
Functions§
- deadline_
met - §5’s first question: did this member meet its deadline over the window? No is the finding.
- declaration
- Reads the declaration of a resource of
kindfrom its resolved annotations (§2.2, §2.3):[defaults], then[defaults.<kind>], then its own, as the contract model merges them (core §9.3). The kind is read first, then each key alone. Anothertiming.<key>is W105’s and plays no part. - declaration_
of declarationof a resource of a contract.- detection_
bound - The detection bound of a deadline (§2.5): max(deadline/50, 1 ms). A reader reports a miss at most this long after it is due.
- lifespan_
expired - §5’s third question: did a sample of this member arrive expired? Yes is the finding.
- period_
kept - §5’s second question: did the owner keep this member’s period over the window? No is the finding.
- period_
window - One member’s period over a window from
fromtoto(§2.7), on the reader’s monotonic clock: the span starts atfromfor aknownmember, else at its first arrival within the window, and ends atendedwhen the member ended within the window, else atto; its arrivals are those within the span, both ends included. - requirement_
declaration - The declaration of a requirement (
[requires.<role>]) from its own annotations (§2.3): a key of the vocabulary there means nothing at this version, and a linter warns of it. - roll_up
- §5’s roll-up of one question over a resource or a run, read by its finding (text 0.2, F-264), a member not asked, or not this profile’s, set aside: the finding when any member’s answer is the finding; the other pole when every member’s answer is that pole or set aside, and at least one is that pole; when every member is set aside, and there is at least one, not this profile’s when every one is, else not asked (text 0.4, F-277); unobservable otherwise, an unobservable member and none the finding, or no member at all.
- roll_
up_ first - §5’s roll-up with its reason (text 0.5, F-279):
roll_up’s answer overmembers, each its key, its answer and its reason, and the first member giving that answer in byte order of the keys, with its reason, whatever order they come in;Noneover no member. Over one member or more the answer is always some member’s:unobservableis the roll-up’s only when a member’s is, or when there is none. - tracker_
for - The tracker a reader judges a resource of
kindand declarationdby (§2.2, §2.5):Nonewhen it judges no deadline, the resource not a stream, its declaration invalid, no deadline declared, or the deadline below the period (text 0.2, F-259).boundandknownareTracker::new’s. - zid_
value - A zid’s value from its text (core §3.3): 1 to 32 hexadecimal digits, case and leading zeros carrying no meaning.