Repository navigation
Conversation
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (2)
lib/api/src/grpc/conversions.rs (1)
1424-1427: Use an explicit conversion in the new Turbo arm.
turbo.into()is the new implicit conversion in this hunk. Please switch it to an explicitTurboQuantization::from(turbo)to match the repo’s Rust conversion rule.As per coding guidelines, "`**/*.rs`: Prefer explicit `SomeType::from(x)` over implicit `x.into()` in Rust".♻️ Suggested change
segment::types::QuantizationConfig::Turbo(turbo) => Self { quantization: Some( - super::qdrant::quantization_config::Quantization::Turboquant(turbo.into()), + super::qdrant::quantization_config::Quantization::Turboquant( + super::qdrant::TurboQuantization::from(turbo), + ), ), },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/api/src/grpc/conversions.rs` around lines 1424 - 1427, Replace the implicit conversion turbo.into() in the match arm that builds super::qdrant::quantization_config::Quantization::Turboquant with an explicit conversion call: use super::qdrant::quantization_config::TurboQuantization::from(turbo) (or TurboQuantization::from(turbo) via the imported path) so the quantization field becomes Some(...Turboquant(TurboQuantization::from(turbo))...); update the import/path if needed to reference TurboQuantization directly.lib/api/src/grpc/qdrant.rs (1)
975-983: Avoid temporary public proto fields without a removal reservation plan.
plusis marked TODO in a public protobuf message. If you plan to remove it, reserve tag3inpoints.prototo avoid accidental tag reuse and future wire-compat regressions.Based on learnings:
lib/api/src/grpc/qdrant.rsis auto-generated by prost-build; make changes inlib/api/src/grpc/proto/points.protoand regenerate the Rust code.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/api/src/grpc/qdrant.rs` around lines 975 - 983, The generated TurboQuantization struct exposes a temporary public field plus using proto tag 3; instead of editing the Rust file, update lib/api/src/grpc/proto/points.proto to either remove the field and add "reserved 3;" (or rename it and explicitly reserve tag 3) in the TurboQuantization message definition, then run prost-build/regenerate the protobuf Rust sources so the generated qdrant.rs no longer contains the temporary plus field and tag 3 is reserved to prevent future tag reuse.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lib/api/src/grpc/proto/collections.proto`:
- Around line 364-370: The public proto message TurboQuantization currently
exposes a temporary field "plus" (optional bool plus = 3) which must not land;
remove the "optional bool plus = 3;" line from the TurboQuantization message and
replace it with "reserved 3;" (or add a reserved range including 3) to prevent
reuse of that tag in future incompatible changes, and keep the TODO in a
non-public place (e.g., an internal comment or task) until the semantics are
finalized.
In `@lib/collection/src/operations/conversions.rs`:
- Around line 375-379: The TurboQuant branch must be rejected at conversion time
instead of converting to Self::Turbo; in conversions.rs update the match arm
handling Quantization::Turboquant (the current Quantization::Turboquant =>
Ok(Self::Turbo(turbo.try_into()?)) lines and the similar occurrences around the
841-854 range) to return a clear conversion error (e.g., Err(...) from the
TryFrom/TryInto impl) so requests containing TurboQuant are rejected rather than
producing a Self::Turbo that will hit todo!() at runtime; locate the
TryFrom/impl conversion method that uses
Quantization::Scalar/Product/Binary/Turboquant and replace the Turboquant arm
with a failure return that includes a descriptive message referencing
TurboQuant.
In `@lib/edge/python/src/config/quantization.rs`:
- Around line 58-61: The QuantizationConfig::Turbo arm currently calls
unimplemented!("TurboQuant not yet implemented for edge") which will panic in
conversion/__repr__ paths; replace that panic with a Python-level error return
so Python callers get a proper exception instead of crashing the process.
Concretely, in the QuantizationConfig::Turbo match arm (and the similar block at
the other occurrence), return an Err containing a pyo3 Python exception (e.g.,
PyNotImplementedError or a descriptive PyValueError) or map to a safe fallback
representation in the binding conversion function rather than calling
unimplemented!(), ensuring the conversion/Display/__repr__ flows propagate a
Python error instead of panicking.
In `@lib/segment/src/types.rs`:
- Around line 931-934: The current matches! expression treats
QuantizationConfig::Turbo(_) as appendable which can route appendable segments
into unimplemented Turbo runtime paths; change the pattern in the matches! to
only include QuantizationConfig::Binary(_) (i.e., remove
QuantizationConfig::Turbo(_)) so Turbo is excluded from the appendable flow
until runtime support is implemented, and run/update any related tests to ensure
no code path assumes Turbo is appendable (update comments if needed to note the
intentional gating).
In `@lib/segment/src/vector_storage/quantized/quantized_vectors.rs`:
- Around line 731-734: Replace the panic-causing todo!() in all
QuantizationConfig::Turbo match arms with an explicit, non-panicking error
return so Turbo is rejected at runtime; locate each Turbo arm
(QuantizationConfig::Turbo) used during quantized storage create/load/update and
return a clear Unsupported/InvalidConfiguration error (e.g.,
Err(Error::UnsupportedQuantization("Turbo")) or the project’s existing
unsupported-config error variant) with a consistent message, so callers
(create/load functions that currently can panic) get an error result instead of
aborting the process; apply the same change to all four Turbo arms identified so
Turbo cannot be persisted or cause a panic.
---
Nitpick comments:
In `@lib/api/src/grpc/conversions.rs`:
- Around line 1424-1427: Replace the implicit conversion turbo.into() in the
match arm that builds
super::qdrant::quantization_config::Quantization::Turboquant with an explicit
conversion call: use
super::qdrant::quantization_config::TurboQuantization::from(turbo) (or
TurboQuantization::from(turbo) via the imported path) so the quantization field
becomes Some(...Turboquant(TurboQuantization::from(turbo))...); update the
import/path if needed to reference TurboQuantization directly.
In `@lib/api/src/grpc/qdrant.rs`:
- Around line 975-983: The generated TurboQuantization struct exposes a
temporary public field plus using proto tag 3; instead of editing the Rust file,
update lib/api/src/grpc/proto/points.proto to either remove the field and add
"reserved 3;" (or rename it and explicitly reserve tag 3) in the
TurboQuantization message definition, then run prost-build/regenerate the
protobuf Rust sources so the generated qdrant.rs no longer contains the
temporary plus field and tag 3 is reserved to prevent future tag reuse.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: eab796c0-9298-46aa-980b-f14b1ea71098
📒 Files selected for processing (13)
lib/api/build.rslib/api/src/grpc/conversions.rslib/api/src/grpc/proto/collections.protolib/api/src/grpc/qdrant.rslib/api/src/grpc/validate.rslib/collection/src/collection/collection_ops.rslib/collection/src/config.rslib/collection/src/operations/config_diff.rslib/collection/src/operations/conversions.rslib/edge/python/src/config/quantization.rslib/segment/src/compat.rslib/segment/src/types.rslib/segment/src/vector_storage/quantized/quantized_vectors.rs
| message TurboQuantization{ | ||
| optional bool always_ram = 1; | ||
| optional TurboQuantBitSize bits = 2; | ||
|
|
||
| // TODO(turbo): Remove before release | ||
| optional bool plus = 3; | ||
| } |
There was a problem hiding this comment.
Avoid landing a temporary public field.
plus is part of the public proto contract here, but the comment says it should be removed later. If this reaches a release, you either have to support it indefinitely or make the next schema revision breaking. I’d keep it out of the public message until the semantics are final.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@lib/api/src/grpc/proto/collections.proto` around lines 364 - 370, The public
proto message TurboQuantization currently exposes a temporary field "plus"
(optional bool plus = 3) which must not land; remove the "optional bool plus =
3;" line from the TurboQuantization message and replace it with "reserved 3;"
(or add a reserved range including 3) to prevent reuse of that tag in future
incompatible changes, and keep the TODO in a non-public place (e.g., an internal
comment or task) until the semantics are finalized.
There was a problem hiding this comment.
We wont release tmp api
There was a problem hiding this comment.
@IvanPleshkov Understood, thanks for the clarification! As long as the plus field is cleaned up before the branch is merged into a release, the concern is mitigated. Just worth keeping an eye on it so it doesn't accidentally slip through.
😄🐇
🧠 Learnings used
Learnt from: generall
Repo: qdrant/qdrant PR: 7183
File: lib/api/src/grpc/qdrant.rs:4263-4273
Timestamp: 2025-09-16T19:14:17.614Z
Learning: In qdrant, lib/api/src/grpc/qdrant.rs is auto-generated by prost-build; do not edit it directly. Make changes in lib/api/src/grpc/proto/points.proto (e.g., add [deprecated=true], doc comments, or encoding options), then regenerate the Rust code.
| QuantizationConfig::Turbo(_) => { | ||
| // TODO(turbo): Implement for edge. | ||
| unimplemented!("TurboQuant not yet implemented for edge") | ||
| } |
There was a problem hiding this comment.
Don’t panic in the Python binding for unsupported Turbo configs.
unimplemented!() turns ordinary conversion / __repr__ paths into Rust panics. If edge ever sees a Turbo config from persisted state or an API response, this will crash instead of surfacing a Python-level error.
⚠️ Safer fallback
QuantizationConfig::Turbo(_) => {
- // TODO(turbo): Implement for edge.
- unimplemented!("TurboQuant not yet implemented for edge")
+ return Err(pyo3::exceptions::PyNotImplementedError::new_err(
+ "TurboQuant not yet implemented for edge",
+ ));
} QuantizationConfig::Turbo(_) => {
- // TODO(turbo): Implement for edge.
- unimplemented!("TurboQuant not yet implemented for edge")
+ return f.write_str("TurboQuantizationConfig(<unsupported in edge>)");
}Also applies to: 78-80
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@lib/edge/python/src/config/quantization.rs` around lines 58 - 61, The
QuantizationConfig::Turbo arm currently calls unimplemented!("TurboQuant not yet
implemented for edge") which will panic in conversion/__repr__ paths; replace
that panic with a Python-level error return so Python callers get a proper
exception instead of crashing the process. Concretely, in the
QuantizationConfig::Turbo match arm (and the similar block at the other
occurrence), return an Err containing a pyo3 Python exception (e.g.,
PyNotImplementedError or a descriptive PyValueError) or map to a safe fallback
representation in the binding conversion function rather than calling
unimplemented!(), ensuring the conversion/Display/__repr__ flows propagate a
Python error instead of panicking.
There was a problem hiding this comment.
@IvanPleshkov, understood — the unimplemented!() panics in the edge Python bindings are intentional stubs following the incremental TurboQuant rollout plan in #8670. I'll note this for future reviews.
✏️ Learnings added
Learnt from: IvanPleshkov
Repo: qdrant/qdrant PR: 8686
File: lib/edge/python/src/config/quantization.rs:58-61
Timestamp: 2026-04-16T07:20:19.247Z
Learning: In `lib/edge/python/src/config/quantization.rs`, the `unimplemented!("TurboQuant not yet implemented for edge")` panics in `IntoPyObject` and `Repr` impls for `QuantizationConfig::Turbo(_)` are intentional stubs. They are acceptable as part of the incremental TurboQuant rollout plan tracked in https://github.com/qdrant/qdrant/issues/8670. Do not flag these as needing Python-level error returns or safe fallbacks — they will be properly implemented in a later PR.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
🧠 Learnings used
Learnt from: IvanPleshkov
Repo: qdrant/qdrant PR: 8686
File: lib/collection/src/operations/conversions.rs:375-379
Timestamp: 2026-04-16T07:19:56.671Z
Learning: In qdrant/qdrant, TurboQuant API conversion branches (e.g., `Quantization::Turboquant` → `Self::Turbo` in `lib/collection/src/operations/conversions.rs`) are intentionally added before the full load/create implementation is ready. The `todo!()` placeholders in the backend are acceptable as part of the incremental rollout plan tracked in https://github.com/qdrant/qdrant/issues/8670. Do not flag these conversion branches as needing early rejection guards.
Learnt from: IvanPleshkov
Repo: qdrant/qdrant PR: 8677
File: lib/quantization/src/turboquant/mod.rs:67-77
Timestamp: 2026-04-15T08:06:51.157Z
Learning: In `lib/quantization/src/turboquant/mod.rs`, `validate_vector_parameters` is intentionally called only via `debug_assert!` in the `encode` function (and similarly not added to upsert paths) because it requires reading vector data that may be on disk, making it too expensive for production builds. The debug-only check is sufficient to catch mismatches during development and testing.
Learnt from: IvanPleshkov
Repo: qdrant/qdrant PR: 7009
File: lib/quantization/src/encoded_vectors_binary.rs:614-618
Timestamp: 2025-08-11T12:30:47.220Z
Learning: In `lib/quantization/src/encoded_vectors_binary.rs`, the `encode_two_bits_value` function has two paths: when `vector_stats` is available, it uses mean/stddev for accurate z-score based quantization boundaries; when stats are None (for appendable BQ), it falls back to a simple sign-based heuristic (positive -> (true, true), non-positive -> (false, false)). Having stats available provides higher accuracy for storage encoding.
Learnt from: IvanPleshkov
Repo: qdrant/qdrant PR: 6986
File: lib/segment/src/vector_storage/quantized/quantized_vectors.rs:81-84
Timestamp: 2025-08-11T07:57:01.399Z
Learning: In `lib/segment/src/vector_storage/quantized/quantized_vectors.rs`, the BitsStoreType parameter difference between single-vector and multi-vector Binary quantization is intentional: single-vector storage uses `EncodedVectorsBin<u128, ...>` to enable 128-bit SIMD/popcount optimizations for longer vectors, while multi-vector storage uses `EncodedVectorsBin<u8, ...>` because multivectors are typically shorter and benefit from byte-granular storage.
Learnt from: ffuugoo
Repo: qdrant/qdrant PR: 7465
File: lib/edge/python/src/types/value.rs:30-33
Timestamp: 2025-10-29T11:13:46.074Z
Learning: In lib/edge/python/src/types/value.rs, the HashMap transmute pattern in `PyValue::into_rust_map` that converts `HashMap<String, PyValue>` to `HashMap<String, serde_json::Value>` using unsafe transmute is acceptable and should not be flagged, as PyValue has transparent representation over serde_json::Value.
Learnt from: generall
Repo: qdrant/qdrant PR: 8322
File: lib/edge/src/lib.rs:213-237
Timestamp: 2026-03-08T01:28:03.360Z
Learning: Use SaveOnDisk<T> from common::save_on_disk for atomic persist-then-swap semantics when a config or in-memory struct must be kept in memory and persisted atomically on mutation. Prefer SaveOnDisk<T> over combining parking_lot::RwLock<T> with manual save() calls. Note: write_optional (returns Option<T>) is appropriate for fallible mutations where returning None skips both save and swap. In the qdrant/qdrant repo, the type is located at lib/common/common/src/save_on_disk.rs; migrate relevant in-memory config mutations to use SaveOnDisk<T> to ensure atomic persistence.
Learnt from: generall
Repo: qdrant/qdrant PR: 8368
File: lib/common/common/src/disk_cache/controller.rs:129-129
Timestamp: 2026-03-17T19:36:24.259Z
Learning: In this repository, all builds target 64-bit systems. Do not flag casts from u64 to usize (for example file length via f.metadata()?.len() as usize) as potentially unsafe. These casts are acceptable because 32-bit targets are not supported. Apply this guidance across all Rust sources in the codebase unless explicit overrides exist.
| matches!( | ||
| self, | ||
| QuantizationConfig::Binary(_) | QuantizationConfig::Turbo(_) | ||
| ) |
There was a problem hiding this comment.
Gate Turbo out of appendable flow until runtime support exists.
At Line 931, returning true for QuantizationConfig::Turbo(_) can route appendable segments into Turbo quantization build paths, but those runtime paths are still stubbed (todo!()), which risks panics during segment build/update flows.
💡 Proposed fix
pub fn supports_appendable(&self) -> bool {
- matches!(
- self,
- QuantizationConfig::Binary(_) | QuantizationConfig::Turbo(_)
- )
+ matches!(self, QuantizationConfig::Binary(_))
}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@lib/segment/src/types.rs` around lines 931 - 934, The current matches!
expression treats QuantizationConfig::Turbo(_) as appendable which can route
appendable segments into unimplemented Turbo runtime paths; change the pattern
in the matches! to only include QuantizationConfig::Binary(_) (i.e., remove
QuantizationConfig::Turbo(_)) so Turbo is excluded from the appendable flow
until runtime support is implemented, and run/update any related tests to ensure
no code path assumes Turbo is appendable (update comments if needed to note the
intentional gating).
| QuantizationConfig::Turbo(_turbo) => { | ||
| // TODO(turbo): Implement | ||
| todo!() | ||
| } |
There was a problem hiding this comment.
Replace the Turbo todo!()s with a real error before this lands.
These branches are now reachable because the PR also wires Turbo through config/update paths. The first create/load of quantized storage will panic the node instead of returning an unsupported-config error.
🛑 Minimal safe fallback
- QuantizationConfig::Turbo(_turbo) => {
- // TODO(turbo): Implement
- todo!()
- }
+ QuantizationConfig::Turbo(_) => {
+ return Err(OperationError::service_error(
+ "Turbo quantization is not implemented yet",
+ ));
+ }Apply the same guard in all four Turbo arms, or reject Turbo before it can be persisted in collection config.
Also applies to: 856-859, 938-941, 954-957
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@lib/segment/src/vector_storage/quantized/quantized_vectors.rs` around lines
731 - 734, Replace the panic-causing todo!() in all QuantizationConfig::Turbo
match arms with an explicit, non-panicking error return so Turbo is rejected at
runtime; locate each Turbo arm (QuantizationConfig::Turbo) used during quantized
storage create/load/update and return a clear Unsupported/InvalidConfiguration
error (e.g., Err(Error::UnsupportedQuantization("Turbo")) or the project’s
existing unsupported-config error variant) with a consistent message, so callers
(create/load functions that currently can panic) get an error result instead of
aborting the process; apply the same change to all four Turbo arms identified so
Turbo cannot be persisted or cause a panic.
There was a problem hiding this comment.
@IvanPleshkov, understood — the todo!() arms in quantized_vectors.rs are intentional scaffolding per the incremental rollout tracked in #8670, consistent with the same approach taken for the other TurboQuant placeholders in this PR. I'll withdraw the concern.
🧠 Learnings used
Learnt from: IvanPleshkov
Repo: qdrant/qdrant PR: 8677
File: lib/quantization/src/turboquant/mod.rs:67-77
Timestamp: 2026-04-15T08:06:51.157Z
Learning: In `lib/quantization/src/turboquant/mod.rs`, `validate_vector_parameters` is intentionally called only via `debug_assert!` in the `encode` function (and similarly not added to upsert paths) because it requires reading vector data that may be on disk, making it too expensive for production builds. The debug-only check is sufficient to catch mismatches during development and testing.
Learnt from: IvanPleshkov
Repo: qdrant/qdrant PR: 6986
File: lib/segment/src/vector_storage/quantized/quantized_vectors.rs:81-84
Timestamp: 2025-08-11T07:57:01.399Z
Learning: In `lib/segment/src/vector_storage/quantized/quantized_vectors.rs`, the BitsStoreType parameter difference between single-vector and multi-vector Binary quantization is intentional: single-vector storage uses `EncodedVectorsBin<u128, ...>` to enable 128-bit SIMD/popcount optimizations for longer vectors, while multi-vector storage uses `EncodedVectorsBin<u8, ...>` because multivectors are typically shorter and benefit from byte-granular storage.
Learnt from: IvanPleshkov
Repo: qdrant/qdrant PR: 7043
File: lib/segment/src/vector_storage/quantized/quantized_mmap_storage.rs:86-90
Timestamp: 2025-08-15T11:42:00.297Z
Learning: In lib/segment/src/vector_storage/quantized/quantized_mmap_storage.rs, overflow protection for encoded_storage_size computation (quantized_vector_size * vectors_count) is implemented in PR `#7048`, using checked_mul with u64 casting to prevent silent overflow.
Learnt from: IvanPleshkov
Repo: qdrant/qdrant PR: 6986
File: lib/segment/src/vector_storage/quantized/quantized_ram_storage.rs:46-55
Timestamp: 2025-08-11T00:37:34.100Z
Learning: In `lib/segment/src/vector_storage/quantized/quantized_ram_storage.rs`, the `ChunkedVectors` used in `QuantizedRamStorage` is intentionally designed to be non-persistent during updates. The `push_vector` method only updates the in-memory vectors without flushing to disk, and this is expected behavior rather than a bug.
Learnt from: IvanPleshkov
Repo: qdrant/qdrant PR: 7193
File: lib/segment/src/vector_storage/quantized/quantized_chunked_mmap_storage.rs:17-30
Timestamp: 2025-09-01T11:19:26.371Z
Learning: In lib/segment/src/vector_storage/quantized/quantized_chunked_mmap_storage.rs, the ChunkedMmapVectors underlying implementation does not validate against zero-sized vectors, so adding such validation in QuantizedChunkedMmapStorage::new is unnecessary and would be redundant.
Learnt from: IvanPleshkov
Repo: qdrant/qdrant PR: 7113
File: lib/quantization/src/encoded_vectors_binary.rs:515-525
Timestamp: 2025-08-21T13:45:05.899Z
Learning: The `EncodedStorage` trait in `lib/quantization/src/encoded_storage.rs` does not have a `quantized_vector_size()` method. To validate vector sizes from storage, use `get_vector_data(index).len()` to get the actual size of stored vectors.
Learnt from: IvanPleshkov
Repo: qdrant/qdrant PR: 7043
File: lib/segment/src/vector_storage/quantized/quantized_vectors.rs:857-857
Timestamp: 2025-08-15T11:41:10.629Z
Learning: In `lib/segment/src/vector_storage/quantized/quantized_vectors.rs`, the multivector offset storage has two different patterns: for RAM storage, offsets are collected into Vec<MultivectorOffset> and used directly; for MMAP storage, offsets are consumed to create a file via create_offsets_file_from_iter, then the file is loaded back as MultivectorOffsetsStorageMmap. The direct consumption of offsets iterator in the MMAP case is intentional.
Learnt from: IvanPleshkov
Repo: qdrant/qdrant PR: 7113
File: lib/quantization/src/encoded_vectors_u8.rs:202-211
Timestamp: 2025-08-21T13:43:52.191Z
Learning: The `quantized_vector_size()` method is available on the `EncodedVectors` trait, not on the `EncodedStorage` trait. The `EncodedStorage` trait provides methods like `get_vector_data`, `vectors_count`, `is_on_disk`, `upsert_vector`, `flusher`, `files`, and `immutable_files`.
Learnt from: IvanPleshkov
Repo: qdrant/qdrant PR: 7009
File: lib/quantization/src/encoded_vectors_binary.rs:614-618
Timestamp: 2025-08-11T12:30:47.220Z
Learning: In `lib/quantization/src/encoded_vectors_binary.rs`, the `encode_two_bits_value` function has two paths: when `vector_stats` is available, it uses mean/stddev for accurate z-score based quantization boundaries; when stats are None (for appendable BQ), it falls back to a simple sign-based heuristic (positive -> (true, true), non-positive -> (false, false)). Having stats available provides higher accuracy for storage encoding.
Learnt from: IvanPleshkov
Repo: qdrant/qdrant PR: 7048
File: lib/quantization/src/encoded_storage.rs:61-79
Timestamp: 2025-08-14T11:31:21.777Z
Learning: In test storage implementations (like TestEncodedStorage in lib/quantization/src/encoded_storage.rs), IvanPleshkov prefers to keep the code simple rather than adding complex overflow protection, since test storage is not used in production and can be allowed to panic on edge cases.
Learnt from: IvanPleshkov
Repo: qdrant/qdrant PR: 8686
File: lib/collection/src/operations/conversions.rs:375-379
Timestamp: 2026-04-16T07:19:56.671Z
Learning: In qdrant/qdrant, TurboQuant API conversion branches (e.g., `Quantization::Turboquant` → `Self::Turbo` in `lib/collection/src/operations/conversions.rs`) are intentionally added before the full load/create implementation is ready. The `todo!()` placeholders in the backend are acceptable as part of the incremental rollout plan tracked in https://github.com/qdrant/qdrant/issues/8670. Do not flag these conversion branches as needing early rejection guards.
Learnt from: IvanPleshkov
Repo: qdrant/qdrant PR: 7520
File: lib/quantization/src/p_square.rs:41-49
Timestamp: 2025-11-18T18:20:20.021Z
Learning: In lib/quantization/src/p_square.rs, IvanPleshkov prefers using defensive double-checks (e.g., `let Ok(x) = NotNan::new(x) else { return; }`) over `.unwrap()` even when a prior check guarantees success, to avoid panic-causing code and maintain defensive programming practices.
Learnt from: KShivendu
Repo: qdrant/qdrant PR: 6352
File: lib/segment/src/id_tracker/immutable_id_tracker.rs:379-393
Timestamp: 2025-05-07T09:13:47.781Z
Learning: In the Qdrant codebase, prefer fail-fast error handling by returning explicit errors rather than silently continuing with potentially corrupted state, especially in components like ID trackers that are fundamental to data integrity.
Learnt from: generall
Repo: qdrant/qdrant PR: 7183
File: lib/api/src/grpc/qdrant.rs:4263-4273
Timestamp: 2025-09-16T19:14:17.614Z
Learning: In qdrant, lib/api/src/grpc/qdrant.rs is auto-generated by prost-build; do not edit it directly. Make changes in lib/api/src/grpc/proto/points.proto (e.g., add [deprecated=true], doc comments, or encoding options), then regenerate the Rust code.
Learnt from: generall
Repo: qdrant/qdrant PR: 8322
File: lib/shard/src/optimizers/segment_optimizer.rs:67-71
Timestamp: 2026-03-08T01:28:56.567Z
Learning: In qdrant/qdrant, the `max_indexing_threads` field on `HnswConfig` uses `0` as a sentinel meaning "use system CPU count" (resolved via `segment::index::hnsw_index::num_rayon_threads(0)`). The `SegmentOptimizer::max_indexing_threads()` trait method should resolve the sentinel by calling `num_rayon_threads` on each per-vector value inside the implementation, rather than propagating the raw `0` sentinel to callers. The resolved concrete count should then be `.max()`-folded across all dense vector configurations.
Learnt from: coszio
Repo: qdrant/qdrant PR: 6768
File: lib/collection/src/collection/mmr.rs:90-95
Timestamp: 2025-07-01T17:12:27.967Z
Learning: In the Qdrant codebase, the user coszio mistakenly believed that triple question mark `???` syntax was valid Rust, when it is actually invalid syntax. The codebase uses standard Rust error propagation with `?` and `??` operators only.
Learnt from: generall
Repo: qdrant/qdrant PR: 7474
File: lib/collection/src/shards/transfer/stream_records.rs:46-55
Timestamp: 2025-11-02T19:16:42.527Z
Learning: In the Qdrant repository, do not flag compilation errors such as partial-move errors, type errors, or any syntax issues that would be caught by the Rust compiler during the build process.
Learnt from: IvanPleshkov
Repo: qdrant/qdrant PR: 8246
File: lib/segment/src/segment/segment_ops.rs:691-696
Timestamp: 2026-02-27T19:23:23.760Z
Learning: In code that computes offsets or casts counts to PointOffsetType (u32), avoid unsafe or unchecked casts from usize to PointOffsetType. Do not cast unless you can guarantee the value is < PointOffsetType::MAX, for example by assertions or by design constraints (as in versions_store.rs and segment internal IDs). When such a cast is necessary, validate the bound first and add an explicit assertion or guard, documenting the invariant to prevent overflow and maintain correctness across segments.
Learnt from: generall
Repo: qdrant/qdrant PR: 8322
File: lib/edge/src/lib.rs:213-237
Timestamp: 2026-03-08T01:28:03.360Z
Learning: Use SaveOnDisk<T> from common::save_on_disk for atomic persist-then-swap semantics when a config or in-memory struct must be kept in memory and persisted atomically on mutation. Prefer SaveOnDisk<T> over combining parking_lot::RwLock<T> with manual save() calls. Note: write_optional (returns Option<T>) is appropriate for fallible mutations where returning None skips both save and swap. In the qdrant/qdrant repo, the type is located at lib/common/common/src/save_on_disk.rs; migrate relevant in-memory config mutations to use SaveOnDisk<T> to ensure atomic persistence.
Learnt from: generall
Repo: qdrant/qdrant PR: 8368
File: lib/common/common/src/disk_cache/controller.rs:129-129
Timestamp: 2026-03-17T19:36:24.259Z
Learning: In this repository, all builds target 64-bit systems. Do not flag casts from u64 to usize (for example file length via f.metadata()?.len() as usize) as potentially unsafe. These casts are acceptable because 32-bit targets are not supported. Apply this guidance across all Rust sources in the codebase unless explicit overrides exist.
Made-with: Cursor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR introduces comprehensive Turbo Quantization support across the Qdrant codebase. Changes include new protobuf message and enum definitions ( Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This reverts commit 6543af3.
* [ai + manual] API changes for TQ * CI * Add TurboQuant types to Python type stubs Made-with: Cursor * Revert "Add TurboQuant types to Python type stubs" This reverts commit 6543af3. --------- Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: generall <[email protected]>
Implements required API changes for TQ.
Excluded in this PR: