Skip to content

compiler: index reversed equivalent edges - #2839

Merged
alixander merged 1 commit into
masterfrom
agent/fix-reversed-edge-index
Aug 10, 2026
Merged

compiler: index reversed equivalent edges#2839
alixander merged 1 commit into
masterfrom
agent/fix-reversed-edge-index

Conversation

@alixander

Copy link
Copy Markdown
Collaborator

Treats a connection and its reversed notation as one index sequence when endpoint arrowheads describe the same semantics. For example, a -- b / b -- a, a <-> b / b <-> a, and a -> b / b <- a now receive indexes 0 and 1; the genuinely opposite b -> a remains a separate sequence.

The change applies consistently across IR lookup/indexing, compiled graph lookup, and oracle reconnect ID deltas. It also replaces the original TODO in d2graph.Edge.initIndex.

Validation:

  • focused d2ir/d2graph/d2compiler/d2oracle tests
  • focused race and vet for all four packages
  • exact E2E suite
  • direct positive and negative arrow-direction tables
  • reconnect increment/decrement regressions for reversed notation

@alixander
alixander force-pushed the agent/fix-reversed-edge-index branch 2 times, most recently from 695cc2e to ca8e683 Compare August 10, 2026 01:38
Signed-off-by: Alexander Wang <alex@terrastruct.com>
@alixander
alixander force-pushed the agent/fix-reversed-edge-index branch from ca8e683 to 24a58dc Compare August 10, 2026 01:41
@alixander
alixander marked this pull request as ready for review August 10, 2026 01:46
@alixander
alixander merged commit 5ef950e into master Aug 10, 2026
6 checks passed
@alixander
alixander deleted the agent/fix-reversed-edge-index branch August 10, 2026 01:46
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.

1 participant