Skip to content

DDIR Corgi chunks: consolidate uniform timestamps without sorting times - #909

Closed
frankmcsherry wants to merge 1 commit into
master-nextfrom
ddir-uniform-consolidation
Closed

frankmcsherry wants to merge 1 commit into
master-nextfrom
ddir-uniform-consolidation

Conversation

@frankmcsherry

Copy link
Copy Markdown
Member

Chunk consolidation sorts by time within each equal (key, value) run. When every row in the chunk has the same timestamp, there is nothing to sort. The new ColTimes::is_uniform detects that case (it checks all coordinates, including zero-width times), and consolidation then sums the diffs of each equal run directly. Chunks whose times vary take the existing path. Three files, +51 lines, including tests for uniformity and cancellation.

Measured on SCC, the worldgen tour, and the stock AoC runner. Three paired runs each, order reversed in the middle run, M4 release build:

Workload / workers Initial ms Ten churn ticks ms Process CPU s Peak footprint MiB
scc 1 70.91 → 70.92 775.96 → 779.56 (+0.5%) 0.84 → 0.84 79.8 → 79.8
scc 4 32.69 → 32.54 (−0.5%) 376.54 → 377.54 (+0.3%) 1.64 → 1.63 86.6 → 78.8 (−9.0%)
tour 1 1540 → 1510 (−1.9%) 331.76 → 327.34 (−1.3%) 1.86 → 1.82 (−2.2%) 37.2 → 37.2
tour 4 1760 → 1750 (−0.6%) 365.24 → 362.92 (−0.6%) 3.38 → 3.39 45.9 → 44.4 (−3.3%)
AoC workers Runner elapsed s Process CPU s
1 2.14 → 2.13 (−0.5%) 2.12 → 2.11 (−0.5%)
4 2.26 → 2.23 (−1.3%) 8.48 → 8.35 (−1.5%)

The gains are small. SCC peak at 4 workers falls 9.0% in every pair, with ranges that do not overlap. In worldgen, on top of other changes, the tour is 1.7–1.9% faster at 1, 3 and 4 workers.

Unexplained validation failure. In one early 4-worker AoC run with this change, the runner reported day02 part 1 as an empty string (8 was expected). That runner mixed stdout and stderr and did not keep the raw output, so the cause cannot be found now. No wrong number was ever reported. We then ran the focused case 4,600 times, on base and with this change, with stdout and stderr both mixed and separate. None of those runs failed. With output captured properly, every later paired run passed all 33 answers at 1 and 4 workers. We have seen stdout and inspect output interleave in a baseline server session, so a capture problem is a plausible cause, but it is not proven.

Tests. cargo test --release -p interactive: 106 passed, 5 ignored (all ignored before this change too). The supported sessions and the graph outputs match on both backends.

This PR and the sort-labels PR edit the same function. They were measured separately and do not depend on each other.

Measurements and the port are by Astra (OpenAI Codex). I re-ran the tests on master-next 9cfc909.

🤖 Generated with Claude Code

When every update in a chunk carries the same timestamp, consolidate
directly within equal (key, value) classes, preserving addition order,
instead of sorting times within each class. Chunks with varying times
keep the existing path.

Co-Authored-By: Astra (OpenAI Codex)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@frankmcsherry
frankmcsherry force-pushed the ddir-uniform-consolidation branch from 1a1c6a3 to 88299bd Compare September 28, 2026 23:47
@frankmcsherry

Copy link
Copy Markdown
Member Author

Rebased onto master-next after #908 (88299bd). The uniform-time shortcut now walks #908's equality-label runs, so it no longer builds its own adjacent comparison, and it gathers the payload once from the surviving source rows as #908 does. cargo test --release -p interactive: 114 passed, 5 ignored (all ignored before this change too). I have not re-timed it on top of #908.

@frankmcsherry

Copy link
Copy Markdown
Member Author

Closing as "not obviously great" and "would be done differently atop #908 anyhow".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant