fix: expose HYPERFINE_ITERATION to --prepare and --conclude (fixes #781)#874
Open
leno23 wants to merge 4 commits into
Open
fix: expose HYPERFINE_ITERATION to --prepare and --conclude (fixes #781)#874leno23 wants to merge 4 commits into
leno23 wants to merge 4 commits into
Conversation
…ommands Previously, the $HYPERFINE_ITERATION environment variable was only set for the main benchmark command, but not for --prepare or --conclude commands. This made it impossible to use iteration-specific file names in preparation and cleanup steps (e.g. creating and removing per-iteration data files). The fix passes the current BenchmarkIteration through to run_intermediate_command so that --prepare and --conclude commands receive the same HYPERFINE_ITERATION value as the corresponding benchmark command. Setup and cleanup commands (--setup/--cleanup) continue to use NonBenchmarkRun since they run once, not per-iteration. Fixes sharkdp#781 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add integration test for sharkdp#781 and changelog entry. Based on sharkdp#857 by @alexchenai. Co-authored-by: Cursor <cursoragent@cursor.com>
3 tasks
Co-authored-by: Cursor <cursoragent@cursor.com>
Author
|
CI green (including Windows after gating the integration test to Unix). Ready for review — thanks! |
Author
Author
Author
|
Friendly ping — PR #874 still green on all platforms. Thanks for any review when you have time. |
Author
|
Friendly ping — PR #874 (HYPERFINE_ITERATION in prepare/conclude) still CI-green. Thanks! |
Author
Author
|
Rebased onto latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #781:
$HYPERFINE_ITERATIONis now set for--prepareand--concludecommands with the same iteration value as the corresponding benchmark/warmup run.Implementation
Core change from #857 by @alexchenai (thank you!):
#[derive(Clone, Copy)]onBenchmarkIterationrun_preparation_command/run_conclusion_commandThis PR adds:
hyperfine_iteration_env_in_prepare_and_conclude_commandsHappy to close in favor of #857 if the author adds the test there — goal is to land a tested fix.
Test plan
cargo test --locked(40 tests)Made with Cursor