Skip to content

fix(tier3): write plain progress heartbeats once a minute - #274

Merged
rng1995 merged 4 commits into
mainfrom
naren/port-progress-heartbeat-interval
Nov 2, 2026
Merged

rng1995 merged 4 commits into
mainfrom
naren/port-progress-heartbeat-interval

Conversation

@rng1995

@rng1995 rng1995 commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Tier 3 plain progress output now writes its still running heartbeat once a minute instead of every second. A new --progress-interval SECONDS option sets the interval explicitly.

  • PlainProgressReporter defaults to a 60-second heartbeat. RichProgressReporter keeps its 1-second refresh of elapsed times.
  • create_progress_reporter() takes an optional refresh_interval. When it is omitted, each reporter keeps its own default.
  • tier3 evaluate and tier3 PATH accept --progress-interval SECONDS. The hidden top-level evaluate spelling also gets it, because both commands copy its parameters. validate does not forward the option, just as it does not forward --progress, and the docs say so.
  • The interval must be finite and between 0.05 and 86400 seconds:
    • The CLI rejects anything else with a usage error (exit code 2) before the evaluation starts.
    • The reporter constructors raise ValueError for NaN or infinity and clamp finite values to that range.
    • NaN passes ordinary range checks (including click.FloatRange) and makes Event.wait return at once, so the heartbeat thread would spin and flood the log.
    • Infinity or very large values make the heartbeat thread's wait raise OverflowError, which ends the thread with a traceback.
  • Docs: a new row in docs/cli-reference.mdx, the flag added to that page's list of options validate does not forward, and a new row in docs/tier3-live-evaluation.mdx.
  • The CLI surface golden file is regenerated; the only change is the new option on its three commands.
  • CHANGELOG entry under Unreleased / Fixed.

Why

When stderr is redirected or is not an interactive terminal, as in CI jobs and log files, --progress auto picks the plain reporter. That reporter wrote [hh:mm:ss] still running: <stages> every second for the whole run. A one-hour evaluation added about 3,600 identical lines to the CI log, which buried the stage transitions and failures people need to read. There was no option to change the interval.

On current main, a plain reporter on a redirected stream writes one heartbeat per second. With this change it writes none in the first minute. Stage transitions are still written as they happen.

Kept from public

  • Terminal detection. create_progress_reporter("auto") still checks Console.is_terminal and is_dumb_terminal before it picks Rich. So a TTY with TERM=dumb or similar still gets plain output, and with this change it also gets the 60-second default.
  • Rich at one second. The Rich view keeps public's 1-second heartbeat and its existing Live auto-refresh settings. This PR does not change Rich rendering.
  • Existing floor and shutdown. The 0.05-second minimum and the capped heartbeat-thread join in close() are unchanged. close() still returns at once with a 60-second interval, because setting the stop event wakes the wait.
  • Presentation only. The interval stays out of EvaluationOptions.engine_kwargs(), the same as --progress, so it does not change the run configuration or results.
  • Validation style. The CLI check uses a parameter callback like the existing _validate_similarity_threshold, with a "must be finite and within [...]" message.

Tests

New tests. All 17 test cases fail against unmodified main.

  • tests/test_tier3_progress.py:
    • test_plain_heartbeat_defaults_to_one_minute_and_rich_to_one_second: runs the heartbeat loop of the reporters that auto picks, with a recording stop event, and checks that they wait 60 s (plain) and 1 s (Rich). The test does not sleep.
    • test_progress_interval_overrides_plain_and_rich_defaults: plain, rich and auto with refresh_interval=12.5.
    • test_progress_reporter_rejects_non_finite_refresh_interval: NaN, +inf and -inf.
    • test_progress_reporter_bounds_refresh_interval_below_thread_timeout_limit: clamps to 0.05 s and 86400 s, and checks that the maximum is below threading.TIMEOUT_MAX.
  • tests/test_cli.py:
    • test_live_eval_progress_interval_configures_reporter: runs evaluate and tier3 evaluate with --progress plain, once with the default (60 s) and once with --progress-interval 12.5. It also checks that the interval is not in the engine kwargs.
    • test_live_eval_rejects_invalid_progress_interval: nan, inf, 0.01, 86401 and -1 exit with code 2 and the evaluation does not start.

Results:

  • pytest -n 8 tests/test_tier3_progress.py tests/test_cli.py tests/test_evaluation_service.py tests/golden tests/test_commands.py tests/tier3/test_workflow.py tests/test_oss_packaging.py tests/test_tier3_public_runtime.py tests/test_benchmark_rollout_docs.py tests/test_accuracy_arithmetic.py tests/test_tier3_result_display.py: 1101 passed.
  • ruff check passes on the four changed Python files.
  • ruff format --check passes on progress.py, test_cli.py and test_tier3_progress.py. cli.py already fails it on main at two unrelated places (around lines 469 and 514); this PR does not touch those lines, and the lines it adds are formatted.
  • scripts/check_oss_boundary.py passes.
  • Manual check: a reporter from create_progress_reporter("auto") on a redirected stream wrote 2 heartbeat lines in 2.3 s on main and none with this change. close() returned in about 5 ms.

