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 CountStrategy / ConnectiveStep code. - Assistant
Next I'll read
HugeCountStrategyand the existing count-strategy tests to see how connective steps are handled today. - Assistant
I'll read the full strategy implementation and compare it with the upstream TinkerPop CountStrategy if present in the tree.
- Assistant
Continuing through the rest of
HugeCountStrategyand searching the local jars for the upstream CountStrategy implementation. - Assistant
I'll extract upstream
CountStrategyfrom the gremlin jar and inspect the existing regression tests. - Assistant
I'll dig into git history and any notes about TINKERPOP-2911, and try to recover sources for the upstream CountStrategy change.
- Assistant
I'll grab the TinkerPop sources and decompile CountStrategy so we can compare the ConnectiveStep handling.
- Assistant
I'll pull newer upstream CountStrategy sources and check the TinkerPop commit for TINKERPOP-2911.
- Assistant
Let me extract CountStrategy from different versions and diff them.
- Assistant
I'll review the full upstream CountStrategy and existing tests so we can port the ConnectiveStep change carefully.
- Assistant
I'll inspect negative-bound coverage in the existing tests and how HugeCountStrategy is wired in.
- Assistant
I'll look at upstream regression tests for the connective CountStrategy cases next.
- Assistant
The maven get might have failed. Let me try again for gremlin-test.
- Assistant
Fetching the full upstream CountStrategyTest for the connective cases.
- Assistant
Let me get more of the test file focusing on and/or cases.
- Assistant
Checking how traversals are asserted and whether unit-style structure tests already exist.
- Assistant
I'm in /tmp now. Let me go back.
- Assistant
I'll update
HugeCountStrategywith the ConnectiveStep handling from TINKERPOP-2911. - Assistant
I'll replace the ConnectiveStep handling section and add transformToNotStep. I'll update the class javadoc to mention TINKERPOP-2911 too.
- Assistant
Next I'll swap in the ConnectiveStep branch and the
transformToNotStephelper. - Assistant
I need to jump to the right line first so the edit can apply.
- Assistant
Applying the ConnectiveStep handling change now.
- Assistant
Next I'll add the connective regression cases to
CountStrategyCoreTestand check how the core test harness is set up. - Assistant
I'll insert connective regression tests into
CountStrategyCoreTestafter the existing negative-bound cases. - Assistant
Updating imports and adding the connective regression tests.
- Assistant
Now add helper and tests after testWhereCountGteNegativeDoesNotBuildInvalidRange
- Assistant
I'll insert tests after line 202
- Assistant
Fixing a bad comment, then verifying the strategy with a small standalone script.
- Assistant
Need to goto line 301
- Assistant
Fix the comment
- Assistant
I'll check how HugeGraph handles unknown edge labels and missing properties so the semantic tests stay valid.
- Assistant
Checking label validation and compiling a quick standalone verification program.
- Assistant
I'll verify whether unknown edge-label lookups fail at runtime.
- Assistant
I'll update the semantic where-test to use only existing schema labels so it won't fail on unknown edge names.
- Assistant
Making the semantic where-test use defined labels only.
- Assistant
Compiling the strategy and running a standalone verification of the connective rewrites.
- Assistant
Fixing the generics issue by matching upstream's raw
Stepusage. - Assistant
Change filterStep to raw Step type like upstream.
- Assistant
Recompiling after the generics fix.
- Assistant
Compile succeeded. Writing a quick temp script to verify the rewrites.
- Assistant
I'll build the classpath from the local m2 jars and rerun the check.
- Assistant
There's some annotation processor issue. Let me try -proc:none
- Assistant
Strategy rewrites look good. Checking whether we can run the CountStrategy core tests next.
- Assistant
I'll try compiling the test module and running CountStrategyCoreTest if the environment can support it.
- Assistant
I'll check the Surefire report for the actual test results.
- Assistant
All 26 tests passed. Cleaning temp files and reviewing the final diff before submit.
- Assistant
There's an unexpected
pom.xmlchange — I'll inspect it and revert if it isn't part of the fix. - Assistant
Reverting the unrelated
pom.xmlchange.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.