Repository navigation
Catalog and sequential kernels on WorkMeter; threads come from the execution - #11
Merged
Merged
Conversation
alexy
added a commit
that referenced
this pull request
Sep 20, 2026
Documentation only. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Step 5 of the order in codex-to-codex.md. Meter and width() are gone. The partition helpers take a worker count read from the execution, run on the calling thread at one worker without touching rayon, and otherwise run inside the bounded pool for that count. Per-block workspaces own one meter each, because creating a meter registers it under a lock. The determinism tests ask for workers through the context instead of installing a pool, and the triangle fixture grew to clear the sequential floor it would otherwise never leave. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The second half of step 5: item 3 of quegee's 03:05Z follow-ups. dijkstra, shortestPaths, bfs, dfs, topologicalSort, scc, wcc and the shared MinHeap no longer pay one compare-exchange on the shared counter per visited entry. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
alexy
force-pushed
the
work/catalog-on-workmeter
branch
from
September 20, 2026 09:21
5e2ab8e to
5352909
Compare
alexy
added a commit
that referenced
this pull request
Sep 20, 2026
…, sweep is sequential-only Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sak2FQcdgs5pkL2ruKrSUZ
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.
Step 5 of the order in
codex-to-codex.md(2026-09-20T08:15Z). After this there is one accounting layer and one source of thread counts ingrust-algorithms.What changes
The seventeen catalog kernels move onto the surviving layer.
Meterandparallel::width()are deleted. Every kernel charges throughExecutionContext::work_meter(), which admits work before it is done, so a budget is never exceeded by work already performed; the oldMetercould overshoot by a block per worker.Threads come from the execution, never from the machine.
parallel::concurrency(context, units)is what the execution asked for above the shared floor, otherwise one.map_ranges,ordered_blocks,for_chunksandsort_totaltake that count. At one worker they run on the calling thread and do not touch rayon; above it they run inside the bounded pool for that count. Before, a kernel called outside an installed pool used rayon's global pool, which is every core of the machine.Behaviour change: a caller that does not call
with_concurrencynow runs every catalog kernel single-threaded. Results are unchanged and bit-identical at any worker count. Nutmeg must pass the option through to get parallel kernels.One meter per block workspace, not per node or per source, because creating a
WorkMetertakes the grant registry exclusively.The sequential kernels charge through a meter too:
dijkstra,shortestPaths,bfs,dfs,topologicalSort,scc,wcc, and theMinHeapthe path kernels share, instead of one compare-exchange on the shared counter per visited entry.Tests
175 pass across
grust-procedures,grust-algorithmsandgrust-algorithm-procedureswith all features; clippy clean with-D warnings;--no-default-featuresbuilds. The determinism tests now ask for 1, 2, 3 and 8 workers through the context rather than installing a pool, and still assert identical bits and identical charged work. The triangle fixture grew from 12,400 to 28,700 work units: below the 16,384-unit floor it would have passed without ever going parallel. The original kernels' exact-work-charge tests pass unchanged.Numbers, and what they are worth
Sequential kernels, a million nodes and ten million random weighted arcs, no deadline, no concurrency requested, release, best of nine, one laptop. Per-entry was measured before and again after the metered runs and reproduced within 3%.
charge_workThis is a single-host probe on one synthetic graph, not the paired benchmark harness. The harness run has been requested in
codex-to-codex.mdand is what should be cited.🤖 Generated with Claude Code