8.3 KiB
Measured Scenario labels: next integration seam
Read-only findings against 68a81c3f50d846e34cae96090979543878514c1e, 2026-09-13. The parent selected this sequencing: preserve existing short32 paint/usage agreement during the saved-workspace identity increment; explicitly retain the long-label and heuristic-band limitation. Integrate measured labels in a separate gate using actual Scene geometry, corridor policy and destination measurement context. This note adds no implementation or acceptance claim.
Current contract and smallest coherent change
Widening saved lanes alone cannot reveal long names. Production behavior.rs still caps Line::label_bounds at 225 (line 1164), duplicates the heuristic for hit-testing (1773) and backplates (2113), and paints short(&l.label, 32) (2204). scenario/usage.rs independently models that 32-grapheme policy at 7-22 and derives operation-field visibility at 94-137.
The smallest coherent measured integration is a label preparation pass on the actual resolved Scene, after lifecycle/activation endpoint alignment and after selecting the actual camera scale. Each labelled occurrence needs one prepared artifact: displayed text, original-source field spans, text position, backplate/hit rectangle and measurement context. Paint, hit-testing and operation usage must consume it. Replace every heuristic copy together; preserve exact-call operation resolution for Replies and existing arrow/activation hit precedence. A label hit rectangle must not steal an adjacent activation's exposed shoulder.
Do not introduce a geometry → Fit → measurement → geometry cycle. scenario_layout.rs consumes label_bounds() for footprints at 146 and final bounds at 794. Replacing that method with zoom-dependent text measurements inside structural planning would make camera and geometry depend on each other. Define finite structural label bands first and require prepared text/backplates to remain inside them. Structural scope and camera bounds must not depend on the currently truncated string. A self-label band that extends content bounds must contribute its finite structural extent before Fit. Oversized vertical metrics need an explicit outcome; do not silently redesign row heights in this slice.
Available primitives and their limits
The unwired scenario_label.rs measures with Iced's actual text allocator/font system, style and scaled text size. Label guards render-session identity, font Version and exact zoom. retains_any maps retained text through whitespace normalization and grapheme truncation back to original-source ranges; use those ranges rather than repeating an independent prefix-length estimate. The candidate measures advances, not raster ink, and does not guarantee the globally longest fitting prefix under nonmonotone contextual shaping.
Cache::resolve is intended to survive Scene rebuilds through per-live-occurrence ownership, keyed by representation and occurrence. Its two recent entries are not a two-entry global Scene cache. No production frame-time or large-model cache result has been established. Headless measurement can contend for the global font-system lock; do not move all-view shaping onto the UI path without a bounded evaluator.
The unwired corridor.rs selects one widest connected clear interval after padded blockers, with deterministic ties. It does not infer the structural band, self-message policy, blocker padding or raster containment.
Settled fonts remain an experimental contract: Iced's WGPU text-cache key omits font Version. Rejecting stale Label artifacts cannot repair the renderer's old glyph buffers after dynamic font loading. Establish the font session only after fonts settle and a fresh renderer/cache exists; forbid font changes through actual draw. A check just before fill_text is not atomic against concurrent loading. Production startup/session ownership still needs explicit integration.
Inactive destination measurement is unresolved
app/diagram_usages.rs:57-60 constructs a default Scenario state in its lookup worker. It has neither the destination camera nor a settled rendering session. Text measurement itself needs no WGPU renderer, but paint agreement requires the same font environment, style, corridor and zoom. The current document/revision stamp alone cannot establish font/zoom freshness.
Two concrete candidates remain:
- Measure inactive destinations at an explicit readable navigation zoom and actually enter at that zoom; first viewport arrival adjusts pan without silently changing scale. This is smaller but changes navigation camera policy.
- Collect structural candidates first, then measure/revalidate label-dependent membership against the destination display context before presenting or activating it. This preserves adaptive camera behavior but adds asynchronous states.
Measuring at 1x and painting later at an independently fitted scale is not agreement. This note does not select either policy or allow an approximation disconnected from paint. Saved identity and automatic-fallback geometry provenance must remain distinct through either approach.
Remaining corridor decisions and evaluator
- Ordinary/reversed messages can share a band between finalized endpoint positions; text direction need not follow arrow direction.
- Self messages have no inter-lane gap. Specify a finite structural label band; viewport width or an unlimited extension is not justified by current evidence.
- Exercise intermediate activations, fragment headers, adjacent labels and completely blocked corridors. If labels become blockers, avoid an unspecified order-dependent placement loop.
- Corridors at or below the six-unit reserve need a truthful empty/truncated outcome and source/inspection access. Font metrics exceeding the fixed vertical band need an explicit outcome too.
Reuse the published inset evidence without broadening it: 32 valid rendering probes, zero candidate findings, but 12 cases whose actual ink exceeded layout advances. True corridors 160/760 retained a three-world-unit horizontal inset on each side. The declared pixel oracle included a one-physical-pixel halo. These results do not prove universal ink containment or a universal three-unit overhang bound. The original uninset policy's eight italic failures remain separate rejection evidence.
Those probes used (zoom,DPI) values (0.65,1), (1,1), (1.75,1), (1,1.5). They did not exercise the extremely small Fit scales now required by widely spaced saved lanes, actual Scene activation/frame interactions, self/reversed corridor choice, production cache performance, native application behavior or Linux. Existing font coverage controls are not complete portable font-file provenance.
The next gate should compare actual Scene paint, hits and operation membership together: widen a lane until a previously hidden operation becomes visible; test reversed/self messages and blockers; invalidate font/zoom artifacts; exercise extreme Fit. Preserve the real Frame::fill_text transform and inspect pixels instead of treating advances as ink. Until that gate passes, saved-workspace acceptance must retain the long-label limitation.
No further research, production/plan edits, compiler or native execution was performed for this save. The parent owns synthesis and eventual links into existing label evidence/design.