Files
ARCADIA-Studio/harness/experiments/diagram-resize-foundation-20260912/inverse-report.md
T

14 KiB
Raw Blame History

Eight-handle inverse-resize experiment — 2026-09-12

Owner: delegated geometry experiment; root retains Gitea issue 16, native access and integration. After the initial source/report handoff, root granted this agent a serialized standalone-rustc reader lease. The agent fixed the probe's unused diagnostic field, compiled and ran it through root's identified-input helpers, and released that lease. Only .local experiment material/receipts were written; no tracked project/build inputs, Gitea or native application were changed. The prescribed build helper performs a read-only HEAD lookup and verifies the core/configuration input hashes.

Verified premise and current evidence boundary

Root compiled and ran the earlier actual-core falsifier at 42511f0. Receipts: .local/native-qa/resize-probe-42511f0/{build,projection}.{json,log}. The normalization counterexample, minimally authored E shrink, manual-anchor repeat and valid below-preferred-minimum card all passed. In particular, stored 224×160 projects to 224×232; storing that visible size projects to 232×232; storing 214×160 realizes the desired E shrink to 214×232.

The inverse-planner probe compiled with -D warnings and passed both its default and --oracle runs. Exact evidence is recorded below. Its initial source comments describing the unexecuted draft are superseded by these receipts; the tested source bytes were retained unchanged after compilation. It imports only oa_core; no Cargo target or production module was needed. These are bounded experiment results, not full resize-feature acceptance.

Executed results and exact identity

Receipts: .local/native-qa/resize-inverse-r1-42511f0/{build,default-env,oracle}.{json,log}. Core/configuration/lock inputs match 42511f0f8ae46f29e11ae18c1030face654c2994; the helper recorded concurrent current HEAD f7d84faf30cdb5e3695c2dc16ee0a5f2eac91e71, whose desktop changes are not covered by this core experiment.

Artifact SHA-256
.local/diagram-resize-inverse-probe-20260912.rs 7686a82dd843d6f546ac584b6669f74d1b59ac6282e94a2845e02e8b21704c3c
target/debug/deps/liboa_core-145180297aa692e4.rlib d395dbe1f761d41bce3cb850f44cdc0343b0db172bd03abf89e455c44f4b7e86
.local/native-qa/resize-inverse-r1-42511f0/resize-inverse-r1-42511f0.exe 5e4eef070d016244f19302b03818c96737d2cfd08280ec900399ea1c6759cbd2

Root's initial build failed because ResultPlan.requested was only used by derived Debug. The fix made it meaningful: Exact results assert requested==offered, and each operation prints both rectangles. The successful compile took about4.16 seconds. The first launch omitted the toolchain environment in its new shell and exited before main with3221225781; its default.json/log are preserved. Reloading .local/toolchain/env.ps1 fixed runtime DLL resolution. Neither failure was suppressed or counted as a successful geometry run.

The default run passed in2353ms measured inside the probe. Its576 requests produced326 Exact/NoChange,118 StaticMinimum,48 Unresolved and84 Ineligible. All48 unresolved requests belonged to the two port fixtures (24 of48 each). All static fixtures resolved; the84 ineligible requests were the folded parent's36 vertical/corner cases and the fixed symbol's48 cases. Every successful plan used finite seeds: none needed residual corrections, and the largest observed accepted seed cost was5 projections.

The --oracle run passed in45075ms including the default cases. Its14 grids evaluated 52,622 candidates, with individual searches taking1.503–5.777 seconds during the shared native session. There were zero feasible grid witnesses missed by the planner. For both automatic and manual anchors, E−10, E+8, SE(+10,+10) and NW(−10,−10) had witnesses; W+10, N−10 and S−10 had none. These timings are debug-probe observations on the small fixture, not large-model UI benchmarks. The oracle was run once and no unrelated process was interrupted.

Reproduction under root's reader lease, with a fresh output label rather than overwriting receipts:

