KRN-NOTIF requirements¶
Each thread shall own a notification bit set that can be set from ISR context without blocking. Rationale: The cheapest completion path from an interrupt to a thread (R-001 §6). Status: Accepted 2026-10-07 Verification: Test: Trace: SPEC-006 §2; 03 §6.1 |
Only the owning thread shall wait on its notifications. Rationale: One possible waiter makes the structure a single slot and every operation O(1). Status: Accepted 2026-10-07 Verification: Analysis: Trace: SPEC-006 §2.2 |
Notification set and wait shall be O(1) and allocation free. Rationale: It is the primitive everything else is built on. Status: Accepted 2026-10-07 Verification: Benchmark: harness operation T8 (R-003 §4); Analysis: no list and no allocation in the path. Trace: SPEC-006 §2.2; R-003 §4 T8 |
Every waitable kernel object shall support binding to one notification bit of one thread; the set shall be O(1) and shall happen on every transition to the ready condition. Rationale: Multi-object wait without poll objects (ADR-027). Status: Accepted 2026-10-07 Verification: Test: Trace: SPEC-006 §3; ADR-027 |
Binding shall not change the object’s own wait-queue semantics for threads blocked directly on it. Rationale: A binding is an observer of transitions, not a waiter. Status: Accepted 2026-10-07 Verification: Test: Trace: SPEC-006 §3.2; SPEC-004 §6.3 |
The Rationale: Bindings need spare bits (answers 08 Q7). Status: Accepted 2026-10-07 Verification: Analysis: Trace: SPEC-006 §1, §2.1 |
The high Rationale: Work queues, supervisor fault delivery, and budget notices need bits the application cannot forge. Status: Accepted 2026-10-07 Verification: Test: Trace: SPEC-006 §2.1, §2.2 |
Bits set while nobody waits shall persist until consumed; a set that satisfies the waiting owner shall hand over the satisfied bits, apply the waiter’s Rationale: The edge-plus-re-check contract the multi-source pattern relies on (SPEC-006 §3.2, §3.3). Status: Accepted 2026-10-07 Verification: Test: Trace: SPEC-006 §2.2, §3.2 |
Rationale: Deterministic ownership of the single binding slot; no dangling-pointer action. Status: Accepted 2026-10-07 Verification: Test: Trace: SPEC-006 §3.1, §3.2 |
In isolated profiles, setting another partition’s thread notification shall require a thread capability with the Rationale: A notification is a cross-partition signal; capabilities govern it like every other cross-partition action. Status: Accepted 2026-10-07 Verification: Test: Trace: SPEC-006 §2.2, §3.1; KRN-CAP-002 |
Notification set (with whether it woke the owner), wait begin and result, and binding signals shall be trace events compiled out when tracing is disabled. Rationale: “Who set my bit” is the first debugging question of event-driven code. Status: Accepted 2026-10-07 Verification: Test: trace decoder reconstructs every set of the conformance run. Trace: SPEC-006 §7; OBS-005 |
Public binding operations shall take one nonzero application-bit mask, reject zero, multiple bits, and kernel bits, and preserve the object’s existing readiness. A caller shall bind before producers start or check and drain existing readiness before its first notification wait; edge-driven consumers shall drain their selected sources before waiting again. Rationale: Matches the M1 semaphore API and prevents confusing a bit index with a mask or waiting for an edge that already occurred. Status: Proposed 2026-10-14; mask validation is implemented for semaphore binding, broader lifecycle validation is pending. Verification: Existing Trace: SPEC-006 §3; A18; A23 |