Skip to content

Conversation

@mdboom
Copy link
Contributor

@mdboom mdboom commented Jun 26, 2025

No description provided.

@mdboom mdboom requested review from brandtbucher and Copilot June 26, 2025 18:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds support for bisecting using pystats by updating the benchmark collection functions and integrating new command-line flags to drive the bisect process. Key changes include:

  • Updating type hints and default parameters in the collect_pystats function.
  • Renaming and adjusting functions in bisect.py to include new pystats and invert parameters.
  • Modifying the argument parsing logic in bisect.py to support the new bisect mode.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
bench_runner/scripts/run_benchmarks.py Updates to type hints and logic in collect_pystats to run summarize stats only when both fork and ref are provided.
bench_runner/scripts/bisect.py Introduction of new functions and parameters (pystats, invert) to handle pystats bisecting; modification of command-line arguments and function calls to support new behavior.
Comments suppressed due to low confidence (1)

bench_runner/scripts/bisect.py:257

  • Using a string argument to handle a boolean value can be error-prone; consider using an action such as 'store_true' for the --invert flag to simplify the interface.
    parser.add_argument("invert", type=str, choices=["True", "False"])

pass
else:
if individual:
if individual and fork is not None and ref is not None:
Copy link

Copilot AI Jun 26, 2025

Choose a reason for hiding this comment

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

Ensure that the new condition correctly captures all intended cases. If the bisect operation requires both fork and ref to be set, consider documenting the expected behavior to avoid ambiguity.

Suggested change
if individual and fork is not None and ref is not None:
# Ensure both fork and ref are set and valid before proceeding.
if individual and isinstance(fork, str) and fork.strip() and isinstance(ref, str) and ref.strip():
# This ensures that the operation can correctly summarize stats for the given benchmark.
if individual and isinstance(fork, str) and fork.strip() and isinstance(ref, str) and ref.strip():

Copilot uses AI. Check for mistakes.
benchmark_links = []

run_summarize_stats(python, fork, ref, "all", benchmark_links, flags=flags)
if fork is not None and ref is not None:
Copy link

Copilot AI Jun 26, 2025

Choose a reason for hiding this comment

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

[nitpick] This check duplicates the condition logic from earlier; consider centralizing the validation of fork and ref to improve maintainability and reduce potential inconsistencies.

Copilot uses AI. Check for mistakes.
@mdboom mdboom force-pushed the bisect-by-stats branch from d6332fc to 2959655 Compare June 26, 2025 18:44
@mdboom mdboom merged commit d363daf into faster-cpython:main Jun 27, 2025
6 checks passed
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