Detach old-world spatial ownership atomically, prioritize destination retirement dependencies, and reveal the viewport at the retail transition edge. Give private paperdoll views independent mesh ownership and retain dormant ACE entities so portal revisits preserve server objects without extending active GPU lifetimes.
11 KiB
Modern runtime Slice H execution plan
Status: COMPLETE (2026-07-25)
Parent plan: 2026-07-24-modern-runtime-architecture.md, Slice H
Prerequisite state at execution: Slice G4 production cutover was
automated-gated; its user visual gate later passed on 2026-07-25.
1. Safety boundary
Slice H removes work which scales with presentation rate. It does not change retail gameplay rules, visible-cell authority, light membership, packet ordering, acknowledgement timing, heartbeat placement, or UI presentation.
Slice H did not delete or alter the G4 old-route referee while its visual gate was pending. That gate has since passed; G5 owns the final deletion boundary.
If the G4 visual result is wrong, revert only:
git revert ef1d263337997bb030eadb7b8e71d73dc659907a
Do not reset history and do not revert G3. The portal-warmup corrections
129dd77d and 03b10183 are independent of the retained draw-source cutover.
2. H-a — retained UI, live attachments, diagnostics, and frame scratch
H-a1 — cached shaped text — COMPLETE
- Add a small retained text-layout cache keyed by source revision/value plus width, padding, color, and font identity.
- Convert appraisal item, inscription, spell, creature, character-info, and active-effect detail providers so expensive report construction and wrapping occur only after source or layout changes.
- Preserve
UiText.LinesProvideras the rendering seam. Dynamic one-line widgets remain dynamic; this change is limited to report/wrapped content. - Ensure selection, appraisal response, component count, enchantment, character-property, font, and resize changes invalidate the right cache.
- Add tests proving stable draws return the same line collection while source and geometry changes rebuild it.
Gate: the existing appraisal/character/effect behavior tests remain unchanged, and repeated stable provider polls allocate no report/wrap objects.
Landed evidence:
../research/2026-07-25-slice-h-a1-ui-text-cache.md.
H-a2 — visible cooldown participants — COMPLETE
- Keep the shared retail heartbeat and one cooldown result per represented item.
- Index mounted
UiItemListparticipants once at bind time. - At heartbeat, visit only lists whose complete ancestor chain is visible. Hidden panels keep no stale visual state: their slots query zero while hidden and are refreshed on the first visible heartbeat.
- Keep future-slot support and shared-group behavior.
Gate: hidden inventory, equipment, external-container, vendor, and spell-bar lists are not scanned; reopening immediately displays the authoritative cooldown step.
Landed evidence:
../research/2026-07-25-slice-h-a2-cooldown-scope.md.
H-a3 — equipped-child transition work — COMPLETE
- Preserve both frame ordering points: pre-network presentation and post-network spatial reconciliation have different authority boundaries.
- Split transition retry from pose recomposition.
- Run the complete parent-first pose walk once after animation.
- In the post-network phase, recompose only attachments dirtied by accepted root/relation/appearance changes.
- Replace mutation-safe dictionary
ToArraysnapshots with retained key scratch buffers. Callback reentrancy still observes the same transition generation checks.
Gate: equip, unparent, reparent, pose loss, rollback, delete, GUID reuse, and subtree-withdrawal suites preserve exact event and resource counts.
Landed evidence:
../research/2026-07-25-slice-h-a3-attached-pose-reconcile.md.
H-a4 — diagnostics and frame scratch — COMPLETE
- Reuse one synchronous
RetailPViewFrameInputowned byWorldSceneRenderer; reset every field before each draw. - Expose stable borrowed landblock entry/bounds views instead of creating iterator state in each frame.
- Consumer-gate optional shadow enumeration. Preserve landblock visibility
counting because the normal title and lifecycle checkpoints are active
consumers of
lb V/T; neutralizing it would be a visible/automation behavior change. - Do not rework
InteriorEntityPartitionwhile the G4 referee remains. Issue #241 closes with G5 old-route deletion, not by editing the fallback. - Profile capped and uncapped production paths and retain evidence.
Gate: identical framebuffer/scene digest, no per-frame PView input allocation, no iterator allocation for stable landblock views, and no shadow traversal with all optional consumers disabled.
Landed evidence:
../research/2026-07-25-slice-h-a4-frame-scratch.md.
3. H-b — exact light top-k — COMPLETE
Retail anchors:
CEnvCell::add_dynamic_lightsat0x0052D410Render::insert_lightat0x0054D1B0Render::add_dynamic_lightat0x0054D420- global caps at
0x0081EC94/0x0081EC98
Execution:
- Preserve the resident
_allregistry and existing visible-cell filter. - Preserve dynamics-first ordering and squared distance from the player.
- Replace only the over-cap complete sort with a bounded exact top-k selection.
- Define tie-breaking from the existing comparator so the selected set and final submission order are identical, including equal-distance fixtures.
- Differential-test randomized candidate sets and the captured 463-light Town Network fixture against the old full-sort oracle.
- Run the fixed-camera screenshot comparison and connected light gate.
Gate: identical selected IDs and submission order for every fixture, identical Town Network screenshot, reduced overflow CPU/allocation, and AP-85 retired only after the visual evidence passes.
Landed evidence:
../research/2026-07-25-slice-h-b-light-top-k-report.md.
The deterministic differential fixtures preserve exact accepted output; the
463-light diagnostic microbenchmark reduced selection CPU time by 29.1% with
zero warmed allocations. AP-85 remains open because its retail dual-pool
behavior is outside this performance-only unit.
4. H-c — ordered, allocation-conscious network I/O
H-c is executed as three independently reversible units:
- H-c1 — pooled receive owner — COMPLETE. One cancellable async socket
receive, a retained full-size edge buffer, right-sized pooled FIFO
datagrams, unchanged blocking handshake cadence, and direct span sends.
Evidence:
../research/2026-07-25-slice-h-c1-pooled-receive-owner.md. - H-c2 — borrowed decode — COMPLETE. Parse and verify headers, optional
fields, and fragments as borrowed views. Copy only multi-fragment state
that must survive the current datagram. Evidence:
../research/2026-07-25-slice-h-c2-borrowed-packet-decode.md. - H-c3 — direct outbound framing — COMPLETE. Write packet and fragment
framing into caller storage and remove intermediate payload arrays.
Evidence:
../research/2026-07-25-slice-h-c3-direct-outbound-framing.md.
Retail/transport invariants:
- one outstanding receive;
- kernel datagram arrival order remains inbound queue order;
- one acknowledgement decision per accepted packet;
LinkStatusHolder::OnHeartbeatat0x004113D0remains at the same last-heard point;PumpOncehandshake pacing remains unchanged;- fragmented message assembly and sequence gates remain authoritative.
Execution:
- Capture allocation and ordering baselines for login, idle, motion, portal, appraisal, container, and combat traffic.
- Introduce a single cancellable socket receive owner using reusable/pool storage.
- Decode packet headers and fragments from spans/borrowed storage.
- Copy only payloads whose lifetime crosses the receive/dispatch boundary; pooled receive memory is never returned while referenced.
- Replace outbound temporary arrays with span/list segment writes where the socket API permits.
- Prove cancellation, remote close, malformed packet, receive fault, fragment reassembly, queue backpressure, and reconnect cleanup.
- Run connected lifecycle, reconnect, portal, interaction, and soak gates.
Gate: identical decoded event/ack traces, no receive-thread death, no pooled buffer lifetime violation, and materially reduced bytes per packet.
5. Commit and evidence order
Each numbered unit lands as a bisectable commit after focused tests, App Release, complete Release, and documentation reconciliation:
- H-a1 cached shaped text.
- H-a2 cooldown visibility.
- H-a3 attachment retry/recomposition.
- H-a4 diagnostics/frame scratch.
- H-b exact light top-k.
- H-c network receive/decode/send allocations.
- Slice-H connected measurements and closeout.
Raw captures stay under .test-out/ or logs/; reviewed summaries and compact
fixtures are committed under docs/research/ or the matching test project.
6. Deferred boundaries
- Physics
Transitionpooling (#237) remains Slice I and requires reset- completeness/identity tests first. - G5 old-route/referee deletion waits for the user's G4 visual acceptance.
- Static publication indexing (#242) is not silently folded into H; it is measured after H-a and scheduled only if still material.
- Slices I–L start only after Slice H is measured and documented, but no additional authorization is required.
7. Closeout
All H-a, H-b, and H-c implementation units are complete. The Release build
and complete solution pass 8,292 tests with 5 skips. The connected
login/portal/dungeon/revisit/graceful-disconnect/fresh-process-reconnect gate
passed on commit 41c1a593927fcf71ef83b4825c659a4970e9b858 with all seven
checkpoints ready, no invariant or transport failure, and both sessions
closing through the normal logout path.
The connected automation deliberately constructs the retained G4 current-path
oracle, so its scene-sized per-frame allocation is comparison-instrumentation
cost and not representative of production. A separate normal uncapped Release
session, with neither lifecycle automation nor the oracle composed, stabilized
at 25.6 KiB/frame and roughly 500 presented frames/second under RDP. Allocation
stack attribution identifies the remaining dominant production owners as
Transition query scratch (Slice I) and the retained current partition/referee
path (G5). The H-owned packet decode and recurring outbound framing paths
independently allocate zero bytes when warm. The program-wide 4 KiB/frame
target therefore remains an end-of-G5/Slice-I acceptance condition rather than
being misreported as achieved by H alone.
Closeout evidence:
../research/2026-07-25-slice-h-closeout.md.