aboutsummaryrefslogtreecommitdiffstats
path: root/research/experiments/012-tail-records/run.py
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-09-27 13:14:38 +0100
committereunhhu <[email protected]>2026-09-27 13:14:38 +0100
commit37d3a1e152707d2da587440c4cea8601b9ef0fd2 (patch)
tree1a4cbea9d8ca636deabd8fc24b0d73cdae2bdaef /research/experiments/012-tail-records/run.py
parent5372d03b5968796515966e2cfc89628d6448f0c1 (diff)
downloadpure-37d3a1e152707d2da587440c4cea8601b9ef0fd2.tar.gz
pure-37d3a1e152707d2da587440c4cea8601b9ef0fd2.zip
Lay Pure out as a core with the parts selected around it
The app model, the tree store and the HTTP host lived in prototypes/connections among the earlier document runtime, the store was known only by its format's name, and Vega compiled six Pure sources by path. Now, as the README's principle has it: core/ runtime, flow and the app model (module*.c), with what the core asks of storage (state.h, store.h) store/ the tree store (PURETRE3, PUREREC1) serve/ pure-serve: HTTP host, outbound delivery, JSON in place cli/ pure-run, pure-edit-module A top-level make builds libpure.a (app model and store, for hosts to link) and the hosts; make check runs the store's and the app model's tests. The earlier runtime still builds from prototypes/connections against core/ and store/ (check, check-tree and check-core pass). Design 009 records the rule: parts by role behind libraries; git repositories split by coupling, so the store stays here while its contract moves with the core, and Vega stays apart.
Diffstat (limited to 'research/experiments/012-tail-records/run.py')
-rwxr-xr-xresearch/experiments/012-tail-records/run.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/research/experiments/012-tail-records/run.py b/research/experiments/012-tail-records/run.py
index 7fc342e..ed8630b 100755
--- a/research/experiments/012-tail-records/run.py
+++ b/research/experiments/012-tail-records/run.py
@@ -18,12 +18,19 @@ from pathlib import Path
HERE = Path(__file__).resolve().parent
ROOT = HERE.parents[2]
-PURE = ROOT / 'prototypes' / 'connections'
+CORE = ROOT / 'core' # the store's headers
+STORE = ROOT / 'store' / 'store-tree.c'
COMMITS = HERE.parent / '010-one-sync-commit' / 'commits.c'
+def stored_at(revision):
+ """Where the tree store was at a revision: store/ now, prototypes/connections/ before."""
+ moved = subprocess.run(['git', '-C', str(ROOT), 'cat-file', '-e', f'{revision}:store/store-tree.c'], capture_output=True)
+ return 'store/store-tree.c' if moved.returncode == 0 else 'prototypes/connections/store-tree.c'
+
+
def build(output, sources):
- subprocess.run(['cc', '-O2', '-std=c17', f'-I{PURE}', '-o', str(output)] + [str(s) for s in sources] + ['-lpthread'],
+ subprocess.run(['cc', '-O2', '-std=c17', f'-I{CORE}', '-o', str(output)] + [str(s) for s in sources] + ['-lpthread'],
check=True)
@@ -37,12 +44,12 @@ def main():
with tempfile.TemporaryDirectory() as work:
work = Path(work)
before = work / 'store-tree-before.c'
- before.write_text(subprocess.run(['git', '-C', str(ROOT), 'show', f'{args.before}:prototypes/connections/store-tree.c'],
+ before.write_text(subprocess.run(['git', '-C', str(ROOT), 'show', f'{args.before}:{stored_at(args.before)}'],
capture_output=True, text=True, check=True).stdout)
build(work / 'probe', [HERE / 'probe.c'])
builds = {'heads in slots': work / 'commits-before', 'heads as records': work / 'commits-after'}
build(builds['heads in slots'], [COMMITS, before])
- build(builds['heads as records'], [COMMITS, PURE / 'store-tree.c'])
+ build(builds['heads as records'], [COMMITS, STORE])
results = {'rounds': []}
for round_ in range(args.rounds):
measured = {'probe': [], 'commits': {}}