Skip to content

Prevent inconsistent indicators when growing batched graphs - #737

Merged
CarloLucibello merged 2 commits into
JuliaGraphs:masterfrom
DHAKED440:reproduce/issue-733-graph-indicator
Nov 29, 2026
Merged

CarloLucibello merged 2 commits into
JuliaGraphs:masterfrom
DHAKED440:reproduce/issue-733-graph-indicator

Conversation

@DHAKED440

Copy link
Copy Markdown
Contributor

Fixes #733

Problem

add_nodes and add_edges could increase num_nodes without extending graph_indicator, leaving batched graphs inconsistent and causing downstream operations to misbehave or fail.

Solution

Reject node growth on batched graphs until the API defines which component graph should own new nodes. Preserve unbatched behavior and extend an explicit indicator for single-graph inputs.

Changes

  • Guard ambiguous node growth in add_nodes and add_edges.
  • Update the function documentation and GNNGraphs development version.
  • Add regression coverage for batched growth, valid existing-node edge additions, single-graph indicators, unbatched graphs, and no-op cases.

Testing

  • Reproduced the original inconsistency before the fix.
  • Pkg.test("GNNGraphs"; coverage=false): 1,391 passed, 8 broken, 1,399 total; the test runner reported success.
  • git diff --check: passed.

DHAKED440 and others added 2 commits November 29, 2026 09:05
@CarloLucibello
CarloLucibello force-pushed the reproduce/issue-733-graph-indicator branch from 2244bdc to ec10d7a Compare November 29, 2026 08:06
@CarloLucibello
CarloLucibello merged commit aeeb7a6 into JuliaGraphs:master Nov 29, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add_nodes and add_edges leave graph_indicator inconsistent on batched graphs

2 participants