From d048f596e88fa428bfb8b4ab7bb772da496818fe Mon Sep 17 00:00:00 2001 From: Morten Punnerud-Engelstad Date: Wed, 12 Aug 2026 23:25:13 +0200 Subject: [PATCH] Flush the bench's progress lines A battery run takes half an hour, and print without flush block-buffers when the output is a file -- so the log stayed empty until exit, indistinguishable from a hung run. Watched happen on the first six-domain run. --- src/mpe_lkg/battery/bench.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mpe_lkg/battery/bench.py b/src/mpe_lkg/battery/bench.py index 2f838cc..a3257ab 100644 --- a/src/mpe_lkg/battery/bench.py +++ b/src/mpe_lkg/battery/bench.py @@ -23,11 +23,18 @@ def run( decompose: int = 8, budget: float = 120.0, select: bool = False, - progress=print, + progress=None, ) -> dict: """Every question through the reasoning loop, one row each.""" from ..reasoning import _steady, reason + if progress is None: + # Flushed, not buffered: a battery run takes half an hour, and a log + # that stays empty until exit is indistinguishable from a hung one. + import functools + + progress = functools.partial(print, flush=True) + rows = [] for index, question in enumerate(questions, 1): started = time.time()