1name: estimates
3# Runs the parameter grid in scripts/grid.py and caches the results on the
4# `estimates` branch. Each run adds fresh, independent pasts to every cell and
5# rebuilds the pooled means, so repeated runs tighten the error bars.
7on:
8 workflow_dispatch:
9 schedule:
10 # Every two hours, off the top of the hour — GitHub sheds scheduled load at
11 # :00. Only the copy of this file on the default branch is scheduled.
12 - cron: '23 */2 * * *'
14permissions:
15 contents: write
17# One sweep at a time — two concurrent dispatches would race on the push.
18concurrency:
19 group: estimates
20 cancel-in-progress: false
22jobs:
23 sweep:
24 runs-on: ubuntu-latest
25 # Auto-thinning makes the slow-mixing cells legitimately expensive, and a
26 # deep truncation-level draw can add tens of minutes on top; a run that
27 # exceeds the timeout pushes nothing, which is safe but wasted.
28 timeout-minutes: 120
29 steps:
30 - uses: actions/checkout@v4
32 - uses: actions/setup-python@v5
33 with:
34 python-version: '3.12'
36 - run: pip install -e .
38 - name: Check out the estimates branch (creating it if absent)
39 env:
40 GH_TOKEN: ${{ github.token }}
41 run: |
42 set -euo pipefail
43 mkdir -p data
44 cd data
45 git init -q
46 git remote add origin \
47 "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
48 if git fetch -q --depth 1 origin estimates; then
49 git checkout -q -B estimates FETCH_HEAD
50 echo "continuing $(wc -l < runs.jsonl 2>/dev/null || echo 0) cached records"
51 else
52 git checkout -q -b estimates
53 echo "estimates branch does not exist yet — starting it"
54 fi
56 - name: Run the sweep
57 run: python scripts/run_sweep.py --data-dir data
59 - name: Commit and push
60 run: |
61 set -euo pipefail
62 cd data
63 git add -A
64 if git diff --cached --quiet; then
65 echo "nothing to commit"
66 exit 0
67 fi
68 git \
69 -c user.name='github-actions[bot]' \
70 -c user.email='41898282+github-actions[bot]@users.noreply.github.com' \
71 commit -q -m "estimates: run ${GITHUB_RUN_NUMBER} from ${GITHUB_SHA:0:7}"
72 git push -q origin estimates