Skip to content

Conversation

@Sicheng-Pan
Copy link
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
Contributor Author

Sicheng-Pan commented Feb 10, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link

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
Contributor

propel-code-bot bot commented Feb 11, 2026

Quantized SPANN writer integration across compaction pipeline

This PR wires the quantized SPANN writer end-to-end by extending the SpannProvider with a USearchIndexProvider, exposing a write_quantized_usearch entry point, and propagating support for SegmentType::QuantizedSpann through the log fetch, compaction, and attached-function orchestrators. The service layer now automatically calls schema.quantize(Quantization::USearch4BitRabitQ) for tenants flagged for quantization, while the schema data model is refactored to treat quantization as a first-class enum with stricter validation, default handling, and helper APIs to set quantized defaults.
In addition, compaction manager/server wiring, span tests, and quantized writer persistence logic were updated to load/use the USearch provider, write new metadata (quantization center/rotation), and flush/reopen quantized indices safely.

Key Changes

• Extended rust/segment/src/spann_provider.rs to hold a USearchIndexProvider, generate quantized writers, and expose write_quantized_usearch alongside existing HNSW writers.
• Updated orchestrators (attached_function, log_fetch, compaction, and related error enums) to branch on SegmentType::QuantizedSpann, instantiate QuantizedSpannSegmentWriter, and plumb optional hnsw_index_uuid semantics.
• Enabled quantization-aware deployments by loading USearchIndexProvider in worker/compactor servers, gating schema creation via schema.quantize(Quantization::USearch4BitRabitQ), and toggling quantization per-tenant through the frontend.
• Refactored rust/types/src/collection_schema.rs to model quantization via a Quantization enum, enforce Quantization::None in user/default configs, add Schema::quantize helper, and loosen SPANN validation ranges to support RabitQ defaults.
• Enhanced quantized SPANN writer/persister (rust/index/src/spann/quantized_spann.rs) to read/write rotation matrices, handle center drift rebuilds, load raw embeddings, and ensure persistence across reopen cycles (with expanded test coverage).

Possible Issues

schema.quantize(Quantization::USearch4BitRabitQ) unconditionally resets SPANN tuning parameters, potentially discarding user-provided overrides without warning.
• Compaction workflows now depend on chroma-segment being built with the usearch feature; deployments lacking the feature flag may fail to spawn quantized writers.

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

@blacksmith-sh
Copy link
Contributor

blacksmith-sh bot commented Feb 11, 2026

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
chroma-types/collection_schema::tests::test_spann_index_config_validation View Logs

OOM Events Detected

  • Job Python tests / test-rust-bindings-stress (3.9) has run into an OOM error.

Fix in Cursor

@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
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.

1 participant