. .local/toolchain/env.ps1
& 'C:\Users\User\.cache\codex-runtimes\codex-primary-runtime\dependencies\python\python.exe' .local/build-delete-probe.py 42511f0f8ae46f29e11ae18c1030face654c2994 UNIQUE_LABEL .local/diagram-resize-inverse-probe-20260912.rs
& 'C:\Users\User\.cache\codex-runtimes\codex-primary-runtime\dependencies\python\python.exe' .local/run-delete-probe.py UNIQUE_LABEL default
& 'C:\Users\User\.cache\codex-runtimes\codex-primary-runtime\dependencies\python\python.exe' .local/run-delete-probe.py UNIQUE_LABEL oracle --oracle

The final command is appropriate only after default passes and native responsiveness permits the roughly45-second bounded search. Toolchain environment must be loaded in each fresh shell.

Question and candidate

Can a small inverse planner realize ordinary eight-handle frame resizing without copying the entire visible rectangle into authored storage, introducing a second port algorithm or silently moving fixed edges?

The candidate keeps the original selected placement and its full projected press-time rectangle. Every pointer request derives from that baseline. It computes desired moving edges, applies the preferred UI minimum on active axes only, and evaluates alternative authored intervals through the existing actual projector. It accepts a candidate only when the entire selected projected rectangle equals the target, including every opposite edge and inactive axis.

Per-axis authored candidates are deliberately small:

  1. Apply the visible edge delta to the original authored interval, retaining any latent difference between authored and projected geometry.
  2. Set moving authored edges to their requested positions while retaining the opposite original authored edge.
  3. Use the desired visible interval.
  4. Mix desired and original endpoints, then retain the original interval as a final candidate if the other axis alone can cause the target projection.

Inactive axes try the exact original interval first, followed by normalization/mixed alternatives. This is necessary: retaining height160 realizes the verified E shrink; normalizing height232 may be necessary when a wider A changes automatic port side and would otherwise lose the inactive visible height232. The finite Cartesian product has at most 24 seeds for a side or 36 for a corner before de-duplication.

If the seeds miss, the probe tries up to six inverse residual corrections per seed: add target-minus-observed projected origin and extent errors to the authored fields, then reproject. Record de-duplication prevents cycles. This is explicitly a heuristic search, not a convergence theorem. A failed or exhausted search returns Unresolved, never “minimum reached.”

Constraints and observable outcomes

  • Exact zero motion returns the original NodePlacement, including latent authored floors. A target clamped back to the original visible rectangle also retains the original record.
  • The 184×94 preferred UI floor is grandfathered per active axis with min(baseline_visible_extent, preferred_floor). Dedicated state hard width/header constraints remain stronger. Inactive axes do not acquire a new preferred floor.
  • With no visible ports, static direct-child envelopes and state headers provide proven target clamps. The probe mirrors existing 24-unit side/footer and ordinary 64-unit header constants for this isolated comparison. A production implementation should extract these shared facts from core rather than maintain the duplicate policy.
  • Any visible port conservatively marks the scene dynamic; the probe then does not claim the baseline child envelope is a fixed hard minimum. Actual projection remains the acceptance evaluator.
  • Folded rectangles admit W/E only and always preserve original expanded height and authored y. Fixed state symbols reject rectangular resize handles; other dedicated state rectangles use the same planner.
  • The five outcome classes are Exact, StaticMinimum, NoChange, Unresolved and Ineligible. StaticMinimum means the declared preferred/state/static-content policy clamped the target, not that numerical search proved a global geometric optimum.
  • Every accepted plan is prepared through actual EditNode, restored back to the baseline to assert that only the selected record changed, and reprojected to compare the complete preview scene with the committed candidate scene. Exact original no-op and folded-height preservation have additional assertions.
  • Finite/positive/coordinate-bounded authored geometry is required before projection. Equality is exact f32 equality in this experiment, using representative integer/quarter-unit fixtures; no broad epsilon hides drift.

Evaluators

The normal run exercises 12 fixtures, each across all eight handles and six baseline-derived requests (zero, grow, shrink, cross/clamp, reverse/grow and identical shrink repeat). Static fixtures must not return Unresolved. Explicitly ineligible folded vertical/fixed-symbol cases are checked without pretending those shapes have eight handles.

