Skip to content
This repository was archived by the owner on Nov 21, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions benchmarks/experiments/PUBLISHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,14 @@ One command, the same order every time, refuses by default:
--only-lanes <lanes the stage measured, comma list> \
--exclude-backends <backends still running on mini, comma list> \
[--overlay neo4jvec] [--exclude-since 2026-09-12T12:00] [--preview --pin <commit>] \
[--drop-unless arcadedb_graph_server:l2:oltp:server_http_body_max_bytes=68719476736] \
--message "<one line: what joined>" [--dry-run | --apply]
```

It pulls `runs_page_<pin>.jsonl` (and, with `--overlay`, an arm's dense multipass files at both sizes, always the sparse second-pass files `sparse_mp_<pin>/` when the sparse lane lands (BUGS F148), and always the deployment decomposition's `e4decomp_<pin>/` files, since the `e4` table is a directory of artifacts rather than rows in the log and the export stops without it), drops the rows of the backends named as still running so a stage in progress never reaches the freeze, merges, publishes through the gates, and prints which page tables changed.

**`--drop-unless` drops the rows a repair stage replaced.** `BACKEND:LANE:WORKLOAD:FIELD=VALUE` drops that cell's rows whose FIELD is not VALUE (absent counts as not VALUE), so the old rows go and the repair's rows, which carry the stamp, stay; repeat it for several cells. The 26.10.1 campaign needs it once: qP01 measured ArcadeDB's served graph OLTP at the engine's default bulk-load body limit, which broke the sf10 load, and the repair stage re-ran the cell with the raise stamped as `server_http_body_max_bytes` (DECISIONS #172), so the spec above drops qP01's eight rows and keeps the repair's twelve. A malformed spec ends the run instead of dropping nothing.

**`--only-lanes` scopes a staged landing, and the scope is cumulative.** Rows of every lane not named stay on the host for a later landing, because the gates read the whole freeze and would fail a landing on lanes it was not publishing; empty lands everything. The scope is the lanes named PLUS every lane already on the page, read from the published payload, so a landing adds to the page rather than rebuilding it as though no other lane existed (BUGS F111; PAGE-SPEC.md section 2). Under that sits a refusal: a landing that would make any table on the page disappear is REFUSED and the site's payload restored, because "the page lost a table" is the one diff nobody accepts on purpose. After the merge it also WARNS, without refusing, when a landed lane's rows were measured before a later commit to that lane's own script, and lists the commits: the gates cannot tell a harmless new field from a changed index decision, and an l4 landing once passed every gate with DuckDB rows that predated the index every other arm had (BUGS F98). Without `--apply` it stops there and restores the site's payload; with `--apply` it builds the site, commits both repositories, and pushes. The merge into `runs.jsonl` is idempotent, so a run without `--apply` followed by one with it is the normal sequence.

**`--apply` governs the PUBLISH, not the merge, and `--dry-run` is the flag that writes nothing.** A run without `--apply` still performs steps 2 and 3, and step 3 merges. That reading cost nothing only by luck on 2026-09-19, when a test of an unrelated guard was killed by a closed pipe one step before the merge. Use `--dry-run` to pull, filter, and stop: it prints how many rows WOULD merge and which of them carry errors, and leaves `runs.jsonl` byte-identical. It is also the mode a pre-campaign rehearsal wants -- the rehearsal that found six defects before October's first cell was assembled by hand with `BENCH_RUNS_JSONL` and a scratch log, which nobody should have to reconstruct.
Expand Down
32 changes: 31 additions & 1 deletion benchmarks/experiments/land_stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
--overlay ARM, the dense multipass files mp_<ARM>_b*.json at both sizes);
2. drop rows of the backends still running (--exclude-backends), so a
stage in progress never reaches the freeze; also any row newer than
--exclude-since for those backends only;
--exclude-since for those backends only; and the rows a repair stage
replaced (--drop-unless BACKEND:LANE:WORKLOAD:FIELD=VALUE drops that
cell's rows whose FIELD is not the repair's stamp);
3. merge (merge_campaign.py --from-file --apply);
4. publish through refresh_web_page.py (page-only, no site build here) and
stop unless every gate passed;
Expand Down Expand Up @@ -273,6 +275,26 @@ def step(n, title):
# preview one (see main()).
PIN_DEFAULT = "8d6af9475"

def parse_drop_unless(spec):
"""BACKEND:LANE:WORKLOAD:FIELD=VALUE -> (backend, lane, workload, field, value). A malformed spec ends the run:
a landing that silently dropped nothing would publish the rows the repair replaced."""
try:
backend, lane, workload, cond = spec.split(":", 3)
field, value = cond.split("=", 1)
except ValueError:
raise SystemExit(f"--drop-unless {spec!r}: expected BACKEND:LANE:WORKLOAD:FIELD=VALUE")
if not all((backend, lane, workload, field)):
raise SystemExit(f"--drop-unless {spec!r}: every part must be non-empty")
return backend, lane, workload, field, value


def replaced_by_repair(row, u):
"""True when the row is BACKEND on LANE and WORKLOAD and its FIELD is not VALUE (absent counts as not VALUE)."""
backend, lane, workload, field, value = u
return (str(row.get("backend")) == backend and str(row.get("lane")) == lane
and str(row.get("workload")) == workload and str(row.get(field)) != value)


def main():
# RUN UNDER THE REPOSITORY'S ENVIRONMENT, whatever interpreter started us.
# Every step this script shells out to already uses PY; the one piece that
Expand All @@ -295,6 +317,10 @@ def main():
ap.add_argument("--exclude-since", default="",
help="ISO UTC timestamp; rows of the excluded backends newer than this are dropped "
"(default: every row of those backends)")
ap.add_argument("--drop-unless", action="append", default=[], metavar="BACKEND:LANE:WORKLOAD:FIELD=VALUE",
help="drop the rows of BACKEND on LANE and WORKLOAD whose FIELD is not VALUE (compared as text); "
"repeatable. For rows a repair stage replaced, keyed on the stamp only the repair carries: "
"qP01's served graph OLTP rows lack server_http_body_max_bytes=68719476736 (DECISIONS #172)")
ap.add_argument("--overlay", action="append", default=[],
help="dense multipass arm token to pull at both sizes (e.g. neo4jvec, pgvector)")
ap.add_argument("--message", required=True, help="one-line commit subject for both repos")
Expand Down Expand Up @@ -429,11 +455,15 @@ def main():
excl = {b.strip() for b in args.exclude_backends.split(",") if b.strip()}
lanes = {l.strip() for l in args.only_lanes.split(",") if l.strip()}
rows = [json.loads(l) for l in pulled.read_text().splitlines() if l.strip()]
unless = [parse_drop_unless(x) for x in args.drop_unless]
keep, dropped, other_lane = [], [], []
for r in rows:
if lanes and str(r.get("lane") or "") not in lanes:
other_lane.append(r)
continue
if any(replaced_by_repair(r, u) for u in unless):
dropped.append(r)
continue
be = str(r.get("backend", ""))
hit = any(be == x or be.startswith(x) for x in excl)
if hit and (not args.exclude_since or str(r.get("ts_utc", "")) >= args.exclude_since):
Expand Down
51 changes: 51 additions & 0 deletions benchmarks/experiments/test_land_stage_drop_unless.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
"""land_stage.py --drop-unless: rows a repair stage replaced are dropped at landing, keyed on the stamp only the repair carries.

Run with `python -m pytest test_land_stage_drop_unless.py -q` from this directory.

The 26.10.1 campaign's first stage measured ArcadeDB's served graph OLTP before the bulk-load body limit was raised (DECISIONS
#172); the repair stage re-ran it with the raise, and its rows carry `server_http_body_max_bytes` = 68719476736. The old rows
(six clean sf1 rows and two failed sf10 rows) must not merge: they measured the engine default that broke the load.
"""
import sys
from pathlib import Path

import pytest

HERE = Path(__file__).resolve().parent
sys.path.insert(0, str(HERE))

import land_stage # noqa: E402

SPEC = "arcadedb_graph_server:l2:oltp:server_http_body_max_bytes=68719476736"


def _row(backend="arcadedb_graph_server", lane="l2", workload="oltp", stamp=None):
r = {"backend": backend, "lane": lane, "workload": workload}
if stamp is not None:
r["server_http_body_max_bytes"] = stamp
return r


def test_parse_and_reject_malformed():
assert land_stage.parse_drop_unless(SPEC) == ("arcadedb_graph_server", "l2", "oltp", "server_http_body_max_bytes",
"68719476736")
for bad in ("arcadedb_graph_server:l2:oltp", "a:b:c:field", ":l2:oltp:f=v", "a:b::f=v"):
with pytest.raises(SystemExit):
land_stage.parse_drop_unless(bad)


def test_drops_only_the_unstamped_rows_of_that_cell():
u = land_stage.parse_drop_unless(SPEC)
assert land_stage.replaced_by_repair(_row(), u) # no stamp: replaced
assert land_stage.replaced_by_repair(_row(stamp=104857600), u) # the old default: replaced
assert not land_stage.replaced_by_repair(_row(stamp=68719476736), u) # the repair's rows stay
assert not land_stage.replaced_by_repair(_row(workload="olap"), u) # another workload stays
assert not land_stage.replaced_by_repair(_row(backend="arcadedb_graph_embedded"), u)
assert not land_stage.replaced_by_repair(_row(lane="e2"), u)


def test_the_campaign_shape_keeps_twelve_and_drops_eight():
u = land_stage.parse_drop_unless(SPEC)
rows = [_row() for _ in range(8)] + [_row(stamp=68719476736) for _ in range(12)] + [_row(workload="olap", stamp=68719476736)] * 6
dropped = [r for r in rows if land_stage.replaced_by_repair(r, u)]
assert len(dropped) == 8 and len(rows) - len(dropped) == 18
Loading