Skip to content

[ENH] Wire up quantized writer in compaction#6399

Merged
Sicheng-Pan merged 7 commits intomainfrom
02-10-_enh_wire_up_quantized_writer_in_compaction
Feb 14, 2026
Merged

[ENH] Wire up quantized writer in compaction#6399
Sicheng-Pan merged 7 commits intomainfrom
02-10-_enh_wire_up_quantized_writer_in_compaction

Conversation

@Sicheng-Pan
Copy link
Copy Markdown
Contributor

@Sicheng-Pan Sicheng-Pan commented Feb 10, 2026

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • Updated spann provider to spawn quantized writer with feature flag
    • Wire up the quantized writer spawning in compactor
  • New functionality
    • N/A

Test plan

How are these changes tested?

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Migration plan

Are there any migrations, or any forwards/backwards compatibility changes needed in order to make sure this change deploys reliably?

Observability plan

What is the plan to instrument and monitor this change?

Documentation Changes

Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs section?

Copy link
Copy Markdown
Contributor Author

Sicheng-Pan commented Feb 10, 2026

@github-actions
Copy link
Copy Markdown

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@blacksmith-sh

This comment has been minimized.

@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_quantized_spann_segment branch from 15768fa to e3957b5 Compare February 11, 2026 02:22
@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_wire_up_quantized_writer_in_compaction branch from 184f5c3 to ff1afdf Compare February 11, 2026 02:22
@Sicheng-Pan Sicheng-Pan marked this pull request as ready for review February 11, 2026 02:30
@propel-code-bot
Copy link
Copy Markdown
Contributor

propel-code-bot bot commented Feb 11, 2026

Enable Quantized SPANN Writer and USearch Provider Plumbing

This PR wires quantized SPANN compaction end-to-end by introducing a USearch-backed writer path and the configuration/schema changes required to drive it. SpannProvider now optionally owns a USearchIndexProvider, bootstrapped via new usearch_provider.cache_config blocks in the service YAMLs and guarded by feature flags, while the worker/compactor orchestration code branches on SegmentType::QuantizedSpann to spawn the new quantized writer. The quantization configuration surface was redesigned: SpannIndexConfig.quantize is now the Quantization enum, serialization/deserialization helpers enforce valid presets, and Schema::quantize() applies preset defaults for allow-listed tenants; the generated TypeScript API types and validation logic were updated accordingly. Tests and helpers (including quantized_spann::test_config) were adjusted to the new enum-based configuration and to cover quantized segment paths and USearch cache directories.

Key Changes

• Introduced optional USearchIndexProvider wiring inside SpannProvider, including feature-gated constructors, write_quantized_usearch helper, and server/bootstrap hooks that build the provider/cache using new YAML config.
• Refactored compaction, log-fetch, and attached-function orchestration to recognize SegmentType::QuantizedSpann, spawn the quantized writer, and stop assuming HNSW UUIDs.
• Replaced the boolean SpannIndexConfig.quantize flag with a Quantization enum, added serde helpers/validation, and exposed the enum through Rust schema APIs and generated TypeScript types.
• Added Schema::quantize() to auto-apply quantization presets for eligible tenants and kept frontend schema/attached-function flows in sync.
• Updated worker Cargo.toml, configuration files, and tests (including quantized_spann::test_config) to enable the usearch feature and supply cache/test directories for quantized segments.

Possible Issues

• Deployments missing the new usearch_provider config will fail at startup when the usearch feature is enabled.
• Older persisted schemas or clients still sending boolean quantize values may break without migration/backcompat logic.
• Any remaining code paths that still expect an HNSW UUID for quantized segments could panic or mis-route work.

This summary was automatically generated by @propel-code-bot

@blacksmith-sh

This comment has been minimized.

@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_quantized_spann_segment branch from e3957b5 to 0a585d2 Compare February 11, 2026 19:10
@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_wire_up_quantized_writer_in_compaction branch from ff1afdf to d599ae5 Compare February 11, 2026 19:10
@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_wire_up_quantized_writer_in_compaction branch from 3324688 to f823d3d Compare February 11, 2026 21:07
@blacksmith-sh

