Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning].
source. Upstream H-2 now reads PROVEN downstream (occupancy-types adopts
`Instances.HWM`), with signed drift OPEN.

==== Siblings re-pinned: resource-algebra f0818f2, occupancy-types ead4478 (2026-11-16)

* `scripts/fetch-siblings.sh` pins resource-algebra at `f0818f2` (was
`0b338c9`) and occupancy-types at `ead4478` (was `8f09c0b`). The two move
in one commit: at `f0818f2` the kernel's `_≤_` is a record over a relation
defined by recursion on ℕ (so that it checks under `--cubical-compatible`),
and occupancy-types builds against it only from `ead4478`
(occupancy-types#25).
* Upstream restated proofs and added lemmas. The definitions and law
statements the grade kernel transcribes are unchanged, and so are
occupancy-types' Timeline, Reclaim, Witness and both expected rejections.
The transcription table regenerates identically.
* The module headers that cite a pin now name the one the gate checks.
`ResourceAlgebra/Nat.idr` no longer says `_≤_` and Idris2's `LTE` agree
clause for clause: they are logically equivalent.

==== Certificates about one access (2026-11-09)

* New module `Certified.idr`. Every witness in a `ProgressiveW` chain hides
Expand Down
11 changes: 6 additions & 5 deletions LEVEL-STATUS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,9 @@ kernel*: `+ResourceAlgebra+` / `+IsOrdered+` / `+IsDioid+` /
`+IsAnnihilating+` interfaces and the Loss (min-plus), MaxPlus
(max-plus), HWM (high-water-mark) and MinMax (min-max, bottleneck; named
implementations on Loss's carrier) instances, transcribed from
`+hyperpolymath/resource-algebra+` @ `+0b338c9+` (Agda `+--safe
--without-K+`; MinMax added 2026-10-14, the rest unchanged since `+cf9235c+`). Laws re-proved in Idris2 (PROVEN, `+idris2 --build+`);
`+hyperpolymath/resource-algebra+` @ `+f0818f2+` (Agda `+--safe
--without-K --cubical-compatible+`; MinMax added 2026-10-14; definitions and
law statements of the rest unchanged since `+cf9235c+`). Laws re-proved in Idris2 (PROVEN, `+idris2 --build+`);
correspondence to the Agda source ASSUMED (transcription) and TESTED
on a 197-row operation table, accepted by Agda `+refl+` against the
pinned sources and by Idris2 `+Refl+` against the port, with a
Expand All @@ -449,7 +450,7 @@ refused for the intended reason.

|Occupancy.idr |0 |0 |0 |In package (PWL-01 step 3, 2026-10-14). L13
occupancy over the kernel's HWM grade: occupancy-types
(`+Reclaim.agda+` / `+Timeline.agda+` / `+Witness.agda+` @ `+af95728+`)
(`+Reclaim.agda+` / `+Timeline.agda+` / `+Witness.agda+` @ `+af95728+`, checked at `+ead4478+`)
R-1..R-5 ported and re-proved; L13 binding (`+OccupancyGradedMemory+`,
`+BoundaryCut+`, `+boundaryFrees+`, `+fitsAcrossBoundary+`) OPEN.

Expand Down Expand Up @@ -682,8 +683,8 @@ rule.

The "same object" above is now one definition. The grade kernel
(`+src/abi/TypedWasm/ABI/ResourceAlgebra*+`) is the Idris2 transcription of
`+hyperpolymath/resource-algebra+` @ `+0b338c9+`, the estate's Agda
(`+--safe --without-K+`) proof kernel for grades, fetched by
`+hyperpolymath/resource-algebra+` @ `+f0818f2+`, the estate's Agda
(`+--safe --without-K --cubical-compatible+`) proof kernel for grades, fetched by
`+scripts/fetch-siblings.sh+`. It holds the only min-plus (Loss), the only
max-plus (MaxPlus) and the only min-max (MinMax, the bottleneck) in the tree,
plus the high-water-mark occupancy grade (HWM). `+tools/check-grade-kernel.sh+` fails the build if anything else defines
Expand Down
4 changes: 2 additions & 2 deletions scripts/fetch-siblings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
set -euo pipefail
cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.."

RESOURCE_ALGEBRA_COMMIT="${RESOURCE_ALGEBRA_COMMIT:-0b338c9fc45cd04e7ee7d00b3855cd59d56a2afe}"
OCCUPANCY_TYPES_COMMIT="${OCCUPANCY_TYPES_COMMIT:-8f09c0bb319dee99d532e261cd5da4d04ace479a}"
RESOURCE_ALGEBRA_COMMIT="${RESOURCE_ALGEBRA_COMMIT:-f0818f2b108e273c47a52dda6b9406381071bcbb}"
OCCUPANCY_TYPES_COMMIT="${OCCUPANCY_TYPES_COMMIT:-ead44781e33a616c541bc9ef12a7340a37a90a73}"
CHOREOGRAPHIC_TYPES_COMMIT="${CHOREOGRAPHIC_TYPES_COMMIT:-edb784a7d26c276c2abfa8399b773d346dbb101e}"

fetch() { # fetch <name> <commit>
Expand Down
3 changes: 3 additions & 0 deletions src/abi/TypedWasm/ABI/Occupancy.idr
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
--
-- PROVENANCE. Ported and re-proved from hyperpolymath/occupancy-types
-- src/OccupancyTypes/{Order,Timeline,Reclaim,Witness}.agda @ af957280075699c659de0abd9a3b0defade77309
-- and checked at the pin ead44781e33a616c541bc9ef12a7340a37a90a73, where
-- Timeline, Reclaim and Witness are unchanged; Order restates proofs and
-- takes four order lemmas from resource-algebra instead of defining them
-- (fetched by scripts/fetch-siblings.sh), which states them over
-- resource-algebra's Instances/HWM.agda, the source of
-- TypedWasm.ABI.ResourceAlgebra.HWM. Agda is the proof kernel; these Idris2
Expand Down
10 changes: 6 additions & 4 deletions src/abi/TypedWasm/ABI/ResourceAlgebra.idr
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
-- (tools/check-grade-kernel.sh enforces that).
--
-- PROVENANCE. Transcribed from hyperpolymath/resource-algebra
-- src/ResourceAlgebra/Core.agda @ 0b338c9fc45cd04e7ee7d00b3855cd59d56a2afe
-- (unchanged since cf9235c, the pin it was first transcribed at)
-- (fetched by scripts/fetch-siblings.sh). Agda --safe --without-K is the
-- proof kernel; this Idris2 module is the ABI layer and re-proves the same
-- src/ResourceAlgebra/Core.agda @ f0818f2b108e273c47a52dda6b9406381071bcbb
-- (definitions and law statements unchanged since cf9235c, the pin it was
-- first transcribed at; later upstream commits restated proofs, added
-- lemmas and adopted the PROOF-POLICY §2.1 flags)
-- (fetched by scripts/fetch-siblings.sh). Agda --safe --without-K
-- --cubical-compatible is the proof kernel; this Idris2 module is the ABI layer and re-proves the same
-- laws. Correspondence status: ASSUMED (transcription). The instance
-- operation tables are additionally checked on both sides, by Agda `refl`
-- against the pinned sources and by Idris2 `Refl` against this port
Expand Down
8 changes: 5 additions & 3 deletions src/abi/TypedWasm/ABI/ResourceAlgebra/HWM.idr
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
-- occupancy-types adopts Instances.HWM; signed drift is OPEN there.
--
-- Transcribed from hyperpolymath/resource-algebra
-- src/ResourceAlgebra/Instances/HWM.agda @ 0b338c9fc45cd04e7ee7d00b3855cd59d56a2afe
-- (unchanged since cf9235c, the pin it was first transcribed at)
-- src/ResourceAlgebra/Instances/HWM.agda @ f0818f2b108e273c47a52dda6b9406381071bcbb
-- (definitions and law statements unchanged since cf9235c, the pin it was
-- first transcribed at; later upstream commits restated proofs, added
-- lemmas and adopted the PROOF-POLICY §2.1 flags)
-- Correspondence status: ASSUMED (transcription); operation table TESTED on
-- both sides by tests/transcription. occupancy-types @ af95728 builds its
-- both sides by tests/transcription. occupancy-types @ ead4478 builds its
-- reclamation law (OccupancyTypes/Reclaim.agda) on that same Agda module.
--
-- The model: a grade records the peak live state reached during a run and
Expand Down
6 changes: 4 additions & 2 deletions src/abi/TypedWasm/ABI/ResourceAlgebra/Loss.idr
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
-- loss grade are this carrier, not copies of it.
--
-- Transcribed from hyperpolymath/resource-algebra
-- src/ResourceAlgebra/Instances/Loss.agda @ 0b338c9fc45cd04e7ee7d00b3855cd59d56a2afe
-- (unchanged since cf9235c, the pin it was first transcribed at)
-- src/ResourceAlgebra/Instances/Loss.agda @ f0818f2b108e273c47a52dda6b9406381071bcbb
-- (definitions and law statements unchanged since cf9235c, the pin it was
-- first transcribed at; later upstream commits restated proofs, added
-- lemmas and adopted the PROOF-POLICY §2.1 flags)
-- which is itself the echo-types loss grade
-- (echo-types experimental/echo-additive/Grade.agda).
-- Correspondence status: ASSUMED (transcription); operation table TESTED on
Expand Down
6 changes: 4 additions & 2 deletions src/abi/TypedWasm/ABI/ResourceAlgebra/MaxPlus.idr
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
-- THE ONE DEFINITION OF MAX-PLUS IN THIS TREE (tools/check-grade-kernel.sh).
--
-- Transcribed from hyperpolymath/resource-algebra
-- src/ResourceAlgebra/Instances/MaxPlus.agda @ 0b338c9fc45cd04e7ee7d00b3855cd59d56a2afe
-- (unchanged since cf9235c, the pin it was first transcribed at)
-- src/ResourceAlgebra/Instances/MaxPlus.agda @ f0818f2b108e273c47a52dda6b9406381071bcbb
-- (definitions and law statements unchanged since cf9235c, the pin it was
-- first transcribed at; later upstream commits restated proofs, added
-- lemmas and adopted the PROOF-POLICY §2.1 flags)
-- which is itself the tropical-types grade (TropicalSessionTypes.lean).
-- Correspondence status: ASSUMED (transcription); operation table TESTED on
-- both sides by tests/transcription. The Lean bridge (resource-algebra M-2)
Expand Down
2 changes: 1 addition & 1 deletion src/abi/TypedWasm/ABI/ResourceAlgebra/MinMax.idr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
-- Level11BottleneckProof) is `minMaxSeq`, not a copy of it.
--
-- Transcribed from hyperpolymath/resource-algebra
-- src/ResourceAlgebra/Instances/MinMax.agda @ 0b338c9fc45cd04e7ee7d00b3855cd59d56a2afe
-- src/ResourceAlgebra/Instances/MinMax.agda @ f0818f2b108e273c47a52dda6b9406381071bcbb
-- Correspondence status: ASSUMED (transcription); the sequence's operation
-- table is TESTED on both sides by tests/transcription.
--
Expand Down
17 changes: 11 additions & 6 deletions src/abi/TypedWasm/ABI/ResourceAlgebra/Nat.idr
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,21 @@
-- ResourceAlgebra/Nat.idr — the ℕ lemmas the grade kernel's instances need.
--
-- Transcribed from hyperpolymath/resource-algebra
-- src/ResourceAlgebra/Prelude.agda @ 0b338c9fc45cd04e7ee7d00b3855cd59d56a2afe
-- src/ResourceAlgebra/Prelude.agda @ f0818f2b108e273c47a52dda6b9406381071bcbb
-- (the max-over-min lemmas at the end came upstream with Instances/MinMax;
-- everything else is unchanged since cf9235c)
-- the other lemma statements are unchanged since cf9235c)
-- Correspondence status: ASSUMED (transcription).
--
-- The Agda development is builtins-only, so it defines its own `max`, `min`
-- and `_≤_`. Idris2's base library already has the same definitions, clause
-- for clause: `Data.Nat.maximum`, `Data.Nat.minimum` (structural on Z/S) and
-- `LTE` (LTEZero/LTESucc). They are used here instead of being declared a
-- second time, together with base's associativity / commutativity /
-- and `_≤_`. Idris2's base library has `Data.Nat.maximum` and
-- `Data.Nat.minimum`, the same definitions clause for clause (structural on
-- Z/S), and `LTE` (LTEZero/LTESucc). Upstream's `_≤_` is no longer an
-- indexed family: it is a record over a relation defined by recursion on ℕ,
-- so that it checks under --cubical-compatible, with smart constructors
-- z≤n and s≤s in the places of LTEZero and LTESucc. The two types are
-- logically equivalent, not the same definition; every lemma statement over
-- them reads the same. Base's definitions are used here instead of being
-- declared a second time, together with its associativity / commutativity /
-- idempotence / upper-bound lemmas. This module holds only what base lacks.
--
-- Direction note: base states associativity as l ∘ (c ∘ r) = (l ∘ c) ∘ r,
Expand Down
5 changes: 3 additions & 2 deletions src/abi/TypedWasm/ABI/ResourceAlgebra/Separation.idr
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
-- alternatives and differ only in sequence
--
-- Transcribed from hyperpolymath/resource-algebra
-- src/ResourceAlgebra/Separation.agda @ 0b338c9fc45cd04e7ee7d00b3855cd59d56a2afe
-- (S-1..S-3 unchanged since cf9235c; S-4 added with Instances/MinMax)
-- src/ResourceAlgebra/Separation.agda @ f0818f2b108e273c47a52dda6b9406381071bcbb
-- (statements of S-1..S-3 unchanged since cf9235c; S-4 added with
-- Instances/MinMax; later upstream commits restated the proofs)
-- Correspondence status: ASSUMED (transcription).
--
-- These are the reason typed-wasm does not fold its grades into one: L11's
Expand Down
4 changes: 2 additions & 2 deletions src/abi/typed-wasm.ipkg
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ modules = TypedWasm.ABI.Region
, TypedWasm.ABI.KCut
, TypedWasm.ABI.Choreography
-- Grade kernel (PWL-01): transcribed from hyperpolymath/resource-algebra
-- @ 0b338c9; the one definition of min-plus (Loss), of max-plus
-- @ f0818f2; the one definition of min-plus (Loss), of max-plus
-- (MaxPlus) and of min-max (MinMax) in the tree — tools/check-grade-kernel.sh.
, TypedWasm.ABI.ResourceAlgebra
, TypedWasm.ABI.ResourceAlgebra.Nat
Expand All @@ -32,7 +32,7 @@ modules = TypedWasm.ABI.Region
, TypedWasm.ABI.ResourceAlgebra.HWM
, TypedWasm.ABI.ResourceAlgebra.MinMax
, TypedWasm.ABI.ResourceAlgebra.Separation
-- L13 occupancy (PWL-01 step 3): R-1..R-5 ported from occupancy-types @ af95728
-- L13 occupancy (PWL-01 step 3): R-1..R-5 ported from occupancy-types @ af95728 (pin ead4478)
, TypedWasm.ABI.Occupancy
, TypedWasm.ABI.Echo
, TypedWasm.ABI.Tropical
Expand Down
2 changes: 1 addition & 1 deletion tests/reject/CostIsOccupancy.idr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
--
-- MUST FAIL (tools/check-kernel-proofs.sh). Mirrors occupancy-types
-- tests/reject/CostIsOccupancy.agda @ af95728 (R-6).
-- tests/reject/CostIsOccupancy.agda @ ead4478 (R-6; unchanged since af95728).
--
-- Occupancy of a sequence is not the sum of the peaks. Reading it as cost
-- would charge an L13 run for memory its boundary has already reclaimed.
Expand Down
2 changes: 1 addition & 1 deletion tests/reject/DriftIsPeak.idr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
--
-- MUST FAIL (tools/check-kernel-proofs.sh). Mirrors occupancy-types
-- tests/reject/DriftIsPeak.agda @ af95728 (R-6).
-- tests/reject/DriftIsPeak.agda @ ead4478 (R-6; unchanged since af95728).
--
-- What is live at a cut is not the peak reached before it; identifying them
-- is exactly "an L13 boundary never reclaims anything".
Expand Down
2 changes: 1 addition & 1 deletion tests/reject/MinMaxIsLoss.idr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
--
-- MUST FAIL (tools/check-kernel-proofs.sh). Mirrors resource-algebra
-- tests/reject/MinMaxIsLoss.agda @ 0b338c9.
-- tests/reject/MinMaxIsLoss.agda @ f0818f2.
--
-- The bottleneck sequence keeps the worst hop; it does not add the hops.
-- Accepting this would let a min-max bound (L11's Level11BottleneckProof) be
Expand Down
2 changes: 1 addition & 1 deletion tests/transcription/ops.tsv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: MPL-2.0
# GENERATED by tools/check-kernel-proofs.sh --regen from tests/transcription/Explore.idr
# (the Idris2 port evaluated on the domain below). Checked by Agda refl against
# resource-algebra @ 0b338c9 and by Idris2 Refl against the port. Do not hand-edit.
# resource-algebra @ f0818f2 and by Idris2 Refl against the port. Do not hand-edit.
Loss alt fin 0 fin 0 fin 0
Loss alt fin 0 fin 1 fin 0
Loss alt fin 0 fin 2 fin 0
Expand Down
Loading