Repository navigation
interop/tinkerpop: A2 lowering strategy (Gremlin → mask hop chain) - #90
Merged
Merged
Conversation
LanceHopStrategy is a TinkerPop ProviderOptimizationStrategy. It rewrites V(ids).out(label)^k.dedup().count() into one LanceHopCountStep answered by the lance-graph-java mask hop chain; repeat(out()).times(k) reaches the same shape. Every other root traversal is left to Gremlin, counted in fellBack() with the reason in lastFallbackReason(). LoweringStrategyTest (55 checks): parity with plain Gremlin for k = 1..3; provenance (an empty TinkerGraph still yields the row store's count when lowered, 0 when not); seven fallback shapes counted and answering exactly as Gremlin. Disable runs: removing the dedup() guard turns 6 checks red, a lowered step answering 0 turns 7 red. run.sh now runs both mains. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AhMhXd2gDhYzTgwKeHaWHB
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (8)
✨ Finishing Touches📝 Generate docstrings
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Comment |
AdaWorldAPI
marked this pull request as ready for review
October 9, 2026 14:40
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Quick win A2, built on the A1 harness (#89).
LanceHopStrategyis a TinkerPopProviderOptimizationStrategy:It lowers exactly one shape,
V(ids).out(label)^k.dedup().count()with k ≥ 1. The whole traversal becomes oneLanceHopCountStep, which answers from the lance-graph-java mask hop chain when iterated.repeat(out(label)).times(k)reaches the same shape, because TinkerPop unrolls it before provider strategies run.Any other root traversal is left to Gremlin, counted in
fellBack(), with the reason inlastFallbackReason(). That covers:dedup();has(),in(), unmapped labels, more than one label per hop;V()without ids, or an id outside the row store;as()labels.Everything lives in
interop/tinkerpop/.src/mainis unchanged.Measured
LoweringStrategyTest: 55 checks green. A1'sTinkerParityTeststays at 25 green.out()^kandrepeat(). Each traversal ran as oneLanceHopCountStep.Disable runs (each red, then green after restore)
dedup()guard removed: 6 checks go red. A walk count throughbarrier()gets lowered and returns the distinct count instead of the walk count.A finding from the first disable run: Gremlin rewrites
out().count()intooutE().count()before provider strategies run, so a plain walk count never reaches thededup()guard. Thebarrier()case was added because it does reach the guard.Not in this PR
🤖 Generated with Claude Code
https://claude.ai/code/session_01AhMhXd2gDhYzTgwKeHaWHB
Generated by Claude Code