"""Freeze 20 MATH-500 test items; they are not novel to published benchmark.""" import hashlib,json,random,requests from pathlib import Path rev='6e4ed1a2a79af7d8630a6b768ec859cb5af4d3be' url=f'https://huggingface.co/datasets/HuggingFaceH4/MATH-500/resolve/{rev}/test.jsonl' r=requests.get(url,timeout=30);r.raise_for_status(); raw=r.content items=[json.loads(line) for line in raw.splitlines() if line.strip()] if len(items)!=500:raise ValueError(f'Unexpected dataset size: {len(items)}') indices=sorted(random.Random(18012026).sample(range(len(items)),20)) out=Path('experiments/math500_pilot_20.jsonl');out.write_text(''.join(json.dumps({'source_row':i,**items[i]},ensure_ascii=False)+'\n' for i in indices),encoding='utf-8') Path('experiments/math500_pilot_20_manifest.json').write_text(json.dumps({'dataset':'HuggingFaceH4/MATH-500','revision':rev,'source_url':url,'source_sha256':hashlib.sha256(raw).hexdigest(),'selection':'Python random.Random(18012026).sample(range(500),20), then sorted','row_indices':indices,'selection_sha256':hashlib.sha256(out.read_bytes()).hexdigest(),'caveat':'Held out from this session direction discovery; these questions are part of the published benchmark and cannot be claimed unseen by the original authors or model.'},indent=2)) print('Prepared 20 selected rows; no evaluation run.')