Skip to content

3.x.x: the load report says what the host was doing at each tip, and the tip-delivery, mainnet-shape and churn presets gate their median tip (#842) - #854

Merged
kiwidream merged 1 commit into
3.x.xfrom
orca/842-load-notify-latency
Nov 13, 2026
Merged

kiwidream merged 1 commit into
3.x.xfrom
orca/842-load-notify-latency

Conversation

@kiwidream

@kiwidream kiwidream commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

The problem

On 2026-11-03 three PR runs of the run-load set each failed a tip-to-last-notify gate, each on a different preset. No nightly failed one on the same code. The triage for #842 found the runner, not the code. The findings are drafted as a comment on #842.

  • The trend tracks VM speed, not commits.
    • No server or harness source changed between the 10-23 and 10-27 nightlies, or across 11-03, 11-04 and 11-11.
    • Each frontend's initial full refresh of the same seeded 416,260-row window took 6.5–17.9 s across the 39 preset runs examined. This is the frontend's snapshot_ms on its trigger="initial" refresh line.
    • Tip-delivery's median tip follows it over 13 runs at r = 0.87 (the gate's nearest-rank median), or r = 0.90 with the midpoint median.
    • Fast VMs give the same latency before 10-27 (572–624 ms) and after it (526–571 ms).
  • Each failure was one stalled tip on its own VM. Medians are nearest rank, as the gate computes them.
PR Preset Slowest tip / median tip Where the time went
#833 tip-delivery-2000-miners-400k-2fe-retarget 4,546 / 1,039 ms 1st tip: refresh 1.5 s plus 2.9 s of fan-out, on both frontends at once
#835 mainnet-shape-130-addresses 4,860 / 1,005 ms 3rd tip: refresh 4.1–4.6 s. A PostgreSQL check query took 1.1–1.8 s on both frontends, with no checkpoint running
#834 rental-churn-bursts-and-storms 3,826 / 569 ms 6th churn tip, after the 2,000-rental burst: refresh 2.1 s plus 1.7 s of fan-out

The change, in two commits and a follow-up

1. Measure the host

The harness now reads /proc/stat and /proc/pressure/{cpu,io,memory} every --process-sample-interval-ms (new contention module).

  • Where the figures go: a host_contention block per phase, and per tip in time_to_usable_work and each churn section.
    • A tip's window runs from the node's tip stamp to its slowest session's first usable job.
    • When some session never got the tip, the window runs to the next tip instead, covering the time those sessions were starved.
  • What each figure divides:
    • steal and iowait are shares of the CPU time the kernel accounted.
    • The PSI figures (some and full) are shares of the harness's monotonic time from before one read of a file to after the next.
      That is the most the two totals can cover, so time the sampler loses around a read lowers a share and never raises it past what the kernel counted.
    • Each gives its share over the window and its worst interval.
  • Unknown stays unknown: a host without PSI or without a steal field reports that figure as null with a reason, never 0.
    • CPU full is not read, because the kernel reports it as zero at the system level.
    • The run-level block records the steal counter at start. A counter still at 0 cannot tell an idle hypervisor from one that doesn't report steal, so the gate's lines carry that caveat when it reads 0.
    • The sampler takes one last read as the run stops, so the final interval and a late tip have a read after them.
  • Lock sampler: it adds its longest gap between polls, with PostgreSQL's clock_timestamp() of the poll that ended it. A gap counts if its interval overlaps the phase, so a stall that began before the phase is still the phase's.
  • Gate: a failed tip row, main or churn, gets one informational row. It shows the host over the slowest tip, over its phase, and that phase's longest sampler gap. gate::tip_timeline prints each tip's line.

All of it is additive to the report. An older report gates as before and simply gets no host row. A report without churn or a soak keeps its shape (the tips are reached with pointer_mut, not indexing). The top-level key is added to the load smoke's golden key list.

2. Gate the median tip and give the slowest tip room for a stall

This applies #805's split to the nightly presets with tip budgets.

