JIT and CLI hosts may load a beskid_runtime artifact built separately from the active compiler. Without an explicit version gate, stale toolchains call builtins with wrong layouts or missing symbols.
Contracts and edge cases
Platform spec article
Contracts and edge cases
Spec standingStandard
-
Hosts reject mismatched compiler and runtime ABI integers before executing generated code.
Context
Decision
Rule Detail Version surface beskid_runtime_abi_version()returnsBESKID_RUNTIME_ABI_VERSION(u32inbeskid_abi)Host check Hosts should fail before user mainwhen runtime version ≠ compiler-embedded constant (ABI-003)Diagnostics Failure messages must name both integers and recommend aligning CLI/VSIX/runtime release sets Consequences
Release matrices document paired compiler/runtime builds. Conformance should assert version parity in JIT smoke tests (
beskid_testsruntime/jit).Verification anchors
compiler/crates/beskid_abi/src/version.rs;beskid_engineJIT module setup; ABI-001–ABI-003 in contracts and edge cases. -
Layout, signature, or semantic breaks must increment BESKID_RUNTIME_ABI_VERSION.
Context
Additive runtime symbols and Cargo feature gates are easy to confuse with ABI-stable changes. Silent signature drift breaks AOT/JIT link steps or causes undefined behavior at call sites.
Decision
Trigger Action BeskidStr/BeskidArray/ interop payload layout changeMust increment BESKID_RUNTIME_ABI_VERSION(ABI-004)Builtin rename, arity change, or AbiParamKind/AbiReturnKindchangeMust bump version Semantics relied on by lowering change (e.g. barrier no-op) Must bump version New symbol appended, older artifacts never import it May ship without bump (ABI-005) Optional Cargo featuresonlyMust not bump ABI version Reference tree pins version 2 until the next breaking change.
Consequences
Release notes should list bumped versions and removed symbols. Renaming without bump is a release-process violation.
Verification anchors
beskid_abisymbol tables;RUNTIME_EXPORT_SYMBOLSparity checks in CI.
- Contracts and edge cases MUST/SHOULD rules for ABI version bumps, symbol stability, and mixed toolchain failures.
- Design model ABI version negotiation, symbol stability, and compiler–runtime compatibility boundaries.
- Examples ABI version checks, symbol parity, and migration scenarios for toolchain maintainers.
- FAQ and troubleshooting Common ABI mismatch failures and maintainer guidance for version bumps.
- Flow and algorithm JIT symbol registration, ABI version export, and compatibility check ordering.
- Verification and traceability Tests and crate paths that pin ABI version and runtime export symbol parity.
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).
Normative requirements
Section titled “Normative requirements”| ID | Requirement |
|---|---|
| ABI-001 | RUNTIME_EXPORT_SYMBOLS in beskid_abi must list every symbol the JIT registers and the runtime exports with #[unsafe(no_mangle)] under the same spelling. |
| ABI-002 | BUILTIN_SPECS must be the sole source of Cranelift import signatures for runtime builtins; hand-written CLIF calls must not invent alternate calling conventions. |
| ABI-003 | Hosts should reject execution when beskid_runtime_abi_version() ≠ BESKID_RUNTIME_ABI_VERSION compiled into the active compiler. |
| ABI-004 | Breaking layout or signature changes must increment BESKID_RUNTIME_ABI_VERSION; silent mismatches are forbidden. |
| ABI-005 | Additive symbols may ship without a version bump only if older generated code never imports them and older runtimes ignore unknown symbols safely. |
| ABI-006 | JIT and AOT for the same release must target identical beskid_abi revision (same symbol set and signatures). |
Edge cases
Section titled “Edge cases”| Scenario | Expected behavior |
|---|---|
| Stale VSIX / CLI with fresh runtime | Version check fails fast with actionable diagnostics before running user main. |
| Renamed builtin without version bump | Link or JIT finalize fails (MissingFunction) or undefined behavior if forced—treated as a release process violation. |
Optional runtime features (arrays_backing, metrics) | Do not change BESKID_RUNTIME_ABI_VERSION; see Runtime feature flags. |
Dynamic Extern symbols | Resolved addresses are extras in BeskidJitModule::new_with_symbols; they are not part of RUNTIME_EXPORT_SYMBOLS. |
SHOULD guidance
Section titled “SHOULD guidance”- Release notes should document ABI bumps and list removed or renamed symbols.
- Conformance fixtures should assert symbol list parity between
symbols.rsandbeskid_runtime::lib.rsre-exports.
Related topics
Section titled “Related topics”- Extern dispatch and policy — user library symbols outside
RUNTIME_EXPORT_SYMBOLS - Rust ABI profile — runtime export calling convention vocabulary