Skip to content

Add a --detach flag to bare metal bencher run#762

Merged
epompeii merged 4 commits intodevelfrom
u/ep/detach
Apr 3, 2026
Merged

Add a --detach flag to bare metal bencher run#762
epompeii merged 4 commits intodevelfrom
u/ep/detach

Conversation

@epompeii
Copy link
Copy Markdown
Member

@epompeii epompeii commented Apr 3, 2026

This changeset adds a --detach flag to the bare metal bencher run command. This allows you to skip awaiting the bare metal job execution synchronously.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

🤖 Claude Code Review

PR: #762
Base: devel
Head: u/ep/detach
Commit: 7d6d6849b779ae3564551b6c90dda56bc986c47d


Here's my review:


PR Review: --detach flag for bencher run + human display improvements

Summary

Adds a --detach flag to bencher run for fire-and-forget remote job submission, renames --poll-interval to --job-poll-interval (with backward-compat alias), improves human-readable report output, and adds a detach integration test.

Issues

1. poll_interval field is populated but unused when detach: true

services/cli/src/bencher/sub/run/mod.rs:131 — When detach is true, the poll_interval field is still parsed and stored in the Job struct, but never used. This is harmless but slightly misleading. The conflicts_with on the clap side handles this correctly, so it's fine in practice.

2. Test uses wall-clock time with std::time::Instant and std::thread::sleep

tasks/test_api/src/task/plus/runner.rs:478-485 — The detach test polls with real wall-clock time (Instant::now(), thread::sleep). Per CLAUDE.md, time-based tests should be deterministic. However, this is an integration/smoke test in tasks/ (not a unit test), and it's polling an external process, so real time is appropriate here. This is acceptable.

3. Missing --format json assertion on detach output

tasks/test_api/src/task/plus/runner.rs:455 — The test passes --format json and --quiet, then deserializes stdout as JsonReport. If detach mode ever prints additional non-JSON output to stdout (the cli_eprintln_quietable! currently goes to stderr, which is correct), the test would catch it. Good.

4. Detach test error propagation ordering

tasks/test_api/src/task/plus/runner.rs:250-252 — The error propagation is result? ; no_sandbox_result? ; detach_result?. If an earlier test fails, the detach test is skipped (set to Ok(())). This is intentional to avoid running dependent tests after a failure, which is good.

5. Human output: leading newlines on first content

lib/bencher_comment/src/lib.rs:77-79human_report_link writes "View report: {url}" without a leading newline, then human_no_benchmarks and human_results_list start with "\n\n". This produces clean output. Good.

6. UTM stripping for human URLs

lib/bencher_comment/src/lib.rs:677-706 — The resource_url_human method strips UTM params from URLs shown to humans. Clean separation. The resource_url_inner refactor with the utm: bool parameter is straightforward.

Minor Nits

  • Commit messages: claude_1 is not descriptive. Consider squashing/rewording before merge.
  • TODO remove in due time at services/cli/src/parser/run.rs:274 — Consider adding a version target for removing the --poll-interval alias (e.g., // TODO(v0.7): remove deprecated alias), so it doesn't linger indefinitely.
  • The detach_result variable in tasks/test_api/src/task/plus/runner.rs:234 is not actually async or deferred — it runs synchronously inline. The naming pattern matches the surrounding code, so this is fine for consistency.

Looks Good

  • Backward compatibility via alias = "poll-interval" for the rename
  • conflicts_with = "job_poll_interval" prevents nonsensical --detach --job-poll-interval combos
  • Docs added for all 9 languages
  • Changelog updated
  • Test coverage for the new detach flow
  • No security concerns

Verdict

Approve with minor suggestions. The code is clean, well-tested, and follows project conventions. The only actionable item is adding a version target to the deprecation TODO.


Model: claude-opus-4-6

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2026

🐰 Bencher Report

Branchu/ep/detach
Testbedintel-v1
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
microseconds (µs)
(Result Δ%)
Upper Boundary
microseconds (µs)
(Limit %)
Adapter::Json📈 view plot
🚷 view threshold
4.54 µs
(-0.07%)Baseline: 4.54 µs
4.64 µs
(97.85%)
Adapter::Magic (JSON)📈 view plot
🚷 view threshold
4.47 µs
(+1.24%)Baseline: 4.42 µs
4.47 µs
(99.94%)
Adapter::Magic (Rust)📈 view plot
🚷 view threshold
25.34 µs
(+0.91%)Baseline: 25.12 µs
26.61 µs
(95.23%)
Adapter::Rust📈 view plot
🚷 view threshold
3.38 µs
(+0.12%)Baseline: 3.37 µs
3.47 µs
(97.37%)
Adapter::RustBench📈 view plot
🚷 view threshold
3.37 µs
(+0.01%)Baseline: 3.37 µs
3.49 µs
(96.67%)
🐰 View full continuous benchmarking report in Bencher

@epompeii epompeii merged commit 04096b6 into devel Apr 3, 2026
52 checks passed
@epompeii epompeii deleted the u/ep/detach branch April 3, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant