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
I’ll inspect the local strategy and existing CountStrategy tests, then port the connective handling and run the narrowest relevant test suite.
- Assistant
rgisn’t installed here, so I’m switching to targetedfind/grep. The worktree already has an unrelatedpom.xmlmodification; I’ll leave it untouched. - Assistant
The bug is in the zero-count rewrite for connective children: it negates only the last traversal segment, so
out("none").out().count().is(0)becomesout("none").not(out())instead ofnot(out("none").out()). I’m adding a connective-specific rewrite that wraps the whole child traversal, plus all four requested regression shapes. - Assistant
The focused Maven test is running now. I’ll also inspect the resulting traversal behavior if it exposes any parent/step ownership issue in the rewrite.
- Assistant
The first test command stopped in an unrelated upstream reactor module because its Surefire configuration treats “no tests” as a failure. I’m rerunning with that reactor-only condition disabled; no product test has failed.
- Assistant
The reactor then attempted to resolve a missing artifact remotely, so I stopped it immediately and will keep all remaining Maven runs explicitly offline. I’m narrowing the reactor to the three server modules needed for this test.
- Assistant
Compilation and style checks passed for the changed modules. The offline test launch is blocked only because the configured Surefire 2.20 JUnit provider is absent from the local Maven cache; I’m checking whether a cached provider version can be selected without downloads.
- Assistant
The strategy tests now execute: 21 passed, while the two exact
"none"cases failed because HugeGraph rejects undeclared edge labels (unlike TinkerGraph), before predicate semantics are evaluated. I’m declaring an emptynoneedge label/property in the fixture so the requested traversal forms remain exact and test the strategy itself. - Assistant
All 23 focused tests now pass. I’ve added one defensive case for a connective child containing only
count().is(0)(it must negateidentity()), then I’ll rerun compilation and the same regression class.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.