OpenTPW

QUEUE-014: bounded native segment implementation#

The queue tool's supported plain-cell route uses whole-line passes, not repeated chain-extension operations. This is a bounded port of tp.exe, not a new host transaction policy. Synthetic tests describe expected raw fields; they are not recordings of executing the original game.

Evidence and ordering#

Explicit supported domain and residuals#

The new route is limited to primary types0/1/3, empty track records, no object/prototype/pool/bridge/slide reservation, and existing queue-tool starts or continuation of a newly committed active segment. Authoritative command admission independently requires an own/owner-zero queue start or typed same-owner residue with nonzero direction; arbitrary decoded empty/path starts are rejected. UI entry/exit clears its active-session flag, so reopening does not reuse a failed endpoint receipt. Free-start UI, other primary/secondary layers and overwrite-demolition remain the legacy route, not completed native semantics. A type3 placement counter at32767 is explicitly refused before mutation; native16-bit wrap and negative-counter persistence remain unsupported rather than clamped.

Singleton native undo is rejected unchanged: no active segment receipt generates zero movement. Completed terminal segments discard their active receipt. A closed/reopened tool reconstructs its queue corner stack and does not resurrect that receipt. Native guest effects beyond the already-supported set-down and queue refresh hooks remain residual; this document does not assert full native guest-timing equivalence.

Fidelity round 9 additions#

Persistence and replay compatibility#

Raw arrays are the only runtime truth. A shape classification permits a strict exceptional empty/path snapshot representation; it does not store a second mutable value map. Required sidecar members, ordinary-record agreement, coordinate uniqueness, supported flags/types and owner bounds are checked. Object footprints, tracks and pool-bridge composites are validated before restoration. Hash additions derive current exceptional raw bytes, not classification or origin.

Resume and TPI checkpoint version2 accept version1 only without new residue fields, then validate the migrated candidate. Shared layout export refuses exceptional raw metadata before building a package, since that separate format cannot preserve it.

Distinct queue-segment and active-undo command tags16/17 use command version2. Existing command kinds retain their version1 bytes and legacy execution meaning, even in mixed version2 logs. Version1 logs cannot contain new commands. Partial commits are accepted/logged because later native passes actually mutated the map.

Acceptance evidence#

The synthetic suites cover four directions; destructive cash failure and suffix residue; lateral/diagonal unlink; owner and link-count admission; terminal/interior NoModify; explicit counter overflow exclusion; final latch; active undo, empty survival and prior-path exception; signed debit and unsigned refund arithmetic; strict snapshot and migration; shared-export refusal; raw hashing and mixed-version replay. Source review, executable test results and CI must be reported separately. This document itself does not claim any tests or CI passed.

Source: docs/reverse/QUEUE-014-segment-contract.md in the project repository.