Skip to content

P1 (aarch64): decode-step invariants for every capability invocation, the S1A untyped / page-table columns, and the w1 kernel-window boot witness - #146

Merged
losfair merged 1 commit into
losfair:mainfrom
CommaBot:a64-p1-stage2
Dec 1, 2026

Conversation

@CommaBot

Copy link
Copy Markdown
Contributor

This stage brings the AArch64 P1 line (a64 gens up to 164), the S1A line (gens up to 23) and the A64-Boot window
(gen 9) onto main (5d044787a). Proofs only: no crates/, proofs/Fl4Core*, proofs/Fl4Proofs/ or
proofs/Fl4Spec/ file changes; TRUSTED is unchanged.

What is proved (all in proofs/Fl4ProofsA64/P1, root-imported):

  • syscall.decode_invocation.armQHAt (MdbArmQHD): from SysL, SymL, the deletion input DelIn and the
    decode's placement facts, every DecArmQH arm of decode_invocation ends in ArmQIAt (SysL ∧ SymL ∧ BlkOK at
    the result plus cap carries, including the page-table cap placement PtCap) with the ASID table kept or one entry
    zeroed. The arms: CNode and the deletion family, TCB SetSchedParams / Suspend / ReadRegisters, IRQ control,
    Notification / Endpoint send, every VCPU invocation (Run, AckVPPI, WriteReg, InjectIRQ, ReadState, WriteState,
    SetTCB; ported to proofs (aarch64): re-extract Fl4CoreA64 and adapt P0/P1 after #130 and #134 #139's re-extraction), and the VSpace arms: Stage-1 and HighVSpace Page Map / Unmap,
    PageTable Map / Unmap, TestAndClearAccessed, the flushes, GetAddress, and every Stage-2 (EPT) operation.
  • S1A: syscall.decode_invocation.s1aStepH / s1aStepPt / armQH_s1aPt (S1aStepH, S1aPtCol) add Untyped
    Retype, ASIDPool Assign and ASIDControl MakePool and carry the untyped column and the per-step page-table cap
    invariants
    (PtCap, PtHG: every page table inside one heap object; S1aPtCol with HiCap511) across every arm.
  • Boot window: w1's root task is moved into the kernel window (BootW1Win: addresses in
    [PPTR_BASE, PPTR_TOP), physical addresses below 2^44); w1_sysL (P1's SysL at w1) and
    w1_s1aPtCol (the page-table column at w1).

Named premises: [P] ArchTotal, MaxSpi, ArchPlat (the IPA width), the thread facts mcp, cs, fh (QueueDecTcb's
TcbPlace.mcp / curSc, SspHyps.fh); no new [J] / [W].

Per-step inputs, not yet invariants:

  • hvs: the VSpace typing witness (Stage-1 VsTy with NoTag3 / HighRoot511, and Stage-2 S2DecTy), and
    HiCap511 (every HighVSpace cap's root has a table descriptor at entry 511).
  • B2: on real hardware hvs cannot hold after an ASIDPool Assign of a HighVSpace root whose copied kernel
    TTBR1 L0 entries are non-zero (the kernel's TTBR1 tables are boot memory, not heap objects, while PtHG puts every
    typed table in a heap object). The step theorems are therefore vacuous at such states until a platform contract for
    the kernel tables (KTab, R1) is added.
  • S2DecTy from QueueS2Ty's object-level S2Ty + S2OK is proved (S2DecTy.ofS2Ty, S1aS2Dec) under two facts that
    hold in the code but are not yet derived: hR (Stage-2 roots have 13 bits: STAGE2_VSPACE = 13) and hD (no
    Stage-2 object starts at a 13-bit object's upper granule: heap disjointness, once Te is tied to the typed heap).
    They are discharged in the later closure pass; until then S2DecTy stays inside hvs.

Recorded for later: R1 KTab (B2), R2 the reachability / unmapped-table-zero invariant (S1aVsUnm, B3), R3 the
deletion arms through S1A's Ty (B1), then hvs / HiCap511 as invariants.

Checks: lake build Fl4ProofsA64 (module build) green, 0 errors, 0 sorry; #print axioms over 49,890 constants: only
propext, Classical.choice, Quot.sound. xtask/scripts/port_p2_a64.py --check proofs passes. No sorry / admit /
native_decide / bv_decide.

🤖 Generated with Claude Code

… the S1A untyped / page-table columns, and the w1 kernel-window boot witness

AArch64 P1 (a64 gens up to 164), A64-S1A (gens up to 23) and the A64-Boot kernel-window fix, squashed onto main 5d04478.
Fl4ProofsA64 builds with 0 errors / 0 sorry; 49,890 constants use only propext, Classical.choice, Quot.sound.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@losfair
losfair merged commit 47896dc into losfair:main Dec 1, 2026
1 check failed
losfair pushed a commit that referenced this pull request Dec 1, 2026
… the CDT and IPC-buffer history (DESIGN §9 item 4) (#149)

DESIGN §9 item 4, both halves, for AArch64. One commit on `main` @ `c98a08b1c` (after #146 and #147): 34 files, +9216 / −199. No Rust changes (nothing under `crates/`). No x86 statement changes.

**Half 1 (the history along an execution).** A replay record `InvR` beside `InvH`; P1's MDB tree facts hold of the replayed history (`MdbSH`) along every execution of the local-path family, every slot's edit being one of P1's (`SlotWireP`). The top family is `fl4LocPBL` (`DelLkA`): the Delete-with-PTE start needs the CDT facts only at its own locked slots (`CdtAtL`), discharged from the history, so the all-slot `MdbLk` / `NullLk` [J] is gone. The IPC-buffer words are gate-owned, so `BufSH` is kept along an execution and gives the PTE slots' `bufU`. Boot corollaries at w0/w1 (`w0_serial_mdbL`, `w1_serial_mdbL`).

**Half 2 (the gate and the locks themselves).** `proofs/Fl4P2Base/GateImpl.lean` hand-transcribes fl4-sync's gate (`try_enter_local`, `leave_local`, `acquire`, the serial body, `release`) and fl4-store's lock table (`try_lock_object`, `unlock_held`), plus hardware writes, as `ICfg` / `IStepG` / `IStepL` / `IStepHw` (listed in `TRUSTED` with its modelling choices). `impl_sim` matches every runtime step by zero or one gate-model step (`StepR`: a `Serial.Step`, or a racy speculative read returning another value; on gate- or core-class words a value of the current class), keeping `Rel` and the lock invariant `LkInv`; hardware writes during a pending serial body are deferred and replayed after the model's `serial` at the release's decisive store. Racy reads are covered by weak safety `SafeW` from the same per-path certificates. `impl_execPA` / `serializable_implPA` (`GateExecA`): every runtime execution from boot is an FL4 execution, and where no local path runs and no body is pending its memory is the serial run of the completed entries; `w0_serializable_impl` / `w1_serializable_impl` (`GateBootA`) at the boot witnesses for `fl4LocPBL`.

**Premises and hypotheses.**
- Named premises added: [P] MM-SB, MM-DRF, MM-RACY, IPI (the transcription's step granularity, stated in `GateImpl`'s docstring; no Lean hypothesis carries them). `IHwPA` is `HwStepPA`'s existing [P] moved to the runtime. No [W].
- Theorem hypotheses left to the serial-kernel side: `hSer` / `hSerB` (serial entries keep `MdbSH` / `BufSH`; AArch64 P1 / S1A) and `BufSH` at w0/w1 (S1A / Boot).
- Not yet proved: the Half 1 history facts along the weak executions `ExecPAR` (proved along `ExecPA`).

**Merge with #146.** Text conflicts only: `proofs/Fl4ProofsA64.lean` (union of imports, no duplicates) and `DESIGN.md` §9 status (main's `w1_sysL` kept; this PR's item-4 bullets added; the "Not yet proved" bullet reconciled: `SysL` at w1 is no longer listed). No proof conflicts. Existing declarations: 0 statement changes against the pre-rebase branch.

**Checks.**
- `Fl4ProofsA64` root build on this tree: 0 errors, 0 sorry, "Build completed successfully (5755 jobs)". Module builds of every changed module and its users (the gate files, the A64 P2 files of this PR, and the x86 `Fl4Proofs.P2` re-export modules): 0 errors, 0 sorry (5548 jobs).
- Axioms: sweep of all 18882 constants under `Fl4ProofsA64.P2` and `Fl4Proofs.P2` (`Fl4P2Base`): 0 outside propext / Classical.choice / Quot.sound; plus 109 `#print axioms` on the gate files' and `GateBootA`'s theorems: 68 `[propext, Classical.choice, Quot.sound]`, 21 `[propext]`, 3 `[propext, Quot.sound]`, 17 none, 0 `sorryAx`.
- No sorry / admit / native_decide / bv_decide / axiom / maxHeartbeats in the diff; every new module is imported from `Fl4ProofsA64`.
- `python3 xtask/scripts/port_p2_a64.py --check proofs`: exit 0.
- No x86 root build: the x86 users of `Fl4P2Base` are the unchanged re-export modules `Fl4Proofs.P2.Serial` / `SerialHw` / `SafeCert` / `SerialSafe`, built as modules.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
losfair pushed a commit that referenced this pull request Dec 3, 2026
…ins from boot with the kernel-table column (#151)

The AArch64 P1 S1A line: the R2 reachable-VSpace invariant, the R3 ASID/pool
columns and the B2 decode step, completed after the #146 snapshot.

- syscall.decode_invocation.s1aStepR2K: one decode_invocation step on every
  DecArmS1aH arm re-establishes S1aR2, S1aKtUt and the kernel-table level
  column S1aHiK. No per-step typing input remains: the former HiDelTy witness
  (full typing of every HighVSpace root) is false on reachable states after
  delete_asid_pool / unmap / retype, and is replaced by the reachability-
  guarded HiDelTyR, a projection of R2.
- BootWit.w0_s1aStepEntryK / w1K_s1aStepEntryK: the step's entry facts at boot.
- README and DESIGN section 9 list the covered and uncovered AArch64 arms and
  the step's outer entry inputs.

Statements merged in #146 changed with the line's later generations (FinKZ
widened over Pt, decode-state parameter sd / FrCw write sets, FE over any
device bit, PoolPost/AsgPost fields); cdt.delete.armQIAt moved to MdbDelVsZ
with the FrC / ArmVsZ premises, DecArmKK3 moved unchanged to S1aHiK.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants