Skip to content

3.x.x: load-harness realism, checked-in presets, a nightly workflow and a per-PR smoke run (#521 item 6) - #536

Merged
djh58 merged 2 commits into
3.x.xfrom
djh58/prism-b521-harness-nightly
Sep 28, 2026
Merged

djh58 merged 2 commits into
3.x.xfrom
djh58/prism-b521-harness-nightly

Conversation

@djh58

@djh58 djh58 commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Refs #521 (item 6: the nightly and on-demand load harness, the per-PR smoke run, and the harness realism added to it), #473.

What

Harness realism. Every option is off by default. A run that names none takes the old code paths, so its usernames, passwords, seeded window rows, round-robin offers and token bucket are byte for byte what they were. A test pins that.

Flag Models
--recipients N, --recipient-weights uniform|zipf:s|pareto:a|whale:f+<dist> Distinct payout addresses. Their sessions and seeded window shares follow the weights. The window's recipients are the live sessions' addresses, with the P2MR programs the server derives, so a payout merges them as production does
--session-hashrate-sigma, --session-difficulty vardiff:<ratio> Per-session hashrate and a converged-vardiff difficulty. Each session asks for it with d= in its Stratum password, which the server honours with vardiff off. The configured difficulty is the window difficulty over the mean offered multiplier, so the average live share weighs what a seeded share does and the window keeps its length
--template-bits A harder fake network. A three-order spread over a 400k window otherwise needs share difficulties below 2^-32, the least a share target can express (its target is already 2^256). The entry check refuses such a spread and names the factor needed
--arrival bursty:cv1=,cv60=,max= Seeded per-second and per-minute rate bursts around each phase's rate, capped at a peak
--pool-fee-bps The pool fee on, as mainnet runs it. With it, dust below the payout floor is swept to the fee instead of refusing the template (#525)
--seed, --plan tips, --preset Reproducible draws; a warm-up-only plan with no artifact; a checked-in preset whose flags cannot be given again

The side report gains a population block. It records the distributions asked for, and per address the generated weight, sessions, seeded window shares, and accepted live shares and work, with top-1/top-10/Gini concentration and the difficulty spread. Each phase gains an arrival block: offers per second and their 1 s and 60 s coefficient of variation.

Presets. crates/qbit-prism-load/presets/*.json pin every result flag; the harness and a test both refuse a preset that omits one or leaves it to a default. Each preset also names its runner, timeout, schedule and gates.

Preset Schedule Runner
d1-20k, d1-20k-realistic (#271's D1 20k fixture at its pre-#497 admission, and with 500 Zipf(1.1) addresses) nightly 8 vCPU
tip-275, tip-275-realistic (#275's tip-delivery benchmark with --retarget-bits, and with 500 addresses) nightly 8 vCPU
d1-473-400k-fe1-async (#473's production-window D1 baseline cell, exactly as run on a193705) nightly 8 vCPU
mainnet-floor (130 addresses, 85% whale over a Zipf tail, three orders of difficulty, bursty arrivals peaking at 400/s, 400k window, 200 bps fee) and growth-5x nightly 8 vCPU
#473's other seven cells (200k/400k/500k, 1/2/4 frontends, sync) and growth-20x manual 16 vCPU
smoke every PR 2 vCPU

Gate. qbit-prism-load-gate holds a run to its preset:

The D1 presets gate only the 500 shares/s steady_state. The 2,000/s burst is reported in #473's verdict-table columns, not gated: #473 found no configuration that meets it. The other presets gate warm-up, steady_state and reconnect, not the deliberately degraded slow_database.

Workflow. .github/workflows/prism-load-nightly.yml runs on schedule, and on workflow_dispatch with inputs for the presets, the ref, and overrides of the tip and shortfall budgets. Per preset it:

  • builds the server and the harness in release mode;
  • records pg_test_fsync on the filesystem the harness puts its cluster on;
  • runs the preset through .github/scripts/prism-load-run.sh, which reproduces a nightly run anywhere;
  • writes the gate's table to the job summary and uploads the reports.

A live-nightly job runs the opt-in live_regtest variants listed in test/prism-nightly-gated-tests.txt with --ignored --exact: #523's -reindex crash variant and #524's 130-payee weighted recipients. It proves them executed with check_gate_manifest.py. The schedule fires from the default branch, so a follow-up PR to main will carry this file alone.

Per-PR smoke. The gated test qbit-prism-load::load_smoke::the_smoke_preset_serves_every_session_every_tip_and_reconciles runs the smoke preset against a debug server and holds it to the preset's gates: every session gets work on every tip within 5 s, and reconciliation is exact. The preset is one frontend, 100 sessions over 20 addresses under a 60% whale and a Zipf tail with a two-order difficulty spread, a 20k window, and 3 retargeting tips. CI cost: about 55-70 s on its shard (about 22-37 s building the debug server beside the test's own build, then about 30 s running).

Verification

  • cargo fmt --check and cargo clippy -p qbit-prism-load --all-targets -D warnings are clean.
  • qbit-prism-load tests pass: 136 harness, 21 realism/preset/gate, smoke, and quorum.
  • The Python matrix tests pass; actionlint and shellcheck are clean.
  • The nightly live job's command and manifest proof pass locally for both variants.
  • Mutants that fail the smoke test: a server that holds new-tip delivery 6 s (tips unserved, shortfall), and a server that ignores d= (exit 8, premise contradicted).

Local preset runs (release builds, private PostgreSQL 16 with fsync on; a shared development host, so indicative rather than qualification numbers):

Preset Gate Tip to last notify p99 Notes
mainnet-floor pass 684 ms over 6 tips whale 83.9% of accepted work, difficulty spread 3.00 orders, window held 400,000 -> 400,222. Before the fee and the difficulty fixes this run found #525: 12.7 s with no new-tip work on both frontends
tip-275-realistic pass 721 ms over 8 tips
d1-20k fail 581 ms steady_state shortfall 30,473: #473's rule not met on this host
growth-5x fail 7,955 ms warm-up shortfall 9,230; the host was under heavy load from other work, so treat this as indicative only

Follow-ups in this lane: connection churn and rentals with a rental-churn preset (next PR), and scenario 5's dense-cadence soak wired into live-nightly.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…nd 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]>
@djh58
djh58 requested a review from kiwidream September 28, 2026 18:58
…nciliation 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]>
@djh58

djh58 commented Sep 28, 2026

Copy link
Copy Markdown
Member Author

Review ledger (head 19aefecb, CI green)

CI. All 20 checks pass. The prism-integration proof includes the new gated qbit-prism-load::load_smoke::the_smoke_preset_serves_every_session_every_tip_and_reconciles. It added 52.5 s to its shard: 18 s building the debug server beside the test's own build, 34 s running. Every session got every tip within 1.47 s.

Review (/code-review, medium, on the harness and workflow).

# Finding Disposition
1 A preset flag pinned false or null is left off the expanded command line, so the command line could still set it and run another workload under the preset's name and SHA-256 Fixed in 19aefecb. expand_command_line refuses any flag the preset pins, whatever its value. The test covers a set flag, a flag pinned off and a null one
2 The schedule, and possibly dispatch, only fire from the default branch (main) Planned. After this merges, a follow-up PR to main carries prism-load-nightly.yml alone, identical to this one, with ref defaulting to 3.x.x
3 The README still said the gate fails on reconciliation unexpected Fixed in 19aefecb, with the gate change below

Found by the local preset runs, fixed here.

  • The gate failed a run whose only reconciliation difference was a share PostgreSQL committed after the drain window cut off its answer. The harness explains that case and exits 0. The gate now fails on acknowledged shares missing from PostgreSQL. It reports committed-without-acknowledgement beside its explanations, since an unexplained one is a durability finding and a divergence inside the run exits 5, and both of those stay gated. (19aefecb)
  • Before 44cb1099 was signed, a vardiff whale displaced the seeded window within a minute. The configured difficulty is now the window difficulty over the mean offered multiplier.
  • Before 44cb1099, a three-order spread over a 400k window would have needed share difficulties below 2^-32. --template-bits fixes that, and the entry check refuses such a spread.
  • The first mainnet-floor run found 3.x.x: with the pool fee disabled, the first sub-floor balance stops all work building (silent mining stall) #525: with the fee off, dust recipients below the payout floor stalled new-tip work 12.7 s on both frontends. The realism presets now run mainnet's 200 bps fee.

Mutants that fail the smoke test. A server that holds new-tip delivery 6 s leaves tips unserved and causes shortfall. A server that ignores d= exits 8 (premise contradicted).

Local preset runs. Release builds, private PostgreSQL 16 with fsync on. The host is shared, so these are indicative and not qualification numbers. The exclusive benchmark lock was starved for about an hour, so mainnet-floor ran under the shared lock.

Preset Lock Gate Tip to last notify p99 Notes
mainnet-floor shared pass 684 ms, 6 tips whale 83.9% of accepted work, difficulty spread 3.00 orders, window 400,000 -> 400,222, no #525 deferral
tip-275-realistic exclusive pass 721 ms, 8 tips 1 commit explained as drain-ended
d1-20k exclusive fail 581 ms steady_state shortfall 30,473: #473's rule not met on this host
growth-5x exclusive, but the quiet gate timed out at 1-min load 11.7 fail 7,955 ms warm-up shortfall 9,230; contaminated by other load, indicative only
d1-473-400k-fe2-async exclusive aborted 987 ms steady_state shortfall 178; the frontend restart then aborted on a host shared-memory fault, not a CI concern

The same gates run nightly on the 8 vCPU runners once the workflow is on main, so these numbers get their CI baseline there.

@djh58
djh58 merged commit 0c8842e into 3.x.x Sep 28, 2026
21 checks passed
djh58 added a commit that referenced this pull request Sep 28, 2026
… (#538)

GitHub fires schedule triggers, and offers workflow_dispatch, only for
workflows on the default branch. This adds prism-load-nightly.yml to main,
byte-identical to the copy merged to 3.x.x in #536.

Its jobs check out the ref input, which defaults to 3.x.x. The presets,
scripts, gate and composite actions they run therefore come from 3.x.x,
and nothing else changes on main.

Refs #521

Co-authored-by: Claude Opus 5.5 <[email protected]>
Anatolie added a commit that referenced this pull request Sep 30, 2026
…uilds from #536 to #568 launched (#511)

From 0c8842e (#536) up to 65c9751 (#568) the harness has
--pool-fee-bps but leaves the fee off at 0, so the comparison FAILed a
base in that range at every throughput preset. A fee-off frontend now
satisfies a pinned 0, as legacy-flags.json already accepts; a fee off
at a nonzero pin or an enabled fee at another rate still fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant