Repository navigation
fix(ci): use run_all_json result file names in the selective baseline merge - #220
Open
MaxFreedomPollard wants to merge 1 commit into
Open
MaxFreedomPollard wants to merge 1 commit into
MaxFreedomPollard wants to merge 1 commit into
Conversation
… merge The regression report lists benchmarks by their "benchmark_file" field, which run_all_json.py sets to the script path relative to tests/benchmark (e.g. "experimental/bench_mhc.py"). merge_baseline_selective.py used those paths as file names inside the results directories, but run_all_json.py saves each result as "experimental_bench_mhc_results.json". No source file was ever found, so the merged baseline directory stayed empty, the nightly "Update baseline" step uploaded nothing, and the next run found no baseline and started over from its own results. Map each benchmark to its result file name the way run_all_json.py derives it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Description
The nightly selective baseline merge never copies anything, so the benchmark baseline only survives every other nightly.
check_benchmark_regression.pylists benchmarks in its report by theirbenchmark_filefield, whichrun_all_json.pysets to the script path relative totests/benchmark(bench_softmax.py,experimental/bench_mhc.py).merge_baseline_selective.pyuses those entries as file names inside the baseline and results directories, butrun_all_json.pysaves the results asbench_softmax_results.jsonandexperimental_bench_mhc_results.json. No source file is ever found, somerged-baseline/stays empty while the script exits 0 with "Updated baselines: 0 files", and "Update baseline (nightly only - selective or full)" has nothing to upload. The next nightly then finds nobenchmark-baselineartifact on the latest successful run, skips the regression check, and uploads its own results as a first baseline. The names have never matched: when the merge was added in #15,benchmark_filewas the bare script name and the results file was<stem>_results.json.The Actions history shows the pattern. Of the last 60 tilegym-ci runs on main (Aug 25 to Oct 22), none of the 31 runs where "Merge baseline selectively (nightly only)" ran has a
benchmark-baselineartifact, and all 29 runs where it was skipped have one. For example, run 39420331706 (Oct 20) skipped the merge and uploaded a baseline, then runs 39597578834 and 39776384161 (Oct 21 and 22) ran the merge and uploaded none. As a result, main is only checked for regressions every other night, PR builds have no baseline about half the time, and a regressed benchmark never keeps its old baseline.The fix maps each report entry to its results file name the way
run_all_json.pyderives it (/becomes_,.pybecomes_results.json). The rule is repeated rather than imported because the aggregate job checks out only.github/scripts. The report format and the checker are unchanged.Testing (CPU only):
test_merge_keeps_old_baseline_only_for_regressed_filesto.github/infra_tests/test_selective_baseline_merge.py. It lays out results the wayrun_all_json.pydoes (including a benchmark underexperimental/), runs the checker and the merge, and checks that the regressed benchmark keeps the old file, the improved one takes the new file, andall_benchmarks.jsonis rebuilt from them. It fails on main withFileNotFoundErrorbecause the merged directory is empty, and passes with this change.pytest .github/infra_tests/passes (63 tests).run_all_json.pyon two dummy benchmark scripts (bench_alpha.py,experimental/bench_beta.py) for a baseline and a second run with alpha 20% slower and beta 20% faster, then ran the two scripts with the same arguments as the workflow. Before, the merge wrote nothing. After,bench_alpha_results.jsoncame from the old baseline,experimental_bench_beta_results.jsonfrom the new run, and a check against the merged directory still flags alpha.ruff check --select I .,ruff format --check ., the SPDX header check and the whitespace and end-of-file hooks pass on the changed files.The merge step runs only on nightly builds, so PR CI can't exercise it end to end.
CI Configuration
Checklist
./format.sh)🤖 Generated with Claude Code