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, and archsem_ir RTL Nodes, 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-symex expression nodes) are opaque behind typed accessors.

Extension-Point Taxonomy

Public extension points follow six explicit roles:

SuffixResponsibility
EmitterReceives the portable semantic vocabulary and constructs another IR (RtlEmitter, LlvmEmitter, ReferenceEmitter)
EnvironmentSupplies concrete external state and records effects (ConcreteEnvironment, ReferenceEnvironment)
PolicyChooses a bounded analysis action without supplying machine state (MemoryPartitionPolicy, MemoryPolicy, CallPolicy)
ProviderSupplies caller-owned facts, summaries, choices, or supplements (ChoiceProvider, CallSummaryProvider, OriginSupplementProvider)
SinkConsumes an exported stream or obligation (FunctionReplaySink, RegisterSsaReplaySink, ProofObligationSink)
AdapterTranslates 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) and archsem.external-oracle-response.
  • Cryptographic Request Binding: Every response carries request_binding (sha256 canonical 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) and unavailable (model_not_installed, license_not_accepted, toolchain_incompatible, timeout) remain distinct from observed mismatches (OracleDisagreementArtifact).
  • Maintained Differential: archsem-conformance/oracles/x86isa maintains a pinned ACL2 8.5 / x86isa differential fixture (48 89 d8 MOV 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:

StageFixed WorkloadWork UnitOutput Unit
decode_lift384 instances from a 6-instruction x86 corpusDecoded instructions + actionsRecorded actions
vm_interpret32 interpretations of a 64-lane VM programVerified expanded micro-opsRecorded actions
rtl_build1 fragment with 256 redundant outputsRTL nodes builtFragment events
optimize1 copy of that redundant fragmentSimplifier node visitsRetained RTL nodes
replay32 replays of the optimized fragmentInput RTL nodes replayedReplayed record events
bounded_symex8 executions of a depth-3, 15-block CFGSymbolic execution stepsCompleted 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:

  1. archsem-core
  2. archsem-record, archsem-arm64, archsem-x86
  3. archsem-ir, archsem-conformance
  4. archsem-simplify
  5. archsem-symex, archsem-ref (plus bytecode frontends archsem-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.