`WOW_UI_VERBS=1` over the hover bench answered it in one line: the rebuilt frame's
cost was **`frame:GetLeft`, 3 calls at 2188 us each — 6.56 of the 6.6 ms** —
inside `UIParent:OnUpdate`. `GetLeft` forces a resolve, and each of those
resolves was a whole-graph derivation of ~19,000 frames and ~44,000 regions,
because `Model::frame_id` gave up naming the graph on every mint. OctoPawn mints
two frames on every `GameTooltip` OnShow purely to own a one-shot `OnUpdate` —
the 1.12 way to write `C_Timer.After` — so a raise dirtied the graph twice and
the three `GetLeft`s each paid for it.
A just-minted frame is now **appended to the cached graph as a leaf**
(`LayoutScope::append_frame_leaf`). Sound because the id was minted this instant,
so no anchor anywhere can name it: nothing cached reads the new node and no
cached edge moves. What it reads is its own anchors' targets, which the append is
handed — a mint is not always a creation, since `frame_id` mints on the first
*fetch* too, and a frame built in Rust (a nameplate, a chat bubble) is first
fetched when Lua asks for its wrapper with its anchors long written. `last` stays
`NO_NODE` so the incremental seed sees the hash move; `commit_incremental` counts
the slot, which keeps the next full pass's `matched != last_count` node-death test
honest. Refused when the frame already carries regions: a region is a graph node
without needing a minted id — the derivation mints region ids inside its own walk
— so only a derivation can add those rows.
**Measured, same bench, same interface: the rebuild costs -0.08 ms/frame under
forty churning plates and +0.14 ms with none up, from 6.63 and 6.78.** The
rebuilt windows now report no derivation sites at all.
Two things about how this was found, both in the bench's doc now:
- Its own earlier conclusion was that the cost was "the plate's line walk and the
hooks hanging off it, flat, and not the graph it dirties", because the crowded
and the empty shape cost the same. They cost the same because **both** were
paying the full derivation. A fair experiment that was blind to its own answer,
and one env var would have named it.
- `WOW_LAYOUT_VERIFY` over the real interface is red on this change — and it is
the documented pre-existing 48-region shortfall, reproduced identically with
the whole change stashed: `frames 13544 -> 13544, regions 29481 -> 29529`
either way. All 2069 benilla-ui tests pass, and they run that verifier forced
on after every resolve.
189 workspace failures, unchanged, no regressions.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn