Skip to main content

Module compile

Module compile 

Source
Expand description

LOGOS Compilation Pipeline for CLI

Re-exports the compilation API from logicaffeine_compile.

This module provides access to the core compilation functions without requiring a direct dependency on the compile crate. The key export is compile_project, which transforms LOGOS source into Rust code.

§Architecture

The compilation pipeline is implemented in the logicaffeine_compile crate. This module simply re-exports those types for convenience within the CLI.

§Example

use std::path::Path;
use logicaffeine_cli::compile::compile_project;

let rust_code = compile_project(Path::new("src/main.lg"))?;
println!("Generated {} bytes of Rust", rust_code.rust_code.len());

Structs§

AotModule
A compiled AOT-native module (HOTSWAP §Axis-3): the cdylib Rust SOURCE plus the exact exported symbol to resolve and its arity — everything the loader needs.
CheckArtifacts
Compile LOGOS source and write output to a directory as a Cargo project.
CompileOutput
Full compilation output including generated Rust code and extracted dependencies.
CrateDependency
A declared external crate dependency from a ## Requires block.
EngineOutcome
The outcome of a STRICT engine run. engine_ran is the honest identity: Some(engine) means that engine — and only that engine — executed the program; None means NOTHING ran (a parse failure, or the typed refusal of an engine that cannot run the program) and error says why. A strict run never silently substitutes the tree-walker for the VM.
GenuineProjectionResult
Result of a genuine Futamura projection via self-application. Contains the LOGOS source of the residual and the discovered entry points.
RduArtifact
What largo emit rdu writes: the logos.spatial.neutral v2 envelope, the placement text, the certificate (rechecked against the program, carrying the envelope’s digest), the MODELED report naming the lane, and — when the lane produced one — the Spatial source.
RduBundle
A streamed model bundle’s manifest, the model constants it binds from files no checkpoint holds — each at the path the manifest binds it at, relative to the bundle — which are written with it, and the LOGOS text of the whole cut of the model’s one program the bundle deploys (program.lg), which the manifest’s program line identifies.
RduModel
A model the RDU bundle is compiled from: its spec, the name the manifest gives it, which of the weights the author declares Q8_0 its checkpoint stores Q8_0, and the per-frequency factors of a rotation that reads them (rope_freqs.weight).
RduProgramFiles
One lowered program of a streamed model bundle, rendered to the files a bundle directory holds.
RunOutcome
What a program run produced: every output line emitted before completion or failure, plus the error if it failed. The differential contract is vm_outcome(src) == tw_outcome(src) — output AND error.
StepShape
A step deployment’s shape: a KV cache of ctx positions per sequence, batch sequences per step, over tp chips of tensor parallelism — and, with prefill: Some(chunk), a step that PREFILLS chunk tokens of one sequence (their hidden states stacked, the sequence’s state taken row by row: the model’s prefill cut) instead of decoding one token per sequence.

Enums§

Backend
A backend that lowers compiled bytecode WITHOUT the Rust runtime — the tiers refuse_unlinkable gates. What each one lowers is answered per construct against this type (see crate::semantics::crdt::CrdtKind::lowered_by), so adding a backend fails to compile until every such table classifies it.
CompileError
Errors that can occur during the LOGOS compilation pipeline.
EngineId
Which engine actually executed a strict run — the identity a caller can trust, because the strict entries never substitute one engine for another.
ProjectScopeError
Why a project fails enforce_project_scope_with_deps.
RduLane
Which lane a program takes — a function of its shape, printed by largo emit rdu as lane: <name>.
RuntimeCrateSource
How a generated project resolves the logicaffeine runtime crates.
TierVerdict
The verdict of a cross-tier differential run (Wave 13, footgun F18). Program output must be byte-identical across every execution tier; a divergence is ALWAYS a compiler bug — the framework’s liability, never the user’s mistake — and carries a filed-ready reproduction bundle.

Constants§

FIRST_CLASS_VALUE_KINDS
The CANONICAL set of value kinds that must be FIRST-CLASS as a function parameter AND return value on EVERY execution tier — the single source of truth SHARED across crates so the coverage locks cannot drift apart. The tests crate’s param_return_tier_coverage_lock asserts its PROBES name EXACTLY this set (executed on TW/VM/AOT-C/AOT-Rust, lowered on WASM), and this crate’s wasm_aot_lock::first_class_param_return_round_trips_on_wasm asserts it has an EXECUTABLE WASM program for every kind here. Adding a kind here makes BOTH locks RED until each covers it — anti-drift by construction, compiler-enforced (both crates reference this one const). Keep alphabetically grouped scalars → sequences → collections → aggregates for readability; order is not significant (compared as a set).
RDU_EMIT_REPORT_SCHEMA
RDU_STREAMED_MANIFEST_SCHEMA

Functions§

