BUILTIN_SPECS is sole Cranelift import source
Platform spec ADR
BUILTIN_SPECS is sole Cranelift import source
Spec standingStandard
- Contracts and edge cases MUST rules for builtin signatures, return kinds, and export name stability.
- Design model BuiltinFnSpec catalog, runtime export symbols, and codegen import boundaries.
- Examples Reading BUILTIN_SPECS, mapping symbols to runtime modules, and typical call patterns.
- FAQ and troubleshooting Builtin symbol drift, signature mismatches, and codegen/runtime debugging.
- Flow and algorithm From lowering call sites through BUILTIN_SPECS to runtime C exports.
- Verification and traceability Crate paths and tests that pin builtin specs to runtime exports.
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
| Section id | Required | Found |
|---|---|---|
what-this-feature-specifies | yes | yes |
implementation-anchors | yes | yes |
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
Context
Section titled “Context”Hand-written Cranelift calls bypass the shared ABI catalog and desynchronize JIT, AOT, and runtime extern "C-unwind" implementations.
Decision
Section titled “Decision”| Rule | Detail |
|---|---|
| Catalog | BUILTIN_SPECS in beskid_abi::builtins is the sole source of Cranelift import signatures (ABI-002) |
| Codegen | declare_builtin_imports builds FuncIds only from specs |
| Diverging builtins | AbiReturnKind::Never for panic so unreachable blocks are correct |
| Parity | Symbol strings in specs must match RUNTIME_EXPORT_SYMBOLS entries (ABI-001) |
Consequences
Section titled “Consequences”New builtins require spec, BUILTIN_SPECS, symbols.rs, and beskid_runtime::builtins in one change set.
Verification anchors
Section titled “Verification anchors”compiler/crates/beskid_codegen; compiler/crates/beskid_abi/src/builtins.rs.