Preset Median tip Slowest tip (was)
tip-delivery-2000-miners-400k-2fe-retarget (and -500-addresses) 2,500 ms 5,000 ms (2,500)
mainnet-shape-130-addresses, mainnet-shape-650-addresses 3,000 ms 6,000 ms (3,000)
rental-churn-bursts-and-storms churn rows (8 tips) 3,000 ms 6,000 ms (3,000)
  • New key for churn tips: churn_tip_last_notify_median_budget_ms, optional and validated like 3.x.x: gate the real-node smoke on a median it can support and print where a slow tip's time went (#790) #805's key (finite and positive; absent or null means not gated). A preset whose median budget is above its p99 budget is refused, for either pair.
  • Rental churn's warm-up row is not split. Its 2 warm-up tips keep their 3,000 ms p99 and no median, because the nearest-rank median of 2 is the faster one.
  • One check for both: the churn rows now go through the same check as the run's own tip rows.
  • The report records every gate: its preset.gates block now serialises preset::Gates whole, so the median keys and new_session_first_job_p99_budget_ms are in it.
  • Docs: the README gate table, the workflow's dispatch description and the scenario criteria say the same thing.

The trade-off, plainly:

  • Now passes: a regression confined to at most half the tips that lands between 1× and 2× the budget. A nearest-rank median of n tips is the ceil(n/2)-th fastest, so that is up to 3 of 6 or 4 of 8. Examples: only the first tip after a frontend start, or only churn's burst tip.
  • Still fails:
    • The median, when a regression slows more than half the tips.
    • The median, when the run delivered fewer tips than it planned (see the follow-up below).
    • The slowest-tip row, on a stall past twice the budget or a tip some session never got.
  • Run against 11-03's three failures: their medians (1,039 / 1,005 / 569 ms) and slowest tips (4,546 / 4,860 / 3,826 ms) all pass.
  • The trend restarts for these presets: a changed preset starts a new S6 baseline (preset_sha256 is in the series key). These five series are judged again after min_baseline (5) kept nightlies.
  • The dispatch override is unchanged: the tip_last_notify_p99_budget_ms input still sets only the slowest-tip budget. The medians and churn budgets stay the preset's own, and the input's description now says so.

The commits are ordered so the first can land without the second if the gate change is not wanted.

3. Follow-up: a split gate passes only a run that delivered every planned tip

An independent verify found two gaps in commit 2.

  • F1, a run with too few tips passed. Nothing checked the tips delivered against the plan; external_tips_unminted was reported but never gated. The nearest-rank median of 2 tips is the faster one, so tip-delivery passed a run that delivered 2 of its 8 tips with one at 4,900 ms. The old single 2,500 ms budget failed it.
  • F2, wording. Exactly half the tips slow (4 of 8 at 4,900 ms) passes the median. This body said "fewer than half". The rule stays (it is 3.x.x: gate the real-node smoke on a median it can support and print where a slow tip's time went (#790) #805's nearest rank) and the wording now says "at most half passes, more than half fails", as the README's table already did.

The rule: where a median budget is gated, the median row is measured only over every tip the run planned.

  • Main rows: each phase now reports external_tips_planned beside external_tips_unminted. The gate sums them, and when the report holds fewer tips the row reads, for example, "unmeasured: 7 of 8 planned tips delivered, 1 held unminted behind a landing" and fails.
  • Churn rows: the same check, against the section's plan.tips_at_seconds, which reports have carried since 3.x.x: pre-mainnet end-to-end scenarios on regtest, plus a nightly load-harness job #521.
  • A report that does not record its plan has an unmeasured median, which fails.
  • Unchanged: the p99 rows, and every preset without a median.

Why this rule: it is the narrowest one that is exact.

  • external_tips_unminted == 0 alone misses a real node's mint that failed or never reached the watcher, since observed_mints drops those without counting them.
  • A per-preset minimum tip count would add a key to keep in step with --external-tips.
  • The planned count catches every way a tip goes missing, adds no preset key, and applies only where a median can hide a missing tip.

The A/B summary: it re-gates each base run on the candidate's preset.

  • A base harness older than this follow-up records no plan, so every base run would have failed a median-gated preset, and a candidate regression would have read "as does a base run".
  • When no phase records the plan, compare now fills it from the pinned --external-tips, which it already holds every counted run's tip list to.
  • After landing: add external_tips_planned to legacy-flags.json's report_fields, with the landed squash commit as introduced, so a newer build that drops the key is caught rather than filled. The commit is not known until squash-sign, so it can't be done in this PR.

Not changed, by choice:

  • p99-only presets don't check the plan.
  • The bridge script's tip p50 is reported over delivered tips only, and gates nothing.

