Skip to content

Fix entry-port fork fanout legs collapsing onto one opening vertex - #1965

Closed
pinin4fjords with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-issue-1831
Closed

Fix entry-port fork fanout legs collapsing onto one opening vertex#1965
pinin4fjords with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-issue-1831

Conversation

Copilot AI commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Entry-port-originated same-line fanouts in LR/RL sections could open from a shared source-side turn, producing a starburst instead of a depth-ordered staircase. The affected path was split across plain intra-section diagonals and entry-runway-owned branches, so only some siblings peeled correctly.

  • Routing

    • Broaden the fused-opening-leg seating predicate to include flow-side LR/RL entry ports when the router, not a separate seating mechanism, owns the opening geometry.
    • Apply the same peel-delay budget in _route_entry_runway() that _route_diagonal() already uses, so deeper runway-owned siblings peel earlier instead of reusing the same lead X.
  • Regression lock

    • Add a focused regression test covering:
      • the reported riboseq_inter_row_corridor repro
      • a minimal synthetic same-line entry-port fan
    • The assertion is mechanical: for same-direction siblings, deeper targets must start their opening earlier than shallower ones.
  • Shape of the fix

    • Reuse the existing fused-opening mechanism rather than introducing a second port-only seating path.
    • Keep the change scoped to flow-side LR/RL entry-port forks; other port cases remain on their existing routing paths.
def _source_needs_fused_opening_seat(edge, src, ctx) -> bool:
    if not src.is_port:
        return _fan_plan_seats_the_fork(ctx, edge.source)

    port = ctx.graph.ports.get(edge.source)
    section = ctx.graph.sections.get(port.section_id) if port is not None else None
    return (
        port is not None
        and port.is_entry
        and section is not None
        and (
            (section.direction == "LR" and port.side is PortSide.LEFT)
            or (section.direction == "RL" and port.side is PortSide.RIGHT)
        )
    )

Co-authored-by: pinin4fjords <5775915+pinin4fjords@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix entry-port fork legs sharing turn vertex in starburst rendering Fix entry-port fork fanout legs collapsing onto one opening vertex Sep 8, 2026
Copilot AI requested a review from pinin4fjords September 8, 2026 13:32
Add two curve-invariant repro fixtures that exercise the previously
un-taken arms of the entry-port fused-opening peel-delay seat in
_route_entry_runway: the target-row-clear branch widens the source-side
seat only when the nearest bypassed station leaves room, and the
target-row-blocked branch does likewise against the port-to-target span.
Triage the two defensive guards in _source_needs_fused_opening_seat
(a forking port source is always a registered entry port; its section
always resolves) and regenerate the coverage matrix and baseline.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Render preview is ready for review:
🖼️ https://seqeralabs.github.io/nf-metro/_pr/1965/

This preview shows only the renders that changed compared to main.

github-actions Bot added a commit that referenced this pull request Sep 8, 2026
@pinin4fjords

Copy link
Copy Markdown
Member

Closing — the underlying issue (#1831) has been closed as won't-do. On review, the pre-fix starburst rendering doesn't read as a problem on the real map it was reported from; the staggered version isn't a visible improvement for single-line forks. This change also introduced a genuine new line crossing in examples/topologies/funcprofiler_upstream.mmd (failing test_no_bridges_without_crossings in CI), unrelated to entry ports, so it isn't mergeable as-is regardless.

github-actions Bot added a commit that referenced this pull request Sep 8, 2026
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.

Entry-port fork legs share one turn vertex, producing a starburst instead of a staggered staircase

2 participants