aot_build_function
On-demand AOT-native build + load (HOTSWAP §Axis-3): compile fn_name (and its callees) to an optimized cdylib (cached), dlopen it, and return the loaded crate::vm::NativeFn ready to install via Vm::install_aot_native. None if the function is absent / outside the scalar subset / the build or load failed — the caller keeps it on VM+JIT. Blocking (runs rustc); the background worker (BgAotCompiler) calls this off the interpreter thread.
aot_cache_key
The cache key for an AOT-native artifact (HOTSWAP §Axis-3 / P16): a deterministic FNV-1a hash of the rustc toolchain version AND the optimized Rust source. The toolchain is in the key because Rust has no stable cross-version ABI — a different rustc/runtime yields a different key, so a stale, ABI-mismatched .so is NEVER reused (soundness over convenience). The source captures the function, its callees, and the optimization config (it IS the codegen output).
aot_load_bundle
Load every native-annotated function in source as a compiled-native crate::vm::NativeFn (HOTSWAP §Axis-3): the run path installs these via Vm::install_aot_native, so an annotated function dispatches to rustc -O3 machine code from its first call. Uses the persistent cache, so a bundle pre-built by largo build --native-functions is a cache hit — no rustc on the run path. A function outside the scalar subset / failing to build is skipped (stays on VM+JIT).
build_native_bundle
Pre-build every native-annotated function in source into the AOT bundle under bundle_dir (HOTSWAP §Axis-3 / P16 — the “tools to bundle them”). Returns the (function_name, cdylib_path) manifest. Functions outside the sound scalar subset are silently skipped — they keep running on VM+JIT, no gap at the seam. Err only on a genuine parse/type error.
build_native_cdylib
Build AOT-native cdylib Rust source (from compile_function_to_native_rust) into a loadable cdylib (HOTSWAP §Axis-3 / P16). Generates a minimal crate under work_dir/<crate_name>, copies the shared runtime crates (so the .so and the interpreter share the SAME logicaffeine_data ABI), and runs cargo build --release. Returns the path to the produced dynamic library. panic = "unwind" (the default) — NOT abort — so a panic in a loaded function can be contained rather than killing the host process.
build_native_cdylib_cached
build_native_cdylib with a persistent cache (HOTSWAP §Axis-3 / P16). The artifact lives at cache_dir/aot_<fn>_<key>/… keyed by aot_cache_key; an identical function reuses its .so across runs (no rebuild), and a toolchain change yields a new key so the stale library is never loaded.
build_native_pe_binary
Build (once, content-addressed) the compile-once native PE binary and return its path. Keyed on the generated Rust of pe_native_source + toolchain, so the one-time rustc compile of the whole PE engine happens exactly once per PE version and is reused across every program and session. This is the amortization that turns AOT from “recompile per program” into the 210x win.
build_native_pe_cdylib
Build (and cache) the PE compiled as an IN-PROCESS cdylib exporting logos_pe_specialize. Mirrors build_native_pe_binary but emits a cdylib whose lib.rs is the generated PE engine (pe_cdylib_source) plus a hand-written extern "C" shim (PE_CDYLIB_SHIM) that decodes the wire CProgram and calls peSpecializeOnce directly — so the caller loads it once and specializes with a plain function call, no process, no pipe. Content-addressed on the (stable) cdylib PE source + shim + toolchain, so warm calls skip rustc.
build_native_wasm
Build a function’s AOT module to a browser-loadable wasm32-unknown-unknown cdylib (HOTSWAP §Axis-3 / P17 — the browser analog of build_native_cdylib). The module is the same scalar-ABI shim; the wasm crate keeps logicaffeine-data + logicaffeine-system (both wasm-ready) but drops the desktop-only tokio, the logicaffeine-system full feature, and target-cpu=native. Returns the .wasm path; the browser then WebAssembly.instantiates it and the entry calls into it through the warm-bytecode indirection. Requires the wasm32-unknown-unknown target.
classify_source
Classify the determinacy of a LOGOS program.
compile_and_run
Compile and run a LOGOS program end-to-end.
compile_file
Compile a LOGOS source file. For single-file compilation without dependencies.
compile_function_to_native_rust
Generate the Rust SOURCE for an AOT-native cdylib of ONE function (HOTSWAP §Axis-3 / P14b): the target function plus its transitive callees (crate::codegen::function_slice), emitted through the normal ARCHITECT codegen, with the crate::codegen::codegen_native_tier_export shim appended so the loader can resolve the logos_native_<target> symbol. Mirrors compile_program_full’s front-end, then slices before codegen.
compile_model_to_rdu_streamed
Lower a model to the RDU as the chip would run it: ONE program per layer kind plus the head, each lowered, certified and handed to sink in turn, and a manifest binding every layer to its kind. Returns the manifest JSON and the model constants the bundle ships: a decode deployment’s rotary caches ({weights_dir}/Rcos.f, {weights_dir}/Rsin.f, one pair per rotation the layers turn by — rope_tables at ctx positions, little-endian f32), which every step reads at its positions so the host hands in only tokens and positions.
compile_program_backend_traced
Compile the Rust AOT backend with stage-separated optimization evidence. The ordinary compile path is unchanged; tracing only observes existing mark_fired sites and classifies them as shared optimizer vs Rust lowering.
compile_program_full
Compile LOGOS source and return full output including dependency metadata.
compile_program_full_deterministic
compile_program_full for deterministic replay — the full output (rust + dependencies) with every scheduler operation lowered onto logicaffeine_system::replay. The seeded differential harness uses this so it gets the same dependency set as the default build.
compile_program_full_with_proven
Like compile_program_full, but bundles an extracted math/logic module (proven) into the generated Rust — the imperative half of a mixed document. The module is emitted as pub mod proven { … } use proven::*; so the imperative program can call its functions / check_* predicates by name. None (or a blank module) yields output byte-identical to compile_program_full.
compile_program_full_with_wire
Like compile_program_full, but every emitted (non-generic) enum also gets WireEncode/WireDecode impls over the shared logicaffeine_data::wire codec — byte-identical to the peer codec’s encode_value_raw. This lets a compile-once native partial evaluator receive a program AST as data over the same fast codec the interpreter uses. Ordinary compiles (the default) are byte-unchanged.
compile_program_traced
Compile source while recording which optimizations actually FIRED — the honest, single-compile alternative to optimizations_used’s O(N) diff. An optimization is “fired” when it actually changed the program or emitted its optimized form for this compile, under the effective (normalized) config. Reusable: any caller can compile a program and learn what fired, for tracing and tooling.
compile_project
Compile a multi-file LOGOS project with dependency resolution.
compile_project_with_deps
compile_project, additionally linking the declared dependency roots (see assemble_project_with_deps). dep_roots empty is byte-for-byte identical to compile_project.
compile_to_analog
Compile to a mixed-signal analog artifact — the LOGOS → analog spatial fabric tier (crate::codegen_ana). Scans the Oracle-optimized bytecode through the fail-closed crate::codegen_ana::analog_refusal gate FIRST: concurrency/networking, a program with no float dataflow, or float inputs without declared ranges each get a NAMED analog backend: refusal — a correct artifact or a typed refusal, never a silently-wrong circuit.
compile_to_c
Compile LOGOS source to C code.
compile_to_c_stepped
compile_to_c with the program’s tasks as step functions over heap frames — the stepped tier, the one a GPU thread can run and the host walker runs — instead of coroutines on stacks of their own.
compile_to_c_stepped_with_knobs
compile_to_c_stepped under an explicit SchedulerKnobs: the scheduler’s policy, workers, seed and default pipe capacity, as #defines its scheduler reads.
compile_to_c_traced
Direct AST→C compilation with stage-separated optimization evidence. The refusal probe runs before tracing so VM-only probe work cannot be misreported as a C optimization.
compile_to_c_via_bytecode
★ Phase 1 — compile to C by lowering the bytecode CompiledProgram directly (the codegen_c::from_program Op-walker), the bytecode-IR-as-source-of-truth path that REPLACES the AST-based compile_to_c. It lowers the OPTIMIZED IR (compile_to_program_optimized) — the SAME optimize_program the AST compile_to_c runs, honoring the LOGOS source’s ## No/## Require opt decorators — so the whole AOT optimizer lattice (constant-fold, SCCP, egraph, LICM, deforest, supercompile, closed-form, bound_version) reaches the C. One pristine, optimal pipeline: source → (opt flags honored) optimized bytecode → Op-walker → C. Grown op-by-op behind c_bytecode_lock; returns a typed Err on any op not yet lowered (callers fall back to the AST emitter until the Op-walker covers the corpus).
compile_to_c_via_bytecode_offloaded
The bytecode→C walker with an offload table: offloads chooses, from the optimized program and the interner that names its functions, the functions a device may answer (crate::codegen_c::from_program::compile_program_to_c_offloaded). An empty table is compile_to_c_via_bytecode.
compile_to_c_via_bytecode_traced
Optimized-bytecode→C compilation with stage-separated optimization evidence. Fallbacks to the syntax-tree C tiers are recorded explicitly.
compile_to_c_via_bytecode_with_knobs
The bytecode→C walker with an explicit SchedulerKnobs for the concurrency path — the tunable deterministic scheduler (ready-queue policy, workers, clock, channel capacity, seed). A non-concurrency program ignores the knobs (its sequential C is knob-independent). The default-knob wrapper is compile_to_c_via_bytecode; a determinism lock drives this with each policy to prove the knob is a real, output-preserving tunable on the determinate corpus.
compile_to_cuda
Compile to a single-file CUDA program — the LOGOS → CUDA AOT tier. Lifts the C tier’s program body (compile_to_c, byte-for-byte ≡ the VM) onto one GPU thread as __device__ code, over a printf-based Show preamble, plus a host launcher. Uses the SAME Oracle-optimized bytecode to refuse anything outside the integer/bool scalar fragment (a GPU thread has no dynamic C runtime), returning a Custom ParseError — a sound refusal, never wrong code. Returns the emitted crate::codegen_cuda::CudaArtifact.
compile_to_cuda_forward
Recognize the ordered tensor-op stages of a MULTI-STAGE forward and lower it to ONE CUDA program that chains their parallel kernels through shared device buffers — the whole-forward orchestrator (crate::codegen_cuda::qwen_emit). Where compile_to_cuda_tensor_op emits ONE op’s kernel, this composes a sequence (rmsnorm → matmul → softmax → …). Refuses (typed) if no stage is recognized.
compile_to_cuda_forward_holding
The older forward of source at kind’s numerics with the optimizer’s steps held held back: each kernel it would fuse emitted apart, the program the fused one is held equal to.
compile_to_cuda_forward_q8
compile_to_cuda_forward_weighted with an INT8 (Q8_0) weight manifest: any tensor variable named in q8 is loaded resident as int8 quants + f32 block scales, and a matmul against it becomes a dequant-in-kernel GEMV. This is what fits real 8B weights on a 12 GB card (8 GB int8, not 32 GB f32) and the DP4A path that beats llama.cpp — see crate::codegen_cuda::qwen_emit::Q8Ref.
compile_to_cuda_forward_q8_dp4a
compile_to_cuda_forward_q8 emitting the INT8-activation DP4A MMQ kernel for each Q8 matmul: the activation is quantized to int8 per 32-block and __dp4a’d against the int8 weight (int32 accumulate) — the same kernel shape llama.cpp’s fast path uses, and the shipped batch-1 default. Numerically the int8-activation approximation of the dequant GEMV (small quantization error), not bit-identical; the TwoPassInt8 mode recovers ~14-bit activation exactness at two __dp4a per block.
compile_to_cuda_forward_q8_moe
compile_to_cuda_forward_q8 with a MoE weight manifest: any moe op in the source lowers to grouped-expert CUDA (router GEMV → top-K route → per-expert SwiGLU → weighted combine), its router/gate/up/ down weights loaded int8-resident from the files named in moe (keyed by the block’s output variable). This is the Qwen3-30B-A3B FFN — the SAME emitter as the dense 8B forward, plus the MoE stage.
compile_to_cuda_forward_q8_moe_dp4a
compile_to_cuda_forward_q8_moe emitting the sparse top-K, deeply-fused, coalesced int8-activation MoE path — THE SHIPPED DEFAULT: only the K selected experts’ weights are gathered per token (the “A3B = 3B active” sparsity), and the FFN collapses to three kernels — router+topk, gate+up+SwiGLU fused, down+combine fused — so every intermediate stays off HBM. One __dp4a per 32-block (single-pass int8 activation) is the shortest dependency chain, the fastest batch-1 path at llama.cpp-matched activation precision (the A100 head-to-head beat: identical greedy token, more tok/s). For logits within ~1e-3 of the f64 reference — the correctness mode llama.cpp does not have — use compile_to_cuda_forward_q8_moe_exact.
compile_to_cuda_forward_q8_moe_exact
compile_to_cuda_forward_q8_moe_dp4a’s LOGIT-EXACT sibling: the same sparse top-K deeply-fused kernel shape, but the activation is quantized TWO-PASS (hi byte + lo residual byte ⇒ ~14-bit) and every block runs two __dp4a (hi and lo) — ~2× the activation math for logits within ~1e-3 of the f64 reference, so a near-tie greedy token does NOT flip (single int8 activation flips it — llama.cpp included). Weights are still read once, so the memory-bound cost is unchanged; the measured price of exactness is ~6% tok/s.
compile_to_cuda_forward_weighted
compile_to_cuda_forward with a WEIGHT MANIFEST: var name → (file path, float count). Any tensor variable named in the manifest is loaded from that file by the emitted host at runtime instead of being inlined — the mechanism the real-8B forward needs, since the Qwen weights are gigabytes (extracted from the GGUF checkpoint). Every other input still uses its literal Set values / the deterministic fill.
compile_to_cuda_gemm
Emit an int8 weight-stationary GEMM CUDA program for O(m×n) = A(m×k)·W(k×n) — the DP4A kernel path of the CUDA tier. Uses a deterministic int8 sample (crate::codegen_cuda::sample_gemm_data) baked into the .cu; its numerics are anchored to the certified eval_systolic reference by cuda_matrix_lock. Refuses (typed) if the RDU-shaped target lacks int8 weight-stationary GEMM.
compile_to_cuda_matmul
Genuinely LOWER an ordinary LOGOS matmul program to an optimized CUDA GEMM kernel — the CUDA analog of compile_to_tenstorrent_matmul. Recognizes the GEMM idiom with the SAME backend-agnostic crate::tensor_recognize::recognize_matmul, extracts (M,N,K) from the source, and emits a CUDA program whose dims are the program’s (a function of the source, not a canned template); a non-matmul is REFUSED (typed). Returns the recognized (spec, kernel_cu); the emitted program’s checksum equals the VM’s Show byte-for-byte.
compile_to_cuda_matmul_with
Knob-driven counterpart of compile_to_cuda_matmul — recognize the matmul, then lower it under an explicit crate::codegen_cuda::knobs::CudaKnobs point in the optimization lattice (e.g. the Int8Dp4a precision fast path). This is the user-facing surface the CLI/API drive to select a trade-off; a non-matmul is refused (typed) regardless of the knobs.
compile_to_cuda_tensor_op
Recognize ANY supported tensor op — matmul OR elementwise (plus/hadamard) — in a LOGOS program and lower it to CUDA. The unified accelerator entrypoint: tries the GEMM idiom first, then the elementwise idiom, and REFUSES (typed) only if neither is present. This is what closes the tensor-op × backend matrix to zero gaps on the CUDA cell.
compile_to_dir
compile_to_isa
Compile LOGOS source DIRECTLY to a self-contained WebAssembly module — no rustc, no cargo, no wasm-bindgen, no toolchain. Uses the SAME front-end as vm_outcome (crate::ui_bridge::with_parsed_program → crate::vm::Compiler::compile_with_types), so the emitted module runs the IDENTICAL bytecode the VM does; the AOT WebAssembly backend then lowers the whole program to .wasm.
compile_to_plasticine
Compile to the Plasticine target — the open RDU (Prabhakar et al., ISCA 2017), the LOGOS → Plasticine lane. The region unit is the FIRST function, which must be a counted range loop (Spatial Foreach over lo..=hi): it is lowered through the certified crate::codegen_sva::fabric_rtl::LoopFabric, modeled as one metapipeline stage under Spatial’s II definition, placed on the ISCA’17 checkerboard, anchored to the VM at sample inputs, SAT-certified when its body is ALU-only, and emitted as Spatial source. Any other shape gets a NAMED plasticine backend: refusal — an artifact or a typed refusal, never a wrong model.
compile_to_program
★ THE CANONICAL source → CompiledProgram PATH ★ — the single bytecode-IR entry every backend and every invariant lock reuses (no drift). This is the RAW-AST lowering (Oracle-analyzed, but WITHOUT the AOT optimize_program lattice) — identical to what vm_outcome/compile_to_riscv/compile_to_wasm compile today, so program_outcome(compile_to_program(src)) == vm_outcome(src) by construction. The optimized variant (optimize_program applied → the finalized source-of-truth IR every backend will lower) is added with the optimizer-soundness lock; see the refactor plan.
compile_to_program_optimized
★ THE FINALIZED, OPTIMIZED SOURCE-OF-TRUTH IR ★ — compile( optimize_program( resolve_divisions(AST) ) ). This is the exact front-end compile_to_c/compile_to_rust run (prelude + ## No/## Require decorators
compile_to_program_optimized_named
compile_to_program_optimized with each function’s name, in function order: what a consumer that reports on functions by name (the accelerator region discovery) reads beside the program.
compile_to_rdu
Compile to the SambaNova RDU — ONE front door, three lanes chosen by program shape: the tensor lane (a tensor program lifted through the spatial IR, placed on the chip’s descriptor and certified), the loop lane (a counted-range-loop function through the Plasticine metapipeline model on the RDU mesh descriptor), and the whole-program lane (any construct the fabric’s decision datapath covers, as Scalar stages). Every lane ends in the same certified neutral envelope, honestly SDK-gated for the vendor config bytes. A tensor program the chip cannot host is refused BY NAME on the tensor lane, never handed on; a program no lane hosts gets a rdu backend: refusal naming every lane’s verdict.
compile_to_riscv
Compile to RV64GC assembly text — the LOGOS → RISC-V AOT tier. Lowers from the SAME Oracle-optimized bytecode the VM/WASM tiers use (so DivPow2 / bounds-elim forms match), then crate::codegen_riscv::codegen_program_riscv emits the assembly. A RISC-V GCC assembles+links it; qemu-user runs it byte-for-byte identical to the VM. Returns a Custom ParseError when the program uses an op/shape outside the currently-lowered fragment (a sound refusal, never wrong code).
compile_to_rust
Compile LOGOS source to Rust source code.
compile_to_rust_checked
Compile LOGOS source to Rust with ownership checking enabled.
compile_to_rust_deterministic
Compile for deterministic replay: identical to compile_to_rust for a program that never touches the scheduler; a program that does runs its tasks, pipes, timers and selects on logicaffeine_system::replay, the interpreter’s scheduler ported, so a binary run under LOGOS_SEED=… prints what the interpreter prints at that seed. Used by the seeded differential harness.
compile_to_rust_observed
Compile to Rust in the OBSERVED profile (Wave 13): the emitted program EMITS observation events — logicaffeine_system::obs::record/span_enter/ span_exit calls for Note/Warn/Record/During — instead of eliding them. The default compile_to_rust stays the elided (release) profile, byte-identical to the observation-free program (§0.7).
compile_to_rust_traced
One compile returning the generated Rust, the fired-optimization keywords, AND the (winner, loser) precedence decisions made — what an interactive viewer calls per toggle state to show the firing opts and the conflicts that occurred.
compile_to_rust_with_proven
Compile imperative LOGOS to Rust with an extracted math/logic module bundled in. proven is a main-less Rust module body (the Forge’s extraction); it is emitted as pub mod proven { … } use proven::*; so the imperative program can call its functions / check_* predicates by name. See compile_program_full_with_proven.
compile_to_sol_solution
Compile a LOGOS fused-row program straight into a SOL-ExecBench submission — recognize the op and emit the solution.json + torch-binding CUDA kernel the benchmark evaluates on the B200. definition is the problem’s Definition name; inputs/output are the tensor names in Definition order. This closes the loop from English LOGOS to a submittable, compiler-generated kernel.
compile_to_tenstorrent
Compile to a single-Tensix-core TT-Metalium program — the LOGOS → Tenstorrent AOT tier. The compute body is the C translation (compile_to_c, byte-for-byte ≡ the VM), wrapped by crate::codegen_tt as a data-movement kernel on one baby RISC-V core (RISCV_0) plus a host orchestrator. Uses the SAME Oracle-optimized bytecode to scan for ops outside the single-baby-core fragment — CONCURRENCY (channels/tasks/select need a ucontext scheduler; the mesh tier lowers those) — returning a Custom ParseError, a sound refusal, never wrong code. OFFLINE networking rides the newlib-clean C net runtime on-core. Returns the emitted crate::codegen_tt::TtArtifact.
compile_to_tenstorrent_concurrency
Recognize a producer/consumer pipe program and lower its CONCURRENCY onto the Tensix mesh — the task on one baby RISC-V, main on the other, the pipe as a circular buffer. Returns the recognized spec + the complete 2-core program, or an error if the program is not the recognized pattern (the caller then falls back to the sound single-core refusal). The mesh output is ≡ the VM’s deterministic interleaving.
compile_to_tenstorrent_dynamic
Recognize a dynamic-channel program (a loop-driven producer feeding the pipe with computed values) and lower it to a 2-core program: the producer loops pushing f(i) onto a bounded circular buffer; the consumer folds the stream. Order-deterministic FIFO ⇒ ≡VM.
compile_to_tenstorrent_fanout
Recognize a fan-out program (N distinct tasks each send one value into a shared pipe; main folds all N) and lower its concurrency onto the Tensix mesh — one core per task, main folding via a NoC + semaphore barrier. The commutative fold makes the mesh’s arrival order irrelevant, so it is ≡VM. Errors if the program is not the fan-out pattern (the caller falls back to the sound refusal).
compile_to_tenstorrent_matmul
Genuinely LOWER an ordinary LOGOS matmul program (a triple-loop C[i][j] += A[i][k]*B[k][j]) to a tiled Tensix matrix-engine compute kernel — the compiler recognizes the GEMM idiom (affine index analysis) and generates the kernel from the program’s dimensions, or REFUSES (typed) if the program is not a matmul. This is the honest counterpart to the hand-written template kernels: the kernel is a function of the source, not a canned string. Returns the recognized (spec, kernel_cpp).
compile_to_tenstorrent_multi_racy
Recognize a multi-task race (≥2 tasks each sleep then send; main awaits receive-or-timeout) and lower it to a coordinator + N-task program. The coordinator collects every task’s (value, send-vtime), picks the global-minimum send-vtime, and compares it to the timeout — the VM’s deterministic winner. ≡VM.
compile_to_tenstorrent_racy_select
Recognize a racy select (a task sleeps then sends; main awaits a receive-or-timeout) and lower it to a coordinator + task program. The coordinator compares the reported send virtual-time against the timeout — the VM’s deterministic scheduler rule — so the outcome is ≡VM on both branches, independent of real hardware timing.
compile_to_tenstorrent_select
Recognize a select (Await the first of { Receive … / After … }) on a ready channel and lower it to a single-core program whose non-blocking readiness check reproduces the VM’s deterministic arm choice.
compile_to_tenstorrent_tensor_op
The Tenstorrent analog of compile_to_cuda_tensor_op: recognize matmul OR elementwise and lower to a Tensix compute kernel, refusing (typed) if neither is present. Closes the Tenstorrent cell of the matrix.
compile_to_wasm
compile_to_wasm_checked
compile_to_wasm as a check-mode module: the same program through the same pipeline, with the heap census exported (crate::vm::wasm::assemble_program_checked) for a heap test to read every true count back through. A shipped page never carries it.
compile_to_wasm_linked
Compile LOGOS source to a LINKED WebAssembly module that uses the real logicaffeine_base::BigInt runtime for arbitrary-precision integer arithmetic: an overflowing integer expression (Show 99999999999 * 99999999999, Show 2 to the power of 200) computes the EXACT big number — matching the VM’s promote-on-overflow — instead of trapping, and Show prints its decimal.
compile_to_wasm_observed
Compile to WebAssembly in the OBSERVED profile (Wave 13): Note/Warn/ Record/During lower to Op::Obs, which the WASM backend emits as calls to the host obs(site_id) import — the browser-tracing analog of the VM’s observation emission. Returns the module bytes AND the observation_sites table: the host (which compiled the program) resolves each site_id to its category / message / span kind. The default compile_to_wasm stays the elided profile, byte-identical to the observation-free program (§0.7).
compile_to_wasm_relocatable
The RELOCATABLE object compile_to_wasm_linked hands the linker: the program monomorphized, compiled with the optimizer’s oracle, peephole-coalesced, checked linkable, lowered by the BigInt-aware emitter (crate::vm::wasm::assemble_program_linked) and carried with its relocations — not yet linked, so a caller can link it against a runtime of its own.
compile_to_wasm_with
compile_to_wasm for a host that enters the module by name beyond main: the components a test mounts at a statement of its own (crate::vm::reach::HostEntries). A shipped page’s entries are the default, and its module is exactly the one compile_to_wasm writes.
copy_runtime_crates
Copy the runtime crates to the output directory. Copies logicaffeine_data and logicaffeine_system.
core_interp_source
The self-interpreter (coreEval / coreExecBlock) as a first-class committed artifact — the Logos program the genuine P2/P3 projections specialize (Futamura: pe(pe, coreEval) is a compiler). Promoted out of the phase_futamura test fixture so it is a real source file, not a string constant; the fixture now include_str!s this exact file (parity is structural).
core_types_for_pe_source
The canonical inductive type catalog the Futamura projections are built on (CStmt/CExpr/CVal/…). Every statement the tree-walker executes has a C… constructor here; the partial-evaluator dialects dispatch on it. Exposed so cross-tier lock tests can prove this catalog and every tier stay in sync — a statement added to the language must appear here or it is dropped from the projections (see tier_parity_lock.rs).
count_dispatch
The Jones-optimality oracle: count the units of interpreter dispatch remaining in a residual program.
decode_value_raw
Decode a value produced by encode_value_raw (or by an AOT-generated wire_encode) back into a RuntimeValue. None on any malformed or trailing-byte input.
decompile_source_text
display_float_like_logos
Format an f64 exactly as a Show of a Float would — i.e. byte-identical to the tree-walker / VM (RuntimeValue::to_display_string). The direct-WASM host’s print_f64 sink uses this so a Show of a float matches every other engine. Delegating to the real formatter (rather than re-deriving it) makes drift impossible.
encode_program_source
Encode a LOGOS program (given as source) into CProgram construction source.
encode_program_source_compact
Compact encoding: inlines simple expressions (literals, variables) to reduce encoding size by ~3x. Same semantics as encode_program_source but produces fewer Let statements.
encode_value_raw
Encode ONE value as the plain, self-describing recursive wire form — no envelope, no framing, no columnar/compression/dedup transforms. This is the exact format the shared logicaffeine_data::wire core decodes, so a RuntimeValue encoded here round-trips through an AOT-generated type’s wire_decode (and vice versa). The speed-first form used to hand a program AST to a compile-once native partial evaluator.
enforce_project_scope
Enforce per-file scoping for a project WITHOUT codegen. The interpreter and other lightweight tiers call this so transitive leakage is rejected uniformly with largo build — a program that fails scoping on one tier fails on all. Returns Ok(()) when every reference stays within its file’s scope, else the clean scope-violation message.
enforce_project_scope_with_deps
enforce_project_scope, additionally linking the declared dependency roots. dep_roots empty is identical to enforce_project_scope.
finish_projection1_residual
The post-processing applied to a raw PE residual (the Any-type safety net + ## Main normalization).
first_parallel_block_independent
Phase 0 test seam: is the first Simultaneously: / Attempt all of the following: block in source made of data-independent branches? None if the program contains no such block.
genuine_p2_on_target_source
The whole program run_genuine_p2_on_target runs, so a harness can run it on any backend.
genuine_p3_on_target_source
The whole program run_genuine_p3_on_target runs, so a harness can run it on any backend.
genuine_projection2_residual
Run genuine PE(pe_source, pe_mini(targetStmts)) and return the specialized compiler residual as LOGOS source code.
genuine_projection3_residual
Run genuine PE(pe_source, pe_bti(targetExpr)) and return the specialized cogen residual as LOGOS source code.
implied_crate_deps
The third-party crates the generated Rust names DIRECTLY (not through the runtime crates), each as its [dependencies] line: declared iff the code uses it, and never when a ## Requires already brought it in (a duplicate key is a manifest error). The ONE list every generated manifest — the largo build project and the staged checking project — takes its implied dependencies from.
interpret_bootstrap
interpret_program for one of the compiler’s own LOGOS programs — the partial evaluator, its dialects, the self-interpreter, a compiler a projection produced — inside the bootstrap scope (with_reference_semantics): those programs thread their state through mutable parameters and are written for the in-place writes of reference semantics. A user program never runs here.
interpret_program
Interpret LOGOS source and return output as a string.
native_export_function_names
The names of functions annotated for the AOT-native tier — ## To <fn> … is exported for native: (HOTSWAP §Axis-3 selectivity). These are the functions largo build --native-functions pre-bundles; everything else stays on VM+JIT.
native_pe_cdylib_lib_rs
The PE cdylib’s lib.rs: pe_cdylib_source through the Rust emitter, under the reference collection semantics, followed by PE_CDYLIB_SHIM.
next_inspect_otherwise_idx
The next Inspect-with-Otherwise flag index (post-increment). Called at the START of each such Inspect’s desugaring in BOTH encoders, so a nested Inspect gets a strictly higher index than its enclosing one — no two live flags ever collide.
optimization_dependencies
The per-program DEPENDENCY edges for source, discovered by evaluating with all optimizations on and probing: disabling a fired optimization dep that makes another fired optimization dependent STOP firing means dependent depended on dep for this program. Stops already explained by a declared requires-cascade (normalize would disable the dependent anyway) are excluded — those are captured by the static registry graph. What remains are the EMERGENT, program-specific dependencies (e.g. dead-code elimination only had work because scalarization produced the dead code): returned as (dependent, dep) keyword pairs, sorted and deduped (deterministic).
optimization_graph
The complete per-program optimization graph from one all-on evaluation: the optimizations that fired, the blockers ((winner, loser) preemptions that occurred), and the emergent dependencies ((dependent, dep) — see optimization_dependencies). Everything the menu-tree needs, baked once per benchmark so the UI never probes in the hot path. All on the AOT codegen path (the one that produces the shown Rust), so the three views agree.
optimization_preemptions
The (winner, loser) precedence decisions the compiler made for source — the conflicts traced at their source (mark_preempted), under the effective config.
optimization_trace_run
The optimizations that fired on the RUN path — the VM/interpreter optimizer (optimize_for_run) — for source. The run-path analogue of optimizations_fired (which traces the AOT codegen path); it surfaces the run-path-only passes — inlining, loop-carried CSE, float strength reduction — the AOT trace cannot see. Respects file-level ## No <opt> decorators.
optimization_trace_vm
The optimizations that fired while compiling source to VM bytecode — the third path, after AOT codegen and the run-path optimizer. Surfaces the VM-compile-time opts (constant-divisor magic division, VM i32 narrowing) the other two traces cannot see. Compiles only (no execution), so it is fast and needs no program arguments.
optimizations_fired
The decorator keywords of the optimizations that fired for source (registry order), under the default/effective config. One compile, exact.
optimizations_fired_run
optimizations_fired_vm
optimizations_fired_with
The optimizations that fired for source under an explicit config — re-traces an arbitrary toggle state (turning some off can make others fire). Realised by disabling that config’s off-keywords on the source, then tracing.
optimizations_used
Which optimizations actually FIRE for source: an optimization is “used” when disabling it (via a file-level ## No <X> decorator) changes the generated Rust. Lets the benchmarks UI show, per program, which optimizations it USES vs the full set it CAN use. O(number of optimizations) compiles — intended for per-benchmark, not hot-path, use. Returns the decorator keywords of the firing optimizations (in registry order).
pe_bti_source_text
pe_cdylib_source
The PE as an IN-PROCESS cdylib entry: the identical engine to pe_native_source, but the driver is a single-shot ## To peSpecializeOnce (__prog: CProgram) -> Text that RETURNS the residual instead of writing it to stdout — no readWireProgram/writeWireResidual, no stdin loop. The exported cdylib (build_native_pe_cdylib) decodes the wire bytes to a CProgram in its extern "C" shim and calls this function directly, so the resident server’s process/pipe round-trip is gone. The driver is exported for native: host code calls it, so it keeps the signature it declares, its program taken by value, whatever the emitter would lend an internal function. ## Main is a trivial stub (a cdylib never runs it).
pe_combined_source
Assemble the full PE-run source (core types + PE + decompiler + encoded input + driver) — the exact program projection1_source_real_fast executes. Public so differential harnesses can run it on a specific engine.
pe_mini_source_text
pe_native_source
pe_source_text
Returns the source text of the partial evaluator written in LOGOS.
prelude_user_offset
The offset in the author’s own text that byte pos of the prelude-expanded text came from, through the runs crate::loader::apply_prelude_mapped reports. A position inside spliced stdlib text came from no byte the author wrote and maps to None; a run’s END maps too, so an exclusive span end and the end of the file translate.
prelude_user_span
A span of the prelude-expanded text as a span of the author’s own text — None when either end lies in spliced stdlib text. The one inversion of the prelude splice: every surface that reports a location against the author’s file translates through this.
program_covered_by_native_builder
Whether the native Core-IR value builder covers program (the fast marshal path is taken, not the interpreter fallback). For test coverage assertions.
program_lines_concurrent
program_outcome_concurrent with the shown lines kept apart (see tw_lines).
program_outcome
Run an ALREADY-COMPILED CompiledProgram straight-line on the VM and return its outcome — the plain- sequential counterpart to program_outcome_scheduled/program_outcome_concurrent. This is the missing primitive that lets the source-of-truth invariants be expressed against the SAME bytecode IR every backend lowers: VM(opt P) is program_outcome(&optimized_program), so a backend’s output can be differenced against the exact IR it consumed. Partial output on error is preserved (matching the VM).
program_outcome_concurrent
Run an ALREADY-COMPILED (possibly HAND-AUTHORED) program through the FULL cooperative scheduler (the same VmTask/run_with_seed driver run_vm_concurrent uses, seed 0), returning its output. Unlike the reversible program_outcome_scheduled, this services ops the reverse machinery does not yet cover (TaskAbort) — so it is the oracle for the fabric’s TaskAbort tile.
program_outcome_scheduled
Run an ALREADY-COMPILED (possibly HAND-AUTHORED) program through the reversible cooperative scheduler (RevCoop) and return its main output. The scheduler-only ops that no LOGOS source emits — ChanClose, TaskAwait, SpawnHandle — BLOCK on the plain VM (requires the scheduler driver), so their fabric tile is proven by hand-building a raw CompiledProgram and differencing the fabric tape against THIS oracle (the same seam codegen_sva/rtl.rs’s soft-core differential uses for those ops).
program_to_core_wire_bytes
Serialize a program’s Core-IR CProgram (a CProg with its functions and main block) to the plain wire form — the bytes a compile-once native partial evaluator reads on stdin. FAST PATH: program_to_core on WireSink emits the wire bytes in ONE pass straight from the AST — no intermediate RuntimeValue tree and no second encode_value_raw walk (byte-for-byte identical to the old two-pass form; locked by native_builder_is_byte_identical_to_the_interpreter). FALLBACK: for a construct the native builder does not cover, run the constructor source on the tree-walker (wireBytes). Both are decoded identically by the native binary’s generated CProgram::wire_decode.
program_to_core_wire_bytes_two_pass
The TWO-PASS marshal that program_to_core_wire_bytes replaced: build the full RuntimeValue Core-IR tree (TreeSink) then encode_value_raw it. Kept as the correctness ORACLE and the speed BASELINE for the single-pass (WireSink) form — the two are byte-identical by construction (WireSink emits exactly what encode_value_raw would), and the single pass avoids the tree allocation + the second encode walk. None if a construct is uncovered.
program_to_core_wire_bytes_via_interpreter
The REFERENCE marshal: always the interpreter path (construct the CProgram via the tree-walker, wireBytes-serialize it). The native builder’s output must be BYTE-IDENTICAL to this — locked by native_pe_wire::native_builder_is_byte_identical_to_the_interpreter. Kept public so the lock can force the reference regardless of native-builder coverage.
projection1_source
First Futamura Projection: PE(interpreter, program) = compiled_program
projection1_source_real
Real Futamura Projection 1: pe(program) = compiled_program
projection1_source_real_fast
In-process variant of projection1_source_real.
projection1_source_real_fast_on_vm
VM-driven twin of projection1_source_real_fast.
projection2_source
Second Futamura Projection: PE(PE, interpreter) = compiler
projection2_source_real
Genuine Futamura Projection 2 via self-application: PE(pe_source, pe_mini(targetStmts))
projection3_source
Third Futamura Projection: PE(PE, PE) = compiler_generator
projection3_source_real
Genuine Futamura Projection 3 via self-application: PE(pe_source, pe_bti(targetStmts))
quote_pe_source
Encodes the partial evaluator as CProgram construction source code.
refuse_unlinkable
The entry gate of every backend that lowers bytecode WITHOUT the Rust runtime (C, RISC-V, WebAssembly, the soft core): refuse — by name — what only the interpreter, the VM, and the Rust tier provide, rather than lower it as something else. A standard-library native kernel is Rust code; a CRDT kind the backend does not lower is refused by its type name. Only code that can run is judged (crate::vm::reach): the loader splices whole standard-library modules, and a function nothing calls refuses nothing.
refuse_unlinkable_with
refuse_unlinkable, judging what the host’s own entries reach as well as Main — the same roots a module built with those entries lowers.
remap_project_errors
Remap every rustc error over a project’s GENERATED Rust back to the LOGOS source line it came from — the build path uses this so a generated-code failure points at the LOGOS the user wrote, not main.rs. Compiles with the source-mapped codegen (whose line numbers the map indexes), runs cargo check --message-format=json, and remaps each diagnostic’s primary span. Returns Ok(vec![]) when nothing maps (caller falls back to raw cargo output).
run_genuine_p2_on_target
Run genuine P2 on a specific target: PE(pe_source, pe_mini(target))
run_genuine_p3_on_target
Run genuine P3 on a specific target: PE(pe_source, pe_bti(target))
run_logos_source
Compile and run LOGOS source, returning stdout.
run_native_pe
Specialize program on the compile-once native PE — the DEFAULT entry and the pit of success. Prefers the IN-PROCESS cdylib path (run_native_pe_inprocess; no process/pipe boundary) and falls back to the resident server (run_native_pe_server) only if the in-process build/load fails (e.g. no toolchain), so the fast+correct route is what every caller gets by default. The two paths are proven byte-identical by native_pe_wire.
run_native_pe_inprocess
Specialize program on the compile-once native PE, IN PROCESS: marshal it to wire bytes, hand them to the dlopened PE cdylib’s logos_pe_specialize as a plain function call, and reclaim the residual bytes. No child process, no pipe — the ~59 µs IPC round-trip of the resident server is gone; all that remains is the host marshal + native peBlock + one FFI call. The cdylib is built + loaded ONCE per thread and cached. Residual-identity with the server / tree-walker is locked by native_pe_wire.
run_native_pe_server
run_strict_tw
Run source STRICTLY on the tree-walker. Identical pipeline to tw_outcome (same front-end, same oracle engine — concurrency runs on the tree-walker’s deterministic scheduler), plus the honest engine identity: engine_ran is Some(TreeWalker) whenever the program executed, None for a parse failure (nothing ran on any engine).
run_strict_tw_with_args
run_strict_tw with the program argument vector for the args() system native (full argv; index 0 is the program name).
run_strict_vm
Run source STRICTLY on the bytecode VM. Identical pipeline to vm_outcome (same front-end, same oracle-range compile), with the strict contract: a program the VM cannot run — one that needs the async runtime, one that needs the scheduler driver, or one its compiler rejects — is a TYPED REFUSAL (engine_ran: None, error says why). The tree-walker is NEVER silently substituted.
run_strict_vm_with_args
run_strict_vm with the program argument vector for the args() system native. Honors the thread’s armed fuel (the MCP step_budget) exactly as the live sync path does.
rustc_check
Run rustc’s analysis over a LOGOS program and translate every finding back to English with real user-source spans — the flycheck engine.
rustc_check_artifacts
Compile for CHECKING: the same front as compile_program_full but with the optimizer off and mapped codegen, so every generated line ties back to its statement span and the map stays 1:1 (the optimizer may fuse or drop statements; a check build has no use for its output anyway).
send_check_source
Run the Send/escape analysis over a program.
stmts_to_core_wire_bytes
The PARSE-FREE marshal: emit a program’s Core-IR wire bytes directly from an ALREADY-PARSED AST, skipping the lex + discovery + parse_program that dominates program_to_core_wire_bytes (~90% of a specialization). An integrated caller that parsed the program once for compilation reuses that AST here to feed the native PE at a fraction of the cost. variant_fields maps each variant constructor name to its ordered field names (the caller derives it from its type registry, as program_to_core does). None if a construct is uncovered. Byte-identical to program_to_core_wire_bytes on the same program — same build_core/WireSink spine.
tier_differential
Run source on every always-available execution tier — the tree-walker oracle and the register VM — and classify the result (Wave 13; the engine behind largo test --tiers all and the F18 “works-on-my-tier” guard).
tw_lines
tw_outcome with the shown lines kept apart. The exact bytes a run writes to standard output are every line followed by a newline, which is what a compiled binary writes; the joined output of a RunOutcome cannot tell no output from one empty line, so a byte-exact comparison starts here.
tw_lines_with_args
tw_lines with the program argument vector for the args() system native (full argv; index 0 is the program name).
tw_outcome
Run source on the TREE-WALKER (the oracle), capturing partial output and the error, if any. This entry point always uses the tree-walker — the dispatching interpret_for_ui_sync now runs the VM for the sync path, and the differential suites need the oracle by itself.
tw_outcome_located
tw_outcome, with a failed run’s error LOCATED (see locate_runtime_failure) — same front- end, same interpreter, same error TEXT; this only decides what goes in FRONT of it. A concurrent program (many Interpreter instances, one per task) has no single “the current site” to show, so it falls back to tw_outcome’s own unlocated shape rather than guessing which task’s site to name.
tw_outcome_with_args
tw_outcome with the program argument vector for the args() system native (full argv; index 0 is the program name) — the seam the benchmark corpus differential uses to run main.lg programs that read their size from argv.
verify_no_overhead_source
Verify that a LOGOS program has no interpretive overhead.
vm_lines_net
vm_outcome_net with the shown lines kept apart (see tw_lines).
vm_outcome
Run source on the bytecode VM, capturing partial output and the error, if any. Same front-end as tw_outcome.
vm_outcome_bg
vm_outcome_with_args driven through the BACKGROUND native compiler (HOTSWAP §6): hot functions compile on a worker thread off the interpreter’s path. Requires a process-installed tier (the P8 gate installs one first). The compiled chain is identical to the synchronous one — only WHEN it is produced differs — so output must match the synchronous/tree-walker engines exactly.
vm_outcome_concurrent
The VM outcome for a CONCURRENT program — drives the bytecode VM on the cooperative scheduler (VmTask on run_with_seed, seed 0) exactly as the browser/playground does, so a Pipe/task/ Select program runs on the VM byte-identical to the tree-walker’s async path. The plain vm_outcome errors on any concurrency op (requires the scheduler driver); this is the oracle the AOT concurrency lock compares against so tw == VM == AOT is verifiable for the concurrent set.
vm_outcome_located
vm_outcome, with a failed run’s error LOCATED (see locate_runtime_failure). Uses the plain Compiler::compile_with_oracle → Vm::run path directly (not page_host::drive_main’s page-driving split) — every failure-site fixture this lane’s tests drive is a single-turn action failure, which that plain path already covers exactly as vm_failure_site_lock.rs proves. A run is a fresh process: it starts with nothing stored.
vm_outcome_net
The VM outcome for a peer-NETWORKING program — drives the resumable bytecode VM and services each VmBlock::Net* through the shared LOCAL NetInbox (the same inbox the tree-walker’s offline mode uses), so Listen/Send/Sync/PeerAgent run on the VM byte-identical to the tree-walker. The AOT networking lock compares against this so tw == VM == AOT holds for the local-mode net set.
vm_outcome_observed
Run source on the bytecode VM in the OBSERVED profile (Wave 13): the VM emits the same observation events (Note/Warn/Record/During) the tree-walker does, into the observe channel — program output is byte- identical to vm_outcome. Pair with observe::install()/drain() to capture the emitted event stream.
vm_outcome_tiered
vm_outcome_with_args, but the statements pass through the run-path optimizer at an explicit hotness tier (HOTSWAP §4) before reaching the VM — the seam the tier_invariance gate drives at every tier T0..T3 to assert byte-identical output. tier = Tier::T3 reproduces today’s optimized run path.
vm_outcome_with_args
vm_outcome with the program argument vector and an optional private native tier (so a differential test can observe THAT program’s JIT compile counters in isolation — the process-wide tier’s counters are shared by every test in the binary).
vm_run_source
Parse LOGOS source and execute it on the register bytecode VM, returning the captured output. Uses the SAME front-end as the tree-walker (crate::ui_bridge::with_parsed_program: lex → MWE → discovery → parse), so differential tests compare two engines on one program, never two programs. Returns Err for programs outside the VM’s supported subset (the compiler reports vm: unsupported …).
write_cargo_project
Write a generated program as a runnable cargo project: src/main.rs, Cargo.toml (runtime deps + user ## Requires), .cargo/config.toml, and — only inside a checkout — the staged runtime crates. Shared by compile_to_dir and rustc_check.