Files
ARCADIA-Studio/harness/experiments/boundary-order-20260925/implementation.md
T

20 lines
4.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# One-pass boundary ordering implementation
Owned module only: `examples/auto_layout_probe/condensed/boundary.rs`, preformat SHA256 `d2b1a5882c4b64d79d09d5cca586ad4cef5dac086e5a8fd438f0218e6119889d`. Parent owns integration/format/compilation. No builds, rustfmt, commits or native execution by implementation agent.
Exact requested public-to-parent Block/Band/Group/reorder API. Validates child-parent membership, complete unique band inventory, finite positive block geometry and existing undirected-bundle contiguity. Undirected connectivity is evaluated within each band, preserving existing block order within each indivisible unit; noncontiguous input fails explicitly. Directed incoming edges anchor a unit only when the target lifts into it and source does not lift into the current parent. One vote per distinct visible source placement ID, stable-ID order, f64 arithmetic mean of current absolute source centerY. Full offset ancestry and root40 are composed; parallel edges do not multiply votes.
Only anchored units exchange their previous ordinal slots, using score then canonical unit order. Unanchored unit ordinals remain fixed. Whole-band block heights/gaps are repacked as a prefix, so unequal-height units do not reuse incompatible old Y slots. X, sizes, SCC memberships/ranks, perimeter/member offsets and root layout are untouched. Every member's offset receives its block Y delta; descendants move by ancestor composition rather than duplicate direct edits.
A group is active only if some band contains at least two anchored units. Dependency H→G exists whenever active groupH owns any offset on an actual external source's complete ancestor chain. No additional ancestry-only arcs. Stable parent-ID order feeds SCC condensation; process the dependency DAG once. Every score in one dependency SCC is snapshotted before any member's offset updates. Cycles are therefore a one-pass snapshot heuristic, not a fixed point or a stability guarantee.
Prefix accumulation is f64; conversion and occupied-envelope agreement are checked with explicit0.001units tolerance. Existing canonical prefix positions must also agree within that tolerance. Unchanged orders retain their original f32 positions exactly. No envelope resizing occurs; parent final reprojection remains authoritative. Missing/cyclic/nonfinite structures and excessive charged work return errors. The enclosing candidate owns the private scratch offsets, so it must discard them on failure; this helper does not promise transactional rollback of mutable arguments after an error.
Diagnostics include active parent IDs, dependency edges with source/ancestor witnesses, dependency SCCs/cyclic status, before/after block orders, source-owner sets, actual edge hints, scores, changed units/blocks and tolerance. Pure unrun tests cover anchored sorting with a fixed unanchored ordinal, heterogeneous100/20height repacking, and a source center changing under a grandparent offset. Parent's actual fixtures must test dependency chains/opposition, node/route preservation, repeat behavior and quality; no acceptance is inferred from implementation.
Pre-build review follow-up: module SHA256 `77522e22daf4058a07aafe6b246211bf652d9fc99e2a556cf9f8b20c297eaf0e`. Absolute source Y now follows the final plan's precise f32 order (own offset, ancestors upward, then+40); convert that Y to f64 before adding half-height and averaging votes. Member-offset updates reject actual f32 movement differing from requested delta by more than0.001. Added three unrun tests: actual reorder dependency on a grandparent-owned offset with adversarial parent-ID ordering; actual undirected bundle preservation around an unanchored ordinal with heterogeneous heights and deduplicated sources; noninteger f32 composition plus accepted/rejected translation precision. Six module tests now exist. No policy constants, corpus outcomes or rank/packing heuristics were tuned.
## Parent acceptance addendum
Final tested source3e21c1bca245944ae0ec7bb02aaa920f45f2cc30 corrects full member displacement precision (including origin subtraction), with the real large-origin packing regression. Focused example tests15pass, strict Clippy and optimized Windows build pass with unchanged inputs (gates29–31). Prior gates27–28 at42f595a5 retain14tests/Clippy success. All20candidate outcomes supported inrun01; eightcontrols exact. Result/conservation/native reviews define quality limits; no production adoption.