dtest: add optional --max/--min per-hand timing summary#232
Merged
Conversation
Report min/max ms-per-hand across batches alongside the existing average, so extremes are in the same units as Avg user/sys time. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds optional reporting of per-hand timing extremes (min/max ms-per-hand) across batches in the dtest test driver, so variability is visible alongside the existing average user/sys timing summary.
Changes:
- Extend
TestTimerto track per-batch per-hand min/max for both user and system timings, and allowprint_hands()to write to a caller-provided stream with optional min/max output. - Add
--min/--maxCLI flags and plumb them throughOptionsTypeinto the final timing summary output. - Add GoogleTest coverage for
TestTimerbatch tracking and for--min/--maxargument parsing.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| library/tests/TestTimer.hpp | Adds batch min/max state + new APIs and output options for per-hand reporting. |
| library/tests/TestTimer.cpp | Implements batch recording/min-max tracking and optional min/max printing to a provided stream. |
| library/tests/testcommon.cpp | Passes new --min/--max options into timer.print_hands(). |
| library/tests/test_timer_test.cpp | New unit tests for TestTimer::record() min/max behavior and optional reporting. |
| library/tests/cst.hpp | Extends OptionsType with show_min_ / show_max_ flags. |
| library/tests/BUILD.bazel | Adds test_timer_test and args_test Bazel test targets and excludes them from the non-gtest filegroup. |
| library/tests/args.hpp | Updates args module documentation for the new min/max timing options. |
| library/tests/args.cpp | Adds --min / --max parsing and updates token handling to avoid collisions with existing options. |
| library/tests/args_test.cpp | New unit tests verifying --min / --max parsing behavior. |
Avoid CWD filename collisions when Bazel sandboxes or parallelizes tests. Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid leaving fixed/setprecision sticky on callers that reuse the stream. Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid corrupting cumulative averages and min/max when hands is 0 or negative. Co-authored-by: Cursor <cursoragent@cursor.com>
Make the dependency explicit instead of relying on transitive includes. Co-authored-by: Cursor <cursoragent@cursor.com>
zzcgumn
approved these changes
Jul 16, 2026
zzcgumn
left a comment
Collaborator
There was a problem hiding this comment.
This makes sense. We want to avoid optimisations that look good on average but only help for the most difficult board and increase the time for most boards.
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.
Report min/max ms-per-hand across batches alongside the existing average, so extremes are in the same units as Avg user/sys time.