Conversation
|
/label status/waiting-for-review |
8717ee3 to
9344374
Compare
9344374 to
523f0f8
Compare
LHT129
left a comment
There was a problem hiding this comment.
Reviewed the latest commit (523f0f8). All issues raised in the previous review round have been addressed:
- Double label lookup: Resolved by the
get_data_by_ids/get_data_by_ids_with_flagrefactoring ininner_index_interface.cpp, which resolves inner IDs once and reuses them for vector, attribute, extra-info, and now path retrieval. - Circular include: Resolved by moving
Pyramid::serialize_paths,deserialize_paths, andGetDataByIdsinto the dedicatedpyramid_paths.cppfile.pyramid_path_store.cppno longer includespyramid.h. - Serialization tag criticality:
PYRAMID_PATHSis correctly marked as non-critical inserialization_tags.hwith a comment explaining the rationale. - Deserialization contract: The
Footer::Parsemodernization is consistent with other index types (hgraph, ivf, sindi_v2). Thehas_paths != store_paths_mismatch check and format version validation are good safety measures.
The new code is well-structured, properly tested (unit tests for path store, functional tests for paths and serialization, parameter tests), and follows the project coding standards. No new issues found.
Signed-off-by: jc543239 <jc543239@antgroup.com> Assisted-by: Codex:gpt-5
Signed-off-by: jc543239 <jc543239@antgroup.com> Assisted-by: Codex:gpt-5
cd218ce to
6d10966
Compare
LHT129
left a comment
There was a problem hiding this comment.
[note] This is a well-structured backport of the Pyramid path storage feature (#2763) to the 1.0 branch. The code quality is high, with thorough test coverage, proper serialization compatibility checks, and clean separation of concerns between PyramidPathStore and the Pyramid class.
One minor observation in pyramid_paths.cpp GetDataByIdsWithFlag: the paths unique_ptr is allocated for every hierarchy before checking whether GetPaths succeeds. When a hierarchy lacks complete paths, the allocation is discarded. Since hierarchies_.size() is typically small (1-3) and path retrieval is not a hot path, this is acceptable. Consider pre-checking completeness before allocating if this becomes a concern in the future.
All previous review comments from LHT129 have been addressed:
- Redundant label lookup: resolved via
get_data_by_ids_with_flagwith sharedinner_ids - Circular include: resolved by separating
Pyramidmethods intopyramid_paths.cpp PYRAMID_PATHStag numbering: clarified with a comment about non-critical classificationDeserializefooter change: confirmed behaviorally equivalent to the oldread_index_footer
Signed-off-by: jc543239 <jc543239@antgroup.com> Assisted-by: Codex:gpt-5
Signed-off-by: jc543239 <jc543239@antgroup.com> Assisted-by: Codex:gpt-5
Signed-off-by: jc543239 <jc543239@antgroup.com> Assisted-by: Codex:gpt-5
|
Updated in
The main-branch Release A/B for this Writer design was +1.09% at 1K unique paths and +0.14% at 100K unique paths versus the previous bulk implementation, with less than 0.8 MiB RSS difference and identical serialized sizes. Local targeted result: 18 PathStore unit assertions + 280 Pyramid path functional assertions passed; |
LHT129
left a comment
There was a problem hiding this comment.
[note] In Deserialize (src/algorithm/pyramid/pyramid.cpp), body_length is computed as reader.Length() - footer->Length(). Both are uint64_t, so if footer->Length() exceeded reader.Length() (which should never happen after a successful Footer::Parse), this would underflow. Consider adding CHECK_ARGUMENT(footer->Length() <= reader.Length(), "footer exceeds reader length") to make the invariant explicit and protect against future changes to Footer::Parse.
Overall assessment: This is a well-structured backport PR with comprehensive test coverage (15 functional test cases, 4 unit test cases, plus parameter and serialization tests). The implementation correctly isolates path storage in PyramidPathStore, properly handles concurrent Add operations, validates serialization contract consistency, and preserves backward compatibility when store_paths=false. All previously identified issues have been addressed. No blocking issues found.
Signed-off-by: jc543239 <jc543239@antgroup.com> Assisted-by: Codex:gpt-5
|
Final minimal-scope update is pushed in 0bd344d. Implementation:
Scope cleanup in this update:
Validation:
The main-branch Release A/B remains representative because the in-memory writer is identical: versus the prior single-path implementation, build time was +1.27% at 1K unique paths and +1.86% at 100K unique paths; peak build RSS was +1.16 MiB and +1.43 MiB. Direct serialization was 1.90% and 0.46% faster than the prior unmerged row-state draft, while the direct dense wire format adds 900,016 bytes at 100K slots. |
Signed-off-by: jc543239 <jc543239@antgroup.com> Assisted-by: Codex:gpt-5
| throw VsagException(ErrorType::READ_ERROR, "corrupted Pyramid path hierarchy count"); | ||
| } | ||
|
|
||
| for (uint64_t offset = 0; offset < hierarchy_count; ++offset) { |
There was a problem hiding this comment.
[note] The deserialize_paths method does not check for duplicate hierarchy names in the serialized stream. If a malformed/corrupted serialized payload contains the same hierarchy name twice, the second occurrence would silently overwrite the first deserialized path store without any error. The previous version of this code (before the refactor) used an UnorderedSet to guard against duplicates. Consider adding a similar duplicate-detection check here to fail fast on corrupted data rather than silently accepting it.
LHT129
left a comment
There was a problem hiding this comment.
PR Review Summary
This PR backports store_paths support to Pyramid, enabling GetDataByIdsWithFlag to return original path labels. The implementation is well-structured and follows existing patterns in the codebase.
What changed
- New
PyramidPathStoreclass with RAIIWriterpattern for thread-safe path storage - New
pyramid_paths.cppwith serialization andGetDataByIdsWithFlag store_pathsparameter (default false) added toPyramidParameters- Streaming serialization tag
PYRAMID_PATHS = 18 InnerIndexInterfacerefactored to exposeget_data_by_ids_with_flagas protected- Comprehensive test coverage:
pyramid_path_store_test,test_pyramid_path_serialization,test_pyramid_paths
Review findings
- [note]
deserialize_pathsmissing duplicate hierarchy name check (see inline comment onpyramid_paths.cpp:47): The method does not guard against duplicate hierarchy names in corrupted serialized data. The previous version used anUnorderedSetfor this check.
Overall assessment
The implementation is solid: correct use of RAII, proper error handling, good test coverage, and clean integration with existing serialization infrastructure. No blocking issues found.
Change Type
Linked Issue
Related to #2754. Backport of #2763 to the 1.0 branch.
What Changed
Compatibility and Performance
Validation