diff options
| author | eunhhu <[email protected]> | 2026-10-04 14:24:12 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-10-04 14:24:12 +0100 |
| commit | 608221c21edb345e4eeeca85385d2e149c3baa30 (patch) | |
| tree | c221a7083510a7c108419384e9718e355bda5ec2 /research/experiments/033-computing/record.py | |
| parent | 9e587a06d88b01d21ccc7a1cb25dc156b40efcab (diff) | |
| download | pure-608221c21edb345e4eeeca85385d2e149c3baa30.tar.gz pure-608221c21edb345e4eeeca85385d2e149c3baa30.zip | |
Measure 018 stage 2: a graph search in one event, the pairs, and runs to compare across machines (033)
Diffstat (limited to 'research/experiments/033-computing/record.py')
| -rwxr-xr-x | research/experiments/033-computing/record.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/research/experiments/033-computing/record.py b/research/experiments/033-computing/record.py new file mode 100755 index 0000000..7450fa6 --- /dev/null +++ b/research/experiments/033-computing/record.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +"""The pure-runs of aup's checks of docs/design/018 (transients and +computing: the examples routes.aup and numbers.aup against their models), +each recorded by 029's recorded-pure-run, so two machines' records compare +run by run (029's compare.py). + +record.py AUP_ROOT PURE_ROOT OUT.jsonl the checks' report on stdout""" +import importlib.util +import json +import os +import subprocess +import sys +import tempfile +from pathlib import Path + +aup_root, pure_root, out = (Path(a).resolve() for a in sys.argv[1:4]) +subprocess.run(['make', '-s', '-C', str(pure_root), 'build/pure-run'], check=True) +subprocess.run(['make', '-s', '-C', str(aup_root), 'build/aup'], check=True) +out.unlink(missing_ok=True) +os.environ['PURE_RUN'] = str(pure_root / 'build' / 'pure-run') +os.environ['PURE_RUN_LOG'] = str(out) +recorded = pure_root / 'research' / 'experiments' / '029-across-machines' / 'recorded-pure-run' +spec = importlib.util.spec_from_file_location('check', aup_root / 'tests' / 'check.py') +check = importlib.util.module_from_spec(spec) +spec.loader.exec_module(check) +with tempfile.TemporaryDirectory(prefix='aup-check-') as directory: + work = Path(directory) + report = {'transients': check.transients(aup_root / 'build' / 'aup', recorded, work), + 'computing': check.computing(aup_root / 'build' / 'aup', recorded, work)} +print(json.dumps(report)) |
