Commit 695cc51
ABI: make Idris2 proofs genuinely compile + add machine-checked theorems (#32)
* 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
The src/interface/abi/{Types,Layout,Foreign}.idr files were scaffolded from
a template and never compiler-checked. They now build clean under Idris2
0.7.0 with zero errors and zero warnings.
Fixes:
- Types.idr: replace `%runElab` thisPlatform stub with `thisPlatform = Linux`
(ElabReflection was not enabled).
- Types.idr: createHandle now obtains a real `So (ptr /= 0)` witness via
`choose` instead of leaving the MkHandle auto-implicit unsolved.
- Types.idr: add a genuine `DecEq Result` instance with explicit off-diagonal
disequality cases (`No (\case Refl impossible)`) — a `No absurd` catch-all
does not typecheck.
- Layout.idr: paddingFor uses `minus` instead of Nat subtraction (`-`).
- Layout.idr: lift record-local `requiredAlloc` (illegal `where` on a record)
to a top-level definition.
- Layout.idr: interleaved/planar/video layouts and the new mkDim/mkLayout
smart constructors decide their `So` extent/stride/coverage obligations with
`choose`, returning Maybe, instead of leaving unprovable symbolic auto
proofs unsolved.
- Layout.idr: checkCompatibility binds n,m as runtime implicits so decEq has
access to them.
- Layout.idr: add the C-ABI proof machinery (Divides, decDivides, StructLayout,
FieldsAligned, decFieldsAligned, CABICompliant, checkCABI, offsetInBounds)
plus concrete StructLayout values for halide_buffer_t and halide_dimension_t,
with their erased proofs supplied explicitly ({sizeCorrect = Oh},
{aligned = DivideBy k Refl}). checkCABI is a sound decision procedure
(no `?fieldsAlignedProof` hole). offsetInBounds returns Maybe (So ...) via
choose rather than asserting an unsound universal bound.
New machine-checked theorems (src/interface/abi/Halideiser/ABI/Proofs.idr):
- halideBufferTCompliant : CABICompliant halideBufferTStruct
- halideDimensionTCompliant : CABICompliant halideDimensionTStruct
(each built directly from per-field DivideBy k Refl witnesses)
- okIsZero, dimensionMismatchIsSeven : result-code encoding pins
- avx512Width, float64Bytes : codegen sanity equalities
Buildability:
- Move flat files into src/interface/abi/Halideiser/ABI/ so paths match the
Halideiser.ABI.* namespaces.
- Add src/interface/abi/halideiser-abi.ipkg listing all four modules.
- .gitignore: ignore **/build/, *.ttc, *.ttm.
No believe_me / assert_total / idris_crash / postulate / %hint / holes are
used anywhere; every obligation is discharged genuinely.
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 113125a commit 695cc51
6 files changed
Lines changed: 383 additions & 47 deletions
File tree
- src/interface/abi
- Halideiser/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: 202 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
54 | 64 | | |
55 | 65 | | |
56 | 66 | | |
| |||
73 | 83 | | |
74 | 84 | | |
75 | 85 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
| |||
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
94 | 124 | | |
95 | 125 | | |
96 | 126 | | |
| |||
99 | 129 | | |
100 | 130 | | |
101 | 131 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
111 | 138 | | |
112 | 139 | | |
113 | 140 | | |
| |||
117 | 144 | | |
118 | 145 | | |
119 | 146 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
129 | 153 | | |
130 | 154 | | |
131 | 155 | | |
132 | 156 | | |
133 | 157 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
144 | 165 | | |
145 | 166 | | |
146 | 167 | | |
| |||
152 | 173 | | |
153 | 174 | | |
154 | 175 | | |
155 | | - | |
| 176 | + | |
156 | 177 | | |
157 | 178 | | |
158 | 179 | | |
| |||
212 | 233 | | |
213 | 234 | | |
214 | 235 | | |
215 | | - | |
| 236 | + | |
216 | 237 | | |
217 | 238 | | |
218 | 239 | | |
| |||
294 | 315 | | |
295 | 316 | | |
296 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
0 commit comments