Files
TheTree_mock/docs/plans/original-completion-2026-09-29/execution/OPERATIONS_SNAPSHOT_ENCODING.md
T
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

3.1 KiB

Operations snapshot validation and encoding

OperationsCoordinator.create_snapshot validated the assembled output tree and then traversed it again to canonicalize all containers. The new shared visitor can validate alone or validate while constructing the detached canonical output. Internal-state validation and shape checks are retained; only the final output validation/conversion passes are combined. Canonical String keys are sorted by the engine after insertion instead of repeated Variant string comparator callbacks. The project targets Godot4.7, matching the tested runtime.

Safety contracts remain: depth/node/collection/string budgets, finite numbers, permitted key types, collision rejection before conversion, original insertion-order error precedence, fully detached nested arrays/dictionaries, and exact canonical ordering. Failure returns no partially encoded value. Snapshot version and public saved schema are unchanged. The standalone canonical converter remains for existing restore comparisons.

Coordinator300 checks PASS (46 added for the checked-encoding path), ownership87, Runtime save/recovery96, midnight29, and Runtime operating integration51:563 targeted checks PASS. Source stayed fixed throughout that selected regression. Interleaved old/new comparison additionally checks100 byte-identical complete Operations snapshots on the same production-derived state, alternating timing order.

Interleaved microbenchmark: old2384.77us average/P952441us; new1999.03us/P952051us (about16% lower). The old implementation is retained as operations-before.gd.txt; reference_operations.gd adapts only standalone class/self-construction typing so both versions can be loaded together. Initial adapter parse failures are preserved separately and were fixed before the successful interleaved-final.log run. The game did not fail these harness-only attempts.

One paired full small-scene profile: Operations2466.65→2027.6us; whole snapshot5884.1→5382.55us; x1 update11417.825→10867.475us; x3P9537096→35841us. Same seed424242, macOS AppleM4/Godot4.7.2 headless,40 samples per speed, deferred dashboard flush included, autosave/GPU excluded. The4ms/12ms budgets still FAIL. This is not Windows/full-load/long-term acceptance.

Evidence: artifacts/operations-encoding-2026-09-29/validation.json, regression.json, source-start/source-change, change.patch, before/final-profile.json, interleaved.json and logs. Previous128-suite complete regression predates this change. A rendered three-day opening and separate-process continuation is running in opening-restart (session64200); do not count it passed until both phases finish.

Rendered restart complete

Both phases finished with exit0: writer80 and reader17,97 checks PASS (targeted plus continuation660). No production/data/test source changed during either phase. Three closes balanced with net profits -64,+346,+346G. Full gameplay state except timed domain events and complete reports match the uninterrupted path. Both third-close screenshots reviewed: Japanese ledger labels, balances and guest/staff scene intact. This is the current optimized source, still not latest Windows executable acceptance or complete original feature coverage.