perf: index Pen snapping with reference parity#127
Merged
Conversation
dompm
commented
Jul 13, 2026
dompm
left a comment
Owner
Author
There was a problem hiding this comment.
The index removes steady-state curve flattening and the randomized vertex/alignment checks pass, but equal-length parity still has an uncovered ordering regression.
- [P1] Preserve project piece order in equal-length queries. The reference implementation appends qualifying piece segments in
piecesorder, butqueryLengthSnappopulates itsSetin active-draft-point order. If an earlier draft point touches later project piece B and a later point touches earlier piece A, B is queried first. With A offering length 10, B length 20, and a current length of 15, the reference chooses 10 while the index chooses 20. Collect membership first, then iterate qualifying piece indexes in project order. - The randomized parity suite does not call
queryLengthSnap; it covers vertex, ordinary alignment, and Shift alignment only. Add fixed and randomized equal-length parity cases, including equal-distance ties and reversed active-point/project-piece ordering.
Cached linear Shift alignment is permitted by the plan, so its full vertex scan is not itself a blocker unless tracing shows it is material.
dompm
force-pushed
the
codex/interaction-snap-index
branch
from
July 13, 2026 19:22
fe8b6bf to
fc18b9c
Compare
Deploying vitrai with
|
| Latest commit: |
df25762
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b934e987.vitrai.pages.dev |
| Branch Preview URL: | https://codex-interaction-snap-index.vitrai.pages.dev |
dompm
force-pushed
the
codex/interaction-viewport
branch
from
July 13, 2026 19:22
83635dd to
a5d83ce
Compare
dompm
force-pushed
the
codex/interaction-snap-index
branch
from
July 13, 2026 19:44
fc18b9c to
2fc10c5
Compare
dompm
commented
Jul 13, 2026
dompm
left a comment
Owner
Author
There was a problem hiding this comment.
The project-order fix is correct and the reversed active-point regression now passes.
- [P2] Complete the requested randomized equal-length parity coverage. The randomized loop still exercises only vertex, ordinary alignment, and Shift alignment.
queryLengthSnapis compared with the reference in one fixed case only. Add randomized active drafts that touch multiple pieces in varying order, including ties, and comparequeryLengthSnapwithfindLengthSnapacross the 6/24/96-vertex fixtures before calling the full snap parity run complete.
dompm
force-pushed
the
codex/interaction-viewport
branch
from
July 13, 2026 20:00
54ca1ee to
aae8e12
Compare
dompm
force-pushed
the
codex/interaction-snap-index
branch
2 times, most recently
from
July 16, 2026 15:08
300790c to
75c469a
Compare
dompm
force-pushed
the
codex/interaction-snap-index
branch
from
July 16, 2026 16:19
75c469a to
df25762
Compare
dompm
force-pushed
the
codex/interaction-viewport
branch
from
July 16, 2026 16:19
d4f3d28 to
289779c
Compare
dompm
marked this pull request as ready for review
July 16, 2026 16:47
dompm
added a commit
that referenced
this pull request
Jul 16, 2026
* perf: frame-limit viewport gesture publication * perf: move viewport gestures into focused store subscribers * perf: narrow viewport subscriptions around stable canvas children * perf: keep glass pieces idle during pan * perf: index Pen snapping with reference parity (#127) * perf: index pen snapping with reference parity * perf: cache shift-alignment snap queries * fix: preserve project order in length snapping * test: randomize equal-length snap parity * fix: preserve current snapping behavior on indexed path
dompm
added a commit
that referenced
this pull request
Jul 16, 2026
* perf: frame-limit pen and pencil interaction controllers * fix: refresh and cancel scheduled pen previews * perf: isolate pen preview from result panel * perf: isolate pen status from app state * perf: frame-limit viewport gesture publication (#126) * perf: frame-limit viewport gesture publication * perf: move viewport gestures into focused store subscribers * perf: narrow viewport subscriptions around stable canvas children * perf: keep glass pieces idle during pan * perf: index Pen snapping with reference parity (#127) * perf: index pen snapping with reference parity * perf: cache shift-alignment snap queries * fix: preserve project order in length snapping * test: randomize equal-length snap parity * fix: preserve current snapping behavior on indexed path
dompm
added a commit
that referenced
this pull request
Jul 16, 2026
* perf: add interaction fixtures and behavior baselines * perf: cache piece geometry and memoize canvas pieces * perf: isolate stable and interaction canvas layers * perf: preview piece transforms outside project state * fix: address interaction foundation review feedback * fix: preserve debug mask composition backdrop * perf: frame-limit Pen and Pencil interactions (#125) * perf: frame-limit pen and pencil interaction controllers * fix: refresh and cancel scheduled pen previews * perf: isolate pen preview from result panel * perf: isolate pen status from app state * perf: frame-limit viewport gesture publication (#126) * perf: frame-limit viewport gesture publication * perf: move viewport gestures into focused store subscribers * perf: narrow viewport subscriptions around stable canvas children * perf: keep glass pieces idle during pan * perf: index Pen snapping with reference parity (#127) * perf: index pen snapping with reference parity * perf: cache shift-alignment snap queries * fix: preserve project order in length snapping * test: randomize equal-length snap parity * fix: preserve current snapping behavior on indexed path
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
Why
Steady Pen movement should not repeatedly flatten every piece or scan unrelated geometry.
Stack
Depends on #126 (
codex/interaction-viewport).Verification
This is a draft pending performance review and browser regression testing.