Skip to content

B3b: Concat fidelity and scale #93

Closed

Description

@Claptar

Part of #87.

wave 2 · 0.17.5 · size M · starts after: B3a (#92) (same file)

Goal. concat keeps the source's storage settings, scales with the number of inputs, and matches anndata where the outputs differ.

Owns: core/concat.py

Approach:

  • Keep dense compression and chunking (F075). The fill value promotes only when something is actually filled (F116). Merge varp as anndata does (F118).
  • CSC inputs are read by blocks of columns, not one column at a time (F011). Per-row counts go in numpy arrays, not Python lists (F132).
  • Open inputs lazily, in a bounded pool like split's MAX_OPEN_OUTPUTS (F076).
  • Decision D2: outer var order and category order, first appearance versus anndata's sort (F113, F114).

Findings

Ref Sev Finding Where
F011 H concat of CSC inputs reads every column of every input separately, decompressing the surrounding chunk (or re-fetching the shard index) … src/adata/core/concat.py:594
F075 M concat drops the source's compression and chunking for dense X/layers and obsm arrays src/adata/core/concat.py:520
F076 M concat opens every input at once: it fails at about 253 HDF5 inputs under macOS's default fd limit (about 1,020 on Linux), and peak RSS … src/adata/core/concat.py:1042
F113 L concat --join outer orders var by first appearance; anndata.concat sorts the union src/adata/core/concat.py:65
F114 L concat category order differs from anndata: first-appearance union instead of natsorted, and differently ordered 'ordered' categoricals … src/adata/core/concat.py:239
F116 L concat --fill-value promotes integer X/layers to float64 even on an inner join, where nothing is filled src/adata/core/concat.py:517
F118 L concat always drops varp, even with --merge, although anndata merges varp like varm; the documented reason only applies to obsp src/adata/core/concat.py:1124
F132 L concat and sparsify keep per-row indptr counts in Python int lists (about 36 to 40 bytes per row, against 8) src/adata/core/concat.py:467

Done when one PR on fix/b3b 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