4.7 KiB
SCC-block placement prototype
Research-only examples/auto_layout_probe/condensed.rs. APIs candidate(&Project, Id) and candidate_with_diagnostics(&Project, Id); the latter returns (Project, serde_json::Value). No compiler, formatter, engine or GUI run by implementation agent. Parent owns integration and execution.
The implementation freezes actual projected node minima and visual-parent forest. It rejects Scenario and graphs over256stored nodes/1024visible edges. Folded placements are opaque projected leaves; the authoritative parent import preserves their stored expanded size and moves hidden descendants. No semantic parents, edge direction, port anchors or route fields are directly edited by the module.
Process sibling groups bottom-up. Lift each visible endpoint to its immediate child subtree; form directed arcs only from directed edges. Bounded reachability computes exact SCCs of that quotient graph, which need not equal global semantic SCCs. Condensation longest-path ranks cannot interleave a component's members. Undirected links influence local spacing and deterministic same-rank proximity, never rank direction. Canonical alias/placement-ID order breaks ties, independent of edge IDs. Within each SCC, deterministic directed DFS successor walk chooses clockwise perimeter order.
For a multi-node SCC, enumerate finite integer perimeter grids with enough slots. Use maximum member dimensions and local internal edge-label gaps; select minimum bounding area among physical aspect ratios≤2, then area/rows/columns ties. If no such grid exists within the bounded enumeration, select closest aspect, then area/rows/columns. This near-square restriction was approved before execution; unconstrained area minimization would produce a strip. Singletons retain their size. Fixed one-pass prior-neighbour ordering plus a canonical same-rank adjacency walk affects component proximity without changing ranks.
Component and rank-cut gaps use relevant core-estimated label bounds plus32, minimum32, rather than one diagram-wide maximum. Each compound encloses its child layout with32horizontal/bottom padding and actual State header (otherwise64) plus32top separation, taking maxima against frozen projected minima. Absolute positions are accumulated through the visual forest at root origin40,40. Work cap20000000charged units, extent100000; no quality-score iteration or clearance repair loop.
Exactly one parent import_placement call applies final positions/sizes and authoritative original-to-final route/reset/hidden translation policy. Its final reprojection gate rejects automatic-capacity or container-size divergence rather than repairing indefinitely. The actual final lead diagnostic rejects incompatible mandatory leads explicitly; an empty diagnostic is necessary only, not full-route or readability acceptance. Diagnostics expose parent groups, SCC membership/DFS walk/rank/grid/gap, lifted directed and undirected pairs, component offsets/envelopes and work usage.
Two pure tests cover SCC separation across a one-way bridge and unique nonoverlapping ten-node perimeter slots. They are unexecuted. Repeat stability and meaningful preservation/geometry tests remain parent's run gates. Large local labels may still produce oversized SCCs; quotient cycles and cross-container semantic cycles are heuristic limitations, not equivalent semantic SCC claims. Routing used to obtain label bounds is bounded by existing core machinery but is not included in the prototype's own charged-loop count; this is not a runtime latency guarantee.
Parent integration addendum
The preceding text is the implementation handoff before execution. Source
ea18adc0 corrects perimeter scoring to use occupied cells, includes single-row
and single-column candidates, and adds a two-node witness. It scores maximum
member-cell envelopes, not an exact aspect guarantee for heterogeneous nodes.
Source4dd764fa fixes a Clippy row-iteration warning; five example tests, strict
Clippy and the release build pass. Run01 supports13 of14 frozen cases.
Source2426d286 changes only the shared example importer and its tests, not SCC placement. One bounded conditional restoration preserves intended unchanged effective container minima after children move inward. Three regression tests cover that failure, expanded/folded identity and inconsistent-plan rejection. All eight example tests, strict Clippy and optimized build pass. Run02 supports all14 cases and leaves all13 prior successful candidate objects exactly equal. Independent quality reviews still reject production adoption. See the final results, transfer diagnosis, source review v2 and run02 reviews for the complete evidence and limitations; the early unexecuted status above is historical.