From ca8e1d6038af7362dca27af6f50c08cd7fe99eea Mon Sep 17 00:00:00 2001 From: sora <2075279110@qq.com> Date: Thu, 17 Sep 2026 06:08:33 +0000 Subject: [PATCH] Idle watchdog back to 300s default; begin_bench clears the stale bar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - watchdog: 10s was the user's experiment; back to 5min default (EVALHARNESS_PULL_IDLE_S overrides). Zero-byte detection itself is sound: select(fd, timeout) + any-chunk reset, unit-verified. - a FAILED bench left its 'scoring 0/2' bar on screen through the NEXT bench's entire dataset download; begin_bench() relabels to ' · loading' and zeroes counters at each bench start. Co-Authored-By: Claude --- evalharness/cli.py | 3 +++ evalharness/progress/rich_terminal.py | 20 ++++++++++++++++++++ evalharness/sandbox/prefetch.py | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/evalharness/cli.py b/evalharness/cli.py index c8fced3..0bc253a 100644 --- a/evalharness/cli.py +++ b/evalharness/cli.py @@ -745,6 +745,9 @@ def _cmd_eval_run(args) -> int: try: if _shared_reporter is not None and total_runs > 1: _shared_reporter.set_bench_tag(f'[{i + 1}/{total_runs}]') + if _shared_reporter is not None: + _shared_reporter.begin_bench(name) # clear the previous + # bench's stale scoring bar before this one's dataset load def _emit(msg, _i=i, _n=name): if _shared_reporter is not None: diff --git a/evalharness/progress/rich_terminal.py b/evalharness/progress/rich_terminal.py index 12c704e..b53ec7d 100644 --- a/evalharness/progress/rich_terminal.py +++ b/evalharness/progress/rich_terminal.py @@ -162,6 +162,26 @@ class RichTerminalProgress: self.heartbeat_task.cancel() self.heartbeat_task = asyncio.create_task(self._heartbeat()) + def begin_bench(self, name: str): + """New benchmark starting: immediately re-label the bar to its + loading phase. Without this the PREVIOUS bench's stale scoring + state (e.g. a failed '0/2') stayed on screen through the whole + dataset download of the next one.""" + if self.disabled or self.task_id is None: + return + self.bench_name = name + self._last_phase = 'loading' + self._scoring_for = None + self.started = time.monotonic() + self.inflight = 0 + self.restored = 0 + self.admitted = None + self.progress.update( + self.task_id, + description=f'[green]{self.bench_tag}{name} · loading[/green]', + total=1, completed=0, new='', rate='0.00', inflight=0, + cur='0s', elapsed='0s', eta='-', retries=0) + def set_scoring(self, done: int, total: int): """Retarget the SAME bar to the scoring phase: generation is finished and its filled 100% state is stale -- now the bar refills with judged diff --git a/evalharness/sandbox/prefetch.py b/evalharness/sandbox/prefetch.py index 586c577..f513bb6 100644 --- a/evalharness/sandbox/prefetch.py +++ b/evalharness/sandbox/prefetch.py @@ -166,7 +166,7 @@ def _pull_one(image: str, verbose: bool = True) -> None: # override with EVALHARNESS_PULL_IDLE_S for slow-negotiating mirrors. import os as _os2 - _IDLE_S = float(_os2.environ.get('EVALHARNESS_PULL_IDLE_S', '10')) + _IDLE_S = float(_os2.environ.get('EVALHARNESS_PULL_IDLE_S', '300')) def _iter_lines(): nonlocal buf