Skip to content

CI: rerun studies and fail when committed results drift - #4

Merged
ahrazzle merged 2 commits into
mainfrom
ccr-6718a945-azny78
Nov 18, 2026
Merged

ahrazzle merged 2 commits into
mainfrom
ccr-6718a945-azny78

Conversation

@abu-aska

Copy link
Copy Markdown
Contributor

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 each studies/<name>/ that has measure.py and requirements.txt. Each one gets a fresh virtualenv with its own pinned requirements and runs python measure.py from 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 .gitignore are allowed. On failure it prints git status and 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. PYTHON picks the interpreter.
  • .github/workflows/studies.yml. Runs the script on pull requests and on 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. 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 main it passes ("checked 0 studies"). Once this is merged, any later push to #1 runs the check.

Testing (local)

  • actionlint and shellcheck: clean.
  • main as it is now: checked 0 studies, exit 0.
  • main merged 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.
  • Negative cases, each exits 1 with a clear message:
    • a committed results/totals.csv changed 761 → 760: the diff shows the regenerated 761;
    • measure.py writes an extra output file: reported as untracked;
    • a sanity total changed so measure.py exits 1;
    • a study dir with uncommitted edits;
    • an unknown study name.

Not tested: the workflow on GitHub's runners. This PR's own run will be the first.


Generated by Claude Code

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
ahrazzle marked this pull request as ready for review November 18, 2026 01:15

@ahrazzle ahrazzle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@ahrazzle
ahrazzle merged commit 81c7524 into main Nov 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No automated check that committed study results match a rerun

3 participants