Repository navigation
3.x.x: launch load-harness frontends at the production initial-job admission (#275) - #497
Conversation
…mission (#275) The harness sized PRISM_STRATUM_MAX_PENDING_INITIAL_JOBS to sessions_per_frontend + 16 (128 at least), so a 2,000-session frontend ran with 2,016 permits while production runs the server default of 128. That let every session build its first job at once and, on the real process, inflated the post-publish delivery tail by 50-190 ms against the default, so #275's real-process figures were taken at an admission production never runs. Add --stratum-max-pending-initial-jobs, defaulting to 128 and validated at entry against the connection cap the harness derives (the server refuses more permits than connections). The flag and its default are the only sources: Args::stratum_limits is the one derivation, validate checks it, shared_environment exports it and the child's environment is cleared, so the value the process reads is the validated one. The side report records, per frontend, the launched value read back from its environment, its source (default or the flag), the production default and the pre-flag value for the run's shape, with a null rather than a zero when the launch environment cannot state it. The capacity-evidence artifact is unchanged: the validator's 16 keys do not include the admission. Evidence taken before the flag keeps its meaning: pass the old value to reproduce it, and the README, the honest-value notes and the throughput measurements doc say which admission such runs used. The endpoint, the 400k population, 2,000 sessions, deadlines, receipt reconciliation and the load gates are untouched. Tests: the flag omitted, nondefault (2016, 1) and invalid (0, above the cap, non-numeric) at entry; the value reaching a really launched process, through the run's own launch path against a stand-in that echoes what it read, with a value in the harness's own environment shown not to leak; and the provenance block's null-not-zero. Refs #275 Co-Authored-By: Claude Fable 5.1 <[email protected]>
…and state the permit queue honestly (#275) /code-review on #497: `std::env::set_var` inside a threaded test binary races libc's `getenv` in other tests (the reason it became unsafe in edition 2024), and the property it served -- no second reader between the flag and the frontend -- is `Command::env_clear` in `Frontend::spawn`. The launch test now shows that on a variable the test process really inherits from Cargo, `CARGO_MANIFEST_DIR`, echoed by the stand-in as unset. The README said each queued session waits behind at most 128 builds; the permit queue is first-in, first-out, so the last of 2,000 waits behind every earlier waiter, inside the server's 30 s initial-job timeout. It now says so, and what a slow database or a much larger session count does to the tail. Refs #275 Co-Authored-By: Claude Fable 5.1 <[email protected]>
…d the admission once (#275) Thermo-nuclear pass on #497, run inline: the pre-flag sizing (sessions_per_frontend + 16, at least 128) was inlined in the side report's block while every other shape-derived limit lives on StratumLimits, and the topology block repeated the per-frontend admission record, so one report carried the same fact from two sources (the arguments and the launch environment). The formula is now a StratumLimits method, and the per-frontend block -- read back from the environment the process was launched with -- is the one record. Refs #275 Co-Authored-By: Claude Fable 5.1 <[email protected]>
Real-process proof: 2,000 sessions admitted at the default (128)Two runs on this host, both under the shared measurement lock, one frontend, 2,000 sessions, 400k-window, release binaries, managed PostgreSQL 16.15. Binaries. Server built from this branch with Run 2 (comparable shape, same arguments as the #275 two-frontends 128-permit arm):
Run 1 (my first shape: Both runs prove configuration and admission of all 2,000 sessions only; neither is a performance comparison. |
…art-phase caveat (#275) Independent adversarial review of #497 (Fable, on adeef89): - The throughput measurements doc gave the pre-flag admission as sessions_per_frontend + 16 without the 128 floor, so the 200-session premise probes, which ran the floor, would have been "reproduced" at 116. The row now states the floor and says which rows need the flag. - The README's test summary said 16 configuration keys; the server's CONFIGURATION_KEYS has 17 and the test asserts against its length. - The README's honest-values note covered the setup queue but not the reconnect phase's drained restart, where a frontend's whole session set re-enters the same permit queue: reconnect p50/max are not comparable across the admission-flag boundary either, and it says so. Docs only; no source change, so the 2,000-session proof on 7d242ad stands. Refs #275 Co-Authored-By: Claude Fable 5.1 <[email protected]>
Deep-review ledger (final round)Head reviewed: 1339971 (docs-only on 7d242ad; source unchanged since 7d242ad, so the 2,000-session proof above stands). Stakes: low, harness configuration and reporting only. Lanes
Dispositions
No open findings. Not merged by me. |
…nd a per-PR smoke run (#521 item 6) (#536) * 3.x.x: load-harness realism, checked-in presets, a nightly workflow and a per-PR smoke run (#521 item 6) qbit-prism-load gains a realistic population, all of it off by default so every existing run takes its old code paths byte for byte: - --recipients N and --recipient-weights uniform|zipf:s|pareto:a| whale:f+<dist>: distinct payout addresses whose sessions and seeded window shares follow the weights. The window's recipients are the live sessions' addresses, with the programs the server derives for them. - --session-hashrate-sigma and --session-difficulty vardiff:<ratio>: each session asks for its own difficulty with d= in its Stratum password. The configured difficulty is the window difficulty over the mean offered multiplier, so the window keeps its length. - --template-bits: a harder fake network, so a three-order spread over a 400k window stays above 2^-32, the least a share target can express. The entry check refuses a spread below that floor. - --arrival bursty:cv1,cv60,max: per-second and per-minute rate bursts. - --pool-fee-bps: the pool fee on, as mainnet runs it. - --seed: every draw is reproducible. - --plan tips: warm-up only, with no artifact. The side report records the generated and driven population per address, and each phase's realised arrival. Presets in crates/qbit-prism-load/presets pin every result flag. The harness and a test both refuse a preset that omits one or leaves it to a default. There are 16: the #271 D1 20k fixture, #275's tip-delivery benchmark, a 500-address variant of each, #473's eight D1 cells exactly as run on a193705 (pre-#497 admission), mainnet-floor, growth-5x, growth-20x and the smoke preset. qbit-prism-load-gate holds a run to its preset's gates: exit 0, reconciliation, per-phase shortfall, #473's rule where asked, and the tip-to-last-notify p99. It prints #473's verdict-table columns. .github/workflows/prism-load-nightly.yml runs the nightly presets on 8 vCPU runners, and any selection on dispatch. It records pg_test_fsync, uploads the reports and writes a job summary. Its live-nightly job runs the opt-in live_regtest variants listed in test/prism-nightly-gated-tests.txt and proves them with the gate manifest. The per-PR smoke run is a gated test that drives the smoke preset against a debug server and adds about a minute to its shard. Refs #521, #473 Co-Authored-By: Claude Opus 5.5 <[email protected]> * 3.x.x: refuse a pinned preset flag on the command line, and gate reconciliation as the harness defines it (#521) A preset flag pinned false or null is left off the expanded command line, so clap never saw it twice. The command line could then set it and run a different workload under the preset's name and SHA-256: --recipients, a burst, --mid-flight-kill or --database-url on tip-275, for example. expand_command_line now refuses any flag the preset pins, whatever its value. The gate failed a run whose reconciliation had a committed share without an acknowledgement, although the harness explains each one and exits 0 for a submit whose answer the drain window cut off. It now gates acknowledged shares missing from PostgreSQL. It reports those commits beside their explanations. An unexplained commit is still a durability finding, and a divergence inside the run still exits 5, and both remain gated. Refs #521 Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Refs #275. Harness-only:
crates/qbit-prism-loadconfiguration, CLI, launch environment, side-report provenance, docs and tests. No server source, alert files or perf-worker artifacts.What changed
The harness sized
PRISM_STRATUM_MAX_PENDING_INITIAL_JOBStosessions_per_frontend + 16(128 at least), so a 2,000-session frontend ran with 2,016 initial-job permits while production runs the server default of 128. That let every session build its first job at once and, on the real process, inflated the post-publish delivery tail by 50–190 ms against the default (#275 profiling, section 6 of the two-frontends write-up).--stratum-max-pending-initial-jobs <N>, default 128 (the server's own default). Positive, and at most the connection cap the harness derives (2 × sessions_per_frontend + 64, at least 384): the server refuses to start with more permits than connections, so the harness refuses the pair at entry with the cap named.Args::stratum_limitsis the only place the listener limits are derived;validatechecks it,run::shared_environmentexports it, and the child's environment is cleared, so the value the process reads is the validated one. No environment variable is read by the harness for this.frontend_environment[].stratum_admission: the launched value read back from the process's own environment, its source (defaultor the flag), the production default and the pre-flag value for the run's shape. An unstatable value isnull, never0.honest_value_notesgains a note. The capacity-evidence artifact is untouched: the validator's 16 configuration keys do not include the admission.2016for 2,000 sessions on one frontend,1016for two,516for four) reproduces it. The README flag table, the honest-values section anddocs/prism-throughput-measurements.mdsay which admission those runs used.Untouched: the endpoint, the 400k population, 2,000 sessions, every deadline, receipt reconciliation, and the load gates.
Tests
the_initial_job_admission_defaults_to_production_and_is_bounded_at_entry: omitted → 128;2016and1accepted;0, above-cap (2,016 on four frontends, cap 1,064),-1,abc,1.5, empty refused; the error names the cap and the sessions per frontend.the_initial_job_admission_reaches_a_launched_frontend_as_the_flag_or_its_default: the run's own launch path (shared_environment→frontend_environment→Frontend::launch) against a stand-in server that echoes what it read, for omitted/2016/1, withPRISM_STRATUM_MAX_PENDING_INITIAL_JOBS=7set in the harness's own environment and shown not to reach the child; the provenance block for each case; the evidence configuration block unchanged.an_admission_the_launch_environment_cannot_state_is_null_not_zero.cargo test --locked -p qbit-prism-load(123 passed),cargo clippy --all-targets -D warnings,cargo fmt --check: clean.Real-process proof (in progress)
A release server and harness are being built from this commit and a 2,000-session, one-frontend, 400k-window
shortrun at the default admission (128) is queued under the shared heavy lock. Its side report (sessions_with_work, every session holding work before the first phase, the reconnect phase's completions, andfrontend_environment[0].stratum_admission) will be posted here with the binaries' SHA-256. That run proves configuration and admission of all 2,000 sessions only; it is not a performance comparison.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.