Skip to content

B9: Reads bounded by bytes, not by what a file claims #143

Backlog

Description

@Claptar

Part of #149.

wave 3 · 0.17.13 · size M · starts after: B8 (both edit conversion/{tenx,loom}.py)

Goal. Memory follows --chunk and stored sizes, never a width, length or header a file names.

Owns: elements/read.py, conversion/tenx.py, conversion/loom.py, formats/mtx.py

Approach:

  • Text blocks as object or StringDType arrays, not fixed-width <U padded to the longest value.
  • Fixed-width text read in blocks sized by itemsize against a byte budget, for 10x features and loom attributes; absurd widths refused at plan time.
  • MTX: only the metadata comment kept (bounded), line length capped, negative or implausible sizes refused before allocating.

Findings

Ref Sev Finding Where
F218 M A loom's attributes are read with no byte bound: a compressed fixed-width text column inflates in memory conversion/loom.py:561
F219 M 10x .h5 feature datasets are read and decoded whole, unbounded by stored size conversion/tenx.py:162
F220 M Text blocks are padded to their longest value: one long string makes a block cost GBs elements/read.py:54
F221 M MTX header comments and lines are held whole, through gzip with no inflation cap formats/mtx.py:82
F222 M import sparse sizes first-pass arrays from the MTX size line alone formats/mtx.py:309

Done when one PR on fix/b9 closes this, with a regression test against an oracle for every finding, and docs and changelog in the same PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions