ISSUE DESCRIPTION [Improve] Align HugeCountStrategy with upstream TINKERPOP-2911…
- User
ISSUE DESCRIPTION
[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.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call ) using or commands. However you don't need to use or before submitting your changes. In fact, only submits currently unstaged changes because it uses to get the changes that need to be submitted. - Assistant
I'll start by exploring the repository structure and locating
HugeCountStrategyplus any related tests so we can port the TINKERPOP-2911 ConnectiveStep fixes. - Assistant
Next I’ll inspect
HugeCountStrategyand the related tests, and search for any notes or remaining ConnectiveStep handling gaps. - Assistant
Let me open the HugeCountStrategy file and also search for TINKERPOP related comments. Also I should look at the upstream CountStrategy if available in dependencies.
- Assistant
Let me read the rest of the file.
- Assistant
I can see there's already some ConnectiveStep handling. Let me continue reading.
- Assistant
I'll look up the tinkerpop dependency and the current upstream CountStrategy so we can compare ConnectiveStep handling.
- Assistant
They're on TinkerPop 3.5.1. TINKERPOP-2911 is a later fix. Let me try to find CountStrategy in the jar files or see if there's any documentation about what changed.
- Assistant
I'll extract CountStrategy from the jar and check git history or comments about TINKERPOP-2911.
- Assistant
Let me check git history for HugeCountStrategy and look at serena memories. Also, I should get a newer CountStrategy from tinkerpop.
- Assistant
I'll inspect the #2993 commit and pull upstream CountStrategy history for the TINKERPOP-2911 ConnectiveStep change.
- Assistant
Network might work; I'll try fetching CountStrategy from multiple TinkerPop versions around TINKERPOP-2911.
- Assistant
I have 3.7.3; next I’ll grab the TINKERPOP-2911 change and compare it with the 3.5.1 CountStrategy.
- Assistant
The ConnectiveStep gap is clear; next I’ll pull the full upstream CountStrategy and its tests to port the remaining changes.
- Assistant
Let me also get the rest of the and/or test cases from CountStrategyTest and look at the current CountStrategyCoreTest.
- Assistant
CountStrategyCoreTest looks broader than just count; I'll check how it evolved after #2993 and whether unit-style strategy tests already exist.
- Assistant
I'll prototype how the current strategy rewrites connective patterns versus upstream expectations, then apply the ConnectiveStep port.
- Assistant
I'll check the unit-test layout and recreate the current ConnectiveStep misbehavior so we know what to fix.
- Assistant
Pulling the TINKERPOP-2911 PR diff next so we can mirror the exact ConnectiveStep changes.
- Assistant
I'll port the TINKERPOP-2911 ConnectiveStep handling into
HugeCountStrategy, including thetransformToNotStephelper. - Assistant
I'll replace the ConnectiveStep handling block and add the helper method.
- Assistant
I'll verify the rest of the file and update the class-level comment to mention TINKERPOP-2911.
- Assistant
Updating the class javadoc next, then I'll compile and run a temporary verification script.
- Assistant
Need to go to line 54 first or use open.
- Assistant
I'll compile hugegraph-core and run a temporary verification script against the ConnectiveStep cases.
- Assistant
Compile succeeded. Next I'll write a temporary unit test to verify the ConnectiveStep rewrites.
- Assistant
dependency:build-classpath failed. I'll use the jars from m2 and gremlin-core directly.
- Assistant
Classpath is ready — compiling and running the verification again.
- Assistant
All connective cases passed. I'll run a few more edge cases, then clean up the temp files.
- Assistant
I'll clean up temp files, check style (line length ≤ 100), and review the final diff.
- Assistant
There's an unexpected pom.xml change — I'll inspect it and revert if it's unrelated.
- Assistant
That pom.xml change is accidental — reverting it now.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.