From 2191deef5441250530aa287cd4d06e140ab31a33 Mon Sep 17 00:00:00 2001 From: Digital Drosophila Archive Date: Thu, 1 Oct 2026 14:31:25 +0800 Subject: [PATCH] Record independent benchmark child exits without scientific retries --- .../launch_job.py | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 models/male-cns-lif/conditioning-acceleration-v1/launch_job.py diff --git a/models/male-cns-lif/conditioning-acceleration-v1/launch_job.py b/models/male-cns-lif/conditioning-acceleration-v1/launch_job.py new file mode 100644 index 0000000..34c677f --- /dev/null +++ b/models/male-cns-lif/conditioning-acceleration-v1/launch_job.py @@ -0,0 +1,36 @@ +"""Write new engineering child-process exit receipts; never retry a job.""" +import argparse +from datetime import datetime, timezone +import json +import os +from pathlib import Path +import re +import subprocess +import time + +p = argparse.ArgumentParser() +p.add_argument('--label', required=True) +p.add_argument('--timeout', type=int, default=900) +p.add_argument('command', nargs=argparse.REMAINDER) +a = p.parse_args() +assert re.fullmatch(r'[a-z0-9-]+', a.label) +assert a.command +out = Path('/home/qishizhe/phase4ar-v100-acceleration-20261001') / 'jobs' +out.mkdir(exist_ok=True) +start = time.perf_counter() +receipt = dict(command=a.command, label=a.label, started_utc=datetime.now(timezone.utc).isoformat(), + original_experiment_resumed=False) +with (out / (a.label + '.start.json')).open('x') as f: + json.dump(receipt, f, indent=2) +with (out / (a.label + '.stdout.log')).open('x') as stdout, (out / (a.label + '.stderr.log')).open('x') as stderr: + try: + result = subprocess.run(a.command, stdout=stdout, stderr=stderr, + env={**os.environ, 'PYTHONDONTWRITEBYTECODE': '1'}, timeout=a.timeout) + receipt.update(exit_code=result.returncode, observed_exit=True, timed_out=False) + except subprocess.TimeoutExpired: + receipt.update(exit_code=None, observed_exit=False, timed_out=True) +receipt.update(wall_seconds=time.perf_counter()-start, finished_utc=datetime.now(timezone.utc).isoformat()) +with (out / (a.label + '.exit.json')).open('x') as f: + json.dump(receipt, f, indent=2) +print(json.dumps(receipt), flush=True) +raise SystemExit(receipt['exit_code'] if receipt['observed_exit'] else 124)