Input latency profiler + recorder + baseline (review-only) - #4
Open
hitpopdimestop wants to merge 15 commits into
Open
Input latency profiler + recorder + baseline (review-only)#4hitpopdimestop wants to merge 15 commits into
hitpopdimestop wants to merge 15 commits into
Conversation
…in trace metadata
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.
What this branch adds
An opt-in, zero-by-default input-latency profiler for the presentation editor, plus a reproducible browser recorder/comparator and a captured baseline. No product behavior changes unless profiling is explicitly enabled.
Instrumentation (
packages/super-editor)InputLatencyProfiler(presentation-editor/performance/) — created only whenSD_DEBUG_INPUT_LATENCY/__SD_DEBUG_INPUT_LATENCY__is set. Correlatesbeforeinput → transaction → coalesced render → per-phase layout → DOM paint → next frameand emits standard User Timing measures. When disabled it allocates nothing (one null check at each call site).PresentationInputBridge— one synchronous hook for an eligible visiblebeforeinput(including input that lands on the focused hidden editor).PresentationEditor— records the transaction, render coalescing, per-phase timings, DOM paint, and the following animation frame; cleans up on destroy.performance.now()in the rAF callback (not the frame-start argument), so there are no physically-impossible next-frame < DOM-paint samples.Dev tooling (
devtools/input-latency/, dev-only, alongsideword-benchmark-sidecar)profile.mjs— Playwright recorder: fixed protocol (1 warm-up + 5 measured runs of 40 chars @100Ms across normal / 4×-CPU / layout-off), fixture SHA verification, full trace/discard metadata, strict completeness validation before write.report.mjs/report.test.mjs— deterministic statistics, fingerprinting, comparison, and report-completeness validation (unit-tested).compare.mjs— strict comparison CLI with a materiality rule (max(5ms, 2×MAD)).README.md— exact record/compare workflow. Raw reports live underresults/and are gitignored.How to review
packages/super-editorchanges are the instrumentation surface; check the opt-in gating and the disabled-path no-ops.devtools/input-latency/is standalone tooling;report.test.mjscovers the pure logic.Notes
pnpm-workspace.yamlbumpsplaywrightcatalog to^1.60(Node 24.16extract-zipinstall hang);pnpm-lock.yamlpicked up some incidental@types/nodedrift that would be cleaned before any upstream submission.type-checkhas a large pre-existing failure baseline in this repo; these changes add no new type errors.