Skip to content

[Feat] radix-tree: Report each path node's child count in collect_path_info - #45241

Merged
cctry merged 1 commit into
mainfrom
oss-sync-53e0f0ebc1
Oct 20, 2026
Merged

cctry merged 1 commit into
mainfrom
oss-sync-53e0f0ebc1

Conversation

@metamergebot

@metamergebot metamergebot commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

collect_path_info hands a caller the root-to-node chain for each requested end node as TreePathNodeInfo records (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

  • TreePathNodeInfo gains num_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.
  • Like the rest of the record it is a snapshot: a later split or eviction changes the tree, not a record already handed out.
  • Rust unit test 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.
  • Python integration test: check the new field through the bindings on both backends, including after a split that turns a chain node into a branch point.

Accuracy Tests

No model behaviour changes; this adds a read-only field to a tree inspection record.

Benchmarking and Profiling

Not applicable: one extra usize per 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

@github-actions

This comment has been minimized.

@metamergebot metamergebot changed the title [MemCache] radix-tree: Report each path node's child count in collect_path_info [Feat] radix-tree: Report each path node's child count in collect_path_info Oct 19, 2026
@metamergebot

Copy link
Copy Markdown
Collaborator Author

This port clears our bar on 41fd525b1514bea62dbed77b7577eb95a7a45f7e: every base-a and base-b job is green.
base-c and the accelerator suites are reported but not gated, because they run
on scarce hardware and upstream merges through them routinely.

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.

…_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]>
@metamergebot

Copy link
Copy Markdown
Collaborator Author

This port clears our bar on 7ee7e59635f2926dad2748efce92f4ec38fd5a70: every base-a and base-b job is green.
base-c and the accelerator suites are reported but not gated, because they run
on scarce hardware and upstream merges through them routinely.

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.

@cctry
cctry merged commit dc62c3e into main Oct 20, 2026
182 of 197 checks passed
@cctry
cctry deleted the oss-sync-53e0f0ebc1 branch October 20, 2026 20:24
detain added a commit to detain/sglang that referenced this pull request Oct 30, 2026
… 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci CI: run the baseline test suite on this PR unified-radix-cache

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants