Stabilization batch 19¶
Scope: diagnostic evidence for existing stabilization work, especially GAME-01 startup, GAME-02 reward/pause ownership, and save load/write investigation. No new gameplay feature, save format, recovery policy, network telemetry, or broad manager rewrite.
Implementation¶
GameDiagnostics writes opt-in [TCTrace] events through the existing Unity log. Enable with the exact command-line flag -tinyChaosTrace; default is off, including release players. Each launch identifies a random session, version/build GUID, Unity version, and platform. Events have a sequence and monotonic elapsed milliseconds; operation begin/end/failure events share an operation number and measure duration with Stopwatch, independent of Time.timeScale. Log only failure type, preserving the original exception and its propagation. Each session emits at most 512 ordinary trace events plus one limit warning; later tracing is suppressed without skipping the underlying operation. This limit applies to the new trace, not every existing Unity message.
Trace the outer AppInitiator initialization and its Steam check/identity query, service setup, save startup, settings, and menu-load await. A scene-loaded hook records actual activated scene names. Keep existing startup coordination and exception behavior; instrumentation is not error recovery. Remove the existing startup/service messages that print Steam ID and the legacy resolver's full path message.
SaveManager brackets config load/write and player decrypt/deserialize/serialize/encrypt/write. SaveService brackets the modern disk reads/writes underneath, using fixed player/config/other labels, never filenames, identity paths, or payloads. Existing legacy discovery/migration behavior is unchanged; its total startup is bracketed, not every legacy stream operation.
RewardRoller records enqueue, phase, and accepted reroll transitions; UpgradeSelection records confirmation indices/player count. GameStateService records changed flags and applied time-scale changes without per-frame output. The common phase setter replaces existing phase assignments; the reward type is assigned before its first phase marker for accurate attribution. Gameplay rules remain those verified in batch 18.
The helper is intended for existing main-thread Unity lifecycle/save/reward calls. It is not a background-thread logging queue, a remote reporting service, or a profiler. A missing completion marker is a lead, not proof that the bracketed operation caused a main-thread freeze. Existing logs outside this helper can still contain sensitive values and require review before sharing.
Verification¶
New synchronous Editor-only RunBatch19 captures actual Unity log messages. With tracing enabled, seven groups pass: session/build header; operation correlation and elapsed timing while time scale is zero; synchronous exception identity/message omission; async completion/failure preservation; real SaveService disk roundtrip and missing-read failure using a disposable temporary root; state-change semantics/duplicate suppression; cap enforcement while actions continue. Editor terminal exit 0. Fixtures do not construct a live SaveService or touch the normal profile; the data-only resolver root is replaced before use and removed afterward.
With tracing disabled, 2/2 groups pass with terminal exit 0: work/results and async callbacks still execute, no trace is emitted, and exception identity is unchanged. RunBatch18 with tracing enabled remains 17/17, terminal exit 0, and emits 51 trace messages covering the actual reward coroutines and pause/queue/selection/confirmation handoff. This regression uses the existing data-only fixture, not physical input or a full gameplay pass. Existing Unity Version Control and headless Localization package diagnostics remain separate from assertions.
Linux player evidence¶
Unity 6000.2.8f1 builds StandaloneLinux64 IL2CPP successfully; CLI terminal exit 0. UTC provenance: 2026-10-25 03:19:46.984 → 03:26:27.351. Source 5347e4600bb897ca1c9fa8cb80cb095f6ee0ce0a, dirty. Artifact /tmp/tinychaos-batch19-linux/TinyChaos.x86_64; GameAssembly SHA-256 5ef61875a525e4bc3a6f61f15b9cab58b972c06cf188891c399803e14ead26b0. Trace header identifies runtime version 0.9.0 and build GUID 9cd26ae5c8c84499863b46bcb823199f.
Two separate trace-enabled player processes use the same temporary child-only XDG profile/cache root. PID/executable/window/focus/1280×720 guards protect each input and screenshot; no focus is forced. Both reach visibly usable MainMenu screens after the normal logo/title transition. The fresh process records 74 trace events and 35 complete paired operations, including player/config writes. Relaunch records 72 events and 34 complete paired operations, including player read, decrypt/deserialize completion, and config load. Sequence numbers are consecutive; every instrumented begin has its matching successful end, with no failure or cap marker. Session IDs differ while the build identity is the same.
The encrypted player-save bytes remain identical across reload: SHA-256 04d54d0adc07182a464cb35b04cf27c44342c177552b382bae0658e0f552bb70. This establishes fresh write and current-profile load instrumentation, not legacy/malformed recovery or progression accumulation. Neither native probe enters an arena: reward trace coverage is the actual-coroutine Editor regression above, with batch-18 real-player behavior retained as earlier evidence. No physical-controller, co-op, Windows, full gameplay, or reported freeze resolution is claimed.
The new trace observes 13 config writes during fresh startup and 12 on reload, before owner interaction with Settings. These are existing behavior exposed by instrumentation, now recorded under SAVE-06. Startup initialize scopes complete in 664.276/665.475 ms in these probes; those spans exclude earlier engine startup and later user/menu interaction. Do not equate them to total launch time or infer the one-minute reported symptom's cause. Profiling/writing-policy changes remain a separate focused investigation.
Both players are deliberately terminated after evidence collection, and both player/wrapper terminal exits are 0. Existing Discord ResultException remains NET-02; no new gameplay exception is observed. Raw logs, screenshots, input/focus records, summaries, and provenance stay under /tmp/tinychaos-batch19*, outside Git. Logs may still contain preexisting sensitive output; share reviewed excerpts rather than assuming the entire file is sanitized.
Workspace preservation¶
After completed build exit, restore only the inserted Linux toolchain entries to exact pre-run package bytes, remove generated Addressables Linux/linker metadata, and restore the reviewed TimeManager serialization-only fixed-timestep conversion. Play Mode changes four engine session preference keys; compare their XML entries and restore the pre-run bytes. Final normal-profile paths/bytes match the baseline after both isolated player launches.
Of 552 snapshotted project paths, eight intended production files change; the other 544 retain exact pre-run bytes. GameDiagnostics.cs and DiagnosticsChecks.cs with new metadata are intentional additions. Production CRLF, all existing scenes/prefabs/meta identities, uncertain audio deletion, Plastic evidence, and the nonempty Git index lock are preserved. No commit/push is attempted. Final checks pass: 362 active local document links, 52 uniquely scheduled finding IDs, tracked/new-file whitespace and metadata, exact intended source delta, normal-profile bytes, and no remaining Editor/player process. The canonical Unity stabilization skill records the instrumentation-verification lesson, passes skill validation, and retains its installed symlink.