Repository navigation
[Feat] radix-tree: Report each path node's child count in collect_path_info - #45241
Conversation
This comment has been minimized.
This comment has been minimized.
|
This port clears our bar on gate✓ lint✓ build 8✓✗1✂1 A✓ B✓ C 0/15⏳ other✓ · accel ✗amd,npu @fei-xx @merrymercy @Jialin — could one of you take a look and merge it if you are happy? Nothing else is waiting on our side. |
41fd525 to
1c124e3
Compare
…_path_info `collect_path_info` returns, for each requested end node, the root-to-node chain as `TreePathNodeInfo` records. A caller that reads a tree path by node id, for example a background writer deciding whether a node is a branch point or the middle of a straight chain, could not tell the two apart without a second round trip into the tree. Add `num_children` to `TreePathNodeInfo`, on both the Rust core and the Python reference core, carrying the node's immediate child count at the time of the snapshot. Like the rest of the record it is a snapshot: a later split or eviction changes the tree, not a record already handed out. The Rust unit test now builds its two-node path with a split so the head node has a real child, adds a second branch and checks both chains report the branch point, and evicts the branch again to show the earlier snapshot was not mutated. The Python integration test checks the new field through the bindings tuple on both backends. Co-authored-by: Jialin <[email protected]>
1c124e3 to
7ee7e59
Compare
|
This port clears our bar on gate✓ lint✓ build 4✓✗1✂1 A✓ B✓ C 0/14⏳ other✓ · accel ✗amd,npu @fei-xx @merrymercy @Jialin — could one of you take a look and merge it if you are happy? Nothing else is waiting on our side. |
… C closure -- the post-merge port queue is now decided ARRIVAL SCAN (git log 12dc623..2a6c204 --grep) + LIVE gh STATE + head-sha comparison for EVERY deferred item. Verdicts: RELEASED-BY-MERGE: sgl-project#42689 (@ 7a632cf in-range -- the SECTION-B cherry is now redundant; behavior note rides the restart). CLOSED (C-items whose PRs arrived and whose integration this stack performed): C1 (the dedicated merge week WAS merge sgl-project#5; all eight precursor PRs in-range), C2 (sgl-project#44993/sgl-project#44994 -- B5), C3 (sgl-project#45232/ sgl-project#45236/sgl-project#45334 -- B2), C4 (sgl-project#45238/sgl-project#45241/sgl-project#45242 -- B3), C5 (sgl-project#44912/ sgl-project#44913 -- arrived; entry-230 canary re-planted as its guard), C9 (sgl-project#39727 -- verified OPT-IN, no purge; BOOT_DELTA anti-needle), C0a (arrival shas already recorded at entry 310 -- Section C now carries NO open code-integration items: C6/C10 retain only their explicitly-named docs/boot-measurement remainders, re-stated). STILL-OPEN: sgl-project#44342 (head unchanged; auto-merge comfort LOST to #46970x), sgl-project#46153/sgl-project#37106/sgl-project#32479/sgl-project#45391 (gh CONFLICTING -- stale bases, rebase before any port), sgl-project#41624/sgl-project#42525/sgl-project#42660/sgl-project#44462/sgl-project#35617 (open, heads unchanged), sgl-project#46191/sgl-project#39845-class (watch-list, none in range). HOLD STANDS (operator decision, binding): sgl-project#43356/sgl-project#46452/sgl-project#43240/ sgl-project#43471 KV route -- step-1 'MERGE sgl-project#5 lands first' is NOW MET; the sequence may be re-visited ONLY with the post-merge PCIe-IPC measurement at an operator sitting. sgl-project#44732: the 'one purge if done WITH the merge' premise LAPSED when merge sgl-project#5 completed without it -- later execution costs the SAME single purge once; no penalty, no haste. Recorded for the operator, not decided by B6.
Motivation
collect_path_infohands a caller the root-to-node chain for each requested end node asTreePathNodeInforecords (node id, parent id, path span, FULL value length). A caller that reads tree paths by node id, for example a background writer that must decide whether a node is a branch point or the middle of a straight chain before publishing it, had no way to tell the two apart from the record and needed a second trip into the tree.Modifications
TreePathNodeInfogainsnum_children, the node's immediate child count at the time of the snapshot, in the Rust core (unified_tree_core.rs), the Python reference core (unified_tree_core.py/unified_tree_core_interface.py) and the bindings tuple (python_bindings.rs). The Python adapter already builds the record positionally from the tuple, so it picks the field up unchanged.assert_path_info: build the two-node path with a split so the head node has a real child, add a second branch and check both chains report the branch point, then evict the branch and check the earlier snapshot was not mutated.Accuracy Tests
No model behaviour changes; this adds a read-only field to a tree inspection record.
Benchmarking and Profiling
Not applicable: one extra
usizeper path record on an inspection path.Checklist
CI States
Latest PR Test (Base): ✅ Run #39393620892
Latest PR Test (Extra): ❌ Run #39393620859
Latest PR Test (AMD ROCm 10): ❌ Run #39393620822