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
symbolto resolve and itsarity— everything the loader needs. - Check
Artifacts - Compile LOGOS source and write output to a directory as a Cargo project.
- Compile
Output - Full compilation output including generated Rust code and extracted dependencies.
- Crate
Dependency - A declared external crate dependency from a
## Requiresblock. - Engine
Outcome - The outcome of a STRICT engine run.
engine_ranis the honest identity:Some(engine)means that engine — and only that engine — executed the program;Nonemeans NOTHING ran (a parse failure, or the typed refusal of an engine that cannot run the program) anderrorsays why. A strict run never silently substitutes the tree-walker for the VM. - Genuine
Projection Result - 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 rduwrites: thelogos.spatial.neutralv2 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’sprogramline 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). - RduProgram
Files - 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. - Step
Shape - A step deployment’s shape: a KV cache of
ctxpositions per sequence,batchsequences per step, overtpchips of tensor parallelism — and, withprefill: Some(chunk), a step that PREFILLSchunktokens 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_unlinkablegates. What each one lowers is answered per construct against this type (seecrate::semantics::crdt::CrdtKind::lowered_by), so adding a backend fails to compile until every such table classifies it. - Compile
Error - Errors that can occur during the LOGOS compilation pipeline.
- Engine
Id - Which engine actually executed a strict run — the identity a caller can trust, because the strict entries never substitute one engine for another.
- Project
Scope Error - Why a project fails
enforce_project_scope_with_deps. - RduLane
- Which lane a program takes — a function of its shape, printed by
largo emit rduaslane: <name>. - Runtime
Crate Source - How a generated project resolves the
logicaffeineruntime crates. - Tier
Verdict - 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_lockasserts its PROBES name EXACTLY this set (executed on TW/VM/AOT-C/AOT-Rust, lowered on WASM), and this crate’swasm_aot_lock::first_class_param_return_round_trips_on_wasmasserts 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 oneconst). 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),dlopenit, and return the loadedcrate::vm::NativeFnready to install viaVm::install_aot_native.Noneif the function is absent / outside the scalar subset / the build or load failed — the caller keeps it on VM+JIT. Blocking (runsrustc); 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.sois 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 insourceas a compiled-nativecrate::vm::NativeFn(HOTSWAP §Axis-3): the run path installs these viaVm::install_aot_native, so an annotated function dispatches torustc -O3machine code from its first call. Uses the persistent cache, so a bundle pre-built bylargo build --native-functionsis a cache hit — norustcon 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 insourceinto the AOT bundle underbundle_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.Erronly on a genuine parse/type error. - build_
native_ cdylib - Build AOT-native cdylib Rust source (from
compile_function_to_native_rust) into a loadablecdylib(HOTSWAP §Axis-3 / P16). Generates a minimal crate underwork_dir/<crate_name>, copies the shared runtime crates (so the.soand the interpreter share the SAMElogicaffeine_dataABI), and runscargo build --release. Returns the path to the produced dynamic library.panic = "unwind"(the default) — NOTabort— so a panic in a loaded function can be contained rather than killing the host process. - build_
native_ cdylib_ cached build_native_cdylibwith a persistent cache (HOTSWAP §Axis-3 / P16). The artifact lives atcache_dir/aot_<fn>_<key>/…keyed byaot_cache_key; an identical function reuses its.soacross 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. Mirrorsbuild_native_pe_binarybut emits acdylibwhoselib.rsis the generated PE engine (pe_cdylib_source) plus a hand-writtenextern "C"shim (PE_CDYLIB_SHIM) that decodes the wireCProgramand callspeSpecializeOncedirectly — 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-unknowncdylib (HOTSWAP §Axis-3 / P17 — the browser analog ofbuild_native_cdylib). The module is the same scalar-ABI shim; the wasm crate keepslogicaffeine-data+logicaffeine-system(both wasm-ready) but drops the desktop-onlytokio, thelogicaffeine-systemfullfeature, andtarget-cpu=native. Returns the.wasmpath; the browser thenWebAssembly.instantiates it and the entry calls into it through the warm-bytecode indirection. Requires thewasm32-unknown-unknowntarget. - 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
targetfunction plus its transitive callees (crate::codegen::function_slice), emitted through the normal ARCHITECT codegen, with thecrate::codegen::codegen_native_tier_exportshim appended so the loader can resolve thelogos_native_<target>symbol. Mirrorscompile_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
sinkin 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_tablesatctxpositions, 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_firedsites 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_fullfor deterministic replay — the full output (rust + dependencies) with every scheduler operation lowered ontologicaffeine_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 aspub 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 tocompile_program_full. - compile_
program_ full_ with_ wire - Like
compile_program_full, but every emitted (non-generic)enumalso getsWireEncode/WireDecodeimpls over the sharedlogicaffeine_data::wirecodec — byte-identical to the peer codec’sencode_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
sourcewhile recording which optimizations actually FIRED — the honest, single-compile alternative tooptimizations_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 (seeassemble_project_with_deps).dep_rootsempty is byte-for-byte identical tocompile_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-closedcrate::codegen_ana::analog_refusalgate FIRST: concurrency/networking, a program with no float dataflow, or float inputs without declared ranges each get a NAMEDanalog 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_cwith 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_steppedunder an explicitSchedulerKnobs: 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
CompiledProgramdirectly (thecodegen_c::from_programOp-walker), the bytecode-IR-as-source-of-truth path that REPLACES the AST-basedcompile_to_c. It lowers the OPTIMIZED IR (compile_to_program_optimized) — the SAMEoptimize_programthe ASTcompile_to_cruns, honoring the LOGOS source’s## No/## Requireopt 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 behindc_bytecode_lock; returns a typedErron 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:
offloadschooses, 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 iscompile_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
SchedulerKnobsfor the concurrency path — the tunable deterministic scheduler (ready-queuepolicy,workers,clock, channel capacity,seed). A non-concurrency program ignores the knobs (its sequential C is knob-independent). The default-knob wrapper iscompile_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 aprintf-basedShowpreamble, 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 aCustomParseError— a sound refusal, never wrong code. Returns the emittedcrate::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). Wherecompile_to_cuda_tensor_opemits 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
sourceatkind’s numerics with the optimizer’s stepsheldheld 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_weightedwith an INT8 (Q8_0) weight manifest: any tensor variable named inq8is 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 — seecrate::codegen_cuda::qwen_emit::Q8Ref.- compile_
to_ cuda_ forward_ q8_ dp4a compile_to_cuda_forward_q8emitting 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; theTwoPassInt8mode recovers ~14-bit activation exactness at two__dp4aper block.- compile_
to_ cuda_ forward_ q8_ moe compile_to_cuda_forward_q8with a MoE weight manifest: anymoeop 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 inmoe(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_moeemitting 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__dp4aper 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 — usecompile_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_forwardwith 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 literalSetvalues / 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 certifiedeval_systolicreference bycuda_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-agnosticcrate::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’sShowbyte-for-byte. - compile_
to_ cuda_ matmul_ with - Knob-driven counterpart of
compile_to_cuda_matmul— recognize the matmul, then lower it under an explicitcrate::codegen_cuda::knobs::CudaKnobspoint in the optimization lattice (e.g. theInt8Dp4aprecision 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 —
matmulOR 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
Foreachoverlo..=hi): it is lowered through the certifiedcrate::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 NAMEDplasticine backend:refusal — an artifact or a typed refusal, never a wrong model. - compile_
to_ program - ★ THE CANONICAL
source → CompiledProgramPATH ★ — 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 AOToptimize_programlattice) — identical to whatvm_outcome/compile_to_riscv/compile_to_wasmcompile today, soprogram_outcome(compile_to_program(src)) == vm_outcome(src)by construction. The optimized variant (optimize_programapplied → 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-endcompile_to_c/compile_to_rustrun (prelude +## No/## Requiredecorators - compile_
to_ program_ optimized_ named compile_to_program_optimizedwith 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
Scalarstages). 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 ardu 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_riscvemits the assembly. A RISC-V GCC assembles+links it;qemu-userruns it byte-for-byte identical to the VM. Returns aCustomParseErrorwhen 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_rustfor a program that never touches the scheduler; a program that does runs its tasks, pipes, timers and selects onlogicaffeine_system::replay, the interpreter’s scheduler ported, so a binary run underLOGOS_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_exitcalls forNote/Warn/Record/During— instead of eliding them. The defaultcompile_to_ruststays 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.
provenis a main-less Rust module body (the Forge’s extraction); it is emitted aspub mod proven { … } use proven::*;so the imperative program can call its functions /check_*predicates by name. Seecompile_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.definitionis the problem’s Definition name;inputs/outputare 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 bycrate::codegen_ttas 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 aucontextscheduler; the mesh tier lowers those) — returning aCustomParseError, a sound refusal, never wrong code. OFFLINE networking rides the newlib-clean C net runtime on-core. Returns the emittedcrate::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: recognizematmulOR 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_wasmas 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::BigIntruntime 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, andShowprints its decimal. - compile_
to_ wasm_ observed - Compile to WebAssembly in the OBSERVED profile (Wave 13):
Note/Warn/Record/Duringlower toOp::Obs, which the WASM backend emits as calls to the hostobs(site_id)import — the browser-tracing analog of the VM’s observation emission. Returns the module bytes AND theobservation_sitestable: the host (which compiled the program) resolves eachsite_idto its category / message / span kind. The defaultcompile_to_wasmstays the elided profile, byte-identical to the observation-free program (§0.7). - compile_
to_ wasm_ relocatable - The RELOCATABLE object
compile_to_wasm_linkedhands 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_wasmfor a host that enters the module by name beyondmain: 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 onecompile_to_wasmwrites.- 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 thephase_futamuratest fixture so it is a real source file, not a string constant; the fixture nowinclude_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 aC…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 (seetier_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-generatedwire_encode) back into aRuntimeValue.Noneon any malformed or trailing-byte input. - decompile_
source_ text - display_
float_ like_ logos - Format an
f64exactly as aShowof aFloatwould — i.e. byte-identical to the tree-walker / VM (RuntimeValue::to_display_string). The direct-WASM host’sprint_f64sink uses this so aShowof 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::wirecore decodes, so aRuntimeValueencoded here round-trips through an AOT-generated type’swire_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. ReturnsOk(())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_rootsempty is identical toenforce_project_scope.- finish_
projection1_ residual - The post-processing applied to a raw PE residual (the
Any-type safety net +## Mainnormalization). - first_
parallel_ block_ independent - Phase 0 test seam: is the first
Simultaneously:/Attempt all of the following:block insourcemade of data-independent branches?Noneif the program contains no such block. - genuine_
p2_ on_ target_ source - The whole program
run_genuine_p2_on_targetruns, so a harness can run it on any backend. - genuine_
p3_ on_ target_ source - The whole program
run_genuine_p3_on_targetruns, 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## Requiresalready brought it in (a duplicate key is a manifest error). The ONE list every generated manifest — thelargo buildproject and the staged checking project — takes its implied dependencies from. - interpret_
bootstrap interpret_programfor 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 throughmutableparameters 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 functionslargo build --native-functionspre-bundles; everything else stays on VM+JIT. - native_
pe_ cdylib_ lib_ rs - The PE cdylib’s
lib.rs:pe_cdylib_sourcethrough the Rust emitter, under the reference collection semantics, followed byPE_CDYLIB_SHIM. - next_
inspect_ otherwise_ idx - The next
Inspect-with-Otherwiseflag 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 optimizationdepthat makes another fired optimizationdependentSTOP firing meansdependentdepended ondepfor this program. Stops already explained by a declaredrequires-cascade (normalizewould 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, theblockers((winner, loser)preemptions that occurred), and the emergentdependencies((dependent, dep)— seeoptimization_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 forsource— 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) — forsource. The run-path analogue ofoptimizations_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
sourceto VM bytecode — the third path, after AOT codegen and the run-path optimizer. Surfaces the VM-compile-time opts (constant-divisor magic division, VMi32narrowing) 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
sourceunder 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) -> Textthat RETURNS the residual instead of writing it to stdout — noreadWireProgram/writeWireResidual, no stdin loop. The exported cdylib (build_native_pe_cdylib) decodes the wire bytes to aCProgramin itsextern "C"shim and calls this function directly, so the resident server’s process/pipe round-trip is gone. The driveris 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.## Mainis 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_fastexecutes. 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
posof the prelude-expanded text came from, through the runscrate::loader::apply_prelude_mappedreports. A position inside spliced stdlib text came from no byte the author wrote and maps toNone; 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 —
Nonewhen 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_concurrentwith the shown lines kept apart (seetw_lines).- program_
outcome - Run an ALREADY-COMPILED
CompiledProgramstraight-line on the VM and return its outcome — the plain- sequential counterpart toprogram_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)isprogram_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_seeddriverrun_vm_concurrentuses, seed 0), returning its output. Unlike the reversibleprogram_outcome_scheduled, this services ops the reverse machinery does not yet cover (TaskAbort) — so it is the oracle for the fabric’sTaskAborttile. - 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 rawCompiledProgramand differencing the fabric tape against THIS oracle (the same seamcodegen_sva/rtl.rs’s soft-core differential uses for those ops). - program_
to_ core_ wire_ bytes - Serialize a program’s Core-IR
CProgram(aCProgwith 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_coreonWireSinkemits the wire bytes in ONE pass straight from the AST — no intermediateRuntimeValuetree and no secondencode_value_rawwalk (byte-for-byte identical to the old two-pass form; locked bynative_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 generatedCProgram::wire_decode. - program_
to_ core_ wire_ bytes_ two_ pass - The TWO-PASS marshal that
program_to_core_wire_bytesreplaced: build the fullRuntimeValueCore-IR tree (TreeSink) thenencode_value_rawit. Kept as the correctness ORACLE and the speed BASELINE for the single-pass (WireSink) form — the two are byte-identical by construction (WireSinkemits exactly whatencode_value_rawwould), and the single pass avoids the tree allocation + the second encode walk.Noneif a construct is uncovered. - program_
to_ core_ wire_ bytes_ via_ interpreter - The REFERENCE marshal: always the interpreter path (construct the
CProgramvia the tree-walker,wireBytes-serialize it). The native builder’s output must be BYTE-IDENTICAL to this — locked bynative_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 ownentriesreach 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), runscargo check --message-format=json, and remaps each diagnostic’s primary span. ReturnsOk(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
programon 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 bynative_pe_wire. - run_
native_ pe_ inprocess - Specialize
programon the compile-once native PE, IN PROCESS: marshal it to wire bytes, hand them to thedlopened PE cdylib’slogos_pe_specializeas 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 + nativepeBlock+ one FFI call. The cdylib is built + loaded ONCE per thread and cached. Residual-identity with the server / tree-walker is locked bynative_pe_wire. - run_
native_ pe_ server - run_
strict_ tw - Run
sourceSTRICTLY on the tree-walker. Identical pipeline totw_outcome(same front-end, same oracle engine — concurrency runs on the tree-walker’s deterministic scheduler), plus the honest engine identity:engine_ranisSome(TreeWalker)whenever the program executed,Nonefor a parse failure (nothing ran on any engine). - run_
strict_ tw_ with_ args run_strict_twwith the program argument vector for theargs()system native (full argv; index 0 is the program name).- run_
strict_ vm - Run
sourceSTRICTLY on the bytecode VM. Identical pipeline tovm_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,errorsays why). The tree-walker is NEVER silently substituted. - run_
strict_ vm_ with_ args run_strict_vmwith the program argument vector for theargs()system native. Honors the thread’s armed fuel (the MCPstep_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_fullbut 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_programthat dominatesprogram_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_fieldsmaps each variant constructor name to its ordered field names (the caller derives it from its type registry, asprogram_to_coredoes).Noneif a construct is uncovered. Byte-identical toprogram_to_core_wire_byteson the same program — samebuild_core/WireSinkspine. - tier_
differential - Run
sourceon every always-available execution tier — the tree-walker oracle and the register VM — and classify the result (Wave 13; the engine behindlargo test --tiers alland the F18 “works-on-my-tier” guard). - tw_
lines tw_outcomewith 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 joinedoutputof aRunOutcomecannot tell no output from one empty line, so a byte-exact comparison starts here.- tw_
lines_ with_ args tw_lineswith the program argument vector for theargs()system native (full argv; index 0 is the program name).- tw_
outcome - Run
sourceon the TREE-WALKER (the oracle), capturing partial output and the error, if any. This entry point always uses the tree-walker — the dispatchinginterpret_for_ui_syncnow 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 (seelocate_runtime_failure) — same front- end, same interpreter, same error TEXT; this only decides what goes in FRONT of it. A concurrent program (manyInterpreterinstances, one per task) has no single “the current site” to show, so it falls back totw_outcome’s own unlocated shape rather than guessing which task’s site to name.- tw_
outcome_ with_ args tw_outcomewith the program argument vector for theargs()system native (full argv; index 0 is the program name) — the seam the benchmark corpus differential uses to runmain.lgprograms that read their size from argv.- verify_
no_ overhead_ source - Verify that a LOGOS program has no interpretive overhead.
- vm_
lines_ net vm_outcome_netwith the shown lines kept apart (seetw_lines).- vm_
outcome - Run
sourceon the bytecode VM, capturing partial output and the error, if any. Same front-end astw_outcome. - vm_
outcome_ bg vm_outcome_with_argsdriven 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
(
VmTaskonrun_with_seed, seed 0) exactly as the browser/playground does, so aPipe/task/Selectprogram runs on the VM byte-identical to the tree-walker’s async path. The plainvm_outcomeerrors 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 (seelocate_runtime_failure). Uses the plainCompiler::compile_with_oracle→Vm::runpath directly (notpage_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 asvm_failure_site_lock.rsproves. 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 LOCALNetInbox(the same inbox the tree-walker’s offline mode uses), soListen/Send/Sync/PeerAgentrun 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
sourceon 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 theobservechannel — program output is byte- identical tovm_outcome. Pair withobserve::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 hotnesstier(HOTSWAP §4) before reaching the VM — the seam thetier_invariancegate drives at every tier T0..T3 to assert byte-identical output.tier = Tier::T3reproduces today’s optimized run path.- vm_
outcome_ with_ args vm_outcomewith 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. ReturnsErrfor programs outside the VM’s supported subset (the compiler reportsvm: 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 bycompile_to_dirandrustc_check.