Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

New dependency for 10x `.h5` output: `hdf5-pure` (pure Rust, no libhdf5)

Aperta
#341 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

@Psy-Fer ci sta già lavorando.

Dal 28/10/2026.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
data

Direzione di ricerca

Start by reading this issue alongside #340, which determines whether 10x HDF5 output is wanted; this issue asks maintainers to decide whether to accept hdf5-pure or omit .h5 output. The payload names no source files or tests to start from. Done means a maintainer decision on the dependency and output direction; any implementation depends on that decision.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

dependencies

CONTRIBUTING asks for a new dependency to be raised in an issue before the PR,
especially a non-Rust one. This one is pure Rust, but it is still a dependency
and a supply-chain decision, so here it is.

What needs it

Writing *_feature_bc_matrix.h5 — the HDF5 form of the count matrix that
scanpy.read_10x_h5 and Seurat's Read10X_h5 load. Without it the
CellRanger-compatible output is of limited use, since that is the file most
pipelines actually open. (See #340 for whether that output is wanted at all and
whether its development method is acceptable; this issue is only about how the
file would be written, and is moot if #340 is declined.)

The candidate

hdf5-pure 0.47.0

  • Licence MIT OR Apache-2.0, both already in about.toml's accepted list.
    It ships LICENSE-MIT and LICENSE-APACHE at the crate root, where
    cargo-about looks, so no clarify entry is needed.
  • Dependencies: one — byteorder, which rustar-aligner already depends on.
  • No C, no -sys crate, no bindgen, no system library, no build script.
    cargo install and the Windows build are unaffected.
  • Supports what the 10x layout needs: nested groups, fixed-width ASCII string
    datasets (which is what CellRanger itself writes — |S18, |S15), chunked
    extendable datasets, and typed root attributes.
Alternatives considered
  • hdf5-metno (the maintained fork of hdf5-rust): bindings to the C
    libhdf5. Works, but it is exactly the non-Rust dependency the policy singles
    out, and it needs a system library at build time.
  • Hand-rolling a minimal HDF5 writer: feasible for contiguous 1-D datasets,
    and fixed-length strings avoid the global-heap work — but it is ~1000+ lines
    of binary-format code whose failure mode is a file that one reader accepts and
    another rejects. Hard to justify against a 2-dependency crate.
  • Shipping no .h5: the honest fallback if the dependency is unwanted. The
    MatrixMarket output already exists; users would convert it themselves.
What I have and have not tested

Validated, on macOS aarch64 only:

  • Output read by the reference C library (h5dump/h5ls, exit 0, no stderr)
    and by scanpy.read_10x_h5, on both a small fixture and a real 33,696-gene
    mouse matrix.
  • Matrix contents diffed entry by entry against the .mtx written from the same
    counts — identical, including the barcode and feature columns.
  • Structure diffed against a real CellRanger 10.0.0 .h5: every dataset name,
    dtype and root-attribute type matches.

Not tested, and this is the gap that matters for a dependency decision:

  • Any platform other than macOS aarch64. rustar-aligner builds on five
    platforms including Windows. The crate has no build script and no C, so there
    is no obvious reason for it to differ, but I have not demonstrated that and
    it is CI's question rather than one I can close locally.
  • Degenerate shapes through the full writer: zero called cells, a single gene,
    a single barcode. The unit tests cover the guards that refuse a malformed
    matrix, not these shapes end to end.
Two things worth knowing before adopting it
  1. It is young (0.47.0, but a 2026 crate). It ships extensive benchmarks
    against real ENA data and the validation above came out clean, but it has
    far less mileage than libhdf5, and the bug below is the kind of thing that
    implies.
  2. It has a bug worth pinning. It encodes a chunk dimension in two bytes, so
    a chunk larger than 65535 elements produces a file the reference HDF5 library
    refuses outright ("stored chunk dimension encoding length does not match
    value calculated from chunk dimensions") — no 10x reader can open it. Real
    CellRanger files use 80000-element chunks, i.e. above that limit, so this is
    the crate's bug and not a format constraint. My code has a compile-time
    assertion holding the chunk size at or below 65535. I will report it
    upstream before this PR
    ; the repro is three lines, and how it is received
    is probably better evidence about the crate's stewardship than anything I
    can test locally.
Question

Is a pure-Rust HDF5 dependency on these terms acceptable, or would you rather
rustar-aligner not write .h5 at all?

Lingua principale
Rust
Stelle
91
Fork
9
Merge medio
16h 43m
PR unite (30g)
22

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di scverse/rustar-aligner

Tutte le issue di scverse/rustar-aligner

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.