diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 8724d2b..fee1e07 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -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 diff --git a/LEVEL-STATUS.adoc b/LEVEL-STATUS.adoc index 55206c1..aab24b7 100644 --- a/LEVEL-STATUS.adoc +++ b/LEVEL-STATUS.adoc @@ -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 @@ -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. @@ -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 diff --git a/scripts/fetch-siblings.sh b/scripts/fetch-siblings.sh index 5d5d3ea..bb9da2c 100755 --- a/scripts/fetch-siblings.sh +++ b/scripts/fetch-siblings.sh @@ -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 diff --git a/src/abi/TypedWasm/ABI/Occupancy.idr b/src/abi/TypedWasm/ABI/Occupancy.idr index 95b1660..33ad01c 100644 --- a/src/abi/TypedWasm/ABI/Occupancy.idr +++ b/src/abi/TypedWasm/ABI/Occupancy.idr @@ -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 diff --git a/src/abi/TypedWasm/ABI/ResourceAlgebra.idr b/src/abi/TypedWasm/ABI/ResourceAlgebra.idr index affa889..0669c53 100644 --- a/src/abi/TypedWasm/ABI/ResourceAlgebra.idr +++ b/src/abi/TypedWasm/ABI/ResourceAlgebra.idr @@ -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 diff --git a/src/abi/TypedWasm/ABI/ResourceAlgebra/HWM.idr b/src/abi/TypedWasm/ABI/ResourceAlgebra/HWM.idr index 587bf46..359328e 100644 --- a/src/abi/TypedWasm/ABI/ResourceAlgebra/HWM.idr +++ b/src/abi/TypedWasm/ABI/ResourceAlgebra/HWM.idr @@ -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 diff --git a/src/abi/TypedWasm/ABI/ResourceAlgebra/Loss.idr b/src/abi/TypedWasm/ABI/ResourceAlgebra/Loss.idr index 504435a..82eab5c 100644 --- a/src/abi/TypedWasm/ABI/ResourceAlgebra/Loss.idr +++ b/src/abi/TypedWasm/ABI/ResourceAlgebra/Loss.idr @@ -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 diff --git a/src/abi/TypedWasm/ABI/ResourceAlgebra/MaxPlus.idr b/src/abi/TypedWasm/ABI/ResourceAlgebra/MaxPlus.idr index 820b97f..b79bc9a 100644 --- a/src/abi/TypedWasm/ABI/ResourceAlgebra/MaxPlus.idr +++ b/src/abi/TypedWasm/ABI/ResourceAlgebra/MaxPlus.idr @@ -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) diff --git a/src/abi/TypedWasm/ABI/ResourceAlgebra/MinMax.idr b/src/abi/TypedWasm/ABI/ResourceAlgebra/MinMax.idr index 2258ad5..f5e2b0b 100644 --- a/src/abi/TypedWasm/ABI/ResourceAlgebra/MinMax.idr +++ b/src/abi/TypedWasm/ABI/ResourceAlgebra/MinMax.idr @@ -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. -- diff --git a/src/abi/TypedWasm/ABI/ResourceAlgebra/Nat.idr b/src/abi/TypedWasm/ABI/ResourceAlgebra/Nat.idr index 17c3a00..27a2d1f 100644 --- a/src/abi/TypedWasm/ABI/ResourceAlgebra/Nat.idr +++ b/src/abi/TypedWasm/ABI/ResourceAlgebra/Nat.idr @@ -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, diff --git a/src/abi/TypedWasm/ABI/ResourceAlgebra/Separation.idr b/src/abi/TypedWasm/ABI/ResourceAlgebra/Separation.idr index fd6029d..356dac1 100644 --- a/src/abi/TypedWasm/ABI/ResourceAlgebra/Separation.idr +++ b/src/abi/TypedWasm/ABI/ResourceAlgebra/Separation.idr @@ -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 diff --git a/src/abi/typed-wasm.ipkg b/src/abi/typed-wasm.ipkg index 80043c7..e0aaac8 100644 --- a/src/abi/typed-wasm.ipkg +++ b/src/abi/typed-wasm.ipkg @@ -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 @@ -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 diff --git a/tests/reject/CostIsOccupancy.idr b/tests/reject/CostIsOccupancy.idr index 8fd9afc..40ab27e 100644 --- a/tests/reject/CostIsOccupancy.idr +++ b/tests/reject/CostIsOccupancy.idr @@ -2,7 +2,7 @@ -- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) -- -- 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. diff --git a/tests/reject/DriftIsPeak.idr b/tests/reject/DriftIsPeak.idr index 82f10ef..b521ecc 100644 --- a/tests/reject/DriftIsPeak.idr +++ b/tests/reject/DriftIsPeak.idr @@ -2,7 +2,7 @@ -- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) -- -- 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". diff --git a/tests/reject/MinMaxIsLoss.idr b/tests/reject/MinMaxIsLoss.idr index 7d86b8d..61d5ec4 100644 --- a/tests/reject/MinMaxIsLoss.idr +++ b/tests/reject/MinMaxIsLoss.idr @@ -2,7 +2,7 @@ -- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) -- -- 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 diff --git a/tests/transcription/ops.tsv b/tests/transcription/ops.tsv index 1d84076..956cf20 100644 --- a/tests/transcription/ops.tsv +++ b/tests/transcription/ops.tsv @@ -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