OpenTPW

WALK-R: guest steering and the walk terms of the queue gate#

Lane: WALK-R (research). Input: BOARD-plan derives the queues.no-stuck-queue wait bound from the original except for two walk terms. w is the called head's walk from slot 0 to the stand point (state 13). w₂ is the new head's walk up to slot 0 (state 12). BOARD-plan §6 calls them blocked, because no minimum speed of the steering step (0xfec9c) was traced. BOARD-plan §8 therefore fills them with OpenTPW's own walk model (w = 2, w₂ = 6), which needs a walk APPROX on the gate. This lane traces the steering and speed model of the Feral Mac SimThemePark.data (SHA-256 04809cd4…e295f5). It derives w and w₂ from that model and states when a walk can stall. It also specifies WALK-I (OpenTPW's walk) and the gate change.

Reproduce (private assets stay outside Git):

python3 -I tools/ppc-analysis/lanes/walk/walk_evidence.py /path/to/mac-feral/bin            # witness
python3 -I tools/ppc-analysis/lanes/walk/walk_evidence.py /path/to/mac-feral/bin --derive   # + enumeration
python3 -I tools/ppc-analysis/run_evidence_checks.py --mac-bin /path/to/mac-feral/bin

Confidence follows QUEUE-plan. High: an identity-pinned instruction or table entry whose operation was interpreted. Medium: a role inferred from callers, data or control flow that was read but not pinned field by field. Derived: a value computed from high/medium rules by bounded enumeration. All results are static. Nothing original was executed.

1. Result#

2. Assumptions (bounded claims)#

3. The steering step 0xfec9c (high)#

One call per walk step: 0xe6454 → 0xffd2c → 0xfec9c, with the navigation object at guest +212.

OrderCodeRule
Forces0xfecd8 loop over the global list (data 0xecd6c)for each (weight, behaviour): force = vtable+8(behaviour, nav), truncated to +24 (0xff098), times the weight (0xfd580, FixMul), summed
Sum0xfed54, 0xfed74sum truncated to +24, divided by ONE (0xfd704, FixDiv; data 0xecd84 = 0x10000, set at 0x10031c): mass 1
Velocity0xfed94..0xfedc0+16 += force, truncated to +28
Position0xfedc4..0xfee84new = +8 + +16. Committed only when the map accepts the new cell for mask +180. Otherwise a 1 is shifted into the history +176
Progress0xfeec4..0xfeeecprogress 0xff738 = ONE − FixDiv(remaining, +160). A 1 is shifted into +176 when it did not increase (+172)

Truncation 0xff098: unchanged when the length is < max, else scaled by FixDiv(max, length). Length is trunc(sqrt) of the squared components, computed exactly below 2¹² and otherwise in units of 2⁸ or 2¹⁸.

Behaviour list (0xff99c, called at level load 0x104d20 and cleared at 0x104e1c). Seven behaviours are registered (data 0x4477c). They are looked up by name from the string pool at code 0x1d2e8d:

NameWeightForce method (vtable +8)
avoid_walls0x10000 − 6554 = 0.90xfdc70
follow_path0x10000 − 0x8000 = 0.50xfe628
separation6553 = 0.10xfd778

seek, arrival, avoid_obstacle and repel_obstacle are registered but not in the list.

4. Where walk speed comes from (high)#

FieldWriterValue
+192 baseconstructor 0xe48d0 (data 0x4105e[rand % 5]); 0xd2870, 0xf2abc/0xf2ac8, 0xf4b70/0xf4b98 read the same table60, 80, 100, 120, 140
+194 bonusconstructor 0; needs block 0xef0d8/0xef0e4 on the guest's needs phase only (0xeed40: park turn & 3 = thing id & 3, see W1): 25 while trunc(toilet +428) & 0xff > 80 unsigned, else 0; 0xef8c4 (a state entry) 00 or 25
+196 boost0xeb0cc..0xeb0f4 (inside the outcome routine 0xeaaf8) adds trunc(6 × amount / 100) when the type's special ingredient is Sugar (ORACLE.md F20); 0xe6bbc..0xe6bd8 decays it by trunc(×99/100) per update≥ 0 (u16)
+200 s0xe6b28: (3.0·s + (+192 + +194 + +196)/100)·0.25 (data 0x550c, 0x5508; divisor 100 = data 0x41062)float
+24, +28setter 0xffe38 with s (0xe6ba8)see §1

