| bench round 2: real-world suite results (n=11, 22/22 green) + publishable blog draft + durable push-times joiner 6b67a7e Olivier Girardot 7h ago | 1 | #!/usr/bin/env python3 |
| 2 | """join_push_times.py — build compare.py's --push-times map from push-times.jsonl. |
| 3 | |
| 4 | Joins each collected run (results/<platform>/<run-id>.json, keyed by the |
| 5 | run_id embedded in its records) to its push timestamp via the 7-char short |
| 6 | sha both carry. Emits {"<platform>/<run_id>": "<iso8601>", ...}. |
| 7 | """ |
| 8 | import json, glob, sys |
| 9 | |
| 10 | pushes = {} |
| 11 | for line in open('push-times.jsonl'): |
| 12 | r = json.loads(line) |
| 13 | pushes[(r['platform'], r['sha'][:7])] = r['pushed_at'] |
| 14 | |
| 15 | out = {} |
| 16 | for f in sorted(glob.glob('results/*/*.json')): |
| 17 | recs = json.load(open(f)) |
| 18 | if not recs: |
| 19 | continue |
| 20 | rid, plat = recs[0]['run_id'], recs[0]['platform'] |
| 21 | key = (plat, rid.split('-')[-1]) |
| 22 | if key in pushes: |
| 23 | out[f'{plat}/{rid}'] = pushes[key] |
| 24 | |
| 25 | json.dump(out, open('push-times.json', 'w'), indent=1) |
| 26 | print(f'join_push_times: {len(out)} runs matched') |