Repository navigation
P3 (aarch64): Stage 5 — MakePool, DeriveSubframe, chunk-loop Untyped reset and stale-ASID unmap in the dispatch; VSpace uniqueness, frame containment and caps_no_overlap in the record - #158
Merged
Conversation
…ped reset and the stale-ASID unmap in the dispatch; VSpace root/page-table uniqueness, frame containment and caps_no_overlap in the record Built from par/a64-p5-int. See the PR description for the new arms, the record invariants, the removed premises and the declared limits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Stage 5 of the AArch64 P3 refinement proof builds on Stage 4 (#156). It adds five dispatch arms that were declared limits or missing, strengthens three record invariants, and removes three premises.
New dispatch arms
Strengthened record invariants
caps_no_overlap.Removed premises
hnoDeadTcbandFrSubSiteAare gone, and the decode-sitehfris removed.hT,hYAsandhcOfrom the record instead of taking them as constructor fields.Rust, extraction and the spec port are unchanged. The PR changes
proofs/Fl4ProofsA64/**, the root import listproofs/Fl4ProofsA64.lean,DESIGN.md§9 andREADME.md;proofs/Fl4SpecA64/**,crates/andxtask/are identical to main. Diff vs mained6b92799: 331 files, +24,208 / −2,112.New dispatch arms
VsScopeA.asidMakePoolStage3PoolTopA,Stage3Pool{Shape,Mem,SysEnd,Rec,J5,End,Fin}A,Stage3PoolCoreA(PoolCtxA),Stage3T3PoolAhnoDeadTcbis replaced byMcGrowA.VsScopeA.frameDeriveSubStage3ArmSubframeA(JStage3A.deriveSubframeA,subframesA),Stage3T3ArmSubA,FrSubframeJ5A,P1/S1aSub*,P1/MdbSubFrA,P1/MdbInvSubA,Stage3CnInsSubAinsert_subframesloop over the generalisedcapInsertGenA(UA ∨ SubA), with no copied proof.derive_subframe_jAhas an Ok-continuation (ArchTopSubA), and its Err callers keepArchTopErrA.UtPreScopeA.retypeRstPreUtRtReset*A,Stage3AfterPreemptAA64RelPS3withPreExitA.UtScopeA.retypeRstBigUtRtReset*ABodyOKAafter the clock moved comes fromDelBudAat each passed preemption point.VsScopeA.ptUnmapT2StaleStage3ArmPtUnmStaleA,Stage3T3ArmStaleA,VsUniqStaleAept.rsfinalise →delete_asid, thenunmap_page_tablereturns early; spec:extKindOfAsid = none→ l4vpageTableUnmap). This had no dispatch arm before Stage 5.ptUnmap_runAselects it by ASID kind. It needs no premise: "no reachable descriptor namesptr" isVsUniqA.no_reach_stale.Record invariants
VsUniqA(P3/VsUniqA) gains two fields:rootOnce: an unmapped root-kind cap ofr(Pml4, level-0Ept,HighVSpace) is the only root-kind cap ofr, andris installed at no ASID. ASIDPoolAssign therefore keepsrootInj1/2, and DelAsid/DelAsidPool can drop exactly the deleted ASID's walks (VsUniqClearA).ptOnce: an unmappedPageTablecap ofris the onlyPageTablecap ofr.How the invariant is maintained:
PtClosedAis now the record{pt, root, ptu}, and the closure lemmas are written once as a genericUClosed(VsUClosedA) instantiated for both classes.vspace.rs:1098,FinPtNoOtherA).ptCapIn/hofffor tracked tables, J9UnmTabA.specand J3SpecFreeA.heapfor the rest.ASIDPoolAssignT2 arm now shrinksT2before the cap write.FrAtcontainment (e0). A non-device frame cap names a range inside a heapotherobject, not an exact-size object at its base. The untyped drop/undrop laminarity is derived fromRegionIn(l4vvalid_untyped) viaUtRV.rin, with no frame-specific premise.FrLamA(framecaps_no_overlap). This is the third conjunct ofFrBaseApartA, the A64 counterpart of x86NoOverlap/ l4vcaps_no_overlapfor large frames. It is maintained at every cap writer, retype, pool and boot, andDerivAtracks frame ranges. It is a [J] record conjunct.Premises removed or derived
hnoDeadTcb(MakePool, Stage 4): gone, replaced byMcGrowA.hfr(DeriveSubframe decode site): removed, not derived. It was only used for aCarryAconjunct ofderive_subframe_jAwhose sole consumers are Err-only (decInv_arch_jA→Stage3DecErrVsA/Stage3DecErrPtA). TheCarryA/finMA_insFrameAchain is deleted.FrSubSiteA(Err path): derived and removed fromStage3DecErr*/SendErrAllA. The 2 MiB alignment and canonical form come fromFrAtandJStage3A.largeFrAlCanA.hT(JStage3A.offAsE),hYAs(JStage3A.yNotAsW) andhcO(OSOK.canon) are now derived from the record.frameDeriveSub:hcOis derived from the record.ptUnmapT2Stale:hTO/hEOare derived from the record.Statement changes
A64RelPS3 := ∃ m', McGrowA m m' ∧ A64RelPS3fx … m'. OnlyHPreEnvA.hSend/hPre_ofA.hSendmove to the hiddenm'. They are∀ m'under the run antecedentsDispatchInvokeAtA … → handle_invocation … = ok (.Err Preempted, s', a') → ∀ m', A64RelPS3at … m m' → …. The premise linter reports these as 4 newUNGUARDED(record)rows (hSend | ∀ m' : McStateinptUnmapBodyA,hPre_ofA,kernelEntrySend_recGA,syscallSend_refinesA), becauseA64RelPS3atis in itsskipNames. They are guarded by the preempted run, and the witnesses discharge them (A64Wit2TierA:276,A64WitUtTopA:481).ptUnmapBodyA/ptUnmap_runA. The selectorhT2is now required only for Stage-2 / window-root kinds. Stale and Stage-1 kinds go to the new arm with no premise.derive_subframe_jA. The postcondition is nowArchTopSubA, with the Err half unchanged and an Ok half that gives the decode's success view.ArchTopSubA.toErrAserves the previous callers.Premises of the new arms (DESIGN §9 has the full list)
ArchTotal,ArchPlat,A64FrameMasks;hn: the arch'ss2_ipa_bitsis the spec'ss2IpaBits);hCs;h1,hnN, as for the IPC/SchedContext/Domain groups);hdc/hCp/hCd, the same shape asCnScopeA.cnodeCopy's);DelPlatA, the entry clock andCounterStepA. Which arm applies is a case hypothesis on thereset_untypedrun.Non-vacuity
Every top keeps its mechanized witness (
wit_send_nonvacuous,wit_ut_nonvacuous,wit_recv_nonvacuous,wit_comb_nonvacuous,wit_runexit_nonvacuous/wit_runvppi_nonvacuous,wit_irq_nonvacuous).New this stage:
wit_ut_nonvacuousis an end-to-end Untyped Retype into the root CNode that satisfies every premise of the Send top.The Stage-5 arms have premise-level witnesses at most:
A64WitVsArmsAcoversptMapHi/ptMapS2/frameMapS2/ptUnmapT2;A64WitSubAcovers the DeriveSubframe decode up toinsert_subframesand the pure inputs ofsubframesA;wit_utChunk_premscovers the chunk-loop resets;asidMakePoolandptUnmapT2Stalehave no arm witness.§9 lists what each does not show.
Declared limits and backlog (DESIGN §9)
PtFreshAdisjunct (mp = false ∧ ptr ∉ T2; this weakens an invariant, it is not a premise).ptUnmapT2Z.ptUnmapT2still carries [J]hUniq.FrMapSiteA(needs a RAM-frame window clause inutWin).of_capDerivCnA.SubInv, the chunk-loop resets) and the full VS-world witness.finishand the other guest entries.numNodes = 1).Verification
lake build Fl4ProofsA64, cold (fresh lake, no cache) at5f26fb509: 8,995 jobs, 0 errors, 0sorry, 52 min 38 s.propext,Classical.choiceandQuot.sound. A#print axiomsspot check on the 20 linter tops plusJSyscallA.frameDeriveSubA,JSyscallA.ptUnmapT2StaleA,JSyscallA.asidMakePoolA,JStage3A.asidMakePoolA,JStage3A.subframesAandJStage3A.ptUnmapT2StaleAgives the same result.sorry,admit,native_decide,bv_decide,axiom,unsafe,implemented_byoropaquein the added proof code. All 78 new.leanfiles are imported fromFl4ProofsA64.lean.UNGUARDED(record)goes from 80 to 84; the 4 new rows are the run-guardedhSend ∀ m'explained above.🤖 Generated with Claude Code