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/download_bench_input_from_gcs branch from 8c45c2b to e8bee92 Compare October 19, 2025 13:54
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/run_benchmark branch 2 times, most recently from 105f5d2 to ba16848 Compare October 20, 2025 06:26
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/download_bench_input_from_gcs branch from e8bee92 to b08f3ba Compare October 20, 2025 06:26
@AvivYossef-starkware AvivYossef-starkware marked this pull request as ready for review October 20, 2025 06:28
@avi-starkware
Copy link
Collaborator

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

        if !local_path.exists() {
            panic!("Input directory does not exist: {}", local_dir);
        }

If input_dir is Some, then it is never used. This function just checks that the directory exists, but run_benchmarks doesn't do anything with that directory other than that, and it is not copied into bench.input_dir.

Code quote:

    if let Some(local_dir) = input_dir {
        let local_path = PathBuf::from(local_dir);
        if !local_path.exists() {
            panic!("Input directory does not exist: {}", local_dir);
        }

@github-actions
Copy link

github-actions bot commented Oct 22, 2025

Benchmark movements: tree_computation_flow performance improved 😺 tree_computation_flow time: [13.345 ms 13.494 ms 13.660 ms] change: [-9.0732% -7.4423% -5.7610%] (p = 0.00 < 0.05) Performance has improved. Found 5 outliers among 100 measurements (5.00%) 2 (2.00%) high mild 3 (3.00%) high severe

@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/download_bench_input_from_gcs branch from f388830 to 735532c Compare October 22, 2025 06:32
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/run_benchmark branch 2 times, most recently from 54b91d3 to 8ac0dc3 Compare October 22, 2025 06:42
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/download_bench_input_from_gcs branch from 735532c to 5a4ffef Compare October 22, 2025 06:42
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/download_bench_input_from_gcs branch from 5a4ffef to f0efaf3 Compare October 22, 2025 06:45
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/download_bench_input_from_gcs branch 2 times, most recently from 25cb964 to cc95451 Compare October 22, 2025 07:06
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: 0 of 11 files reviewed, 1 unresolved discussion (waiting on @avi-starkware and @meship-starkware)


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

Previously, avi-starkware (Avi Cohen) wrote…

If input_dir is Some, then it is never used. This function just checks that the directory exists, but run_benchmarks doesn't do anything with that directory other than that, and it is not copied into bench.input_dir.

you absolutly right, thanks

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: 1 of 11 files reviewed, 3 unresolved discussions (waiting on @avi-starkware and @meship-starkware)


Cargo.toml line 256 at r3 (raw file):

Previously, avi-starkware (Avi Cohen) wrote…

Note that adding new external dependencies is discouraged and requires special approval.

I can do something like that
, but fs extra is a popular crate and I prefer to use it.
I'll ask for permission


/// Recursively copies the contents of a directory to another directory.
fn copy_dir_contents(src: &Path, dst: &Path) -> std::io::Result<()> {
    for entry in fs::read_dir(src)? {
        let entry = entry?;
        let src_path = entry.path();
        let dst_path = dst.join(entry.file_name());

        if src_path.is_dir() {
            fs::create_dir_all(&dst_path)?;
            copy_dir_contents(&src_path, &dst_path)?;
        } else {
            fs::copy(&src_path, &dst_path)?;
        }
    }
    Ok(())
}

crates/bench_tools/src/runner.rs line 40 at r4 (raw file):

Previously, avi-starkware (Avi Cohen) wrote…

Three issues:

  1. This will panic if local_dir == benchmark_input_dir which is unexpected behavior.
  2. This recursive copy is blocking, so doesn't work well with your async runtime.
  3. Is the new external dependency necessary?
  1. Thanks, fixed
  2. We removed async
  3. We don't have to use it, but I think that we should.

crates/bench_tools/src/runner.rs line 67 at r4 (raw file):

Previously, avi-starkware (Avi Cohen) wrote…

why do you copy all files for each benchmark you run?
Why not just the files related to _bench?

Thanks,
fixed in #9742

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 6 files at r6, all commit messages.
Reviewable status: 6 of 11 files reviewed, 2 unresolved discussions (waiting on @AvivYossef-starkware and @meship-starkware)


Cargo.toml line 256 at r3 (raw file):

Previously, AvivYossef-starkware wrote…

I can do something like that
, but fs extra is a popular crate and I prefer to use it.
I'll ask for permission


/// Recursively copies the contents of a directory to another directory.
fn copy_dir_contents(src: &Path, dst: &Path) -> std::io::Result<()> {
    for entry in fs::read_dir(src)? {
        let entry = entry?;
        let src_path = entry.path();
        let dst_path = dst.join(entry.file_name());

        if src_path.is_dir() {
            fs::create_dir_all(&dst_path)?;
            copy_dir_contents(&src_path, &dst_path)?;
        } else {
            fs::copy(&src_path, &dst_path)?;
        }
    }
    Ok(())
}

If you get approval, I won't block you from using it, but I don't think it is a good idea to introduce a new external dependency instead of adding this function. (Unless the external crate is somehow much more efficient, or has other benefits.)

Your call anyway - non-blocking


crates/bench_tools/src/runner.rs line 40 at r4 (raw file):

Previously, AvivYossef-starkware wrote…
  1. Thanks, fixed
  2. We removed async
  3. We don't have to use it, but I think that we should.

Why is 1 fixed?
You need to handle the AlreadyExists error to avoid panicking in this case

@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/download_bench_input_from_gcs branch from befb523 to 1286c9b Compare October 28, 2025 06:31
@graphite-app graphite-app bot changed the base branch from aviv/download_bench_input_from_gcs to graphite-base/9636 October 28, 2025 07:18
@AvivYossef-starkware AvivYossef-starkware changed the base branch from graphite-base/9636 to aviv/copy_dir_rec October 28, 2025 08:21
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: 2 of 12 files reviewed, 2 unresolved discussions (waiting on @avi-starkware and @meship-starkware)


Cargo.toml line 256 at r3 (raw file):

Previously, avi-starkware (Avi Cohen) wrote…

If you get approval, I won't block you from using it, but I don't think it is a good idea to introduce a new external dependency instead of adding this function. (Unless the external crate is somehow much more efficient, or has other benefits.)

Your call anyway - non-blocking

I removed it


crates/bench_tools/src/runner.rs line 40 at r4 (raw file):

Previously, avi-starkware (Avi Cohen) wrote…

Why is 1 fixed?
You need to handle the AlreadyExists error to avoid panicking in this case

I forgot to push.
but now the new func does nothing if its he same

@graphite-app
Copy link

graphite-app bot commented Oct 29, 2025

Merge activity

  • Oct 29, 7:56 AM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.

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 6 files at r7, 1 of 1 files at r8, all commit messages.
Reviewable status: 6 of 12 files reviewed, all discussions resolved (waiting on @meship-starkware)

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 4 of 11 files at r2.
Reviewable status: 10 of 12 files reviewed, all discussions resolved (waiting on @meship-starkware)

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 2 of 6 files at r7.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @meship-starkware)

@AvivYossef-starkware AvivYossef-starkware added this pull request to the merge queue Oct 29, 2025
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.

:lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @meship-starkware)

Merged via the queue into main-v0.14.1 with commit b3511f0 Oct 29, 2025
14 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 1, 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