Repository navigation
A collection's groupings by the same key share their membership nodes - #102
Merged
Merged
Conversation
A grouping puts a row in a group through a membership node, present && key == that group, which does not depend on what the grouping adds up. Yet each grouping had its own: a sum and a count of each group made two a row, and the grid, which makes a grouping per totalled column, six for six totals. Now a collection's groupings by the same field or column share them (a Pool per key): the first grouping makes a row's membership node, the others use it, each adding it to its own group's total. When a removed row's node is taken for another group (#101), the pool compiles and renames it once, and each grouping, as it follows the row, empties its member in the old group's total and joins the new one. The bookkeeping is smaller too. Group keys are numbered once a pool, so a grouping holds a row's group and its counts as numbers, not strings, and a row's membership entries (nearly always one) are held in place, with a list only for rows that have more. Fifty thousand rows, six totals grouped by one column of 100 groups: core collection: 300,600 nodes, 226 MB, 1.44 s -> 50,600 nodes, 54 MB, 0.42 s; moving 1,000 rows between groups 47 ms -> 16 ms. grid: 256 MB, 1.21 s -> 74 MB, 0.40 s. The grid's budget for keeping group totals in the graph rises from 100,000 row-and-column pairs to 300,000, about the memory the old budget allowed. Tests: groupings by one key make a membership node a row between them, and a row that moves leaves all their old group's totals. collections_match_a_plain_map_added_up_from_scratch (a sum and a count by a field and by a calculated column) passes, and fails when a grouping does not empty its old group's member on a shared node taken for another group. All workspace tests and the 48 browser tests pass. Docs: watershed-core's README, the grid README, limitations.md, benchmarks.md (the grid's grouping figure is measured again), testing.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AdzBXcxXfE7iKtPMVoTTfr
The React cookbook's "a page that fails to load is asked for again" timed
out in CI waiting to click Try again: the button had been visible, then
went before the click. Showing the failure changes the bar above the grid
(a longer message, and the button), which can move the grid and give it one
more scroll event near the end; the grid then asks for the page again, as
it does on any scroll near the end. If that request came after the test had
stopped failing the page, the page loaded and the button rightly went.
The test meant to wait until the failure had settled ("with nothing asked
for since") but only waited for the button. It now waits until half a
second passes with no request for the page and the button showing, then
stops failing it and clicks. It passed 40 runs of its own here, and the
suite passes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AdzBXcxXfE7iKtPMVoTTfr
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.
Follows #101. A row's membership node (
present && key == group) doesn't depend on what a grouping adds up, yet every grouping had its own. So a sum and a count per group made two nodes per row, and the grid, which makes one grouping per totalled column, made six for six totals.Changes
Poolper key. The first grouping makes a row's node; the others reuse it, each adding it to its own group's total.Numbers
50,000 rows, six totals, grouped by one column with 100 groups. Measured against
mainbuilt in a worktree on the same machine:set_group: memoryset_group: timeTests
collections_match_a_plain_map_added_up_from_scratchruns a sum and a count by a field and by a calculated column, with removals and reuse. It passes, and fails at step 7 when a grouping doesn't empty its old group's member on a shared node taken for another group. That was checked by hand and recorded indocs/testing.md.cargo test --workspacepasses. Clippy, including--features cuda, andcargo docare clean.Docs
limitations.md.benchmarks.md: the grid's grouping figure has been re-measured, so it's off the "not re-measured" list.testing.md.Generated by Claude Code