Repository navigation
Decide each coordinate's winner in one place, and file memberships by winner changes - #2603
Merged
Merged
Conversation
… winner changes Four readers worked out which action wins a widget coordinate: the projection fold, `build_threads`, `thread_memberships`, and (through memberships) sample selection. `events.Standing` is now the one reading: an action stands from admission until an undo withdraws it or a version note retracts what it rests on, and the latest standing action wins. Readers of the final state admit the log's actions with its whole floors and withdrawals; `thread_memberships` walks the log, handing undos and notes to `withdraw` and `restate` where they fall, and each step reports the winner change it caused, if any. Memberships are now exact: an event files under the threads it names, the membership of the gesture an undo takes back, and the answers of the winner before and after each change it causes. A later action no longer joins every earlier answer still standing at its coordinate, only the winner it displaced, so it releases no held news for an answer it did not unseat, and a note files only under threads whose closure it changes. Sample selection lost nothing: since #2515 it copies whole coordinates. Every step costs what it touches: a note reaches the actions resting on what it restates through an index, and each coordinate keeps its actions in a linked order, so its winner stays constant to reach after removals. 64k actions at one coordinate, each undone newest- or oldest-first, take about 0.4 s. A new test checks, over every three-step history of answers, non-answers, undos and notes, that each thread whose resolution `build_threads` changes is in the event's membership; main's code fails it on the case #2515 fixed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 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.
Four readers worked out which action wins a widget coordinate: the projection fold,
build_threads,thread_memberships, and sample selection through memberships. This gives that rule one home,events.Standing, and makes the step-by-step reader linear.The reading. An action stands from admission until an undo withdraws it or a version note retracts what it rests on, and the latest standing action wins, including one answering nothing.
build_threadsand the projection fold admit the log's actions with its whole floors and withdrawals.thread_membershipswalks the log instead, handing undos and notes towithdrawandrestatewhere they fall; each step reports aChangeonly where the winner moved.Memberships are now exact. An event files under the threads it names, the membership of the gesture an undo takes back, and the answers of the winner before and after each change it causes. Before, a later action joined every earlier answer still standing at its coordinate, so it could release held news for an answer it did not unseat; a note now files only under threads whose closure it changes. Sample selection loses nothing, since #2515 copies whole coordinates.
Cost. A note reaches the actions resting on what it restates through an index, and each coordinate keeps its actions in an
OrderedDict, whose tail stays constant to reach after removals. 64k actions at one coordinate, each undone newest- or oldest-first, take about 0.4 s.Tests.
test_every_change_to_a_threads_resolution_reaches_its_membershipchecks, over every three-step history of answers, non-answers, undos and notes at one coordinate, that each thread whose resolutionbuild_threadschanges is in the event's membership; the code before #2515 fails it. A case pins that undoing an answer another has superseded files only under its own thread. Across 28,561 four-step histories,build_threadsmatches the previous code and no note over-includes a thread.