Skip to content

Releases: fcarvajalbrown/Segovia

v0.4.1

Choose a tag to compare

@fcarvajalbrown fcarvajalbrown released this 03 Jul 01:41

Segovia v0.4.1 — the auto batch default is now memory-safe.

Highlights

  • The default (auto) batch width in reader.preprocess(...) is capped at min(logical_threads, 4). Peak resident memory for the default path is now bounded to ~1.2 GB on any machine, instead of scaling to ~3-6 GB on many-core hosts where the previous one-slab-per-thread default could OOM low-RAM machines. Callers passing an explicit batch >= 1 are unaffected. Shipped to both pip install segovia and cargo add segovia. (ADR 0018)

Validation

  • Full CI green: fmt + clippy + test, plus the wheel matrix across macOS, Ubuntu, and Windows. The footprint model ~0.17 GB x batch + ~0.5 GB was confirmed file-size-independent at the full 55.8-minute scale (ADR 0017).

Still open

  • This is a safety guard, not a tuned throughput optimum; the best auto-default value stays open and a future release may refine it. No new features in this patch (the causal filter mode and parallelized mtscomp decode remain future work).

Full Changelog: v0.4.0...v0.4.1

Segovia v0.4.0

Choose a tag to compare

@fcarvajalbrown fcarvajalbrown released this 01 Jul 01:39

Segovia v0.4.0 — the streaming preprocessing chain, built-in data simulators, and bounded-memory online-latency benchmarks.

Highlights

  • reader.preprocess(...) — the streaming bandpass → common-median-reference → whiten chain on every reader (SpikeGLX / Zarr / .cbin), yielding float32 (samples, channels) chunks with the GIL released and resident memory bounded by batch × (chunk + 2·margin) × channels. pip install segovia and the crate now ship the compute engine, not just the readers.
  • segovia.SyntheticEphysReader and segovia.SyntheticIfcReader — built-in streaming, bounded-memory data simulators (biophysically-grounded extracellular spikes; impedance-flow-cytometry bipolar-Gaussian pulses) behind the same ChunkSource contract, with bit-identical output across platforms and ground_truth().

Validation

  • Real IBL AP-band Neuropixels data: the SC1 memory gate is a decisive pass (0.99 GB peak, file-size-independent). In the online regime (batch = 1) versus SpikeInterface's get_traces at a 300 ms real-time budget: 100% deadline-adherence at 0.28 GB (Segovia) vs 69.5% at 0.52 GB (SpikeInterface); Segovia also leads on latency, tail latency, and throughput. 41 Python tests + Rust unit tests green; abi3 wheels build on Windows, macOS, and Linux.

Still open

  • The systems paper itself is not written. The IFC leg is a conceptual dual-domain generality demonstration, not an empirically validated IFC model (there is no real IFC corpus for external validity). There is no strictly-causal (single-pass) filter mode yet. Batch throughput ties SpikeInterface — the "faster than SpikeInterface" claim was measured and dropped; the honest win is bounded memory and online latency.

Full Changelog: v0.3.0...v0.4.0

v0.3.0

Choose a tag to compare

@fcarvajalbrown fcarvajalbrown released this 09 Jun 19:52

Segovia v0.3.0 — native mtscomp .cbin reading and the first real bounded-memory streaming proof.

Highlights

  • segovia.CbinReader — reads IBL/SpikeGLX mtscomp .cbin + .ch directly, the third ChunkSource alongside SpikeGlxReader and ZarrReader. Streams (samples, channels) int16 chunks with positioned per-chunk reads (peak memory independent of file size), flate2 zlib inflate, and i16 wrapping delta reversal; honors chunk_order F/C and rejects spatial-diff / non-int16 / non-zlib with typed errors. pip install segovia / the crate both carry it.

Validation

  • Byte-identical to SpikeGlxReader on the real Noise4Sam_g0 recording round-tripped through the actual mtscomp compressor; tiny committed multi-chunk F-order fixture round-trips.
  • Streamed a real 46-minute, 385-channel IBL LF recording (1.6 GB .cbin, 5.32 GB decompressed) end to end at ~250 MB/s in 186 MB peak RSS — far under the 2 GB target. An early whole-file mmap measured 1698 MB (RSS tracking compressed-file size); positioned reads fixed it, so the bound is file-size-independent and carries to a full AP-band hour.
  • 18 Rust + 18 Python tests; fmt/clippy -D warnings clean; abi3 wheels build on Windows/macOS/Linux. New deps (flate2, serde, serde_json) are pure-Rust — no C-linking risk.

Still open

  • The bounded-memory run was the LF band on a 46-min insertion (not a literal 60-min AP recording); the memory bound is length- and band-independent, but the AP-rate SC1 benchmark itself (the M2–4 go/no-go gate) is the next, separate milestone and is not yet run.
  • No compute ops yet — these are readers only. The bandpass → CMR → whiten chain and the SC1 speed/memory comparison vs spikeinterface(n_jobs=N) are M2–4.
  • Reading direct-neural-biasing source to confirm the niche is still open remains the last M0–2 item.

Full Changelog: v0.2.0...v0.3.0

v0.2.0

Choose a tag to compare

@fcarvajalbrown fcarvajalbrown released this 09 Jun 17:18

Segovia v0.2.0 — a second bounded-memory reader: Zarr joins SpikeGLX behind one streaming contract.

Highlights

  • segovia.ZarrReader — a chunked, memory-bounded Zarr v2/v3 reader (zarrs crate) that streams a store as (samples, channels) int16 chunks, one region resident at a time, GIL released per chunk. Reads gzip-, zstd-, and blosc-compressed stores, covering both zarr-python's (zstd) and SpikeInterface's (blosc) default compressors. Both pip install segovia and the crate carry it.
  • New ChunkSource trait unifies SpikeGlxReader and ZarrReader as one chunk-producer contract that the upcoming compute chain will target generically (ADR 0011).

Validation

  • Real-data cross-validation: ZarrReader yields byte-identical chunks to SpikeGlxReader for the real Noise4Sam_g0 Neuropixels recording (NEO ephy_testing_data) re-encoded through gzip, zstd, and blosc.
  • 12 Rust + 14 Python tests green; clippy -D warnings clean. abi3 wheels build on Windows, macOS, and Linux — including the zstd-sys/blosc-src C-codec builds.

Still open

  • Validated against zarr-python v3 stores, not yet the exact SpikeInterface store layout (array-node naming, segment grouping).
  • No realistic full-1-hour bounded-memory run yet, and the make-or-break SC1 benchmark (bandpass → CMR → whiten vs spikeinterface) is not built — the compute engine does not exist yet.

Full Changelog: v0.1.0...v0.2.0

v0.1.0

Choose a tag to compare

@fcarvajalbrown fcarvajalbrown released this 09 Jun 14:23

First functional release of the Segovia ephys engine.

Added

  • segovia.SpikeGlxReader — a chunked, memory-bounded SpikeGLX .meta/.bin reader. Parses the sidecar metadata (channel count, sample rate, stream type, raw fields), memory-maps the flat int16 binary, and streams it to Python as fixed-size (samples, channels) int16 chunks with the GIL released around each copy. Sample count is derived from the actual file size and frame-validated; a stale/truncated meta fileSizeBytes is tolerated and surfaced via declared_file_size_bytes.
  • Day-1 zero-copy bridge: segovia.zeros and segovia.__version__.

Validation

  • Byte-for-byte verified against the real Noise4Sam_g0 Neuropixels recording (385 ch / 30 kHz) from the NEO ephy_testing_data corpus.
  • 9 Rust + 9 pytest green; cargo fmt/clippy -D warnings clean; single cp38-abi3 wheel.

This lands the M0–2 bounded-memory chunk-reader deliverable. Zarr reader and the full-1-hour benchmark run remain open.