Skip to content

[store]feat: support python hash seed#2969

Merged
Chase-Rong merged 1 commit into
kvcache-ai:dev/conductorfrom
Chase-Rong:dev/conductor
Jul 18, 2026
Merged

[store]feat: support python hash seed#2969
Chase-Rong merged 1 commit into
kvcache-ai:dev/conductorfrom
Chase-Rong:dev/conductor

Conversation

@Chase-Rong

@Chase-Rong Chase-Rong commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Description

This change makes python_hash_seed the source of truth for Conductor hash
profiles. Clients no longer calculate and submit root_digest; Conductor
validates the seed and derives the digest internally.

  • Split external HashProfileConfig from the internal ResolvedHashProfile.
  • Accept random or ASCII decimal seeds in the range 0..4294967295.
  • Preserve the exact seed text and derive the root digest using
    SHA-256 over its canonical CBOR text encoding.
  • Require python_hash_seed in static configuration and /register, with
    strict validation for missing, malformed, mistyped, legacy, or unknown fields.
  • Return both python_hash_seed and the derived root_digest from /services
    and /global_view.
  • Validate seed/digest consistency and keep registration and index state
    unchanged when profiles are forged or conflicting.
  • Extend golden-vector, HTTP registration, static configuration, prefix-index,
    event lifecycle, concurrency, and event-ingestion coverage.

Related issue: N/A

Module

  • Other: Mooncake Conductor

Type of Change

  • New feature
  • Breaking change

How Has This Been Tested?

Test commands:

cd mooncake-conductor
./build/tests/conductor_test
git diff --check HEAD^ HEAD

Test results:

  • Unit tests pass
  • Integration tests pass
  • Manual testing done

All 137 tests from 30 test suites passed. The commit diff contains no
whitespace errors.

Checklist

  • I have performed a self-review of my own code
  • I have formatted my code using ./scripts/code_format.sh
  • I have run pre-commit run --all-files and all hooks pass
  • I have updated the documentation
  • I have added tests to prove my changes are effective
  • RFC is not required because the non-test change is below 500 LOC

AI Assistance Disclosure

  • No AI tools were used
  • AI tools were used

Codex was used to inspect commit c973c8c, review its test coverage, and
draft the PR title and description. The human submitter must review and
understand all code changes before opening the PR.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a mechanism to derive the root digest of a hash profile from a Python hash seed using SHA256, replacing the manual configuration of root_digest in HashProfileConfig. It introduces a new ResolvedHashProfile structure, updates configuration parsing and validation logic, and adapts the event manager and tests to support this seed-based resolution. The review feedback highlights a potential maintenance issue in ParseHashProfileConfig, where the logic for identifying which field caused a validation error duplicates the validation rules from ValidateProfileSelectors, and suggests returning a structured error instead.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +222 to +234
if (std::string error = prefixindex::ResolveHashProfile(source, profile);
!error.empty()) {
const char* field = "python_hash_seed";
if (source.strategy != "vllm_v1") {
field = "strategy";
} else if (source.algorithm != "sha256_cbor") {
field = "algorithm";
} else if (source.index_projection != "low64_be") {
field = "index_projection";
}
HttpJsonError(resp, "invalid_value", error, field);
return false;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This logic for determining the field that caused the error is a bit fragile as it duplicates the validation logic from prefixindex::ValidateProfileSelectors. If the supported profiles change in ValidateProfileSelectors, this code will also need to be updated to report the correct field in case of an error. This could lead to maintenance issues in the future.

A more robust approach could be for ResolveHashProfile to return a structured error indicating the problematic field. Barring that, you might consider reporting the error on the hash_profile object as a whole to avoid this duplication and potential for getting out of sync.

@Chase-Rong
Chase-Rong requested a review from stmatengss July 17, 2026 02:31
@Chase-Rong
Chase-Rong merged commit d9c605f into kvcache-ai:dev/conductor Jul 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant