acdream/docs/research/2026-07-27-slice-k4-resource-telemetry-checkpoint.md

171 lines
7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Slice K4 resource telemetry checkpoint
**Date:** 2026-07-27
**Status:** Implementation and automated gates complete; exact connected
terminal gate active
**Production commits:** `cb512fd0`, `97c174fb`, `bd236ce5`, `776482da`
## Outcome
The Linux headless process emits one structured resource sample at
startup, every 30 seconds, before scheduler stop, and after terminal disposal.
Sampling is driven by the existing process scheduler's absolute deadline. It
does not add a worker, timer, or callback per session.
Each sample reports:
- working set, private bytes, virtual bytes, total CPU time, interval CPU as
both core-equivalent and machine-normalized percentages;
- managed live, heap, fragmentation, committed and allocated bytes, memory
load, GC pause percentage, and generation counts;
- process thread/handle counts and Linux file/socket descriptors;
- configured, in-world, faulted, reconnecting, and converged Runtime roots,
entity/inventory totals, and exact host-lease count;
- scheduler waits, turns, catch-up collapses, late-deadline count, mean and
maximum lateness;
- shared-content lease count, mapped virtual bytes, disposal state, and final
convergence.
No account password or credential reference is included in this schema.
## Two-account connected evidence
One native Linux process connected the two locally available accounts:
- `testaccount` / `+Acdream`
- `testaccount2` / `+Horan`
Both entered Rynthid and maintained independent Runtime roots and movement.
The user asked that the current exact `776482da` process stay running for the
retail-observer gate.
The first process sample after both world entries reported:
| Metric | Value |
|---|---:|
| private bytes | 207,966,208 |
| working set | 191,553,536 |
| managed live bytes | 71,108,368 |
| threads | 16 |
| handles | 115 |
| Linux descriptors | 114 |
| socket descriptors | 3 |
| shared content leases | 2 |
| mapped package virtual bytes | 29,908,271,024 |
The roughly 29.9 GB mapped-package value is address space, not resident or
private memory. The mmap remains shared and demand-paged.
The earlier fixed scheduler artifact ran for roughly 16 minutes and plateaued
near 311.8 MiB private / 303.8 MiB resident while entity count rose to roughly
600. Its steady combined two-bot CPU was 2.33.2% of one core, scheduler mean
lateness was about 3.3 ms, and it retained 1517 threads, 115 handles, 116
Linux descriptors, and three sockets. It recorded no session fault or
reconnect debt. That process ended without a terminal sample, so it is soak
evidence rather than the closeout teardown gate.
The current exact `776482da` process entered Rynthid with both accounts and
reported four consecutive passing samples in its first 90 seconds. After
initial hydration, combined CPU was 2.52.9% of one core, waits were
8996/second, turns were 133/second, continuing catch-ups were zero, mean
lateness was about 3.1 ms, and maximum lateness was 145.1 ms. It had zero
faulted or reconnecting sessions and exactly two Runtime/content leases.
## Scheduler finding and correction
The connected samples exposed two distinct scheduler problems:
1. scheduler deadlines began during host construction, before sequential
account connects completed, producing a false initial catch-up and a
roughly 615 ms maximum-lateness sample;
2. the final positive sub-millisecond `Task.Delay` remainder rounded down to
zero on Linux, causing millions of wait-loop turns between actual 15 ms
simulation deadlines.
The correction:
- rebases every session and observation deadline exactly once after all
configured sessions enter the world;
- refuses to rebase a scheduler that has already dispatched;
- rounds only positive sub-millisecond timer waits up to one millisecond;
- retains the 15 ms absolute simulation cadence and bounded catch-up rules.
The process still under user observation was intentionally not restarted, so
its high wait counter belongs to the pre-correction artifact. The committed
correction is protected by deterministic rebase/lateness tests and a real
system-timer test that fails if the scheduler busy-loops between turns.
## Committed resource envelope
`776482da` commits the `k4-linux-30-session` numeric profile. For `N`
configured sessions, the principal ceilings are:
| Dimension | Ceiling |
|---|---:|
| private bytes | 224 MiB shared + 64 MiB/session |
| working set | 224 MiB shared + 64 MiB/session |
| managed live bytes | 64 MiB shared + 48 MiB/session |
| managed heap | 64 MiB shared + 48 MiB/session |
| CPU | 2% of one core shared + 3%/session |
| threads | 48 process-wide |
| handles | 128 shared + 3/session |
| Linux descriptors | 128 shared + 3/session |
| sockets | 1 shared + 2/session |
| scheduler waits | 250/second process-wide |
| scheduler catch-ups | 1/second process-wide |
| mean/max lateness | 10/750 ms |
The evaluator fails closed on non-finite metrics, reports named violations,
requires exact running lease/session accounting, and requires all Runtime
roots plus shared content to converge in the `disposed` sample. It is
observational only.
## Automated endurance and adversarial gates
- Content sharing and same-GUID/portal/reconnect isolation run at 1, 5, 10,
and 30 roots.
- The 30-root workload advances 480,000 frames per root: two simulated hours
and 14.4 million stable-order scheduler turns.
- Every root performs recurring movement, use, combat, spell, chat, portal,
death, and reconnect activity.
- Whole-process allocation stays below 384 KiB/second and retained growth
stays below 16 MiB in the deterministic endurance fixture.
- Five 30-root process runs inject randomized cancellation across lifecycle
edges and converge every Runtime root and shared-content lease.
- The resource evaluator covers a passing recorded Rynthid sample, every
individually named resource/ownership debt, terminal success/failure, and
non-finite metrics.
- Windows Headless Release: 67 passed.
- Native Ubuntu Headless Release: 67 passed.
- Runtime Release: 412 passed.
- App Release: 3,722 passed / 3 skipped.
- Complete Windows Release suite: 8,784 passed / 5 skipped.
- Windows and native Ubuntu Release builds complete.
- Diagnostics assert no credential text and exact 1/5/10/30-root terminal
convergence.
## Remaining K4 gate
The exact `776482da` two-account process is running under the committed
envelope. After the observer window it must receive graceful cancellation and
emit a final `disposed` sample with:
- two converged Runtime roots;
- zero in-world/reconnecting/faulted sessions;
- zero entities, inventory objects, and host leases;
- zero shared-content leases with content disposed/converged;
- `withinCeilings=true`.
Only then does Slice K close. Available credentials support two simultaneous
connected accounts; 5/10/30-session scale and two-hour duration are therefore
proved by the deterministic in-process production-owner fixtures.
## Rollback
```text
git revert 776482da8225d88a7c6128022d137d26f9266a87
git revert bd236ce553718cfb1248703f4a2b17b35733b11c
git revert 97c174fbb2d72fb94e2fe07448bb257989ed8941
git revert cb512fd0916fbf49285c9b64df1630c5a69a0d20
```