Repository navigation
refactor(router): move the selection core into the scheduler kernel - #143
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:46 — with
GitHub Actions
Failure
Step 6-4b of the router split (DYNO-179), the last move of step 6. The selection core (SelectionCore, its partitions, operations, reservations, hints, queries, worker catalog, membership reconciler, request and response DTOs, the selection cache, the error type, and the KvEventIngress trait with its passive default) leaves lib/kv-router/src/services/ selection for dynamo_scheduler::selection, and the replica-sync channel plumbing (services/common/replication.rs) becomes dynamo_scheduler::replication, which the slot-tracker service and the ZMQ mesh import from the kernel. Imports flip from kv-router's shims to the owners (kv-indexer for the backend and the index registry, slot-tracker for sequences, worker-selection for the policy types, session-affinity for the affinity table, the kernel's own modules for queue, config, selector, overlap summary, tracking hash, and replication). The kernel gains a host module listing the surface a host implements or calls. kv-router keeps server.rs, service.rs, zmq_ingress.rs, the HTTP tests, and the affinity alias, with shim submodules so every super:: path and every public services::selection name still resolves; lib/llm, the mocker, and the bindings compile unchanged until step 8. Tests: the core's white-box suite moves with the core on a kernel-native RouterConfig fixture (its flat-config footprint was one helper and three literals; the fixture builds the indexer policy from use_kv_events as the flat conversion did); the six tests that need the ZMQ ingress, the service builder, or the flat configuration move to kv-router over the public API. Validation: cargo test -p dynamo-scheduler --features testing and --all-features (291 passed, 1 ignored: 174 + the 117 moved core tests); kv-router 241 + 2 + 7 under the full feature set (358 - 117), 133 default, 155 slot-tracker only (the replication tests run in the kernel now); clippy -D warnings on the kernel (both feature sets), kv-router (five feature sets), dynamo-llm, mocker, ext-proc, sglang-sidecar, builtin (tests and benches), dynamo-bench, the five example crates; builtin tests; lib/llm kv_router 485, router_policy 3, watcher 36; mocker 304; router layering gate 26 checks; cargo tree on the kernel free of dynamo-runtime, kv-router, zmq, axum, hyper, reqwest, prometheus; codeowners strict; fmt. Move-diff against 1eca463: common 10569 / new 290 / dropped 131 (visibility, path rewrites, the fixtures, the shim submodules, the host list, two kernel deps). Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
ishandhanani
force-pushed
the
idhanani/dyn-179-selection-core-move
branch
from
November 2, 2026 13:31
0889c71 to
b31d493
Compare
ishandhanani
had a problem deploying
to
external_collaborator
November 2, 2026 13:31 — with
GitHub Actions
Failure
ishandhanani
had a problem deploying
to
external_collaborator
November 2, 2026 13:53 — 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-4b of the router split v2 (DYNO-179). Stacked on #142. The last move of step 6: the selection core and the replica-sync channel plumbing leave
lib/kv-routerforlib/router/scheduler; kv-router keeps the HTTP server, the service builder, the ZMQ ingress, and shim submodules.Summary
git mv):services/selection/{core/*, catalog, input, membership, pending, types, error, ingress}.rs->dynamo_scheduler::selection::{..};services/common/replication.rs->dynamo_scheduler::replication(itsstandalone-selectiongates dropped, its itemspub; the slot-tracker service and the ZMQ mesh import it from the kernel). The kernel'sselectionmodule re-exports what kv-router's did; a newhostmodule lists the kernel-facing surface a host implements or calls (hosts inventory section 3.6).crate::services::common::replication->crate::replication;crate::services::indexer::{backend, registry}->dynamo_kv_indexer::{backend, registry};crate::services::overlap->crate::overlap_summary;crate::scheduling::{queue, config, selector, router_config}->crate::{queue, config, selector, config};crate::sequences->dynamo_slot_tracker;crate::indexer->dynamo_kv_indexer;crate::WorkerSelectionPolicyFactory->crate::types::..;super::affinity->dynamo_session_affinity;default_routing_groupjoins the kernel'sidentitymodule.services/selection/mod.rskeepsserver,service,zmq_ingress,tests, and the affinity alias, with private shim submodulescore,error,ingress,input,pending,typesover the kernel so everysuper::path resolves, and re-exports every public name at its current path;services/common/mod.rsdropsreplication.cfg(test)hooks) moves with the core on a kernel-native fixture indynamo_scheduler::test_utils(test_router_config(use_kv_events, queue_threshold),local_test_core,test_core_with,reference_policy_factory); its flat-config footprint was one helper and three literals, nowRouterConfigand itsselection/conditional_disaggslices. The kernel fixture builds the indexer policy fromuse_kv_events(an approximate primary when events are off), as the flat conversion did. Six tests that need the ZMQ ingress, the service builder, or the flat configuration move to kv-router asservices/selection/core_host_tests.rsover the public API (reupsert_recreates_a_listener_lost_to_a_cancelled_updatereads the partition throughcore.partition()instead of the private entry;rejoined_worker_feeds_partition_indexasserts the ZMQ ingress's detach, which the kernel's passive ingress does not do, and reads the index through the ingress's registry). The membership tests use the kernel fixture. What kv-router's server, service, ZMQ ingress, and HTTP tests reach became public:WorkerCatalogRecord::{key, dp_size, ensure_running, listener_endpoints},PromptView::{normalize_for_selection, normalize_for_reservation},TrackingHashInput,NormalizedPromptandNormalizedReservationwith their fields (the service tests drive normalization directly; moving those tests into the kernel is a follow-up),REQUEST_BODY_LIMIT_BYTES,SelectionCore::{with_session_binding_publisher, signal_indexer_ready, dispatch_replica_event, dispatch_affinity_event}, and a testing-gatedSelectionCore::cancel_token().Validation
cargo test -p dynamo-scheduler --features testingand--all-features: 291 passed, 1 ignored (174 before + the 117 moved core tests).cargo tree -p dynamo-scheduler -e normalstays free of dynamo-runtime, dynamo-kv-router, dynamo-zmq, axum, hyper, reqwest, zmq, prometheus.cargo test -p dynamo-kv-routerwithstandalone-selection,standalone-slot-tracker,metrics,testing: 241 + 2 + 7 (358 before; 358 - 117 = 241); default 133;standalone-slot-trackeronly 155 (161 before: the sixreplication.rstests moved with the module and run in the kernel).cargo clippy -D warnings --all-targets: kernel (testing,--all-features), kv-router (full, default, slot-tracker only, indexer only, selection only),dynamo-llm -p dynamo-mocker -p dynamo-ext-proc -p dynamo-sglang-sidecar -p dynamo-custom-policy-builtin --tests --benches,dynamo-bench --tests;cargo checkon the five custom-policy example crates.cargo test -p dynamo-custom-policy-builtinall green;cargo test -p dynamo-llm kv_router485,--lib router_policy3,--lib watcher36;cargo test -p dynamo-mocker --lib304.scripts/router_layering_check.sh: 26 checks, 0 failures.build_codeowners.py --strictok.cargo fmt --all -- --checkclean.scripts/router_move_diff.py 1eca463e73 WORKTREE, kv-routerservices/selection/*,services/common/{replication,mod,replica_sync}.rs,services/slot_tracker/registry.rs,scheduling/mod.rs, kernellib.rs/identity.rs/test_utils.rs/Cargo.toml-> kernelselection/,replication.rs,host.rs, those four, kv-router shims +core_host_tests.rs): common 10569 / new 290 / dropped 131. New and dropped lines are the visibility widening listed above, thecrate::/super::path rewrites to the owners, the kernel-native fixtures and the relocated tests' helpers, the shim submodules, thehostlist,default_routing_group, and the two kernel deps (uuid,once_cell).