Fixtures cover an off-grid leaf, valid 100×50 leaf, automatically enclosed allocation-summary container with displaced authored origin, roomy container, folded parent with hidden descendants, folded child inside an expanded container, State with entry annotation/internal-transition header and nested content/boundary symbols, Region, Machine, fixed EntryPoint, automatic port counterexample and its manual-anchor variant. The full-project equality check protects stored descendants, allocations, IDs, anchors and other records.

--oracle adds seven requests for each automatic/manual port fixture: E shrink, E growth across the side-change threshold, W shrink, N growth, S shrink, SE growth and NW growth. For each it exhaustively enumerates the stated finite domain: target authored origin, even authored widths from84 through target width, and even authored heights from132 through target height. It searches the whole domain even after finding a witness, records call/time counts and fails if the finite oracle finds a feasible candidate missed by the planner. Accepted candidates in these fixtures must also have a witness in that domain.

This is exhaustive within that declared lattice, not all finite f32 geometry, other authored origins, other diagrams or arbitrary model sizes. A negative oracle result does not prove global infeasibility. A positive witness is a concrete falsifier of a failed candidate plan. The probe prints witnesses and unresolved counts; a final bounded-experiment PASS does not imply all dynamic requests were resolved.

Interpretation and next decision

The confirmed E-shrink regression is now Exact with stored214×160, and every eligible static request resolved. Dynamic failures remain substantial. The finite oracle confirmed no witness for the selected W/N/S requests in its domain. For this particular fixture, source-level geometry also explains why those three targets cannot be realized by a different authored size:

  • N−10, visible (0,−10),224×242: to obtain width224, authored width must224, because the other width-producing thresholds are84 and232. To obtain height242, authored height must242, greater than the semantic160 and automatic232 floors. That unique pre-choice geometry faces Top and forces width232, contradicting224.
  • W+10, visible (10,0),214×232: authored width must214 for the same reason. Pre-choice height is at least160. The peer-facing comparison is dx=13/214≈.06075, while abs(dy)=abs(70/height−.5)≥.0625 for every height≥160. All eight choose Top and force width232, contradicting214.
  • S−10, visible224×222: all eight ports share the same peer center and clear exits, so they choose the same side. That side requires232 on either height or width; both desired extents are below232.

These arguments apply to the specific nonoverlapping same-peer fixture and its manual-anchor variant, not arbitrary models. Manual anchors do not help because the current capacity pass deliberately counts automatic choices independently of authored anchors. Actual default output also shows nonmonotone north growth: N−30 was unresolved while N−60 was Exact. An iteration-cap increase cannot repair a rectangle the projector cannot realize.

The passed bounded static and finite-oracle gates establish a small foundation for the production planner: baseline records, authored-interval alternatives, exact shared projection evaluation, explicit typed outcomes and one atomic record edit. They do not justify shipping these dynamic refusals as finished UX. A core port-capacity policy decision is necessary for the full ergonomic eight-handle objective, rather than treating every refusal as a user-facing minimum.

Production integration should reuse the candidate architecture but not blindly promote its six-step cap, global dynamic detection or duplicated core constants. The residual loop delivered no accepted case in this experiment; retain it only if a new concrete fixture justifies it. The next bounded design comparison should challenge the projection policy itself: how to retain readable port spacing and authored anchors while making owner extents predictable under resize, versus the present geometry-dependent capacity enlargement. Alternatives such as constrained automatic side placement or controlled spacing degradation need their own routing/readability evidence; this experiment does not select one. Do not silently persist formerly automatic anchors, apply worst-case capacities to every card, or weaken fixed-edge invariants to make the test pass.

This experiment does not claim source bundle/trivia/API transport, undo lifecycle, routing readability, control arbitration, native UX, performance on large models or Linux verification. Those remain downstream gates of the complete eight-handle feature rather than reasons to reduce it to E/S/SE.