Repository navigation
refactor(router): cut the selection core's last ties to the composed router - #142
Closed
ishandhanani wants to merge 1 commit into
Closed
ishandhanani wants to merge 1 commit into
ishandhanani wants to merge 1 commit into
Conversation
ishandhanani
had a problem deploying
to
external_collaborator
October 31, 2026 08:03 — with
GitHub Actions
Failure
…router Step 6-4a of the router split (DYNO-179): the boundary changes the selection core needs before it moves into the kernel crate, each inside today's crates. The Mooncake overlap summary (MooncakeOverlapSummary, build_mooncake_overlap_summaries) is kernel output vocabulary built from the kernel's SelectedWorkerTierSnapshot and kv-indexer's match details; it moves to dynamo_scheduler::overlap_summary, and kv-router's services::overlap re-exports it for the indexer HTTP server. WorkerSelectionPolicyFactory, the hook that builds a partition's policy from the selection slice, the worker type, and the partition, is built from stage and protocol types only; it moves to dynamo_scheduler::types and plugins::worker_selection re-exports it. SelectionServiceConfig carries the flat KvRouterConfig for the CLI and the Python bindings; it belongs to the builder and moves to service.rs beside its service_builder impl, exported at the same path. SelectionCore::new_inner becomes the public SelectionCore::new: every input is a resolved slice or a host-owned hook, and the builder calls it. The flat-config conveniences try_new_local and try_new_local_with_host leave the core, where they could not stay once the type is foreign, and become local_selection_core and local_selection_core_with_host in kv-router's selection service; their callers (the kv-router and builtin benches, the builtin and membership tests, lib/llm's router-policy test fixture, the core tests) call the free functions. Validation: move-diff vs 7179215 common=7460 new=30 dropped=43 (the renamed constructors and callers, the path-qualified factory alias, and visibility; no logic line changed); cargo test -p dynamo-scheduler --features testing (174: the three overlap-summary tests joined the kernel) and clippy -D warnings on it under testing and all features; cargo test -p dynamo-kv-router under the full service feature set (358 lib + 2 plugin-API + 7 standalone HTTP; 358 + 3 = the pre-change 361), with default features (133), and under standalone-slot-tracker alone (161); clippy -D warnings all targets on kv-router under five feature sets, on dynamo-llm, dynamo-mocker, dynamo-ext-proc, dynamo-sglang-sidecar, dynamo-custom-policy-builtin (tests and benches), dynamo-bench, and the five example policy crates; builtin tests 56+5+1+3+20+3+4; cargo test -p dynamo-llm kv_router (485), --lib router_policy (3), --lib watcher (36); dynamo-mocker --lib 304; router layering gate 26 checks, 0 failures; CODEOWNERS strict clean; cargo fmt --check clean. Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
ishandhanani
force-pushed
the
idhanani/dyn-179-selection-boundary
branch
from
November 2, 2026 13:30
1eca463 to
a40709a
Compare
ishandhanani
had a problem deploying
to
external_collaborator
November 2, 2026 13:31 — with
GitHub Actions
Failure
Owner
Author
|
Landed upstream as ai-dynamo#18055 (squash commit 79692cf on main, 2026-11-11). Closing this fork review unit. |
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.
Step 6-4a of the router split v2 (DYNO-179). Stacked on #141. Behavior-preserving boundary changes inside today's crates, so that 6-4b can move the selection core into the kernel as a pure move.
Summary
MooncakeOverlapSummary,build_mooncake_overlap_summaries, and their tests move from kv-routerservices/overlap.rstodynamo_scheduler::overlap_summary(built from the kernel'sSelectedWorkerTierSnapshotand kv-indexer's match details; the kernel re-exports the type at its root).from_selected_worker_tiersloses itsstandalone-selectiongate and both functions becomepub; kv-router'sservices::overlapre-exports them for the indexer HTTP server.WorkerSelectionPolicyFactory(Arc<dyn Fn(&SelectionConfig, WorkerType, RoutingPartitionRef) -> WorkerSelectionPolicy>) isdynamo_scheduler::types::WorkerSelectionPolicyFactory;plugins::worker_selectionre-exports it, so plugin authors' path is unchanged.SelectionServiceConfig(the CLI's and the Python bindings' struct, carrying the flatKvRouterConfig) moves fromcore/mod.rstoservice.rsnext to itsservice_builder;services::selection::SelectionServiceConfigstill resolves.SelectionCore::new_innerbecomes the publicSelectionCore::new(every input a resolved slice or a host hook).try_new_local/try_new_local_with_host(apply the policy file, validate, resolve the tracking hash and indexer policy, thennew) leave the core as kv-router free functionslocal_selection_core/local_selection_core_with_host, exported fromservices::selection; thebench-onlybench_try_new_local_with_hostis subsumed. Callers updated: kv-routerbenches/selection_core.rs, the builtin bench and tests,membership.rstests,core/tests.rs,new_local_for_test, and lib/llm'srouter_policy.rstest fixture.With this, nothing in
services/selection/{core, catalog, input, membership, pending, types, error}namesKvRouterConfig, the plugin registry, or a transport; 6-4b moves those files andservices/common/replication.rsintolib/router/scheduler/src/selection/and adds thehostlist (inventory split-v2/inventory-scheduler.md §8).Validation
cargo test -p dynamo-scheduler --features testing: 174 (the three overlap-summary tests joined the kernel's 171);cargo clippy --all-targets -- -D warningson the kernel undertestingand--all-features: clean.cargo test -p dynamo-kv-router: 358 lib + 2 plugin-API + 7 standalone-HTTP under the full service feature set (358 + the 3 moved = the pre-change 361); 133 lib with default features; 161 lib withstandalone-slot-trackeralone.cargo clippy --all-targets -- -D warnings: kv-router under the full, default, slot-tracker-only, indexer-only, and selection-only feature sets; downstreamdynamo-llm,dynamo-mocker,dynamo-ext-proc,dynamo-sglang-sidecar,dynamo-custom-policy-builtin(tests and benches),dynamo-bench --tests; the five example policy crates check: clean.cargo test -p dynamo-llm kv_router485,--lib router_policy3 (the fixture now callslocal_selection_core),--lib watcher36;cargo test -p dynamo-mocker --lib304.scripts/router_layering_check.sh: 26 checks, 0 failures. CODEOWNERS--strictclean.cargo fmt --all -- --checkclean.scripts/router_move_diff.py 7179215b31 WORKTREEover the touched files (+overlap_summary.rson the head side):common=7460 new=30 dropped=43; every new line isSelectionCore::new/local_selection_core*replacingnew_inner/try_new_local*(and the removedbench_try_new_local_with_hostwrapper), the factory alias with path-qualified stage types,pubon the two overlap functions andReplicaSyncConfig(now named by a public constructor), and the callers' new names. No logic line changed (artifacts6-4a-move-diff.txt).