Skip to content

fix(server): honor bounded traversal inputs - #396

Open
imbajin wants to merge 2 commits into
masterfrom
codex/repair-bounded-traversals
Open

imbajin wants to merge 2 commits into
masterfrom
codex/repair-bounded-traversals

Conversation

@imbajin

@imbajin imbajin commented Dec 3, 2026 •

Copy link
Copy Markdown

Purpose of the PR

NeighborRank can try to expand a vertex after its rank was discarded. Multi-node shortest path reads the entire source before rejecting more than ten resolved vertices.

Main Changes

  • Accumulate each NeighborRank candidate's score and expand only the highest-ranked candidates retained for that layer. Per-step top controls the displayed entries.
  • Accept 2 to 10 resolved vertices for multi-node shortest path. Reading the eleventh vertex triggers rejection and closes the source while preserving the input error.

NeighborRank 容量裁剪和多点最短路输入上限

Verifying these changes

  • Used memory graphs to exercise weighted candidates, ties, layer traversal, resolved and missing vertex IDs, and invalid limits. Tested concurrent read and close errors with controlled iterators.

Does this PR potentially affect the following parts?

  • The public API

Documentation Status

  • Doc - Done

Updated the Server runtime guide and the Chinese and English website REST references.

Confidence Score: 5/5RetriggerView in Greptile

The PR appears safe to merge; the latest test-order change introduces no identified defect.

Summary

The PR fixes bounded traversal behavior:

  • NeighborRank expands only the highest-ranked vertices retained in each layer.
  • Multi-node shortest path stops reading after the eleventh resolved vertex.

Since the previous review, only the position of BoundedTraversalsTest in UnitTestSuite changed. No new actionable issue was found.

Reviews (2) · Last reviewed commit: "fix(server): run traversal tests before ..." · Reviewed by Greptile

- Accumulate candidate ranks before selecting the bounded layer.
- Expand only the vertices retained for the next step.
- Stop and close shortest-path input as soon as its vertex limit is exceeded.
- Document the two API contracts and add memory graph regressions.
@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 498a4040-2d1b-4404-bfa2-15a7d8d6a9cc
Commits

Reviewing files that changed from the base of the PR and between f60b628 and 3956e97.

Files selected for processing: 5

  • docs/server-runtime.md
  • hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/algorithm/MultiNodeShortestPathTraverser.java
  • hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/algorithm/NeighborRankTraverser.java
  • hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/unit/UnitTestSuite.java
  • hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/unit/traversal/BoundedTraversalsTest.java
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-12-03T07:11:44.913788Z
We couldn’t complete this review. Comment @codex review to try again.
f83c08b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@heydeer heydeer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Review completed. No issues found.

🛡️ Security: no issues found.

Walkthrough

Automatic approval is turned off in your settings. Change automatic approval settings

ℹ️ About this review
  • Review summary: The shortest-path input read stops after the eleventh resolved vertex and preserves read or validation errors when closing also fails. NeighborRank's per-step top remains a presentation limit.
  • Risk level: medium. The PR changes the ranking and expansion logic inside two existing graph traversal algorithms (NeighborRank scoring and multi-node shortest path input bounds) and their documentation, but it does not touch stored data, auth, credits, or the core runtime, so a missed mistake would surface as wrong traversal results that a revert or ordinary follow-up fix can contain. The results of capacity-limited NeighborRank queries will differ from before, which is a behavior change for the public API but not a changed API contract.
  • Review depth: Standard
  • Trigger source: Automatic (PR opened)
  • View in HeyDeer · Config

- Register the real Memory graph tests before global teardown.
- Keep the security fixture after graph tests that need the task pool.
- Preserve the bounded traversal regression and close assertions.

@heydeer heydeer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Review completed. No issues found.

🛡️ Security: no issues found.

Walkthrough

Automatic approval is turned off in your settings. Change automatic approval settings

ℹ️ About this review
  • Review summary: No new problems were found.
  • Risk level: medium. The PR changes how NeighborRank scores and trims candidates and caps multi-node shortest path inputs at 10 vertices, so a missed mistake would show up as wrong or changed traversal results that a revert or ordinary follow-up fix can contain, and it does not touch stored data, auth, credits, or the core runtime. The new delta only moves BoundedTraversalsTest between two lists in the test suite, which neither raises nor lowers that risk.
  • Review depth: Standard
  • Trigger source: Automatic (New commits pushed)
  • View in HeyDeer · Config

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Approach: sound — NeighborRank now aggregates each candidate's contributions before applying the per-layer capacity and only expands vertices retained for the layer, while multi-node shortest path reads at most the eleventh resolved vertex, closes the source, and preserves the primary failure when closing also fails.

Reviewed changes

  • NeighborRank bounded expansion — candidate scores are accumulated before the capacity check, the lowest-ranked retained entry is used for deterministic tie-breaking, and sources is pruned to the retained layer vertices before the next step.
  • Multi-node shortest path input cap — the method reads up to MAX_VERTICES + 1 resolved vertices, rejects inputs outside [2, 10], and closes the source iterator in finally without masking the primary exception.
  • Traversal test registration — BoundedTraversalsTest is added to UnitTestSuite before SecurityManagerTest, so the memory-graph traversal tests run before the global shutdown.
  • Runtime documentation — docs/server-runtime.md documents both bounded traversal contracts.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@imbajin

imbajin commented Dec 4, 2026

Copy link
Copy Markdown
Author

/agentic_review

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Qodo Logo

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