acdream/docs/research/2026-07-24-slice-e-cost-budgeted-streaming-report.md
Erik e7d9d6fa7d docs(runtime): close cost-budgeted streaming slice
Record the exact physical-display evidence, ownership fixes, budget semantics, and performance deltas that close Slice E. Reconcile the architecture, roadmap, milestones, issues, documentation map, and session instructions before the explicit F/G approval gate.

Co-authored-by: Erik Nilsson <erikn@users.noreply.github.com>
2026-07-24 20:52:20 +02:00

7.6 KiB

Modern Runtime Slice E - Cost-Budgeted Streaming Report

Date: 2026-07-24 Exact source/binary: 91e82c3c6850fcedbf20322b2ecf4fdcd11a2b2a Configuration: Release, physical local AMD display, 2560 x 1440 Result: PASS

Scope

Slice E replaces portal-time whole-window work with one typed, frame-scoped streaming scheduler. Completion admission, retained CPU payloads, entity work, requested GPU bytes, and GL-retirement admissions share one budget. Stable destination/control/unload/Near/Far queues preserve exact FIFO order and retry receipts. Old generations become unavailable and stop simulation, collision, targeting, effects, and owner audio immediately while physical retirement converges over later frames.

Publication now advances through retained render, physics, static, building, EnvCell, and spatial receipts. Destination work receives a reserved share of the same ceilings; it does not bypass them. Login and portal transit remain in the authored portal scene until the canonical render/composite/collision predicate is complete, with retail's centered five-second wait notice instead of forced partial materialization.

The final connected gate also corrected two ownership bugs found only under real destination quiescence:

  • CPU mesh-cache hits may stage GPU work only while their exact owner token is still live. An evicted owner can no longer recreate stale upload work.
  • A destination live object may acquire spatial/render presentation while the world is quiesced, but remains invisible to draw, collision, picking, radar, status targeting, effects, and audio until reveal. Loaded residency and gameplay visibility are separate facts.

Raw JSON, CSV, PNG, counter, and frame-history artifacts remain in the ignored local logs/ tree:

  • connected-r6-soak-20260724-202244.*
  • connected-r6-soak-20260724-203225.*
  • connected-dense-town-20260724-204109.*

Connected results

Route Result Elapsed Failures Warnings Graceful
Capped nine-stop PASS 561.516 s 0 13 yes
Uncapped nine-stop PASS 518.748 s 0 12 yes
Dense Arwic uncapped PASS 69.741 s 0 1 yes

Warnings were expected authoritative population changes, known DAT-driven VFX diagnostics, and empty world-edge landblocks. No warning represented a reveal, streaming, residency, rendering, or shutdown failure.

Frame cost and allocation

The values are complete-route frame-history percentiles. Allocation is the largest positive frame-thread allocation.

Capture CPU p50 / p95 / p99 GPU p50 / p95 / p99 Frame allocation max
Capped Slice A 4.287 / 6.972 / 9.404 ms 1.702 / 3.261 / 3.847 ms 203.5 MiB
Capped Slice C 4.247 / 5.873 / 7.814 ms 1.836 / 2.694 / 3.078 ms 46.8 MiB
Capped Slice E 4.213 / 4.940 / 6.139 ms 1.650 / 2.576 / 2.921 ms 31.1 MiB
Uncapped Slice A 1.520 / 5.694 / 7.825 ms 0.897 / 3.239 / 3.406 ms 202.9 MiB
Uncapped Slice C 1.409 / 4.909 / 6.496 ms 0.832 / 2.510 / 2.706 ms 39.9 MiB
Uncapped Slice E 1.216 / 4.216 / 5.450 ms 0.725 / 2.486 / 2.666 ms 36.0 MiB
Dense Arwic Slice A 3.672 / 6.561 / 14.121 ms 2.476 / 3.284 / 3.752 ms 28.5 MiB
Dense Arwic Slice C 3.487 / 6.044 / 12.432 ms 2.126 / 2.768 / 3.122 ms 26.9 MiB
Dense Arwic Slice E 2.652 / 4.153 / 5.736 ms 1.576 / 2.504 / 2.662 ms 30.0 MiB

