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.

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 e0c1fed to 7eeb13c Compare August 21, 2026 17:54
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