7.2 KiB
Connection-aware placement reference experiment
Prepared before reference-engine outputs. Owned scope remains issue32 under Codex-ytr83r/root. Gitea writes are currently failing; this plan and future results remain local-only until normal publication succeeds. No Linux checks or prerelease change.
Question and decision
Can a mature port/hierarchy/label-aware placement engine produce node positions that materially improve the unchanged released Rust router's final drawing on the already frozen five-case corpus? Compare the old Rust layered prototype, reset-only released placement, and this external placement reference. This is a diagnostic comparison, not adoption of JavaScript into the product and not a test of ELK's complete drawing quality: returned ELK edge sections and label coordinates are deliberately not applied to the Project. Failure may show that placement and routing must stay coupled, or that this adapter is inadequate; it does not establish that ELK itself is poor.
The previous turn completed a verified explicit route-reset contribution. Prior J/P/PL/L router tuning stopped with realistic ID-order/label tradeoffs. Root cause inspection shows production Layout topologically orders roots then packs four per row; nested children are ordered by ID and stacked. Its isolated layered prototype uses neighbor node centers, ignoring fixed port order, and one diagram-wide maximum label gap. Repeating penalty tuning is not the next experiment.
Primary sources: ELK Layered supports ports, labels and compound graphs; Schulze et al. explains that crossing reduction depends on port order as well as node order. ELK JSON defines nested nodes/ports and requires supplied label dimensions. Official elkjs exposes the layout algorithms in JavaScript. These motivate a reference comparison, not an inferred implementation guarantee.
Frozen inputs and engine
Use every existing case in harness/experiments/routing-independent-20260925/corpus/manifest.json at research commitac5d7ef3: workshop expanded/folded, mixed dispatch, its fixed edge-ID permutation, sparse40. Do not edit fixtures, select favorable routes or add new tuning cases after results. Manifest SHA256 a58a6956e26b414e88fafd4fdb92e006050653a4149178f08df84128e3917717. Reuse named trace tasks and report every case, including unsupported/error outcomes.
Reference engine elkjs0.12.0, official npm tarball SHA256 c1d7719723e020b10724e3ccbc935696a2884f1e78d361cdd03766309e8e8e2a, bundle SHA256 1222e44f953ce7746af23801e723708f8e6f436b8b377a6a5fc7552f34a307b3. Registry SHA512 integrity was verified. Isolated bundle extraction runs no npm lifecycle scripts. Dependency receipt and license retained. No application dependency or packaging decision follows.
One declared configuration: layered, RIGHT, orthogonal, hierarchy INCLUDE_CHILDREN, seed1, no edge/hierarchy merging. Projected visible hierarchy and dimensions; semantic port identities shared exactly where projection shares them. Ports use observed owner-relative coordinates, side and FIXED_POS. Compound header64/top padding and24 side/bottom padding reflect these architecture fixtures; they are not general State metrics. Current core-estimated edge label dimensions are supplied. Save complete input graph before calling the engine. Unsupported direction/port references fail explicitly. Record all output coordinates, sections and labels even though only node geometry is transferable.
Adapter gates and attribution
Return exactly one finite positive node rectangle for each input projected node, with unchanged IDs and hierarchy. Detect extra/missing/duplicate nodes, changed identity, invalid fields, shrinkage and header/containment collisions. Do not change semantic endpoints, port anchors, relation direction, node visibility/collapse, authored endpoint attachments, or other views to fit the engine. Output port coordinates relative to resized containers must be audited: FIXED_POS can diverge from our final-size anchored fractions. Report that divergence; do not silently accept it as matching a fixed-fraction constraint or repair anchors. Reproject the imported Project through Rust to establish its actual final endpoints.
The placement importer starts from the original Project and replaces only returned visible node geometry. A visible collapsed node has a compact projected footprint distinct from stored expanded size: require the returned size to equal that compact footprint, apply only position, and preserve stored expanded size. A resized collapsed footprint is rejected in this first adapter, not silently written into expanded geometry. For a hidden placement under a visible collapsed ancestor, translate its original position by the nearest visible collapsed ancestor's delta, preserving latent relative geometry; unrelated out-of-projection nodes stay exact. This is an explicit reference-adapter policy, not a production amendment. Use existing actual-owner translation for retained routes; clear only pre-operation eligible visible actual-owner pins and full labels, preserving entries/order and attachments as in the verified reset contract. Validate the final Project, source roundtrip and conservation before geometric comparison. Scenario is excluded explicitly. The old prototype's folded refusal remains a failure to support that case, not a zero-score row.
Observations and stopping rule
Parent bounds each engine process at90seconds; retain timed-out/missing output as failure. Engine timing is diagnostic startup+layout timing and is not directly compared to prior isolated Rust route-only timings. Freeze binaries/scripts/config/source before calls; verify input and tool hashes afterward. No concurrent compiler writes to shared target. Once compiled, preserve the observer executable before further worktree edits.
Report the existing full vector: proper crossings, all raw T/bend/endpoint contacts, pairwise and nonterminal shared length, node/header penetration, node and estimated-label collisions, unrelated label/stroke intersections, per-edge warnings, bends, length and area. No weighted aggregate pass. Compare each candidate to the same source/reset control; distinguish node positions from final routed geometry. Preserve source inputs and raw outputs. ID-permutation pair must stay explicit.
This finite experiment answers whether further native Rust placement design or an external-engine integration spike has stronger evidence. A simpler Rust candidate remains preferred if comparable. Reject a transfer as acceptable if it loses constraints, changes semantic records, produces invalid geometry or introduces new trace ambiguity. Scalar improvements alone cannot establish native traceability or shipped usability. Follow native inspection only for a candidate with a defensible full quality vector and faithful adapter; no automatic production adoption. Stop after this single configuration and analysis; repair concrete adapter defects with preserved failures, but do not tune options after viewing quality results.