Repository navigation
proofs: add standalone x86_64 Fl4Spec ↔ l4v ASpec equivalence suite - #159
Merged
Merged
Conversation
Check the guarded kernel step against the pinned l4v X64 MCS reference and include the reference overlay, regeneration tools, and axiom audit. Record the intentional x86-64 selector and object-type differences in the porting notes.
CommaBot
added a commit
to CommaBot/FL4
that referenced
this pull request
Dec 6, 2026
…into par/a64-p6-int Merged against the base 6c92d26 (main's Stage-5 squash has the same tree), so only the Fl4SpecEquiv additions and the two PORTING.md edits come in. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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
Adds a standalone, machine-checked Lean 4 equivalence suite (
proofs/Fl4SpecEquivX64/) relating FL4's frozen x86_64 base abstract specification (proofs/Fl4Spec/, 23 base modules) to upstreamseL4/l4v(rtbranch,L4V_ARCH=X64with a provenance-tracked X64-MCS Isabelle overlay throughSyscall_A.call_kernel).The suite is completely standalone — it is not imported from
Fl4Proofs.leanorFl4ProofsA64.leanand has zero impact on existing P0–P3 builds or CI.Scope & Contents (113 files, +39,521 / -0)
proofs/Fl4SpecEquivX64/L4vRefX64/(100 Lean 4 files, 34,646 LoC, 947 public theorems):Spec/(59 generated X64ASpectheories +Spec.lean) emitted deterministically from Isabelle2025-2 typed HOL AST export (aspec-x64-full.jsonl).Prim.lean(507-line HOL primitive layer shared withFl4SpecEquivA64) &PrimX64.lean.Rel/(Config,Embed,Extension,Invocation,Lift,Monad,State):StateRel,ConfigRel,OpaqueRel RestRel,BaseCarriers(includingNoVirtObjectsand base-carrier restrictions).Patched.lean: explicit, kernel-checked point-delta theorems documenting every deliberate divergence between upstream l4v X64 and FL4 (newContext_selectors_delta,decodeObjectType_codes7to11_delta,notificationBits_delta,asidWidths_delta,asidFreeIndex_delta,tcbEptSlot_delta,finaliseTcbZombieSlots_delta,lookupIpcBuffer_slot_delta,makeArchFaultMsg_delta,ioPortOwner_delta,invocationLabel_numbering_delta,hugePages_delta,endTimeslice_runningVM_delta,compiledNumDomains_delta,maxPeriodUs_delta).Equiv/(28 proof modules): end-to-end single-step kernel equivalencepatched_callKernel_equiv(L4vRefX64/Equiv/Syscall.lean) covering all 11 syscall routes and all 5 non-syscall event constructors, guarded by run-indexedCallKernelSafe(0 unconstrained∀ s : Structures_A.statein public*Safeor theorem signatures).Equiv/Witness.lean: 26 public non-vacuity witness theorems, including the 16-domain PC99 configuration model witness (pc99Config_exists), direct instantiations ofpatched_callKernel_equiv(liveOneTickInterruptWitnesscharging 1 tick & advancing both oracles,liveNbWaitWitnessdelivering badge0x62& clearing notification), and sub-entry witnesses (liveScheduleWitness, native unmaps, IRQ issue/binding, TCB install,liveMakeAsidPoolWitness,liveLinkedFaultReplyWitness).Manifest.lean:#print axiomsaudit over all 1,043 public theorems (includingpatched_callKernel_equivand all witnesses).proofs/Fl4SpecEquivX64/overlay/: minimal 25-hunk X64-only MCS Isabelle overlay (x64-mcs-overlay.patch, SHA-256a4d0d1fe...) with per-hunk upstream donor citations (overlay-provenance.md; zero edits to generic MCS theories).proofs/Fl4SpecEquivX64/tools/:ExportASpec.ML,Run_X64_Export.ML,phase1-theories.txt,phase1-symbols.txt,emit_l4v_ref.py, fail-closedbuild.py(enforcing zero warnings, 1,043 theorem floor, required headline/witness theorems, and standard-only axioms), andtest_build.pynegative self-tests.proofs/Fl4SpecEquivX64/{README.md,PHASE2_REPORT.md,PATCHED_INVENTORY.md}: reproduction steps, explicit TCB disclosure (noting thatcall_kernel_pis a hand-patched call tree of 129*_pdefinitions whose correspondence toSpec/*outsidePatched.leanis established by inspection and indexed with exactfile:linelinks inPATCHED_INVENTORY.md), and scope boundaries (ConfigRel,OpaqueRel RestRel, single-stepCallKernelSafe, per-core base spec).proofs/Fl4Spec/PORTING.md(+6 lines): documents the two intentional FL4 x86_64 deviations confirmed in Phase 1 (initial user selectorsCS=0x33 / SS=0x2Bvs0x2B / 0x33, and arch-relative object codes7..11decoding to VCPU/EPT types vsNone).(Root
README.md,DESIGN.md§9, andTRUSTEDpointers are intentionally deferred to a small follow-up once #157 and #158 land, keeping this PR conflict-free.)Verification
FL4@ed6b927999d462bc217cfcd44a5b02b8bab7c4ff,l4v@f44de69e426184f5edff14aeb8d8e03385f33c01,seL4@c98d70adf15e8be7d3b99085c28d057069ba7155(all clean).BUILD OK: 100 rebuilt, 100 total,0warnings,0errors,0forbidden tokens (sorry/admit/axiom/unsafe/implemented_by/extern/native_decide/partial),AXIOM_AUDIT PASS: 1043/1043 theorems strictly standard(⊆ {propext, Classical.choice, Quot.sound}).tools/test_build.py): 5/5 PASS (rejectssorryAx, module warnings, manifest warnings, and missing required theorems at the 1,043 floor).Run_X64_Export.ML+emit_l4v_ref.pyfrom the committed entry points matched the audited export digest (6a7c95f9...) and all 59 generated Lean theories +Spec.leanbyte-for-byte.PATCHED_INVENTORY.mdrows script-verified) → APPROVE.