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
HugeCountStrategyand related tests so we can port the TINKERPOP-2911 ConnectiveStep fixes. - Assistant
Next I'll read
HugeCountStrategyand the related count-strategy tests to see how connective steps are handled today. - Assistant
Let me read the rest of the file and look at the test file, as well as find what TINKERPOP-2911 changed in upstream.
- Assistant
I'll finish reading
HugeCountStrategyand locate the upstream TINKERPOP-2911 CountStrategy ConnectiveStep logic. - Assistant
I'll extract upstream
CountStrategyfrom the TinkerPop dependency and inspect git history for TINKERPOP-2911-related changes. - Assistant
Let me look at the CountStrategy from the jar and also check git history for the original file introduction. Also let me search for TINKERPOP-2911 online notes - wait, I shouldn't search the internet....
- Assistant
I'll check project docs and try to recover the upstream CountStrategy source for the ConnectiveStep fix.
- Assistant
rg not found oddly. Let me use grep.
- Assistant
I'll fetch the TinkerPop sources and dig into the history around TINKERPOP-2911.
- Assistant
Good, got the sources jar. Let me extract CountStrategy from it.
- Assistant
I've identified the upstream ConnectiveStep change. Next I'll compare it with the older CountStrategy version and review the existing tests.
- Assistant
Checking TinkerPop test cases for expected connective-step results and how leadership tests are structured.
- Assistant
Let me look for CountStrategyTest in tinkerpop source.
- Assistant
Checking how
HugeCountStrategyis registered in the graph: - Assistant
I'm in /tmp. Let me grep from the hugegraph root.
- Assistant
Updating
HugeCountStrategywith the TINKERPOP-2911 ConnectiveStep handling while preserving HugeGraph’s negative-bound guard. - Assistant
I'll replace the useNotStep block and add transformToNotStep method.
- Assistant
The replace tool might need an exact match of the displayed window. I'll jump to line 187 first.
- Assistant
I'll apply the change with an explicit line-range edit.
- Assistant
I'll freshten the class javadoc for TINKERPOP-2911 and add regression coverage next.
- Assistant
Need to navigate to line 54 first.
- Assistant
Let me update the javadoc and then add tests.
- Assistant
Next I'll add regression tests covering connective rewrites and their execution semantics.
- Assistant
I'll insert connective-step regression tests after the negative-bound tests.
- Assistant
Cleaning up the duplicate assert and
@Testannotations introduced by the edit. - Assistant
Need to remove duplicate @Test
- Assistant
I'll check whether HugeGraph rejects unknown property keys in
has(), since the new tests rely on that. - Assistant
Checking how HugeGraph handles missing edge labels and property keys in traversals:
- Assistant
Checking recursive strategy application APIs available in TinkerPop 3.5.1:
- Assistant
Rewriting the connective tests to assert strategy rewrite structure so we avoid schema issues with undefined labels.
- Assistant
I need to add a blank line between the import block and the class declaration, and fix theconnective tests.
- Assistant
Now replace the connective tests with structure checks + graph execution for and/or without "none".
- Assistant
I'll replace tests from line 203-273 with better versions including helper method.
- Assistant
I'll compile the module and run the CountStrategyCoreTest suite next.
- Assistant
I'll try a quick isolated rewrite check first, then run the full Maven core tests if the project builds.
- Assistant
Compiling the core module and running CountStrategyCoreTest.
- Assistant
All 23 tests passed. I'll review the full diff and check line-length/style before submitting.
- Assistant
There's an unexpected
pom.xmlchange — I'll inspect and revert it if it isn't ours. - Assistant
I'll revert the unrelated
pom.xmlchanges so only the intended fix is submitted.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.