Ticket 067: Propagation Progress Feedback¶
Goal¶
Emit periodic progress lines to stderr during propagate runs so operators
know the command is still working. With 500–10 000 samples and a 2-second
time step, a propagation can take tens of seconds to minutes with no output.
Silent progress is a common source of confusion and premature Ctrl-C.
Motivation¶
propagate is the slowest command in the tool. A run with 1 000 samples and
dt_s = 1.0 over a 3-minute mission processes ~180 000 physics ticks with
zero terminal feedback. Operators running this in a CI gate or pre-flight
check assume the command hung. A simple progress line — propagating 250/1000
samples 25% 0.3 s/sample ETA 2m 15s — costs nothing in output terms and
eliminates the ambiguity.
Design¶
Progress is written to stderr, not stdout, so it does not contaminate the JSON
output when --format json --output /dev/stdout is used. Progress is suppressed
when stderr is not a TTY (e.g., piped into a log file) unless --progress is
explicitly passed.
Emit a progress line: - After the first sample completes (to show rate immediately) - Every 5 % of total samples thereafter - After the final sample, with total elapsed time
Example output:
propagating 50/1000 samples 5% 0.31 s/sample ETA 2m 54s
propagating 100/1000 samples 10% 0.30 s/sample ETA 2m 42s
...
propagating 1000/1000 samples 100% 0.30 s/sample 2m 58s elapsed
Implementation Path¶
- Add a
ProgressCallbackprotocol toestimator/execution/propagator.py: - Thread the callback through
run_stochastic_propagationand call it after each sample completes. - In
adapters/cli.py, thepropagatecommand creates a stderr-writing callback and passes it torun_stochastic_propagation. - Add
--progress / --no-progressflag (default:--progresswhen TTY).
Acceptance Criteria¶
propagatewith 50+ samples writes at least one progress line to stderr.- Progress lines do not appear in
--output file.jsonJSON output. - Progress lines are suppressed when stderr is not a TTY and
--progressis not passed. --no-progressfully suppresses all progress output.ProgressCallbackprotocol is tested via a mock callback that records calls: call count ≥ 1, completed values are monotonically increasing, final call hascompleted == total.
Scope¶
estimator/execution/propagator.py—ProgressCallbackprotocol and callback wiring in_ParticleSampler.run()adapters/cli.py—--progress / --no-progressflag, stderr callback builder, rate and ETA formattingtests/test_stochastic_propagator.py— callback invocation tests
Notes¶
- The callback has zero overhead when not wired (default
None). - Do not use
tqdmor any third-party progress library — keep the dependency footprint clean. - The progress line format uses
\rand ANSI clear-to-EOL if TTY, so the cursor stays on one line; otherwise each line ends with\n. - This ticket has no impact on the JSON output contract or golden fixtures.