Repository navigation
refactor(router): move the hash contract to dynamo-kv-hashing - #112
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 30, 2026 16:38 — with
GitHub Actions
Failure
Move the router's block and sequence hash functions out of lib/kv-router/src/protocols.rs into dynamo_kv_hashing::routing: the XXH3 seed, compute_block_hash, BlockHashOptions, the multimodal pad constants and pad_value_for_mm_hash, hash_mm_identifier, compute_block_hash_for_seq and its seeded variants, compute_next_seq_hash, compute_seq_hash_for_block, compute_seq_hash_for_tokens_with_seeds, and TokensWithHashes. The eighteen tests that exercise them move with them. The three seeded helpers that were pub(crate) become pub with their existing docs, because the tracking hash in kv-router calls them across the crate boundary. Move the multimodal block and request metadata (BlockMmObjectInfo, BlockExtraInfo, RequestMmObjectInfo, RequestExtraInfo) into dynamo_router_protocol::mm: KV events, the hash contract, and the frontend preprocessor all name it, so it is shared vocabulary. dynamo-kv-hashing gains dependencies on dynamo-router-protocol and xxhash-rust; protocol does not depend on it. lib/kv-router keeps pub use shims at the old paths, so no other crate changes. The layering gate gains a dynamo-kv-hashing row and forbids kv-hashing in protocol's tree. Step 3a of the router split v2 plan, taken before step 2 because the ZMQ event codec calls these helpers. DYNO-171. Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
ishandhanani
force-pushed
the
idhanani/dyn-171-kv-hashing-contract
branch
from
November 2, 2026 13:29
e1e8b11 to
e28c4d0
Compare
ishandhanani
had a problem deploying
to
external_collaborator
November 2, 2026 13:29 — 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 3a of the router split v2 (DYNO-171), stacked on #111. Taken before step 2 because the ZMQ event codec calls these helpers.
Summary
dynamo-kv-hashinggains aroutingmodule with the router's block and sequence hash contract, moved verbatim fromlib/kv-router/src/protocols.rs:XXH3_SEED,compute_block_hash,BlockHashOptions, the multimodal pad constants andpad_value_for_mm_hash,hash_mm_identifier,compute_block_hash_for_seqand its seeded variants,compute_next_seq_hash,compute_seq_hash_for_block,compute_seq_hash_for_tokens_with_seeds, andTokensWithHashes. The eighteen tests that exercise them move with them. The three seeded helpers that werepub(crate)becomepubwith their existing docs because the tracking hash in kv-router calls them across the crate boundary.dynamo-router-protocolgains anmmmodule with the multimodal block and request metadata (BlockMmObjectInfo,BlockExtraInfo,RequestMmObjectInfo,RequestExtraInfo): KV events, the hash contract, and the frontend preprocessor all name it.lib/kv-routerkeepspub useshims at the old paths; no other crate's imports change. kv-hashing now depends on protocol and xxhash-rust; protocol does not depend on kv-hashing, and the gate forbids it.TrackingHashContext, because itsfrom_configreads a key file and is called fromlib/llmand the mocker.Validation
cargo test -p dynamo-router-protocol -p dynamo-kv-hashing: protocol 10 passed; kv-hashing 20 + 17 + 3 passed (the 18 moved hashing tests included).cargo check -p dynamo-kv-router: clean.cargo test -p dynamo-kv-router: 1,104 lib + 1 integration passed, 0 failed, 3 ignored (the 22-test drop from refactor(router): add dynamo-router-protocol, the wire vocabulary crate #111 is the 18 hashing tests now in kv-hashing plus the 4 that moved to protocol).cargo check -p dynamo-llm -p dynamo-mocker -p dynamo-bench -p dynamo-custom-policy-builtin --tests: clean.cargo clippy -p dynamo-router-protocol -p dynamo-kv-hashing -p dynamo-kv-router --all-targets -- -D warnings: clean.scripts/router_layering_check.sh: 8 checks, 0 failures (protocol row plus the new kv-hashing row: router deps == {dynamo-router-protocol}; direct deps == {derive_builder, dynamo-router-protocol, dynamo-tokens, serde, serde_json, thiserror, xxhash-rust}; 42-crate closure).scripts/router_move_diff.py ebe3e707db WORKTREEoverprotocols.rsandkv-hashing/src/lib.rsto the new modules: 1,891 normalized lines in common; 10 new and 13 dropped, all accounted for:pub(crate)topubon the three seeded helpers,dynamo_kv_hashing::shortened to the in-crate path on five lines, rustfmt collapsing one signature onto one line, and onemod tests. protocols.rs fraction 0.993.