Phasic← Overview

Building from source

cargo run              # debug build, slow but quick to compile
cargo run --release    # optimised; use this for real recordings

Always use a release build for actual work. The debug build decodes and renders far more slowly, which is very noticeable on a long or high-density recording.

Release tuning

The release profile uses thin link-time optimisation and a single codegen unit, letting the optimiser see the whole crate at once. This produces a faster binary at the cost of slower, non-parallel compilation. The benchmark profile carries the same settings, so measured figures reflect the shipped binary rather than a differently-optimised one.

Tests

cargo test --workspace                   # everything except model inference
cargo test --workspace --features onnx   # the full suite

The suite covers the pure signal layers, the readers and writers, and a conformance suite that runs the XDF reader against the reference files the wider ecosystem tests against. See the correctness chapter for what is verified and how.

Inference tests need the feature. Model inference is gated as a whole, so its hundred-odd tests only run with --features onnx. A plain cargo test passing says nothing about them.

Tests that also need the ONNX Runtime library skip themselves with a printed reason when it is absent, so a fresh checkout without the runtime still reports a clean run rather than failing or hanging.

Benchmarks

cargo bench

Criterion microbenchmarks for the decode and DSP kernels.

Workspace layout

Crate Contents
phasic (root) The application — interface, panes, document model, inference, live streaming
phasic-core The pure signal layers shared with the web build: decoding, DSP, montages, the signal model
phasic-core-wasm A wasm-bindgen surface over phasic-core for the browser build

phasic-core compiles to wasm32 and is what the web version of Phasic runs on, so the two share one decoding and signal-processing implementation rather than maintaining two.

The minimum supported Rust version differs by crate: the application needs 1.88, driven by its inference dependencies, while phasic-core needs 1.82 so that consumers are not held to a floor for a dependency it does not have.

Code style

The repository is deliberately not rustfmt-clean. It uses manual alignment — aligned fields and comments, compact match arms, intentional one-liners — that rustfmt would rewrite. Do not run cargo fmt; match the surrounding style by hand.