Repository navigation
feat(kv-router): approximate, remote, and hint-aware indexing in SelectionService - #46
Closed
ishandhanani wants to merge 3 commits into
Closed
ishandhanani wants to merge 3 commits into
ishandhanani wants to merge 3 commits into
Conversation
ishandhanani
had a problem deploying
to
external_collaborator
September 4, 2026 03:18 — with
GitHub Actions
Failure
This was referenced Sep 4, 2026
ishandhanani
force-pushed
the
idhanani/up-2-core-indexing
branch
from
September 4, 2026 04:00
ee54fa1 to
56b3f2d
Compare
ishandhanani
had a problem deploying
to
external_collaborator
September 4, 2026 04:00 — with
GitHub Actions
Failure
ishandhanani
had a problem deploying
to
external_collaborator
September 4, 2026 04:00 — with
GitHub Actions
Failure
ishandhanani
added this pull request to stack #54
September 9, 2026 06:20
…ctionService Second half of input parity: the standalone core indexes the way the frontend KvRouter does. - IndexerPolicy::from_router_config resolves the frontend's shape rules: event-driven primary, event-driven plus a short-TTL predict-on-route side indexer when router_predicted_ttl_secs is set, approximate TTL primary when use_kv_events=false. Bookings (select_and_reserve, cached replay, explicit reservations with tokens or hashes) are recorded into the approximate indexer; query-only selects record nothing. Previously a service with use_kv_events=false had an empty index and no cache awareness. - Indexer::Remote serves the primary index from a standalone indexer over HTTP (POST /query_tiered_by_hash returns lossless TieredMatchDetails). With a remote primary the core requires no kv_events endpoints and registers no ZMQ listeners. Exposed as SelectionServiceBuilder::remote_indexer, --remote-indexer-url, and remote_indexer_url= on the Python constructor. - Router hints: catalog records carry router_hint_worker_type and per-rank source control endpoints; a booking retains the matched chain when the partition has a hint-capable worker and SelectResponse::router_hint names a same-role source that beats the target's own cached prefix. Tests: backend policy matrix; approximate primary and side-indexer merge for 1 and 2 threads; bookings credited through all three paths; /query_tiered_by_hash round trip; remote indexer against a live standalone indexer including offline mapping; hint produced for a cold-worker booking and absent for warm-worker and query-only selections. Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
ishandhanani
force-pushed
the
idhanani/up-2-core-indexing
branch
from
September 9, 2026 18:30
56b3f2d to
e7ef305
Compare
ishandhanani
had a problem deploying
to
external_collaborator
September 9, 2026 18:30 — with
GitHub Actions
Failure
ishandhanani
had a problem deploying
to
external_collaborator
September 9, 2026 18:30 — with
GitHub Actions
Failure
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
ishandhanani
had a problem deploying
to
external_collaborator
September 9, 2026 19:06 — with
GitHub Actions
Failure
This was referenced Sep 10, 2026
This branch had an error being deployed
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.
PR 2 of 9 implementing ai-dynamo#14310 (one
SelectionCorefor the frontend, the standalone selection service, and the EPP). Base:idhanani/up-1-host-hooks(PR 1 of this stack).Summary
Adds approximate, remote and hint-aware KV indexing to the standalone selection core. Booked requests can contribute cache knowledge when worker events are disabled, while remote-index and transfer-hint paths use the current typed protocols.
Implementation
IndexerPolicychooses an event-driven primary, an event-driven primary with a prediction side index, or an approximate TTL primary from router configuration.POST /query_tiered_by_hashand replaces local KV-event subscriptions.kv_hintwhen a usable source has a longer prefix than the selected worker.remote_indexer_url, including the feature-gated lifecycle-test constructor at this boundary.Walkthrough
Index selection and writes
When
use_kv_events=false, the primary is populated from admitted routing decisions instead of remaining empty.select_and_reserve, cached booking replay and explicit reservations carrying tokens or hashes record their decisions. Recording happens after booking, so a recording error is logged rather than reported as a failed booking.A remote primary needs neither worker KV-event endpoints nor local listeners or peer recovery. It is rejected with events disabled because the remote service has no routing-decision write API. Capacity-bounded approximate retention still falls back to TTL at this boundary until request-lease support is shared in #51.
Transfer hints and boundaries
The core retains matched chains only when the partition can consume hints. Source selection checks the backend role, control endpoint, cached-prefix advantage and the current transfer constraints; the response field is
SelectResponse::kv_hint, not the prototyperouter_hintfield. Query-only selection emits no transfer hint.This adds indexing and selection metadata. It does not add the separate DisaggCoordinator piece or claim a disaggregated end-to-end test.
Validation
Current stack boundary:
8dfeecbcc5305219333dd881af32e80c378fdc69; the series is based on Dynamo mainab58558c2dff28f4ff1ea4e219030eac5da3f48f.cargo check -p dynamo-kv-router -p dynamo-llm -p dynamo-ext-proc --no-default-features --features dynamo-kv-router/standalone-selection,dynamo-kv-router/standalone-slot-tracker --all-targetsfor this stack boundary.cargo check --manifest-path lib/bindings/python/Cargo.toml --features select-service --all-targetsat this boundary.GitHub CI is not green across this series. Recurring failures are the missing fork Fastchecker runner group, helm-tester image and approval-bot token, plus published-docs composition and an unchanged external documentation link. The local compilation and final-stack validation above are recorded separately from those CI failures.
Stack
idhanani/up-1-host-hooksidhanani/up-2-core-indexingidhanani/up-3-embed-coreidhanani/up-4-delete-kvscheduleridhanani/up-5-policy-sourceidhanani/up-6-membershipidhanani/up-7-kv-index-sourceidhanani/up-8-affinity-tableidhanani/up-9-epp-affinity