Repository navigation
Crate vyrn engine
Path: crates/engine/vyrn-engine · Layer 4 (11 §1.4) · Pinned: yes (11 §1.3)
vyrn-engine joins lane, cut and BBO into one engine, in two modes: live and replay. It adds no matching rule: every decision is made by vyrn-lane or vyrn-bbo, and the engine plays the cores neither crate implements (the cut cores, the stream-core role, the snapshot fan-out). It owns seal(), the sealing allocator (INV-NOALLOC) and the core-role table. The mode is chosen by the call, not by a build flag (C-ONEBIN).
- 11 §1.3 (crate scope), §3.5 (sealing allocator), §3.1 (clock reads), §6.4 (single-threaded schedule)
- 05 §1.1, §4.1 (shared lines), §4.13 and §7.1 (half-cuts,
INV-CUT-MONO), §4.14 (snapshot), §4.15 (LaneCut,INV-FRAME-FIRST), §8.10 (responses), §10 (replay; rows 1–3 and 6), §14.3 (faults) - 01 §11.6 (live and replay modes), §6.6 (order stream)
| Type | Role |
|---|---|
Engine |
One box; ingest, step, poll_lanes, run (live) and replay
|
Shared |
Every line and ring of one box, built before seal()
|
Sink |
Where outputs go: lane responses, TX packets, order-stream records |
Rec, OwnedRec
|
One order-stream element as emitted; owned form for replay |
Payloads |
Packet bytes by record, for replay |
Diverged, Why
|
Replay stopped at a record: Mismatch, NoPayload, SourceTooOld, BadRecord, NoStep, Fault
|
Fault |
Engine fault; the caller fail-stops the sequencer or replica |
alloc::SealingAlloc, seal, seal_counting
|
The global allocator; per-thread seal; counting form for tests and vyrn-sim
|
role::Role |
One core's role (including PoolLane, Spare) |
Implemented (partial). Version 0.1.0 from the workspace; publish = false.
-
Replay from the log (PR #47). Each step runs through
vyrn_bbo::Bbo::replay_stepwith its cut, source, kind (includingShedandCONT) andRescanband taken from the record (05 §10 rows 4–5). Each packet runs throughvyrn_lane::Lane::replay_packet; an op is forwarded iff a laterStepRecordnames it, never by the lane's snapshot (05 §10 rows 1–3, 7). No clock is read; every output record is checked against the log. - New replay rejects:
Why::BadStep,Why::Step(withvyrn_bbo::Diverge),Why::StepTooOld. - The crate doc's "Scope of this version (each is a PR follow-up)":
- "Live mode is the single-threaded schedule of 11 §6.4 (
vyrn-simorder)." Pinned threads belong to the binary. - A forwarded op's route is derived from its first step's kind, "because the log does not carry the live classification. A
Crossthat STP stops before any fill is logged asImprove… a known divergence until the spec logs the route." - "Pooled lanes (
AcctTake), auction control steps, and theSimvisibility backend in tests."
- "Live mode is the single-threaded schedule of 11 §6.4 (
-
Engine::replayreads the engine's own journal (OwnedRec), not 07's wireStepRecord; vyrn-replica'sports.rssays the wire record lacks fields this replay compares, so noRustReplayexists yet.
alloc is the only module allowed unsafe (UNSAFE.toml). Tests: tests/engine.rs and tests/alloc.rs, with tests/harness/. Total: 11 #[test] functions.
Workspace: vyrn-types, vyrn-lane, vyrn-bbo, vyrn-cut, vyrn-wire; dev: vyrn-risk. This matches 11 §1.4 (layer 4, vyrn-engine → vyrn-lane, vyrn-bbo, vyrn-cut, vyrn-wire). It does not depend on vyrn-nic, as the graph requires.
- Source: crates/engine/vyrn-engine
- Spec: Spec-05-Engine, Spec-11-Build, Spec-01-Conventions
- Related: Crate-vyrn-replica, Binary-vyrn-seq, Crate-vyrn-sim, Known-Gaps
Overview
Working on VYRN
Spec
- 00 Index
- 01 Conventions
- 02 Requirements
- 03 Architecture
- 04 Protocol
- 05 Engine
- 06 Platform
- 07 Replication
- 08 Epochs
- 09 Chain
- 10 Accounts, Risk, MD
- 11 Build
- 12 Commitment
- 13 Availability
- 14 Envelope
Engine crates
Other crates
- vyrn-nic
- vyrn-log
- vyrn-data
- vyrn-consensus
- vyrn-replica
- vyrn-epoch
- vyrn-chain
- vyrn-md
- vyrn-sim
- vyrn-bench
Binaries
- vyrn-seq (stub)
- vyrn-validator (stub)
- vyrn-admin
Outside Rust
Reflects main at a9f0d61.