Skip to content

Commit 238187f

Browse files
committed
infra: run frozen V142 V135 runtime parity
1 parent 772dfe4 commit 238187f

1 file changed

Lines changed: 72 additions & 37 deletions

File tree

Lines changed: 72 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Trace Ace V141 Runtime Asset Build
1+
name: Trace Ace V142 V135 Runtime Parity
22
on:
33
push:
44
branches: [main]
@@ -9,54 +9,44 @@ permissions:
99
contents: write
1010
actions: read
1111
jobs:
12-
build-v141:
12+
parity:
1313
runs-on: ubuntu-24.04
14-
timeout-minutes: 120
14+
timeout-minutes: 60
1515
steps:
16-
- name: Check out frozen V141 branch
17-
uses: actions/checkout@v4
18-
with:
19-
ref: agent/v141-v135-runtime-assets
20-
- name: Record authoritative V141 run start
21-
shell: bash
16+
- uses: actions/checkout@v4
17+
with: {ref: agent/v142-v135-runtime-parity}
18+
- name: Record V142 run start
2219
run: |
23-
set -euo pipefail
2420
python - <<'PY'
25-
import json, os, pathlib
26-
out={'run_id':int(os.environ['GITHUB_RUN_ID']),'run_attempt':int(os.environ['GITHUB_RUN_ATTEMPT']),'workflow':os.environ['GITHUB_WORKFLOW'],'status':'STARTED'}
27-
pathlib.Path('/tmp/V141_RUN_START.json').write_text(json.dumps(out,indent=2))
28-
print(json.dumps(out,indent=2))
21+
import json,os,pathlib
22+
pathlib.Path('/tmp/V142_RUN_START.json').write_text(json.dumps({'run_id':int(os.environ['GITHUB_RUN_ID']),'status':'STARTED'},indent=2))
2923
PY
3024
git fetch origin main
31-
git worktree add /tmp/v141-start origin/main
32-
cd /tmp/v141-start
25+
git worktree add /tmp/v142-start origin/main
26+
cd /tmp/v142-start
3327
mkdir -p competitions/trace_the_ace/results
34-
cp /tmp/V141_RUN_START.json competitions/trace_the_ace/results/V141_RUN_START.json
28+
cp /tmp/V142_RUN_START.json competitions/trace_the_ace/results/V142_RUN_START.json
3529
git config user.name github-actions[bot]
3630
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
37-
git add competitions/trace_the_ace/results/V141_RUN_START.json
38-
git commit -m "results: record V141 run start $GITHUB_RUN_ID"
39-
git push origin HEAD:main
31+
git add competitions/trace_the_ace/results/V142_RUN_START.json
32+
git commit -m "results: record V142 run start $GITHUB_RUN_ID" || true
33+
git push origin HEAD:main || true
4034
- uses: actions/setup-python@v5
41-
with:
42-
python-version: '3.12'
43-
cache: pip
44-
- name: Install dependencies
45-
run: python -m pip install --disable-pip-version-check numpy pandas scipy scikit-learn gdown
35+
with: {python-version: '3.12', cache: pip}
36+
- run: python -m pip install --disable-pip-version-check numpy pandas scipy scikit-learn gdown
4637
- name: Restore transcript cache
4738
id: tc
4839
uses: actions/cache@v4
4940
with:
5041
path: transcripts.zip
5142
key: trace-ace-transcripts-v1-603547640
52-
- name: Verify frozen transcript cache
43+
- name: Verify cache
5344
run: |
5445
set -euo pipefail
5546
test '${{ steps.tc.outputs.cache-hit }}' = 'true'
5647
test "$(stat -c%s transcripts.zip)" = '603547640'
5748
echo 'e685b85b04694e130c25b17d09cdd1892fbda5e9fa685e98b2300114b915aa2d transcripts.zip' | sha256sum -c -
58-
unzip -tq transcripts.zip >/dev/null
59-
- name: Restore metadata
49+
- name: Restore metadata and transcripts
6050
run: |
6151
set -euo pipefail
6252
gdown 1EpqoamY0vFI2qE57R6wdqU5HwuoVk3Zz -O metadata.zip
@@ -65,16 +55,61 @@ jobs:
6555
unzip -q metadata.zip -d data/meta
6656
echo "FEATURES=$(find data/meta -type f -name 'train_features*.csv' -print -quit)" >> "$GITHUB_ENV"
6757
echo "LABELS=$(find data/meta -type f -name 'train_labels*.csv' -print -quit)" >> "$GITHUB_ENV"
68-
FIRST=$(find data/transcripts -type f -name '*.csv' -print -quit)
69-
test -n "$FIRST"
70-
echo "TRANSCRIPTS=$(dirname "$FIRST")" >> "$GITHUB_ENV"
71-
- name: Build frozen V135 runtime assets
58+
FIRST=$(find data/transcripts -type f -name '*.csv' -print -quit); echo "TRANSCRIPTS=$(dirname "$FIRST")" >> "$GITHUB_ENV"
59+
- name: Download exact V141 assets
60+
env: {GH_TOKEN: '${{ github.token }}'}
61+
run: |
62+
set -euo pipefail
63+
curl -L --fail -H "Authorization: Bearer $GH_TOKEN" -H 'Accept: application/vnd.github+json' https://api.github.com/repos/heathsanchez/mathgraph/actions/artifacts/9489892325/zip -o v141_assets.zip
64+
mkdir -p competitions/trace_the_ace/runtime_v135/assets
65+
unzip -q v141_assets.zip -d competitions/trace_the_ace/runtime_v135/assets
66+
sha256sum v141_assets.zip
67+
test -f competitions/trace_the_ace/runtime_v135/assets/v135_assets.npz
68+
- name: Assemble self-contained runtime
69+
run: |
70+
set -euo pipefail
71+
cd competitions/trace_the_ace
72+
for f in v71_mastery_events.py v75_canonical_trajectory.py v81_target_segment_phase.py v85_evidence_state.py v89_relative_ability_composition.py v94_related_control.py; do cp "$f" runtime_v135/; done
73+
python -m py_compile runtime_v135/*.py
74+
- name: Run exact held-out parity and sample-independence audit
7275
run: |
7376
cd competitions/trace_the_ace
74-
python train_v135_runtime_assets.py --features "../../$FEATURES" --labels "../../$LABELS" --transcripts "../../$TRANSCRIPTS" --out ../../v135_runtime_assets
75-
- name: Upload V141 assets
76-
uses: actions/upload-artifact@v4
77+
python v142_runtime_parity.py --features "../../$FEATURES" --labels "../../$LABELS" --transcripts "../../$TRANSCRIPTS" --runtime runtime_v135 --out ../../v142_parity --rows 512
78+
- name: Pack exact submission ZIP
79+
run: |
80+
set -euo pipefail
81+
mkdir -p submission_v135/assets
82+
cp competitions/trace_the_ace/runtime_v135/main.py submission_v135/
83+
cp competitions/trace_the_ace/runtime_v135/v*.py submission_v135/
84+
cp competitions/trace_the_ace/runtime_v135/assets/v135_assets.npz submission_v135/assets/
85+
cp competitions/trace_the_ace/runtime_v135/assets/manifest.json submission_v135/assets/
86+
(cd submission_v135 && zip -qr ../trace_ace_v135_submission.zip .)
87+
unzip -l trace_ace_v135_submission.zip | tee v142_zip_listing.txt
88+
unzip -Z1 trace_ace_v135_submission.zip | grep -qx 'main.py'
89+
- uses: actions/upload-artifact@v4
7790
with:
78-
name: trace-ace-v141-v135-runtime-assets
79-
path: v135_runtime_assets
91+
name: trace-ace-v142-v135-runtime-candidate
92+
path: |
93+
v142_parity/v142_runtime_parity.json
94+
trace_ace_v135_submission.zip
95+
v142_zip_listing.txt
8096
retention-days: 14
97+
- name: Record V142 completion
98+
if: always()
99+
run: |
100+
python - <<'PY'
101+
import json,os,pathlib
102+
p=pathlib.Path('v142_parity/v142_runtime_parity.json')
103+
out={'run_id':int(os.environ['GITHUB_RUN_ID']),'status':'FINAL','parity':json.loads(p.read_text()) if p.exists() else None}
104+
pathlib.Path('/tmp/V142_RUN_FINAL.json').write_text(json.dumps(out,indent=2))
105+
PY
106+
git fetch origin main
107+
git worktree add /tmp/v142-final origin/main
108+
cd /tmp/v142-final
109+
mkdir -p competitions/trace_the_ace/results
110+
cp /tmp/V142_RUN_FINAL.json competitions/trace_the_ace/results/V142_RUN_FINAL.json
111+
git config user.name github-actions[bot]
112+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
113+
git add competitions/trace_the_ace/results/V142_RUN_FINAL.json
114+
git commit -m "results: record V142 final $GITHUB_RUN_ID" || true
115+
git push origin HEAD:main || true

0 commit comments

Comments
 (0)