Skip to content

Conversation

@AvivYossef-starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/add_absolute_limits_to_benchmark_run branch from f0f11db to f08bafc Compare October 30, 2025 10:50
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/dont_capture_output_when_rinnung_benchmark branch from 69b8d38 to e4891f5 Compare October 30, 2025 10:50
@AvivYossef-starkware AvivYossef-starkware marked this pull request as ready for review October 30, 2025 12:50
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/add_absolute_limits_to_benchmark_run branch from f08bafc to d505305 Compare October 30, 2025 12:59
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/dont_capture_output_when_rinnung_benchmark branch from e4891f5 to b246fe1 Compare October 30, 2025 12:59
@AvivYossef-starkware AvivYossef-starkware changed the base branch from aviv/dont_capture_output_when_rinnung_benchmark to graphite-base/9861 October 30, 2025 13:03
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/add_absolute_limits_to_benchmark_run branch from d505305 to 154ad3f Compare October 30, 2025 13:43
@AvivYossef-starkware AvivYossef-starkware changed the base branch from graphite-base/9861 to aviv/dont_capture_output_when_rinnung_benchmark October 30, 2025 13:44
@AvivYossef-starkware AvivYossef-starkware changed the base branch from aviv/dont_capture_output_when_rinnung_benchmark to main-v0.14.1 October 30, 2025 13:53
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/add_absolute_limits_to_benchmark_run branch 2 times, most recently from 0ec0ba0 to 1a0388f Compare October 30, 2025 14:08
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/add_absolute_limits_to_benchmark_run branch from 1a0388f to eba6a02 Compare November 2, 2025 09:04
Copy link
Collaborator

@avi-starkware avi-starkware left a comment

Choose a reason for hiding this comment

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

@avi-starkware reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @AvivYossef-starkware)


crates/bench_tools/src/comparison.rs line 77 at r1 (raw file):

/// If any benchmark exceeds the regression limit or absolute time threshold, returns an error with
/// detailed results. Panics if change file is not found for any benchmark.
pub fn check_regressions(

Add a test where the absolute time threshold is reached

Code quote:

pub fn check_regressions(

crates/bench_tools/src/utils.rs line 71 at r1 (raw file):

/// # Panics
/// Panics if any limit value cannot be parsed as f64.
pub fn parse_absolute_time_limits(args: Vec<String>) -> HashMap<String, f64> {
  1. Add tests
  2. Why not make it pub(crate)?

Code quote:

pub fn parse_absolute_time_limits(args: Vec<String>) -> HashMap<String, f64> {

crates/bench_tools/src/utils.rs line 74 at r1 (raw file):

    let mut limits = HashMap::new();
    for chunk in args.chunks(2) {
        if chunk.len() == 2 {

If the input has an odd number of elements, then the last element will be silently ignored. I think there should be at least a warning in this case.

Code quote:

    for chunk in args.chunks(2) {
        if chunk.len() == 2 {

crates/bench_tools/src/runner.rs line 149 at r1 (raw file):

                    if result.exceeds_regression_limit {
                        println!(
                            "❌ {}: {:+.2}% (EXCEEDS {:.1}% limit)",

To make the format consistent

Suggestion:

                            " ❌ {}: {:+.2}% (EXCEEDS {:.1}% limit)",

crates/bench_tools/src/runner.rs line 161 at r1 (raw file):

                        }
                    }
                    println!();

Suggestion:

                    if result.exceeds_regression_limit {
                        println!(
                            "❌ {}: {:+.2}% (EXCEEDS {:.1}% limit)",
                            result.name, result.change_percentage, regression_limit
                        );
                    }
                    else if result.exceeds_absolute_limit {
                        if let Some(&limit) = absolute_time_ns_limits.get(&result.name) {
                            println!(
                                " ❌ {}: {:.2}ns (EXCEEDS {:.0}ns limit)",
                                result.name, result.absolute_time_ns, limit
                            );
                        }
                    }

@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/add_absolute_limits_to_benchmark_run branch from eba6a02 to 2207e68 Compare November 4, 2025 07:36
Copy link
Contributor Author

@AvivYossef-starkware AvivYossef-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 3 of 6 files reviewed, 4 unresolved discussions (waiting on @avi-starkware)


crates/bench_tools/src/comparison.rs line 77 at r1 (raw file):

Previously, avi-starkware (Avi Cohen) wrote…

Add a test where the absolute time threshold is reached

I tested it manually with #9526
Do you want me to add unitests for it?


crates/bench_tools/src/utils.rs line 71 at r1 (raw file):

Previously, avi-starkware (Avi Cohen) wrote…
  1. Add tests
  2. Why not make it pub(crate)?
  1. added
  2. I use it in the main of the binary; it doesn't have access to the pub (crate) lib utils.

crates/bench_tools/src/utils.rs line 74 at r1 (raw file):

Previously, avi-starkware (Avi Cohen) wrote…

If the input has an odd number of elements, then the last element will be silently ignored. I think there should be at least a warning in this case.

You are right, I added an assert


crates/bench_tools/src/runner.rs line 161 at r1 (raw file):

                        }
                    }
                    println!();

why?
I want to print both if both exceed the limit

Copy link
Collaborator

@avi-starkware avi-starkware left a comment

Choose a reason for hiding this comment

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

@avi-starkware reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @AvivYossef-starkware)


crates/bench_tools/src/comparison.rs line 77 at r1 (raw file):

Previously, AvivYossef-starkware wrote…

I tested it manually with #9526
Do you want me to add unitests for it?

I think we should unit test both limits (can be in another PR).
No need to actually run benchmarks for these tests, just generate the mock estimates and run the function check_regressions.


crates/bench_tools/src/runner.rs line 161 at r1 (raw file):

Previously, AvivYossef-starkware wrote…

why?
I want to print both if both exceed the limit

Oh okay... I missed that flow...
So I think it would be better to put the happy flow as the first case, and then there will be no nested ifs.
Additionally, I think you can remove the println!(); at the end.

Non-blocking

@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/add_absolute_limits_to_benchmark_run branch from 2207e68 to c28ef50 Compare November 4, 2025 13:49
Copy link
Collaborator

@avi-starkware avi-starkware left a comment

Choose a reason for hiding this comment

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

@avi-starkware reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @AvivYossef-starkware)

Copy link
Contributor Author

@AvivYossef-starkware AvivYossef-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @avi-starkware)


crates/bench_tools/src/comparison.rs line 77 at r1 (raw file):

Previously, avi-starkware (Avi Cohen) wrote…

I think we should unit test both limits (can be in another PR).
No need to actually run benchmarks for these tests, just generate the mock estimates and run the function check_regressions.

I'll do it in a different PR


crates/bench_tools/src/runner.rs line 161 at r1 (raw file):

Previously, avi-starkware (Avi Cohen) wrote…

Oh okay... I missed that flow...
So I think it would be better to put the happy flow as the first case, and then there will be no nested ifs.
Additionally, I think you can remove the println!(); at the end.

Non-blocking

I dont understand why happy flow as the first case would help avoiding the nested if.

@AvivYossef-starkware AvivYossef-starkware added this pull request to the merge queue Nov 5, 2025
Merged via the queue into main-v0.14.1 with commit d2daf94 Nov 5, 2025
14 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants