API Stability & Releasing
This chapter summarizes Architectura's public API evolution rules (docs/api-stability.md), external formal oracle protocol (docs/external-formal-oracles.md), deterministic performance baselines (docs/performance-baselines.md), and staged release process (docs/releasing.md).
Public API Stability Policy
Architectura is currently pre-0.2: semantic and artifact contracts are versioned and validated, while deliberate public API refinements remain permitted until 0.2 is cut (monitored via cargo-semver-checks on portable libraries in CI).
Closed Vocabulary vs. Extensible Boundaries
- Closed Semantic Vocabulary (Exhaustive Matching): Representation-bearing types that are the portable semantic language—
archsem_core::IrEmitter,SemProgram,MicroOp, control/memory/fault/choice/decode contracts,archsem_record::SemanticAction, andarchsem_irRTLNodes, events, origins, and SSA records—may be matched exhaustively. Adding a primitive is a semantic language change so consumers are never silently incomplete. - Open-Ended Results (
#[non_exhaustive]): Failures, resource/boundary reasons, evidence classifications, and backend capability outcomes use#[non_exhaustive]so callers fail closed or preserve unknown future cases. Analysis-internal arena indices (e.g.,archsem-symexexpression nodes) are opaque behind typed accessors.
Extension-Point Taxonomy
Public extension points follow six explicit roles:
| Suffix | Responsibility |
|---|---|
Emitter | Receives the portable semantic vocabulary and constructs another IR (RtlEmitter, LlvmEmitter, ReferenceEmitter) |
Environment | Supplies concrete external state and records effects (ConcreteEnvironment, ReferenceEnvironment) |
Policy | Chooses a bounded analysis action without supplying machine state (MemoryPartitionPolicy, MemoryPolicy, CallPolicy) |
Provider | Supplies caller-owned facts, summaries, choices, or supplements (ChoiceProvider, CallSummaryProvider, OriginSupplementProvider) |
Sink | Consumes an exported stream or obligation (FunctionReplaySink, RegisterSsaReplaySink, ProofObligationSink) |
Adapter | Translates to an external framework or toolchain |
External Formal Oracle Sidecar Protocol (archsem-conformance::external_oracle)
To validate semantics against independently installed formal ISA models (Arm ASL, K x86-64, ACL2 x86isa) without embedding external toolchains, licenses, or command execution into archsem, archsem-conformance::external_oracle defines a bounded JSON/RON exchange protocol:
archsem process independently managed sidecar
--------------- -----------------------------
ExternalOracleRequest ──────────▶ translate & execute ASL / K / ACL2
ExternalOracleResponse ◀────────── observed / unsupported / unavailable
compare_external_result()
├─ Agreement
└─ OracleDisagreementArtifact
- Schemas:
archsem.external-oracle-request(v1.0) andarchsem.external-oracle-response. - Cryptographic Request Binding: Every response carries
request_binding(sha256canonical revision 1 over the complete validated request: architecture, profile, sorted context, address, bytes, initial registers/flags/memory, choices, environment inputs, and model name/version/revision), preventing response substitution. - Typed Non-Agreement:
unsupported(model lacks coverage or observation vocabulary) andunavailable(model_not_installed,license_not_accepted,toolchain_incompatible, timeout) remain distinct fromobservedmismatches (OracleDisagreementArtifact). - Maintained Differential:
archsem-conformance/oracles/x86isamaintains a pinned ACL2 8.5 /x86isadifferential fixture (48 89 d8MOV RAX, RBX) with source-hash verification (ARCHSEM_X86ISA_LIVE=1).
Deterministic Performance Baselines (archsem-benchmarks)
Rather than brittle wall-clock assertions in CI, archsem-benchmarks guards provider-pipeline regressions using deterministic work units, output units, SHA-256/checksum verification, and generous allocation ceilings stored in archsem-benchmarks/baselines/semantics_pipeline.json:
| Stage | Fixed Workload | Work Unit | Output Unit |
|---|---|---|---|
decode_lift | 384 instances from a 6-instruction x86 corpus | Decoded instructions + actions | Recorded actions |
vm_interpret | 32 interpretations of a 64-lane VM program | Verified expanded micro-ops | Recorded actions |
rtl_build | 1 fragment with 256 redundant outputs | RTL nodes built | Fragment events |
optimize | 1 copy of that redundant fragment | Simplifier node visits | Retained RTL nodes |
replay | 32 replays of the optimized fragment | Input RTL nodes replayed | Replayed record events |
bounded_symex | 8 executions of a depth-3, 15-block CFG | Symbolic execution steps | Completed return paths |
Run the CI deterministic check or local release calibration via:
# CI deterministic contract (work, output, checksum, allocation ceilings):
cargo test --locked -p archsem-benchmarks --bench semantics_pipeline -- --check
# Local calibration / median-of-7 release timing:
cargo bench --locked -p archsem-benchmarks --bench semantics_pipeline -- --calibrate
cargo bench --locked -p archsem-benchmarks --bench semantics_pipeline
Staged crates.io Release Procedure
Pre-Release Verification Gates (Rust 1.88)
cargo fmt --all -- --check
cargo test --locked --workspace --all-targets --all-features --exclude archsem-llvm
cargo check --locked --target wasm32-unknown-unknown --all-targets --all-features \
-p archsem-core -p archsem-record -p archsem-ir -p archsem-simplify \
-p archsem-symex -p archsem-ref -p archsem-conformance -p archsem-x86 -p archsem-arm64
cargo check --locked --target wasm32-wasip1 --all-targets --all-features \
-p archsem-core -p archsem-record -p archsem-ir -p archsem-simplify \
-p archsem-symex -p archsem-ref -p archsem-conformance -p archsem-x86 -p archsem-arm64
Staged Dependency Order
Publish portable crates in topological order, verifying each archive (cargo package --locked -p <crate> and cargo publish --locked -p <crate> --dry-run) and waiting for index visibility before packaging the next layer:
archsem-corearchsem-record,archsem-arm64,archsem-x86archsem-ir,archsem-conformancearchsem-simplifyarchsem-symex,archsem-ref(plus bytecode frontendsarchsem-wasm,archsem-evm,archsem-cil,archsem-lua)
Host-only tools (archsemc, archsem-lang, archsem-lsp, archsem-gen, archsem-export, archsem-uops-info, archsem-llvm) and the native archsem-capi library remain publish = false.