metronome/rust
Me Here 72dbb2ecd0 pm-grid: hardening - bound the USB-MIDI TX queue + defensive set-list guard
Audit for panic/brick risks (a panic = black screen on this device):
- sx_send (live-sync broadcasts + 5s heartbeat) pushed to tx_q with no cap. If
  the editor disconnects without a BYE while sync_armed and nothing drains
  MIDI-IN, tx_q grows unbounded -> heap exhaustion -> brick. Now drops messages
  when tx_q > 256 (the heartbeat re-syncs when the host returns). Notes/clock
  were already capped.
- build_setlists now drops empty set lists, so load()/next_track() can never
  hit a `% 0`. (parse guarantees >=1 lane; built-ins/parsed lists are non-empty,
  this is belt-and-suspenders.)

Other unwrap()s are boot-time peripheral init; lanes[0]/items[0]/step[0] are all
safe (parse substitutes beep:4 for empty programs; built-ins lead the list).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 11:21:06 -05:00
..
assets/bravura Add untracked notation deliverables (build/compile depend on these) 2026-06-02 13:46:45 -05:00
glyphgen Add untracked notation deliverables (build/compile depend on these) 2026-06-02 13:46:45 -05:00
pm-grid pm-grid: hardening - bound the USB-MIDI TX queue + defensive set-list guard 2026-06-04 11:21:06 -05:00
pm-kit Preserve notation + grammar feature work (verified complete + green) 2026-06-02 13:45:26 -05:00
pm-ui Add untracked notation deliverables (build/compile depend on these) 2026-06-02 13:46:45 -05:00
track-format Preserve notation + grammar feature work (verified complete + green) 2026-06-02 13:45:26 -05:00
uisim Preserve notation + grammar feature work (verified complete + green) 2026-06-02 13:45:26 -05:00
.gitignore Add untracked notation deliverables (build/compile depend on these) 2026-06-02 13:46:45 -05:00
Cargo.toml Add pm-grid: Rust firmware for the Pico Scroll Pack (RP2040) 2026-06-03 07:22:48 -05:00
Containerfile Add pm-grid: Rust firmware for the Pico Scroll Pack (RP2040) 2026-06-03 07:22:48 -05:00
probe-flash.md rust: probe-flash.md — flash+defmt via Pi Debug Probe in a Silverblue toolbox 2026-06-01 08:49:02 -05:00
README.md Rust port Stage 1: track-format codec crate (passes the golden vectors) 2026-05-31 18:36:59 -05:00
run.sh pm-kit: defmt+probe-rs diagnostics + flip-link toolchain 2026-06-01 08:30:35 -05:00

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):

./rust/run.sh            # cargo test — runs the conformance + idempotency suite
./rust/run.sh cargo build
./rust/run.sh bash       # interactive shell in the crate