Untitled conversation
- User
[Improve] Align HugeCountStrategy with upstream TINKERPOP-2911 ConnectiveStep fixes
Feature Description (功能描述)
Background
PR #2993 introduced
HugeCountStrategyto fix the negative-bound optimization issues behind #2930, #2931, and #2932.That fix was implemented by forking an older version of TinkerPop's
CountStrategyand adding HugeGraph-specific guards for negative bounds.However, the current local fork does not yet include the upstream follow-up fix for
ConnectiveStep/and()/or()handling fromTINKERPOP-2911.As a result, HugeGraph is now aligned for the negative-bound cases fixed in #2993, but it may still inherit older
CountStrategybehavior for some connective-filter patterns.Follow-up Scope
Port the upstream
TINKERPOP-2911changes forConnectiveStepintoHugeCountStrategy, and add regression coverage for connective traversal shapes.Suggested regression cases include:
__.and(__.out().count().is(0), __.in().count().is(0))__.or(__.out().count().is(0), __.in().count().is(0))__.where(__.or(__.out("none").out().count().is(0), __.has("none")))__.where(__.or(__.out("none").out().count().is(0), __.has("none").count().is(0)))
Expected Result
HugeCountStrategyshould behave consistently with the upstreamCountStrategyfixes aroundConnectiveStep- connective
and()/or()traversal shapes should no longer rely on older inherited behavior from the forked strategy - regression tests should cover the above traversal forms and protect against future drift
I’d be happy to follow up on this as a separate improvement issue and work on a later refinement PR.
Interface
No new interfaces are introduced.
- Assistant
Let me look at the issue context: which TinkerPop version is in use, and what the upstream
CountStrategylooks like after TINKERPOP-2911. - Assistant
TinkerPop 3.5.1. Let me fetch the upstream TINKERPOP-2911 changes to
CountStrategyfrom the TinkerPop repo. - Assistant
I have the exact upstream diff. Now let me find the existing tests from PR #2993 so I can add regression coverage in the same place.
- Assistant
Now add the
transformToNotStephelper beforedoStrategy: - Assistant
The port matches upstream. Now compile the core module:
- Assistant
Now append the regression tests at the end of the class:
- Assistant
Now compile the test module and figure out how to run the core tests (they need a backend — likely memory):
- Assistant
Needs
-amso the reactor resolves the${revision}parent: - Assistant
The test run is in progress in the background; I'll wait for its completion notification.
- Assistant
The diff faithfully mirrors upstream commit
39e3a74(TINKERPOP-2911), including thetraversal.clone()change. Waiting for the test run to complete. - Assistant
Still building (the
-amreactor builds all upstream modules first). I'll pick this up when the background run notifies. - Assistant
Both monitors are armed (one on the maven output, one on the surefire report). I'll report the results as soon as the run finishes.
- Assistant
I'll report back once the re-run finishes.
- Assistant
Waiting for the reverted-code run to confirm the new tests catch the old behavior.
- Assistant
Final verification run in progress — I'll summarize once it reports.
- Assistant
Done. All 23 tests pass with the fix in place.
Summary
Ported TINKERPOP-2911 into
HugeCountStrategy(hugegraph-server/hugegraph-core/.../traversal/optimize/HugeCountStrategy.java), faithfully mirroring upstream commit39e3a74("Fixed bug in CountStrategy around ConnectiveStep", TinkerPop 3.5.6):- Replaced the old branch — which routed / children through the generic else-branch and mangled multi-step children (e.g. was rewritten to instead of ) — with explicit handling:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.