Repository navigation
[M11] Durability dial and numbers slider from measured bench data (M11.6) - #95
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.mjsparses the README's Performance section intoweb/src/data/bench.json(machine, invocation, and per policy the records/s, MiB/s, elapsed, reads/s, p50 and p99). It runs inprebuildandpredev, so a build cannot ship a figure that disagrees with the README, and--checkre-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 typecheckruns beforenpm run buildin 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
web/src/data/bench.jsonfrom the README's Performance section, runs as part of the build, and a test fails if the JSON and the README disagree.fsync=neverrate, with the formula in words and the invocation beside it.What ran, and what passed
pytest: 1264 passed.ruff check src testsandruff format --check src tests: clean. No Python changed in this story.web/:npm ci, lint, typecheck, build: clean.npx playwright test: 86 passed across both projects (default andchromium-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.jsonand 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:
page.css. They are now--step-dialand--step-figure-unitin the token file, documented as sizes belonging to a control and to a figure rather than new places on the five step scale.radiogroup,tablist,menu,listbox,grid), so a control still cannot simply be dropped out of the tab order. Movement inside the group is asserted inbench.spec.ts.Decisions taken without asking
--value-sizeinto-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