This comment has been minimized.

@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_wire_up_quantized_writer_in_compaction branch from f823d3d to d45735e Compare February 12, 2026 01:40
@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_quantized_spann_segment branch from 22ff37f to fa35f48 Compare February 12, 2026 01:40
@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_wire_up_quantized_writer_in_compaction branch from d45735e to d24f142 Compare February 12, 2026 01:41
@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_quantized_spann_segment branch from fa35f48 to b02eb80 Compare February 12, 2026 01:41
@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_wire_up_quantized_writer_in_compaction branch from d2f93df to bc0818a Compare February 12, 2026 21:33
@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_quantized_spann_segment branch from b02eb80 to 41c8cc9 Compare February 12, 2026 21:33
@blacksmith-sh

This comment has been minimized.

Copy link
Copy Markdown
Collaborator

@HammadB HammadB left a comment

Choose a reason for hiding this comment

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

please move out the config

@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_quantized_spann_segment branch from 41c8cc9 to d58781f Compare February 13, 2026 00:43
@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_wire_up_quantized_writer_in_compaction branch from bc0818a to 465c5fc Compare February 13, 2026 00:43
@Sicheng-Pan
Copy link
Copy Markdown
Contributor Author

Introduced separate cache config for USearch

Copy link
Copy Markdown
Contributor Author

Sicheng-Pan commented Feb 14, 2026

Merge activity

  • Feb 14, 1:52 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Feb 14, 1:54 AM UTC: Graphite rebased this pull request as part of a merge.
  • Feb 14, 2:30 AM UTC: @Sicheng-Pan merged this pull request with Graphite.

@Sicheng-Pan Sicheng-Pan changed the base branch from 02-10-_enh_quantized_spann_segment to graphite-base/6399 February 14, 2026 01:52
@Sicheng-Pan Sicheng-Pan changed the base branch from graphite-base/6399 to main February 14, 2026 01:52
@Sicheng-Pan Sicheng-Pan force-pushed the 02-10-_enh_wire_up_quantized_writer_in_compaction branch from 465c5fc to 8588982 Compare February 14, 2026 01:53
@Sicheng-Pan Sicheng-Pan merged commit 6b0fa05 into main Feb 14, 2026
67 checks passed
tanujnay112 added a commit that referenced this pull request Feb 18, 2026
- **[ENH]: Cache rust git submodules in mounted volume (#6424)**
- **[CHORE](k8s) increase dev CPU limits from 100m to 200-300m (#6435)**
- **[ENH] replace live cloud tests with k8s integration tests (#6434)**
- **[ENH] Make dirty_log_collections metric mcmr-aware. (#6353)**
- **[ENH] Quantized Spann Segment Writer (#6397)**
- **[ENH] Wire up quantized writer in compaction (#6399)**
- **[ENH] Quantized Spann Segment Reader (#6405)**
- **[ENH] Wire up quantized reader in new orchestrator (#6409)**
- **[ENH] Garbage collect usearch index files (#6416)**
- **[ENH] Trace quantized spann implementation (#6425)**
- **[ENH]: Precompute data chunk len() (#6442)**
- **[BUG]: Compaction version file flush was incomplete on MCMR
(#6423)**
- **[DOC]: Fixed broken links in Readme (#6440)**
- **[DOC] Fix link to Rust documentation (#6443)**
- **[ENH]: Allow users to disable FTS in schema (#6214)**

---------

Co-authored-by: Robert Escriva <[email protected]>
Co-authored-by: Macronova <[email protected]>
Co-authored-by: Nilpotent <[email protected]>
Co-authored-by: anderk222 <[email protected]>
Co-authored-by: Sanket Kedia <[email protected]>
@Sicheng-Pan Sicheng-Pan deleted the 02-10-_enh_wire_up_quantized_writer_in_compaction branch February 25, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants