#292 Add sequential stopping rule for benchmark iterations#308
Merged
jathavaan merged 3 commits intoMay 22, 2026
Conversation
6 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a warmup_iterations override to the @monitor benchmarking decorator and applies it to national-scale spatial join entrypoints so long-running benchmarks can run with a single warmup iteration (instead of the default warmup count), reducing wasted wall-clock time on expensive workloads.
Changes:
- Extend
monitor()with an optionalwarmup_iterationsparameter and use it to drive the warmup loop. - Set
warmup_iterations=1for national-scale spatial join entrypoints (DuckDB, PostGIS, Databricks runner) that already opt out of sequential stopping. - Document the warmup override behavior in
README.mdandCLAUDE.md.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/presentation/entrypoints/national_scale_spatial_join_postgis.py | Set warmup_iterations=1 for the PostGIS national-scale join benchmark. |
| src/presentation/entrypoints/national_scale_spatial_join_duckdb.py | Set warmup_iterations=1 for the DuckDB national-scale join benchmark. |
| src/presentation/entrypoints/_databricks_benchmark_runner.py | Set warmup_iterations=1 for the Databricks national-scale join runner. |
| src/application/common/monitor.py | Add warmup_iterations parameter and apply it to the warmup loop/logging. |
| README.md | Document that national-scale entrypoints override warmup to 1 iteration. |
| CLAUDE.md | Update contributor notes to include warmup_iterations=1 guidance for long-running benchmarks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+82
to
+87
| effective_warmup_iterations = ( | ||
| warmup_iterations | ||
| if warmup_iterations is not None | ||
| else Config.BENCHMARK_WARMUP_ITERATIONS | ||
| ) | ||
|
|
This was referenced May 23, 2026
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.
Summary
BenchmarkIterationvalue, hard timeout at 1 hr. Stops when the relative CI half-width drops below 5%. Deterministic bootstrap RNG seeded from(run_id, query_id)so reruns reproduce.use_sequential_stopping=False: fixed 5 iterations, no wall-clock timeout, pluswarmup_iterations=1to keep the warmup cost from dominating long per-iteration runtimes.StopReasonenum (precision,timeout,ceiling,fixed,failed) and metadata columns persisted on every run:achieved_iterations,stop_reason,ci_half_width_seconds,ci_half_width_relative,mean_elapsed_seconds,median_elapsed_seconds.Test plan
stop_reason="precision"andachieved_iterations < 2500inbenchmark_metadata.parquet.national-scale-spatial-join-duckdb-small); verifystop_reason="fixed",achieved_iterations=5, and only 1 warmup line in the logs.stop_reason="fixed"and the new columns populate alongside the existing Spark-phase metrics.BENCHMARK_MAX_TIMED_WINDOW_SECONDSdoes not fire on Databricks or single-machine national-scale runs even when total wall-clock exceeds 1 hr.stop_reason="timeout"plus the cost-metric window still contains data.