Against Slice A, capped CPU p99 improved 34.7%, uncapped CPU p99 improved 30.4%, and the corresponding largest frame allocations fell 84.7% and 82.2%. Against the package-only Slice C checkpoint, capped/uncapped CPU p99 improved 21.4%/16.1%, GPU p99 improved 5.1%/1.5%, and largest frame allocation improved 33.5%/9.7%. Dense Arwic CPU/GPU p99 improved 53.9%/14.7% from Slice C while exercising 15,530 entities and 111 animated entities.

Dense Arwic's 30.0 MiB allocation maximum is 3.1 MiB above Slice C's dense capture. It remains far below the portal baseline and is not hidden by a changed threshold; Slice H's whole-world partition and unconditional frame-owner work remain the program-level allocation gate.

Wall-clock budget interpretation

StreamingWorkMeter measures elapsed wall time on a non-real-time Windows thread. A frame may therefore report an overrun when the OS preempts an indivisible operation. The meter never admits another operation after the deadline and records the exact stage. Count/byte/entity ceilings likewise permit only the documented first-indivisible-operation progress rule.

The uncapped route's largest observed streaming operation was 32.055 ms in publication-physics-statics; the capped route's was 45.446 ms in publication-spatial-commit. These are named observer-atomic boundaries, not an unmetered continuation loop. Complete-route p99, per-destination turn windows, and repeated-route behavior do not show a persistent 32-45 ms streaming cost. Slice F/G is the approved architectural boundary for replacing the remaining render-scene spatial commit with prepared deltas; retail per-object collision registration remains one atomic physics owner operation.

This interpretation reconciles the plan's absolute wall-clock wording with its earlier first-operation progress contract. It does not claim that Windows can guarantee a 2 ms wall-clock maximum across thread preemption.

Convergence and ownership

Every canonical checkpoint reported:

  • invariantFailureCount = 0;
  • reveal ready, materialized, complete, and world viewport observed;
  • zero pending publication and retirement transactions;
  • zero worker, destination, control, unload, Near, and Far backlog;
  • zero staged mesh uploads and staged bytes;
  • zero composite warmup candidates;
  • zero residency staging, requested-GPU, and retiring bytes.

On the uncapped third Caul visit, cache-attributed committed CPU/physical GPU residence was 41.1/310.8 MiB, below the second visit's 48.8/292.3 MiB in CPU and within the configured GPU budget. The difference in physical GPU residence tracks the changed authoritative/visible population and composite ownership; no staged or retiring owner remained. Final process working/private memory was 1,716.4/1,461.3 MiB, below Slice D's 1,776.5/1,543.8 MiB final uncapped sample. The prepared package remains memory mapped, so working set includes discardable clean file-backed pages and is not substituted for ownership accounting.

Automated gates

  • Deterministic budget, reservation, pressure, cancellation, stale-generation, retry, callback-reentrancy, and GUID-reuse suites pass.
  • Destination quiescence tests prove retained live objects can prepare without becoming drawable or gameplay-visible.
  • Mesh-cache tests prove an unowned cache hit cannot recreate staged upload work and exact ownership reacquisition stages once.
  • Release solution build passes.
  • Complete Release suite passes: 8,164 tests, 5 intentional skips.
  • Exact source and binary commits match for all three physical runs.
  • Every client completed graceful character logoff and transport shutdown.
  • Slice E changes scheduling and hidden destination preparation only; the existing fixed-camera harness found no pixel-change gate requiring new subjective approval.
  • Divergence audit found no new retail behavior difference. AD-2 already owns the asynchronous readiness/quiescence adaptation; E6 only corrects its internal residency and cache-owner implementation.

Conclusion

Slice E's scheduler, lifecycle, reveal, convergence, allocation, and connected performance gates are complete. The client now spreads destination publication and old-world retirement across explicit work budgets without exposing partial worlds, replaying owners, or reducing visual quality. Slices F/G remain behind their explicit user approval gate.