Skip to content

Conversation

@markuspf
Copy link
Contributor

@markuspf markuspf commented Dec 5, 2025

Scope & Purpose

Use the same definition of VertexRef throughout;

Before this patch, there were various places in the codebase which used using VertexRef = HashedStringRef, as well as Steps in the traverser code wrapping this HashedStringRef into a helper class, which is identical for every Step type.

This PR introduces a class VertexRef which replaces all these uses consistently (and is currently only a wrapper around HashedStringRef

Requires Enterprise PR: https://github.com/arangodb/enterprise/pull/1563


Note

Introduces a unified VertexRef wrapper (over HashedStringRef) and replaces ad-hoc vertex ID types/usages across graph components, updating APIs, data structures, and tests.

  • Types:
    • Add graph::VertexRef (Graph/Types/VertexRef.{h,cpp}) and VertexSet (Graph/Types/VertexSet.h); migrate ForbiddenVertices.h to use them.
  • APIs and Call Sites:
    • Replace HashedStringRef vertex IDs with VertexRef in public methods (e.g., reset, startVertex, addVertexToBuilder) across executors (TraversalExecutor, ShortestPathExecutor, EnumeratePathsExecutor).
  • Enumerators:
    • Update One-/Two-Sided, Weighted (Shortest/KShortest), and Yen enumerators to consume/produce VertexRef; switch internal maps/sets to key by VertexRef.
  • Providers/Steps:
    • Adjust SingleServerProvider, ClusterProvider, ProviderTracer, and step types to store/return VertexRef and propagate through expansion/builders.
  • Path Management:
    • Modify PathResult and SingleProviderPathResult to store vertices as VertexRef; update memory accounting and VPack emission; PathValidator* now uses VertexRef for uniqueness/forbidden checks.
  • Tests:
    • Update all graph tests and mock provider to construct and compare vertices via VertexRef.

Written by Cursor Bugbot for commit 2cdb2fe. This will update automatically on new commits. Configure here.

@cla-bot cla-bot bot added the cla-signed label Dec 5, 2025
@markuspf markuspf requested review from jvolmer and mpoeter December 5, 2025 17:21
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

// need a mechanism here as well to distinguish between (non)required
// parameters.
callback(Step{to, edge, previous, fetchedType, step.getDepth() + 1,
callback(Step{VertexRef{to}, VertexRef{edge}, previous, fetchedType,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Edge ID incorrectly wrapped in VertexRef type

The edge variable (an edge ID of type EdgeType/HashedStringRef) is incorrectly wrapped in VertexRef{edge}. The ClusterProviderStep constructor expects EdgeType for the second parameter, not VertexRef. While this currently works due to the implicit conversion operator in VertexRef, it semantically treats an edge ID as a vertex reference. Only to (the vertex ID) should be wrapped in VertexRef; edge should be passed directly.

Fix in Cursor Fix in Web

Copy link
Contributor

@jvolmer jvolmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small include improvements and the cursor-comment above looks legitimate. Otherwise, LGTM

Comment on lines 52 to 54
using VertexSet = arangodb::containers::HashSet<VertexRef, std::hash<VertexRef>,
std::equal_to<VertexRef>>;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably be exchanged with #include "Graph/Types/VertexSet.h"

Comment on lines 53 to 55
using VertexSet = arangodb::containers::HashSet<VertexRef, std::hash<VertexRef>,
std::equal_to<VertexRef>>;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@markuspf markuspf force-pushed the chore/unify-vertex-ref branch from 94c2ae2 to 4e40c07 Compare December 9, 2025 19:32
@markuspf markuspf changed the title [COR] Unify VertexRef [COR-56] Unify VertexRef Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants