Skip to content

fix(layout): gate off-track bump on the feeding run's actual flow span - #1581

Merged
pinin4fjords merged 1 commit into
mainfrom
fix/1566-off-track-flow-span-gate
Jul 28, 2026
Merged

fix(layout): gate off-track bump on the feeding run's actual flow span#1581
pinin4fjords merged 1 commit into
mainfrom
fix/1566-off-track-flow-span-gate

Conversation

@pinin4fjords

@pinin4fjords pinin4fjords commented Jul 27, 2026

Copy link
Copy Markdown
Member

Summary

  • _bump_off_track_clear_of_trunks (off-track slot allocation) treated any non-terminus trunk station downstream of an off-track icon in flow as contesting its row, without checking whether the run feeding that station actually reaches back across the icon's column.
  • A trunk station's own in-section predecessor can itself sit downstream of the icon, in which case the feeding run never spans the icon's column and cannot cross it — the icon was bumped an extra row for a run that never gets near it.
  • Adds _feeding_run_spans_flow_coord, which checks each candidate trunk station's actual feeding predecessor(s) before counting its line band as contesting.
  • Removes the now-resolved topologies/paired_input_fan_branch_tree entry from _KNOWN_END_OF_LAYOUT_GAPS (the compensation-pass replay test now stays a clean no-op for this fixture).
  • Adds two direct unit tests on a minimal synthetic graph pinning the gate's behaviour: a downstream-but-non-spanning predecessor must not contest, a genuinely spanning predecessor must still contest.

Visual effect

Across the full render corpus (313 fixtures, byte-for-byte MD5 comparison against main), only paired_input_fan_branch_tree changes. The false-positive contest had been pushing an off-track icon and its downstream fork sibling out an extra row early in layout; although a later reanchor stage corrected their final relative position, the earlier over-bump had already forced a whole-graph title-band clearance shift that stuck. With the fix, that unnecessary shift is gone and the canvas is ~40px shorter (structure and relative placement are unchanged — verified by rendering both versions).

Fixes #1566

Test plan

  • pytest tests/test_layout_invariants.py tests/test_compensation_passes_idempotent.py tests/test_routing_gate_coverage.py tests/test_guard_registry_golden.py passes (20943 passed, only pre-existing xfails)
  • New invariant test fails on pre-fix code, passes post-fix (verified directly)
  • ruff check / ruff format --check clean; mypy clean
  • Full-corpus MD5 render diff against main: only the named fixture changes
  • Visual review of render preview once CI posts it
  • Render-preview verdict: pending

Generated with Claude Code

_bump_off_track_clear_of_trunks treated any trunk station downstream of
an off-track icon in flow as contesting its row, without checking
whether the run feeding that station actually reaches back across the
icon's column. A trunk station's own in-section predecessor can itself
sit downstream of the icon, in which case the run never spans the
icon's column and cannot cross it.

Add _feeding_run_spans_flow_coord to check the feeding run's flow span
before counting a trunk station's line band as contesting, and remove
the now-resolved paired_input_fan_branch_tree entry from
_KNOWN_END_OF_LAYOUT_GAPS.

Fixes #1566
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

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

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

@pinin4fjords
pinin4fjords merged commit a9c8cfb into main Jul 28, 2026
13 checks passed
@pinin4fjords
pinin4fjords deleted the fix/1566-off-track-flow-span-gate branch July 28, 2026 07:33
github-actions Bot added a commit that referenced this pull request Jul 28, 2026
pinin4fjords added a commit that referenced this pull request Jul 28, 2026
…-gate

fix(layout): gate off-track bump on the feeding run's actual flow span
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.

Off-track slot allocator bumps an icon for a run that never reaches its column

1 participant