Tests run

All on this branch, through the host's build gate:

No load preset was run locally.

For the follow-up (commits after d96b217):

  • cargo test --locked --offline -p qbit-prism-load --lib --test realism --test churn --test contention --test compare --test harness -- --test-threads=4: 56, 26, 7, 13, 51 and 155 passed. The new tests:
    • realism: a_tip_median_is_measured_only_over_every_tip_the_run_planned (a 2-of-8 run with one tip at 4,900 ms fails, a tip held unminted fails, a report without the plan fails, a short run with an unserved tip names both reasons) and a_tip_median_passes_a_slowdown_on_half_the_tips_and_fails_one_on_more.
    • churn: 2 of 8 churn tips delivered fails the median, and a section without its plan fails it.
    • compare: a_base_report_predating_the_tip_plan_is_held_to_the_pinned_tips.
    • harness: the ordered-tips runs record tips_planned 3, including the run with one tip held unminted.
  • cargo fmt --all -- --check: clean. cargo clippy --locked -p qbit-prism-load --all-targets -- -D warnings: clean, apart from the three known sqlx-core warnings.

Landing note: merging with #845

#845 (orca/817-alerts-check-and-report-gates) lands first. Merged with this branch, cargo test -p qbit-prism-load --lib fails to compile: E0063, a missing churn_tip_last_notify_median_budget_ms in #845's two Gates literals in preset_report_tests (run.rs, near L5876 and L5904).

  • Don't use None in both literals. With None, 3.x.x: the lint job runs the alert and metric generators' --check, and the load harness's side report carries every gate (#817) #845's every_gate_set still passes when the new key is dropped from the report.
  • every_gate_set needs Some(non-default) for the new churn median key, as its own doc says ("each value differs from its default"). the_side_report_carries_every_gate_key then catches a dropped key.
  • The golden key file should also cover preset.gates. tests/golden/fake_side_report_keys.json pins only the top_level, node, topology, versions and window keys, so it would not catch a regression in the gates block either.

What CI must cover

  • load_smoke (PostgreSQL-gated) is the only end-to-end proof of the wiring in run.rs. Its golden key set now includes host_contention. It now asserts, against a real run, that:
    • every phase has host intervals, with steal and iowait measured on Linux;
    • each PSI figure is measured or unknown with a reason;
    • the lock sampler's gap is present;
    • every driven tip, main and churn, carries a host_contention block naming its phase.
  • cargo test --workspace --all-targets picks up the new tests/contention.rs.
  • Not touched: server code, settings and metrics. The workflow edit is the dispatch input's description only, which main picks up at its next sync of the nightly workflow.

Refs #842

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T14:38:56.219459Z db8017a New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 022b8c21ac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@kiwidream
kiwidream force-pushed the orca/842-load-notify-latency branch from 022b8c2 to d96b217 Compare November 11, 2026 22:25
@kiwidream

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: d96b217e7a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@qbit-reviewer qbit-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 finding posted inline.

Reviewed by Claude Opus 5.5.

@kiwidream

Copy link
Copy Markdown
Member Author

Flake rerun: qbit-prism-server --test compact_runtime_e2e::issued_expiry_during_sql_wait_does_not_publish_or_renew_original_identity failed in shard 2 with "proxy connection task failed: forwarding server frame to client: Broken pipe (os error 32)". This PR does not touch qbit-prism-server. Run: https://github.com/Qbit-Org/qbit-mining-bootstrap/actions/runs/43111671099/job/130829000549

@kiwidream kiwidream closed this Nov 11, 2026
@kiwidream kiwidream reopened this Nov 11, 2026

@qbit-reviewer qbit-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still open from earlier reviews

  • [low] PSI share can exceed 100% because each pressure file is time-stamped after its read: crates/qbit-prism-load/src/contention.rs:349, first reported at d96b217

Reviewed by Claude Opus 5.5.

@qbit-reviewer qbit-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No bugs or security points found.

Not posted: 1 nit. Reviews post bugs and security points only; the rest stay in Sixth Man's ledger.

Reviewed by Claude Opus 5.5.

…the tip-delivery, mainnet-shape and churn presets gate their median tip (#842)

## The problem

On 2026-11-03 three PR runs of the `run-load` set each failed a tip-to-last-notify gate, each on a different preset. No nightly failed one on the same code. The triage for #842 found the runner, not the code. The findings are drafted as a comment on #842.

- **The trend tracks VM speed, not commits.**
  - No server or harness source changed between the 10-23 and 10-27 nightlies, or across 11-03, 11-04 and 11-11.
  - Each frontend's initial full refresh of the same seeded 416,260-row window took 6.5–17.9 s across the 39 preset runs examined. This is the frontend's `snapshot_ms` on its `trigger="initial"` refresh line.
  - Tip-delivery's median tip follows it over 13 runs at r = 0.87 (the gate's nearest-rank median), or r = 0.90 with the midpoint median.
  - Fast VMs give the same latency before 10-27 (572–624 ms) and after it (526–571 ms).
- **Each failure was one stalled tip on its own VM.** Medians are nearest rank, as the gate computes them.

| PR | Preset | Slowest tip / median tip | Where the time went |
|---|---|---|---|
| #833 | `tip-delivery-2000-miners-400k-2fe-retarget` | 4,546 / 1,039 ms | 1st tip: refresh 1.5 s plus 2.9 s of fan-out, on both frontends at once |
| #835 | `mainnet-shape-130-addresses` | 4,860 / 1,005 ms | 3rd tip: refresh 4.1–4.6 s. A PostgreSQL check query took 1.1–1.8 s on both frontends, with no checkpoint running |
| #834 | `rental-churn-bursts-and-storms` | 3,826 / 569 ms | 6th churn tip, after the 2,000-rental burst: refresh 2.1 s plus 1.7 s of fan-out |

- **The share-ack path degraded on the same VMs.** In each failing run, the phase holding the slow tip had a share-ack p99 of 71, 207 and 380 ms. The other 36 preset runs had 2–38 ms.
- **Nothing measured the VM itself.** No steal time, pressure stall or sampler gap was recorded, so a VM-level stall could only be inferred.
- **One stall fails the whole run.** The gated "p99 over 6 or 8 tips" is the slowest tip, nearest rank. #790 had the same problem on the real-node smoke, and #805 split that gate.

## The change, in two commits and a follow-up

### 1. Measure the host

The harness now reads `/proc/stat` and `/proc/pressure/{cpu,io,memory}` every `--process-sample-interval-ms` (new `contention` module).

- **Where the figures go:** a `host_contention` block per phase, and per tip in `time_to_usable_work` and each churn section.
  - A tip's window runs from the node's tip stamp to its slowest session's first usable job.
  - When some session never got the tip, the window runs to the next tip instead, covering the time those sessions were starved.
- **What each figure divides:**
  - `steal` and `iowait` are shares of the CPU time the kernel accounted.
  - The PSI figures (some and full) are shares of the harness's monotonic time from before one read of a file to after the next.
    That is the most the two totals can cover, so time the sampler loses around a read lowers a share and never raises it past what the kernel counted.
  - Each gives its share over the window and its worst interval.
- **Unknown stays unknown:** a host without PSI or without a steal field reports that figure as null with a reason, never 0.
  - CPU `full` is not read, because the kernel reports it as zero at the system level.
  - The run-level block records the steal counter at start. A counter still at 0 cannot tell an idle hypervisor from one that doesn't report steal, so the gate's lines carry that caveat when it reads 0.
  - The sampler takes one last read as the run stops, so the final interval and a late tip have a read after them.
- **Lock sampler:** it adds its longest gap between polls, with PostgreSQL's `clock_timestamp()` of the poll that ended it. A gap counts if its interval overlaps the phase, so a stall that began before the phase is still the phase's.
- **Gate:** a failed tip row, main or churn, gets one informational row. It shows the host over the slowest tip, over its phase, and that phase's longest sampler gap. `gate::tip_timeline` prints each tip's line.

All of it is additive to the report. An older report gates as before and simply gets no host row. A report without churn or a soak keeps its shape (the tips are reached with `pointer_mut`, not indexing). The top-level key is added to the load smoke's golden key list.

### 2. Gate the median tip and give the slowest tip room for a stall

This applies #805's split to the nightly presets with tip budgets.

| Preset | Median tip | Slowest tip (was) |
|---|---|---|
| `tip-delivery-2000-miners-400k-2fe-retarget` (and `-500-addresses`) | 2,500 ms | 5,000 ms (2,500) |
| `mainnet-shape-130-addresses`, `mainnet-shape-650-addresses` | 3,000 ms | 6,000 ms (3,000) |
| `rental-churn-bursts-and-storms` churn rows (8 tips) | 3,000 ms | 6,000 ms (3,000) |

- **New key for churn tips:** `churn_tip_last_notify_median_budget_ms`, optional and validated like #805's key (finite and positive; absent or null means not gated). A preset whose median budget is above its p99 budget is refused, for either pair.
- **Rental churn's warm-up row is not split.** Its 2 warm-up tips keep their 3,000 ms p99 and no median, because the nearest-rank median of 2 is the faster one.
- **One check for both:** the churn rows now go through the same check as the run's own tip rows.
- **The report records every gate:** its `preset.gates` block now serialises `preset::Gates` whole, so the median keys and `new_session_first_job_p99_budget_ms` are in it.
- **Docs:** the README gate table, the workflow's dispatch description and the scenario criteria say the same thing.

**The trade-off, plainly:**
- **Now passes:** a regression confined to at most half the tips that lands between 1× and 2× the budget. A nearest-rank median of n tips is the ceil(n/2)-th fastest, so that is up to 3 of 6 or 4 of 8. Examples: only the first tip after a frontend start, or only churn's burst tip.
- **Still fails:**
  - The median, when a regression slows more than half the tips.
  - The median, when the run delivered fewer tips than it planned (see the follow-up below).
  - The slowest-tip row, on a stall past twice the budget or a tip some session never got.
- **Run against 11-03's three failures:** their medians (1,039 / 1,005 / 569 ms) and slowest tips (4,546 / 4,860 / 3,826 ms) all pass.
- **The trend restarts for these presets:** a changed preset starts a new S6 baseline (`preset_sha256` is in the series key). These five series are judged again after `min_baseline` (5) kept nightlies.
- **The dispatch override is unchanged:** the `tip_last_notify_p99_budget_ms` input still sets only the slowest-tip budget. The medians and churn budgets stay the preset's own, and the input's description now says so.

The commits are ordered so the first can land without the second if the gate change is not wanted.

### 3. Follow-up: a split gate passes only a run that delivered every planned tip

