Skip to content

fix(chartgen): name the backend when a drain slice's corpora disagree - #162

Open
zannis wants to merge 1 commit into
mainfrom
zannis/fix/attribute-drain-corpus-by-backend
Open

fix(chartgen): name the backend when a drain slice's corpora disagree#162
zannis wants to merge 1 commit into
mainfrom
zannis/fix/attribute-drain-corpus-by-backend

Conversation

@zannis

@zannis zannis commented Sep 7, 2026

Copy link
Copy Markdown
Owner

What

The drain caption collected every in-slice corpus into one BTreeSet and rendered it flat:

…until 90 % of a corpus of 6M / 30k messages, published before they started, had been consumed

That names both sizes and attributes neither. A reader cannot tell which series drained which, which is strictly worse than naming one size or naming them all.

When every backend ran the same corpus the sentence is correct and stays exactly as it is. When they disagree, the sentence stops naming a size and a second caption line attributes them:

…until 90 % of its corpus, published before they started, had been consumed; no producer ran in the window

corpus differs by backend: inmemory 22k, kafka 2.2k — a smaller corpus is a shorter window, not a different measurement

Why now

It has never fired, because one pinned matrix means one corpus — MATRIX pins --drain-messages 6000000 for every backend.

The upcoming six-backend rerun is about to make it fire. SQS measures at ~900 msg/s against LocalStack, so the pinned corpus makes its pass ~51 h on this host (~17 h on a 3× faster one) to produce a 1.7-hour window measuring what a 30k corpus measures in seconds. The decision taken on that work is to run SQS on a smaller corpus, recorded as a documented deviation on the row and captioned on the chart.

The row half already works: drain.corpus is on every drain row, so the document records it by construction. The chart half is this PR — without it the deviation reaches the reader as an unattributed pair of numbers.

Scope of the rendering change

Every committed SVG still byte-matches. the_committed_results_document_renders_every_family (the svg == committed byte-compare) passes untouched, because both runs in the committed document drained identical corpora per payload leg:

backend 64 B 1 KiB 64 KiB
inmemory 6000000 3145728 49152
kafka 6000000 3145728 49152

Tests

  • one_shared_corpus_is_stated_once_and_never_attributed — the uniform case keeps the flat sentence and adds no attribution line.
  • a_backend_that_drained_a_smaller_corpus_is_named_in_the_caption — the deviating case names each backend's corpus, drops the flat claim, and keeps the drain rule.

One existing assertion moved from the raw SVG to the text nodes joined — the idiom this file already uses for caption prose ("wrapped text must keep every word"). The shorter sentence re-wraps at NOTE_WRAP, splitting no producer ran in the window across two <text> nodes; where a line happens to break was never part of the claim.

Verification

cargo fmt -- --check                                             # clean
cargo clippy --no-default-features --all-targets -- -D warnings  # clean
cargo nextest run --no-default-features                          # 334/334 passed

Depends-on: none — the caption change stands alone; the six-backend rerun that will exercise it depends on this, not the other way round.

The drain caption collected every in-slice corpus into one set and rendered
it flat: "a corpus of 6M / 30k messages". That names both sizes and
attributes neither, so a reader cannot tell which series had the shorter
window — worse than naming one size or naming them all.

It has never fired, because one pinned matrix means one corpus. It is about
to: the upcoming six-backend rerun measures SQS on a deliberately smaller
corpus, since at ~900 msg/s on LocalStack the pinned 6M-message corpus is a
~51 h pass measuring what a 30k one measures in a minute. The row already
records `drain.corpus`, so the deviation is in the document; the chart was
where it went unsaid.

The flat sentence is kept for the case it is true of — every backend on the
same corpus — so every committed SVG still byte-matches. When they disagree
the sentence stops naming a size and a second caption line attributes them.

The existing drain-rule assertion moves to the text nodes joined, the idiom
this file already uses for caption prose: the shorter sentence re-wraps, and
where a line breaks was never part of the claim.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 7, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
shove-docs 71f0ddc Commit Preview URL

Branch Preview URL
Sep 07 2026, 09:16 PM

@codecov

codecov Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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