metronome/rust/README.md
Me Here be524ce1ea Rust port Stage 1: track-format codec crate (passes the golden vectors)
A third implementation of the track DSL alongside engine.js and app.py, validated
against the same tests/fixtures/track-format.json:

- rust/track-format/: pure parse()/serialize() codec (std + alloc for now; no_std is
  a later refinement). Ports the app.py/engine.js semantics exactly — grouping,
  subdivisions, swing, ghost, polymeter, euclid, GM note-number aliases, unknown->beep,
  default groove (group-start accents), tempo clamp, empty->beep, and the playback-flow
  tokens (rep/end/relative-goto). Carries vol/cd too, so it's the most spec-complete
  of the three.
- tests/conformance.rs: the Rust adapter — reads the shared fixtures, asserts each
  case's normalized form (number-tolerant deep-equal) + serialize idempotency.
- rust/Containerfile + run.sh: Rust toolchain in a container (mirrors hardware/eda/),
  with the thumbv8m.main-none-eabihf target for the eventual RP2350 firmware. Never
  on the host.

Verified: ./rust/run.sh -> cargo test -> conformance + idempotent both pass.
docs/rust-port.md Stage 1 marked done.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 18:36:59 -05:00

13 lines
533 B
Markdown

# Rust port — `track-format` crate (Stage 1)
Pure parse/serialize codec for the track DSL, validated against the shared golden
vectors (`tests/fixtures/track-format.json`) — the third implementation alongside
`engine.js` and `app.py`. See `docs/rust-port.md` for the staged plan.
All tooling runs in a container (per the develop-in-container rule):
```sh
./rust/run.sh # cargo test — runs the conformance + idempotency suite
./rust/run.sh cargo build
./rust/run.sh bash # interactive shell in the crate
```