An independent verify found two gaps in commit 2.
- **F1, a run with too few tips passed.** Nothing checked the tips delivered against the plan; `external_tips_unminted` was reported but never gated. The nearest-rank median of 2 tips is the faster one, so tip-delivery passed a run that delivered 2 of its 8 tips with one at 4,900 ms. The old single 2,500 ms budget failed it.
- **F2, wording.** Exactly half the tips slow (4 of 8 at 4,900 ms) passes the median. This body said "fewer than half". The rule stays (it is #805's nearest rank) and the wording now says "at most half passes, more than half fails", as the README's table already did.

**The rule:** where a median budget is gated, the median row is measured only over every tip the run planned.
- **Main rows:** each phase now reports `external_tips_planned` beside `external_tips_unminted`. The gate sums them, and when the report holds fewer tips the row reads, for example, "unmeasured: 7 of 8 planned tips delivered, 1 held unminted behind a landing" and fails.
- **Churn rows:** the same check, against the section's `plan.tips_at_seconds`, which reports have carried since #521.
- **A report that does not record its plan** has an unmeasured median, which fails.
- **Unchanged:** the p99 rows, and every preset without a median.

**Why this rule:** it is the narrowest one that is exact.
- `external_tips_unminted == 0` alone misses a real node's mint that failed or never reached the watcher, since `observed_mints` drops those without counting them.
- A per-preset minimum tip count would add a key to keep in step with `--external-tips`.
- The planned count catches every way a tip goes missing, adds no preset key, and applies only where a median can hide a missing tip.

**The A/B summary:** it re-gates each base run on the candidate's preset.
- A base harness older than this follow-up records no plan, so every base run would have failed a median-gated preset, and a candidate regression would have read "as does a base run".
- When no phase records the plan, `compare` now fills it from the pinned `--external-tips`, which it already holds every counted run's tip list to.
- **After landing:** add `external_tips_planned` to `legacy-flags.json`'s `report_fields`, with the landed squash commit as `introduced`, so a newer build that drops the key is caught rather than filled. The commit is not known until squash-sign, so it can't be done in this PR.

**Not changed, by choice:**
- p99-only presets don't check the plan.
- The bridge script's tip p50 is reported over delivered tips only, and gates nothing.

## Tests run

All on this branch, through the host's build gate:
- `cargo fmt --all -- --check`: clean.
- `cargo clippy --locked -p qbit-prism-load --all-targets -- -D warnings`: clean, apart from the three known vendored sqlx-core warnings.
- `cargo test -p qbit-prism-load --test contention`: 15 passed.
  - Parsers against real and truncated lines, plus this host's own `/proc/stat`.
  - Unknown versus a real zero for a host without PSI or a steal field, and a counter that went backwards.
  - Window math, and the tip annotation, including an unserved tip whose window runs to its replacement.
  - The lock sampler's gap, including one that straddles a window's start.
  - The sampler's final read, and the steal caveat.
  - A sampler preempted around a pressure read (the share stays at or below what the kernel counted), and the stamps on both sides of a read.
  - The gate rows: shown only on a failed tip row, absent for an old report, and pointing at an unserved tip.
- `cargo test -p qbit-prism-load --test realism`: 24 passed. #805's preset test is now `presets_gate_the_tip_median_only_where_they_split_it_from_a_stall_budget`, which covers both median keys, their refusals (including a median above its p99) and null. It is not cited in the deleted-test map, which covers 2.x.x files only.
- `cargo test -p qbit-prism-load --test churn`: 7 passed. The new churn median test uses #834's eight churn tips.
- `cargo test -p qbit-prism-load --lib --test harness --test compare --test legacy_flags --test soak_plan --test faults -- --test-threads=4`: 56, 155, 50, 3, 5 and 1 passed. Without `PRISM_TEST_PG_BIN_DIR`, the PostgreSQL-gated tests in `harness` pass without running.
- `python3 scripts/check_e2e_scenarios.py` and `python3 scripts/check_prism_pool_acquires.py`: pass.
- The first commit alone also passes clippy and the contention, realism and churn tests, so it can land without the second.
- All of the above was rerun after merging `origin/3.x.x` (#833 and #834).

No load preset was run locally.

**For the follow-up (commits after d96b217):**
- `cargo test --locked --offline -p qbit-prism-load --lib --test realism --test churn --test contention --test compare --test harness -- --test-threads=4`: 56, 26, 7, 13, 51 and 155 passed. The new tests:
  - `realism`: `a_tip_median_is_measured_only_over_every_tip_the_run_planned` (a 2-of-8 run with one tip at 4,900 ms fails, a tip held unminted fails, a report without the plan fails, a short run with an unserved tip names both reasons) and `a_tip_median_passes_a_slowdown_on_half_the_tips_and_fails_one_on_more`.
  - `churn`: 2 of 8 churn tips delivered fails the median, and a section without its plan fails it.
  - `compare`: `a_base_report_predating_the_tip_plan_is_held_to_the_pinned_tips`.
  - `harness`: the ordered-tips runs record `tips_planned` 3, including the run with one tip held unminted.
- `cargo fmt --all -- --check`: clean. `cargo clippy --locked -p qbit-prism-load --all-targets -- -D warnings`: clean, apart from the three known sqlx-core warnings.

## Landing note: merging with #845

#845 (`orca/817-alerts-check-and-report-gates`) lands first. Merged with this branch, `cargo test -p qbit-prism-load --lib` fails to compile: E0063, a missing `churn_tip_last_notify_median_budget_ms` in #845's two `Gates` literals in `preset_report_tests` (run.rs, near L5876 and L5904).
- **Don't use `None` in both literals.** With `None`, #845's `every_gate_set` still passes when the new key is dropped from the report.
- **`every_gate_set` needs `Some(non-default)`** for the new churn median key, as its own doc says ("each value differs from its default"). `the_side_report_carries_every_gate_key` then catches a dropped key.
- **The golden key file should also cover `preset.gates`.** `tests/golden/fake_side_report_keys.json` pins only the `top_level`, `node`, `topology`, `versions` and `window` keys, so it would not catch a regression in the gates block either.

## What CI must cover

- **`load_smoke`** (PostgreSQL-gated) is the only end-to-end proof of the wiring in `run.rs`. Its golden key set now includes `host_contention`. It now asserts, against a real run, that:
  - every phase has host intervals, with steal and iowait measured on Linux;
  - each PSI figure is measured or unknown with a reason;
  - the lock sampler's gap is present;
  - every driven tip, main and churn, carries a `host_contention` block naming its phase.
- **`cargo test --workspace --all-targets`** picks up the new `tests/contention.rs`.
- **Not touched:** server code, settings and metrics. The workflow edit is the dispatch input's description only, which `main` picks up at its next sync of the nightly workflow.

Refs #842

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Squashed commits:
6aac948 3.x.x: the load report says what the host was doing over each phase and each tip's delivery (#842)
b428e5f 3.x.x: the nightly tip-delivery, mainnet-shape and churn presets gate their median tip, with the slowest tip at twice the budget (#842)
d96b217 Merge remote-tracking branch 'origin/3.x.x' into orca/842-load-notify-latency
b53688c 3.x.x: a split tip gate passes only a run that delivered every planned tip (#842)
6859982 3.x.x: the A/B summary holds an older base report's tip median to the pinned tips (#842)
189e1a2 3.x.x: the A/B tip-plan fill-in leaves a report without a phase list as it is (#842)
3dcce7e 3.x.x: a PSI share divides by the time from before its first read to after its second (#842)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kiwidream
kiwidream force-pushed the orca/842-load-notify-latency branch from 3dcce7e to db8017a Compare November 13, 2026 14:36

@qbit-reviewer qbit-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved: a complete review with no bugs found.

No bugs or security points found.

Not posted: 2 nits. Reviews post bugs and security points only; the rest stay in Sixth Man's ledger.

Reviewed by Claude Opus 5.5.

@kiwidream
kiwidream merged commit 3d48a8f into 3.x.x Nov 13, 2026
46 checks passed
kiwidream added a commit that referenced this pull request Nov 13, 2026
…set_report, and its tests name #842's churn median gate

#854 changed the same block to serialize the whole gates struct inline;
preset_report does the same and is the one kept. Its two test literals name
every gate, so they gain churn_tip_last_notify_median_budget_ms.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
kiwidream added a commit that referenced this pull request Nov 13, 2026
…#842's median gate measures it (3.x.x is red since #847 and #854 both landed)

## Problem

`3.x.x` is red since #847 and #854 both landed (CI run 43456385763 on 3d48a8f): "Rust tests" and "Rust PRISM PostgreSQL and multi-instance contracts (shard 3)" fail in `qbit-prism-load --test collate`, and every PR that takes the base in fails the same way.

```
test a_report_only_points_failed_budgets_are_shown_but_never_fail_the_suite ... FAILED
test a_report_only_run_sets_aside_only_its_commit_deadlines_refusals ... FAILED
test a_report_only_run_that_did_not_reconcile_fails_the_suite ... FAILED
```

Each PR was green on its own base. Together they are not:

- #854 gave `mainnet-shape-650-addresses` a median gate (`tip_last_notify_median_budget_ms: 3000`, #842). A median is only measured when the report says how many tips its phases planned (`external_tips_planned`), so a run that lost tips cannot pass on the ones it kept.
- #847 added tests that use that preset as the gated run beside a report-only point. Their synthetic report has one tip and no `external_tips_planned`, so the collation now reports the gated run as

  `tip to last session's notify, median over tips (unmeasured: phase warm_up does not record its planned tips (external_tips_planned))`

  and fails a suite the tests expect to pass.

It is a test-fixture gap, not a defect in the gate or the collation: a report without the key is rightly unmeasured.

## Change

`crates/qbit-prism-load/tests/collate.rs`: the synthetic report's first phase records the one tip the report holds (`external_tips_planned: 1`), and the other phases record none. The report now says what a current harness says, and the median gate measures its one tip (600 ms against 3,000 ms).

No code outside the test changes.

## Tests

- `cargo test --locked -p qbit-prism-load --test collate`: 14 passed, 0 failed (on 3d48a8f without this change, CI has the three above failing).
- `cargo fmt --all -- --check`: clean.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Squashed commits:
32c308d 3.x.x: the collate tests' synthetic report records its planned tip, so #842's median gate on the 650-address preset measures it

Co-Authored-By: Claude Fable 5.2 <[email protected]>
kiwidream added a commit that referenced this pull request Nov 13, 2026
3.x.x: the collate tests' synthetic report records its planned tip, so #842's median gate measures it (3.x.x is red since #847 and #854 both landed)
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