Skip to content

Native release: a speed smoke of the candidate wheel against the previous release - #457

Merged
tae898 merged 2 commits into
mainfrom
feat/404-native-update-smoke
Nov 23, 2026
Merged

tae898 merged 2 commits into
mainfrom
feat/404-native-update-smoke

Conversation

@tae898

@tae898 tae898 commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

I added the release-time speed smoke that #404 asks for: scripts/native_update_smoke.py and its runbook docs/modules/ROOT/pages/development/release-native-smoke.adoc. Native wheels built from one commit differ in speed on the single-record UPDATE, so the release has to measure the wheel it publishes. The tool takes the previous release as the baseline and one or more candidate wheels, and measures them on the current host in one session.

What it measures: each wheel is installed into its own throw-away environment (uv run --no-project --with <wheel>, from a private copy named by its sha256), and one fresh process per wheel per round runs the process state of the paper cell on synthetic rows (the async executor, the parallel columnar load of LineItem with 300,000 rows, the Part load with 200,000 rows, the indexes, the warm-up), then the single-record phases, each operation in its own begin and commit pair. The verdict figure is the median latency per operation of UPDATE Crud SET qty = 2 WHERE ckey=:c with a parameter, through command(). The order is interleaved (ABBA over the rounds). The ratio is the median of the per-round ratios against the baseline with a 95% percentile bootstrap interval. The control is the baseline against itself in its own processes of the same session. Each process hashes the library it loaded and compares it with the libarcadedb.so member of its wheel.

Exit status Meaning
0 at least one candidate passed (upper end of its interval below --max-ratio, default 1.10)
1 no candidate passed
2 refused or a process failed (usage, more than 4 allowed cores without --quick, fewer than 8 or an odd number of rounds, a wheel that does not load, a library that is not the wheel's)
3 the control is not inside 0.97 to 1.03: the session is not readable

The tool reads Cpus_allowed_list from /proc/self/status, records it, and does not pin anything itself: the caller pins it and every process checks that it runs on the same set. --out writes a JSON file with the host, the allowed cores, the hashes of the wheels and libraries, the schedule, every process and every ratio and interval. The default is 12 measured rounds plus one warm-up round. --hash-only prints the library sha256 of a wheel, for the release notes and for checking a published wheel afterwards.

How to run it (the runbook has the full commands, including how to get the candidate from the artifact native-release-dist while Publish to PyPI waits for its reviewer, and what to write into the release notes):

taskset -c <cores of one compare lane> uv run --no-project python -I scripts/native_update_smoke.py \
  --baseline <previous release wheel> --out smoke.json <candidate wheel> [<candidate wheel> ...]

What it leaves out of the cell: real TPC-H data (the rows are synthetic, of the same columns and types, LineItem a tenth of scale factor 1 and Part the scale-1 count), the harness around the cell (its container, its memory sampler, its other phases and queries), and the key streams of the cell (the keys come from a seeded generator of the script). The heap and the relaxed WAL flush of the cell are set through ARCADEDB_NATIVE_ISOLATE_ARGS (--isolate-args, default -Xmx8g -Darcadedb.txWalFlush=0). A pass says something about the host class where it ran and about the Linux x86-64 wheel only.

Two things I did not do. I did not run the tool on a real wheel: this PR was written with static checks only, no timed run and no dispatched build, so the measurement process (the part that imports arcadedb) is checked by reading, and the first real run is on a compare lane before the 26.12.1 release. And the sha256 does not go into the release notes by a script: release-notes.yml rewrites the notes, so the runbook adds the lines by hand after the release exists. The repository has no tools/ folder, so the script is in scripts/ with the other release tools.

Related issues

Refs #404. The issue stays open until the 26.12.1 release has used the smoke.

Performance changes

None to the library or the bindings: this adds a measurement tool and its docs, and changes nothing on a hot path. No timed A/B ran for this PR.

Docs

New page development/release-native-smoke.adoc (the runbook, in the navigation) and one line in the native release section of development/release.adoc that points to it.

Checklist

  • Tests for the pure parts: tests/test_native_update_smoke.py (the ratio and bootstrap arithmetic, the ABBA schedule, the allowed cores, the verdict and exit status, the library member hash of a fake wheel, the session loop with a fake process). They need no JVM, no native library and no real wheel, so the file is in neither NATIVE_NOT_APPLICABLE nor WINDOWS_NOT_APPLICABLE, like the other tests of release scripts.
  • The test suite that the change can affect passes (CI of head 76e08a6: every check green)
  • uvx pre-commit run --files <changed files> passes (run twice)
  • compile() and pyflakes clean on the two Python files

…ious release (refs #404)

Two native wheels built from one commit differ in speed by about a third on the single-record UPDATE, because a native-image build is not reproducible and the speed of a hot path is a draw from a spread. The release has to measure the wheel it publishes. scripts/native_update_smoke.py runs the process state of the paper cell on synthetic rows in a throw-away uv environment per wheel, one fresh process per wheel per round, in an interleaved ABBA order, with the baseline against itself as the control. It prints the ratio of the median of the per-round ratios with a bootstrap 95% interval, the library sha256 and the engine version of each candidate, and a verdict (PASS when the upper end is below 1.10). The exit status is 0 when a candidate passed, 1 when none did, 2 for a refused run and 3 when the control is outside 0.97 to 1.03. It refuses more than 4 allowed cores unless --quick, and each process checks that it loaded the library of its wheel.

The runbook is development/release-native-smoke.adoc: when to run it (while Publish to PyPI waits for the reviewer, on the artifact that job will upload), the commands, how to read the verdict, what to do when none passes (reject, re-run, up to 4 builds), and what goes into the release notes. The tests cover the pure parts only and need no JVM, native library or wheel.

This only refers to #404: the issue stays open until the 26.12.1 release has used the smoke.
@tae898 tae898 added this to the 26.12.1 milestone Nov 22, 2026
@tae898 tae898 added python Pull requests that update python code performance Speed or memory of the bindings, with a measurement native The arcadedb package (native library build) labels Nov 22, 2026
@tae898 tae898 self-assigned this Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

native The arcadedb package (native library build) performance Speed or memory of the bindings, with a measurement python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant