Repository navigation
perf(gpui): update freehand stroke bounds incrementally - #3341
Open
himanshu748 wants to merge 2 commits into
Open
himanshu748 wants to merge 2 commits into
himanshu748 wants to merge 2 commits into
Conversation
Contributor
|
@himanshu748 is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
himanshu748
marked this pull request as ready for review
October 26, 2026 07:40
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This branch has not been deployed
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.
Growing a freehand screenshot annotation currently rescans every stored point whenever a new sample passes the 2px spacing threshold. Keep the active gesture's raw minima and maxima instead, so maintaining bounds visits each accepted sample once. The same points, spacing rule and final normalization remain in use; retaining raw extrema avoids rounding drift from reconstructing a maximum as
x + width.The included ignored benchmark compares complete sample ingestion against the previous full scan, including annotation/point allocation and cleanup. It performs two warmups and nine alternating before/after measurements and reports medians. On Linux x86_64 (KVM, AMD EPYC 7763), using rustc 1.99.1 with opt-level 3, thin LTO and one codegen unit, an extracted-source harness using the real
cap_project::Annotationmeasured:These are accumulated CPU costs for ingesting an entire stroke, not per-frame or end-to-end drawing latency. Path generation, tessellation, paint and final normalization are outside the timed region. Independent measurements in three processes, including duplicate and subthreshold events, corroborated the scaling.
Validation:
--lib --no-deps -- -D warnings.git diff --checkpass.jxl-oxide, resolved with a locked Linux dependency fetch. The restarted full check was then interrupted (exit 130) after a system probe confirmed missing ALSA development files. A focusedcargo check -p alsa-sys --locked --offlineexited 101 becausealsa.pcis unavailable. Full native GPUI compilation and GUI execution remain unverified locally; no macOS execution claim is made. The local GPUI dependency checkout also predates two current preparation patches, so a configured checkout or CI must perform the native validation.Reproduce the committed tests and benchmark in a configured native checkout:
Native CI on
857021707dd2dc029960c8b4195113071bc3389c: all fivefreehand_boundsregressions pass on Linux (1,553 app tests), Apple Silicon (1,478), Windows (1,437), and Intel macOS (1,473), with zero failures. The benchmark is intentionally ignored by CI; the measurements above remain local isolated-harness results. CI tested merge299d5760935d600e2ef2a691b556ca77a127fac1, containing this exact head and basef6046f1.All five Actions workflows completed successfully: CI, Engine verify, Verify recording, Perf budget, and Linux desktop reliability (GNOME, NixOS, niri and Hyprland). Both GitHub-required checks, Engine verify and Verify recording, pass. Vercel's two deployment statuses require maintainer authorization and are separate from code validation. No manual GUI session was performed locally.


Confidence Score: 5/5
This PR appears safe to merge.Summary
Freehand strokes now keep raw minima and maxima instead of rescanning every stored point after each accepted sample.
Reviews (1) · Last reviewed commit: "perf(gpui): update freehand stroke bound..." · Reviewed by Greptile