-
Notifications
You must be signed in to change notification settings - Fork 7
Allow for bisecting by pystats #459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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: |
Copilot
AI
Jun 26, 2025
There was a problem hiding this comment.
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.
| 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(): |
| benchmark_links = [] | ||
|
|
||
| run_summarize_stats(python, fork, ref, "all", benchmark_links, flags=flags) | ||
| if fork is not None and ref is not None: |
Copilot
AI
Jun 26, 2025
There was a problem hiding this comment.
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.
No description provided.