Commit Graph
1584 Commits
Author SHA1 Message Date
gromandClaude Opus 5 ada08720bb ui+docs: the GUID token's real spelling, 40-yard interact, and the whole patch map
Working down the 29 `.tdata` hooks from the realm's patched `WoW.exe`.
Most turned out to be already ported; two were wrong here, and one of
those was wrong in a way that mattered.

**The GUID token was the wrong string.** `unit::guid_token` wrote 16
lowercase hex digits and no prefix. The realm writes `0x` + 16 upper-case
digits: its formatter at `0xd06500` — which `UnitExists`'s second return
goes through — lays down `0x30 0x78` then sixteen nibbles each `+0x37`
above 9, and its parser at `0xd06650` demands the `0x` and takes upper
case only. grom's own addons agree from the other end: BigWigs decides a
string is a GUID with `string.sub(guidOrName, 1, 2) == "0x"`
(`MageTools.lua:963`), and AI_VoiceOver reads fields from position 3 and
mints its own with `format("0x%04X%06X%06X", …)`.

Same number, wrong string, and wrong where it mattered most:
`UNIT_CASTEVENT` and the aura events carry these tokens, so every such
test read our GUIDs as unit *names* and every `sub(3, …)` field read came
out two characters off. Now written the realm's way; both spellings and
either case are accepted on the way in, since refusing one buys nothing.
Pinned literally rather than by round trip — a round trip held fine
through the whole bug.

**`CheckInteractDistance` type 4 is 40 yards, not 30.** `0x48bafd` jumps
to `0xd0686c`, which tests the type against 4 and compares against the
float the section carries at `0xd06868`: `1600.0`, squared thresholds.
Stock 1.12's `900.0` is still what the other three types use.

`docs/ADDON_COMPAT.md` now carries all 39 hook sites of both sections
with a status each: 10 in `.octoql` (one feature, the quest log, ported),
and 29 in `.tdata` — the aura ids, the master looter, `UnitExists`'s
GUID, the char-create mask and `CHAT_MSG_HARDCORE` already done; the two
challenge-mode functions needing nothing, because the realm's own
`ChallengeList.lua` defines them in Lua for exactly our case; four read
but unported with the reason (unnamed struct fields, no consumer in the
corpus); and three that cannot apply to a client that loads no DLLs.

Also `scripts/dll-surface.py`, which asks the injected DLLs the same
question. Their export tables are one `DllMain` each, but a DLL that
registers a Lua function must point at the name: collecting NUL-delimited
identifier strings the image holds a pointer to cuts `ClassicAPI.dll`
from 2872 CamelCase candidates to 706, and subtracting the 1.12 census,
Lua's own names and benilla's real surface leaves a candidate list the
addon corpus can rank. It is a list to read, not a specification —
statically linked libraries contribute their own strings, and
`UnitXP_SP3.dll` yields nothing. It found 38 names in `nampower.dll` that
grom's addons call and this file did not know about; they are written
down rather than guessed at.

269 data-gated failures, identical to the baseline, all nine gates green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-23 19:57:26 -06:00
gromandClaude Opus 5 cae59cdc11 app+protocol: fire CHAT_MSG_HARDCORE, the realm's own chat type
`reference_ui`'s `UNPRODUCED` carried `CHAT_MSG_HARDCORE` as a chain
event nothing here fires: the window registered for it and benilla
routed no such message, so the realm's hardcore-death broadcasts simply
never arrived. Three of grom's addons listen for it too.

The missing piece was one number, and the realm's patched `WoW.exe` has
it in the PE section it names `.tdata`, beside the string `"HARDCORE"`
at `0xd06000`. Two detours do the whole job: `0x49f7aa`, in the chat
type-name lookup, jumps to `0xd06020`, which sets the name pointer to
that string and the type to `$0x5e`; and `0x49b193`, inside the
`CHAT_MSG_*` fire helper `0x49b0b0` whose format string this file
already cites, jumps to `0xd06040`, which tests the type against
`$0x5e` and swaps in the event-name index `0x21f`.

So wire type `0x5E` is `ChatEventKind::Hardcore`. Nothing in 1.12 claims
it — its last type is `CHAT_MSG_BATTLEGROUND_LEADER` at `0x5D` and its
`CHAT_MSG_BG_SYSTEM_*` block sits at `0x52`-`0x54` — so there is no
collision to arbitrate, and the test pins that adjacency along with the
decode, since a wrong id would look exactly like the silence it
replaces. The chain's `ChatFrame.xml` registers the event and its
`GlobalStrings.lua` has the `[Hardcore] %s: ` format, so the window
needed nothing from us but the fire; it takes the window's default
colour, as `FILTERED` does, the realm adding no `ChatTypeInfo` row.

Not covered: sending. The ruRU locale carries `SLASH_HARDCORE1 = "/h"`
and `CHAT_HARDCORE_SEND` where enUS has only the receive format, so the
send side needs its own look.

269 data-gated failures, identical to the baseline, all nine gates green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-23 19:27:36 -06:00
gromandClaude Opus 5 56bdd15cfe protocol: read the realm's quest-log slots 21-25
The offsets came out of the realm's own patched `WoW.exe`, which carries
the patch in a PE section it names `.octoql` — 488 bytes used of 20 KB
at VA 0xd26000. `GetNumQuestLogEntries` (0x4df8b0, from
`reference/1.12-shapes.tsv`) begins `jmp 0xd26145`, and the routine the
detour calls at 0xd26000 is the entire contract in eight instructions:
slot against 20, 12 bytes per slot, `+0x28` for the first twenty and
`+0x10C8` for the next five, against the same `%edx`, with a `cmp $0x5`
that is the 25 the realm's Lua also declares.

Both arms index one dword array, so the step between the blocks is
`(0x10C8 - 0x28) / 4` = 1064 and slot 20 is field 198 + 1064 = 1262.
That checks out twice independently: 198 × 4 = 0x318, so `%edx` is the
field array plus 188 dwords, which is exactly `UNIT_END` — the player
block's own base, with `0x28` as slot 0 inside it; and 1262 is
`PLAYER_FIELD_COMBAT_RATING_1`, 1.12's dead twenty-field block, which is
what their `QuestLogFrame.lua` says in prose. Five slots take 15 of
those 20 fields, which is also exactly the run the detour's own
change-poll walks (`cmp $0xf`) before calling the client's
quest-log-changed path itself, those fields raising nothing.

`player_quest_log_field` holds both blocks and every caller already
iterates `0..PLAYER_QUEST_LOG_SLOTS`, so the quest log, the markers and
the probes pick the five up unchanged. The test pins each boundary and
the 1064 step against the disassembly, because every number here came
off a listing and a one-field slip reads a neighbour's counters.

Stated in the doc rather than guarded: a server that wrote real combat
ratings there would show slot 21 as a phantom quest. None does — the
block is dead in 1.12 and vmangos never writes it — and gating this
would mean asking the interface what the protocol should parse.

269 data-gated failures, identical to the baseline, all nine gates green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-23 18:16:02 -06:00
gromandClaude Opus 5 02e6fc4208 formats+app: a stale snapshot archive mounts below the realm's patches
grom is keeping `patch-A.mpq` — it is almost certainly textures — so the
shadowing it causes is handled in the chain instead of on his disk.

`mount_order` stays the reference's law, letter above digit and all, and
`demote_stale_snapshots` runs after it: an archive whose `FrameXML.toc`
is a **strict subset** of another's is an earlier edition of the realm's
manifest, so it mounts just below the patch set — above `patch.MPQ` and
the base archives, so anything only it carries still resolves. A toc
that differs by *removal* is a different manifest rather than an older
one and is left exactly where its name puts it. `WOW_CHAIN_DEMOTE=0`
keeps the reference's order for comparison.

On his install `patch-A.mpq` (Aug 7) now loses to `patch-5.mpq`, so the
realm's current data is what loads: its `FrameXML.toc`, its
`GlobalStrings.lua` and a `Spell.dbc` with **28019** rows against the
27992 his last session reported — 27 spells the update added that were
invisible.

Reading the realm's real files then broke ten tests, all of which had
pinned August's behaviour, and each is now pinned the realm's way:

- `AIOHandlers.lua` claimed the `OctoRadio` block as a no-op on the
  evidence that the radio file carried no AIO call. The update built the
  radio out into a file twice the size whose `RegisterNowPlayingFeed`
  registers that name at `VARIABLES_LOADED`, and `AIO.RegisterEvent`
  asserts on a duplicate, so our shim raised through seven tests. The
  row is gone, and the shim now claims at `PLAYER_LOGIN` through `pcall`
  so a realm that implements one of these takes the name and we step
  aside. `no_aio_block_we_shim_is_one_the_realm_now_handles` fails a row
  the realm has implemented — verified by putting `OctoRadio` back.
