Commit d64b5fc
ABI: make Idris2 proofs genuinely compile + add machine-checked theorems (#36)
* Add SPDX header to LICENSE and set Cargo.toml license field
The governance/licence-consistency check requires an SPDX-License-Identifier
header on the LICENSE file and a `license` field in the manifest. The LICENSE
body is MPL-2.0 text, so stamp `SPDX-License-Identifier: MPL-2.0` (matching the
actual body) and set `license = "MPL-2.0"` (replacing `license-file`).
Verified with standards/scripts/check-licence-consistency.sh (passes).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DF9CcCuL4YJoqs26eHsYiA
* Normalize licensing to MPL-2.0 (code) + CC-BY-SA-4.0 (docs)
Make the repo's licensing single and consistent, matching the wokelangiser
reference policy and the merged iseriser pattern:
- Remove contradictory PMPL-1.0-or-later / Palimpsest self-claims from README
badges/footers, QUICKSTART, RSR_OUTLINE, STATE-VISUALIZER, and machine-readable
governance (META, stapeln, deny.toml allow-list, copilot/AGENTIC SPDX
directives, Trust/Must LICENSE-content checks, per-project CLAUDE.md).
- Encode the docs split in REUSE dep5: *.adoc/*.md/docs/** -> CC-BY-SA-4.0,
everything else -> MPL-2.0.
- READMEs show MPL-2.0 (code) + CC-BY-SA-4.0 (docs) badges; full texts live in
LICENSES/; root LICENSE stays MPL-2.0 for GitHub's licence chip.
Preserves legitimate non-self references: cargo-deny's AGPL deny-list, the
"never use AGPL" estate policy, and the Contributor Covenant CoC.
Verified: standards/scripts/check-licence-consistency.sh passes; no residual
PMPL/Palimpsest self-claims remain.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DF9CcCuL4YJoqs26eHsYiA
* Fix Idris2 ABI proofs so they genuinely compile and verify (0.7.0)
The src/interface/abi/{Types,Layout,Foreign}.idr files were scaffolded from
a template and never compiler-checked. This makes the whole ABI build clean
under Idris2 0.7.0 with zero errors and zero warnings, and adds real
machine-checked theorems.
Buildability:
- Moved flat files into the Futharkiser.ABI namespace layout
(src/interface/abi/Futharkiser/ABI/{Types,Layout,Foreign}.idr).
- Added src/interface/abi/futharkiser-abi.ipkg listing all four modules.
Types.idr:
- Replaced every `decEq _ _ = No absurd` catch-all (GPUBackend, SOAC,
MemorySpace, Result) with explicit off-diagonal cases of the form
`decEq X Y = No (\case Refl impossible)`; imported Decidable.Equality.
- createHandle now solves the `{auto 0 nonNull : So (ptr /= 0)}` obligation
via `choose (ptr /= 0)` instead of leaving it unsolved.
- thisPlatform = Linux (was a %runElab block needing ElabReflection).
- CPtr now maps each Platform to a concrete Bits type (was the non-existent
`Bits : Nat -> Type`).
- verifyTransfer same-space cases made explicit (the `s s` non-linear
pattern did not compile).
Layout.idr:
- paddingFor uses `minus alignment (mod offset alignment)` (Nat has no Neg);
imported Data.Nat.
- Added sound `decDivides` and `decFieldsAligned` decision procedures.
- checkCABI now returns a real `FieldsAligned` witness via decFieldsAligned
(was the hole `?fieldsAlignedProof`).
- verifyLayout supplies both erased auto-implicits (sizeCorrect, aligned)
explicitly, gating on decDivides.
- offsetInBounds is now `Maybe (So ...)` via choose (the universally
quantified `So` return type was unsound).
- Concrete gpuBufferDescriptorLayout supplies {sizeCorrect = Oh,
aligned = DivideBy 4 Refl} (32 = 4 * 8).
- Replaced the false-by-Refl alignUpCorrect with the genuinely provable
multipleDivides lemma.
- Renamed shadowing implicit binders to clear all warnings.
Proofs.idr (new): genuine theorems, all `export`, no holes/escape hatches:
- gpuBufferDescriptorCompliant : CABICompliant of the FFI struct, built
directly from DivideBy witnesses per field.
- descriptorSizeAligned, okIsZero, errorIsOne,
okDistinctFromShapeMismatch, f64IsEightBytes.
.gitignore: added **/build/, *.ttc, *.ttm for Idris2 artifacts.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DF9CcCuL4YJoqs26eHsYiA
---------
Co-authored-by: Jonathan D.A. Jewell <paraordinate@yahoo.co.uk>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 561c574 commit d64b5fc
6 files changed
Lines changed: 287 additions & 31 deletions
File tree
- src/interface/abi
- Futharkiser/ABI
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
| |||
File renamed without changes.
Lines changed: 70 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | | - | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
49 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
50 | 58 | | |
51 | | - | |
52 | | - | |
53 | | - | |
| 59 | + | |
| 60 | + | |
54 | 61 | | |
55 | 62 | | |
56 | 63 | | |
| |||
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
78 | | - | |
| 85 | + | |
79 | 86 | | |
80 | 87 | | |
81 | 88 | | |
| |||
104 | 111 | | |
105 | 112 | | |
106 | 113 | | |
107 | | - | |
| 114 | + | |
108 | 115 | | |
109 | 116 | | |
110 | 117 | | |
| |||
142 | 149 | | |
143 | 150 | | |
144 | 151 | | |
145 | | - | |
| 152 | + | |
146 | 153 | | |
147 | 154 | | |
148 | 155 | | |
| |||
151 | 158 | | |
152 | 159 | | |
153 | 160 | | |
154 | | - | |
| 161 | + | |
155 | 162 | | |
156 | 163 | | |
157 | 164 | | |
158 | | - | |
| 165 | + | |
159 | 166 | | |
160 | 167 | | |
161 | 168 | | |
162 | 169 | | |
163 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
164 | 174 | | |
165 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
166 | 203 | | |
167 | 204 | | |
168 | 205 | | |
169 | | - | |
170 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
171 | 211 | | |
172 | 212 | | |
173 | 213 | | |
| |||
221 | 261 | | |
222 | 262 | | |
223 | 263 | | |
224 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
225 | 267 | | |
226 | 268 | | |
227 | 269 | | |
228 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
229 | 273 | | |
230 | 274 | | |
231 | 275 | | |
| |||
247 | 291 | | |
248 | 292 | | |
249 | 293 | | |
| 294 | + | |
250 | 295 | | |
251 | 296 | | |
252 | 297 | | |
| |||
260 | 305 | | |
261 | 306 | | |
262 | 307 | | |
263 | | - | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
264 | 312 | | |
265 | | - | |
266 | | - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
0 commit comments