14 KiB
Connection corridors: next bounded #32 experiment
Decision after ae9dad54: test jointly assigned derived separation of existing orthogonal routes on a fixed placement, before another placement-only spacing algorithm. Keep it an isolated geometry experiment. Do not integrate it into Arrange or change the released router until the named tracing witnesses and preservation checks pass. A small shared-run separator can test an actual missing mechanism; a new set of node gaps cannot ensure that the existing router consumes those gaps.
No external claims, source changes, builds, routing runs or GUI work underpin this note. Sources are the current research routing/projection code, auto_layout_probe/layered.rs, and the frozen connection-layout / placement-clearance experiments.
The decisive limitation
There is no proof that no placement-only method can improve shared routing: the mixed ELK placement did improve it through the released router. The stronger assumption that reserving distinct empty corridors in node placement enforces distinct routed lanes is false under the present interface. RoutingSpace::new uses obstacle boundaries; fast_path builds direct/one-axis alternatives; crossing_cost only gives coincident spans a soft cost. No placement result carries edge-to-corridor membership into routing. Two connections may still choose the same shorter trunk regardless of how much unused space was reserved elsewhere. The old layered prototype illustrates the practical risk: huge sparse/mixed shared runs despite larger gaps. The clearance repair proves terminal compatibility but sparse sharing666→761 and crossings20→22 prove that compatibility is not lane allocation.
This is not a reason to adopt an entire new engine. It is a reason to test a route-space operation whose output is actually used, rather than interpreting free space as an edge reservation.
Material options
| Approach | What it can directly control | Unresolved failure / cost | Choice |
|---|---|---|---|
| Initial coordinate assignment with distinct connection corridors | Node order, available width/height and containment; avoids known stub incompatibility. | Without route-to-corridor constraints, released routing may ignore all lane distinctions. Adding such constraints is already a joint placement/routing interface. Global per-edge spacing can explode area. | Necessary later for insufficient corridors; not the next isolated experiment. |
| Joint derived route separation after an initial route | Actual connection strokes, with fixed tips/stubs and obstacles. Can distinguish coincident nonterminal trunks without moving nodes or changing semantic ports. | Must handle order conflicts, route topology, turns, labels and insufficient clearance; careless nudging creates collisions or touches. | Preferred next bounded diagnostic. Preserve topology and refuse difficult bundles instead of silently forcing them. |
| Improve rank/order using virtual long-edge vertices | Adjacent-layer crossing order and space occupied by edges skipping ranks; fixes a real limitation of the current prototype's node-only incoming-neighbor means. | Straight-line/layer crossing reduction is not a guarantee about orthogonal trunks chosen by the independent router. Feedback/undirected/compound edges need policy. | Next placement improvement if fixed-route separation establishes that enough useful free space exists; do not present it as a direct shared-run fix. |
Concrete experimental interface and lifecycle
One example-only function: separate_routes(project, diagram, final_view, original_routed) -> Result<RoutedView, Diagnostic>. Borrow the Project and view; return only derived geometry plus explicit moved-bundle/refusal facts. Initially require a flat, unfolded, complete projected scene, all relevant automatic routes free of authored pins, and no existing NoClearPath or unrelated-node penetration. The predeclared input set includes repaired sparse ELK, both mixed ELK orderings, and the small diamond/bipartite witnesses. Keep original routing as the paired control. No node geometry or anchor changes occur during this experiment.
Final automatic ports are already settled by projection. Their tips and full18-unit leads are fixed barriers/anchors for this operation, including shared semantic endpoints. Authored port anchors and explicit endpoint attachments remain exact. Protect common same-owner/same-port leads; do not require physically impossible separation of coincident terminal ink. Distinct ports must not be merged merely because coordinates coincide. Treat any authored pinned route as wholly fixed in the initial scope; defer partial between-pin movement. Preserve its label override. Generated bends must never be written to EdgeRoute.waypoints.
If later integrated, derive it every time route_diagram computes geometry from the current Project, not only immediately after Arrange. Otherwise Save/reopen or an unrelated redraw would lose the result. Preview must use the same derivation and respect cached unchanged routes or explicitly invalidate the appropriate bundle; that is an integration requirement, not work needed for the first example experiment. Arrange continues to commit only selected diagram presentation geometry and its existing eligible-route reset in one history transaction. Undo/Redo, other views, dormant/promoted route metadata and original-to-final translations retain their accepted behavior.
Minimal bounded algorithm to falsify
- From the frozen routed polylines, find positive shared nonterminal spans, grouped by orientation and overlapping longitudinal intervals. Split analysis intervals at segment endpoints; retain edge and original segment identity. No routing weights change and no new search grid is introduced.
- For each small bundle, inspect the entire connected orthogonal run/turn chain that would move. Determine available transverse bounds from actual inflated obstacles, protected terminal leads and fixed routes. Assign a consistent edge order from branch attachments on both ends; if the two end orders conflict, mark unsupported rather than concealing an unavoidable crossing through arbitrary UUID ordering. Canonical semantic/placement ties are deterministic, with explicit relation-ID permutation sensitivity retained.
- Solve all coordinates in that bundle together: neighboring tracks get a fixed declared separation, original coordinates are preferred, and adjacent perpendicular segments extend/shorten to meet the moved tracks. Do not independently move overlapping subsegments, which would produce broken routes. Any new connector needed near a protected stub is an explicit derived orthogonal dogleg, checked in full. First scope may simply refuse bundles requiring such a connector; record how many target witnesses are thereby unsupported.
- Use a fixed small bundle/segment bound and one deterministic pass, followed by complete recomputation of geometric validity. No iterative tweak-until-metric-improves loop. If constraints lack room, either leave that bundle exactly original with an explicit refusal or fail the whole experiment according to the predeclared case protocol; never report it as repaired. Other bundles must not be treated as non-obstacles while solving, and later changes must not invalidate earlier separation.
- Recompute automatic label placement on final paths using the same core label placement machinery. An example cannot honestly carry old bounds onto moved paths and call the resulting label metrics final. This is the main small core seam potentially needed beyond the example: factor the existing post-route label settlement phase for reuse, without changing its policy. If parent declines that extraction initially, retain labels as fixed obstacles and label the result geometry-only; it cannot pass label-aware Arrange acceptance.
This is a bounded parallel-segment constraint problem, not a whole orthogonal graph drawing framework. Avoid promoting a speculative reusable solver before one small bundle and one realistic scene demonstrate value. If the smallest useful bundle requires pervasive topology changes, stop and record that limitation; the next candidate is explicit corridor-aware routing coupled to placement, not hundreds of ad hoc bend exceptions.
Finite evaluation and stop conditions
Use fixed geometry with an analytically separable two-route shared middle span and immutable terminal leads; a shared-port witness must retain its common lead while separating only beyond it. Include a too-narrow corridor (explicit refusal), opposite branch order (refusal or explicitly counted crossing), one fixed pinned route, and one real sparse shared-run bundle. Pair with diamond/bipartite and both mixed relation-ID variants already available. No parameter sweep.
Require exact Project, node geometry, semantic ports and endpoint tips/stubs; every output orthogonal; no new unrelated node/lead penetration, no lost hard pin, no newly introduced improper self-overlap/degenerate backtracking. Compare actual shared-run identities/lengths, proper and T/bend contacts, and label/stroke/label-node collisions after label settlement. The concrete user-facing target is tracing two formerly coincident connections from their branch points without an ambiguous shared middle run. A native trace task is still needed before adoption; an export diagram can provide review evidence but not replace interaction.
Success means at least the declared bundle and one realistic route-tracing witness separate with no new hard violation or label interference and a recorded acceptable path/area cost. A lower total shared length obtained by moving ambiguity to a different pair is failure. Idempotence means applying the separator to its own derived result makes no further change; Save/reopen recomputation from the same Project must match the original derived output. Do not claim full Arrange support: nested ancestor headers, folded promotions, undirected branch ordering and partial authored-pin routing are explicit later gates. Semantic direction is not invented for undirected edges; separator ordering derives from geometry and endpoints, and reversing an undirected edge must not change its physical lane assignment.
Stop after this fixed candidate is compared. If it only works by moving nodes, consumes excessive space, or fails the real witness because free corridors cannot preserve branch order, that is actionable evidence for a combined rank/order + corridor assignment planner. Virtual long-edge vertices then become part of routing constraints shared with coordinate assignment, rather than another placement proxy whose route result is assumed.
Revision after grouped-sharing/SCC diagnosis
Priority revised: SCC condensation with compact block placement is the justified next experiment; defer the joint separator. This supersedes the initial next-action recommendation above, while preserving its alternatives and interface warning. New evidence is connection-corridor-sharing-diagnosis-20260925.md and its independently reconstructed interval/SCC data. The predeclared implementation contract is harness/experiments/scc-placement-20260925/plan.md.
The diagnosis resolves an uncertainty that my initial recommendation left too broad. Sparse has four ten-member SCCs interleaved over16 ranks;38880/40522 shared units (95.95%) occupy the same y28 outside corridor. Mixed has4006/4228 (94.75%) there. These are long stretched feedback/forward routes caused by incoherent component ranking plus aligned row boundaries and globally inflated gaps, not primarily the small local lane collision exhibited by repaired ELK geometry. A joint separator would treat a large structural symptom while retaining avoidable rank spans. Coherent condensation order and compact SCC membership directly change the implicated cause with the released router unchanged.
The frozen plan is a meaningful distinct candidate: SCCs per actual sibling quotient, condensation DAG ranks, compact perimeter for cyclic members, local label gaps, explicit final projection/lead checks and no iterative rescue. It is more appropriate now than virtual long-edge vertices: dummy vertices can improve ordering across coherent ranks but cannot undo an incorrectly split/interleaved SCC rank assignment. Among block rows and a compact perimeter, the predeclared perimeter is a reasonable single hypothesis because it bounds cyclic-member extent and distributes turn opportunities; it is not a proven cycle embedding. A strongly connected group need not be one simple cycle, directed DFS successor order need not make every adjacent perimeter pair connected, and chords can still cross or share trunks. Do not describe the perimeter as an optimal cycle layout.
Specific plan risks to retain in evaluation: a minimum30-unit gap only addresses a particular facing-port clearance case, not all final automatic-port choices; nested quotient SCCs are not leaf semantic SCCs; undirected edges must retain direction-free treatment and still be observed for routing quality; fixed anchors can oppose perimeter flow; expanded/folded footprints and local-label estimates must not induce repeated size growth. The plan's explicit final reprojection failure and original-to-final import policy address these as boundaries rather than silently assuming success. Header/enclosure checks and ten-call stability are essential, as declared.
The decisive falsifier is not merely fewer global ranks. Require coherent condensation order, reduced component span and the diagnosed top-corridor contribution, with no new hard geometry violation or comparable ambiguity shifted to another axis/pair. Retain area, labels, contacts and actual named trace tasks. If the perimeter introduces another outside shared loop or rejects a real case because of mandatory leads, preserve that counterexample without parameter tuning. Then select long-edge ordering for rank/order failure, or joint derived separation for a genuinely local residual channel failure.
Nothing here proves placement alone always enforces distinct lanes: that earlier interface limitation remains exact. Nor does the diagnosis prove that a coupled router is necessary. It supplies a narrower, more causal and cheaper first experiment than the initial separator recommendation. No new run or implementation was performed for this revision.