Engineering standards and the definition of done for this project. Read alongside
REPS.md(root, authoritative) anddev/ROADMAP.md(current phase). If anything here conflicts withREPS.md,REPS.mdwins. Family plan:../_lexersketch/(README rules of engagement, ARCHITECTURE, ISSUES, ROADMAP).
This library is built and maintained to a production standard and treated as a flagship piece of work. Plan the full path, then build one verified step at a time. "Good enough" is treated as a defect. It is part of the LexerSketch runtime tier (LXRT) of the -lang family that LexerSketch assembles.
bytecode-lang owns the format and its static checks. It does not execute (bvm-lang), generate (codegen-lang), or load images (loader-lang).
One bytecode format replaces the incompatible ISAs that grew separately in codegen-lang and bvm-lang, and the private byte format of aot-lang. It is a load-bearing wall: the VM, debugger, and hybrid images all depend on it.
- Ours, not rented. No third-party runtime dependency. First-party
-langcrates only, wired when first used. Dev-only test tooling is allowed. - Performance. Peak is the baseline: allocation-free hot paths where feasible, dense ids instead of maps, no "faster" claim without
criterionnumbers at realistic scale (100k+ items). - Correctness. Every invariant in section 4 is covered by property tests, cross-checked against a simple reference implementation wherever one can be written.
- Hostile-input hardening. Any input this crate accepts may be adversarial: explicit budgets (depth, size, steps), iterative algorithms, no quadratic paths, no reachable panics.
- Architecture. SOLID, KISS, YAGNI; one responsibility; a Tier-1 one-call entry point headlines the docs.
- Cross-platform. Linux, macOS, and Windows are first-class, verified by CI on stable and MSRV 1.85.
- Error handling. Every fallible path returns
Result/Optionper a documented contract; errors are#[non_exhaustive]and actionable. - Production-ready.
#![forbid(unsafe_code)]and#![deny(missing_docs)]from the first commit; nounwrap/expect/todo!/dbg!/printing in library code; every public item has rustdoc with a runnable example; every claim in the docs maps to a test.
- Compiles clean on Linux/macOS/Windows, stable and MSRV 1.85.
fmt,clippy -D warnings(all targets, all/no-default features),test --all-features,cargo doc -D warningsclean.cargo audit+cargo deny checkpass.- No
unwrap/expect/todo!/dbg!in shipping code. - A Tier-1 API exists and headlines the docs.
- Property tests cover every section-4 invariant; a fuzz target exists for every decoder or parser.
- Hot-path changes carry benchmarks; no regression over 5%.
README.md,docs/API.md, andCHANGELOG.mdupdated; the matchingdocs/release/vX.Y.Z.mdwritten before the tag.- v1.0.0 only after a real consumer has exercised the API end to end (LexerSketch decision D18).
- The verifier is total and sound: every module it accepts has in-range registers, constants, and jump targets, consistent types, and well-formed frames; every module it rejects gets a precise error.
- Encoding round-trips exactly and is deterministic; the header carries a format version and decoding refuses unknown versions.
- Decoding is budgeted (size, counts, nesting); hostile input never panics or allocates without bound.
- Every instruction has a written semantics that every execution tier implements identically.