The speed table data 0x41058 = {0, 25, 50, 60, 80, 100, 120, 140} has no writer: every reference through its two TOC slots is a load. No traced path lowers +192 below 60. Sums of u16 fields cannot be negative, so 0.6 bounds the smoothed input from below. At s = 0.6 the top speed is 0.12 cell per turn = 0.48 cell/s. At s = 1.0 it is 0.2 cell per turn = 0.806 cell/s; at s = 1.4, 1.13 cell/s. Nothing reads energy here. OpenTPW's Energy < 20 ⇒ × 0.7 has no counterpart, which PPC-guests already noted.

5. Arrival, waypoints and routes#

6. The other forces#

6.1 avoid_walls 0xfdc70 (high for the edge branch)#

The probe is position + velocity (0xff1c4). The probe cell's edges are tested with 0xd768c and mask +180, in the direction of motion only (velocity sign per axis; zero counts as positive). A blocked edge whose probe lies within the radius (0.2) gives a force of 2 × penetration, perpendicular to that edge (0xfde14..0xfdfe0). Four diagonal-corner branches follow (0xfdfe4..0xfe5e0, via 0xfc9e0); they were read but not modelled. In a straight queue strip the side forces are perpendicular to the walk. The enumeration models them with both sides fenced and with both open.

6.2 separation 0xfd778 (high for the gate, medium for the force)#

It is off when (idx is the last segment, or arrived) and the octile distance to the current waypoint is ≤ ONE + radius = 1.2 cells (0xfd7b4..0xfd840). Otherwise it sums the callback 0xfd5f4 (the transition vector at data 0x7088; 0xfd8a8 is the 0x7078 vector of another behaviour) over neighbours within 2 × radius (0x10087c); section 16 has the traced rules. The force goes into the sum truncated to +24 with weight 0.1, so it is at most 0.1·+24. In w₂ (route [Q], target in Q) it is always off. In w it can be on only on the first segment, toward Q's centre.

7. Stuck detector and stalls#

0xff810 counts the set bits among the low 15 of the history +176, as count/15 (0xff8e8..0xff97c). follow_path reroutes (0xff224 mode 1, which prepends the current cell) when progress ≠ ONE and that fraction is ≥ 0.4, that is 6 of 15 (0xfe6a4..0xfe700). Progress (0xff738) is measured against the current waypoint. On the last segment that is the destination cell's centre, not the target point.

Consequence: in w₂ the target (slot 0, depth byte 0) lies on Q's edge, half a cell from Q's centre. A guest that starts near the centre and walks to slot 0 moves away from the waypoint, so every step sets a history bit. A fast guest arrives (0.32 cell short of slot 0) before 6 bits accumulate. In the enumeration, a guest with s ≤ 0.31 does not, and reroutes (in all 8 variants; none for 0.32 ≤ s < 0.59). The reroute sends it back to Q's centre first, then the same thing can repeat. Whether it ever finishes is not derived. This is the precise stall condition: move-up walks with s ≤ 0.31. With base speed ≥ 60 that means guests younger than 3 updates (s ≥ 0.6·(1 − 0.75³) = 0.347 from n = 3). Under W2 it cannot occur.

Other conditions under which completion is not claimed:

8. Geometry used#

Local frame, in cells: E is y ∈ [−1, 0), Q is y ∈ [0, 1), B is y ∈ [1, 2), with x ∈ [0, 1).

9. Derivation of w and w₂ (derived)#

walk_evidence.walk restates sections 3, 5 and 6 in 16.16 fixed point, one call per update. It runs:

  1. avoid_walls on the strip sides, fenced or open;

  2. follow_path, exactly;

  3. separation by the traced on/off rule, either absent or at its maximum against the walk;

  4. per-force and total truncation to +24, then the +28 velocity truncation;

  5. the position update;

  6. the progress history and the 6-of-15 reroute.

A run fails if the guest leaves the strip, reroutes, or exceeds 5000 updates. worst_walk enumerates, per speed s:

