feat(streaming): enforce typed completion queues

Replace the flat deferred list, priority scan, unload bypass, and count-only execution cap with exact destination/control/unload/Near/Far FIFOs behind one typed frame meter. Price worker results before adoption, retain exact retry identity, reject stale generations without payload retention, and publish queue pressure through lifecycle diagnostics.

Tests: dotnet build AcDream.slnx -c Release --no-restore; dotnet test AcDream.slnx -c Release --no-restore (8138 passed, 5 skipped)
This commit is contained in:
Erik 2026-07-24 17:48:24 +02:00
parent ac45cb1bd7
commit b8f6317fe1
15 changed files with 1261 additions and 336 deletions

View file

@ -712,11 +712,16 @@ partially hydrated cell membership or shell placement to the renderer.
update-thread streaming cost. `StreamingWorkMeter` owns the frame-scoped
admission ledger; `LandblockStreamResultCost` assigns deterministic charges to
immutable completion arrays and logical retained entries without claiming to
measure CLR allocator overhead. During Slice E1 the ledger is observational:
the existing scheduler still executes its accepted work, while lifecycle
artifacts record would-yield limits, elapsed work, retained backlog bytes/age,
and pending publication/retirement counts. Enforcement belongs to the explicit
Slice E scheduler, not to presentation owners or the worker.
measure CLR allocator overhead. `LandblockStreamer` exposes one allocation-free
single-consumer peek/read source so the update thread prices a result before
adopting it. `StreamingController` is the sole scheduler: it admits through the
typed meter into reusable destination/control/unload/Near/Far FIFOs, preserves
exact reference identity and retry position, rejects stale generations, and
executes every class through the same meter. Priority changes order, never the
budget. Lifecycle artifacts publish worker and per-class backlog, retained
bytes/age, yields, oversizes, overruns, and pending publication/retirement
facts. Publication remains transaction-atomic until Slice E4; retirement
quiesce/cursors belong to E3.
### World-reveal readiness ownership

View file

@ -1605,8 +1605,13 @@ port in any phase — no separate listing here.
> and dense-Arwic physical routes passed; third-visit cache residence was
> non-growing and no checkpoint retained staged or retiring bytes. [Residency
> report](../research/2026-07-24-slice-d-unified-residency-report.md). Slice E
> cost-budgeted streaming/retirement is active. F/G and J retain their explicit
> approval gates.
> cost-budgeted streaming/retirement is active. E2 has replaced the flat
> deferred list, count-only throttle, priority hunt, and unload bypass with one
> typed-meter scheduler over explicit stable destination/control/unload/Near/
> Far queues; production prices worker results before adoption and lifecycle
> artifacts expose exact backlog/retained-byte facts. E3 next adds immediate
> old-generation quiesce and cursored retirement. F/G and J retain their
> explicit approval gates.
**Spec:** `docs/superpowers/specs/2026-07-05-modern-pipeline-design.md` (the
umbrella design — read it first). **Goal:** smoothness first (no frame over

View file

@ -93,9 +93,10 @@ The separately authorized modern-runtime performance program has completed
Slices AD: corrected measurement, prepared-package bake/dedup, package-only
production streaming, and typed unified residency. Its physical capped,
uncapped, and dense connected gates pass without a visual-quality change.
Slice E cost-budgets portal publication and retirement next. Slices F/G remain
behind their explicit ECS approval gate, and Slice J remains behind its
gameplay-owner approval gate.
Slice E0E2 now define and enforce typed completion admission through explicit
stable priority queues; E3 adds immediate old-generation quiesce and cursored
retirement next. Slices F/G remain behind their explicit ECS approval gate,
and Slice J remains behind its gameplay-owner approval gate.
Slice 1's 18-cell favorite-spell overflow bar is user-accepted. Slice 2's
status hand selected-object availability and existing

View file

@ -1,6 +1,6 @@
# Modern Runtime Slice E — Cost-budgeted streaming and retirement
**Status:** active — E0/E1 complete; E2 explicit admission queues next
**Status:** active — E0/E1/E2 complete; E3 quiesce and budgeted retirement next
**Program:** `docs/plans/2026-07-24-modern-runtime-architecture.md`
**Baseline:** Slice D closeout commit `66690805`
**Behavior contract:** no visual-quality or retail-behavior reduction
@ -255,6 +255,30 @@ retry, stale-generation, and deferred-compaction tests remain green.
- Keep current publication atomic until E4, but execute only work admitted by
the typed meter.
**Complete 2026-07-24.** Production now consumes the worker channel through
one allocation-free `TryPeek`/`TryRead` source, prices the exact immutable
result before adoption, and admits it through the typed completion-count and
retained-CPU dimensions. Accepted work lives in reusable stable FIFOs for
destination, control, unload, Near, and Far classes. FIFO order is exact inside
each class, a blocked publication head does not reorder its tail, callback
appends cannot invalidate an active receipt, and exact-reference compaction
cannot conflate equal records or GUID/landblock reuse.
`_deferredApply`, `MaxDrainIterations`, direct priority hunting, and the unload
budget bypass are gone. Destination and unload work win queue order but consume
the same execution meter. One indivisible publication may make progress after
admission work, but that privilege is granted only once per frame and every
oversize/overrun remains named. Stale generations consume a bounded admission
without retaining their payload. The old completion-count quality setting now
selects a complete scaled time/count/byte/operation profile rather than acting
as a hidden second throttle.
Validation: 240 focused App streaming tests and 58 focused Core streamer/
controller tests passed; the complete App suite passed 3,656 / 3 skipped, the
complete solution passed 8,138 / 5 skipped, and the Release solution build was
clean. Physical connected and visual gates are intentionally deferred until
E6; the active desktop was RDP and is not valid performance evidence.
### E3 — Quiesce and budgeted retirement
- Add destination-generation world quiesce.