Files
ARCADIA-Studio/harness/experiments/wrapped-label-20261001/alternatives.md
T

13 KiB

Issue 38: bounded label-generator alternatives

Local-only feasibility study; root owns synthesis. Source baseline is the original saved full twelve-relation geometry in .local/native-reading/manual/geometry-before.json, not a simplified view. The existing-generator feasibility result is separately confirmed by the Rust probe at source 70cf and published in packet 45bfb63b; this note does not rerun or replace that evidence. Candidate B's fresh native evaluation is still independent and its outcome is not assumed here.

Only this report was written. No production/probe changes, compiler, native GUI, or Gitea actions. All alternative results below are read-only JavaScript double-precision rectangle/orthogonal-segment arithmetic over the saved JSON. They are feasible geometric witnesses, not fresh reading passes or production implementation recommendations.

Fixed requirements and arithmetic

Keep all twelve paths, cards, semantic identities/endpoints/ports, other displayed labels, and authored fields exact. Change only the automatic conversation label's derived position and, for explicitly identified alternatives, its visual line wrapping. The semantic string remains Technician service conversation throughout. The conversation ID is 63009b5f-539e-5914-b630-ec6b7fefb4d5.

Use full flat card rectangles inflated by 12, other nonempty label rectangles inflated by 4, and candidate label rectangle inflated by 3 for stroke intersection checks. Own/foreign clearances below are shortest distances from the uninflated label rectangle to the respective routes. Foreign routes retain semantic identity, including coincident portions. These conventions match the bounded probe's geometry assumptions; they do not establish a perceptual threshold.

The original label is 233 x 24, centered (1296.5,274.5). It intersects foreign allocation sa_repair_allocation at x1312.5, y179..325. Its own vertical route is x1162, y89.5..316.5. Other foreign verticals at x1065 and x1071 bound the space to its left. The foreign allocation also runs horizontally at y325, which matters for taller labels.

For multiline witnesses only, assume unchanged font size 13, line advance 16, and padding consistent with the existing 24-high one-line box: height = 8 + 16 * line_count; width = 16 + 7 * longest_line_character_count. These are explicit experimental dimensions. Production typography must use actual rendered line metrics and then recheck geometry; replacing exact semantic text with a shortened name is excluded.

Actual witnesses

Every row below has zero node, foreign-stroke, and other-label collisions under the declared margins. All boxes stay inside the original whole-scene node extents, so their union cannot enlarge Fit bounds. Whole-scene Fit would remain geometrically unchanged under these fixed paths and cards.

Alternative Center; size Own stroke intersections Own / foreign clearance Center displacement from baseline
D. Dynamic single-line corridor placement, permit own backing (1191.75,274.5); 233 x 24 1 0 / 4.25 104.75
E. Two lines centered on own route, permit own backing (1162,274.5); 142 x 40 1 0 / 20 134.5
F. Three lines beside own route, keep every stroke clear (1230,254.2); 100 x 56 0 18 / 32.5 about 69.53

D bounds: x1075.25..1308.25, y262.5..286.5. Own vertical x1162 passes through the box. The nearest foreign lines are x1071 and x1312.5, 4.25 units away on either side. A minimum-movement variant centered at (1193,274.5) moves 103.5 units but leaves only 3 units to the allocation. D's balanced witness maximizes horizontal clearance within this narrow corridor; its 4.25-unit clearance is only about 2.2 pixels at Fit. Collision freedom therefore does not imply good association or legibility. A grid enumeration at 0.5-unit steps over x950..1470/y180..340 found the minimum-movement variant above, but this bounded grid is not a global optimum proof and is not a suggested production algorithm.

E wraps as Technician service / conversation; longest line is 18 characters, yielding width 142. Bounds are x1091..1233, y254.5..294.5. Own stroke is centered beneath the opaque backing; the closest foreign stroke is x1071, 20 units away. The box intentionally hides a 40-unit own-route interval, about 20.6 screen pixels at Fit. This may create clear line-label association through aligned entering/exiting segments, or may make the path look broken. Geometry cannot decide which. It moves farther than D but gains substantial foreign clearance and uses only two text lines.

F wraps as Technician / service / conversation; longest line is 12 characters, yielding width 100. Bounds are x1180..1280, y226.2..282.2. Its own anchor can use the already-existing fraction .55, which is approximately (1162,254.2); the existing right-offset formula for the narrower box gives +68. The label is 18 units right of its own vertical path, 32.5 units left of the allocation vertical, and 42.8 above the allocation horizontal. It adds no strokes and obscures no route. It does increase label height from 24 to 56 (about 12.4 to 28.9 screen pixels at Fit), at the same small font size. The geometric own-versus-foreign clearance margin is 14.5 units, about 7.5 pixels; it is an evaluator observation, not a validated scoring threshold.

F at the original .5 fraction is also collision-free: center (1230,274.5), same width/height, displacement 66.5. However, its bottom lies 22.5 units above the allocation horizontal, leaving only 4.5 units of own-versus-foreign distance advantage. Thus a first-zero-collision chooser can still pick a perceptually weaker candidate even after wrapping. The .55 witness improves that geometry without introducing a new fraction generator.

Materially different definitions

