m/market labResearch, with a record.
Source on GitHub ↗

benchmark_prepared_checkpoint.py

1"""Supplementary 35-second idle run: exercise the real 30-second checkpoint.23Uses the same declared event rate and thresholds. This is not the short model4gate, and does not reset or relax its acceptance criteria.5"""67import argparse8import json9from pathlib import Path10import tempfile11from time import perf_counter_ns12from unittest.mock import patch13from benchmark_prepared_runtime import ROOT, fixture, run_case, distribution14from sim_platform.execution.coordinator import ExecutionCoordinator151617def main():18    parser = argparse.ArgumentParser(description=__doc__)19    parser.add_argument('--output', type=Path, required=True)20    args = parser.parse_args()21    profile = json.loads((ROOT / 'tools/fixtures/prepared-runtime.json').read_text())22    profile = dict(profile, case_seconds=35, repetitions=1, cases=['idle'])23    samples = []24    original = ExecutionCoordinator.checkpoint_execution2526    def measured(operations, *values, **options):27        started = perf_counter_ns()28        try:29            return original(operations, *values, **options)30        finally:31            samples.append(perf_counter_ns() - started)3233    with tempfile.TemporaryDirectory(prefix='prepared-checkpoint-') as temporary:34        root = Path(temporary)35        source = fixture(root / 'source.bin', profile)36        with patch.object(ExecutionCoordinator, 'checkpoint_execution', measured):37            result = run_case(root / 'app', source, profile, 'idle', 1)38    report = dict(39        profile=profile,40        complete=True,41        passed=result['passed'] and bool(samples),42        case=result,43        periodic_checkpoint=distribution(samples),44        scope='35-second idle run with no intervening financial commit; real checkpoint required',45    )46    args.output.write_text(json.dumps(report, indent=2) + '\n')47    print(json.dumps(report, indent=2), flush=True)484950if __name__ == '__main__':51    main()