Repository navigation
test(desktop): fail the typing benchmark over 16 ms locally and 25 ms on CI - #218
Merged
Merged
Conversation
… on CI GitHub's runners draw different CPUs, and the same code measured 10.4 to 21.1 ms a keystroke in live preview across 19 runs, so a 16 ms gate on CI passed or failed by the runner. make desktop-bench now fails over localTypingBudget (16 ms), or over ciTypingBudget (25 ms) when CI=true. TestTypingBudgets keeps the two values apart. ADR-0043 records the limits and the figures. Closes #193
bketelsen
approved these changes
Nov 12, 2026
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.
Summary
Closes #193.
BenchmarkTypingInALongNote(make desktop-bench) now fails when a keystroke in a 10,000-line note costs more than the typing gate. Before, it only printed the figure.localTypingBudget), one frame at 60 Hz. This is plan 0009's gate for source mode (Phase 2) and live preview (Phase 5).ciTypingBudget), selected only whenCIis true. GitHub Actions setsCI=true.TestTypingBudgetsholds the two values apart: the local gate must be 16 ms, the CI gate must be above it, and only a trueCIselects it.ADR-0043 records the decision. Plan 0009 (Phases 2 and 5),
AGENTS.md(Gates), thedesktopjob's comment and thedesktop-benchhelp line say the same.Why 25 ms on CI
The
ubuntu-24.04runner draws different CPUs. These are theBenchmarkTypingInALongNotefigures from theNative desktop appjob, in 19 runs ofmainand its branches from 2026-11-11 to 2026-11-12:Runs: 43081519232, 43084464171, 43085427771, 43127310696, 43131798511, 43139223248, 43140903791, 43145932676, 43147531919, 43223038425, 43225303846, 43226635018, 43229048340, 43229921377, 43230554296, 43233097956, 43233241074, 43239778953, 43241551068 (
mainat c7d68a7, after #216: 17.5 ms on an EPYC 7763).The slowest CPU is about twice as slow as the fastest, and 10 of the 19 runs are over 16 ms. 25 ms is the highest figure, 21.1 ms, plus a margin of about a fifth: runs on one CPU spread up to 8%, and a slower CPU can appear. On the slowest CPU seen, a keystroke that grows by about a fifth fails CI. On the fastest, it can nearly double first, so the 16 ms local gate stays the strict one.
Risk tier
Risk tier: 3 —
risk:highpaths, each with a comment or help-text change only:.github/workflows/ci.yml(L2, governance: CI): only the comment above the existingmake desktop-benchstep changes. No step, permission, action pin or job name changes. The step can now fail, which is the gate's purpose.Makefile(L2, governance: the gates): only thedesktop-benchhelp text changes. The command is the same.Docs housekeeping
TEMPLATE.md(ADR-0043)docs/README.mdAGENTS.md)Verification
make checkgreen (host), andmake verifyexit 0make desktop-benchpasses locally (AMD Ryzen 9 6900HX: source 3.4 ms, live 12.4 ms), with and withoutCI=truelocalTypingBudgetset to 5 ms,go test -run '^$' -bench BenchmarkTypingInALongNote -benchtime 100x ./internal/desktop/editor/failsBenchmarkTypingInALongNote/livewitha keystroke took 12.41407ms, over the typing gate of 5ms (local 5ms, CI 25ms), andmake desktop-benchfailsTestTypingBudgetspermissionsandpersist-credentialsunchangedReview
Cross-review:
openai/gpt-6.1-sol(coderanthropic/claude-opus-5-5), basec7d68a7.003d2af: Ready, Blocking: none. 1 low finding: the ADR said onlyCI=trueselects the CI gate, butstrconv.ParseBoolalso takes1,tandTRUE. Fixed in1806b55(wording only).1806b55: Ready, no findings.Revert test: the change is a new gate, not a fix of code under test. The check is the forced failure above (the gate set to 5 ms fails
BenchmarkTypingInALongNote/liveandTestTypingBudgets).