- `BATTLEFIELDS_CLOSED` no longer hides the battlefield list, by the
  realm's decision: the server stamps `SMSG_BATTLEFIELD_LIST`'s
  battlemaster guid with the player's own, so the client anchors the
  window to the spot it opened and closes it when you step away, on foot
  or on a boat (bug tracker #330 and its follow-up). Pinned that way,
  with the close button proving the list still closes.
- `MAX_QUESTLOG_QUESTS` is 25, not 1.12's 20. The test reads the realm's
  global now, so the next bump is data and not a failure.
- The realm's `OctoQuestLogPoller` redraws the log every 0.2 s, which
  legitimately costs a layout gate walk. `POLLS_ON_A_TIMER` stands it
  down by name before the quiet-frame bench measures, rather than
  raising the threshold and blunting the one instrument that catches an
  every-frame writer. A timed realm handler that is not listed fails.

269 data-gated failures, identical to the baseline at HEAD name for
name, and all nine gates green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-23 17:44:21 -06:00
gromandClaude Opus 5 73bc9a9e8e app+formats: name the realm files a shadowing archive holds stale
The archive found holding an old copy of the realm's own `FrameXML.toc`
is holding an old snapshot of the realm's interface, not one old file.
`Chain::copies` answers which archives hold a name and at what size off
the hash and block tables alone, decompressing nothing, so the boot log
can now name every row of the realm's toc whose winning copy comes from
that archive while the realm's own has a different one.

On grom's install that is ten, and it is the better half of the finding:
`GlobalStrings.lua`, five `OctoLocale` files, `AIO.lua` — the client and
server's whole transport — the calendar, the challenge tips and the
radio all load as an August `patch-A.mpq` has them, because a letter
patch outranks the realm's `patch-5.mpq`. `Spell.dbc` is shadowed the
same way, 20 KB behind.

Reported and not repaired, deliberately: shadowing a file with different
content is what a patch archive is *for*, so outside the toc — where
"holds every row the winner does, plus more" is a decidable relation —
this client cannot tell a stale copy from an intended override. The real
1.12 client reads the same copies, so this is a fix on disk, and the
line is what makes it findable instead of invisible.

`richest_toc` splits the superset rule out of `realm_toc_rows` so it is
testable without client data, which is where it ships from: the winner
stands unless a shadowed copy drops nothing, a longer copy that drops a
row is passed over, and the caller is told which archive it read so it
can say so. The staleness report is checked against the real chain and
every row it names must really differ in size between the two archives,
so it cannot be noise. The 269 data-gated failures remain identical to
the baseline at HEAD, name for name.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-23 16:52:40 -06:00
gromandClaude Opus 5 eaadc9f73b app+formats: take the realm's own FrameXML list, not a curated copy of it
`benilla.toc` enumerated every interface file, so a row the realm adds
in a client update was *silently* absent: no "not found", no warning,
just a global nobody defined. That is what `/xpboost` was, and the only
way to find it was to diff two MPQ archives by hand.

The manifest now decides order and substitution, and the realm's own
`FrameXML.toc` decides membership: every row it carries that the
manifest does not name loads after it, in the chain's order, and the
boot log names them. `DECLINED` is the short list of rows this client
must not run (`StatsFrame.xml`, whose OnUpdate is the only reader of a
`GetDebugStats` we do not have), each with its reason; a row we merely
have no verb for still loads and raises where it is used, which beats
silence. `WOW_FRAMEXML_TAIL=0` opts out and says what it is leaving out.

Finding that out turned up the reason the row was missing in the first
place, which is worse and is now fixed too. `Chain::open` mounts
`patch-?.MPQ` in the reference's order — case-folded, last wins — so
`patch-A.mpq` mounts **above** `patch-5.mpq`. The realm ships its
interface in `patch-5`; this update added six rows to that toc; and the
140-row copy inside an older `patch-A.mpq` kept winning. The interface
was loading August's list of files.

So `Chain::read_all` returns every archive's copy of a name in
ascending priority, and `realm_toc_rows` reads a shadowed copy when it
holds every row the winner does *plus* more. That case is unambiguous —
nothing was removed, so nothing can be lost — and it is a packaging
accident with no intent behind it either way. A copy that disagrees by
removal is a real change of mind we cannot arbitrate: the winner stands
and the log says what was passed over. Both paths say which archive, so
the clean fix on disk is one line of log away.

Verified against grom's own install and his addon corpus: with the
`OctoXpBoost` row deleted from the manifest — tomorrow's update,
simulated — the tail finds it, resolves it to a readable chain path, and
`/xpboost` is a live slash command with a function behind it. The tail
is empty with the manifest as it stands, which is the point: the
mechanism is armed and changes nothing today.

Tests: the merge takes both lists as arguments so it runs where there is
no client data, since that is the machine where a regression in it would
otherwise skip unseen; the letter-above-digit mount order is pinned on
its own, because that fact is what cost the six rows; `read_all`'s
ordering contract is checked against a real chain; and a `DECLINED` row
that the realm stops shipping now fails as stale. The 269 data-gated
failures are the same 269, name for name, as at HEAD.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-23 16:27:03 -06:00
gromandClaude Opus 5 cf0e56a4cf ui: give the worst-call ordering test margins a stall cannot invert
`the_worst_call_is_one_calls_cost_and_not_the_mean` reads both its
orderings off a wall clock, and the margins were too thin to survive the
full suite: it failed about one run in three, on an idle box as well as a
loaded one. One of the steady handler's ten calls would pick up a ~0.9 ms
scheduler stall and overtake the spike it is meant to rank below —
`self_us` 5109 / `worst_us` 1405 against the spike's 1398 / 1361.

Twenty steady calls instead of ten raise the window cost without raising
any single call's, and an 8x spike instead of 3x puts the worst-call
margin about four times beyond the stall that broke it. Six consecutive
full-suite runs clean, then a full gate chain. The doc comment carries
the measured numbers and says to keep both ratios, since the absolute
durations are not what the test rests on.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-23 15:06:11 -06:00
gromandClaude Opus 5 9ce0fe7b3f app: load the five FrameXML rows this client update added
benilla loads its own curated `benilla.toc`, not the chain's
`FrameXML.toc`, so a row the realm adds is silently absent: no "not
found", no warning, just a missing global. grom updated the client on
2026-10-23 and `/xpboost` did nothing. The chain itself was fine — every
archive mounted, no DBC field-count mismatch, and the two sessions'
warning sets differ by two lines *fewer* after the update. The command
was simply undefined.

Diffing the chain's toc against ours found five rows, all added here in
the chain's own order:

- `OctoXpBoost`: `/xpboost`, the bonus-experience opt-out. Slash commands
  never reach the server, so it sends the server's `.xpboost` as a SAY,
  which the server runs as a command and never broadcasts. This is the
  reported bug.
- `OctoTurtleBridge`: Turtle_General's addon-message dispatcher, for the
  realm's inspect replies and `RESPONSE_PLAYER_CHALLENGES`.
- `Turtle_GroupUI` + `OctoGroupUIFix`: the compact group/raid frames and
  three fixes to them. The fix stays immediately after, as the chain has
  it; the xml pulls its own .lua and templates.
- `OctoTurtleStore`: transmog outfits and LFT presets kept on the realm
  over AIO, FrameXML having no SavedVariables.

Verified with the real data: `b_opens_the_backpack_and_shift_b_opens_every_bag`
(the only test that reads a new row's OnLoads) stays green, and the
producer gate goes from red to green with it. Through the addon harness
against grom's own corpus: `SLASH_OCTOXPBOOST1` is `/xpboost` with a
function behind it, the bridge and all nine group frames exist, no
session errors — and the group frames are hidden with no OnUpdate armed
while solo, so they cost nothing until a group fills them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-23 15:06:02 -06:00
gromandClaude Opus 5 ef7f823d9a ui: teach the producer gates the reach-reporting fire
`every_event_a_chain_file_registers_has_a_producer` finds producers by
scanning our own `.rs` for `fire_event(`, `fire_event_into(` and
`pending_events.push((` followed by a string literal. `49b4f7b5` moved
`area.rs`'s minimap fire to `fire_event_reach(`, which matches none of
them, so the gate began reporting that `Minimap.xml` listens for
`MINIMAP_ZONE_CHANGED` and nothing fires it. Both scanners here now
match that spelling too.

The break rode green through a full gate run and a commit because this
test and its sibling need `WOW_DATA`, which `scripts/gates.sh` does not
set — on a machine without the client data 1609 tests skip silently.
Found by running `WOW_DATA=<Data> cargo test -p benilla-app --lib` and
diffing the failures against a baseline at HEAD: 3 before, 2 after, and
the two that remain fail at HEAD as well.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-23 15:05:50 -06:00
gromandClaude Opus 5 d3d2103919 app: publish the world-map feed from the frame's own area
`SetMapToCurrentZone()` answers out of the `(continent, zone)` pair
`feed_world_map` pushes into the VM, because the VM cannot query the
world — the reference's resolver `0x4a6650` reads the player's area
live. That makes the schedule part of the verb's contract, and only
half of it was declared: the feed ordered `.after(UiInput)` and
nothing else, so it ran before `terrain_stream::update_current_area`
wrote the area under the player and published the previous frame's
zone.

At a crossing the feed therefore named the zone just left, `area`'s
`feed_zone_events` fired `ZONE_CHANGED_NEW_AREA` on the new one, and
both addons that answer it while the map is closed reselected where
the map already was. From grom's 03:57 log at the Ironforge gate:
`ZONE_CHANGED_NEW_AREA 10/10 handler(s) · MINIMAP_ZONE_CHANGED 8/8
handler(s) · the UI asked to follow the player 3× · WorldMapFrame
shown=Some(false)` — every handler reached, the verb called three
times, the selection unmoved. Every map-derived overlay then sits a
zone behind, `GetPlayerMapPosition` and so pfQuest's minimap pins
included, until the player opens the world map by hand (pfQuest
reselects on close), which is the workaround he reported.

Ordered after `AreaAuthoritySet`, whose own doc already required it of
every consumer of the area, and pinned by a schedule test over the
declared graph: remove the edge and it fails naming both systems.

The watchdog's zero-ask arm said "nothing has called
`SetMapToCurrentZone()` since the player crossed" through all of this.
The count was right and the window was not: it starts where this feed
first publishes the new zone, which the stale feed made *later* than
the addons' answer, so three real calls read as none. That one wrong
fork cost two sessions; the wording now names the window it measures.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-23 04:22:49 -06:00
gromandClaude Opus 5 49b4f7b55e ui+app: say what a fired event reached, and whether the UI answered
grom's stale-minimap report survived the same-interior-skip fix, and his log
says why that fix was the wrong suspect: at the gate the zone-text interior
claim reads `outdoors`, so the skip was never consulted there. The module doc
no longer claims otherwise.

What his run leaves is sharper and stranger. The election cannot have declined
— leaf 1537 → 809 "Gates of Ironforge" takes the zone from 1537 to 1 and the
subzone text with it, so both `ZONE_CHANGED_NEW_AREA` and
`MINIMAP_ZONE_CHANGED` fire — and two separate addons call
`SetMapToCurrentZone()` on those while the map is closed
(`pfQuest/map.lua:1466`, `pfUI/modules/minimap.lua:183`). Zero calls arrived,
with nothing raised anywhere in the session. Offline, against the same addons
and saved variables, both events reach every registered handler and are
answered every time, so the difference is live-only and the engine cannot
currently see which of three things it is.

So it can now. `UiScript::fire_event_reach` answers an `EventReach` — frames
registered when the dispatch began, frames whose handler ran, and the name of
the frame a cut-short walk stopped on (our documented deviation: a handler that
unregisters the walk's saved next ends the dispatch, and every later registrant
silently never hears the event). `UiScript::frame_shown` reads the shown bit
addons branch on, which no amount of engine-side logging could otherwise
explain. `fire_event` is unchanged for its nineteen callers.

`area::feed_zone_events` logs the whole handshake at each fire: what was
elected, reached/registered per event, the `SetMapToCurrentZone` delta, and
`WorldMapFrame`'s shown bit. `0/0` is nothing registered, `reached` below
`registered` is a cut-short walk, and every handler run with `0×` asked is the
guard both answerers share. `addon_harness --fire` reports the reach too.

Gates green (459 s). His corpus offline: 10/10, 8/8 and 4/4 handlers reached.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-22 20:12:03 -06:00
gromandClaude Opus 5 38fd2543b4 app: the same-interior skip must not swallow a zone change
grom's minimap report, found. Walking out through Ironforge's gate tunnel fires
no `ZONE_CHANGED_NEW_AREA`, so nothing tells pfQuest to call
`SetMapToCurrentZone()`, so `GetPlayerMapPosition` keeps projecting onto
Ironforge and every minimap pin sits wherever that lands — until the world map's
`OnShow` calls the verb itself, which is exactly "it fixes itself when I open and
close the map".

The zone updater's same-interior skip (`[0x868608]`, `[0x86860c]`) returned out
of the whole function while the player stayed inside one group of one building.
But the zone it elects on comes from the **terrain leaf**, and that can change
underneath an unbroken group: the gate tunnel spans the boundary, so the leaf
goes 1537 → 809 "Gates of Ironforge", whose zone is Dun Morogh, with the group
never changing. The election never ran, and the cache kept saying Ironforge for
as long as he stood there.

So the skip now covers the naming only: it carries the previous frame's names
forward explicitly and falls through. The texts then compare equal, so the only
thing that can elect is the zone id — which is the case that was being lost, and
nothing else changes. Three tests pin it, including the gate crossing itself and
that a different group of the same building still renames.

Read as a skip of the whole updater the reference would lose the "Dun Morogh"
splash on the way out, which it plainly does not, so this is recorded in the
module doc as a deviation chosen on that evidence rather than one traced out of
the binary. The dedup key is a separate question left open there: the doc claims
`(WMOID, MOGP uniqueID)` and the code has only the group's `WMOAreaTable` key.

Two log lines, because this was invisible from a log twice over: the zone-text
interior claim now prints on change (`sound::interior` prints the *render* claim,
a different ray, and the two disagree exactly at the aprons where it matters),
and an election that happens inside one unbroken group says so.

Measured first, against grom's own addons: `--fire ZONE_CHANGED_NEW_AREA` in the
probe harness has the loaded corpus call `SetMapToCurrentZone` 1× and move the
selection, which is what ruled the addon side out and left the client. `--fire`
is new to the harness for that.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-22 18:21:11 -06:00
gromandClaude Opus 5 9e13856cfd app: say in the log when the world map stops following the player
The stale-minimap report needs one fact: did the selection follow the player
into the new zone? Everything map-derived rests on it, because
`GetPlayerMapPosition` projects onto the **displayed** map — a selection left a
zone behind seats pfQuest's minimap pins against the wrong rect, and plausibly
rather than obviously wrong wherever two rects overlap, as Ironforge's does
inside Dun Morogh's.

The `zone:` line could not answer it even after it started printing both pairs,
because the pairs disagree constantly and mostly correctly: for a frame or two
after every crossing, since this feed publishes the new zone and the
`ZONE_CHANGED*` an addon answers by reselecting fires after it; and for as long
as the map is open on another zone, which is what browsing is. A marker on that
line would have cried wolf on both.

So the rule is its own thing, `SelectionLag::step`: an episode starts only on a
frame where the *player* moved to a zone the map is not on, and only an episode
outliving a 1 s grace is reported — once, at WARN, with the catch-up line when
something finally reselects. A selection that wanders under a standing player is
never an episode. Five tests, including the 600-frame browse that must stay
silent.

The line also forks the cause, which is the part that saves a round trip:
`UiScript::world_map_resolver_calls` counts Lua's `SetMapToCurrentZone` calls, so
the report can say whether the UI never asked to follow — the event did not reach
the addon — or asked and still landed wrong, which is the verb reading a zone the
feed had not published. Same symptom, different fixes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-22 17:20:28 -06:00
gromandClaude Opus 5 e282410938 Seat the map catalog in the harness, and print the real map selection
Two instruments, both because a diagnosis went wrong on this data today.

The zone line said "world map shows" while printing the player's *resolved*
zone, not the selection. Those are not the same fact, and conflating them cost
a whole diagnosis: GetPlayerMapPosition projects onto the **displayed** map, so
a selection sitting a zone behind is exactly what leaves every map-derived
overlay stale — and from the log it looked identical to a selection that had
followed. Both pairs are now printed, with an explicit "STALE: the map is not on
the player's zone" marker, so a plain run answers it with no flags.

The harness never seated the world-map catalog, so C_Map.GetMapWorldSize had no
rects there. pfQuest's minimap_sizes metatable caches a false per zone on a miss,
so a probe of its pin gate reported "no zone sizes" for Dun Morogh, Elwynn,
Orgrimmar, Thunder Bluff, Darnassus and Loch Modan — and the four zones that did
answer were the four whose sizes the addon still ships. Every number was real
and the conclusion was false. With the catalog seated (and the C_TaxiMap table
beside it, for the same reason) all six answer and SearchFlightNodes adds 69
nodes. seat_a_session already carried the area-name column against exactly this
fault class; this is the next feed in the same wall.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-22 07:42:33 -06:00
gromandClaude Opus 5 ce8992bc3e Draw flight masters: C_TaxiMap.GetTaxiNodesForMap over TaxiNodes.dbc
grom: "can't see flight master location marks, even tho I have them on."

Nothing was broken — the layer was silently empty. pfQuest-octo has deleted its
shipped pfDB.meta.flight table in favour of this call (db/meta.lua:181 is a stub
whose comment says the data "always comes live from the client (ClassicAPI)"),
and SearchFlightNodes opens with

    if not (C_TaxiMap and C_TaxiMap.GetTaxiNodesForMap) then return maps end

so with the namespace absent the option stays ticked, no error is raised, and no
icon is ever drawn. Same silent-by-construction shape as C_Map.GetAreas, same
consumer.

The contract is half read off the bundled ClassicAPI.dll's string pool
(C_TaxiMap, GetTaxiNodesForMap, nodeID, faction, reachable, state and the
FlightPathFaction/FlightPathState enum names) and half off the caller: the
areaID/mapX/mapY triple is not separately visible there, since the pool holds
one copy of each string and C_Map.GetAreaTriggerInfo already uses all three, so
for those SearchFlightNodes itself is the authority. It reads six fields, gates
on `node.areaID and node.mapX and node.mapY`, and feeds the pair into
pfMap:AddNode as meta.x/meta.y, which UpdateNodes divides by 100 — so they are
percentages of the zone rect. Both files say which half is which.

Faction comes from the two MountCreatureID columns, the reference's own gate
(0x4a2650 asks for the mount of the player's half): one column filled is that
faction, both is neutral, and neither means the row is not a flight master at
all — on this install those are exactly the eight Transport/Ferry/zeppelin
endpoints, and passing them on would put "Flight Master" pins on the Menethil
docks.

Attributing a node to a zone needed the file's own names. Geometry over
WorldMapArea boxes proposes — these are axis-aligned boxes around irregular
zones, so a node near a border sits inside two or three of them — but no purely
geometric rule works: "smallest box" misfiled a dozen of ~70 rows (Crossroads
under Mulgore, Aerie Peak under Alterac Mountains), and "most central box",
much better and what zones_at now sorts by, still loses Talonbranch Glade to
Darkshore by about one percent of inset. TaxiNodes.dbc names its rows
"<place>, <zone>" and a city row leads with the city, which is itself a zone, so
trying each comma-separated part against the candidates gets Ironforge over Dun
Morogh *and* Felwood over Darkshore from one rule. zones_at also reaches the
instance-map list, so Alterac Valley's two nodes place on the battleground map
instead of nowhere.

Seeded before the interface loads, after the map catalog it reads the rects
from. That deadline is tighter than file scope: pfQuest replays its saved
tracking selections once on PLAYER_ENTERING_WORLD and then unregisters every
event (database.lua:131-151), so a push one frame later is a push after the only
read.

Verified against the real addon offline, not just by unit test:
SearchFlightNodes now adds 69 nodes through the probe harness. Three tests pin
the rule against the DBC itself — the capitals and the border nodes by hand, and
every named row held to the zone its own name claims, which is the test that
rejected both earlier geometric rules. It also pins the four rows that name no
zone, three of which are this realm's own additions (Northshire Abbey and two
Darkshore canoe routes), so the next custom node shows up as a failing
assertion rather than a pin in the wrong zone.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-22 07:42:22 -06:00
gromandClaude Opus 5 f434cc9916 Survive a net entity despawned before attach's queue is applied
grom's 06:23 session died 183 s in on first world entry
(Diagnostics/crash-1792671984.txt): insert::<GroundShade> on 4431v0, "its
index now has generation 1", one frame after a 4301 ms world-entry hitch
during which the server sent a burst of creates and destroys.

The mechanism is structural, not a one-off. A command queue is applied at the
schedule's next sync point, not when the system returns, so a destroy handled
by a system that ran *earlier* in the same frame is still only queued while
attach_entity_visuals' query runs: the row looks alive, the whole visual is
built for it, and the despawn lands first at the sync point. The panicking
command form then kills the client for an entity the server had already taken
away.

So every write this system makes onto the net entity root is now a try_
command. add_child was the one that needed more than a rename: it queues its
command on the *parent*, so the conform node and RigPose::anchor_for's bone
anchors are related at spawn with ChildOf instead — the relationship hook
tolerates a missing target where a command on it does not.

The test builds a CommandQueue the way the existing rig test does, despawns the
root before applying it, and asserts the entity stays gone. It fails with
grom's exact panic text when any single write is put back, which is how I know
it bites.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-22 07:41:59 -06:00
gromandClaude Opus 5 b4a5d3b38f ui: "do I know this spell?" asks the known set, not the spellbook
Every "Already known" check read `spellbook.slots`, and
`SpellDisplay::in_spellbook` filters out `SPELL_ATTR_IS_TRADESKILL` — correctly,
since recipes live in the trade-skill window, not the spellbook. So the question
"do I know this spell?" answered **no for every crafting recipe in the game**: a
recipe item never showed its `ITEM_SPELL_KNOWN` red line, and nothing stood
between the player and consuming it a second time.

grom learned Plans: Copper Chain Vest (item 3609) twice.

`PlayerReqState` gains `known_spells`, filled from `PlayerActions::spells` —
`SMSG_INITIAL_SPELLS` plus every learn, which is the set the reference's own
check reads (`0xb700b0`). It belongs there: that struct is already "the player
state the tooltip's red lines and the usable gate compare against", already
change-gated on the action/spell inputs, and already pushed by the same feed.
Both readers move over: the taught-spell line and `item_usable_by_id`'s spell
requirement, which had the same hole.

The existing `verified_families_signable_locked_resists_known` only passed
because it made the recipe known by putting it in the spellbook, which no real
session does — it now sets the known set instead, and that is the change's own
regression story. The new test leaves the spellbook deliberately empty, which is
the real shape and what fails if the check ever reads it again; it asserts the
not-yet-learned case too, so it cannot pass by always reading red.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-21 22:17:15 -06:00
gromandClaude Opus 5 a2da3e4da7 ui: a skill lock you can open stops reading red
The GameObject tooltip's skill-lock line took the opener-*unknown* arm
unconditionally — `LOCKED_WITH_SPELL` in red — whatever the player's skill. The
known arm was simply not built, and the code said so where it was missing.

The reference forks on whether any known spell opens the slot's LockType
(`0x52abcb`): known takes `LOCKED_WITH_SPELL_KNOWN`, which carries the
requirement as a `%d` and the colour of the skill-difficulty ramp `0x529fa0`.
Built now, both halves.

grom reported it on a copper vein at Mining 70, which under the ramp is +69 over
the vein's requirement of 1 — the green rung, not the grey one he expected; grey
starts at +100, so a copper vein greys at Mining 101. Either way not red, and
red is what it showed.

The resolve is hoisted out of the `flag_locked` branch, because the "Locked"
line's colour and this line's known arm are two readings of one answer and must
not disagree with the click. `lock::skill_margin` recomputes the two numbers from
the opener the resolver already matched, with the same two functions its own
value test uses (`0x5f850f`), so hover and click cannot diverge on which opener
is in play.

Deviation, recorded at the constants: the three new rung RGBs are the standard
trade-skill palette, not values read out of the binary's table. Only the ramp's
shape is traced — five rungs, bands at +0/25/50/100 — and the rung a line lands
on is what the player reads.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-21 22:17:04 -06:00
gromandClaude Opus 5 92b2e31577 app: order the zone events after the world-map feed
`feed_zone_events` fires `ZONE_CHANGED`, `ZONE_CHANGED_NEW_AREA` and
`MINIMAP_ZONE_CHANGED` inline into the VM. pfQuest answers all three by calling
`SetMapToCurrentZone()` whenever the map is closed (`pfQuest/map.lua:1466`), and
that verb reads `worldmap.player_zone` — which `ui_world_map::feed_world_map`
publishes, in a system that was ordered only `.after(UiInput)`, exactly as this
one was. Nothing ordered the two against each other.

Run the wrong way round, `SetMapToCurrentZone()` reselects the zone the player
has just left, because the feed has not published the new one yet. Every
map-derived overlay then stays a zone behind until something else reselects —
opening the world map, say, whose `OnShow` calls the same verb a frame later
when the feed has caught up.

There is nothing to order in the reference: `SetMapToCurrentZone` calls the
resolver `0x4a6650`, which reads the player's current area live. Reading a
per-frame feed instead is ours, so the ordering is ours to state. Stated as a
set rather than a bare `.after`, since the next consumer of the published zone
will owe the same edge.

Found while chasing grom's report that pfQuest's minimap icons do not re-seat on
a zone change until the world map is opened — which is this shape. Not confirmed
as that bug's cause: it is an unpinned order, so which way it fell before this
commit is not something the logs record.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-21 21:37:12 -06:00
gromandClaude Opus 5 cd6731799b ui: memoise the texture-existence probe, as its two neighbours already are
`set_texture_probe`'s closure answers every path form of `SetTexture`, and it
was the only one of the three probes installed beside it without a cache —
`set_texture_size_probe` and `set_font_probe` both memoise, and the font one's
comment already gives the reason that applies here verbatim: a path's answer
cannot change, and an addon may ask every frame.

A miss is the expensive answer. An addon texture is never in the MPQ chain, so
both candidates fall through to `loose_addon_file`, which walks the path one
component at a time and, whenever a component's real spelling is not the
lower-cased one it was handed, enumerates that whole directory to compare
case-insensitively. `Interface\AddOns` holds 94 folders here and `pfquest` never
matches `pfQuest` on a case-sensitive filesystem, so an uncached call read that
directory twice over, on the main thread, between two systems.

grom's 2026-10-21 17:08 session priced it: `[ui-verbs]` reports
`texture:SetTexture` at **45-59 us a call across all 33 windows** — stable
enough to be a fixed charge rather than a tail — against the ~0.2 us a cached
existence answer costs. 1.75 ms a frame over 34 calls while the world map was
up, because `WorldMapFrame_Update` re-textures every overlay tile and POI on
each `WORLD_MAP_UPDATE`. Replaying the same walk over the real AddOns tree
reproduces 26-42 us for a single candidate.

Misses are cached too, as the size probe's are: an addon probing for optional
art is the common case and it is the one that pays for the walk.

This is the smaller half of the map's cost — `scrollframe.rs`' derivations were
the larger — and it is a ~1-2% of frame fix, not the dip.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-21 17:47:07 -06:00
gromandClaude Opus 5 e6ae2e0f67 ui: a scroll names the child it moved instead of giving up on the graph
`SetVerticalScroll` and `SetHorizontalScroll` called `Model::touch_layout` on
the line before `reanchor_child`. That gave up naming for the whole graph and
then *erased* the precise touch that followed: `reanchor_child` re-anchors the
scroll child through `write_anchor`, which reads an offsets-only change (same
point, same target) and names the child node — but `touch_layout_node` will not
un-say an imprecise touch, so the give-up won on every call.

Naming the child is the whole truth here. A scroll offset reaches the layout
only as that one anchor: anchor targets are ids fixed at `SetPoint`, so no edge
moves and the roster is unchanged, and the clip a scroll child draws within is
the ScrollFrame's resolved rect rather than the offset —
`clip::scroll_clip_sources` rebuilds it per call and caches nothing.

Measured on grom's 2026-10-21 17:08 session, which was a map-and-panel run.
These two lines were **472 of the run's 806 whole-graph derivations**, the
largest single source by a factor of two, and the cost lands on the Lua that
reads a frame edge afterwards rather than on the pass's own `resolve` phase:

| | n | fps | UI pass | `frame:GetLeft` |
|---|---|---|---|---|
| windows with >= 10 scroll derivations | 12 | 68.5 (min 53) | 5.93 ms/f | 2.18 ms/f |
| windows with no derivations at all | 11 | 92.4 (min 77) | 1.62 ms/f | 0.05 ms/f |

`r(scroll derivations, GetLeft us/f) = +0.907` over 57 in-play windows, against
`+0.014` for every other derivation site. `[ui-verbs]` has `frame:GetLeft` at
94-376 us a call in those windows and 0.6-1.5 us in the quiet ones, on ~14 calls
a frame, because stock FrameXML reads frame edges constantly and each read past
the clean epoch re-derived. That is why a scrolling panel — the world map, the
quest log, a profession list — was the expensive thing on screen.

The test scrolls both axes on the shipped interface and asserts zero
derivations, with a positive control so it cannot pass on a dead counter. Put
one `touch_layout` back and it reads exactly 10 for 10 scrolls.

`WOW_LAYOUT_VERIFY=1` over the real 92-addon interface gives
`frames 13379 -> 13379, regions 29597 -> 29645` — identical to the recorded
pre-existing baseline, so this narrowing introduced nothing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-21 17:46:55 -06:00
gromandClaude Opus 5 754d577eaf ui: a trade-skill list mutator signals inside its own call
`ExpandTradeSkillSubClass`, `CollapseTradeSkillSubClass`,
`SetTradeSkillSubClassFilter` and `SetTradeSkillInvSlotFilter` fire
`TRADE_SKILL_UPDATE` from inside the call now, as the one helper all four
tail-call in the reference does (`0x4fd710`, `0x4fd730`, `0x4fd750`;
`reference/1.12-verb-events.tsv`). It used to be a `trade_skill_touched` flag
drained by `ui_tradeskill::drain_trade_skill` and answered the following frame.

Inline is load-bearing. These four verbs are called *from* a
`TRADE_SKILL_UPDATE` handler: a profession library reads the recipe list by
unfolding every header, walking it and folding back what was folded. The signal
is therefore re-entrant by construction, and every addon that does it carries
its own guard — LibCraftingProfessions has `trade_skill_scan_in_progress`, ATSW
an `atsw_scans < 2` counter. Those guards are written against an inline signal
and only an inline signal lands inside the window they cover.

Deferred to the next frame it landed after the guard had cleared: the library
rescanned, the rescan called the verb, the verb re-armed the flag, and the two
kept each other alive at one fire a frame for as long as the window was open.
grom's 2026-10-21 session shows it directly — `[ui-events]` reporting
`TRADE_SKILL_UPDATE · 1.01 fires/f · ~900 call(s)` across 37 consecutive
windows, three unbroken minutes, at 0.58-0.84 ms a frame in handlers over four
addons rebuilding their lists for nothing. It is the 118-second and 61-second
stretches at 55-70 fps in a session whose in-play median was 86.

Two tests: each mutator's fire is read with its own `run` still on the stack, so
a deferred signal fails; and a library-shaped in-progress guard turns one real
update into exactly one scan, with nothing owed to a later tick.

The bench's `[events]` block also fires the five non-quest events the live
session named. They cost ~0.2-0.5 ms there against 12-72 ms live, because this
harness has no NPC in front of it, no trainer list and no open map — recorded as
a gap, not an answer.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-21 14:47:57 -06:00
gromandClaude Opus 5 e269e4dbb4 ui: name the event, not the library frame that dispatched it
`WOW_UI_EVENTS=<secs>` (`script/event_prof.rs`): per event, what one fire
costs across every handler it reaches, and which frame took the most of the
worst fire.

The gap it fills is a dispatcher. `WOW_UI_HANDLERS` keys on `(frame, script)`,
which is the right key for an `OnUpdate` and the wrong one for an `OnEvent`,
because every addon library registers *one* frame for *every* event it wants and
fans out in Lua. So the largest identifiable cost in grom's 2026-10-21 session,
eleven separate times, read as

    [ui-handlers]  312.5  312.5  0.00  72522.3  AceEvent30Frame:OnEvent

— a true row that names a library's shared frame and no addon, no event and no
cause. `[sys-timing]` saw the same cost as `ui_quest::feed_quest` at 85.7 ms for
one run in 76, because every handler runs synchronously inside whichever system
fired, so the system holding the stack gets the bill.

Two conventions the report sticks to:

- `self` is nest-adjusted, in both columns. A handler's own time has any event it
  fired taken back out (`event::fire` differences `event_prof::nested_ns` across
  the call), or every event in a cascade reports the cascade and the row naming
  the real cost is the one that looks innocent. `total` keeps it, which is what a
  `[sys-timing]` span sees.
- A fire is one `fire_event`, however wide it fans out, because that is the unit
  a dropped frame is measured in. `calls` is beside it for the width.

Measured on the player's own 92-addon interface (`tick_bench`'s new `[events]`
row, three fires per event from a settled start):

      us/fire    worst  event
         5068    14759  QUEST_DETAIL      <- HCQuest.lua:139 took 14,097 us
          764     1324  QUEST_LOG_UPDATE
          662     1564  QUEST_FINISHED

Read `us/fire` against `worst` and that 14.8 ms is **one** fire of three: the
other two cost ~0.1 ms, so it is HCQuest building something once and keeping it,
not a cost paid per quest. With that read correctly, no quest event costs more
than ~1.5 ms recurring offline — so the bench does not reproduce the live 57-73
ms and says so, rather than offering a number that looks like an answer. Hence
the instrument, armed in `./measure.sh`.

Also adds `./measure.sh --frames`, which arms two meters that already existed and
have never been armed: `WOW_FRAME_PHASES=50` and `WOW_RENDER_MS=1`. A frame's
wall time is `max(main app, render app)` since bevy pipelines the render app onto
its own thread, so when the render app is the longer, `wall` climbs while `cpu`,
`main`, `gpu` and every per-system `worst` all read healthy — exactly what that
session's **161 ms frame in a second whose costliest system worst was 2.9 ms over
105 runs** looks like, and what 43 of its 64 spike-seconds look like. Its own
mode because both perturb what they measure.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-21 06:43:01 -06:00
gromandClaude Opus 5 0c862838da ui: a SetScale names its subtree instead of giving up on the graph
`[ui-phases]`'s new write-site tally answered the combat-fps question on its
first armed session: 463 whole-graph layout derivations across 34 windows, and
**232 of them** at `object/frame_state.rs:427` — the `touch_layout()` inside
`SetScale`. Splitting the per-window count by site and regressing against
resolve time over 43 in-world windows, resolve correlates with `SetScale`
derivations at r = +0.996 and with every other derivation at r = -0.041. The
four costliest windows of the run are 36-64 `SetScale` derivations each and
almost nothing else.

That also corrects the flat "~15.5 ms per derivation" of the round before: a
mint-triggered derivation costs ~1.1 ms, a `SetScale`-triggered one 12-13 ms.
The difference is that `SetScale` gave up *two* ledgers, not one.

The caller is pfUI's action-button press animation
(`pfUI/modules/actionbar.lua:182`, `:207`, `:233`, `:259`): four styles that all
run `this:SetScale(this:GetScale() + fade)` on `OnUpdate` for the ~60 frames a
button's fade lasts. Pressing an ability starts it, which is why a settled
interface never reproduced this and a fight always did.

Both give-ups had precise versions already, written for `SetParent`:

- `touch_layout()` -> `touch_layout_subtree_scale(h)`. A scale write moves the
  subtree's `effective_scale` and nothing else: anchor targets are ids fixed at
  `SetPoint`, so no edge moves and the roster is unchanged.
- `touch_measure_all()` -> the same walk now names the subtree's regions on the
  measure ledger. This was the bigger half. `measure_dirty = None` makes the
  next `fontstrings_needing_measure` walk all ~43,000 regions of a real
  interface to issue, typically, zero requests; `stale_measure_key` reads only a
  region's own data plus *its owner frame's* `effective_scale`, so the subtree's
  regions are exactly the ones that can go stale.

Measured on the player's own 92-addon interface, 43,195 regions, one `SetScale`
per frame for 240 frames (`tick_bench`'s new `[scale]` row):

    before   changing  resolve 0.601 ms/f · 0.996 derivations/f (239/240)
    after    changing  resolve 0.005 ms/f · 0.000 derivations/f (  0/240)
    control  same      resolve 0.005 ms/f · 0.000 derivations/f (  0/240)

`changing` is now indistinguishable from a control that writes the value it
already holds. The harness understates the live cost (its measure answers are a
6px-per-char stub), so the live saving is to be confirmed in a play-test, not
predicted from that row.

Correctness is left to `WOW_LAYOUT_VERIFY`, which `cfg!(test)` forces on for all
1975 benilla-ui tests: it re-derives the whole graph after every `resolve()` and
panics on any rect the incremental pass got wrong, and runs the full measure
roster beside the ledger drain and panics on any stale region the ledger missed.
So the two new tests assert only that the cheap path was taken, on a graph three
frames deep with a FontString on the leaf. The real-interface verify run fails
identically to its documented pre-existing red (`frames 13379 -> 13379, regions
29597 -> 29645`), so this change adds nothing to it.

Also repairs an assert message in `layout_gate.rs` whose line continuations had
been eaten by a heredoc, leaving runs of spaces mid-sentence.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-20 20:57:15 -06:00
gromandClaude Opus 5 c1a56f98ab layout: name the write that asks for a whole-graph derivation
`[ui-phases]` could say a window paid for 61 whole-graph derivations. It could not say which of the
forty-odd `touch_layout` sites asked for them, and that is the half a fix has to be aimed at.

Measured on the player's interface, one derivation costs ~15.5 ms — from two directions: the
derivation count explains total resolve time at r = +0.977 across twenty windows (solve count:
r = -0.33, so solves are free and derivations are everything), and 26 of 78 worst-single-call
figures over 1 ms land in the 15-16 ms bin across eleven unrelated handlers by six authors, two of
which fired exactly once for their whole window. Eleven handlers cannot each independently be
15.5 ms slow; it is one shared charge landing on whoever reads the graph first, which is also why
the same session shows `resolve` p99 at 14.4 ms and worst frames "mostly tick". One defect, two
accounts.

So `#[track_caller]` down the naming chain and a tally of `file:line`, printed in the report. Not a
backtrace: `WOW_LAYOUT_DERIVE_TRACE` already captures those and has to be rationed to `n` prints
because of what they cost. This is a `(&'static str, u32)` key off `Location::caller()`, cheap
enough to leave armed, and take-and-rearm so a window reports its own rows and a VM replaced by
`/rl` re-arms without anybody noticing it was replaced.

Also a `[churn]` window in tick_bench, which records a negative: a plate roster turning over 4-in-40
every ten frames costs **zero** derivations on the player's own interface. `sync_nameplates` pools
the plate frames, so a new key rewrites an existing plate and mints nothing. With `resolve_bench`'s
hover-sweep, tooltip-content and moving-region tests all asserting zero, four candidate triggers are
now ruled out offline and the live tally is what names the real one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-20 19:17:44 -06:00
gromandClaude Opus 5 4393bde4ec sys-timing: a stall report names the thread and how long it was stuck
Two durations were being conflated. How long the thread has not moved is the defect; how long the
span it is inside has been open is only where it is stuck, and for an enclosing span that is the
whole session — which is why the live log said "has been running 360380 ms" and then "was in there
at least 360406 ms" about a 150 ms hiccup.

So both, labelled, and the thread's name beside them: the span it is stuck in may be unnamed, since
an enclosing `info_span!` carries no `name` field for `on_new_span` to record, and then the thread
is the only thing the report can name. Before this, such a stall printed `span #2473901162497` and
nothing else.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-20 19:17:44 -06:00
gromandClaude Opus 5 e4851df7df ui: WOW_UI_PHASES — the UI pass's phase split, windowed
`WOW_UI_TICK` measures `UiScript::tick`. `[sys-timing]` measures the Bevy system around it,
`ui_script::extract::tick_script`, which also runs the FontString measure round-trip and
`UiScript::resolve`. In a combat session the first read 38 ms/s — its lowest of the whole run —
while the second read 157 ms/s. Neither instrument was wrong, and 76% of the cost was in the space
between them, which is where the stutter players report lives.

`UiFrameCost` has carried the whole split since the hover recorder needed it, and `WOW_UI_COST=1`
prints it one line per frame: at this client's framerate, twenty thousand synchronous stderr writes
a minute from the thread being measured, which is the trap `sys_timing`'s header records costing
15 ms a frame. The split existed and was unusable in exactly the situation it was for.

So a window, and a worst column — a phase that is ruinous on one frame in a hundred has a mean near
nothing and is the only thing a player feels. `derives` is in the per-frame line because
`UiFrameCost::derives` is documented "expected zero", so a nonzero one names a whole-graph
re-derivation on sight.

`UiFrameCost::stamped` comes with it: the paint can return before any of its three arms wrote this
frame's phases, and a reader that cannot tell counts the previous frame twice.

Armed in ./measure.sh at 5 s, with the per-frame form left alone for the hover recorder.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-20 18:17:01 -06:00
gromandClaude Opus 5 21c0befdca sys-timing: a stall is a thread that stopped, not a span that is open
The watchdog keyed on "a span has been open past the threshold". Spans nest, and `on_exit`
republishes the enclosing one deliberately — so between any two inner spans the slot shows a span
that has been open since the first frame, and the watchdog said so.

In a 105-second play session that was 13,658 of the log's 15,335 lines: `STALL: span
#2473901162497 has been running 209147 ms`, alternating with `STALL ended`, every ~75 ms, each one
re-reading /proc for 39 threads — inside the session it was there to measure. The instrument whose
whole job is to be trustworthy when nothing else is was the loudest liar in the log, and it could
not even name what it was accusing, because an enclosing span has no entry in `names`.

So `Slot::beat`, bumped on every enter and every exit. A stall is now a thread that has not entered
or exited anything for the threshold — which is what "wedged" means and what the module header
already claimed to be reporting. The end line also gets the real total rather than the duration at
first sighting, which is why both lines used to print the same number.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-20 18:16:52 -06:00
gromandClaude Opus 5 112647b919 perf(ui): the handler profiler names the worst single call, not only the mean
`WOW_UI_HANDLERS` ranked handlers by self time over the window, which is the
right ranking for what costs framerate and the wrong one for what costs a
frame. A handler that stalls once every four seconds has a mean near zero over
five hundred frames and never reaches the table at all.

The player's session had a 15-28 ms tick in nearly every five-second window —
one dropped frame every few seconds, which is the kind of thing a player
reports as "it hitches" and no average will ever show. The table said
`UIParent:OnUpdate 60.8 us/f` and nothing about it.

So each slot keeps its costliest single call, the table gets a `worst` column,
and the handlers whose worst call cost a frame are listed again underneath —
but only the ones the table left out, so the block says something new or
nothing. `tick_bench` prints the same ranking.

It names the stall on the first run, offline, in this interface:

```
15768.7 us once  (self 17080.8 us over 240 calls)  pfQuestMapTracker:OnUpdate
12339.4 us once  (self 13042.0 us over 240 calls)  AceEvent20Frame:OnUpdate
 5380.9 us once  (self 16166.0 us over 240 calls)  pfQuest\quest.lua:348:OnUpdate
```

92% of the tracker's whole cost over 240 frames is one call. Both of the top
two are steady per-frame allocators, which made the collector the first
suspect; the bench's own heap line refutes it — 222.8 MB live against 29.1
kB/frame of churn is ~131 s between 200%-pause cycles, not the ~4 s the stall
recurs on. What the per-binding bill says is in there instead: one `pcall` of
7.5 ms, and `frame:GetLeft` at 92 us a call, which is a layout resolve against
a dirty graph.

`measure.sh` comes with it. The set of instruments worth arming for a play-test
is long enough that a run with one of them missing is normal, and such a run
looks exactly like a run that found nothing — the session this column came from
was missing `WOW_SYSTEM_TIMING`, so it could say what the UI cost and not what
the frame cost. The script arms the set and prints what it armed.

The test asserts the property the column exists for and not a duration: a
handler called ten times for 50k iterations each outranks one called once for
150k by self time, and the second still has the larger worst call.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-20 06:19:20 -06:00
gromandClaude Opus 5 3ebf432ebd harness: ask the whole interface a question, not one addon at a time
`--probe <Name>` loads one addon and asks it things. What it cannot see is an
interaction between two addons, and a real interface is mostly interactions:
the player's chat frame is docked by pfUI, re-anchored by the shipped
`FCF_DockUpdate`, and read by ChatSuey, and no single-addon probe reproduces
any of that.

`--probe-all` is the same read-back against the walk `--together` already does
— the whole folder in one VM, in load order, each `ADDON_LOADED` at its own
position, then one session start — with the VM left standing for `--eval`,
`--tick` and `--mouse` instead of thrown away. The walk itself is now one
function both callers share, so the survey and the probe cannot drift.

Two things the walk was missing, both of which decide what the interface looks
like:

- **Saved variables.** `register_addons` was told where they live and nobody
  read them, so every `--together` run measured a default-config interface.
  pfUI's panel sizes, module enables and font sizes all live there. With
  `--saved C_Thun-Gromgosh` the probe reproduces the player's own geometry to
  the digit — the chat frame's 25.12 px panel gap matches what was measured in
  play, where a default-config VM says 23.62. Loaded before `ADDON_LOADED`, as
  the reference sets them (`0x51f6c0`), because reading config on that event is
  the usual shape; after it is a default-config interface with extra steps.
  Dependencies get theirs too: a library pulled in under its first dependent
  never gets a turn of its own in this walk, where the live client gives every
  enabled addon one.

- **The screen.** `--screen 2560x1440` instead of a hardcoded 1024x768, because
  pfUI's pixel-perfect scaling reads `GetScreenHeight` and a player's interface
  is not laid out at the harness's resolution.

What it answered first time out: the player's short pfUI chat frame does **not**
reproduce offline. With his real saved variables, at his real resolution, with
all 80 addons in one VM, `ChatFrame1` is docked correctly — `TOPLEFT` and
`BOTTOMRIGHT` into `pfChatLeft`, height 129.76 of a 180 panel — so whatever
shortens it live needs state this walk does not have, which is worth knowing
before reading another line of `layout.rs`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-20 06:19:20 -06:00
gromandClaude Opus 5 a8b6fc8ad6 perf(layout): the resolve's seed pass walked the graph, not the change
Each solve chooses which nodes to solve and which clean rects to seed it
with. It did that by asking **every id in the graph** — 18 203 frames and
42 284 regions on the player's interface — "is one of your dependents
dirty?", for a dirty closure whose steady-state median is 2 frames and 4
regions.

And nothing was measuring it. `[layout-pre]`'s last lap ends at the change
gate; `[layout-prof]`'s `frame_us`/`region_us` start at the round loop. This
pass sits between them, so neither line charged it — which is how a
`frame:GetLeft` that measures 17.5–18.4 us a call in a live session (six a
frame, through stock `MouseIsOver`'s four edge reads) could force a resolve
the profiler called 3 us. A `seedsel_us` column now closes that gap, and it
stays: a phase between two timers is a phase nobody owns.

Measured on the player's own 80-addon interface, last-quarter solves:

              median   p75   p90   mean    max
    before       458    498   607    488    882
    after          0      3     9     38   3788

`solved` and `swept` come out identical to the digit (median 2/4, mean
156.3/408.3, max 18183/41415): the same work is selected. Before, 202 of 549
solves cost over 400 us and the dearest of them had dirty sets of 0–13 nodes,
which is the pathology itself; after, 29 of 549 exceed it and every one is
solving 14 000–16 600 frames at 0.48 us a node, against a `frame_us` of
10 170 us on the same pass. The cost moved from the size of the graph to the
size of the change, which was the point; the higher max is that, not a
regression.

**What it is not: an fps fix.** The bench's per-frame totals do not move —
1.294 -> 1.293 ms/frame grouped, `vm-tick` 0.667 -> 0.676 (noise, single
runs). The one column that shifts is `resolve`, 0.011 -> 0.006 ms/frame. The
458 us is per *solve*, and a steady frame does a fraction of one; the live
bound is the whole of `frame:GetLeft`, 105-110 us/f, against a 7.6-9.5 ms
frame. So this removes real waste and buys about 1%, which is worth having
and is not what grom asked for. Chasing it at all was a misread of mine:
`GetLeft` is 54% of the *binding* bill, and the binding bill is ~200 us of a
~9000 us frame.

The same set, by the same relation read the other way round: a clean node is
seeded iff some dirty node reads it, and a node's dependencies are exactly
the three `scope.edge` arguments in the roster walk — its anchors' targets,
plus a region's owner frame, whose scale it reads. `LayoutScope::dirty_ids`
carries the dirty set as a list, written wherever `dirty` turns true so the
two cannot disagree, and `seed_dep` enumerates the dependencies. A
`full_scope` pass skips the walk: everything is dirty, so there are no seeds
to find.

Order is not a property here, which is what makes the rewrite safe. Both
rosters are built from `HashMap` iteration (`frame_to_id`, `region_data`), so
no pass ever had a canonical order, and the region sweep is a fixpoint whose
round cap covers any chain — order moves `rounds`, not rects. Only the seed
lists are sorted, to drop duplicates a shared dependency would otherwise
re-`set_external` every round.

`verify_selection` is the falsifier: under `WOW_LAYOUT_VERIFY` it recomputes
all four lists the old way and requires the same sets. That is a tighter
question than `resolve_layout`'s rect comparison — it isolates this pass, so
a selection bug cannot hide behind an unrelated red, and an unrelated red
cannot be pinned on the selection. Verified non-vacuous by dropping the
region-owner dependency and watching it fail (`0 vs 1 entries`).

Note for whoever runs it: `WOW_LAYOUT_VERIFY=1` over `tick_bench` is **red at
HEAD**, independently of this change — an incremental pass ends with 48 fewer
region rects than a full derivation of the same frame (`regions 29597 ->
29645`), byte-identical with and without this commit. That is a missing
`touch_layout()` somewhere, not a selection bug, and it had never been run
before because `tick_bench` is `--ignored` and the flag is in no gate.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-19 22:05:01 -06:00
gromandClaude Opus 5 7322a95a9d fix(ui): WOW_UI_VERBS must not wrap setfenv — it unloaded a third of the interface
A wrapper puts its own frame between the caller and the callee, which
silently changes the meaning of every stack-level-relative call.
`verb_prof::install` wraps every function in `_G`, and `_G` at that point
holds Lua's own stdlib as well as our bindings — so it wrapped `setfenv`.
pfUI's `api/api.lua:4` is `setfenv(1, pfUI:GetEnvironment())`, and level 1
from inside a wrapper is the wrapper, a C function, so Lua raises
``setfenv' cannot change environment of given object`.

One armed session logged **91** of those and lost pfUI, WhatsTraining_Turtle,
AI_VoiceOver, MasterTradeSkills, pfUI-addonskinner, pfUI-locplus and
PizzaSlices: an instrument that unloaded a third of the interface it was there
to measure, and whose numbers were therefore of a client without them.

`STACK_RELATIVE` names the four `wrap_table` must leave alone. `setfenv` and
`getfenv` take a level; `error(msg, level)` positions its message by one; and
`debugstack([start])` is the reference's traceback by level, which
`FuBarPlugin-2.0.lua:752` asks for as `debugstack(6, 1, 0)` and
`AceDB-2.0.lua:742` reads a specific line of. `pcall`/`xpcall` stay wrapped:
no level argument, and an armed session shows them working and worth seeing.

The test wraps `_G` and then runs pfUI's line, so it is the bug rather than a
restatement of the list; deleting the skip reproduces grom's exact error. The
module doc also claimed `_G` "holds our bindings and nothing else" at install
time, which is what made this easy to miss.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-19 20:58:03 -06:00
gromandClaude Opus 5 5764837e35 perf(ui): give WOW_UI_VERBS a live window, so the instrument exists in a session
`verb_prof` wrapped every global and every widget method and charged each call
two `Instant::now`s — and the only caller of `log_report` was the
`addon_harness` **example**'s `--together` load. Armed in the client it paid
for every binding call and printed nothing at all. The one question it answers
— which binding a handler's self time went into — is exactly the open one:
`WOW_UI_HANDLERS` names `UIParent:OnUpdate` at 503 us/f in combat against 48
idle, and stops there.

So `WOW_UI_VERBS=<secs>` now prints a window from `report_window`, called at
the end of `UiScript::tick` beside the handler and raise reports, one level
down from them. The bare `=1` the harnesses already pass reads as one second,
which is why `period()` parses the same variable rather than taking a new one.

A window is a **delta** against a snapshot (`PREV`), not a `reset`: `ROWS` is
the one table and `log_report`'s callers read it whole at a moment of their
own choosing — `--together` ticks ten times before printing its load bill, so
a window that cleared the table would have handed it whatever happened after
the last window instead of the load. The arithmetic is `diff`, split out and
tested on its own because `window_delta` reads two process-wide statics and
`diff` is the whole of the logic.

It earns its keep immediately. `tick_bench` over the player's real 94-addon
folder, 121-frame windows: `frame:GetLeft` costs **0.42 us/call** on a settled
layout and **29.95 us/call** the moment anything moved — the same two calls a
frame, 55% of the frame's whole verb bill — because the four edge getters call
`settle()` and a resolve past tier 1 walks every live frame. During the load
burst the same call is **370 us**. `GetWidth`/`GetHeight` already carry an
authored-span shortcut for precisely this; the edge getters never got one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-19 20:35:07 -06:00
gromandClaude Opus 5 df72d823cd perf(static-gx): budget the bake, 43 ms off a world-load frame
`flush_static_gx` bakes a cell once it has been dirty and *quiet* for its
window, which staggers cells whose changes are staggered — and a world load
dirties hundreds within a few frames of each other, so their windows expire
together and the whole burst baked in one flush. A cold Elwynn vista measured
one run of 43.2 ms against 2.6 ms for the other nineteen in that second
(`WOW_SYSTEM_TIMING=1`): a visible stall, and a scheduling artefact rather than
work, since the same bakes cost the same total spread over later frames.

`BAKE_BUDGET` spends 4 ms of wall clock per flush — the figure
`terrain_stream::SPAWN_BUDGET` already paces placement spawns by, and the two
passes share a frame — and hands the rest to the next flush. A region that
yields stays `dirty` with its `last_change` untouched, so `bake_due` says yes
again next flush: yielding is the absence of a decision rather than one, which
is what keeps the budget to *when* a region bakes and never *whether*. The three
exemptions say the same thing. Nothing yields until one region has baked, so a
region larger than the whole budget cannot stall behind itself. `flush_now` gets
the full flush it asked for. The `MAX_DIRTY_FRAMES` age cap outranks the budget,
so the backstop that already bounded a region's wait stays absolute instead of
becoming advisory. And an empty region is an unload — free to publish, and
deferring one would leave dead geometry on screen — so removals are never
budgeted at all.

Measured after, same vista: every budgeted flush landed 4.0–4.5 ms, draining a
backlog that peaked at 398 held regions at ~30 a frame over 16 consecutive
flushes. Worst visible flush 43.2 → 4.5 ms.

One flush still runs 58.4 ms and should. `terrain_stream.rs:908` asks for a
`flush_now` while `!focus.paced`, because a region that cannot draw yet is "a
hole in the reveal", and `ViewFocus::paced` is false only "through entry, a
teleport and a world swap, while the loading cover absorbs the burst". So the
budget moves that stall out of play time and behind the cover, which is the
point; it is not a leftover to fix.

`WOW_GX_BAKE_MS=<ms>` overrides the budget and an explicit `0` retires it, so
the A/B runs in both directions.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-19 20:33:00 -06:00
gromandClaude Opus 5 d8d8f4fc59 physics: retire avian's collider mass-property pass, 181 ms off a world load
`WorldPlugins` has disabled `MassPropertyPlugin` for as long as the world has
had colliders, with the reason written beside it: there are no dynamic bodies,
so no mass is ever read. The pass kept running anyway. `ColliderBackendPlugin`,
which we keep for `update_collider_scale`, registers
`update_collider_mass_properties` itself (`collision/collider/backend.rs:232`),
and that system's query filters `Without<Sensor>` and nothing about the body
type — so every collider that *changed* paid `Collider::mass_properties`, a
full parry volume integral over the trimesh, for a value with no reader.

Terrain streams its colliders as trimeshes by the tile, so the cost lands in a
world load. Measured on a cold Elwynn vista with `WOW_SYSTEM_TIMING=1`, before
and after, same viewpoint:

  before  run_fixed_main_schedule  worst 183.0 ms   200.9 ms/s
  after   run_fixed_main_schedule  worst   1.3 ms    25.9 ms/s

`update_collider_mass_properties` no longer appears in the report at all, and
its 181.3 ms worst run was the whole of that schedule's spike — the nesting is
what identified it.

A run condition rather than another `.disable()`, because the system cannot be
removed individually and shares a `.chain()` with `update_collider_scale`.
`MassPropertySystems` is `pub` but not in avian's prelude, hence the full path.

The invariant the whole physics trim rests on now has a wall of its own:
`tests/no_dynamic_bodies_wall.rs` fails if `RigidBody::Dynamic` appears in the
workspace. This bug was exactly an invariant that lived only in prose — the
`.disable()` comment stated it correctly while a system slipped through the gap
between two plugins — so the assert is the point. Verified by planting a
dynamic body and watching it fail, then reverting.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-19 17:22:59 -06:00
gromandClaude Opus 5 d06bb9fae9 options: Interior Darkness says what it does not scale
grom turned this dial down, hit snow in Dun Morogh, and got rooms that read
"really grey and flat" — then spent his own time hunting it before settling on
19% by trial. The dial was not lying, it was just silent about the half of the
picture it does not own.

A storm's fog reaches indoors at full strength, which is faithful: the MFOG
selector bails on a one-record root (`0x69de4b`) so the room keeps the SCENE
fog, and the crossfade staged at `0x6cef43` carries it in "storm veil included".
Measured at his own spot, snow against clear: the fog start goes 0 -> -105 over a
350 end, which is 23.1% fog at ZERO distance — the wall in front of you. That
predicts [36.0, 50.2, 57.8] against a measured [36.9, 50.3, 58.0], so it is the
whole effect. Turn the room light down under that and the veil is most of what
is left.

So the tooltip now says it, in both locales, and points at the dial as the answer
instead of leaving the next player to re-derive it. No behaviour changes — the
fog is the reference's and stays.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-19 13:40:26 -06:00
gromandClaude Opus 5 9d16c200a6 cvars: a capture can boot on a player's setting, not only the defaults
A capture reads no `config.toml` — that hermetic boot is exactly what keeps an
A/B exact — so there was no way to ask offline whether a report still reproduces
at the player's own numbers. `WOW_CVAR=<name>=<value>[;…]` applies after the file
and the preset, so it wins; unset it moves nothing and every capture keeps
booting on the registered defaults. An unknown name or a malformed step is
reported and skipped, because a typo in a measurement should not take the run
down with it.

Written for grom's report that interiors go "really grey and flat" when it snows
with Interior Darkness turned down. That is `interiorGain`, and reproducing it
needed his 1.25 in a capture that boots at 0.5.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-19 13:16:02 -06:00
gromandClaude Opus 5 948373f7a4 probes: a prop shares a slot with one that agrees, not only one identical
The interior prop-probe table holds 8192 and cannot be widened — 13 mesh-tag
bits, with every bit of that u32 already spoken for. It keyed on exact
coefficient bits, so two props shared a slot only when no MOLR light reached
either *and* their baked MODD colours matched to the last bit. Measured in
Ironforge at grom's login spot: 3,883 distinct probes standing still, 5,543 at a
far clip of 777, and his session saturated during the world load — after which
every further interior prop falls back to the room's flat day/night law.

The distinctness is the per-prop baked colour, not the prop's position: folding
the probe on a 16 yd grid instead of each prop's own centre removed only 4.5% of
the slots. Rounding the *key* onto a 1/32 step removes 35%. A shared slot keeps
the first claimer's exact rows, so the quantization decides who shares and never
reaches the light the shader reads.

Verified by render, not by argument: that Ironforge storeroom at the new default
is byte-identical to exact keying across 1.44M pixels, while starving the table
outright (the new `WOW_PROBE_CAP=0`) moves 109,830 of them by up to 14/255 — so
the lane does drive this view, and the sharing costs nothing measurable in it.

The table now also counts the distinct probes it refused, and all three overflow
warnings report it. That number is the whole question when the table saturates: a
small overflow is answered by sharing harder, a large one only by more slots, and
until now the log could not tell them apart.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-19 12:39:10 -06:00
gromandClaude Opus 5 497570a68c addons: an on-demand load says what it loaded
The startup walk names every addon it loads; `LoadAddOn` named none. So when
the client froze on 10-19 while learning recipes, the session log could not
say whether the trainer window was even open — and `Blizzard_TrainerUI` is
LoadOnDemand, so that was the whole question.

`benilla-ui` has no logger, so the line travels the way its errors and
warnings already do: a `notices` channel on the model, drained to `info!`
beside them in the same pass. Silent for a redundant load, because the stock
`*_LoadUI` glue calls `LoadAddOn` on every open and a line per call would
bury the one that did the work. A refusal carries the reference's own reason
token, and a name that is not installed says so.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-19 10:54:56 -06:00
gromandClaude Opus 5 9782b07fd4 lua: a frame that never leaves the VM fails its call, not the client
The load has had an instruction bound since `3b6975fd` — "so a hung load reports
instead of freezing the loading screen" — and the end of the load disarmed it,
"so no handler is killed for being slow". Right about slow, and it leaves a
handler that never returns at all able to freeze the client until the player
kills it, which is what happened to him this morning.

So the bound does not go at the end of the load, it changes shape. Wall time
rather than instructions, because the number has to be obviously beyond anything
legitimate and a count is not: a frame still inside Lua after fifteen seconds is
not slow, it is stuck. `tick` restamps every frame, so no frame is charged the
one before it and a handler reached later in the frame — a click, a fired event —
measures from that mark, which can only make the bound tighter. The raise names
the chunk and the line, so his log says which addon rather than that something
somewhere looped.

It shares the one count hook, which costs 5-13% of pure Lua execution time
(measured: 30M instructions, 235-260 ms bare against 267-274 ms hooked, which
also puts his machine at ~125M VM instructions a second — what sizes the load's
200M at about 1.6 s). Lua is a small part of a play frame, so that is a fraction
of a percent of frame time, and the load was already paying it.
`WOW_LUA_RUNAWAY=<secs>` moves the bound, `0` disarms it.

Two tests: a loop with no exit fails its own call, names its chunk and leaves the
VM usable; and a frame is not charged the wall time that passed before it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-19 08:53:12 -06:00
gromandClaude Opus 5 af4bb2dd22 stall: the Linux client watches its own main thread
It froze on him this morning while learning recipes at a trainer, and he had to
kill it. Both logs end on an ordinary line; the fps journal's last sample is a
second earlier with normal numbers; `journalctl -k` holds nothing but firewall
noise between 07:30 and 08:20, so no GPU reset and no OOM kill; and the two crash
reports in Diagnostics are from the 11th and the 15th by their own embedded
server-time lines. A frozen frame writes no line of its own, and a force-kill
writes no crash report, so the session left no evidence of where it stopped.

There was a watchdog for exactly this, with a heartbeat, a threshold set, an
`_exit` backstop and two injectors to test it — registered
`#[cfg(all(feature = "dev", target_os = "macos"))]`, because its diagnosis is
`/usr/bin/sample`. On Linux nothing was watching at all.

So the sampler grows a Linux arm instead of a second watchdog beside it. `/proc`
already knows: each thread's scheduler state, the kernel function it sleeps in,
and its CPU time in clock ticks. That is less than a backtrace, but it settles
the first question — climbing ticks is a loop, `S` or `D` with flat ticks is a
wait and the wchan says what for — and it is free, where a real backtrace of our
own process needs ptrace, which yama's `ptrace_scope=1` refuses between siblings
and which this client has no business asking for on a player's machine. The
report says so, and names the pid for `sudo eu-stack -p <pid>` by hand.

Verified with the injector that was already there, `WOW_STALL_INJECT=20:14000`:

  stall: no frame finished in 10072 ms — main thread tid 2793492 state S
  wchan hrtimer_nanosleep cpu 667 ticks benilla; 39 thread(s) in all

`S` on `hrtimer_nanosleep` is the injected sleep, read correctly as a wait. The
full report lists all 39 threads by CPU. The in-frame verdict goes to the log as
well as the file, because the log is what gets read after a freeze and a file
nobody knows about is not evidence.

Per-platform where the platforms differ: Linux waits ten seconds rather than
600 ms, since this client has honest frames of several (a world entry's UI load,
a `/reload`), and takes more reports, since reading `/proc` suspends nothing —
where a `sample` suspends the audio thread, which is itself a crackle, and still
declines for that reason.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-19 08:53:12 -06:00
gromandClaude Opus 5 b7ddc18782 load: a reload says what it cost and what the chunk cache did for it
Both lines sat on the world-entry path, so the load the player actually waits
through — the `/reload` — reported nothing at all. His 2026-10-19 session has two
of them, 4,981 ms and 6,276 ms against the 7.5-9 s he started from, and the log
cannot say where either went or whether the bytecode cache was hit, although the
cache directory proves it was: 1,585 entries written at first load, 14 added
across both reloads.

`report_load` now runs on both roots and names which one. The reload's clock
starts before the saved-variable writes, because those are part of the one
blocked frame he sees, which is also what the `frame hitch` warn measures.

`chunk_cache_line` resets its counters on read, so each line is that load's own
work rather than a running total in which a warm reload hides behind the cold
login before it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-19 07:59:45 -06:00
gromandClaude Opus 5 a3334b279e gameobject: a template is keyed by the object's own entry, not its guid's bits
A hardcore gravestone gave no tooltip, and his log had the whole answer:
`go plate: 0xf112aea6e34d2828 has no template yet — asked, drawing nothing`. The
pick landed perfectly; the plate's only silent exit is the template. And the
guid says why — high `0xF112` names no 1.12 object family (`HIGHGUID_GAMEOBJECT`
is `0xF110`), so `guid::entry` answered `None`, `request` returned at its first
line, and the query was never sent. The word "asked" in that line was a lie.

Two graves differ in the entry slot by 77 (`…aea6e3…`, `…aea730…`), so on this
realm that slot is a counter, not an entry. `OBJECT_FIELD_ENTRY` is the
reference's own cache key (`0x60b160`) — the lesson `names.rs` and
`ui_pet_stats.rs` already carry for creatures and pets, where a guid's middle
field holds a pet number instead.

So `request` takes the descriptor's entry, and remembers the guid only when the
two disagree: a 1.12 guid costs nothing, and all sixteen lookup sites keep
taking a bare guid, which is all a hover has. `ui_item_text`'s is-a-GameObject
test goes the same way — `OBJECT_FIELD_TYPE` bit `0x20` first, guid bits only
when no descriptor arrived — because reading a custom object as an item asks the
wrong query entirely.

If a grave still draws nothing, the plate's line now prints the entry it asked
under, which says whether the server refused it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-19 07:59:45 -06:00
gromandClaude Opus 5 c13c85615c pipes: a warm budget is not charged the frame it starts in
The pipeline warm pass held a 10 s budget and timed out 5.2 s in, leaving
pipelines to compile live — a visible stall each. `Time<Real>` is sampled at the
top of the frame, and the frame the menagerie spawns in is the frame that loads
the in-game UI: his login's 3.9 s (4.8 s the day before) came out of the budget
before the first rig was ever revealed.

His own log says so without a bisect: "2069 rigs drained in 9.75s" printed 5.84 s
after "menagerie up", and 9.75 - 5.84 = 3.91 s, exactly that session's
`in-game UI up in 3907 ms`. It cleared the timeout by a quarter of a second.

The stamp is now an `Instant` read in the system, taken *after* `spawn_menagerie`:
building the rigs is the frame's own cost, which no timeout can cut short, so
charging it to the reveal only shortens the reveal. The spawn line prints that
build cost and the timeout line prints how far it got, so the next failure reads
as "too slow" or "budget stolen" with no further instrumenting.

And a live compile now names the near miss instead of just its own identity:
every variant that compiled behind a cover is kept as a `Variant`, and an
uncovered one logs the warm variant it is closest to and the single field that
differs — `cull=None (warm Some(Back))`, `vs_defs +WOW_RIG_SKIN` — or says no warm
variant carries its label at all, which is a missing menagerie arm rather than a
missing variant. One field is an edit; a 900-character pipeline identity is a
research project.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-19 07:59:28 -06:00
gromandClaude Opus 5 a48dc95586 lua: the cache says what it did, and takes an off switch
Two small things the chunk cache needed to be trustworthy on a machine I cannot
watch. `WOW_LUA_CACHE=0` turns it off without a rebuild — a cache earns a kill
switch, and it is also how its own saving is measured. And every in-game UI load
now logs what it did, beside the load's own cost:

    ui_script: lua chunks: 0 compiled in 0 ms, 1591 loaded from cache in 157 ms
    ui_script: in-game UI up in … ms

because "the cache is installed" and "the cache is working" turned out to be
different claims, and the first build of it satisfied only the first.

A capture run resolves no state folder, so it has no cache and compiles
everything — which is right (a capture writes no player state) and worth knowing
before reading one of those logs as a regression.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-18 19:42:39 -06:00
gromandClaude Opus 5 d5ddaa1286 lua: a compiled chunk is kept, so a load parses only what changed
The compile is a UI load's biggest removable cost and the only half of it that can
be kept — running the chunks is what an addon *is*. Measured through the addon
harness's `--together` load of the player's own 91 addons, three passes:

```
no cache   4,788 chunks compiled              3,324 ms
cold       1,592 compiled, 3,196 from cache   1,482 ms
warm           0 compiled, 4,788 from cache     471 ms  (+24 ms of keys)
```

**About 940 ms off every login and every `/reload`**, and the first load after an
addon changes pays only for the files that changed.

`benilla-config/cache/lua/`, one file per chunk, keyed by a hash of the chunk's
own bytes and its name. Both chunk paths go through it — `run_chunk_named` and the
XML loader's own runner, which is how the biggest files in the corpus arrive
(pfQuest's database is 33 MiB of `<Include>`d Lua).

It cannot go wrong quietly. A key is a property of the bytes, so an edited file is
a different entry and a stale one is never asked for; an entry that is truncated,
corrupt or from another Lua build fails `lua_undump`'s header check and the source
is parsed instead, so a bad entry costs the parse it meant to save. The dump keeps
its debug info — `debugstack` is an addon-facing verb and a stripped chunk would
lie about its own lines — which the test asserts by raising from a cached chunk
and demanding its file and line back. The folder is capped at 512 MiB (one load's
worth is 159 MiB) and emptied wholesale when it is over: a cache that needed an
eviction policy would need bookkeeping that costs more than it saves.

The first build of this looked like it worked and saved nothing, because
`ahash::AHasher::default()` is seeded per process: every session hashed the same
file to a different name, found nothing and rewrote the whole cache (4,776 entries,
477 MiB, a steady 1,592 misses a run). Fixed seeds, and the instrument that caught
it — `benilla_ui::script::chunk_cache_line()`, hits and misses with the time each
spent — stays, because "the cache is installed" and "the cache is working" turned
out to be different claims.

Verified: the harness's verdicts over all 91 addons are **identical** with the
cache and with `WOW_LUA_CACHE=0`, the full gate chain is green, and the
`WOW_DATA` failure sets are unchanged (benilla-app 270, benilla-formats 80).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-18 19:33:11 -06:00
gromandClaude Opus 5 0fe0a99d8a layout: a size the author set is not a question for the solver
`GetWidth`/`GetHeight` answer against current layout, so they resolve first — and
a resolve that follows any `CreateFrame` re-derives the whole layout graph, because
minting a frame id drops the cached one (`Model::frame_id` → `touch_layout`). A UI
load is nothing but creation interleaved with reads, so the player's interface paid
**839 whole-roster derivations in one load, 2.84 ms each: 2.4 s**, against 650
`GetWidth` calls. `WOW_LAYOUT_DERIVE_TRACE` named the giver-up: every sampled one
was `create_frame`.

Most of those reads cannot learn anything from a resolve. An edge takes its anchor
scan first and only then `combineEdge(center, opposite, size · scale)`
(`resolve_left`, `resolve_right`), so an authored size IS the span unless the
anchors pin **both** of that axis's edges. `LayoutInput::authored_span` is that
rule, written beside the solver whose precedence it mirrors, and it refuses the two
cases where only the solver knows: both edges anchored, and a clamped frame, whose
rect the screen can squeeze.

Measured on the player's own 91 addons through the harness's `--together` load,
three passes each:

```
derives per load      839  →  235
preamble per load   2,414  →  560 ms
frame:GetWidth      686 µs →  60 µs per call  (1,241 ms → 118 ms over three loads)
```

**1.85 seconds off every login and every `/reload`**, and the steady state gains
the same way: an addon reading a size it set in an `OnUpdate` no longer walks the
roster for it.

Proven as well as measured: six UI captures (character, bag, merchant, quest, quest
log, tooltip) are **pixel-identical** before and after, MAE 0.000, max 0; the
layout suite passes under `WOW_LAYOUT_VERIFY`, which re-derives every frame from
scratch and demands the same rects; and `resolve_bench` now asserts both halves —
an authored, singly-anchored span answers with no gate walk, while one whose
anchors pin both edges still forces the resolve and reports the anchors' distance,
not the authored number.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-18 18:51:45 -06:00
gromandClaude Opus 5 c5911ccd6f verbs: an instrument that charges a load's time to the binding it went into
`WOW_UI_HANDLERS` names the handler and `WOW_UI_TICK` names the tick phase, and
between them they left the question this answers. A reload of the player's
interface spends **4.47 s inside handler bodies**, and single calls in there cost
hundreds of milliseconds — `pfBag:OnHide` 394 ms in ONE call — which is not Lua
arithmetic. A handler's self time includes the engine work it provokes, so that
time is ours: it is inside the verbs the handler called, and nothing charged it to
them.

`WOW_UI_VERBS=1` wraps every global and every widget method at the end of
`UiScript::new` — before FrameXML or any addon runs, so everything it finds is
ours — and times each call. Off, nothing is wrapped and nothing is paid.

It works offline, which matters more than the live case: the addon harness's
`--together` mode loads the player's whole folder into one VM in load order, which
is the closest thing to a login burst that needs no server. The first run over his
91 addons, three passes:

```
[ui-verbs] 519 verbs, 17,966,414 calls, 9,148 ms in all
    4384     6393    685.8 us  pcall            (addon code, nested)
    1498 16071556      0.1 us  type             (5.4M calls a load, Ace's)
    1241     1950    636.2 us  frame:GetWidth   ← 650 calls a load at 0.6 ms each
     548    33093     16.6 us  CreateFrame
     219    37524      5.8 us  fontstring:SetPoint
      95       99    960.3 us  frame:GetHeight
      67      123    545.9 us  frame:GetLeft
      17        3   5628.6 us  frame:GetCenter
```

A geometry read costing 636 µs is the whole finding, and the fix is the next
commit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-18 18:51:45 -06:00
gromandClaude Opus 5 3369d525cb log: the client keeps its own log, and says which zone and room it thinks it is in
A player sees something wrong for two seconds and quits. What the client said at
that moment lived only in the terminal it was launched from — which, for a player
who starts it from a desktop, is nowhere. So three things, all aimed at the next
report being answerable from the machine it happened on.

**The session log.** `benilla-config/Logs/benilla.log` now holds every line that
goes to stderr, with the previous two runs kept beside it as `benilla-1.log` and
`benilla-2.log`. The ring that feeds the crash report already formats these lines
([`log_ring`]), so the file is one more sink on it: the ring's backlog replays into
the file when it opens, so the boot lines are not lost to the attach being late,
and writes are unbuffered because the point of the file is to survive the crash
that made someone read it. 64 MiB cap, then one line saying so. A capture run
resolves no state folder and writes none. Player chat is logged at `debug` and so
is not in it; server notices are.

**The zone line.** One line per change naming the whole chain: the leaf area id
the terrain chunk under the player carries, the zone it rolls up to, and what the
world map selected from that. This is unanswerable otherwise — the ids live for a
frame, and the map only shows the end of the chain. It is already earning itself:
the player reported the map naming a far-away zone in a custom area, and the
terrain says why. `Azeroth_36_43.adt` (the server's own, out of `patch-A.mpq`)
tags 44 of its 256 chunks `5599 "Rugford's Mountain Rest"` — the custom area the
quest is in — and **53 of them `3 "Badlands"`**, in a block that starts a few
chunks south of it. Walk off the rest and the client reads Badlands off their
terrain and moves the map there, exactly as the reference would.

**The interior line.** One line per room change saying whether the camera is
inside a WMO group and which, because that claim decides whether the open world is
drawn at all: inside, the exterior is culled to what the portal flood reaches. "It
all went grey but I could see at some angles" is a description of that state, and
from the outside a wrong claim and a right one look identical.

`log_ring::attach_file` and `FILE_CAP_BYTES` are published engine API: the engine
owns the log, the app owns where this player's state lives. The wall caught both
the moment they crossed, which is what re-baselining it was for.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-18 17:34:17 -06:00
gromandClaude Opus 5 6affd61c35 doc: the model pane's skins link points at the struct that has them
`doc-links` was the last red gate, on one link dating from the fork's import
(`81d96af3`): `script::types.rs`'s `QuadContent::ModelPane::skins` cited
`widget::kinds::ModelState::skins`, a field that never existed on that struct. The
three creature skin variations live on `script::CreatureModelView`, which is what
a display id resolves to for a pane, so the link now goes there — by the public
re-export rather than through the private `model` module.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SgstFWtn1RxEJ5kVrpgYwn
2026-10-18 16:14:22 -06:00