Skip to content

Building Testing Benchmarking

Amp edited this page Nov 18, 2026 · 1 revision

Building, Testing, Benchmarking

What the repository at a9f0d61 provides, and what spec/11-build.md §6–§7 asks for. Nothing on this page is a measured result: 11 §0 says "Draft 0.2 has no measured numbers", and bench/reports/ is empty.

Toolchains

Tool Pin Where
rustc 1.100.0, with rustfmt, clippy, rust-src, llvm-tools rust-toolchain.toml
nightly Miri, TSan/ASan, cargo-fuzz (cargo +nightly ...) rust-toolchain.toml comment, .agents/setup
previous stable B4 build C (11 §7.7) rust-toolchain.toml comment
clang, lld must share rustc's LLVM major (11 §4.2) .cargo/config.toml, .github/actions/llvm
vxc v0.0.4 (tag object 3a89e3c7, commit c6dffec7), hash pinned for x86_64-linux only vx/TOOLCHAIN
Foundry v1.9.0 in CI .github/workflows/ci.yml
cargo-release 1.1.7, git-cliff 2.14.2 per-crate releases deploy/release/README.md

The workspace is edition 2024, rust-version = "1.100", one Cargo.lock; every external dependency is pinned with =x.y.z (Cargo.toml). The release profile has overflow-checks = true, panic = "abort" and codegen-units = 1 (11 §3.4).

Target flags in .cargo/config.toml: Linux x86-64 builds with target-cpu=x86-64-v3, Linux aarch64 with target-cpu=neoverse-n1, both linked by clang + lld with frame pointers. Vendored sources (vendor/) are not in the repository yet, so --offline builds are not possible; the replacement block is commented out.

Cargo aliases

Alias Expands to Use
cargo release cargo build --release --config .cargo/release.toml release build with cross-language LTO (-C linker-plugin-lto, 11 §4.3)
cargo bench-release cargo bench --config .cargo/release.toml benches with the same LTO

Run both from the repository root, because Cargo resolves the --config path from the working directory. vyrn-nic's build script rejects a release build of the C shim without LTO.

The release alias shadows the external cargo-release subcommand (Cargo prints a warning), but deploy/release/README.md tells you to run cargo release -p vyrn-wire minor. See Known Gaps.

Everyday commands

cargo fmt --all --check
cargo clippy --locked --workspace --all-targets -- -D warnings
cargo test --locked --workspace
RUSTFLAGS="--cfg loom" cargo test -p vyrn-cut --test loom --release   # loom models (vyrn-cut only)
vx/build.sh                                                          # Vx oracle, if a pinned vxc is present
(cd contracts && forge fmt --check && forge build && forge test)     # L1 bridge
python3 -I tests/golden/vyrn_proto_vectors.py | diff - tests/golden/vyrn_proto_vectors.out

vx/build.sh skips a host that has no vxc or no pinned hash, unless VYRN_REQUIRE_VX=1 (FRICTION.md W-10).

Test layers (11 §6) and what exists

Layer (11 §6) On main at a9f0d61
1 unit + loom + Miri Unit and integration tests in most crates; loom models in vyrn-cut/tests/loom.rs (behind --cfg loom); Miri is named in crate docs but not run in CI.
2 property tests vs oracle proptest in vyrn-cut, vyrn-risk, vyrn-wire and vyrn-log; none against the oracle yet.
3 per-message differential vs vyrn-vx-oracle Scenario files in tests/golden/scenarios run through vyrn-sim's oracle binding; no 10⁹-message diff yet.
4 vyrn-sim Oracle binding and scenario runner only; no whole-cluster simulator; tests/seeds.toml has seeds = []; tools/sim-swarm is an empty main.
5 fuzzing Nine targets in fuzz/fuzz_targets (cargo +nightly fuzz run <target>), each a 7-line body that ignores its input.
6 chaos on hardware Not present.
7 cross-build determinism (B4) Not present; the release workflow compares two builds of the same commit on one runner.

Golden vectors in tests/golden (protocol, reject, log, admin, data, replica, SipHash, BLAKE3, Ed25519 edge cases) let another implementation check itself; tests/golden/README.md explains them.

Benchmarks (11 §7)

B1–B20 and B-GPU are defined in 11 §7.3; each passes or fails against a budget. The repository has the parts that do not need lab hardware:

  • vyrn-bench: vyrn-bench gen (workload config + seed → request stream) and vyrn-bench hist (percentiles of a histogram export). Formats: bench/workloads/FORMAT.md.
  • Workload configs: bench/workloads (wl-ref, wl-lane, wl-pool, wl-deep, wl-xsweep, wl-auction, wl-diurnal, wl-low, wl-sess, wl-aws, and vectors.toml).
  • tools/perf-gate: the 11 §9.3 regression rule over committed results files. bench/baselines/, bench/rigs/ and bench/reports/ hold only .gitkeep.

What needs which machine

From the 11 §6.9 test matrix and the hardware targets of 01 §10:

Check DEV macOS aarch64 CI Linux x86-64 / aarch64 Lab hardware
Unit tests, golden vectors, property tests, sim seeds yes yes —
loom, Miri, TSan yes x86-64 only —
Fuzzing 60 s x86-64 (60 s and 8 h) —
C shim: DPDK net_ring, ASan/UBSan n/a yes —
C shim: ef_vi — — REF, CONSUMER (Solarflare X2541)
Asm gate n/a (no shim) yes —
B4 determinism one build in the set yes REF
B1–B3, B5–B15, B17–B19, B-GPU — — REF
B20 — — CONSUMER
B16 — — AWS
  • x86 is required for anything that relies on x86-64-v3 code generation or AVX-512 paths (the Segment16 sweep, 01 §14.13), and for the only pinned vxc hash.
  • macOS runs the full functional suite with the sim and kernel_udp backends, but cannot pin threads, so "nothing timed is ever reported from it" (11 §6.9). The current CI has no macOS job.
  • Real NICs are needed for every latency benchmark: ef_vi needs Solarflare X2541 cards, dpdk needs ConnectX or ENA, and PTP, 1 GiB huge pages and core pinning are lab features. vyrn-nic builds only kernel_udp and sim today, so no hardware backend exists yet.

Clone this wiki locally