refactor(proofs): remove codegen fiction, name the scheduling-math source (#321 foundation) - #334
Merged
Merged
Conversation
…abler, #321) WIP toward #321. Splits the combinational RTA defs (Task, ceilDiv, interference, totalInterference, rtaStep) out of RTA.lean (which imports Mathlib.Tactic) into a mathlib-free RTACore.lean, so Codegen.lean can import and reflect over the REAL definitions while staying mathlib-free (the `lake exe codegen` exe builds in <1s, no mathlib). RTA.lean imports RTACore and proves the theorems about those same defs. RTACore.lean verified to build mathlib-free locally (lake build Proofs.Scheduling.RTACore, 285ms). RTA.lean proof re-verification is CI-gated (needs mathlib; not locally buildable here). Not yet wired into Codegen.lean — the generator completion + byte-diff drift gate follow. No Rust changes yet. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…urce (#321) Honest foundation toward #321 (does NOT close it — see REQ-PROOF-SCHED-CODEGEN-001). A reflection probe (lake env lean over the elaborated Exprs) confirmed true generation is blocked this cycle: the arithmetic defs reflect cleanly but `totalInterference` compiles to List.brecOn and the driver loop is a template, not a syntactic image. And a byte-diff gate over a *string* generator would only enforce `.rs == Codegen-strings` (both hand-written) — it never checks the strings against the proofs, so theory↔code drift stays representable. That's generation cosplay; not shipped as #321 progress. What this does instead: - Corrects a false claim (claim-verification): scheduling_verified.rs read "generated by `lake exe codegen` — DO NOT EDIT" while its own top lines documented a hand-edit, and the generator only ever emitted 5 of the 12 functions it ships. Header now states the truth — hand-written to mirror the Lean defs, bound to them by the named property tests (ceil_div_matches_lean_definition, compute_response_time_matches_lean_spec, the jittered/blocking spec tests) that run in CI. - Removes the footgun: deletes proofs/Codegen.lean + its lakefile exe. The documented `lake exe codegen > scheduling_verified.rs` would have silently deleted the 7 hand-added jittered/blocking/ISR functions. - Keeps RTACore.lean: the combinational defs (Task, ceilDiv, interference, totalInterference, rtaStep) as a mathlib-free named single source that the future reflection generator will consume; RTA.lean proves the theorems over it. - rivet: REQ-PROOF-SCHED-SPEC-SOURCE-001 (this, verified, v0.29.0) + REQ-PROOF-SCHED-CODEGEN-001 (the real generator, closes #321, proposed). Fixes REQ-PROOF-SCHED-002's now-stale "existing RTA extraction" ref. scheduling_verified property tests: 15/15 (the Rust↔Lean binding oracle). RTACore builds mathlib-free locally; RTA.lean proof re-verify is CI-gated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…n line (#321) Clean-room caught a lingering false claim in a draft design-plan: it told readers to "Generate Rust via lake exe codegen (existing infrastructure)" — the infrastructure this release just removed as fiction. Annotated as superseded, pointing at REQ-PROOF-SCHED-SPEC-SOURCE-001 (removal) and REQ-PROOF-SCHED-CODEGEN-001 (the real generator, OPEN). Doc-only. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rivet verification gate✅ 20/20 passed
Filter: Failed artifacts(none) Updated automatically by |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Jul 21, 2026
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.
Foundation toward #321 — does NOT close it.
REQ-PROOF-SCHED-SPEC-SOURCE-001(verified). The real generator that closes #321 is filed asREQ-PROOF-SCHED-CODEGEN-001(proposed); #321 stays OPEN.What the investigation found
A reflection probe (
lake env leanover the elaboratedExprs) established that true generation is blocked this cycle:ceilDiv/interference/rtaStepreflect cleanly (flat arithmeticExprtrees).totalInterferencecompiles toList.brecOn/List.below— not a naiveExprwalk.compute_response_timeis a hand-written loop, not a syntactic image ofiterN.And critically: the existing
Codegen.leanemits hardcoded Rust strings, so a byte-diff gate over it would only enforce.rs == Codegen-strings(both hand-written, neither read from the proofs) — theory↔code drift stays representable. That's generation cosplay; shipping it as #321 progress would be a #294/#331-class over-claim. Not done.What this PR does (honest, verifiable)
scheduling_verified.rsclaimed "generated bylake exe codegen— DO NOT EDIT" while its own top lines documented a hand-edit (div_ceil) and the generator only ever emitted 5 of the 12 functions it ships. The header now states the truth: hand-written to mirror the Lean defs, bound to them by the named property tests (ceil_div_matches_lean_definition,compute_response_time_matches_lean_spec, the jittered/blocking spec tests) that run in the CITestgate — the executed oracle for the Rust↔Lean correspondence.proofs/Codegen.lean+ itscodegenlakefile exe. The documentedlake exe codegen > scheduling_verified.rswould have silently deleted the 7 hand-added jittered/blocking/ISR functions.RTACore.lean— the combinational defs as a mathlib-free named single source the future generator will consume;RTA.leanproves the theorems over it.REQ-PROOF-SCHED-002's now-stale "existing RTA extraction" reference.Verification
scheduling_verifiedproperty tests: 15/15 (the Rust↔Lean binding oracle) — logic unchanged, header is doc-only.RTACore.leanbuilds mathlib-free locally (357ms). The fullRTA.leanproof re-verify (theorems now typecheck against the relocated RTACore defs) is the CIlake buildgate — the key thing to watch, since the def relocation is mechanical but only CI has mathlib.Scope honesty
This removes a live footgun and a false "generated" claim, and names the spec source. It does not make the Rust generated from the proofs — #321's actual ask — which stays open as
REQ-PROOF-SCHED-CODEGEN-001.🤖 Generated with Claude Code