Add configurable sparsity flag to index finalization and merge CLI

Extends `KmerIndex::finalize_indexed` to accept a `sparse` boolean parameter, enabling control over whether output presence matrices are packed in a compact sparse format or stored densely. The merge command now exposes a `--dense` flag to invert this setting, defaulting to the existing sparse representation. Call sites in select and rebuild modules pass `false` to preserve current behavior. A benchmark lock file is also added for dependency tracking.
This commit is contained in:
Eric Coissac committed 2026-08-22 17:36:50 +02:00
1 parent bb380d0c7d
commit cbf6893f38
6 files changed
+23 -8

No files matched your search

+5
View File
@@ -28,6 +28,10 @@ pub struct MergeArgs {
/// Disambiguate duplicate genome labels by appending .1, .2, … instead of erroring
#[arg(long, default_value_t = false)]
pub rename_duplicates: bool,
/// Pack the output's presence matrices in the dense format instead of the default sparse one
#[arg(long, default_value_t = false)]
pub dense: bool,
}
pub fn run(args: MergeArgs) {
@@ -89,6 +93,7 @@ pub fn run(args: MergeArgs) {
let mut merge = Merge::new(&source_refs, &args.output, mode)
.force(args.force)
.rename_duplicates(args.rename_duplicates)
.sparse(!args.dense)
.on_progress(|_: Progress| pb.inc(1));
let dst = merge.run().unwrap_or_else(|e| {