feat: introduce packed matrix storage and layer metadata

Unifies bit and integer matrix storage into `PersistentBitMatrix` and `PersistentCompactIntMatrix` enums, supporting both columnar and memory-mapped single-file layouts. Introduces `LayerMeta` to persist layer dimensions as `layer_meta.json`, enabling correct initialization of implicit presence matrices. Adds CLI commands (`pack` and `--upgrade-index`) to convert existing columnar indices to the compact format and backfill missing metadata. Updates partitionner and layered map logic to use the new persistent builders, optimized memory allocation, and auto-detected storage backends.
This commit is contained in:
Eric Coissac
2026-06-03 11:50:39 +02:00
parent de1a41810a
commit 173ac9fb42
20 changed files with 799 additions and 271 deletions
+10
View File
@@ -196,6 +196,16 @@ impl KmerIndex {
rep.push(t.stop());
}
// ── Pack matrices after merge ─────────────────────────────────────────
{
let t = Stage::start("pack");
let pb = spinner("pack — consolidating column files …");
let dst2 = KmerIndex::open(output)?;
dst2.pack_matrices()?;
pb.finish_and_clear();
rep.push(t.stop());
}
// Re-open to get the updated state.
KmerIndex::open(output)
}