Repository navigation
CI: rerun studies and fail when committed results drift - #4
Conversation
scripts/check_studies.sh reruns each studies/<name>/measure.py in a fresh virtualenv with that study's pinned requirements, then fails if any tracked file in the study changed or a new untracked file appeared. The studies workflow runs it on pull requests and pushes to main that touch studies/, and caches tokenizer downloads (studies pin them by revision and hash). Tested locally against main merged with study 01 (PR #1) under Python 3.12: the rerun reproduces every committed file. Edited results, a new output file, a failing sanity check and a dirty study dir each fail the check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012tWK9WEtcSvmKnVgqxEUFn
checkout v5, setup-python v6 and cache v5. The v4/v5 majors target Node 20, which the runners now force onto Node 24 with a warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012tWK9WEtcSvmKnVgqxEUFn
ahrazzle
left a comment
There was a problem hiding this comment.
Review of head 851ed2a, 2 files, 128 additions.
I read scripts/check_studies.sh and .github/workflows/studies.yml in full. The script runs each study in its own fresh virtualenv with its pinned requirements. It fails on a non-zero run, on any tracked change, and on any new untracked file. It refuses a study dir with uncommitted changes.
With no studies present it reports checked 0 studies and exits 0. I ran the script from this head in a scratch repo: checked 0 studies, exit 0, and an unknown study name exits 1 with a clear message.
The workflow runs the script on pull requests and pushes to main that touch studies, the script, or the workflow, and on manual dispatch. It uses Python 3.12, read-only permissions, and cancels superseded runs. Its run on this pull request completed with success.
Limit: the run on this pull request only covers the empty case, since this branch has no studies. The study rerun path rests on the local test in the pull request body, running the script against study 01 merged in. I did not repeat that run here.
amp-sumi
Closes #3.
Adds a check that reruns every study and fails if its committed files drift. This is the "No automated rerun" item from the review of #1.
scripts/check_studies.sh. Finds eachstudies/<name>/that hasmeasure.pyandrequirements.txt. Each one gets a fresh virtualenv with its own pinned requirements and runspython measure.pyfrom inside its directory. The check fails if the run exits non-zero, if any tracked file in the study changes, or if a new untracked file appears. Files covered by.gitignoreare allowed. On failure it printsgit statusand the diff. It refuses to run on a study dir with uncommitted changes, so local runs can't give a false result. You can name studies as arguments.PYTHONpicks the interpreter..github/workflows/studies.yml. Runs the script on pull requests and on pushes tomainthat touchstudies/**, the script or the workflow, and on manual dispatch. It uses Python 3.12, read-only permissions, and cancels superseded runs. It caches the HF hub and tiktoken downloads. That is safe because study 01 pins HF files by revision and sha256, and tiktoken re-checks its BPE hash on every load.The check does not depend on #1. With no studies on
mainit passes ("checked 0 studies"). Once this is merged, any later push to #1 runs the check.Testing (local)
actionlintandshellcheck: clean.mainas it is now:checked 0 studies, exit 0.mainmerged with Study 01: tokenizer waste in ABIOS traffic #1 (48e2f23),PYTHON=python3.12:ok 01-tokenizer-waste: rerun matches the committed files, exit 0, about 20 s with warm caches.results/totals.csvchanged 761 → 760: the diff shows the regenerated 761;measure.pywrites an extra output file: reported as untracked;measure.pyexits 1;Not tested: the workflow on GitHub's runners. This PR's own run will be the first.
Generated by Claude Code