Context
kiln's embedded async scheduler (kiln-async — no_std/no_alloc cooperative scheduler, REQ_ASYNC_SCHED / SM-ASYNC-001) plans to reuse spar's machine-checked scheduling theory for its bounded-latency / schedulability verification, rather than re-deriving it. The kiln design doc names this as headline reuse:
RTA iterN_le_fixed_point, RMBound, EDF → termination + WCRT + schedulability proofs
I surveyed proofs/Proofs/Scheduling/{RTA,RMBound,EDF}.lean and they are exactly what we need — fully proved (zero sorry/admit/axiom), parameterized over generic Nat cost units, so kiln-async's fuel quantum maps directly onto spar's exec unit. The directly-relevant results:
bounded_mono_nat_seq (RTA.lean:123) + rta_terminates (RTA.lean:153) — fixed-point iteration terminates within deadline+1 steps.
iterN_le_fixed_point (RTA.lean:174) — the converged value is the least fixed point (WCRT is not pessimistic).
edf_two_tasks_demand (EDF.lean:88) — EDF feasibility from pairwise utilization; fully computational (no reals).
rmBound_ge_ln2 (RMBound.lean:49) — Liu & Layland RM utilization bound.
This is forward-looking coordination, not a blocker: kiln-async is at Phase 1 (FIFO MVP, no deadline analysis yet). The reuse lands at kiln-async Phase 4 (fixed-priority + EDF modes) and Phase 5 (Lean+Aeneas refinement). Filing now so the dependency surface is shaped before we depend on it.
Asks (in priority order)
-
Make Proofs/Scheduling consumable as a stable dependency. Today it's the Proofs Lake library mixing all of spar's proofs. Could the scheduling theory be exposed as a stable, importable module boundary (a dedicated Lake package, and — since kiln's Lean toolchain integration runs through rules_lean — ideally a Bazel lean_library target) so kiln-async can depend on it without vendoring/copy-paste? A versioned/pinned boundary keeps a spar refactor from silently breaking kiln's proof gate.
-
A shared abstract task model (or a documented instantiation contract). RTA, EDF, and RMBound each define their own Task/TaskUtil struct. For a fuel-based consumer to instantiate cleanly we'd want either a single abstract task record the three modules share, or a short "how to instantiate with your own cost unit" note confirming the theorems are unit-agnostic (they appear to be — generic Nat). This is the difference between "import and instantiate" and "re-prove the glue."
-
Extend lake exe codegen to EDF/RM feasibility checks. Codegen.lean already extracts the proven RTA definitions to Rust (scheduling_verified.rs) — exactly the "verified code we can run/execute" path kiln-async wants. Could it be extended to also emit rm_schedulable (from RMBound) and edf_schedulable (from the demand-bound lemmas)? Then kiln-async's Phase-4 admission/feasibility test consumes spar-verified analysis instead of an unverified reimplementation.
What kiln owns (not asks of spar)
References
- kiln:
docs/architecture/async-scheduler-plan.md (§6 verification plan, §9 reuse summary), REQ_ASYNC_SCHED, SM-ASYNC-001
- spar:
proofs/Proofs/Scheduling/{RTA,RMBound,EDF}.lean, proofs/Codegen.lean
Context
kiln's embedded async scheduler (kiln-async —
no_std/no_alloccooperative scheduler, REQ_ASYNC_SCHED / SM-ASYNC-001) plans to reuse spar's machine-checked scheduling theory for its bounded-latency / schedulability verification, rather than re-deriving it. The kiln design doc names this as headline reuse:I surveyed
proofs/Proofs/Scheduling/{RTA,RMBound,EDF}.leanand they are exactly what we need — fully proved (zerosorry/admit/axiom), parameterized over genericNatcost units, so kiln-async's fuel quantum maps directly onto spar'sexecunit. The directly-relevant results:bounded_mono_nat_seq(RTA.lean:123) +rta_terminates(RTA.lean:153) — fixed-point iteration terminates withindeadline+1steps.iterN_le_fixed_point(RTA.lean:174) — the converged value is the least fixed point (WCRT is not pessimistic).edf_two_tasks_demand(EDF.lean:88) — EDF feasibility from pairwise utilization; fully computational (no reals).rmBound_ge_ln2(RMBound.lean:49) — Liu & Layland RM utilization bound.This is forward-looking coordination, not a blocker: kiln-async is at Phase 1 (FIFO MVP, no deadline analysis yet). The reuse lands at kiln-async Phase 4 (fixed-priority + EDF modes) and Phase 5 (Lean+Aeneas refinement). Filing now so the dependency surface is shaped before we depend on it.
Asks (in priority order)
Make
Proofs/Schedulingconsumable as a stable dependency. Today it's theProofsLake library mixing all of spar's proofs. Could the scheduling theory be exposed as a stable, importable module boundary (a dedicated Lake package, and — since kiln's Lean toolchain integration runs throughrules_lean— ideally a Bazellean_librarytarget) so kiln-async can depend on it without vendoring/copy-paste? A versioned/pinned boundary keeps a spar refactor from silently breaking kiln's proof gate.A shared abstract task model (or a documented instantiation contract). RTA, EDF, and RMBound each define their own
Task/TaskUtilstruct. For a fuel-based consumer to instantiate cleanly we'd want either a single abstract task record the three modules share, or a short "how to instantiate with your own cost unit" note confirming the theorems are unit-agnostic (they appear to be — genericNat). This is the difference between "import and instantiate" and "re-prove the glue."Extend
lake exe codegento EDF/RM feasibility checks.Codegen.leanalready extracts the proven RTA definitions to Rust (scheduling_verified.rs) — exactly the "verified code we can run/execute" path kiln-async wants. Could it be extended to also emitrm_schedulable(from RMBound) andedf_schedulable(from the demand-bound lemmas)? Then kiln-async's Phase-4 admission/feasibility test consumes spar-verified analysis instead of an unverified reimplementation.What kiln owns (not asks of spar)
rules_lean(nocharon_compilerule yet — kiln's risk R3); that's ours/rules_lean's, not spar's. Until it lands, kiln-async refines against your theorems via manual refinement statements, which is why a stable theorem API (ask Add semantic analysis layer, LSP server, WIT transform, and advanced analyses #1) matters now.References
docs/architecture/async-scheduler-plan.md(§6 verification plan, §9 reuse summary), REQ_ASYNC_SCHED, SM-ASYNC-001proofs/Proofs/Scheduling/{RTA,RMBound,EDF}.lean,proofs/Codegen.lean