D: dynamic free-interval generation, unchanged text shape, changed own-stroke objective. For a bounded set of existing route fractions, take candidate label y positions from the existing offsets. Subtract forbidden horizontal center intervals induced by padded nodes, other labels, and foreign strokes that meet the candidate's vertical extent. Generate at most the nearest feasible center to the old center plus an interval midpoint; do not raster-scan the canvas. Permit covering the owning stroke only where one unique straight own segment enters and exits opposite box sides and no foreign semantic owner occupies that segment. This is a new generator and a new collision objective, not a tie-break patch. Keep node/other-label/foreign collisions hard exclusions. Use limited candidates and charged comparisons before considering any reusable spatial index.

D demonstrates that a single line can avoid the wrong allocation under a changed objective, but its narrow foreign margins weaken it as the next visual experiment. Reject the tempting minimum-movement variant as a preferred witness: it optimizes movement by hugging the wrong stroke at the collision margin. Also reject unconstrained own-stroke occlusion at turns or shared runs.

E: bounded wrapping plus on-route placement. Derive one-, two-, and three-line layouts from legal word boundaries, preserve the complete string, and measure them at the same font size. Include placement centered on a unique straight own segment as an explicit alternative. Keep all foreign strokes/cards/other labels excluded while permitting the defined own-route backing interval. Limit line count and candidate count; if a long unbreakable token cannot fit, fail this fallback rather than shrink text indefinitely or change the name. E is the smallest actual witness with materially comfortable foreign clearance and only two lines, but its intentional route interruption needs direct comparison.

F: bounded wrapping with the existing side-placement family and improved ownership comparison. For each permitted line layout, recompute its real width/height, then apply existing fractions and side-offset construction. Maintain exclusion of all strokes, including own strokes. Among feasible candidates, compare own/foreign association with displacement and wrapping cost; report these dimensions separately before accepting any scalar weighting. Prefer one-line layouts only when they also meet the experiment's association gate, not merely because they are collision-free. F is the strongest current geometric comparison if B fails: it keeps all routes visibly continuous, moves less than D/E, and has a clear own/foreign separation margin. Its tradeoff is a taller and less quickly scanned name. It requires matching multiline layout, hit/backing bounds, and SVG output; simply inserting a newline in the existing string/size formula is incorrect.

No one of D/E/F is accepted for production. A useful next native comparison would be E versus F versus baseline, using these frozen witnesses, after B's current result. D need not consume a native run unless the narrower alternatives prove unreadable or typography invalidates their feasibility.

Rejected or deferred alternatives

  • Same fixed candidates with another weight: already falsified for collision-preserving A. The new widths/objectives above are explicit departures.
  • A long horizontal-own-segment preference alone: own horizontal segments are 18, 143, 18 units. No segment accommodates the original 233-wide label. The 143-unit segment is crossed by foreign corridors at 1065/1071 and sits next to the system/repair cards. Merely moving the old label above that segment reproduces foreign/corner crowding. It can remain one candidate family, not a solution claim.
  • Move the original full-width box just outside the allocation and add a leader: local rightward placements require the leader to cross that foreign vertical; guarded B would properly suppress it. Large exterior placements add displacement and potential Fit costs. A short guard cannot repair arbitrary distant placement.
  • Minimal movement as the first objective: D's 3-unit foreign margin is the counterexample. Use movement to break ties only after meaningful ownership/clearance evidence.
  • Shorter semantic text, hidden relations, or smaller font: these evade the intended full-scene reading task. Multiline display must preserve the entire name and font size.
  • Global packing/rerouting or a new general layout API: not justified by three concrete label-only witnesses. Keep exploratory geometry separate until a reader establishes an improvement.

Policy boundaries before any whole-scene implementation

These witnesses concern one automatic label in an unnested scene. A whole-scene policy must treat authored label offsets/fractions as authoritative and must not silently wrap or move authored labels as collateral changes. All other automatic-label settlement must be inventoried, not hidden behind identical serialized fields.

Include association-end text and every visible label as obstacles. Nested/folded views require their actual label/card/header visibility rules; the flat-node arithmetic must reject or separately handle them, not silently reuse traversable route obstacles for text. Shared/partially coincident paths retain all semantic owners; an apparently own-only segment with another owner is foreign for the guard. Segment indices are zero-based windows over original points, independent of collision deduplication.

Separate fixed-path label-order permutations from full UUID-remapped reroutes, because the latter changes the evidence under the label. Keep existing gesture baseline caching; do not recompute wrap/interval packing on unchanged pointer hover. Charge extra interval/candidate scoring work and bound it on geometry rebuilds. A target label drag must commit once, preserve authored shape/anchor semantics, and remain stable across Undo/Redo, reopen, and canvas/SVG rendering. A layout policy depending continuously on zoom can cause label jumps; use zoom for evaluation first, not an automatic per-frame generator.

Explicit gates and stop rule

Before implementation, render the measured typography for E/F in an isolated experiment with frozen scene/viewport. Recheck the reported bounds and all collisions. Reject a witness if actual text exceeds the assumed box, any node/foreign/other-label collision appears, endpoints disappear from Fit, or any semantic/path/authored state changes.

Then use a reader without prior endpoint exposure: first unselected path and port-owner identification, no Inspector answer beforehand. Require the conversation's original wrong allocation association to disappear without new wrong turns on Request/Report or the port mappings; record font readability and multiline scan cost separately. For E, explicitly ask whether the path remains traceable across the label backing; for F, whether stacked words associate with the left conversation route rather than the lower/right allocation. Any need to explain the intended attachment first is a failure of this experiment, not a pass after coaching.

A positive isolated result permits considering a small production rule and its regression/latency tests; it does not close the broader full-view shared-corridor readability issue. If E/F both fail first reading, stop tuning weights around this fixture and record the failed hypotheses before choosing a different approach.