Skip to content

Add deterministic edge routing - #6

Merged
konojunya merged 1 commit into
mainfrom
jj/add-edge-routing
Sep 3, 2026
Merged

Add deterministic edge routing#6
konojunya merged 1 commit into
mainfrom
jj/add-edge-routing

Conversation

@konojunya

Copy link
Copy Markdown
Member

背景

Task 13 requires the internal scene to preserve edge semantics, route connectors outside node interiors, place labels deterministically, and report unsatisfied order hints at their authored source ranges.

実装方法

  • Add ordered scene edges with normalized kind, direction, label, orthogonal path, endpoint markers, and integer half-path label anchors.
  • Build one deterministic rectilinear visibility grid from canvas margins and node geometry, then route each edge with Manhattan distance, a fixed bend penalty, and stable tie ordering.
  • Validate boundary endpoints, axis-aligned nonzero segments, canvas containment, marker semantics, label anchors, and absence of node-interior intersections.
  • Evaluate each order hint on the resolved cross-axis and append STK4001 only when the placed centers do not satisfy it, using the compiler source-map statement span.
  • Expand the canonical scene snapshot with all eight complete-semantics routes and run every public specification example through routed-scene validation.

テスト方法

  • cargo +stable test --workspace --locked
  • canonical formatter suite and full scene conformance suite against the pinned specification revision
  • native and wasm32-wasip1 geometry plus routing numeric fixtures with Wasmtime 48.0.1
  • wasm32-unknown-unknown engine build
  • stable and Rust 1.85 Clippy with warnings denied
  • rustdoc with warnings denied
  • llvm-cov: 96.97% lines, 97.94% functions, 95.69% regions

Review 視点 / 懸念点

  • Forward edges use a target arrow, bidirectional edges use both endpoint arrows, and associations use no arrow.
  • Paths may touch or follow node boundaries but cannot enter a node interior.
  • The bend penalty improves readability but does not promise globally minimal crossings; that remains a renderer quality goal rather than source semantics.
  • Compiler diagnostics remain first, followed by layout warnings in diagram then depth-first group order.

@konojunya
konojunya merged commit 664c25a into main Sep 3, 2026
2 checks passed
@konojunya
konojunya deleted the jj/add-edge-routing branch September 3, 2026 06:45
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