Skip to content

Architecture

bhogesararam23 edited this page Oct 5, 2026 · 1 revision

Architecture

APORIA is a Rust workspace under software/. Its crates separate model compilation and execution from evidence analysis, search, reporting, and persistence. The separation lets the campaign consume executions without embedding every execution mechanism in the search driver.

Execution path

.ap source ──> aporia-dsl ──> A-IR ──> Executor ──> observations
                                                   │
                   properties / numerics <────────┘
                           │
                 evidence + calibration + fusion
                           │
                  search + Trust Atlas
                           │
               findings / archive / replay

The shipped aporia-cli path reads a .ap file, compiles and verifies it, then runs the campaign with the default scalar interpreter. aporia-search also exposes run_with and an Executor trait. That is a Rust library seam for alternate execution; the repository does not yet ship a packaged adapter or a foreign-program command-line workflow. An executor reports outputs, traces, flags, and work steps. It can also say whether it supports a meaningful lower-precision run or an independent reference path; unsupported probes are skipped rather than represented as agreement.

Crates

Crate Responsibility
aporia-dsl Lexes, parses, checks units, and lowers Aporia DSL source to A-IR.
aporia-ir Defines and verifies the three-address intermediate representation, domains, dimensions, relations, and constraints; also has a canonical text form.
aporia-runtime Scalar interpreter and lane-major batch evaluator, execution modes, traces, flags, and outcome records.
aporia-numerics Double-double arithmetic, numerical comparison helpers, deterministic random generator, and an independent A-IR reference evaluator.
aporia-properties Evaluates declared rules and relations, divergence, inferred patterns, perturbation probes, and sensitivity.
aporia-evidence Five evidence channels, fitted calibration, provenance-aware correlation discounts, and noisy-OR fusion.
aporia-boundary Adaptive axis-aligned cell partition, labels, coverage, and boundary bands.
aporia-search Acquisition families, strategies, budgeted campaign, decisions, records, and findings.
aporia-minimize Predicate-preserving parameter and value reduction for a finding.
aporia-store Run manifests, digests, fixed-record observations, findings, CSV bands, and replay.
aporia-bench Registered corpus, ground-truth checks, campaign runs, metrics, comparisons, and explanations.
aporia-cli The aporia run <model.ap> front end.

Two evaluators and independent paths

For A-IR models, the scalar interpreter is the default execution path used by the CLI. A lane-major batch evaluator is also implemented in aporia-runtime. The campaign's current differential probe compares the selected executor with the independent A-IR reference evaluator; it does not automatically compare scalar and batch runs. The numerical channel compares f64 and f32 executions. The reference evaluator uses double-double arithmetic and shares no arithmetic implementation with the runtime.

An alternate executor can declare that it does not vary with requested precision or has no independent A-IR reference. In those cases, APORIA does not spend campaign budget on probes that would only repeat the same path or compare against equations that do not describe the executed program. See Evidence Model and Adaptive Search.

Source and history

The implementation lives in the APORIA source repository. Its commit history shows several conclusions being revised after measurement: trust-label reachability, single-channel corroboration, findings merged by region, charged differential reference calls, and declared symmetry probes. The current benchmark narrative records those corrections; see Experiments & Results.


Home · How APORIA Works · Archives and Replay

Clone this wiki locally