🤖 Generated with Claude Code

Tier 3 plain progress output, which `--progress auto` selects whenever
stderr is redirected or is not an interactive terminal (CI jobs, log
files), repeated a "still running: <stages>" line every second for the
whole run. A long evaluation added thousands of identical lines per hour
to CI logs, and there was no way to change the interval.

Plain progress now defaults to one heartbeat every 60 seconds, while the
interactive Rich view keeps refreshing its elapsed times every second.
`tier3 evaluate` and `tier3 PATH` gain `--progress-interval SECONDS` to
set the interval explicitly for either view, and
create_progress_reporter() accepts a matching `refresh_interval`.

The interval must be finite and between 0.05 and 86400 seconds. NaN
passes ordinary range checks and would make the heartbeat thread spin,
and infinite or very large values make its wait raise OverflowError, so
the CLI rejects them with a usage error and the reporter constructors
refuse non-finite values and clamp the rest to that range.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the diff in full context. No findings. The interval is validated (NaN/inf rejected, clamped to [0.05, 86400] below threading.TIMEOUT_MAX), the plain and Rich defaults are split correctly, the heartbeat thread still stops promptly on close, and the golden CLI surface, docs and CHANGELOG are updated. tests/test_tier3_progress.py, tests/test_cli.py and tests/golden pass locally (381 passed); ruff clean.

Reviewed with Claude Code.

rng1995 and others added 2 commits November 2, 2026 10:32
Conflicted files: CHANGELOG.md

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rng1995
rng1995 enabled auto-merge (squash) November 2, 2026 20:07
@rng1995
rng1995 merged commit aba2fa1 into main Nov 2, 2026
21 checks passed
@rng1995
rng1995 deleted the naren/port-progress-heartbeat-interval branch November 2, 2026 20:50
rng1995 added a commit that referenced this pull request Nov 6, 2026
* docs(changelog): move entries released in 0.7.0-0.7.2 out of Unreleased

0.7.0 (#314) and 0.7.1 (#327) never cut their sections on main, and 0.7.2
(#335) added its section below the whole Unreleased block, so Unreleased
still listed work that had already shipped.

Place each Unreleased entry under the release that shipped the PR that
added it:

- 0.7.0: the published section from the 0.7.0 tag, verbatim. It already
  holds the six entries that main had filed under 0.6.0, so 0.6.0 again
  matches the v0.6.0 tag, including the original run_config.json entry.
- 0.7.1: #264 #271 #274 #281 #284 #289 #293 #299 #316 #317 #318 #323
  #324 #326 #327, plus the #320 wording of the Windows Git-root entry,
  since #320 changed that 0.7.0 fix in 0.7.1.
- 0.7.2: #263 #265 #269 #270 #276 #279 #287 #290 #296 #309 #328 #330
  merged with the existing #335 entries.

Only post-v0.7.2 entries stay under Unreleased, with one heading per
subsection. Entry text is unchanged, apart from the published tag wording
in 0.7.0 and 0.6.0.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(release): prepare v0.8.0

Set the package, fallback, lock, citation and developer-guide versions to
0.8.0 and move every entry merged since v0.7.2 under
'## 0.8.0 - 2026-11-05', leaving Unreleased empty.

The refusal-fallback documentation test now reads the release section
that names CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK, requires it to be 0.8.0,
and requires exactly one entry there to name the switch.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(release): pin the verified 0.8.0 Tier 1 image and add its CI bundle

Pin onboarding to the Tier 1 image published by the reviewed main revision
55d2d04 in "Build and publish Tier 1 image" run 42158955180:
ghcr.io/nvidia/skillevaluator-tier1@sha256:9d5483243918937be4f2178f74cf7c622a531dee41e3176906994d52fa14950a
(config sha256:d17d6f5105ec5f1bf0cbe4dff0d693aae4ecf01e9c1c6a6ddb7830518acace33).
The workflow and publisher refs both move to 55d2d04.

ci/bundles/0.8.0 mirrors the 0.7.2 bundle. The templates, README and
release.json are the run's github-actions-onboarding artifact and match
ci/render_templates.py output for these pins byte for byte. The scanner
inventory and verification receipt come from the build's runtime-stage
version step, the five-case smoke receipt, the onboarding job's anonymous
pull, and the public manifest, whose config digest equals the smoke-tested
image ID. The ZIP uses the 0.7.2 layout (sorted members, inner checksums,
1980 timestamps, 0644, deflate level 9) and rebuilds to identical bytes.

Point the current-bundle links at 0.8.0 and list 0.7.2 as historical.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>

---------

Signed-off-by: Narendran Raghavan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant