proofs(rta): jittered RTA convergence theorem (Track A commit 3/4)#148
Merged
proofs(rta): jittered RTA convergence theorem (Track A commit 3/4)#148
Conversation
Adds proofs/Proofs/Scheduling/RTAJittered.lean stating monotonicity and least-fixed-point convergence of the jittered response-time recurrence implemented as compute_response_time_jittered in PR #147. Theorem 2 connects the new function to the classical rtaStep when all jitters and ISR overheads vanish — the non-regression property that anchors the Rust-side test no_isrs_matches_classical_rta. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
4 tasks
avrabe
added a commit
that referenced
this pull request
Apr 25, 2026
…I integration (#154) Closes the v0.7.0 Track A milestone: - COMPLIANCE.md "In progress / v0.7.0" expanded into a full narrative covering all four Track A commits (foundation #145, hierarchical RTA #147, Lean convergence #148, this close-out), the Track B variant- contract foundation (#144), v0.7.x infrastructure landings (#141-143, #151), and v0.8.0 planning anchors (Track D #149/#152, Track E #150/#153). - Updated header date to 2026-04-25 and crate count from "16 crates, 1200+ tests" to "17 crates, 1900+ tests" reflecting the test growth through Track A and the v0.7.x infrastructure additions. - New CLI integration test crates/spar-cli/tests/track_a_close_out.rs exercises the full parse → instance → analyze pipeline on a model using the Spar_Timing::ISR_* property surface plus a sporadic handler thread. The unit + fixture tests in spar-analysis cover the algorithm at the analysis-crate level; this test guards the property surface flowing through the CLI binary end-to-end. Out-of-scope items explicitly recorded: PIP/PCP blocking deferred to v0.7.1, multi-processor ISR migration deferred, cache-aware interference inflation deferred to v1.0+. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 tasks
avrabe
added a commit
that referenced
this pull request
Apr 25, 2026
The Lean compiler requires `import` statements to appear before any other top-level content (including doc-comment blocks `/- ... -/`). The original file from #148 had two stacked comment blocks (a `/-!` docstring then a `/- ... -/` overview) above the `import` lines, and Lean 4.29.0-rc6 rejects that with: error: Proofs/Scheduling/RTAJittered.lean:35:0: invalid 'import' command, it must be used in the beginning of the file Fix: merge the two blocks into a single `/-! ... -/` module docstring that sits *before* the imports — Lean treats the leading docstring as metadata, not as a top-level command, so imports following it are still "at the beginning". Same content, different framing. Discovered by the new Lean CI gate from #151 once Mathlib's precompiled cache lands fast enough to actually reach our in-tree files. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
v0.7.0 Track A commit 3 of 4. Adds the Lean 4 specification and convergence theorems for the jittered response-time recurrence implemented in Rust as
compute_response_time_jittered(landed in #147). Anchors the Rust loop bound and theno_isrs_matches_classical_rtanon-regression test in machine-checkable mathematics.Single new file:
proofs/Proofs/Scheduling/RTAJittered.lean(plus a one-line addition toproofs/Proofs.leanto wire the import). No changes toRTA.lean,RMBound.lean, orEDF.lean.What's in
Type definitions mirroring the Rust API:
JitteredHigherPriorityTask—(period, exec, jitter)withperiod_posproofJitteredTask—(exec, deadline, jitter)for the task under analysisIsrOverhead := Nat → Nat(abbrev) — abstract ISR-interference functionIsrOverhead.Monotonepredicate, plusisrOverheadOfListconstructor that always satisfies it (isrOverheadOfList_mono)Step function
rtaStepJitteredmirroringrta_step_jitteredinscheduling_verified.rs:Theorem 1 —
rtaStep_jittered_monoStatus: proved.
R₁ ≤ R₂impliesrtaStepJittered task hps isr R₁ ≤ rtaStepJittered task hps isr R₂whenever the ISR overhead is monotone. Proof composesinterferenceJittered_mono,totalInterferenceJittered_mono(proved by induction on the HP list), and the monotonicity hypothesis on the ISR term viaNat.add_le_add.Theorem 2 —
rtaStep_jittered_zero_jitterStatus: proved. When the task under analysis has zero jitter, every HP task has zero jitter, and the ISR overhead is identically zero,
rtaStepJittered = rtaStep. This is the non-regression property anchoring the Rust-sideno_isrs_matches_classical_rtatest incrates/spar-analysis/src/rta.rs. Proved viatotalInterferenceJittered_zero_jitter(list induction) plussimpcleanup of the zero-ISR lambda.Theorem 3 —
rtaJittered_finds_least_fixed_pointStatus: proved (modulo
lake buildvalidation). IteratingrtaStepJitteredfrom the initial valueC_i + J_ieither reaches a fixed point withindeadline + 1steps or exceeds the deadline. The proof reuses the un-jittered file's generic Nat-sequence lemmabounded_mono_nat_seq, applies Theorem 1 for the monotonicity hypothesis, and usesrtaStepJittered_ge_initial(proved byomega) for the non-decreasing-from-the-start condition. Mirrorsrta_terminatesandrta_finds_least_fixed_pointinRTA.lean:152-190exactly.Plus a soundness lemma
iterN_le_fixed_point_jittered: any iterate from the canonical startC_i + J_iis bounded above by any fixed point that itself dominatesC_i + J_i. So the iterate sequence converges to the least such fixed point.What's explicitly NOT in
u64saturating arithmetic to the LeanNat. The Rust file's property tests bridge that gap; a future commit can lift them to Kani.Imports / dependencies
Mathlib.Tactic(already used byRTA.lean,RMBound.lean,EDF.lean)Proofs.Scheduling.RTA(re-usesceilDiv,ceilDiv_mono,iterN,iterN_mono,iterN_nondecreasing,no_fp_implies_growth,bounded_mono_nat_seqvia a singleopenclause)No new lakefile entries required — the
lean_libtarget picks up the new file automatically.lake buildstatusNot run locally in this agent environment (the sandbox does not have
elan/lakeinstalled). The file mirrors the structure ofRTA.leanline-by-line for the convergence machinery; anylake buildfailure is expected to be a localized syntactic issue in one of:interferenceJittered_mono(usesceilDiv_monofrom the open clause +omegaonr₁ + J ≤ r₂ + J)totalInterferenceJittered_zero_jitter'ssimp onlysetlinarithclose inrtaJittered_finds_least_fixed_pointIf any step fails CI, the corresponding proof can be replaced by
sorrywith a-- TODO(v0.7.1): discharge sorrycomment without invalidating the theorem statements (which are the load-bearing artifact for the Rust side).Test plan
cd proofs && lake buildsucceeds in CIRTA.lean/RMBound.lean/EDF.leanproofscompute_response_time_jitteredclaims to satisfyno_isrs_matches_classical_rtatest incrates/spar-analysis/src/rta.rsis now traceable to Theorem 2Linked: #147 (now-merged Rust commit). Track A commit 4/4 will follow with the COMPLIANCE.md wording updates.
🤖 Generated with Claude Code