Files
TheTree_mock/docs/plans/original-completion-2026-09-29/execution/SNAPSHOT_OWNERSHIP.md
Takeshi 5dde0c5ec2 Record original-alignment implementation and traceability checkpoint
Capture current source, content data, tests, asset licenses, and original-specification traceability. Original implementation remains incomplete. The accepted matching UI generation passed 154 suites and 12,253 checks, with eight rendered staff-contract screens reviewed. Latest native Windows and full-original acceptance remain outstanding.
2026-09-30 23:52:24 +09:00

4.6 KiB

Transfer detached subsystem snapshots without a second full copy

Runtime create_snapshot previously assembled the results of every subsystem snapshot/serializer, then passed the complete tree into SimulationSnapshot.capture, which deep-copied it again. Runtime now assembles those freshly owned containers, captures the clock/resource envelope at the same point, and attaches the owned systems tree directly. Generic SimulationSnapshot.capture remains unchanged and still deep-copies arbitrary caller extras. No schema, ordering, hash format or publication frequency changes.

Reviewed component snapshot builders: world/path/infrastructure build serialized rows and detached cells; operation serialization recursively creates canonical containers; economy/command/event records return detached dictionaries; facility/guest/staff serializers copy nested policies, histories, tasks and definitions; inventory/logistics/kitchen, construction/excavation, authority/defense/relationships/progression and weather use copies or new scalar rows. Runtime manifest/RNG/movement/logistics/event-definition wrappers likewise create new arrays/dictionaries. The Runtime path now relies on that existing component ownership contract rather than masking aliases with another aggregate clone.

Added a regression registered in make test-perf. It independently mutates all40 Runtime snapshot sections in new-game and populated-demo states, including adding values to empty typed arrays and clearing/replacing nested dictionaries; live state must remain identical. It also covers the clock/resources, retained snapshots while live time advances, exact restore/replay, and generic caller-extra isolation. Before and after both87 checks PASS. Runtime Save/Load/recovery/atomic-rejection96 checks PASS, targeted total183.

Single paired small production-scene profile: snapshot average6766.5→5457.4us (~19% lower); x1 average12636.875→11957.1us (~5% lower); x3 P9544193→36908us (~16% lower). Same seed424242,40 samples per speed, macOS Godot4.7.2 headless, includes deferred dashboard flush, excludes GPU and autosave. Both4ms/12ms budgets remain FAILED. This is not a statistical/full-load/Windows acceptance claim.

Because the change spans every saved subsystem, started the complete source regression in artifacts/snapshot-full-regression-2026-09-29 (expected128 unique scripts). Runner session74488 is the handle to resume. Inspect authoritative completion and compare source-start.json at the end; do not infer success from partial all-tests.json. After successful regression, rerun the paired opening/restart scenario. The last Windows ZIP still predates this and the preceding infrastructure validation optimization.

Evidence: artifacts/snapshot-ownership-2026-09-29/validation.json, before/after ownership logs, save-lifecycle.log, profile-before.json and profile-after.json. Ownership checks exercise current fixtures, not a proof that every possible future subsystem branch can never introduce an alias; retain this test and the general capture contract when adding new components.

Complete source regression after both optimizations

Runner session74488 terminated with exit0. All128 unique discovered source test scripts passed; missing/unexpected scripts and ERROR/SCRIPT ERROR logs were empty. All283 tracked source/data/scene/test files match the starting manifest, including no newly added or removed files. completion.json and source-end.json are retained in artifacts/snapshot-full-regression-2026-09-29. Tooling/docs changes during the run are outside that production-source manifest and do not alter the tested game. This closes the regression gap for the infrastructure-validation and snapshot-ownership optimizations, as well as the prior ledger display correction. It does not certify missing original features or unmet performance budgets.

A new rendered paired opening/restart run started after that success, output artifacts/snapshot-opening-restart-2026-09-29, runner session84272. It remains pending until both processes and source-change comparison finish; prior runs are not substituted for this result.

Paired rendered continuation completed after the128-suite pass: writer80 and fresh-process reader17 checks, total97PASS, both exit0, no source changes. All three closes balance (-64,+346,+346G). Gameplay state (excluding only wall-clock domain events) and complete financial reports match across process restart. Both third-close screenshots were visually reviewed. Evidence: artifacts/snapshot-opening-restart-2026-09-29/validation.json. This validates the existing three-day inn flow after both optimizations, not the full unfinished original game.