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 suite.
- Assistant
rgisn’t installed in this checkout, so I’m switching to targetedfind/grepsearches. - Assistant
The risky branch is exactly the local special-case for
ConnectiveStep: it rewrites connective children differently from other filter parents. I’m adding the four semantic regressions first so the current failure mode is concrete before changing that rewrite. - Assistant
The reactor unexpectedly reached a Maven resolution path that attempts Central. I’m stopping that run and will use the already-built/local module path so validation stays offline.
- Assistant
The regression confirms the semantic bug:
out("none").out().count().is(0)was rewritten asout("none").not(out()). Becausecount()is a productive barrier, that rewrite incorrectly drops the traverser when the prefix is empty. The connective child must instead becomenot(out("none").out()), wrapping the entire prefix. - Assistant
The corrected strategy now returns
0, 3, 3, 3for the four requested shapes in an isolated TinkerGraph check. I’m moving on to the repository’s core test suite and style checks, using Maven offline. - Assistant
The full Maven run is blocked before compilation by a pre-existing malformed local
hugegraph-structartifact descriptor (${revision}is unresolved in its installed parent). I’m still validating both changed Java files directly against the repository’s packaged dependency set, and I’ll report that Maven limitation explicitly. - Assistant
The real HugeGraph run exposed a test-fixture detail: unlike TinkerGraph, HugeGraph rejects an undefined edge label before evaluating the connective. I’m defining the intentionally empty
"none"edge label in the fixture so the requested traversal shapes test CountStrategy semantics rather than schema validation. - Assistant
All 23
CountStrategyCoreTesttests now pass against HugeGraph’s memory backend, including the four new connective regressions. I’m doing the final diff and whitespace review now.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.