0%

s22 — Dev-Mode Tier: ori run / ori test on the Native Fast Tier

Goal

The fast tier becomes the development execution path: ori run --backend=native and ori test --backend=native are first-class, fast (no LLVM Context bottleneck — parallel test execution), with the s03-decided execution shape (quick-AOT or in-memory) implemented and cache-integrated.

Implementation Sketch

  • Execution shape per the s03 decision record: quick-AOT (compile to temp object + link + exec — simplest, reuses the whole s08+ chain) vs in-memory emission (map executable pages + resolve runtime symbols in-process — faster startup, more machinery). The decision was recorded at s03; this section implements it and measures the difference on the dev-loop corpus before locking.
  • ori run: single-file + multi-file paths through compile_to_native_*; stdout/exit-code parity with ori build+exec pinned (the dual-exec Part-2 discipline).
  • ori test: the s04 AOT-shaped runner goes production-grade — batch compilation of test exports, PARALLEL execution (no Context lock; rayon over test binaries/exports), result aggregation into the existing summary machinery; LCFAIL-equivalent classification for native compile failures.
  • Salsa/caching integration: backend consumes cached ArcFunction/borrow-inference outputs (the cache feature boundaries respected — serde-skip derived fields recompute per session); incremental dev-loop measured (edit-compile-run cycle) on the corpus; no Salsa contamination inside ori_backend (it stays a pure consumer like ori_llvm).
  • Dev ergonomics: ORI_BACKEND env default honored; error surfaces identical to LLVM path.

Test Strategy

  • Matrix: {run single-file, run multi-file, test small suite, test full spec dir} x {native} — parity vs interpreter + LLVM; parallel-execution determinism (result sets identical across runs).
  • Semantic pin: dev-loop latency benchmark recorded (edit-to-output) vs LLVM-JIT path baseline (/calc-verified) — the fast-tier raison d’etre measured.
  • Negative pin: a poisoned cache fixture (stale derived fields) is recomputed, not consumed (cache-discipline check).

Work Items

  • Execution-shape implementation per s03 decision + measured comparison on the dev-loop corpus before lock-in.
  • ori run native path (single + multi-file) with build/exec parity pins.
  • ori test native runner production-grade: batch compile, parallel exec, summary integration, native compile-failure classification.
  • Cache integration (derived-field recompute discipline + incremental dev-loop measurement) with poisoned-cache negative pin.
  • Dev-loop latency ledger vs LLVM-JIT baseline recorded.