Releases: fcarvajalbrown/Segovia
Releases · fcarvajalbrown/Segovia
Release list
v0.4.1
Segovia v0.4.1 — the auto batch default is now memory-safe.
Highlights
- The default (auto) batch width in
reader.preprocess(...)is capped atmin(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 explicitbatch >= 1are unaffected. Shipped to bothpip install segoviaandcargo 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 GBwas 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
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), yieldingfloat32 (samples, channels)chunks with the GIL released and resident memory bounded bybatch × (chunk + 2·margin) × channels.pip install segoviaand the crate now ship the compute engine, not just the readers.segovia.SyntheticEphysReaderandsegovia.SyntheticIfcReader— built-in streaming, bounded-memory data simulators (biophysically-grounded extracellular spikes; impedance-flow-cytometry bipolar-Gaussian pulses) behind the sameChunkSourcecontract, with bit-identical output across platforms andground_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'sget_tracesat 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
Segovia v0.3.0 — native mtscomp .cbin reading and the first real bounded-memory streaming proof.
Highlights
segovia.CbinReader— reads IBL/SpikeGLX mtscomp.cbin+.chdirectly, the thirdChunkSourcealongsideSpikeGlxReaderandZarrReader. Streams(samples, channels)int16chunks with positioned per-chunk reads (peak memory independent of file size),flate2zlib inflate, andi16wrapping delta reversal; honorschunk_orderF/C and rejects spatial-diff / non-int16 / non-zlib with typed errors.pip install segovia/ the crate both carry it.
Validation
- Byte-identical to
SpikeGlxReaderon the realNoise4Sam_g0recording round-tripped through the actualmtscompcompressor; tiny committed multi-chunkF-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 warningsclean; 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-biasingsource to confirm the niche is still open remains the last M0–2 item.
Full Changelog: v0.2.0...v0.3.0
v0.2.0
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 (zarrscrate) that streams a store as(samples, channels)int16chunks, one region resident at a time, GIL released per chunk. Reads gzip-, zstd-, and blosc-compressed stores, covering bothzarr-python's (zstd) and SpikeInterface's (blosc) default compressors. Bothpip install segoviaand the crate carry it.- New
ChunkSourcetrait unifiesSpikeGlxReaderandZarrReaderas one chunk-producer contract that the upcoming compute chain will target generically (ADR 0011).
Validation
- Real-data cross-validation:
ZarrReaderyields byte-identical chunks toSpikeGlxReaderfor the realNoise4Sam_g0Neuropixels recording (NEOephy_testing_data) re-encoded through gzip, zstd, and blosc. - 12 Rust + 14 Python tests green;
clippy -D warningsclean. abi3 wheels build on Windows, macOS, and Linux — including thezstd-sys/blosc-srcC-codec builds.
Still open
- Validated against
zarr-pythonv3 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
First functional release of the Segovia ephys engine.
Added
segovia.SpikeGlxReader— a chunked, memory-bounded SpikeGLX.meta/.binreader. 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 metafileSizeBytesis tolerated and surfaced viadeclared_file_size_bytes.- Day-1 zero-copy bridge:
segovia.zerosandsegovia.__version__.
Validation
- Byte-for-byte verified against the real
Noise4Sam_g0Neuropixels recording (385 ch / 30 kHz) from the NEOephy_testing_datacorpus. - 9 Rust + 9 pytest green;
cargo fmt/clippy -D warningsclean; singlecp38-abi3wheel.
This lands the M0–2 bounded-memory chunk-reader deliverable. Zarr reader and the full-1-hour benchmark run remain open.