Skip to content
TheChatArchiveThe Chat Archive
composer-2.5· unknownHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

Untitled conversation

  1. User

    [Improve] Align HugeCountStrategy with upstream TINKERPOP-2911 ConnectiveStep fixes

    Feature Description (功能描述)

    Background

    PR #2993 introduced HugeCountStrategy to fix the negative-bound optimization issues behind #2930, #2931, and #2932.

    That fix was implemented by forking an older version of TinkerPop's CountStrategy and 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 from TINKERPOP-2911.

    As a result, HugeGraph is now aligned for the negative-bound cases fixed in #2993, but it may still inherit older CountStrategy behavior for some connective-filter patterns.

    Follow-up Scope

    Port the upstream TINKERPOP-2911 changes for ConnectiveStep into HugeCountStrategy, 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

    • HugeCountStrategy should behave consistently with the upstream CountStrategy fixes around ConnectiveStep
    • 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.

  2. Assistant

    I'll align HugeCountStrategy with upstream TINKERPOP-2911 ConnectiveStep fixes. First I'm locating the current strategy implementation and any existing tests.

  3. Assistant

    Searching for upstream TinkerPop CountStrategy and the TINKERPOP-2911 fix.

  4. Assistant

    Porting the TINKERPOP-2911 ConnectiveStep handling from upstream and adding regression tests.

  5. Assistant

    HugeGraph requires schema-defined labels, so I'm updating the tests to define the none edge label and property without creating any data.

  6. Assistant

    Aligned HugeCountStrategy with upstream TinkerPop 3.5.6 CountStrategy fixes from TINKERPOP-2911.

    HugeCountStrategy changes

    The old fork excluded ConnectiveStep from the not() rewrite path and fell back to pulling preceding filter steps backward. That broke and() / or() branches — e.g. out("none").out().count().is(0) could become out("none"), not(out()) instead of not(out("none").out()).

    The fix mirrors upstream:

    1. ConnectiveStep handling — When the parent is and() / or(), wrap the entire branch in not() via TraversalHelper.removeAllSteps() + addStep(notStep).
    2. FilterStep handling — where(...) branches use a dedicated path that replaces the filter step with not(...).
    3. transformToNotStep() helper — Clones the inner traversal (traversal.clone()) before wrapping, matching upstream semantics.

    HugeGraph-specific negative-bound guards from #2993 are unchanged (hasNegativeCompareBound and highRange < 0 dismissal).

    Regression tests

    Added four cases to CountStrategyCoreTest:

    • 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)))

    The where/or tests define schema for the none edge label and property (no data) because HugeGraph requires labels to exist at query time, unlike TinkerGraph.

    All 23 tests in CountStrategyCoreTest pass.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.