diff --git a/harness/DECISIONS.md b/harness/DECISIONS.md index b91f4dc1..712a30c9 100644 --- a/harness/DECISIONS.md +++ b/harness/DECISIONS.md @@ -575,3 +575,24 @@ comparison should preserve coherent SCC ranks while using actual cross-boundary neighbors to order siblings. Treat label association separately from route sharing, preserve the full quality vector, and retain native tracing as a later acceptance gate. No global gap or routing-penalty sweep follows from this result. + +## Incoming boundary order is useful but not sufficient — 2026-09-25 + +The [boundary-order comparison](experiments/boundary-order-20260925/results.md) +at3e21c1bc preserves SCC blocks/ranks and orders same-rank child blocks using +incoming external source centers. Dependency components provide deterministic +propagation; cycles use one simultaneous snapshot. It fixes the declared +simple two-container tracing witness (sharing164→0) and three-parent chain, +while preserving all ten flat Projects/metrics exactly. All20 candidates pass +independent full-Project conservation. Native saved-Project inspection confirms +the simple trace improvement without establishing a native planner integration. + +Retain the mechanism experimentally. Folded workshop sharing726.5→1077.5, +expanded crossing6→7, and anchored/local-SCC label intersections prevent +unconditional adoption. Native anchored labels remain readable while their +backgrounds interrupt the parent border: geometric collision counts require +severity and ownership interpretation, not silent removal. Full member displacement +must be checked in f64 before final f32 rounding; checking only a rounded delta +misses large-origin errors. No further parameter sweep or release change is +justified by this checkpoint. Production selection, label handling and integration +remain open; the user requested a stop after publication. diff --git a/harness/auto-layout-investigation-20260925.md b/harness/auto-layout-investigation-20260925.md index e72dd4ae..8d3e1d1a 100644 --- a/harness/auto-layout-investigation-20260925.md +++ b/harness/auto-layout-investigation-20260925.md @@ -149,3 +149,12 @@ child ordering, local label conflicts and folded backtracking remain explicit witnesses. Source, failed/successful runs, conservation and independent reviews are linked from the result. Gitea remains authoritative for live ownership and publication status; no integrated checkpoint or release change is implied. + +The [incoming boundary-order experiment](experiments/boundary-order-20260925/results.md) +resolves the exact simple two-container tracing defect and preserves all flat +SCC results. Twenty supported cases retain model/anchor/block invariants, but +workshop sharing/crossing and label tradeoffs remain. Saved-Project native +inspection confirms the simple benefit and limits the severity interpretation +of anchored label intersections. This is a published research checkpoint, not +an integrated Arrange replacement. Gitea records handoff and the user-requested +pause; no further experiment is authorized during that pause. diff --git a/harness/experiments/boundary-order-20260925/conservation-review.md b/harness/experiments/boundary-order-20260925/conservation-review.md new file mode 100644 index 00000000..706d0a24 --- /dev/null +++ b/harness/experiments/boundary-order-20260925/conservation-review.md @@ -0,0 +1,19 @@ +# Boundary-order conservation review + +Read-only audit of `.local/boundary-order-20260925/run01`, source `3e21c1bca245944ae0ec7bb02aaa920f45f2cc30`. No compiler, router, engine or native execution. Twenty boundary candidates are supported; zero unsupported cases. Fourteen current SCC controls and six paired extra-fixture baselines are accounted for separately, not counted as additional boundary cases. + +Independent complete-Project reconstruction passes for all20 boundary candidates,14 controls and6 paired baselines. Reconstruction starts from raw original Project, resolves actual endpoint owners and preoperation reset eligibility, retains entire semantic/nongeometry structures, applies only permitted visible geometry/minimum restoration and hidden-owner translation, and compares the entire expected result. No conservation boolean substitutes for this comparison. All66 receipt hash/byte-size bindings read back exactly. + +All14 current SCC-control Projects equal their prior SCCrun02 Projects exactly. All20 successful boundary/baseline pairs retain exact effective node sizes, per-group SCC membership/rank/canonical walk/grid/gaps, and rigid internal SCC geometry within0.001units. Eleven boundary Projects equal baseline completely. Nine differ: all six extra fixtures, two_containers_reversed_children, workshop original and workshop folded. Node positions are the intended variable; no semantic reparenting or new authored elbows are persisted. + +Every authored port-anchor record, other diagram, route entry identity/order and nongeometry field remains exact. The only authored-route changes are the same three eligible waypoint/label resets (mixed, reversed mixed, authored_detour_and_label). No retained dormant/promoted authored-route translation or nonempty authored attachment coverage occurs; do not infer it from the checker implementing that policy. Folded workshop's three hidden descendants still independently follow Allocation/semantic ancestry under collapsed owner `75920e7a-4586-58b7-9eb2-7e0a3d8a1825` by(-680,0), preserving latent sizes/metadata. All checked non-State container enclosures/minima pass. + +Automatic port changes are preserved, not normalized away: boundary_two_local_sccs has two side changes, owner`…000004`/port`…000026` Bottom→Right and owner`…00000a`/port`…00002a` Bottom→Left. Neither is authored. Every pair has identical projected port inventory; no other side changes were observed. These are actual projection results, not evidence that source anchor records changed. + +All34 primary successful records report exact same-input output, all nine repeated calls2–10 equal first/previous, and exact JSON/single-source round trips. These remain recorded Rust checks: repeat Projects/source strings are not serialized for independent rerun. Exact intended node plans are absent; final-plan equality remains the source import gate. The audit independently checks final emitted projection, permissible full-Project deltas, component invariants and enclosures, not a second layout implementation. It does not validate renderer text, estimated label collision accuracy, trace readability, general native workflow or adoption. + +Auditor: `.local/audit-boundary-conservation-20260925.py`, SHA256 `f14d96f7ee1487d245bd30436dea356df7524006c51f2fbac929b067b881d893`. Final result: `.local/boundary-conservation-audit-final-20260925.json`, SHA256 `f6a3fa93c03174e0eae6f816975f06a10a696659bd3fd58291ac805a69d5edee`. Raw paired rows are read directly and bound to original paths/hashes, with baseline selector attribution; no normalized copy is represented as runtime output. + +The first audit output is preserved: it successfully checked conservation but grouped14 SCC controls with20 candidates and used prior baselines directly. Final checker explicitly labels those roles, compares controls to prior results and boundary cases to the current controls, while retaining six in-row baseline/boundary pairs. This is inventory/attribution refinement, not a suppressed model failure. Original SCC auditors/reviews were untouched. + +Reproduce: `python audit-boundary-conservation-20260925.py RUN_DIRECTORY NEW_OUTPUT_JSON 3e21c1bca245944ae0ec7bb02aaa920f45f2cc30 PRIOR_SCC_RUN02_DIRECTORY`. UTF-8 is explicit; output refuses overwrite; only the Python checker executes. diff --git a/harness/experiments/boundary-order-20260925/design.md b/harness/experiments/boundary-order-20260925/design.md new file mode 100644 index 00000000..af0381cf --- /dev/null +++ b/harness/experiments/boundary-order-20260925/design.md @@ -0,0 +1,81 @@ +# Boundary-order design critique + +Local-only independent design review, 2026-09-25. Read source at `f4fa0c11f2271a93e324541e570ba391dce8122f` in `.local/auto-layout-20260925` and the SCC experiment's results, run02 quality review and transfer diagnosis. No implementation, build, router execution, GUI exercise or Gitea publication. The working tree was clean when inspected. This is a proposal and source-derived reasoning, not new empirical quality evidence. + +## Recommendation + +Use one deterministic sweep over the SCC condensation of **ordering dependencies between sibling groups**, starting from the complete canonical SCC plan. A dependency must represent every mutable ancestor ordering that can move an external source endpoint. Do not substitute source-parent dependencies, parent ID order, absolute-X order, or a fixed count of snapshot passes. Freeze the internal decision state of a cyclic dependency SCC: compute its members' proposed orders from one pre-SCC snapshot and commit all together. Explicitly document that cyclic dependencies can retain or exchange crossings; this is a bounded heuristic, not a cycle solver. + +Preserve the existing semantic SCCs, ranks, member walks, perimeter offsets, block dimensions, gaps and root ordering. Repack the changed ordinal orders from the same block dimensions. Group envelopes are invariant under this operation; assert that fact instead of introducing a new enclosure growth pass. Import only the final plan using the existing exact projection and mandatory-lead guards. This adds precisely the information omitted by the current child-group planner while retaining the sparse structural witness. + +The selected policy preserves same-rank undirected-connected bundles as indivisible ordering units with their canonical BFS internal order. A new external-order pass must not silently undo that proximity policy. Use visible endpoint centers as a declared heuristic, and retain final port/route checks; do not pretend center ordering proves attachment alignment or readability. + +## Why the alternatives differ + +| Candidate | Main benefit | Concrete weakness | Verdict | +| --- | --- | --- | --- | +| One canonical snapshot, incoming only | Smallest change; no mutation-order dependence; handles the two-container witness | A→B→C chain: B changes order to A, but C sorts against B's stale canonical order | Useful control, too weak as the preferred next candidate | +| Fixed number of snapshot passes | Carries influence farther without traversal code | Any fixed count has a longer-chain counterexample; cyclic groups may alternate; the pass count becomes an arbitrary hidden bound on quality | Reject as a generalization of old layered's three passes | +| Parent-ID or X/topological order using only parent relations | Cheap sequential propagation | Source descendants can later move under an ancestor ordering; ancestor-level SCC perimeter X does not express causality; unrelated ID changes select winners | Reject as the dependency definition | +| Complete ordering-dependency SCC sweep | Acyclic influence propagates once; explicit handling of genuine mutual dependence; bounded work | More bookkeeping; cyclic-SCC snapshot retains a declared limitation | Preferred bounded experiment | +| Joint crossing minimization or repeated barycenter optimization | Could optimize opposing constraints and port attachment geometry | Introduces a substantially different optimization problem, objectives and stopping policy before the simple witness is resolved | Defer until evidence defeats the bounded structural candidate | + +Incoming-only treatment is meaningful because it anchors downstream order to upstream arrangement. It does not by itself remove cycles: two containers can each have an incoming edge from the other even when their internal child graphs are edgeless. The SCC used for ordering dependencies is distinct from the sibling-subtree semantic SCC already used for rank and perimeter placement. Never merge these concepts or feed ordering dependencies into semantic ranks. + +## Precise candidate contract + +1. Run the existing canonical planner to an in-memory plan. Keep a record for each sibling group of its SCC blocks, ranks, canonical ordinal order, dimensions, cut gaps and member offsets. Keep the root order fixed. Record a complete canonical absolute-position snapshot without importing an intermediate Project. +2. A target ordering group G is the children of a visible, noncollapsed parent P. An eligible boundary signal is an oriented **projected** edge for which the target lifts to a child of P and the source does not lift to any child of P. Internal-group incoming links are not boundary signals; outgoing and undirected boundary links supply no ordering signal in this candidate. An edge to a hidden endpoint uses its actual projected promoted endpoint, never the latent hidden placement. +3. The unit that moves is an SCC block, or an explicitly defined contiguous undirected-connected bundle of same-rank blocks. If bundle support is deferred, freeze layers with any such cross-block undirected link and report the reason. Do not break an SCC or reorder its perimeter members. A unit is anchored when at least one eligible incoming boundary signal targets one of its members or visible descendants. +4. For each same-rank layer, preserve the canonical ordinal indices occupied by unanchored units. Sort anchored units only into the remaining indices, by the arithmetic mean of their external source endpoint centers' absolute Y coordinates, followed by the existing canonical unit key. Deduplicate external visible source placement IDs per unit; several ports or parallel relations from one source owner contribute once. Sort those placement IDs independently of relation IDs, accumulate in f64, and reject nonfinite values. This is a declared source-owner weighting policy: relation multiplicity does not increase influence. This score is a center-based ordering heuristic, not a crossing objective. +5. Build a dependency graph whose vertices are the nonroot ordering groups that can alter an order. For every eligible signal consumed by G from visible source S, add H→G for **every** mutable group H whose child subtree contains S. In other words, include all ancestor ordering transforms that can change S's absolute position, not merely S's immediate sibling group. A collapsed visible source has no visible interior ordering group; its visible ancestors still matter. Conservative extra dependencies are permissible if reported, but may enlarge SCCs and freeze useful propagation. +6. Condense that graph. Process dependency SCCs in deterministic topological order. Before each SCC, reconstruct a complete absolute-position snapshot from the current relative offsets. All groups inside that SCC read this same snapshot, calculate proposed orders, then commit their orders together. Acyclic singleton SCCs therefore observe completed upstream changes; cyclic SCCs take one simultaneous bounded step. Independent ready SCCs cannot influence each other's consumed sources by construction, but use the canonical key to make diagnostics reproducible. +7. After committing an order, repack by prefix sums of the unchanged block heights and unchanged gaps. Preserve rank X origins and internal block/member offsets. Recompose absolute descendant positions from all relevant relative transforms. Do not move only the source node while leaving its descendants behind. +8. Assert every group's planned envelope and every block size equal their canonical values. Assemble one final complete plan and call the existing importer once. Keep original-to-final route translation, eligible reset, dormant-route preservation, authored anchors, hidden translations, semantic conservation and exact second-projection rules unchanged. A final projection mismatch or incompatible mandatory lead remains a refusal, not permission to grow sizes or iterate. + +Two useful simplifications: source-center ordering does not require target-ancestor-before-descendant execution, since a target ancestor's translation does not change the order of consumed external source values. Explicit source-influence dependencies plus absolute coordinate recomposition are sufficient. Also, arbitrary intermediate geometry within a dependency SCC need never be externally visible: compute its decisions before committing any of them. + +## Important limits and traps + +**Ordinal slots are not fixed Y coordinates.** If an 80-high and 200-high block trade old Y coordinates, they can overlap. Preserve ordinal indices, then recalculate packed Y values using the unchanged heights. The layer envelope is nevertheless unchanged: height is the same sum of heights plus gaps, and width is the same maximum. Every ancestor enclosure is consequently unchanged by induction, even for nested containers. Nested size feedback is not inherent in this permutation stage. + +**Automatic port projection remains geometry dependent.** Rearrangement may select different automatic sides or put more ports onto a side, increasing projected size beyond the frozen plan. Derived enclosure invariance does not exclude that. The exact final projection and lead checks must catch it. Preserve explicit port-side and fraction metadata. A center-based score may worsen actual fixed-port endpoint order; inspect routed outcomes and include that counterexample in evaluation. + +**Determinism differs from idempotence.** Complete canonical reconstruction plus deterministic dependency processing gives same-input determinism. It does not prove repeated-call equality because the next input's effective minima may include stored enclosure repairs or new side-capacity minima. Existing repeated-call checks must remain, including nested automatic-port cases, and must compare complete Projects. Do not justify a failed repeat by saying that the ordering graph is deterministic. + +**Canonical choice is a policy, not evidence of quality.** Alias and placement-ID keys are defensible tie breakers already present in this experiment. They imply sensitivity to alias changes and duplicate-alias placement IDs. Relation-ID permutation should not change geometry or scores. Full graph-isomorphism invariance is neither supplied by the current planner nor established by this proposal. Diagnostics should distinguish a canonical tie from a strict source-derived ordering decision. + +**Cyclic dependency SCCs have no guaranteed winner.** Simultaneous calculation is independent of group traversal order, but opposing permutations may both reverse and remain crossed. Freezing canonical order for cyclic SCCs is a still more conservative alternative if the corpus shows worsening; predeclare which policy is being tested. Do not quietly select between the two after routing each fixture. Sequential execution within a cyclic SCC merely chooses an arbitrary winner and is not a resolution of the constraints. + +**Non-singleton target blocks weaken the center proxy.** Two SCCs can receive edges into different perimeter rows. Mean external-source center ignores target member offsets, so it can place their block centers in an order that crosses the actual connections. An offset-adjusted score would be a different candidate and would introduce dependencies on target descendants as well. Keep this limitation explicit and use a cyclic-block target fixture; do not add that refinement without a separate reason and specification. + +**External order can conflict with internal rank order.** The current canonical pass already uses preceding-rank proximity. Overriding its same-rank order from boundary neighbors can increase internal crossings. A fixture must include this conflict, and evaluation must retain all internal and external routes. Success on one reversed-child witness is insufficient. + +## Falsifying fixtures and acceptance evidence + +- Preserve the frozen 14 cases and exact complete sparse candidate geometry/metrics. The targeted two-container witness should reach zero shared length and zero label/node collisions like old layered, without semantic, port, fold or import regression; report the whole quality vector rather than only that target. +- Three containers A→B→C, two matched channels, chosen aliases giving differing canonical child orders. A second version with a longer chain distinguishes an actual dependency sweep from a fixed snapshot-pass count. Verify final channel alignment and dependency order from emitted plans, not just zero process exit. +- Ancestor influence: an ordering group moves a container holding an external source whose own immediate child group does not reorder; that source feeds a different target group. The target must consume the source's updated absolute Y. Reverse container IDs to expose accidental iteration dependencies. +- Opposing incoming constraints between two containers; a three-container directed cycle; and an acyclic semantic graph whose container grouping induces a dependency cycle. Confirm the declared cyclic policy and same-input determinism, and report unresolved crossings rather than claiming all cycles solved. +- Heterogeneous block heights with an unanchored block between two anchored blocks. Require unanchored ordinal-slot preservation, no overlap, exact unchanged total envelope and deterministic packing. Repeat with nested containers and a multirow SCC. +- A same-rank chain of undirected-connected blocks plus externally anchored endpoints, and a purely undirected cross-container fixture. Require the declared bundle/freeze policy, no invented directed arcs/ranks and no silent loss of existing contiguity. +- An internal diamond or fan-out whose canonical target order is good but boundary signals prefer its reverse. Detect improvement to the boundary at the cost of internal tracing. +- Fixed ports with source-center order opposite to port-attachment Y order; many automatic ports near a side-choice/capacity threshold. Require exact model-anchor preservation and final projection acceptance or clean refusal, never size chasing. +- A collapsed source container promoting hidden edges; nested collapsed descendants; and a surviving dormant authored route. Require only visible geometry to influence ordering, hidden translation with owner, and the existing route/reset conservation contract. +- Parallel boundary relations and a relation-ID permutation with identical endpoints; equal mean scores; repeated invocation; JSON/text round trips. Require exact geometry determinism under relation-ID changes and exact repeated Projects. Route relation-ID sensitivity remains a separate existing router limitation. + +The existing full corpus remains the primary comparative experiment. These small synthetic fixtures test the candidate's mechanism and claimed invariants. No compilation result, small-corpus metric or this design review establishes native usability, production Arrange integration, or release acceptance. + +## Final selected-policy review + +The parent's final proposal adopts indivisible undirected-connected bundles, deduplicated visible source owners, active groups only when some band has at least two anchored units, source-ancestor dependencies only, and one simultaneous pre-SCC snapshot for each cyclic dependency SCC. I find no material correctness flaw in that bounded contract, provided the following definitions are implemented literally: + +- A source owner is the projected edge's visible source **placement ID**, not a semantic element ID or unprojected port owner. Distinct visible placements remain distinct observations; promoted endpoints contribute their visible owner. +- The source influence chain includes the ordering group immediately containing the source placement, and every higher active ordering group that can move it. It must not start one level too high. +- Bundle order is preserved by ordinal slot, then prefix-height packing; old absolute Y coordinates are not reused for differently sized blocks. +- Before an SCC computes scores, all source absolute coordinates are recomposed from the current full offset map. All its proposals are calculated before any are committed. +- Work charging and diagnostic bounds include ancestor-chain discovery, dependency SCC processing, source-set accumulation and absolute-coordinate recomposition. + +Active-group restriction is sound for this contract: fewer than two anchored units cannot change order because unanchored unit slots are preserved. Unchanged active groups can conservatively remain dependencies. No extra hierarchy edges are necessary. + +The important remaining risks are empirical: cyclic dependencies may preserve or exchange crossings, source-center order can disagree with fixed-port/perimeter attachment order, deduplicated owners intentionally ignore connection multiplicity, and boundary preference can worsen internal rank tracing. Keep those limitations and the chain/ancestor influence fixtures above. Exact repeated-call stability and final automatic-port projection remain acceptance checks, not consequences of the ordering proof. diff --git a/harness/experiments/boundary-order-20260925/evaluation.md b/harness/experiments/boundary-order-20260925/evaluation.md new file mode 100644 index 00000000..14efe13d --- /dev/null +++ b/harness/experiments/boundary-order-20260925/evaluation.md @@ -0,0 +1,46 @@ +# Independent boundary-order evaluator contract + +Source inspection at research f4fa0c11; controls are frozen SCC run02 and prior old-layered results. No implementation, compiler, router, UI or Gitea action. Evaluate one predeclared boundary-order candidate, not a family selected after viewing scores. + +## Exact missing information + +`layered.rs` incoming-neighbor pass (approximately137–167) considers an edge whose target lifts to the current child and whose source does not lift to that same child. An external source need not be a sibling. Its world-space center Y influences downstream child order. Three passes carry updated positions between groups; outgoing neighbors are intentionally not chased simultaneously, avoiding a swap of both groups that preserves reversal. This is a useful mechanism, not a proof that its three-pass update converges for arbitrary parent cycles. + +`condensed.rs:224–241` requires BOTH endpoints to lift into the same sibling group before retaining a link. Thus an external source contributes no local child-order information. Lines365–390 only order SCC blocks from lower-ranked neighbors already in that local links list, followed by same-rank proximity. Correct root condensation knows Left→Right, but the singleton children inside Right have neither local arcs nor external order hints. Their component/canonical order survives. This omission is separate from the successfully fixed SCC rank problem. + +## Existing two-container witness: fixed expected order + +Fixture definitions are `auto_layout_probe.rs:580–603`. Placement suffixes uniquely identify this fixture: + +- Left parent002: Left A006 then Left B008. +- Right parent004: Right A00a then Right B00c. +- Directed edge00d: Left A006→Right B00c. +- Directed edge010: Left B008→Right A00a. + +In frozen SCC run02 both groups retain A above B: child Y136 and300. The concrete downstream order witness is **Left A < Left B and Right B < Right A** (compare projected centerY; names are labels, IDs are identities). Preserve Left's order as the upstream reference; swapping both groups is not success. The mirrored physical arrangement can be equivalent globally, but it is not the predeclared one-sided witness. Every child remains under its original parent and each parent's local SCC membership/rank remains unchanged. + +Old layered establishes a feasible target with unchanged semantic endpoints: zero shared length/contacts/label collisions versus SCC164 sharing,2contacts,1label/node; route length372 versus788, area272800 versus339852. Do not assert the new implementation must reproduce every coordinate. Require the ordered pairs above and compare actual final released routes to that zero-sharing witness. Smaller connector inversions alone do not pass if routing still merges the traces or labels become obstructed. + +## Three additional topology falsifiers, fixed before implementation + +Use equal-size ordinary SA function children, no authored ports initially; add explicit anchors only as the stated separate invariant variant. Stable aliases A/B determine the unconstrained upstream order. Use the same renderer-independent node sizes/gaps as existing fixtures, not dimensions chosen after candidate output. + +1. **Opposing cross-parent evidence.** Two parents L/R, children A/B each; arcs L.A→R.B, L.B→R.A, R.A→L.A, R.B→L.B. The first pair asks for opposite L/R order; the second pair asks for matching order. These demands are incompatible. Expected: semantic direction and SCC condensation remain exact, deterministic bounded resolution with explicit ties/diagnostics, no endless joint swapping or silently dropped arcs. Do NOT require zero crossing or a particular arbitrary winner. Repeated full candidate calls must stabilize; route/label costs and any introduced hard violation remain visible. +2. **Three-parent propagation.** Parents L/M/R with A/B children. Arcs L.A→M.B, L.B→M.A, M.B→R.A, M.A→R.B. With upstream L.A