Skip to content

compute: a per-process registry of published index arrangements - #38387

Draft
antiguru wants to merge 1 commit into
mh/interactive-01-shared-tracefrom
mh/interactive-02-sharing
Draft

compute: a per-process registry of published index arrangements#38387
antiguru wants to merge 1 commit into
mh/interactive-01-shared-tracefrom
mh/interactive-02-sharing

Conversation

@antiguru

Copy link
Copy Markdown
Member

Second of eight PRs splitting #37770. Stacks on #38386. Tracked by CPU-215.

Publishing an arrangement produces handles, but a reader on another thread needs a way to find them. This adds a registry keyed by GlobalId and worker ordinal, shared across all timely workers of a process the way the persist client cache is. Worker i publishes into slot i and a reader on worker i of another runtime looks up the same slot, which is sound only because both sides shard keys by key.hashed() % peers.

A slot can be created before it is filled. get_or_create_placeholder lets whichever side touches an id first create the slot and the other adopt it in place, so a reader never overwrites a publisher's arrangement nor imports over a slot a later publish replaces. Readers learn about publication and seal through a dirty-id inbox with a coalescing SyncActivator rather than by polling.

Inert: nothing constructs a registry.

@antiguru
antiguru force-pushed the mh/interactive-02-sharing branch from 0b83619 to e4df1e7 Compare August 21, 2026 11:23
@antiguru
antiguru force-pushed the mh/interactive-02-sharing branch from e4df1e7 to db592b9 Compare August 21, 2026 13:24
@antiguru
antiguru force-pushed the mh/interactive-02-sharing branch from db592b9 to acaae62 Compare August 21, 2026 13:42
@antiguru
antiguru requested a review from DAlperin August 21, 2026 13:46
@antiguru
antiguru force-pushed the mh/interactive-02-sharing branch 2 times, most recently from e0c1fed to 7eeb13c Compare August 21, 2026 17:54
@antiguru
antiguru force-pushed the mh/interactive-02-sharing branch from 7eeb13c to 5c1ad88 Compare August 28, 2026 14:05
Publishing an arrangement produces handles, but a reader on another thread needs
a way to find them. This adds a registry keyed by `GlobalId` and worker ordinal,
shared across all timely workers of a process the way the persist client cache
is, so worker `i` publishes into slot `i` and a reader on worker `i` of another
runtime looks up the same slot. That is sound only because both sides shard keys
by `key.hashed() % peers`, which the equal-peer requirement guarantees.

A slot can be created before it is filled. `get_or_create_placeholder` lets
whichever side touches an id first create the slot and the other adopt it in
place, so a reader never overwrites a publisher's arrangement or imports over a
slot that a later publish replaces. Readers learn about publication and seal
through a dirty-id inbox with a coalescing `SyncActivator` rather than by
polling.

Nothing in the crate calls the registry yet, so it is inert in the same sense as
the shared-trace primitive it builds on. `published_logical_holds` is `pub`
because its callers arrive later and crate scoping would make it unreachable for
dead-code analysis.

Tests are out of line in `sharing/tests.rs`, per the convention in
`src/compute/AGENTS.md`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@antiguru
antiguru force-pushed the mh/interactive-02-sharing branch from 5c1ad88 to 882fe25 Compare September 3, 2026 08:48
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