From fc76577dcb8100ba1953b5c2f84778591a887d8e Mon Sep 17 00:00:00 2001 From: Taewoon Kim Date: Thu, 22 Oct 2026 08:05:50 +0900 Subject: [PATCH 1/2] make_2611_stages: ArcadeDB pair guards only where an ArcadeDB arm runs, and every ABORT hands on A comparator stage guarded on the pinned wheel in dist/ and on dbbench:arcadedb although none of its arms uses either, and the ALL-DONE trap was set after those guards, so a guard failing before the START line stranded the rest of the chain. The pair's guards now belong to the stages that run an ArcadeDB arm (the --arcadedb-release pass), the trap is set right after the wait, --check --drafts lints both rules, and the stored draft sha list is rewritten. Closes #439 Co-Authored-By: Claude Sonnet 5.5 --- benchmarks/experiments/CAMPAIGN.md | 3 +- benchmarks/experiments/make_2611_stages.py | 131 ++++++++++++------ .../experiments/stage_drafts_2611.sha256 | 62 ++++----- benchmarks/experiments/test_jpype_pin.py | 34 +++-- .../experiments/test_stage_generator_2611.py | 75 ++++++++++ 5 files changed, 220 insertions(+), 85 deletions(-) diff --git a/benchmarks/experiments/CAMPAIGN.md b/benchmarks/experiments/CAMPAIGN.md index e99e944d11b..5198811324f 100644 --- a/benchmarks/experiments/CAMPAIGN.md +++ b/benchmarks/experiments/CAMPAIGN.md @@ -214,7 +214,7 @@ Rules every campaign keeps: | 70 | The TimescaleDB time-series arm runs `ANALYZE p` after its `(host, ts DESC)` index, inside its ingest timer, as the plain PostgreSQL arm does | TimescaleDB, the time-series lane only | **owed at the re-pin, done on repin-prep-2 (2026-10-06, the user's decision), now on main**: `l4_tsbs.py`. October's TimescaleDB l4 ingest rows (417314c18) were measured WITHOUT the ANALYZE and stay as measured | `test_ingest_prose.py`; `test_l4_analyze.py` | | 71 | The served graph arm over Bolt in place of HTTP | ArcadeDB served, the graph arm only | **decided against (DECISIONS #162 item 2)**: with the lean HTTP client (row 72) one bound read costs 121 us over HTTP against 171 to 194 us over Bolt, and upstream's question on which protocol a Python client should use (ArcadeData/arcadedb#9165) is unanswered; the branch `levers-served-bolt` (`21a6ffd47e`) stays unmerged and off by default | `.notes` repros/levers-audit-20261006/LEVERS.md | | 72 | Every ArcadeDB SERVED arm that talks HTTP uses one persistent `http.client` connection per host (`lean_http.py`) in place of `requests.Session` | every ArcadeDB served arm that posts to the server; no comparator client moves | built (the maintainer's decision, DECISIONS #162 item 1); rows record `arcadedb_http_client` (the headline client and the lean sensitivity twin are described under row 82); `test_lean_http.py`, `test_lean_http_live.py`, `test_e4_client_axis.py`. **Owed at the re-pin:** the e4 stage re-runs, and the page prose around the table (its caption and the "wire format" paragraph) is rewritten from the new columns. October's served rows (417314c18) carry no `arcadedb_http_client` | `.notes` repros/levers-audit-20261006/LEVERS.md | -| 73 | JPype is pinned to 1.7.1 in the benchmark images and recorded per row; reason and the measurement: `.notes/bench/repros/jpype-master-check-20261006/`. The wheel declares `jpype1>=1.5.0` with no upper bound, so an image rebuilt on the day of a JPype release would change the instrument in the middle of a run | every embedded ArcadeDB arm and the host-side Python-cost stage | **built (on main), owed at the re-pin**: `bench_common.JPYPE_PIN` and `Dockerfile.bench`'s `ARG JPYPE_VERSION=1.7.1`; every generated stage reads JPype back out of `dbbench:arcadedb` and aborts if it differs; rows record `jpype_version`; `test_jpype_pin.py`. Moving the pin is a deliberate edit of `JPYPE_PIN` and the Dockerfile default between campaigns, never an image rebuild | jpype#1379 | +| 73 | JPype is pinned to 1.7.1 in the benchmark images and recorded per row; reason and the measurement: `.notes/bench/repros/jpype-master-check-20261006/`. The wheel declares `jpype1>=1.5.0` with no upper bound, so an image rebuilt on the day of a JPype release would change the instrument in the middle of a run | every embedded ArcadeDB arm and the host-side Python-cost stage | **built (on main), owed at the re-pin**: `bench_common.JPYPE_PIN` and `Dockerfile.bench`'s `ARG JPYPE_VERSION=1.7.1`; every generated stage that runs an ArcadeDB arm reads JPype back out of `dbbench:arcadedb` and aborts if it differs; rows record `jpype_version`; `test_jpype_pin.py`. Moving the pin is a deliberate edit of `JPYPE_PIN` and the Dockerfile default between campaigns, never an image rebuild | jpype#1379 | | 74 | The wheel the 26.10.1 measurement runs on carries the call-overhead change of bindings PR #214 (`fabbda7ab7`) and the columnar insert (row 63) | ArcadeDB embedded arms only | built and verified (2026-10-06): the stages bake a wheel built from this tree (commit `8989cbb0e8`) over the official 26.10.1 jars, sha256 `83a2a40369a411622696aed77361fd3b1c3d23b675d0a784b38b0b022c13c41b` (`PAIR VERIFIED d36b4ca3a`). It is NOT the file PyPI holds for the bindings 26.10.1 release; the page's note on what the Python package costs should name the change when it lands | #214's own A/B (laptop, relative only) | | 75 | The served ArcadeDB arms that bulk-load through `POST /api/v1/batch` run with `-Darcadedb.server.httpBodyContentMaxSize=68719476736` (64 GiB) in place of 26.10.1's default of 100 MiB | ArcadeDB served only: the graph arm (l2, restart lane) and the cross-model arm (e2) | built and verified on the laptop (2026-10-07), on main: `runner.py` (`HTTP_BODY_MAX_OPT`), `override_registry.py` (`arcadedb_http_body_limit`), PROTOCOL.md section 7, `test_overrides.py`. Mini picks it up at its next `git pull`, which is the user's to time | the 26.10.1 sf10 served graph cell failed rep 1; `.notes/bench/repros/served-body-limit-20261006/` | | 76 | **`pgvector==0.5.0` and `neo4j-rust-ext==6.3.1.0` go into the `client` image (DECISIONS #173, #174).** In `build_images.sh`, the `[client]=` line: `neo4j==6.3.1` becomes `neo4j==6.3.1 neo4j-rust-ext==6.3.1.0` and `pgvector==0.5.0` is appended; register both in the COMPARATORS.md pin table. The harness side is on main and waits for the image: `l3d_dense.PgVector.connect` and `e2_hybrid.PgAgeE2.__init__` import `pgvector.psycopg` lazily (a cell on an image without the package fails at connect with ImportError, by design), and `neo4j-rust-ext` is a one-`.so` overlay that needs no code. The same PR moved `PostgresTPC` (and `postgres_tuned`) to autocommit for single statements, the pgvector dense and cross-model product loads to binary COPY, and the six QuestDB reads to `binary=True` (PROTOCOL.md section 7) | the `client` image: comparators only; no ArcadeDB arm, no tier 1 stage | **code built, image rebuild pending; lands at the tier 1 to tier 2 boundary of the 26.10.1 measurement (qP10 rebuilds the client image at its start)**, between qP09's ALL-DONE and qP10's first cell, never inside a running stage: rebuild, `verify_pair`, `queue_lint`, then check inside the image that `neo4j.RUST_AVAILABLE` is True and `import pgvector.psycopg` works before the first cell; the image digest change is expected and recorded | Row 76 is the rebuild; the code half is the PR that added it. Rows stamped by #173 (`neo4j_rust_ext`, `redis_hiredis`, `es_json_serializer`) land in the same rebuild | @@ -241,6 +241,7 @@ The detail behind item 8: **The next campaign's stages are generated by `make_2611_stages.py`.** One template carries every guard the campaign learned (cap table, shadowed definitions, budgets against the cap, whole-cell cost, images present and current, comparator digests frozen at generation, the JPype pin read out of the image, the pinned wheel by sha256, the cap rule, the ALL-DONE trap); the instrument, `REPS` and the banner are its parameters. The generator selects the multi-model subset. The subset is `ENGINES` in the file: ArcadeDB (embedded and served), SurrealDB (embedded and served), ArangoDB, Memgraph, PostgreSQL with pgvector, AGE and TimescaleDB (and plain PostgreSQL where a lane uses it), MongoDB with MongoDB Search, DuckDB with VSS and DuckPGQ, SQLite with sqlite-vec, the composed Qdrant plus Neo4j stack, Neo4j and Qdrant on their own (graph and dense; sparse on the second list), and LadybugDB on every lane it supports. Every registered arm is either in the subset or in `OUTSIDE`, so a newly registered arm forces a decision (`--check`). The core lanes are graph (interactive and analytics), cross-model, documents and dense; `--second-list` adds lifecycle, then sparse and time series, after them. TimescaleDB runs whenever the time-series lane does; `--without-timescaledb` leaves it out. Every generated stage exports `BENCH_INSTRUMENT=2026-11` before its first Python call, reads the selection back from `bench_common` and aborts if the tree does not select it, writes `runs_page__2611.jsonl` (and overlay directories with the same suffix) so one rows file never holds two instruments, and fixes `REPS` at generation (`--reps`, default 3, at most 5). The generator re-executes itself with the variable set and refuses a different value in the environment. `land_stage.py` reads only 2026-10 rows today, so landing the new rows is a change of its own, made when the first 2026-11 tables land. The comparators are the default mode and run on the release pair already installed (`ARCADEDB_WHEEL`, `ARCADEDB_SERVER_IMAGE`, `ARCADEDB_ENGINE_COMMIT`): `python3 make_2611_stages.py --second-list --after --id-prefix qS --out DIR`. `--after` is required (a stage id, or `none`), and each stage then waits for the previous one with `grep -qx " ALL-DONE"`. The ArcadeDB pass is `--arcadedb-release X.Y.Z` with `--engine-commit`, `--image-digest sha256:...`, `--wheel-name`, `--wheel-sha256` and `--wheel-url`; it refuses unless all five are given, because the release may not exist when the drafts are made. It writes `00`, the pair install (official image by digest, wheel by sha256, `build_matched_pair.sh`, `verify_pair_c25.sh`), and ArcadeDB's lane stages behind it. +The ArcadeDB pair's guards (the pinned wheel by name and sha256 and the only wheel in `dist/`, the server image, the wheel and JPype read back out of `dbbench:arcadedb`, `verify_pair_c25.sh`) are in the stages that run an ArcadeDB arm and only those: a comparator stage needs neither the wheel nor `dbbench:arcadedb`, and exports `ARCADEDB_WHEEL`, `ARCADEDB_SERVER_IMAGE` and `ARCADEDB_ENGINE_COMMIT` only as the label its rows carry (after its image build, so no image bakes the engine under test). Every ABORT hands on: the `ALL-DONE` trap is set right after the wait, before the first guard, so a stage that aborts before its START line still writes its marker and the next stage runs (its own guards then run too). The ABORT line is in `STATUS.txt`, where `mini_watch.sh` reports it; to resume, fix the cause and run the aborted stage's script again by hand after the chain, and landing reads only the rows that exist. `make_2611_stages.py --check --drafts DIR` lints both rules. The default order is the core block first, then the second list. Inside the core block the large tiers (deep10m, tpch10, the full SF1 network) run after the small ones, and the cells that dominate the hours (Memgraph's deep10m dense cells, SurrealDB's documents at tpch1, the full SF1 network's analytics) run last of all in stages of their own, where they are easiest to drop if time runs short; `BIGGEST` in the file names them, and `--order paper` keeps the table order. Splitting moves stage boundaries only, and `--check` proves the cells are the same. `--project TABLE` prints projected hours per drafted stage from a per-cell hours table (tab separated: lane, workload, scale, backend, class, hours at 3 repetitions, hours at 5 repetitions; a cell with no clean rep carries its one failed attempt). `--check --drafts DIR` lints written scripts: the instrument exported and never 2026-10, the 2611 rows file, only subset arms, each stage waiting for the one before it. Drafts are written to a folder outside the tree and copied to the bench host by hand on the owner's go. Which stage is running is state, not method: it is in `STATUS.txt`'s tail and in HANDOFF, never here. `test_stage_generator_2611.py` holds the written drafts byte for byte against `stage_drafts_2611.sha256`, so a stage cannot move without the list changing in the same commit. **What a stage costs is projected from its components, never from an uplift.** Multiplying the previous campaign's cells by an assumed per-lane uplift goes wrong in both directions: a larger query set lengthens a stage several times over, and a stage that runs fewer workloads than the cells it is priced from runs shorter. Project each cell from its measured ingest, first touches, and budget ceiling, as `cell_cost_check` does, and replace a stage's projection with its measured cost once it runs. The current projection lives in HANDOFF. diff --git a/benchmarks/experiments/make_2611_stages.py b/benchmarks/experiments/make_2611_stages.py index ab8882eac68..7085a2bcf62 100644 --- a/benchmarks/experiments/make_2611_stages.py +++ b/benchmarks/experiments/make_2611_stages.py @@ -558,10 +558,20 @@ def lint_draft(text, name, engines=None): out.append(f"{name}: does not export BENCH_INSTRUMENT={INSTRUMENT}") if re.search(r"runs_page_\$\{PIN\}\.jsonl", text) or f"runs_page_${{PIN}}{ROWS_SUFFIX}.jsonl" not in text: out.append(f"{name}: writes a rows file that is not runs_page_{ROWS_SUFFIX}.jsonl") + first_abort = text.find('$ID ABORT') + if first_abort >= 0 and not 0 <= text.find("ALL-DONE\" >> \"$S\"' EXIT") < first_abort: + out.append(f"{name}: a guard can ABORT before the ALL-DONE trap is set, which strands every stage waiting on this one") m = _BACKENDS.search(text) if not m: out.append(f"{name}: no BACKENDS line") else: + arcade = has_arcadedb_arm(m.group(1).split()) + for needle, what in (("is not the wheel this chain was generated for", "the pinned wheel in dist/"), + ("ABORT: dbbench:arcadedb carries wheel", "the dbbench:arcadedb wheel check")): + if arcade and needle not in text: + out.append(f"{name}: runs an ArcadeDB arm but has no guard for {what}") + if not arcade and needle in text: + out.append(f"{name}: runs no ArcadeDB arm but guards {what}, so a host still on the previous release aborts it") for b in m.group(1).split(): eng = engine_of(b) if eng is None: @@ -737,6 +747,66 @@ def seed(m): return re.sub(r"\nfor BE in \$BACKENDS; do\n", seed, body) +# THE ARCADEDB PAIR'S GUARDS, in the stages that contain an ArcadeDB arm (and only those). A stage whose roster is comparators +# needs neither the pinned wheel in dist/ nor dbbench:arcadedb: its arms run in the digest-pinned images and dbbench:duckdb, +# client, dense, pg-age, mongo-search and composed, none of which import arcadedb_embedded. Guarding them anyway aborted a +# healthy comparator stage on a host whose dist/ and dbbench:arcadedb were still the previous release's. +ARCADE_PRE_BUILD = '''# THE WHEEL IS BAKED AT IMAGE BUILD TIME, so it has to be exported BEFORE +# build_images.sh, and the arcadedb image has to be rebuilt. Without both, +# build_images.sh falls back to `arcadedb-embedded==26.8.1` from PyPI and +# every EMBEDDED arm runs that while every SERVED arm runs the pinned image: +# two ArcadeDB versions on one table. That is exactly what last night's +# calibration did -- its embedded arms ran 26.8.1 against served +# 26.9.1-SNAPSHOT -- and verify_pair_c25.sh does not catch it, because it +# compares the newest wheel FILE in dist/ against the server image and never +# looks inside dbbench:arcadedb. +# THE RELEASE PAIR THIS CHAIN WAS GENERATED FOR, named rather than found +# (DECISIONS #42). A different file in dist/ is a different engine under test. +W="$REPO/bindings/python/dist/{wheel_name}" +[ -f "$W" ] || {{ say "$ID ABORT: the pinned wheel {wheel_name} is not in dist/"; exit 1; }} +# ONE WHEEL, OR SAY WHICH. `ls -t | head -1` takes the newest by mtime and +# says nothing about the ones it passed over, so a second wheel in dist/ -- +# a rebuild at a different pin, a copy kept "just in case" -- silently +# decides what every cell of this stage measures. dist/ holds exactly one +# today; the guard is here because the day it holds two is the day nobody +# notices. Refusing rather than warning: this picks the ENGINE UNDER TEST. +_NW=$(ls "$REPO"/bindings/python/dist/*.whl 2>/dev/null | wc -l) +[ "$_NW" -eq 1 ] || {{ say "$ID ABORT: $_NW wheels in dist/, and ls -t would pick one by date: $(ls "$REPO"/bindings/python/dist/*.whl | tr ' +' ' ')"; exit 1; }} +[ "$(sha256sum "$W" | cut -d' ' -f1)" = "{wheel_sha256}" ] || {{ say "$ID ABORT: dist/{wheel_name} is not the wheel this chain was generated for (sha256)"; exit 1; }} +export ARCADEDB_WHEEL="$W" ARCADEDB_SERVER_IMAGE="{server_image}" +docker image inspect "$ARCADEDB_SERVER_IMAGE" >/dev/null 2>&1 || {{ say "$ID ABORT: no server image $ARCADEDB_SERVER_IMAGE"; exit 1; }} +WV=$(basename "$W" | cut -d- -f2) +''' + +ARCADE_POST_CHECKS = '''# VERIFY THE ARM, NOT THE FILE: read the version out of the built image. +# The pair check below is the REPO copy, not ~/verify_pair_c25.sh: that +# one is a stale copy from 2026-08-30 and would miss its own fourth +# check. A script pulled with the tree cannot drift from it. +IV=$(docker run --rm --entrypoint python3 dbbench:arcadedb -c 'import importlib.metadata as m; print(m.version("arcadedb-embedded"))' 2>/dev/null | tr -dc "0-9a-zA-Z.-") +[ "$IV" = "$WV" ] || {{ say "$ID ABORT: dbbench:arcadedb carries wheel $IV, dist has $WV"; exit 1; }} +say "$ID: dbbench:arcadedb carries wheel $IV, matching dist" +IJ=$(docker run --rm --entrypoint python3 dbbench:arcadedb -c 'import jpype; print(jpype.__version__)' 2>/dev/null | tr -dc "0-9a-zA-Z.-") +[ "$IJ" = "{jpype_version}" ] || {{ say "$ID ABORT: dbbench:arcadedb runs JPype '$IJ', the pin is {jpype_version} (Dockerfile.bench, ARG JPYPE_VERSION); rebuild dbbench:arcadedb, which installs the pin"; exit 1; }} +say "$ID: dbbench:arcadedb runs JPype $IJ, the pin" +PAIR_IMAGE="$ARCADEDB_SERVER_IMAGE" ./verify_pair_c25.sh "$SHA" >> "$S" 2>&1 || {{ say "$ID ABORT: pair unverified at the pin"; exit 1; }} +''' + +# What a comparator-only stage does in their place. runner.py takes ARCADEDB_WHEEL and ARCADEDB_SERVER_IMAGE together or not +# at all, and refuses ARCADEDB_ENGINE_COMMIT without them, while land_stage.py keeps only the rows whose engine_commit starts +# with the chain's pin: so the three are still exported, as the label the rows carry. They are exported AFTER the image build, +# because build_images.sh bakes ARCADEDB_WHEEL into every generic image it builds (client, duckdb, dense), and a comparator +# image has no use for the engine under test. Nothing here reads dist/ or dbbench:arcadedb. +COMPARATOR_PRE_BUILD = "# (no ArcadeDB arm in this stage: no wheel in dist/ and no dbbench:arcadedb needed, see make_2611_stages.ARCADE_PRE_BUILD)" +COMPARATOR_STAMP_EXPORTS = '''# ROW LABEL ONLY, nothing is read from these: see make_2611_stages.COMPARATOR_STAMP_EXPORTS. +export ARCADEDB_WHEEL="$REPO/bindings/python/dist/{wheel_name}" ARCADEDB_SERVER_IMAGE="{server_image}"''' + + +def has_arcadedb_arm(backends): + """True when the stage runs an ArcadeDB arm (embedded or served), which is when the pair's guards apply.""" + return any(engine_of(b) == "arcadedb" for b in backends) + + # The stage script. Braces are doubled where bash needs one. The parameters that change with the instrument are the instrument # itself ({instrument}), the repetitions ({reps}), the rows file suffix ({rows_suffix}) and the banner ({banner}); the rest is # per stage (stage_script) or per release pair. @@ -765,6 +835,13 @@ def seed(m): REPS={reps} # fixed at generation (make_2611_stages --reps) say() {{ echo "[$(date -Is)] $*" >> "$S"; }} {wait} +# AN ABORT MUST NOT STRAND THE CHAIN. Every ABORT hands on (the convention of the qMA stages: "an EXIT trap set after the wait +# writes its own marker, so ABORT/SKIP still hand on"). This trap used to be set after the guards, so a guard that failed +# before the START line exited without a marker and the stages waiting on this one waited forever -- which is what happened +# on 2026-09-20 when a guard of mine aborted a healthy stage and left the host idle. Set from here on, the marker is written +# whatever happens: the ABORT is already in STATUS.txt and loud (mini_watch.sh greps it), and the rest of the campaign is worth +# more than making a human notice sooner. It is set after the wait, so a waiter that is killed does not hand on. +trap 'echo "$ID ALL-DONE" >> "$S"' EXIT cd "$REPO" && git pull -q --ff-only || {{ say "$ID ABORT: pull"; exit 1; }} cd "$R" || exit 1 export PATH=$HOME/.local/bin:$PATH @@ -901,32 +978,7 @@ def seed(m): done {guards} # --- images and the pinned pair ------------------------------------------- -# THE WHEEL IS BAKED AT IMAGE BUILD TIME, so it has to be exported BEFORE -# build_images.sh, and the arcadedb image has to be rebuilt. Without both, -# build_images.sh falls back to `arcadedb-embedded==26.8.1` from PyPI and -# every EMBEDDED arm runs that while every SERVED arm runs the pinned image: -# two ArcadeDB versions on one table. That is exactly what last night's -# calibration did -- its embedded arms ran 26.8.1 against served -# 26.9.1-SNAPSHOT -- and verify_pair_c25.sh does not catch it, because it -# compares the newest wheel FILE in dist/ against the server image and never -# looks inside dbbench:arcadedb. -# THE RELEASE PAIR THIS CHAIN WAS GENERATED FOR, named rather than found -# (DECISIONS #42). A different file in dist/ is a different engine under test. -W="$REPO/bindings/python/dist/{wheel_name}" -[ -f "$W" ] || {{ say "$ID ABORT: the pinned wheel {wheel_name} is not in dist/"; exit 1; }} -# ONE WHEEL, OR SAY WHICH. `ls -t | head -1` takes the newest by mtime and -# says nothing about the ones it passed over, so a second wheel in dist/ -- -# a rebuild at a different pin, a copy kept "just in case" -- silently -# decides what every cell of this stage measures. dist/ holds exactly one -# today; the guard is here because the day it holds two is the day nobody -# notices. Refusing rather than warning: this picks the ENGINE UNDER TEST. -_NW=$(ls "$REPO"/bindings/python/dist/*.whl 2>/dev/null | wc -l) -[ "$_NW" -eq 1 ] || {{ say "$ID ABORT: $_NW wheels in dist/, and ls -t would pick one by date: $(ls "$REPO"/bindings/python/dist/*.whl | tr ' -' ' ')"; exit 1; }} -[ "$(sha256sum "$W" | cut -d' ' -f1)" = "{wheel_sha256}" ] || {{ say "$ID ABORT: dist/{wheel_name} is not the wheel this chain was generated for (sha256)"; exit 1; }} -export ARCADEDB_WHEEL="$W" ARCADEDB_SERVER_IMAGE="{server_image}" -docker image inspect "$ARCADEDB_SERVER_IMAGE" >/dev/null 2>&1 || {{ say "$ID ABORT: no server image $ARCADEDB_SERVER_IMAGE"; exit 1; }} -WV=$(basename "$W" | cut -d- -f2) +{pre_build} BENCH_ALLOW_DEV=0 ./build_images.sh {images} >> "$S" 2>&1 || {{ say "$ID ABORT: image build"; exit 1; }} # ARTIFACT EXISTS IS NOT ARTIFACT BUILT: a target that silently did # nothing leaves no image, and the first cell to want it reports @@ -960,29 +1012,12 @@ def seed(m): # reading each image's versions back out of the image before any cell runs. python3 version_pin_check.py --runtime >> "$S" 2>&1 || {{ say "$ID ABORT: an image does not carry the version it is pinned to"; exit 1; }} say "$ID: images carry their pins" -# VERIFY THE ARM, NOT THE FILE: read the version out of the built image. -# The pair check below is the REPO copy, not ~/verify_pair_c25.sh: that -# one is a stale copy from 2026-08-30 and would miss its own fourth -# check. A script pulled with the tree cannot drift from it. -IV=$(docker run --rm --entrypoint python3 dbbench:arcadedb -c 'import importlib.metadata as m; print(m.version("arcadedb-embedded"))' 2>/dev/null | tr -dc "0-9a-zA-Z.-") -[ "$IV" = "$WV" ] || {{ say "$ID ABORT: dbbench:arcadedb carries wheel $IV, dist has $WV"; exit 1; }} -say "$ID: dbbench:arcadedb carries wheel $IV, matching dist" -IJ=$(docker run --rm --entrypoint python3 dbbench:arcadedb -c 'import jpype; print(jpype.__version__)' 2>/dev/null | tr -dc "0-9a-zA-Z.-") -[ "$IJ" = "{jpype_version}" ] || {{ say "$ID ABORT: dbbench:arcadedb runs JPype '$IJ', the pin is {jpype_version} (Dockerfile.bench, ARG JPYPE_VERSION); rebuild dbbench:arcadedb, which installs the pin"; exit 1; }} -say "$ID: dbbench:arcadedb runs JPype $IJ, the pin" -PAIR_IMAGE="$ARCADEDB_SERVER_IMAGE" ./verify_pair_c25.sh "$SHA" >> "$S" 2>&1 || {{ say "$ID ABORT: pair unverified at the pin"; exit 1; }} +{post_checks} export ARCADEDB_ENGINE_COMMIT=$PIN BENCH_DATA=$HOME/bench-data BENCH_HOST=mini export BENCH_CPUSET=0-11 BENCH_GRAPH_SOURCE=ldbc {stage_env} BACKENDS="{backends}" -# AN ABORT MUST NOT STRAND THE CHAIN. Every guard above exits 1 without a -# marker, so the stages waiting on this one wait forever -- which is what -# happened on 2026-09-20 when a guard of mine aborted a healthy stage and left -# the host idle. From the START line on, the marker is written by a trap -# whatever happens: the ABORT is already in STATUS.txt and loud, and the rest -# of the campaign is worth more than making a human notice sooner. -trap 'echo "$ID ALL-DONE" >> "$S"' EXIT say "$ID START: {title}, {nbe} engines, REPS=$REPS, pin $PIN, instrument {instrument}" {cap_rule_helpers} @@ -1037,6 +1072,11 @@ def stage_params(reps): "jpype_version": bench_common.JPYPE_PIN, "cap_rule_helpers": CAP_RULE_HELPERS.lstrip("\n")} +def _pair_part(text, pins, params): + return text.format(wheel_name=pins["wheel_name"], wheel_sha256=pins["wheel_sha256"], + server_image=pins["ARCADEDB_SERVER_IMAGE"], jpype_version=params["jpype_version"]) + + def stage_script(idx, total, spec, after, pins, params): """One stage's script. THE ROSTER IS stage_backends(spec), never the lane's whole arm list: that would put an arm that runs only part of its lane into the lane's main stage as well.""" @@ -1045,6 +1085,7 @@ def stage_script(idx, total, spec, after, pins, params): dur_mode = spec[9] if len(spec) > 9 else None backends = stage_backends(spec) guards = list(guards) + _pin_guard(backends) + arcade = has_arcadedb_arm(backends) caps = [(s, runner.TIMEOUT_BY_SCALE[s]) for s in scales] body = HEAD.format( id=sid, n=idx + 1, total=total, title=title, lane=lane, nbe=len(backends), sha=pins["ARCADEDB_ENGINE_COMMIT"], @@ -1055,6 +1096,8 @@ def stage_script(idx, total, spec, after, pins, params): # ONE SHAPE FOR BOTH CASES: an empty string is a valid word the loop skips, a comment is a bash syntax error pulled=(" ".join(f'"{i}"' for i in _pulled_images_for(backends)) or '""'), wheel_name=pins["wheel_name"], wheel_sha256=pins["wheel_sha256"], server_image=pins["ARCADEDB_SERVER_IMAGE"], + pre_build=_pair_part(ARCADE_PRE_BUILD if arcade else COMPARATOR_PRE_BUILD, pins, params), + post_checks=_pair_part(ARCADE_POST_CHECKS if arcade else COMPARATOR_STAMP_EXPORTS, pins, params), **params) for scale, cap in caps: senv = " ".join(SCALE_ENV.get((lane, scale), [])) diff --git a/benchmarks/experiments/stage_drafts_2611.sha256 b/benchmarks/experiments/stage_drafts_2611.sha256 index 73a8afcdfd1..2c9d7ee0f04 100644 --- a/benchmarks/experiments/stage_drafts_2611.sha256 +++ b/benchmarks/experiments/stage_drafts_2611.sha256 @@ -1,32 +1,32 @@ 9b6d1bdcb834f28515eb3de2818e4635930186f5521ff9b727414065b69b0987 arcadedb-release/qV00.sh -cff6884e1b6a2eef02de656987110c8ad3d065be26e7260cbf2040ffc58748f2 arcadedb-release/qV01.sh -e568403dd2f0dbd117bd5b95b0f5a7e2455d2e2bc8e2682381ba9269e65e6f9e arcadedb-release/qV02.sh -e8bef704fe3c0afc5587f193bb7877768cb4ce696e28cceb9e6122d690abd931 arcadedb-release/qV03.sh -9d016e6abc48a92a3650d8f28b30e6c0ac2f6571191798d7e2de3fa49879628d arcadedb-release/qV04.sh -72f69cbdeeabd3cd4ef1d38299640633c92456f0cdc798466963c49515cf7879 arcadedb-release/qV05.sh -be82c9392ec185ec5845261498922636e3199c9b47ebc6fea3ab00267a339c15 arcadedb-release/qV06.sh -45f83027961512277c3de353602136134cc876c09fbe42f2f43f4f45de50a854 arcadedb-release/qV07.sh -84ecdab145868446f05806d4a687748174a9a732efb9d1a3f3ffa529e9bc1d87 arcadedb-release/qV08.sh -3a4806eaf4b209528c1b46b6dd34d165c1144592d4acd20f1dcacb7088dd429c arcadedb-release/qV09.sh -08b5ea77fec913d7e873fc0e8dfb392ce89a5a27304b52ce2f31e8f2fc230dbf arcadedb-release/qV10.sh -6c832c9a1219a0293e1e970712736626bdcd3ecd7733cc89b3d08d998c04f266 arcadedb-release/qV11.sh -83d66697e26c2bb21a78c7f6b0c452f94704dfe2f2197fe972949a6f8a0d4e2e comparators-paper-5reps/qU01.sh -a54b53a49fd7ef1b2104a117d31a3e757e6aa925783b77937cb79232c8ffbbe4 comparators-paper-5reps/qU02.sh -dedb29c680410cebe96b6e677c3d84d48d0ed16519a0ed8f52cd30c0852dcda3 comparators-paper-5reps/qU03.sh -606a8774ae6689e3bd9d332e74fe834368bc39460c57ee7f506a2d4a5ce97a74 comparators-paper-5reps/qU04.sh -d5cd60923717381bfeb2236cf3ac36f72b2a7e54354c32cbb87a65aba8c2e0f0 comparators-paper-5reps/qU05.sh -2e83578349b3b80a01584f985b8a96e04a1051b030a2ffa92c62e4d4744d2c36 comparators-paper-5reps/qU06.sh -537bad0c4603beb0ec34c59f3370ec23c0594e74f7985ececae38fb77619d707 comparators-paper-5reps/qU07.sh -146d78b07e7552c9944da1af684afcd6e8874d51e48b2bbec008000303d51dfc comparators-paper-5reps/qU08.sh -7a85c04fa6b6a2525fbc71ed6fae29d571fc4b1f5c09bf84409127247fdfff68 comparators/qS01.sh -234bca6451cb1ffdf31949f00300418ef7ca0ac40a3d13aa3135d8fcf353fd27 comparators/qS02.sh -d05c4230db394c5188c7a4a5b7b45a3edf8d7de7d869f84c0f92905f367fa697 comparators/qS03.sh -65453fc1bf3b458940c8a544ff156eb58235e10d6dd7b21beb2d57f15bc228fe comparators/qS04.sh -964a8f6195036fddf8d18077b72a662cbae0463d95915d22e031a376c4cdd203 comparators/qS05.sh -ca715e3abb9122328a6ac97b7c37efd18cebef6afcc6e928bd7e142a402ac13d comparators/qS06.sh -836b9a188a7e4dc95dbbb51c26f4cda995543ba567125ef00b77e54cc17ddde7 comparators/qS07.sh -3cab58117f8eb6b56af14fd8a1a72530b07c83ec0ab9540ffd27cb17f712c97c comparators/qS08.sh -8539a8c50839f490e74af4d6696a1b4d7995d5a4563cfb230842128e9dbbd798 comparators/qS09.sh -2314b9c5301f290c570239542e32c62c6cd857fb7ceb65b1ec4b035ae7fd85ec comparators/qS10.sh -0126029eb2dfe19a54c3f83fc423567018e06209ba5f251124c03dc303a611b5 comparators/qS11.sh -741fd52fef523ad83af1bde2d68d2aeb6f5984af105cfb2c36d0169ce7dee1ad comparators/qS12.sh +d3dd242487c6a9e0bf1537a65272990cc9d36cf054c6244ed42785ba1efe2487 arcadedb-release/qV01.sh +484cc28854715f12b71d833081fe601352a0329db7f9bf85d19e04c1bd4a504e arcadedb-release/qV02.sh +5dc6951a76d0ac65c39b97f36447b7c3dae315e3806e46b7558839307228aeb2 arcadedb-release/qV03.sh +43c30422cf8d27fbb33882b40fae35f588e6231a07baf31f5bbdd4ec8fd58be7 arcadedb-release/qV04.sh +8e575d5a90c8d90463e9bf4e3462b3f2a043dc58c927ea824d83595a6de62fc9 arcadedb-release/qV05.sh +2ae120d6c711d58d92f36cc1764145072369de0aaedc520d458b217434506681 arcadedb-release/qV06.sh +ed3dda07afe9eb963f0c21a5931c2b3050ed5e297a509cd54f9d483ebbe1ea18 arcadedb-release/qV07.sh +cecf857ac39830c10d823d565ff72162bd46ef4a97f3ed33a4b7e5cf2e38371e arcadedb-release/qV08.sh +b50f2d4309fa3910b86b8a4e15188d7f6a8415c0ac7896d169adb53dca6aa1d5 arcadedb-release/qV09.sh +998127854c3233ba34c4faec47e223f362f1df29bf5bbbd40b8a80c5553a47ee arcadedb-release/qV10.sh +96e2a0c4af6f18721f39e3ed1815395b16e4e88f0412a5071e5f4681443311de arcadedb-release/qV11.sh +0d3a1db3ed512c28e831eeadd2de59fcbfabe461a6a9a4c00492b71bc644232d comparators-paper-5reps/qU01.sh +a867fb670a6d4e7b0be6bf380fac5e9064aec42f587a12d4343390f6d3319b1d comparators-paper-5reps/qU02.sh +03ee63e47e8ca8810c75b273b67dad96b6e806620abe1cc1eab860dd720263ed comparators-paper-5reps/qU03.sh +fc131dbd9d0e538325e79ac490dd31dc9682f28d71a052e5398d9e131bced480 comparators-paper-5reps/qU04.sh +2376cd6767dea54d8c8ff7b0bbcee0d3e02be75bd35ea0f4b43942c565bf5e00 comparators-paper-5reps/qU05.sh +697978fe0b107637d913b27427603f579f929f8b0c0491affa05c11256effdd7 comparators-paper-5reps/qU06.sh +77f9808756529e4429e32bedfe0cf8920f3b2eb8bf7b526dc8b32324f44d5a3f comparators-paper-5reps/qU07.sh +7944ebe6f55fbc019ef5c86091ed2743bcc1eb823bf647a4dcc574b6665ef9ed comparators-paper-5reps/qU08.sh +3450d5ec700249d37083723894382d57d490c6213246f5ad36f7b5786ca201fd comparators/qS01.sh +abd3a05cbfee6cdcddb55a0364e04fdafaa7599cf1bc548083c3da36e5fe41da comparators/qS02.sh +5b618625da138d90cac4d73c2e19145dd486eb13e227df944af32f492ddc15b4 comparators/qS03.sh +2281e793f5f1f2136398fcf69025b521dcb1a824f4580b3bb3000b8e9652eb22 comparators/qS04.sh +2cad3916b801bdad229a95861680fad2fc5876336225108cbaf079028527cb6e comparators/qS05.sh +80364c8f2c8163454db37dbfc16749557e199dcfcb73c55c4c7874884703bffa comparators/qS06.sh +f28cbf9ff9d508287fe84d35b027b30c965411096ae32f88b7fea7c13a9fd5bd comparators/qS07.sh +7619e7ca771c363cd489566f8e33c69903adc7f029f0170ee0c09300bc5489df comparators/qS08.sh +9f7febc2f50aeecc0bcc14fd90298d603031f167d3a7ef974ead99435ff6529b comparators/qS09.sh +a2f7b4b4bcc4d19a6becbefed81662191a1f76156738254f6623bc8ef51e28be comparators/qS10.sh +77a592525a063b2946b477804f94f67fe37afeef09126c6ddcb5721f46ef1580 comparators/qS11.sh +f6f44bdb0027eb5a6637f28554d6ed175041aa9b886cd5247e0b0cc59f1a3384 comparators/qS12.sh diff --git a/benchmarks/experiments/test_jpype_pin.py b/benchmarks/experiments/test_jpype_pin.py index 6d3c008fb07..35305bc4206 100644 --- a/benchmarks/experiments/test_jpype_pin.py +++ b/benchmarks/experiments/test_jpype_pin.py @@ -171,16 +171,20 @@ def test_check_refuses_a_pin_that_is_a_range_and_a_dockerfile_with_two_defaults( # --------------------------------------------------------------------------- the stages @pytest.fixture(scope="module") def stages(tmp_path_factory): + """The ArcadeDB release pass's stages: the only ones that run an ArcadeDB arm, so the only ones that read JPype out of + dbbench:arcadedb (a comparator stage has no use for that image, make_2611_stages.has_arcadedb_arm).""" tmp = tmp_path_factory.mktemp("jpype-stages") - wheel = tmp / "arcadedb_embedded-26.10.1-cp312-cp312-manylinux_2_34_x86_64.whl" - wheel.write_bytes(b"not a real wheel, only its name and sha256 are read") - env = dict(os.environ, ARCADEDB_WHEEL=str(wheel), ARCADEDB_SERVER_IMAGE="arcadedb-c25:26.10.1", - ARCADEDB_ENGINE_COMMIT="d36b4ca3ae4c170abc73598e0dffa2bb58e06621") + wheel_name = "arcadedb_embedded-26.11.1-cp312-cp312-manylinux_2_34_x86_64.whl" out = tmp / "stages" - env.pop("BENCH_INSTRUMENT", None) - r = subprocess.run([sys.executable, str(HERE / "make_2611_stages.py"), "--second-list", "--out", str(out), "--after", "none"], + env = {k: v for k, v in os.environ.items() if k != "BENCH_INSTRUMENT"} + r = subprocess.run([sys.executable, str(HERE / "make_2611_stages.py"), "--arcadedb-release", "26.11.1", + "--engine-commit", "1" * 40, "--image-digest", "sha256:" + "ab" * 32, "--wheel-name", wheel_name, + "--wheel-sha256", "cd" * 32, "--wheel-url", "https://files.pythonhosted.org/packages/x/" + wheel_name, + "--second-list", "--out", str(out), "--after", "none", "--id-prefix", "qT"], cwd=HERE, env=env, capture_output=True, text=True) assert r.returncode == 0, r.stdout[-400:] + r.stderr[-400:] + for pair in out.glob("qT00.sh"): + pair.unlink() # the pair install is not a runner stage return out @@ -190,14 +194,26 @@ def _stage_ids(stages): return ids -def test_every_runner_stage_reads_jpype_out_of_the_image_after_the_build(stages): +def test_every_arcadedb_stage_reads_jpype_out_of_the_image_after_the_build(stages): for sid in _stage_ids(stages): text = (stages / f"{sid}.sh").read_text() assert text.count("import jpype; print(jpype.__version__)") == 1, sid assert f'[ "$IJ" = "{PIN}" ]' in text, sid # after the image build and the wheel check, before the pair check and the first cell assert text.index("./build_images.sh") < text.index('IJ=$(docker run') < text.index("./verify_pair_c25.sh"), sid - assert text.index('IJ=$(docker run') < text.index('trap \'echo "$ID ALL-DONE"'), sid + # the ALL-DONE trap is set before it, so a failed read hands on (CAMPAIGN: every ABORT hands on) + assert text.index('trap \'echo "$ID ALL-DONE"') < text.index('IJ=$(docker run'), sid + + +def test_a_comparator_stage_does_not_read_jpype_out_of_dbbench_arcadedb(tmp_path): + wheel = tmp_path / "arcadedb_embedded-26.10.2-cp312-cp312-manylinux_2_34_x86_64.whl" + wheel.write_bytes(b"x") + out = tmp_path / "comparators" + out.mkdir() + pins = {"ARCADEDB_ENGINE_COMMIT": "d" * 40, "ARCADEDB_WHEEL": str(wheel), "ARCADEDB_SERVER_IMAGE": "arcadedb-c25:26.10.2"} + G.emit_all(str(out), G.number(G.subset_specs(["duckdb"], ["l2"], "paper"), "qS"), pins, None, 3) + text = (out / "qS01.sh").read_text() + assert "IJ=$(docker run" not in text and "dbbench:arcadedb" not in text.replace("no dbbench:arcadedb needed", "") def _snippet(text, first, last): @@ -240,7 +256,7 @@ def test_the_stages_carry_the_pin_the_generator_holds_not_a_literal_of_their_own out.mkdir() pins = {"ARCADEDB_ENGINE_COMMIT": "d36b4ca3ae4c170abc73598e0dffa2bb58e06621", "ARCADEDB_WHEEL": str(wheel), "ARCADEDB_SERVER_IMAGE": "arcadedb-c25:26.10.1"} - G.emit_all(str(out), G.number(G.subset_specs(["duckdb"], ["l2"], "paper"), "qS"), pins, None, 3) + G.emit_all(str(out), G.number(G.subset_specs(["arcadedb"], ["l2"], "paper"), "qS"), pins, None, 3) text = (out / "qS01.sh").read_text() assert '[ "$IJ" = "1.7.2" ]' in text assert PIN not in "".join(re.findall(r'\[ "\$IJ" = "[^"]+" \]', text)) diff --git a/benchmarks/experiments/test_stage_generator_2611.py b/benchmarks/experiments/test_stage_generator_2611.py index 691010da345..594ffd10dba 100644 --- a/benchmarks/experiments/test_stage_generator_2611.py +++ b/benchmarks/experiments/test_stage_generator_2611.py @@ -220,6 +220,81 @@ def test_projection_prices_the_lane_cells_of_each_stage(tmp_path): G.load_hours(str(tsv), 4) +# ------------------------------------------------------------------------------------ the ArcadeDB pair's guards +PAIR_GUARDS = ("is not in dist/", "wheels in dist/", "is not the wheel this chain was generated for", "no server image", + "ABORT: dbbench:arcadedb carries wheel", "ABORT: dbbench:arcadedb runs JPype", "ABORT: pair unverified at the pin") + + +def test_a_comparator_only_stage_has_no_arcadedb_wheel_or_image_guard(drafts): + for f in sorted(drafts.glob("*.sh")): + t = f.read_text() + for g in PAIR_GUARDS: + assert g not in t, (f.name, g) + assert "dbbench:arcadedb" not in t.replace("no dbbench:arcadedb needed", "") + assert "dist/*.whl" not in t and "verify_pair_c25.sh" not in t + # the rows still carry the pin, and the runner's together-or-not-at-all rule still holds + assert "export ARCADEDB_ENGINE_COMMIT=$PIN" in t + assert re.search(r'^export ARCADEDB_WHEEL=".*/dist/' + re.escape(WHEEL) + r'" ARCADEDB_SERVER_IMAGE="arcadedb-c25:e85469273"$', + t, re.M), f.name + # ... and is exported only after the image build, which bakes ARCADEDB_WHEEL into every generic image it builds + assert t.index("./build_images.sh") < t.index("export ARCADEDB_WHEEL=") + assert "arcadedb" not in re.findall(r"^BENCH_ALLOW_DEV=0 \./build_images\.sh (.*?) >>", t, re.M)[0].split() + + +def test_an_arcadedb_release_stage_keeps_every_guard_of_the_pair(tmp_path): + out = tmp_path / "rel" + r = run(_release_args() + ["--after", "none", "--id-prefix", "qT", "--lanes", "graph", "--out", str(out)]) + assert r.returncode == 0, r.stdout[-500:] + r.stderr[-500:] + stages = sorted(out.glob("qT0[1-9].sh")) + assert stages + for f in stages: + t = f.read_text() + for g in PAIR_GUARDS: + assert g in t, (f.name, g) + assert re.findall(r"^BENCH_ALLOW_DEV=0 \./build_images\.sh (.*?) >>", t, re.M)[0].split()[0] == "arcadedb" + assert t.index("is not the wheel this chain was generated for") < t.index("./build_images.sh") < t.index("pair unverified") + + +def test_the_lint_demands_the_pair_guards_exactly_where_an_arcadedb_arm_runs(tmp_path): + base = ('export BENCH_INSTRUMENT=2026-11\nRF="runs_page_${PIN}_2611.jsonl"\n') + guards = "is not the wheel this chain was generated for\nABORT: dbbench:arcadedb carries wheel\n" + assert G.lint_draft(base + 'BACKENDS="arcadedb_graph_embedded"\n' + guards, "s.sh") == [] + assert G.lint_draft(base + 'BACKENDS="arcadedb_graph_embedded"\n', "s.sh") + comp = G.lint_draft(base + 'BACKENDS="duckpgq_graph"\n' + guards, "s.sh") + assert any("guards the pinned wheel" in p for p in comp) + + +# ------------------------------------------------------------------------------- an ABORT hands on (CAMPAIGN rule) +def _abort_trap(text): + return re.search(r"""^trap 'echo "\$ID ALL-DONE" >> "\$S"' EXIT$""", text, re.M) + + +def test_the_all_done_trap_is_set_before_the_first_guard_that_can_abort(drafts, tmp_path): + rel = tmp_path / "rel" + r = run(_release_args() + ["--after", "none", "--id-prefix", "qT", "--out", str(rel)]) + assert r.returncode == 0, r.stdout[-500:] + r.stderr[-500:] + for f in sorted(drafts.glob("*.sh")) + sorted(rel.glob("*.sh")): + t = f.read_text() + m = _abort_trap(t) + assert m, f.name + assert m.start() < t.index("$ID ABORT"), f.name + assert t.index('ALL-DONE" "$S"') < m.start() if 'while ! grep -qx' in t else True # set after the wait, never inside it + + +def test_a_pre_start_abort_writes_the_marker_so_the_chain_goes_on(tmp_path): + out = tmp_path / "o" + r = run(["--after", "none", "--lanes", "graph", "--out", str(out)], tmp_path) + assert r.returncode == 0, r.stdout[-400:] + r.stderr[-400:] + home = tmp_path / "home" + home.mkdir() # no repo here: the first guard (git pull) fails, long before the START line + p = subprocess.run(["bash", str(out / "qS01.sh")], env={"HOME": str(home), "PATH": os.environ["PATH"]}, + capture_output=True, text=True, timeout=60) + assert p.returncode == 1 + lines = (home / "STATUS.txt").read_text().splitlines() + assert "qS01 ABORT: pull" in lines[0] and "START" not in "".join(lines) + assert lines[-1] == "qS01 ALL-DONE" + + # ------------------------------------------------------------------------------------ the drafts, byte for byte SHA_LIST = HERE / "stage_drafts_2611.sha256" GENERATIONS = { From 59d8e29b7529fb6595cf698cb07fee734edcd826 Mon Sep 17 00:00:00 2001 From: Taewoon Kim Date: Thu, 22 Oct 2026 08:11:35 +0900 Subject: [PATCH 2/2] Comparator stages keep the wheel guards their image build needs; build_images.sh has no PyPI fallback Every stage exports the pinned wheel before build_images.sh (which bakes it into every generic image) and guards that it exists with the pinned sha256. Comparator stages drop only what concerns the ArcadeDB arms: the one-wheel-in-dist rule, the server image check, the dbbench:arcadedb read-back and verify_pair_c25.sh. build_images.sh refuses to build the arcadedb image without ARCADEDB_WHEEL instead of falling back to a stale PyPI pin. Co-Authored-By: Claude Sonnet 5.5 --- benchmarks/experiments/CAMPAIGN.md | 2 +- benchmarks/experiments/build_images.sh | 18 ++++-- benchmarks/experiments/make_2611_stages.py | 56 ++++++++++------- .../experiments/stage_drafts_2611.sha256 | 62 +++++++++---------- benchmarks/experiments/test_jpype_pin.py | 45 +++++++++++++- .../experiments/test_stage_generator_2611.py | 36 ++++++----- bindings/python/docs/benchmarks/running.md | 3 +- 7 files changed, 145 insertions(+), 77 deletions(-) diff --git a/benchmarks/experiments/CAMPAIGN.md b/benchmarks/experiments/CAMPAIGN.md index 5198811324f..a0c920c39bb 100644 --- a/benchmarks/experiments/CAMPAIGN.md +++ b/benchmarks/experiments/CAMPAIGN.md @@ -241,7 +241,7 @@ The detail behind item 8: **The next campaign's stages are generated by `make_2611_stages.py`.** One template carries every guard the campaign learned (cap table, shadowed definitions, budgets against the cap, whole-cell cost, images present and current, comparator digests frozen at generation, the JPype pin read out of the image, the pinned wheel by sha256, the cap rule, the ALL-DONE trap); the instrument, `REPS` and the banner are its parameters. The generator selects the multi-model subset. The subset is `ENGINES` in the file: ArcadeDB (embedded and served), SurrealDB (embedded and served), ArangoDB, Memgraph, PostgreSQL with pgvector, AGE and TimescaleDB (and plain PostgreSQL where a lane uses it), MongoDB with MongoDB Search, DuckDB with VSS and DuckPGQ, SQLite with sqlite-vec, the composed Qdrant plus Neo4j stack, Neo4j and Qdrant on their own (graph and dense; sparse on the second list), and LadybugDB on every lane it supports. Every registered arm is either in the subset or in `OUTSIDE`, so a newly registered arm forces a decision (`--check`). The core lanes are graph (interactive and analytics), cross-model, documents and dense; `--second-list` adds lifecycle, then sparse and time series, after them. TimescaleDB runs whenever the time-series lane does; `--without-timescaledb` leaves it out. Every generated stage exports `BENCH_INSTRUMENT=2026-11` before its first Python call, reads the selection back from `bench_common` and aborts if the tree does not select it, writes `runs_page__2611.jsonl` (and overlay directories with the same suffix) so one rows file never holds two instruments, and fixes `REPS` at generation (`--reps`, default 3, at most 5). The generator re-executes itself with the variable set and refuses a different value in the environment. `land_stage.py` reads only 2026-10 rows today, so landing the new rows is a change of its own, made when the first 2026-11 tables land. The comparators are the default mode and run on the release pair already installed (`ARCADEDB_WHEEL`, `ARCADEDB_SERVER_IMAGE`, `ARCADEDB_ENGINE_COMMIT`): `python3 make_2611_stages.py --second-list --after --id-prefix qS --out DIR`. `--after` is required (a stage id, or `none`), and each stage then waits for the previous one with `grep -qx " ALL-DONE"`. The ArcadeDB pass is `--arcadedb-release X.Y.Z` with `--engine-commit`, `--image-digest sha256:...`, `--wheel-name`, `--wheel-sha256` and `--wheel-url`; it refuses unless all five are given, because the release may not exist when the drafts are made. It writes `00`, the pair install (official image by digest, wheel by sha256, `build_matched_pair.sh`, `verify_pair_c25.sh`), and ArcadeDB's lane stages behind it. -The ArcadeDB pair's guards (the pinned wheel by name and sha256 and the only wheel in `dist/`, the server image, the wheel and JPype read back out of `dbbench:arcadedb`, `verify_pair_c25.sh`) are in the stages that run an ArcadeDB arm and only those: a comparator stage needs neither the wheel nor `dbbench:arcadedb`, and exports `ARCADEDB_WHEEL`, `ARCADEDB_SERVER_IMAGE` and `ARCADEDB_ENGINE_COMMIT` only as the label its rows carry (after its image build, so no image bakes the engine under test). Every ABORT hands on: the `ALL-DONE` trap is set right after the wait, before the first guard, so a stage that aborts before its START line still writes its marker and the next stage runs (its own guards then run too). The ABORT line is in `STATUS.txt`, where `mini_watch.sh` reports it; to resume, fix the cause and run the aborted stage's script again by hand after the chain, and landing reads only the rows that exist. `make_2611_stages.py --check --drafts DIR` lints both rules. +The ArcadeDB pair's guards are split by what a stage runs. Every stage exports the pinned wheel (`ARCADEDB_WHEEL`, with `ARCADEDB_SERVER_IMAGE` and `ARCADEDB_ENGINE_COMMIT`) before `build_images.sh`, which bakes it into every generic image (client, duckdb, dense), and so every stage guards that the file exists at the pinned path and has the pinned sha256; `build_images.sh` copies it from that path and nothing in it or the Dockerfiles reads `dist/` itself. Only a stage that runs an ArcadeDB arm (the `--arcadedb-release` pass) also guards the rest: exactly one wheel in `dist/` (it protects `verify_pair_c25.sh`), the server image, the wheel and JPype read back out of `dbbench:arcadedb`, and `verify_pair_c25.sh`. A comparator stage on a host whose `dbbench:arcadedb` is the previous release's therefore runs. `build_images.sh` has no PyPI fallback: it refuses to build the `arcadedb` image (named or by default) without `ARCADEDB_WHEEL`, and refuses a wheel that is not a file; the images that take no wheel can be built alone by naming them. Every ABORT hands on: the `ALL-DONE` trap is set right after the wait, before the first guard, so a stage that aborts before its START line still writes its marker and the next stage runs (its own guards then run too). The ABORT line is in `STATUS.txt`, where `mini_watch.sh` reports it; to resume, fix the cause and run the aborted stage's script again by hand after the chain, and landing reads only the rows that exist. `make_2611_stages.py --check --drafts DIR` lints both rules. The default order is the core block first, then the second list. Inside the core block the large tiers (deep10m, tpch10, the full SF1 network) run after the small ones, and the cells that dominate the hours (Memgraph's deep10m dense cells, SurrealDB's documents at tpch1, the full SF1 network's analytics) run last of all in stages of their own, where they are easiest to drop if time runs short; `BIGGEST` in the file names them, and `--order paper` keeps the table order. Splitting moves stage boundaries only, and `--check` proves the cells are the same. `--project TABLE` prints projected hours per drafted stage from a per-cell hours table (tab separated: lane, workload, scale, backend, class, hours at 3 repetitions, hours at 5 repetitions; a cell with no clean rep carries its one failed attempt). `--check --drafts DIR` lints written scripts: the instrument exported and never 2026-10, the 2611 rows file, only subset arms, each stage waiting for the one before it. Drafts are written to a folder outside the tree and copied to the bench host by hand on the owner's go. Which stage is running is state, not method: it is in `STATUS.txt`'s tail and in HANDOFF, never here. `test_stage_generator_2611.py` holds the written drafts byte for byte against `stage_drafts_2611.sha256`, so a stage cannot move without the list changing in the same commit. **What a stage costs is projected from its components, never from an uplift.** Multiplying the previous campaign's cells by an assumed per-lane uplift goes wrong in both directions: a larger query set lengthens a stage several times over, and a stage that runs fewer workloads than the cells it is priced from runs shorter. Project each cell from its measured ingest, first touches, and budget ceiling, as `cell_cost_check` does, and replace a stage's projection with its measured cost once it runs. The current projection lives in HANDOFF. diff --git a/benchmarks/experiments/build_images.sh b/benchmarks/experiments/build_images.sh index 828393b7bf0..9926889b6e7 100755 --- a/benchmarks/experiments/build_images.sh +++ b/benchmarks/experiments/build_images.sh @@ -17,13 +17,25 @@ cd "$(dirname "$0")" # result set, so they are part of the instrument. Pinned at what the October # images on mini and the laptop resolved (2026-09-19); move them deliberately. HARNESS_PKGS="numpy==2.5.3 pandas==3.0.6 pyarrow==25.0.1" -ARCADE_PKGS="arcadedb-embedded==26.8.1 $HARNESS_PKGS" +# NO SILENT PYPI FALLBACK (2026-10-22). The engine under test is always a named wheel: the `arcadedb` image takes it from +# ARCADEDB_WHEEL and nothing else, because the old default here (`arcadedb-embedded==26.8.1` from PyPI) was a stale pin that +# a build with the variable forgotten would have baked in without a word, two ArcadeDB versions on one table (F5). The +# generic images (client, duckdb, dense) take no ArcadeDB package of their own: with the variable set they carry the wheel +# (Dockerfile.bench installs every wheel in docker-wheels/), and without it they carry none, so building only those needs no wheel. +ARCADE_PKGS="$HARNESS_PKGS" mkdir -p docker-wheels && rm -f docker-wheels/*.whl if [ -n "${ARCADEDB_WHEEL:-}" ]; then + [ -f "$ARCADEDB_WHEEL" ] || { echo "REFUSING: ARCADEDB_WHEEL=$ARCADEDB_WHEEL is not a file" >&2; exit 1; } cp "$ARCADEDB_WHEEL" docker-wheels/ - ARCADE_PKGS="$HARNESS_PKGS" echo "using local wheel: $(basename "$ARCADEDB_WHEEL")" fi +_want_arcadedb=1 +if [ $# -gt 0 ]; then _want_arcadedb=0; for _t in "$@"; do [ "$_t" = "arcadedb" ] && _want_arcadedb=1; done; fi +if [ "$_want_arcadedb" = 1 ] && [ -z "${ARCADEDB_WHEEL:-}" ]; then + echo "REFUSING: the arcadedb image needs ARCADEDB_WHEEL=; there is no PyPI fallback." >&2 + echo " Name the targets (e.g. './build_images.sh duckdb client dense') to build the images that take no wheel." >&2 + exit 1 +fi declare -A PKGS=( # EVERY package pinned, and every pin at the current release as of @@ -68,8 +80,6 @@ _pin="" if [ -n "${ARCADEDB_WHEEL:-}" ]; then # arcadedb_embedded-26.8.1.dev20-py3-none-linux_x86_64.whl -> 26.8.1.dev20 _pin=$(basename "$ARCADEDB_WHEEL" | cut -d- -f2) -else - _pin=${ARCADE_PKGS#*arcadedb-embedded==}; _pin=${_pin%% *} fi case "$_pin" in *dev*|*rc[0-9]*|*a[0-9]*|*b[0-9]*|*SNAPSHOT*) diff --git a/benchmarks/experiments/make_2611_stages.py b/benchmarks/experiments/make_2611_stages.py index 7085a2bcf62..2a07740c594 100644 --- a/benchmarks/experiments/make_2611_stages.py +++ b/benchmarks/experiments/make_2611_stages.py @@ -566,8 +566,12 @@ def lint_draft(text, name, engines=None): out.append(f"{name}: no BACKENDS line") else: arcade = has_arcadedb_arm(m.group(1).split()) - for needle, what in (("is not the wheel this chain was generated for", "the pinned wheel in dist/"), - ("ABORT: dbbench:arcadedb carries wheel", "the dbbench:arcadedb wheel check")): + # every stage builds images with the pinned wheel baked in, so every stage guards the wheel's sha256 + if "is not the wheel this chain was generated for" not in text: + out.append(f"{name}: no guard for the pinned wheel's sha256, which the image build bakes into every image") + for needle, what in (("wheels in dist/", "one wheel in dist/"), ("ABORT: no server image", "the server image"), + ("ABORT: dbbench:arcadedb carries wheel", "the dbbench:arcadedb wheel check"), + ("ABORT: pair unverified at the pin", "verify_pair_c25.sh")): if arcade and needle not in text: out.append(f"{name}: runs an ArcadeDB arm but has no guard for {what}") if not arcade and needle in text: @@ -747,16 +751,20 @@ def seed(m): return re.sub(r"\nfor BE in \$BACKENDS; do\n", seed, body) -# THE ARCADEDB PAIR'S GUARDS, in the stages that contain an ArcadeDB arm (and only those). A stage whose roster is comparators -# needs neither the pinned wheel in dist/ nor dbbench:arcadedb: its arms run in the digest-pinned images and dbbench:duckdb, -# client, dense, pg-age, mongo-search and composed, none of which import arcadedb_embedded. Guarding them anyway aborted a -# healthy comparator stage on a host whose dist/ and dbbench:arcadedb were still the previous release's. -ARCADE_PRE_BUILD = '''# THE WHEEL IS BAKED AT IMAGE BUILD TIME, so it has to be exported BEFORE +# THE ARCADEDB PAIR'S GUARDS. A stage that runs an ArcadeDB arm (the --arcadedb-release pass) gets all of them. A comparator-only +# stage gets the ones its IMAGE BUILD needs and no others: the build bakes ARCADEDB_WHEEL into every generic image (client, +# duckdb, dense; Dockerfile.bench installs every wheel in docker-wheels/), so the wheel is exported before build_images.sh, +# exactly as in the ArcadeDB stages, and must exist at the pinned path with the pinned sha256 (build_images.sh copies it from +# there; nothing in it or in the Dockerfiles reads dist/ itself). What it does not need, because none of its arms is ArcadeDB: +# the "one wheel in dist/" rule (it protects verify_pair_c25.sh, which takes the newest wheel there), the server image, the wheel +# and JPype read back out of dbbench:arcadedb, and verify_pair_c25.sh. Guarding those anyway aborted a healthy comparator stage +# on a host whose dist/ and dbbench:arcadedb were still the previous release's. +ARCADE_WHEEL_HEAD = '''# THE WHEEL IS BAKED AT IMAGE BUILD TIME, so it has to be exported BEFORE # build_images.sh, and the arcadedb image has to be rebuilt. Without both, -# build_images.sh falls back to `arcadedb-embedded==26.8.1` from PyPI and -# every EMBEDDED arm runs that while every SERVED arm runs the pinned image: -# two ArcadeDB versions on one table. That is exactly what last night's -# calibration did -- its embedded arms ran 26.8.1 against served +# the embedded arms would run another wheel than the served ones run +# (build_images.sh used to fall back to `arcadedb-embedded==26.8.1` from PyPI; +# it now refuses without ARCADEDB_WHEEL): two ArcadeDB versions on one table. +# That is exactly what last night's calibration did -- its embedded arms ran 26.8.1 against served # 26.9.1-SNAPSHOT -- and verify_pair_c25.sh does not catch it, because it # compares the newest wheel FILE in dist/ against the server image and never # looks inside dbbench:arcadedb. @@ -764,7 +772,9 @@ def seed(m): # (DECISIONS #42). A different file in dist/ is a different engine under test. W="$REPO/bindings/python/dist/{wheel_name}" [ -f "$W" ] || {{ say "$ID ABORT: the pinned wheel {wheel_name} is not in dist/"; exit 1; }} -# ONE WHEEL, OR SAY WHICH. `ls -t | head -1` takes the newest by mtime and +''' + +ARCADE_WHEEL_COUNT = '''# ONE WHEEL, OR SAY WHICH. `ls -t | head -1` takes the newest by mtime and # says nothing about the ones it passed over, so a second wheel in dist/ -- # a rebuild at a different pin, a copy kept "just in case" -- silently # decides what every cell of this stage measures. dist/ holds exactly one @@ -773,12 +783,19 @@ def seed(m): _NW=$(ls "$REPO"/bindings/python/dist/*.whl 2>/dev/null | wc -l) [ "$_NW" -eq 1 ] || {{ say "$ID ABORT: $_NW wheels in dist/, and ls -t would pick one by date: $(ls "$REPO"/bindings/python/dist/*.whl | tr ' ' ' ')"; exit 1; }} -[ "$(sha256sum "$W" | cut -d' ' -f1)" = "{wheel_sha256}" ] || {{ say "$ID ABORT: dist/{wheel_name} is not the wheel this chain was generated for (sha256)"; exit 1; }} +''' + +ARCADE_WHEEL_SHA_EXPORT = '''[ "$(sha256sum "$W" | cut -d' ' -f1)" = "{wheel_sha256}" ] || {{ say "$ID ABORT: dist/{wheel_name} is not the wheel this chain was generated for (sha256)"; exit 1; }} export ARCADEDB_WHEEL="$W" ARCADEDB_SERVER_IMAGE="{server_image}" -docker image inspect "$ARCADEDB_SERVER_IMAGE" >/dev/null 2>&1 || {{ say "$ID ABORT: no server image $ARCADEDB_SERVER_IMAGE"; exit 1; }} +''' + +ARCADE_PRE_TAIL = '''docker image inspect "$ARCADEDB_SERVER_IMAGE" >/dev/null 2>&1 || {{ say "$ID ABORT: no server image $ARCADEDB_SERVER_IMAGE"; exit 1; }} WV=$(basename "$W" | cut -d- -f2) ''' +ARCADE_PRE_BUILD = ARCADE_WHEEL_HEAD + ARCADE_WHEEL_COUNT + ARCADE_WHEEL_SHA_EXPORT + ARCADE_PRE_TAIL +COMPARATOR_PRE_BUILD = ARCADE_WHEEL_HEAD + ARCADE_WHEEL_SHA_EXPORT.rstrip("\n") + ARCADE_POST_CHECKS = '''# VERIFY THE ARM, NOT THE FILE: read the version out of the built image. # The pair check below is the REPO copy, not ~/verify_pair_c25.sh: that # one is a stale copy from 2026-08-30 and would miss its own fourth @@ -792,14 +809,7 @@ def seed(m): PAIR_IMAGE="$ARCADEDB_SERVER_IMAGE" ./verify_pair_c25.sh "$SHA" >> "$S" 2>&1 || {{ say "$ID ABORT: pair unverified at the pin"; exit 1; }} ''' -# What a comparator-only stage does in their place. runner.py takes ARCADEDB_WHEEL and ARCADEDB_SERVER_IMAGE together or not -# at all, and refuses ARCADEDB_ENGINE_COMMIT without them, while land_stage.py keeps only the rows whose engine_commit starts -# with the chain's pin: so the three are still exported, as the label the rows carry. They are exported AFTER the image build, -# because build_images.sh bakes ARCADEDB_WHEEL into every generic image it builds (client, duckdb, dense), and a comparator -# image has no use for the engine under test. Nothing here reads dist/ or dbbench:arcadedb. -COMPARATOR_PRE_BUILD = "# (no ArcadeDB arm in this stage: no wheel in dist/ and no dbbench:arcadedb needed, see make_2611_stages.ARCADE_PRE_BUILD)" -COMPARATOR_STAMP_EXPORTS = '''# ROW LABEL ONLY, nothing is read from these: see make_2611_stages.COMPARATOR_STAMP_EXPORTS. -export ARCADEDB_WHEEL="$REPO/bindings/python/dist/{wheel_name}" ARCADEDB_SERVER_IMAGE="{server_image}"''' +COMPARATOR_POST_CHECKS = "# (no ArcadeDB arm in this stage: dbbench:arcadedb and the pair are not checked, see ARCADE_PRE_BUILD)" def has_arcadedb_arm(backends): @@ -1097,7 +1107,7 @@ def stage_script(idx, total, spec, after, pins, params): pulled=(" ".join(f'"{i}"' for i in _pulled_images_for(backends)) or '""'), wheel_name=pins["wheel_name"], wheel_sha256=pins["wheel_sha256"], server_image=pins["ARCADEDB_SERVER_IMAGE"], pre_build=_pair_part(ARCADE_PRE_BUILD if arcade else COMPARATOR_PRE_BUILD, pins, params), - post_checks=_pair_part(ARCADE_POST_CHECKS if arcade else COMPARATOR_STAMP_EXPORTS, pins, params), + post_checks=_pair_part(ARCADE_POST_CHECKS if arcade else COMPARATOR_POST_CHECKS, pins, params), **params) for scale, cap in caps: senv = " ".join(SCALE_ENV.get((lane, scale), [])) diff --git a/benchmarks/experiments/stage_drafts_2611.sha256 b/benchmarks/experiments/stage_drafts_2611.sha256 index 2c9d7ee0f04..3d7d58ee4c9 100644 --- a/benchmarks/experiments/stage_drafts_2611.sha256 +++ b/benchmarks/experiments/stage_drafts_2611.sha256 @@ -1,32 +1,32 @@ 9b6d1bdcb834f28515eb3de2818e4635930186f5521ff9b727414065b69b0987 arcadedb-release/qV00.sh -d3dd242487c6a9e0bf1537a65272990cc9d36cf054c6244ed42785ba1efe2487 arcadedb-release/qV01.sh -484cc28854715f12b71d833081fe601352a0329db7f9bf85d19e04c1bd4a504e arcadedb-release/qV02.sh -5dc6951a76d0ac65c39b97f36447b7c3dae315e3806e46b7558839307228aeb2 arcadedb-release/qV03.sh -43c30422cf8d27fbb33882b40fae35f588e6231a07baf31f5bbdd4ec8fd58be7 arcadedb-release/qV04.sh -8e575d5a90c8d90463e9bf4e3462b3f2a043dc58c927ea824d83595a6de62fc9 arcadedb-release/qV05.sh -2ae120d6c711d58d92f36cc1764145072369de0aaedc520d458b217434506681 arcadedb-release/qV06.sh -ed3dda07afe9eb963f0c21a5931c2b3050ed5e297a509cd54f9d483ebbe1ea18 arcadedb-release/qV07.sh -cecf857ac39830c10d823d565ff72162bd46ef4a97f3ed33a4b7e5cf2e38371e arcadedb-release/qV08.sh -b50f2d4309fa3910b86b8a4e15188d7f6a8415c0ac7896d169adb53dca6aa1d5 arcadedb-release/qV09.sh -998127854c3233ba34c4faec47e223f362f1df29bf5bbbd40b8a80c5553a47ee arcadedb-release/qV10.sh -96e2a0c4af6f18721f39e3ed1815395b16e4e88f0412a5071e5f4681443311de arcadedb-release/qV11.sh -0d3a1db3ed512c28e831eeadd2de59fcbfabe461a6a9a4c00492b71bc644232d comparators-paper-5reps/qU01.sh -a867fb670a6d4e7b0be6bf380fac5e9064aec42f587a12d4343390f6d3319b1d comparators-paper-5reps/qU02.sh -03ee63e47e8ca8810c75b273b67dad96b6e806620abe1cc1eab860dd720263ed comparators-paper-5reps/qU03.sh -fc131dbd9d0e538325e79ac490dd31dc9682f28d71a052e5398d9e131bced480 comparators-paper-5reps/qU04.sh -2376cd6767dea54d8c8ff7b0bbcee0d3e02be75bd35ea0f4b43942c565bf5e00 comparators-paper-5reps/qU05.sh -697978fe0b107637d913b27427603f579f929f8b0c0491affa05c11256effdd7 comparators-paper-5reps/qU06.sh -77f9808756529e4429e32bedfe0cf8920f3b2eb8bf7b526dc8b32324f44d5a3f comparators-paper-5reps/qU07.sh -7944ebe6f55fbc019ef5c86091ed2743bcc1eb823bf647a4dcc574b6665ef9ed comparators-paper-5reps/qU08.sh -3450d5ec700249d37083723894382d57d490c6213246f5ad36f7b5786ca201fd comparators/qS01.sh -abd3a05cbfee6cdcddb55a0364e04fdafaa7599cf1bc548083c3da36e5fe41da comparators/qS02.sh -5b618625da138d90cac4d73c2e19145dd486eb13e227df944af32f492ddc15b4 comparators/qS03.sh -2281e793f5f1f2136398fcf69025b521dcb1a824f4580b3bb3000b8e9652eb22 comparators/qS04.sh -2cad3916b801bdad229a95861680fad2fc5876336225108cbaf079028527cb6e comparators/qS05.sh -80364c8f2c8163454db37dbfc16749557e199dcfcb73c55c4c7874884703bffa comparators/qS06.sh -f28cbf9ff9d508287fe84d35b027b30c965411096ae32f88b7fea7c13a9fd5bd comparators/qS07.sh -7619e7ca771c363cd489566f8e33c69903adc7f029f0170ee0c09300bc5489df comparators/qS08.sh -9f7febc2f50aeecc0bcc14fd90298d603031f167d3a7ef974ead99435ff6529b comparators/qS09.sh -a2f7b4b4bcc4d19a6becbefed81662191a1f76156738254f6623bc8ef51e28be comparators/qS10.sh -77a592525a063b2946b477804f94f67fe37afeef09126c6ddcb5721f46ef1580 comparators/qS11.sh -f6f44bdb0027eb5a6637f28554d6ed175041aa9b886cd5247e0b0cc59f1a3384 comparators/qS12.sh +57070d2416ccd54c1271b242f22b540d34b6ab1e20f8fac527637a3178f89c5b arcadedb-release/qV01.sh +31d75a775c5093eb5e4c881b0570a9ee94cd9dd15ef12323e695e8a674d01604 arcadedb-release/qV02.sh +0327935ae185b7284788d2d0f131a4f7a4b5ce7145617f3056461c03bce77874 arcadedb-release/qV03.sh +98ccd6ffd31fe0afae049e34832015530daf325fbd5f1bd3298ced57d1c9925b arcadedb-release/qV04.sh +6ecc08f4d1a0752e8dff427653e5ebedd728c5dfc24b2738f12903123261d752 arcadedb-release/qV05.sh +574b3e3969e85181c4de1569f1998529e65447ef8217b3275b4dc809e84902df arcadedb-release/qV06.sh +bf7e79d53750df2fdce2007a38c6e0e3893b9af43533ebd1a923d242b64c89be arcadedb-release/qV07.sh +71e6a08de38457230fd1d8dfdeb94c8d9859dd45eb6212f5e53cd843020f60cd arcadedb-release/qV08.sh +10c7b83666923c4b1c6965709086a4afaa217d358f2670a21210d08ba6556548 arcadedb-release/qV09.sh +470e58097dd26e9884a2f0b8449a35912f3df130a1791a1118a28282f6a3610e arcadedb-release/qV10.sh +113b823cc44b337efffa164f6cf197b05841da1e637a0d771f18df106ae4f02c arcadedb-release/qV11.sh +24186dffd770ebef37cbf02c5f03df9bdae83a988489275451cdbac110509869 comparators-paper-5reps/qU01.sh +8d4dcc7de6cad371869c8859b2af343a3f202ac82a90c2cafa91c80943e1b9ed comparators-paper-5reps/qU02.sh +cc48bd0d9ee290e1497bae0a485c01d2cb926108c67f294baeeb93ab6d1e34c3 comparators-paper-5reps/qU03.sh +1669cf143490d50bd9f470bce5e23cb1e3487363f80da5e7dbeebe167c76d6fc comparators-paper-5reps/qU04.sh +96932d46da23ddba4af6db5fbb2720c4312626a0b01a8bc95516ab18e8c00e25 comparators-paper-5reps/qU05.sh +6b7ff085278cd07350ea084e3d7c918fb2153afff3f94162899229c03f86f645 comparators-paper-5reps/qU06.sh +0c15689a0e021b477a06a61f17d0e80c9dc21fcd22587153118a6eaa2a2b6581 comparators-paper-5reps/qU07.sh +27f9ad8d9222078d570dd9a1178420c05d144fe7ffd64377e480ede5b4a5ea0a comparators-paper-5reps/qU08.sh +6914b13a73cbb8746335e8dac050cb00af19ebb68fc5f3c4b74eb2c3beeb45c4 comparators/qS01.sh +4cba25e2053c7d33015563d5f0e8f60fbb216e99de4f55ad9760b5be38374b59 comparators/qS02.sh +4e057ae64dbb57685ff6a40e763147b7911f38419e677beff3181df7cc01a1d9 comparators/qS03.sh +3fa1e2d5590105e41f65683cad56c1c9ccd82e83485a42f0491f7b0e7eed6745 comparators/qS04.sh +71cad788cd518d7398a281ede5be2eb75147f3c6c8e636233482d47a3f051c04 comparators/qS05.sh +676fcec52b2cce30c2d7bddab9264f00fb2cebb032ba71d7e17626b6646022d9 comparators/qS06.sh +e6efe99a2f297195861c24b92b7216f18e19a3c5288d240f0ed632f987af8f84 comparators/qS07.sh +1a1f8e4236cf61f983a092ee50b784c02398cd3c1c8bef5503ac05e57ab858e2 comparators/qS08.sh +15f47f0a5e311bd883257bf5df5d866dd675e1b5e7ecac7f2d6189a4d705b750 comparators/qS09.sh +7f295742c9dc1be312b36eafd6a081146341aee7d9929b12d683798f1f4555ce comparators/qS10.sh +d62a505d0bfb8e956e627f69f81e37dbef4a3e6c0e7ba954f5ba779e9a127186 comparators/qS11.sh +e17aa0b7156e06b8b98c4b925789349acb799bf0eb81f54dd2cf7623d03c2b52 comparators/qS12.sh diff --git a/benchmarks/experiments/test_jpype_pin.py b/benchmarks/experiments/test_jpype_pin.py index 35305bc4206..dd9693923c1 100644 --- a/benchmarks/experiments/test_jpype_pin.py +++ b/benchmarks/experiments/test_jpype_pin.py @@ -57,7 +57,7 @@ def _build(tmp_path, *, wheel, pip_packages, installed, arg=PIN): if wheel: (wheels / "arcadedb_embedded-26.10.1-cp312-cp312-manylinux_2_34_x86_64.whl").write_bytes(b"x") bindir = tmp_path / "bin" - bindir.mkdir() + bindir.mkdir(parents=True) log = tmp_path / "pip.log" (bindir / "pip").write_text(f'#!/bin/sh\necho "$@" >> {log}\n') # -S: no site-packages, so a JPype installed in the interpreter running this test is never seen @@ -114,6 +114,47 @@ def test_build_images_reads_the_default_from_the_dockerfile_and_passes_it_down() assert subprocess.run(["bash", "-n", str(HERE / "build_images.sh")]).returncode == 0 +def _run_build_images(tmp_path, args, wheel=None): + """build_images.sh copied into a scratch folder, with a `docker` that only records its argv.""" + import shutil + work = tmp_path / "w" + work.mkdir(parents=True) + for n in ("build_images.sh", "Dockerfile.bench"): + shutil.copy(HERE / n, work / n) + bindir = tmp_path / "bin" + bindir.mkdir(parents=True) + (bindir / "docker").write_text('#!/bin/sh\necho "$@" >> "' + str(tmp_path / "docker.log") + '"\n') + (bindir / "docker").chmod(0o755) + env = {"PATH": f"{bindir}:{os.environ['PATH']}", "HOME": str(tmp_path)} + if wheel is not None: + env["ARCADEDB_WHEEL"] = str(wheel) + r = subprocess.run(["bash", str(work / "build_images.sh")] + args, cwd=work, env=env, capture_output=True, text=True) + return r, work + + +def test_build_images_has_no_pypi_fallback_for_the_arcadedb_image(tmp_path): + for args in (["arcadedb"], ["duckdb", "arcadedb"], []): # [] is every target, arcadedb included + r, _ = _run_build_images(tmp_path / ("-".join(args) or "all"), args) + assert r.returncode == 1 and "REFUSING: the arcadedb image needs ARCADEDB_WHEEL" in r.stderr, args + assert "26.8.1" not in r.stdout + r.stderr + + +def test_build_images_refuses_a_wheel_that_is_not_a_file(tmp_path): + r, _ = _run_build_images(tmp_path, ["duckdb"], wheel=tmp_path / "nope.whl") + assert r.returncode == 1 and "is not a file" in r.stderr + + +def test_the_images_that_take_no_wheel_build_without_one_and_carry_none(tmp_path): + r, work = _run_build_images(tmp_path, ["duckdb", "client"]) + assert r.returncode == 0, r.stderr + assert not list((work / "docker-wheels").glob("*.whl")) + wheel = tmp_path / "arcadedb_embedded-26.10.2-cp312-cp312-manylinux_2_34_x86_64.whl" + wheel.write_bytes(b"x") + r, work = _run_build_images(tmp_path / "with", ["arcadedb", "duckdb"], wheel=wheel) + assert r.returncode == 0, r.stderr + assert [w.name for w in (work / "docker-wheels").glob("*.whl")] == [wheel.name] + + def test_the_pair_check_reads_the_pin_from_the_dockerfile_and_checks_the_embedded_image(): text = (HERE / "verify_pair_c25.sh").read_text() assert """sed -n 's/^ARG JPYPE_VERSION=//p' "$HERE/Dockerfile.bench\"""" in text @@ -213,7 +254,7 @@ def test_a_comparator_stage_does_not_read_jpype_out_of_dbbench_arcadedb(tmp_path pins = {"ARCADEDB_ENGINE_COMMIT": "d" * 40, "ARCADEDB_WHEEL": str(wheel), "ARCADEDB_SERVER_IMAGE": "arcadedb-c25:26.10.2"} G.emit_all(str(out), G.number(G.subset_specs(["duckdb"], ["l2"], "paper"), "qS"), pins, None, 3) text = (out / "qS01.sh").read_text() - assert "IJ=$(docker run" not in text and "dbbench:arcadedb" not in text.replace("no dbbench:arcadedb needed", "") + assert "IJ=$(docker run" not in text and "--entrypoint python3 dbbench:arcadedb" not in text def _snippet(text, first, last): diff --git a/benchmarks/experiments/test_stage_generator_2611.py b/benchmarks/experiments/test_stage_generator_2611.py index 594ffd10dba..10e09a01524 100644 --- a/benchmarks/experiments/test_stage_generator_2611.py +++ b/benchmarks/experiments/test_stage_generator_2611.py @@ -164,7 +164,8 @@ def test_stage_problems_catch_an_arm_outside_the_subset(): def test_lint_catches_an_unset_instrument_a_shared_rows_file_and_a_foreign_arm(): - good = ('export BENCH_INSTRUMENT=2026-11\nRF="runs_page_${PIN}_2611.jsonl"\nBACKENDS="sqlite duckdb"\n') + good = ('export BENCH_INSTRUMENT=2026-11\nRF="runs_page_${PIN}_2611.jsonl"\nBACKENDS="sqlite duckdb"\n' + 'is not the wheel this chain was generated for\n') assert G.lint_draft(good, "s.sh") == [] assert G.lint_draft(good.replace("export BENCH_INSTRUMENT=2026-11\n", ""), "s.sh") assert G.lint_draft(good.replace("_2611", ""), "s.sh") @@ -221,23 +222,25 @@ def test_projection_prices_the_lane_cells_of_each_stage(tmp_path): # ------------------------------------------------------------------------------------ the ArcadeDB pair's guards -PAIR_GUARDS = ("is not in dist/", "wheels in dist/", "is not the wheel this chain was generated for", "no server image", - "ABORT: dbbench:arcadedb carries wheel", "ABORT: dbbench:arcadedb runs JPype", "ABORT: pair unverified at the pin") +PAIR_GUARDS = ("wheels in dist/", "no server image", "ABORT: dbbench:arcadedb carries wheel", + "ABORT: dbbench:arcadedb runs JPype", "ABORT: pair unverified at the pin") +WHEEL_GUARDS = ("is not in dist/", "is not the wheel this chain was generated for") -def test_a_comparator_only_stage_has_no_arcadedb_wheel_or_image_guard(drafts): +def test_a_comparator_only_stage_guards_the_wheel_it_bakes_and_nothing_of_the_arcadedb_arms(drafts): for f in sorted(drafts.glob("*.sh")): t = f.read_text() + # what the image build needs: the pinned wheel at its path with its sha256, exported BEFORE build_images.sh + for g in WHEEL_GUARDS: + assert g in t, (f.name, g) + assert t.index("is not the wheel this chain was generated for") < t.index("export ARCADEDB_WHEEL=") < t.index("./build_images.sh") + assert re.search(r'^export ARCADEDB_WHEEL="\$W" ARCADEDB_SERVER_IMAGE="arcadedb-c25:e85469273"$', t, re.M), f.name + # what concerns the ArcadeDB arms themselves for g in PAIR_GUARDS: assert g not in t, (f.name, g) - assert "dbbench:arcadedb" not in t.replace("no dbbench:arcadedb needed", "") - assert "dist/*.whl" not in t and "verify_pair_c25.sh" not in t - # the rows still carry the pin, and the runner's together-or-not-at-all rule still holds + assert "--entrypoint python3 dbbench:arcadedb" not in t + assert "./verify_pair_c25.sh" not in t and "docker image inspect \"$ARCADEDB_SERVER_IMAGE\"" not in t assert "export ARCADEDB_ENGINE_COMMIT=$PIN" in t - assert re.search(r'^export ARCADEDB_WHEEL=".*/dist/' + re.escape(WHEEL) + r'" ARCADEDB_SERVER_IMAGE="arcadedb-c25:e85469273"$', - t, re.M), f.name - # ... and is exported only after the image build, which bakes ARCADEDB_WHEEL into every generic image it builds - assert t.index("./build_images.sh") < t.index("export ARCADEDB_WHEEL=") assert "arcadedb" not in re.findall(r"^BENCH_ALLOW_DEV=0 \./build_images\.sh (.*?) >>", t, re.M)[0].split() @@ -249,7 +252,7 @@ def test_an_arcadedb_release_stage_keeps_every_guard_of_the_pair(tmp_path): assert stages for f in stages: t = f.read_text() - for g in PAIR_GUARDS: + for g in PAIR_GUARDS + WHEEL_GUARDS: assert g in t, (f.name, g) assert re.findall(r"^BENCH_ALLOW_DEV=0 \./build_images\.sh (.*?) >>", t, re.M)[0].split()[0] == "arcadedb" assert t.index("is not the wheel this chain was generated for") < t.index("./build_images.sh") < t.index("pair unverified") @@ -257,11 +260,14 @@ def test_an_arcadedb_release_stage_keeps_every_guard_of_the_pair(tmp_path): def test_the_lint_demands_the_pair_guards_exactly_where_an_arcadedb_arm_runs(tmp_path): base = ('export BENCH_INSTRUMENT=2026-11\nRF="runs_page_${PIN}_2611.jsonl"\n') - guards = "is not the wheel this chain was generated for\nABORT: dbbench:arcadedb carries wheel\n" + wheel = "is not the wheel this chain was generated for\n" + guards = wheel + "wheels in dist/\nABORT: no server image\nABORT: dbbench:arcadedb carries wheel\nABORT: pair unverified at the pin\n" assert G.lint_draft(base + 'BACKENDS="arcadedb_graph_embedded"\n' + guards, "s.sh") == [] - assert G.lint_draft(base + 'BACKENDS="arcadedb_graph_embedded"\n', "s.sh") + assert G.lint_draft(base + 'BACKENDS="arcadedb_graph_embedded"\n' + wheel, "s.sh") + assert G.lint_draft(base + 'BACKENDS="duckpgq_graph"\n' + wheel, "s.sh") == [] + assert G.lint_draft(base + 'BACKENDS="duckpgq_graph"\n', "s.sh") comp = G.lint_draft(base + 'BACKENDS="duckpgq_graph"\n' + guards, "s.sh") - assert any("guards the pinned wheel" in p for p in comp) + assert any("guards one wheel in dist/" in p for p in comp) # ------------------------------------------------------------------------------- an ABORT hands on (CAMPAIGN rule) diff --git a/bindings/python/docs/benchmarks/running.md b/bindings/python/docs/benchmarks/running.md index 4ed051f6314..af356f40db0 100644 --- a/bindings/python/docs/benchmarks/running.md +++ b/bindings/python/docs/benchmarks/running.md @@ -71,7 +71,8 @@ The graph lane at SF1 is the cheapest published tier, so it is the one to try fi cd benchmarks/experiments # Phase A: build the per-backend images. Parallel, nothing is measured here. -bash build_images.sh +# The arcadedb image takes the wheel under test from ARCADEDB_WHEEL (there is no PyPI fallback). +ARCADEDB_WHEEL=/path/to/arcadedb_embedded--.whl bash build_images.sh # The dataset switches, from the repository rather than from someone's shell history. source campaign_env.sh