Summary
bcftools mpileup, view, norm, and index run silent on multi-hour inputs, making "still working" indistinguishable from "hung" without external tooling. An opt-in periodic stderr progress line would close the gap at near-zero cost.
Current workaround
We read /proc/<pid>/io (Linux only) for bytes-read and divide by input file size. Limitations:
- Linux only; no
/proc/<pid>/io on macOS or BSD.
- Bytes only, no record counts.
- Fragile child-PID discovery when bcftools sits behind a shell pipe.
mpileup needs a special case because the I/O-doing process is the child, not the parent shell.
Our wrapper is ~140 LOC handling these edges.
Suggested approach
Either of:
- Opt-in flag —
--progress[=INTERVAL] emits a stderr line every INTERVAL records (default 1M). One extra branch per record; off by default, so scripts are unaffected.
- TTY auto-enable —
isatty(STDERR_FILENO)-gated, like tar --checkpoint=.N. Interactive only, no flag.
Format suggestion:
[mpileup] 12.3 / 23.0 GB processed (53.5%), 145M records, 1234s elapsed, 11min remaining
Bytes from htsFile.fp.bgzf->block_offset; records from each subcommand's main loop; ETA from linear extrapolation, omitted when input size is unknown.
Low priority — the workaround works. Filing because the proliferation of /proc/<pid>/io wrappers across pipelines is a UX signal that upstream should own this.
bcftools 1.23.1.
Summary
bcftools mpileup,view,norm, andindexrun silent on multi-hour inputs, making "still working" indistinguishable from "hung" without external tooling. An opt-in periodic stderr progress line would close the gap at near-zero cost.Current workaround
We read
/proc/<pid>/io(Linux only) for bytes-read and divide by input file size. Limitations:/proc/<pid>/ioon macOS or BSD.mpileupneeds a special case because the I/O-doing process is the child, not the parent shell.Our wrapper is ~140 LOC handling these edges.
Suggested approach
Either of:
--progress[=INTERVAL]emits a stderr line every INTERVAL records (default 1M). One extra branch per record; off by default, so scripts are unaffected.isatty(STDERR_FILENO)-gated, liketar --checkpoint=.N. Interactive only, no flag.Format suggestion:
Bytes from
htsFile.fp.bgzf->block_offset; records from each subcommand's main loop; ETA from linear extrapolation, omitted when input size is unknown.Low priority — the workaround works. Filing because the proliferation of
/proc/<pid>/iowrappers across pipelines is a UX signal that upstream should own this.bcftools 1.23.1.