BobBot f4f08a0210
ci / test (push) Canceled after 0s
ci / build-arm64 (push) Canceled after 0s
docs: detail Open Points (scope, slices, decisions needed, recommended order)
2026-11-12 10:07:32 +00:00
…
…
…

innesco-rs

Rust clone of innesco (the IGNITE64 control/DAQ software, timespot/innesco on baltig). This repo is a separate clean-room-style port: the original Python/C repository is untouched, and its license/authorship is respected.

Deployment target: AMD Kria K26 SOM (Zynq UltraScale+ MPSoC, quad Cortex-A53, aarch64, Ubuntu 22.04) — the board buffering/timestamping the IGNITE64 detector data.

Layout

crate ported from status
innesco-protocol innesco/ecs/protocol.py ECS wire protocol (Read/Write/Ping, >BI headers) + TCP client
innesco-decoding innesco/decoding/csrc/decoding.c 13-byte frame decoder, DCO calibration, position map; golden tests
innesco-cli — ping, decode subcommands (zero-dependency)

Zero external dependencies (pure std): cross-compiling for arm64 needs no cross-linked C libraries, and release binaries are small (panic = "abort", LTO).

Build (x86_64 host)

cargo test --workspace                       # golden tests
cargo build --release                        # host binary
export CARGO_TARGET_DIR=/tmp/innesco-rs-target   # keep artifacts off NFS

Build for arm64 (Kria K26)

scripts/build-arm64.sh --run-tests           # static musl binary (recommended)
scripts/build-arm64.sh --gnu                 # dynamic, glibc (Ubuntu 22.04 on board)

The script bootstraps everything without root: rustup target add, a ziglang pip venv as cross linker (via cargo-zigbuild), then cargo zigbuild --release --target aarch64-unknown-linux-musl. Artifacts land in dist/aarch64-<musl|gnu>/innesco-cli.

Deploy to the Kria: scp dist/aarch64-musl/innesco-cli <board>:~/ && ssh <board> ./innesco-cli ping localhost 8888.

Porting notes

See docs/porting-notes.md for the Python/C → Rust mapping and the (deliberate) divergences from the C extension (64-bit arithmetic where the C overflows 32-bit, strict socket reads where Python truncated silently, skip-and-count instead of abort on malformed packets).

Open Points

(user-editable — tell me here what to focus on; details agreed with Lucio 2026-11-12)

  1. Storage layer (after #3): storage.py is a 185-line ParquetStorage thread (queue → parquet → S3/MinIO upload, prometheus counters). Rust port options: arrow-rs (lighter; arrow is SoA-native, closes the AoS/SoA divergence) vs polars-rs (feature parity with notebooks, heavy). Decisions needed: (a) arrow-rs vs polars, (b) S3 in-process vs local-only, (c) keep the exact Python column schema (notebook compatibility).
  2. REST API (after #3): 7 endpoints in rest_api.py (/ping, /metrics, /state, PUT /chunksize, POST /tag, POST /daq, GET /dataset). Port: axum + tokio in a separate crate with feature flag (library stays dependency-free). /state and /daq depend on #3; the other four can be ported independently.
  3. Board/slow-control model (biggest item): ecs/ ≈ 2,358 lines (asic_state 626, mattonella_state 569, quadrant 502, mattonella 426, …)
    • Board.py 268 + DataProcessor.py 425. Suggested slices: (1) board+pixel 166 lines → (2) mattonella(+state) 995 → (3) asic_state 626 → (4) quadrant 502 → (5) daq+DataProcessor 574. Mirror-1:1 first (golden I2C tests comparable with Python), type-state validation later. Depends only on the (already ported) protocol crate.
  4. Real-board validation: no qemu here, no network to the boards. (a) A raw frame dump from a real acquisition (even small) → decoder validated on physical data as an official golden test — highest value, zero prerequisites. (b) network access to a Kria running data_server → live innesco-cli ping + harmless I2C read (0x7E).
  5. CI runner: verified 2026-11-12 — no Actions runs on this Gitea repo and runner admin endpoint is not accessible → no runner configured. Self-hosting one here is impossible (no Docker daemon). Options: register a runner on a machine with Docker, or rely on local scripts/build-arm64.sh --run-tests until then.

Recommended order: 4(a) → 3 → 1 → 2 → 5.

S
Description
Rust clone of innesco (IGNITE64 ECS protocol + frame decoder), arm64 builds for AMD Kria K26
Readme
96 KiB
Languages
Rust 97.1%
Shell 2.9%