Skip to content

Crate vyrn bench

Amp edited this page Nov 18, 2026 · 1 revision

vyrn-bench

crates/vyrn-bench · test-only in spec 11 §1.4 · split (11 §1.3) · library and binary vyrn-bench

Purpose

11 §1.3 describes the benchmark harness: traffic generator, echo server, microbenchmark drivers, histogram export and report signing (§7). On main the crate holds the deterministic workload generator and the latency-histogram export. bench/workloads/FORMAT.md defines both formats (VYRN-GEN v1 and VYRN-HIST v1). The generator is a pure function of its config and seed, so it yields the same packets byte for byte on every build and target (B4).

Spec sections it implements

  • 02 §6 (workloads; configs in bench/workloads)
  • 11 §7.1 rule 4 (deterministic generator, integer arithmetic only)
  • 11 §7.1 rules 5 and 8 (HDR histograms with 1 ns resolution up to 10 µs, an overflow list, raw counts)

Main public types

Type Role
config::Config (with Class, Mix, Phase, BookModel, Dist) A workload config, such as wl-ref.toml
generator::Generator, GenOptions Config + seed → request packets
generator::Packet, MsgKind, Stats One generated packet, message kinds, counts
stream::write_stream, parse_stream, StreamHeader The VYRN-GEN v1 stream file
hist::LatencyHist, Sample, Req VYRN-HIST v1 export, with the max kept with its request
rng::Xoshiro256, rng::SplitMix64 The seeded PRNGs
fixed::log2_q32, exp2_q32, neg_ln_q32 Integer math used in place of floats

Status on main (a9f0d61)

Implemented (partial)

  • The binary has two subcommands: gen writes a workload stream and hist prints the percentiles of a VYRN-HIST export. There is no echo server, no microbenchmark driver and no report signing.
  • generator.rs: "it has no vyrn-md feed and no sequencer counters, so the model book is the fixed BBO of [crate::config::BookModel], and the mix controller of 02 §6.10 and the lane pacer of 02 §6.9 belong to the rig that sends the packets. Handles are placeholders".
  • It does not link or load libvyrn_vx_oracle yet, so it has no B12 cross-check.
  • Tests: 31 #[test]. tests/generator.rs has 11 and tests/hist.rs has 6. In src/, rng.rs has 6, fixed.rs 5 and generator.rs 3.
  • The crate produces no benchmark numbers. Values in 11 §7 are budgets.

Depends on

Crates
Code (Cargo.toml) vyrn-types, -crypto, -wire, -cut, -risk, -bbo, -lane, -engine, -nic, -log; hdrhistogram, blake3
11 §1.4 engine crates, vyrn-nic, vyrn-log, libvyrn_vx_oracle

Missing: libvyrn_vx_oracle. The source uses only vyrn-types, vyrn-crypto and vyrn-wire. The other declared crates are not used yet.

Links

Clone this wiki locally