derive_bounds repeats this over s = 0.59 … 2.00 in steps of 0.01, and over the 8 variants (separation off/oppose, fences on/off, FixMul/FixDiv rounding to nearest or floor).

Slot axisw maxw₂ maxFailures (s ≥ 0.59)
entrance edge12150
reversed20150

Below s = 0.59, w completes for every s down to the floor: at most 74 updates (separation off and opposing, fenced, nearest rounding; the reversed axis was not enumerated below 0.59). w₂ reroutes for s ≤ 0.31 in every variant. For 0.32 ≤ s ≤ 0.58 it completes in every sampled case, within 24 updates over all 8 variants (section 7).

A second check, varying_speed_check, re-derives the caps every update while s follows the traced smoothing with random inputs (minimum 0.592, up to 3.0). 400 walks (200 seeds × w, w₂) all stay within 20/15. Because s changes slowly, it adds no worse case.

This is a bounded enumeration, not a closed-form proof. The analytic fact behind it (high for the rules): on the last segment, with separation off and no wall force along the walk, the velocity relaxes toward a desired speed ≥ min(+28, 0.143 cell) with factor ½ per update (v' = v + ½(desired − v)). A guest therefore cannot stall there.

10. OpenTPW compared with the traced model#

AspectOriginal (traced)OpenTPW (source/OpenTPW/World/Guests)
Speed sourceper guest: base 60–140 (+25 toilet, + boost) / 100, smoothed 0.75/0.25 per update; cap 0.2·s cell/update, floor 0.01GuestSettings.WalkSpeedCellsPerSecond 1.0 ("approximation: no original source", GuestSettings.cs:47)
0.7 factornone× 0.7 while Energy < 20 (GuestSimulation.cs:347)
Cadenceone steering step per park turn (248 ms)kinematic Move per 60 Hz tick (GuestSimulation.cs:350)
Motionvelocity with acceleration (≤ +24, weight 0.5), carried over between walks; arrival ramp min(vmax, d/2)constant speed, heading snaps, no carry-over
Arrivaloctile < 0.32 cell on the last segment; waypoints passed at octile < 0.4exact snap to the waypoint
Waypointscell centres from the start cellcell centres plus random offsets, cell by cell
Forcesavoid_walls 0.9, separation 0.1none
Stuck handling6 of 15 non-improving steps → reroutenone
Sub-cell bytesbyte/256byte/255 (QueuePositionPoint, GuestSimulation.cs:761)
Stand pointentrance cell at EntryCellStandPos (Belly: its centre)front cell's edge toward the ride (StandPoint, GuestSimulation.cs:787, QUEUE-007)

OpenTPW's walk terms (BOARD-plan §8: w = 2, w₂ = 6) are below the traced 20 and 15, so OpenTPW waits stay under the traced bound.

11. WALK-I implementation spec#

Goal: replace WalkSpeedCellsPerSecond and the 0.7 factor with the traced model. Scope is guest walks (paths and queues). Rendering interpolates between park turns.

  1. Per-guest speed state. BaseSpeed (u16, from {60, 80, 100, 120, 140} by random.Next(5) at creation), ToiletBonus (25 while Toilet > 80, recomputed each update), Boost (u16, ×99/100 truncated per update; increments were WALK-001 until 0xeb0f4 was traced), and SmoothedSpeed (float, 0 at creation). Each park turn, before the state logic, set SmoothedSpeed = (3·SmoothedSpeed + sum/100)·0.25. Then MaxSpeed = max(655, trunc(min(s, 2)·0.2·65536)) and MaxForce = max(655, trunc(min(s, 2)·0.4·65536)).

  2. Navigation state in 16.16 ints: position, velocity (never reset by a new destination), radius 13107, arrived, waypoint index, and the buffered cell-centre waypoints (route includes the start cell; ≤ 5 buffered, re-route on exhaustion), history bits, progress and total.

  3. Steering step once per park turn in walking states, in list order avoid_walls (0.9), follow_path (0.5), separation (0.1). Truncation, FixMul/FixDiv and length are exactly as walk_evidence.py. Use FixMul rounding to nearest (Toolbox) and keep one fixed-point helper. The position commit checks the cell's walkability for the guest.

  4. follow_path, arrival and the reroute exactly as section 5 and section 7. The walk step returns arrived / still walking. A routing failure is arrived (as 0xff224).

  5. avoid_walls edge branch as section 6.1. The corner branches and the separation callback stay [APPROX:WALK-002]/[APPROX:WALK-003] (evidence needed: 0xfc9e0, 0xfd5f4, 0x10087c; WALK-F ported the separation, section 16).

  6. Geometry: sub-cell bytes /256. Stand point = entrance cell (+50) at trunc(255·EntryCellStandPos) after rotation (0xde1d8). This closes QUEUE-007. QUEUE-006's axis keeps its tag until the link compass is pinned.

  7. Remove GuestSettings.WalkSpeedCellsPerSecond, GuestSimulation.Speed and the 0.7 factor. HeadNotReadyBound (M3Gate.cs:1120) must then use the traced per-walk bounds: w₂ per move-up, and per queue cell walked at most ⌈1.2/0.118⌉ + 3 updates. That cell term needs its own enumeration in WALK-I.

  8. Tests: port test_walk_evidence cases. Required:

    • speed caps (655 floor, cap at 2.0);

    • smoothing;

    • arrival radius 20971;

    • the w = 10 / w₂ = 14 worst cases at s = 0.59 on the 7-grid;

    • the w₂ reroute at s = 0.2;

    • velocity carry-over.

12. Gate change for queues.no-stuck-queue#

This applies to BOARD-plan §8 and does not need WALK-I.

  1. Set w = 20 and w₂ = 15 (WalkTerms constants citing WALK-plan §9; use w = 12 once the slot axis is pinned). This replaces ⌈d / (0.7·v·T)⌉ + 1 from WalkSpeedCellsPerSecond, so H = 21 + 35 = 56. Report τ_max = CAP·H + R + 1 − (DUR + 1 s)/T = 277 turns = 68.696 s and W_max = 8021 turns = 1989.208 s (1782 turns = 441.936 s with Qmax = 21 after ORACLE-V F1).

  2. Drop the walk APPROX. Do not introduce BOARD-plan's narrowed tag. [APPROX:GATE-003] goes away with BOARD's spec, and no walk tag replaces it. The derivation string cites walk_evidence.py (SHA-pinned binary) and conditions W2–W4.

  3. Scope conditions join A3's excluded-turn rule. A wait is not judged (counted and reported) when, during it:

    • a boarding guest (a called head or a new head) was younger than 15 park turns since spawn (W2);

    • the front segment is not straight: E, Q and the next queue cell are not in a line (W3);

    • the ride's EntryCellStandPos ≠ (0.5, 0.5) (W4).

  4. Stall, judged separately. A guest in the queue-walk states (OpenTPW WaitingToBoard walking to the stand point, MovingUpQueue) for more than w (20) or w₂ (15) consecutive turns, within the scope conditions, is a FAIL labelled walk-stall. The traced model completes those walks within these bounds. Outside the conditions it is reported, not judged.

  5. Unchanged: BOARD-plan §8 assertions 1–6, the baseline check (p = 50 bound 4188 turns ≥ the measured 254.4 s = 1026 turns).

13. Unresolved#

14. Witnesses and tests#

Lane tools/ppc-analysis/lanes/walk/: walk_evidence.py and test_walk_evidence.py. The runner discovers it.

15. WALK-I: implementation and the queue walk term#

WALK-I implements §11 in source/OpenTPW/World/Guests/GuestNavigation.cs (Fixed16, GuestNavigation, GuestSpeed) and GuestSimulation. The C# step reproduces this lane's pinned worst cases exactly (WalkTests.WorstWalksAtTheSpeedFloorMatchTheWitness: w = 10, w₂ = 14 and reversed w = 17 at s = 0.59 on the 7-grid; the w₂ reroute at s = 0.2; w = 72 at the floor). The untraced parts are the walk register: WALK-001 (boost increments), WALK-002 (avoid_walls' corner branches), WALK-003 (the separation force was zero until WALK-F, section 16) and WALK-004 (OpenTPW's routes: one path cell per destination, the queue cells in order, refilled five waypoints at a time; the stuck reroute prepends the current cell). A queue walk also treats the cell ahead of its destination and the cell behind its start as walkable, as this lane's strip does (E and B are open there). QUEUE-007 is closed: the stand point is in the entrance cell at trunc(255 · EntryCellStandPos) after rotation.

Per-cell term (§11.7). WalkTests.QueueWalkTermFullEnumeration (OPENTPW_WALK_DERIVE=1) runs OpenTPW's step on queue routes:

A walk fails only at 5,000 updates; a reroute is followed (WALK-004). About 74 million walks, 0 failures:

Crossings k012345812162025
Worst (updates)8182533425076109143176218
k × 9 + 1515243342516087123159195240

So one queue walk across k cells to a slot takes at most k × C + w₂ updates with C = 9. The slope of the long routes is 8.4–8.5 updates per cell: at s ≥ 0.59 the max speed is ≥ 7,733, and a straight cell takes 65,536 / 7,733 = 8.47 updates at full speed. 573 walks with one crossing rerouted (a fast guest with a stale velocity into a fence) and still arrived within 18. Like w and w₂, the term needs W2. It is a bounded enumeration, not a proof, and it holds for OpenTPW's walk: for the original, to the extent WALK-002 to WALK-004 do. The M3 gate uses it for the head-not-ready bound (N × C + 2 × w₂ for two walks over N cells) and adds the join walk J(p) = (N − cell of p) × C + w₂ to W(p) (docs/M3-GATE.md). That retires [APPROX:GATE-004] and [APPROX:GATE-005].

PPC oracle (docs/reverse/ORACLE.md, 16bb38e). The oracle ran 0xffe38 and 0xe6b28 in isolation. The setter agrees with §1 on 518 inputs, including NaN → 655 and ±∞. For the smoothing it reported F6: 0xe6b9c is fmadds (one rounding of 3·s + sum/100), and boost · 99 is stored as a u16 before /100, so a boost above 661 wraps. WALK-I uses MathF.FusedMultiplyAdd and the u16 product (GuestSpeed.Smooth, GuestSpeed.Decay). The oracle bridge's hooks map to two public seams that GuestSimulation itself calls: guest_speed_limits → GuestSpeed.Caps(s) (max speed +28, max force +24) and guest_speed_smoothing → GuestSpeed.Update(s, base, bonus, boost) (s, boost, max speed, max force). The bridge cases are added with the oracle after merge.

16. WALK-F: corrections from review WALK-V#

Review WALK-V (docs/reverse/REVIEW-WALK.md) found the gate loosened on approximations it no longer named, a wrong citation for the separation force and untagged walk rules. WALK-F:

The enumeration again. With the ported separation's "oppose" variant and the first-edge rule, QueueWalkTermFullEnumeration gives the same worst cases as the table in section 15 (8, 18, 25, 33, 42, 50, 76, 109, 143, 176, 218 updates for k = 0 … 25) with 0 failures; 420 one-crossing walks rerouted (573 before) and still arrived within 18. The enumeration does not cover backward walks, folded queues (a guest stepping across a fold onto a cell with a smaller index) or the gate's accounting of a walk in progress. Review WALK-V's adversarial harness covered the first two (about 10⁹ walks, no single walk above k × 9 + 15; redirect chains up to 66 of 66 turns), and the gate now charges each head its walks as set up instead of its queue cell index (WV-12, docs/M3-GATE.md).

The gate (WV-1 to WV-4, WV-11). C = 9 (27 since the original walk of WALK-004: M3-GATE.md), J(p), the head's own walk and the head-not-ready bound are registered as [APPROX:GATE-006]: they come from enumerating OpenTPW's own port, not from a proof for the original. The owner accepted on October 10, 2026 that the derived head-not-ready bound is looser than the retired GATE-005 check (110 against 84 turns for the 6-cell Belly Bounce queue, 65 against 50 for one cell) on two conditions, both met: the registration, and stricter checks where the bound was blind. A head is judged from the turn it is 15 turns old (WV-2, not exempted for good), and each head is held to its own remaining walk + 26 where that is smaller (WV-3): a head held at position 0 fails after 26 turns.

Source: docs/reverse/WALK-plan.md in the project repository.