Skip to content

[M11] Durability dial and numbers slider from measured bench data (M11.6) - #95

Merged
ssoufii merged 1 commit into
mainfrom
auto/m11.6-durability-dial-numbers-slider
Nov 17, 2026
Merged

ssoufii merged 1 commit into
mainfrom
auto/m11.6-durability-dial-numbers-slider

Conversation

@ssoufii

@ssoufii ssoufii commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Adds the two sections that make the performance claims concrete: the durability dial and the numbers slider, both fed from figures generated out of the README.

Where the numbers come from

scripts/bench-data.mjs parses the README's Performance section into web/src/data/bench.json (machine, invocation, and per policy the records/s, MiB/s, elapsed, reads/s, p50 and p99). It runs in prebuild and predev, so a build cannot ship a figure that disagrees with the README, and --check re-derives the file and exits non-zero if the committed copy has drifted.

The file is committed as well as generated, because TypeScript imports it and npm run typecheck runs before npm run build in CI. The generator throws rather than emitting a file with a hole in it, so a README restructure breaks the build loudly instead of quietly blanking a figure.

Parsing the README rather than running the bench is deliberate: the bench measures the machine it runs on, and the figures on the page are from one named machine (an M1 laptop), not from a CI runner or from whoever's browser is open. The README is where that run was written down.

Acceptance criteria

  • A script generates web/src/data/bench.json from the README's Performance section, runs as part of the build, and a test fails if the JSON and the README disagree.
  • The durability section has the enlarged, working segmented control (arrow keys move between options), swaps the field colour and the heading word, and shows the measured figure and bench invocation for the chosen policy.
  • The numbers section has a logarithmic slider and a figure equal to records divided by the measured fsync=never rate, with the formula in words and the invocation beside it.
  • Playwright: choosing each policy shows the README figure for that policy; the slider at 1,000,000 shows 15.5 s; arrow keys move the slider.

What ran, and what passed

  • pytest: 1264 passed. ruff check src tests and ruff format --check src tests: clean. No Python changed in this story.
  • In web/: npm ci, lint, typecheck, build: clean.
  • npx playwright test: 86 passed across both projects (default and chromium-reduced-motion). Playwright ran locally, not only in CI.

The page's figures are checked against the README parsed in the test, with a regex written for the test rather than imported from the generator. A test that read bench.json and compared it to the page would only prove the page can read a file. The slider is also checked at both ends of its range (10,000 records reads 0.155 s, 100,000,000 reads 1,551 s), not only at the one value the story names.

I opened the two sections at 1440 and 390, with and without a policy chosen, and checked them against section 6.

Two findings my own house-rules spec produced

Worth stating, because they were caught rather than designed around:

  1. Literal type sizes had crept in. The enlarged dial label and the figure's unit suffix were written as literals in page.css. They are now --step-dial and --step-figure-unit in the token file, documented as sizes belonging to a control and to a figure rather than new places on the five step scale.
  2. The keyboard rule was wrong about composite widgets. It expected every control to be its own tab stop, which a radio group is not: the group is one stop and the arrow keys move within it. The rule now excludes a negative tabindex from the tab walk and fails a negative tabindex that is not inside a composite widget (radiogroup, tablist, menu, listbox, grid), so a control still cannot simply be dropped out of the tab order. Movement inside the group is asserted in bench.spec.ts.

Decisions taken without asking

  • The control bleeds off the right and takes its crop at the bottom. Section 6 asks for a crop of about a fifth on both edges, but a horizontal segmented control 46svh tall is wider than 1440 from the centre, so cropping the right by a fifth would leave the "always" segment mostly off screen in a region that cannot scroll. The bottom takes the crop, the right takes a bleed, and no segment is cut.
  • Which ground each policy takes. Section 6 gives the section two grounds and says the control swaps between them without saying which is which. The split that means something is whether the policy syncs at all, so the accent field marks the settings that make a durability promise.
  • The section rests on "fast and durable?" with nothing chosen, which is the heading section 6 starts from. The radio group starts unchecked, with the first option as the tab stop.
  • The invocation does not wrap. A long shell command that soft wraps breaks after a hyphen and turns --value-size into - and -value-size, which makes the command look like something else. It is a labelled, focusable region that scrolls sideways instead.

Closes #84


Generated by Claude Code

…rkload

Story M11.6. scripts/bench-data.mjs parses the README's Performance section
into web/src/data/bench.json and runs on every build, so a build cannot ship
a figure that disagrees with the README; --check re-derives the file and
fails if the committed copy has drifted.

The durability section is the fsync control enlarged until it is the
section: choosing a policy swaps one word of the heading, swaps the field's
ground between grey and deep maroon by whether the policy syncs at all, and
shows that policy's measured throughput with the invocation that produced
it. It is a radio group, so it is one tab stop and the arrow keys move
within it.

The numbers section is a logarithmic slider from ten thousand to a hundred
million records and one figure: the count divided by the measured
fsync=never rate, with the division written out in words beside it.

The house rules spec gained a rule while this was built: a control with a
negative tabindex is correct inside a composite widget and wrong anywhere
else, so it is now excluded from the tab walk and flagged outside one.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QWNkuNh5Bysnfo2KrxL9Sp
@ssoufii
ssoufii merged commit 9d0cfd3 into main Nov 17, 2026
9 checks passed
@ssoufii
ssoufii deleted the auto/m11.6-durability-dial-numbers-slider branch November 17, 2026 06:14
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.

[M11] Durability dial and numbers slider from measured bench data (M11.6)

2 participants