Load a parallel arm beside the serial one, and guard it (#465) - #474
Merged
ChronicallyJD merged 1 commit intoAug 7, 2026
Merged
Conversation
…ndprompt#465) bench/ loaded every engine with a single serial COPY, so our own benchmark understated our own loader by seven times: 87.2s serial against 12.4s at 16 workers on 2M ClickBench rows, measured on commandprompt#465, with identical stored size. The arm is reported BESIDE the serial number rather than replacing it. Serial COPY is the single-connection ingest path and parallel_copy is the bulk path; both are real capabilities and both are worth publishing. It is deliberately not in ARMS, because the 43 queries have nothing to say about a table that exists to be loaded, and running them would double the run for no reading. The guarding is the part that mattered. parallel_copy prepares one transaction per worker and the stock max_prepared_transactions is 0, so every parallel arm errors on its first worker and returns in about no time. commandprompt#465 records a harness that printed those failures as 0.0s / 0.8s / 1.1s / 1.3s which is indistinguishable from perfect scaling and is exactly the shape someone would publish. Three things now stop it: the cluster is configured with one slot per worker, a preflight refuses to start when the RUNNING cluster cannot supply them (asked of the cluster, not of the file this script wrote, because an operator may point it at their own), and the loaded row count is asserted exactly. The guards live in bench/cb_guards.sh so the matrix can test them. The benchmark needs a 15 GB download and a tuned cluster; its arithmetic needs neither, and a decision that cannot be tested without the dataset would never be tested. test/bench_guards.sh covers them in the ordinary five-major run. Both guards are verified by removal. Weakening the preflight to always-true fails two checks; weakening the row check to a plain string compare fails one. That second proof caught a hole in my own test. The first version asserted only that ONE missing side is refused, and both of those cases pass with the numeric check deleted, because an empty string is unequal to a number either way. The case that distinguishes them is BOTH sides missing, which a plain compare calls equal -- the commandprompt#418 trap, met while writing the test for it. The suite now asserts that one. Not covered here: the wiring itself is not exercised end to end, because this machine has no ClickBench dataset. What is proven is the arithmetic of the guards, that the source line resolves from another working directory, and that the script parses. The 7x figure is commandprompt#465's measurement, not a new one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L2DvnWDM7g27ubDCQdXhky
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #465.
bench/loaded every engine with a single serialCOPY, so our own benchmark understated our own loader by seven times: 87.2s serial against 12.4s at 16 workers, identical stored size. Those are #465's measurements, not new ones; this machine has no ClickBench dataset.The arm
Reported beside the serial number, not instead of it. Serial
COPYis the single-connection ingest path andparallel_copyis the bulk path; both are real capabilities.It is deliberately not in
ARMS: the 43 queries have nothing to say about a table that exists only to be loaded, and running them would double the run for no reading. That also means it needs its own row assertion rather than inheriting the one overARMS, which it has.PGC_CB_PCOPY_WORKERS=0skips it entirely.The guarding is the part that mattered
parallel_copyprepares one transaction per worker and the stockmax_prepared_transactionsis 0, so every parallel arm errors on its first worker and returns in about no time. #465 records a harness that printed those failures aswhich is indistinguishable from perfect scaling, and is the shape a reader would publish. Three things now stop that:
ON_ERROR_STOPplus|| diemean the load cannot return quietlyThe preflight message names the setting, the value, and that it needs a restart, because the alternative is meeting a per-worker error in a load log and working back to the cause.
Why the guards are in their own file
bench/cb_guards.shis sourceable, sotest/bench_guards.shcan run in the ordinary five-major matrix. The benchmark needs a 15 GB download and a tuned cluster; its arithmetic needs neither, and a decision that could only be tested with the dataset would never be tested.Both guards proved by removal
The second proof caught a hole in my own test. The first version asserted only that one missing side is refused, and both of those pass with the numeric check deleted, because an empty string is unequal to a number either way. The case that distinguishes them is both sides missing, which a plain compare calls equal. That is the #418 trap, met while writing the test for it. The suite now asserts that case, and it is the one that goes red on removal.
Gate
harness_selftestalongside because this registers a new suite, and #473's sortedness and registration checks are what keep that honest.Stated plainly: what is not covered
The wiring is not exercised end to end, because there is no ClickBench dataset on this machine. Proven here: the guards' arithmetic, that the
sourceline resolves from another working directory, and that the script parses. The first real run is the first end-to-end exercise, and the preflight is what makes that run fail fast rather than publish a wrong number.