OpenTPW

BOARD-R: boarding latency of BOUNCE rides and the queue gate spec#

Lane: BOARD-R (research). Input: the M3 gate ends at 15 pass / 0 fail / 1 unresolved. The open row is queues.no-stuck-queue. It reports the QUEUE-plan §9b wait bound with the boarding latency τ = 0 s ([APPROX:GATE-003]). This lane traces the boarding path of the Feral Mac SimThemePark.data (SHA-256 04809cd4…e295f5) and the four BOUNCE scripts of the PC corpus. From those rules it derives a wait bound and τ_max. It names the two terms that cannot be derived, and specifies the gate assertion.

Reproduce (private assets stay outside Git):

python3 -I tools/ppc-analysis/lanes/board/board_evidence.py /path/to/mac-feral/bin --pc-data /path/to/Data
python3 -I tools/ppc-analysis/run_evidence_checks.py --mac-bin /path/to/mac-feral/bin --pc-data /path/to/Data

Confidence follows QUEUE-plan. High: an identity-pinned instruction or table entry whose operation was interpreted. Medium: a role inferred from callers or data. Blocked: not derivable from traced rules. All results are static. Nothing original was executed.

1. Result#

For Belly Bounce (jungle, id 1100, CAP 5, DUR 30 s), in park turns (T = 248 ms):

This bound is loose. It assumes every boarding pays a full handshake and every CAP-th boarding pays a full hold. A turn-by-turn model of the traced rules (section 7.3) never exceeded it, and reached at most about 0.6 of it.

2. Assumptions (bounded claims)#

3. The host handshake (high)#

The table runs in order, one park turn per guest or ride update.

StepCodeRule
Callride update 0xe0a8c → (+408 == 0) 0xe1864 → 0xe1404LETMEON == 0, ONRIDE < CAP, RUNNING gate bypassed by RunsContinuously, nobody pending, head in state 11 at +497 == 0 → head +504 = 1, pending +104 = head (QUEUE-plan §6)
Noticestate 11 step 1 (0xed2c8 → 0xe0620)next state-11 update → destination stand point (0xde1d8), state 13
Walkstate 13 0xed7e0: bl 0xe6454 at 0xed808one navigation step per update (0xe6488 → 0xffd2c → 0xfec9c). Result 0 = arrived. 2 is logged and treated as arrived (0xed80c). 1 = still walking
Offersame update, on arrival: price check 0xea5a4, then 0xe03d0 (0xed94c)rejects when ride +408 is 1 or 4 (0xe03f0); checks pending == guest (0xe045c); clears pending (0xe051c); reads variable 0 (0xe0528). If 0, writes the guest id into LETMEON (0xe0544, 0xe0550 → 0xb57d4) and the guest enters state 14 (0xed990). Otherwise it re-queues (0xed9a0 → 0xee604)
Consumedstate 14 = table entry 0xef4f8 (data 0x41314 + 56)0xe05c8 reads variable 0 (0xe05e4) and compares it with the queue head +56 (0xe05ec). Once they differ, the guest is unlinked (0xef548 → 0xdcebc) and enters state 16 (0xef570)
Releaseride update 0xe1864, after admission and after the breakdown variable 7 (0xe189c)reads variable 1, LETMEOFF (0xe1964). 0xeeb30 places the guest at the exit appear point (0xeebc0 → 0xde1d8) and sets state 15 (0xeec80). On success, LETMEOFF is set to 0 (0xe1a14..0xe1a1c)

Consequences:

4. The BOUNCE script loop (high, corpus + binary)#

jungle/rides/bouncy.wad:Bouncy.RSE (SHA-256 7f32699c…8677a35, time slice 50, bounce size 10). Open-ride loop (word index, opcode, operands):

  20 BOUNCING VAR_RUNNING      ; release slice continues here after BRANCH @20
  22 JSR @193                  ; scream level, RETURN at 207
  24 BOUNCING VAR_ONRIDE
  26..43 LOOPANIM by ONRIDE
  46 WAIT 500                  ; release slice ends here; admission slice resumes here
  48..54 TEST VAR_RIDECLOSED / VAR_BREAKSTAT ; closed/broken branches (A3: not taken)
  56..75 optional wear EVENT (RAND)
  79 BOUNCING VAR_TEMP
  81 CMP VAR_CAPACITY VAR_TEMP ; 84 BRANCH_PV @88 ; 86 BRANCH @99
  88 CRIT_LOCK ; 89 TEST VAR_LETMEON ; 91 BRANCH_Z @99
  93 BOUNCE VAR_LETMEON VAR_DURATION
  96 COPY VAR_LETMEON 0
  99 CRIT_UNLOCK               ; admission slice ends here
 100 TEST VAR_LETMEOFF ; 102 BRANCH_NZ @20
 104 UNBOUNCE VAR_LETMEOFF ; 106 BRANCH @20

Binary rules used:

bounce_loop enumerates every open-ride path. Both closed-ride and broken-ride guards take only their fall-through. JSR is followed into the subroutine. Each path is checked to end where expected: 12 admission paths end at the CRIT_UNLOCK @99, 12 release paths end at the WAIT @46, and the longest slice is 23 instructions (≤ 50). A WAITANIM-class wait on the loop path would make the result untraced rather than timed.

So an iteration is: slice A (resume, admission, yield), slice B (UNBOUNCE, ONRIDE update, WAIT set), then 2 waiting slices (248 and 496 ms are both < 500). Slice A comes back after 3 × 248 = 744 ms. The loop period is P = 1 + ⌈500/248⌉ = 4 turns, and B always follows A by one turn.

All four BOUNCE scripts in the corpus have this shape:

ThemeScript (SHA-256 prefix)Ride idCAPDURRunsContinuouslyPR (turns)
jungleBouncy.RSE 7f32699c110053014121
spaceBouncy.RSE 4fd934f7311463014121
fantasyJelly.RSE c015077541043101441
hallowBrainb.RSE cf82eaae21105101441

5. BOUNCE slots and the nominal hold (high for the rules; A1 for the timing)#

Under A1, BOUNCE runs in slice A at time t. UNBOUNCE polls run only in later B slices, at t + 248·(4j + 1). The slot is freed at the first j with 248(4j+1) > 1000·DUR and 248(4j+1) mod 1000 < 200:

This refines QUEUE-plan §7 ("release within 1 s after the deadline"). That holds per poll, but polls are 992 ms apart and phase-locked on the grid. The DUR ≥ 31 value is a property of the exact grid. With real-clock jitter the window is hit at an unpredictable time, so no bound is claimed for it. Belly Bounce's InitDuration of 30 is the largest DUR with the short hold.

Each iteration boards at most one rider (one A slice) and releases at most one (one B slice). Riders therefore become due in distinct iterations. The host clears LETMEOFF on its next update (≤ 1 turn), before the next B slice (4 turns later), so releases never contend.

6. The walk terms are blocked (exactly these two)#

Why they block. The guest moves one steering step per update. 0xfec9c sums the behaviour forces, truncates them to navigation +24 (0xfed0c), adds them to the velocity, and truncates the velocity to +28 (0xfed98). +28 is a maximum: trunc(min(s, 2)·0.2·65536), at least 655 (PPC-guests). There is no traced minimum speed, because arrival and steering can slow the guest below it. The step count to a target is therefore not boundable from static rules. The distance is only partly known. 0xde1d8 puts the stand point in the entrance cell +50 at the fractional EntryCellStandPos. Belly Bounce comments that out, and the jungle Rides.sam default is (0.5, 0.5), the cell centre (medium: assumes the catalog layering). Slot 0 lies in the neighbouring front cell, but the sub-cell axis of the slots (0xdde74) is untraced. The distance therefore lies between 0.5 and about 1.6 cells, and the missing speed floor still blocks a step count.

OpenTPW's walk is not a traced substitute either. GuestSettings.WalkSpeedCellsPerSecond is marked "approximation: no original source". The stand point is [APPROX:QUEUE-007] and the slot axis is [APPROX:QUEUE-006]. Under this lane's rule (use the implementation only if it is traced), w and w₂ are the only terms that keep τ from being fully derived. Everything else in H, and all of R, is traced.

7. Derivation#

7.1 Per-boarding latency H (turns)#

H runs from the later of (previous LETMEON consumed, a slot freed) to the next BOUNCE.

TermTurnsSource
previous guest notices consumption, leaves the list1state 14 0xef528, 0xef548 (A2: its next update)
new head's move-up delay at gap ≤ 22trunc(1.2 × recorded) with recorded ≤ 2 (0xef8ac, data 0x55a0); decrement 0xed4e4 while gap ≤ 2 (0xed4a4)
0xee604 sets state 1210xed4c0 on the update after the delay
walk to slot 0w₂state 12 0xef4b8 → 0xe6454 (blocked)
one interlude11state 8 restores when turn > +520 + 10 (0xef6d8). A second needs turn − +520 > 30 (0xed5a0). The rest of the head-ready phase after a restore (3 + w₂ + 1 turns) fits in the remaining 19 turns when w₂ ≤ 15
ride update calls the ready head10xe1404 → 0xee794 (live-list order)
head notices the call1state 11 step 1, 0xed2c8
walk to the stand point; LETMEON written on arrivalwstate 13 (blocked), 0xe03d0
script's next admission sliceP = 4section 4

H = 21 + w + w₂.

Slot freed. A slice-B release updates ONRIDE in the same slice, and the host's next admission check is ≤ 1 turn later. That is covered by "ride update calls". A guest called early (stale ONRIDE) is consumed at the next A slice, 3 turns after B, which is ≤ H.

7.2 Wait bound#

B_n is the n-th BOUNCE counted from the moment the guest joins (time J). Boarding n needs (a) the previous consumption and (b) a free slot. For n ≤ CAP the slot frees from the riders on board at J, at most R after J. Otherwise it frees from boarding n − CAP, at most R after it. So:

B_n ≤ max(B_{n−1}, F_n) + H, with F_n ≤ J + R for n ≤ CAP and F_n ≤ B_{n−CAP} + R otherwise.

Induction gives B_n ≤ J + n·H + ⌈n/CAP⌉·R. The guest at position p is boarding p + 1. It leaves the list ≤ 1 turn after its own BOUNCE. Therefore:

W(p) ≤ (p + 1)·H + (⌊p/CAP⌋ + 1)·R + 1 turns.

A guest ahead that leaves the queue without boarding costs at most the head-ready part of H and uses no slot, so this bound covers it too. Because p + 1 ≤ CAP·(⌊p/CAP⌋ + 1), the §9b form holds with τ_max = CAP·H + R + 1 − (DUR + 1 s)/T.

Belly Bounce (CAP 5, R 121, DUR + 1 s = 125 turns): τ_max = 5(21 + w + w₂) + 122 − 125 = 102 + 5(w + w₂) turns.

7.3 Model check#

board_evidence.simulate models states 11, 8, 12, 13 and 14, the ride update, and the BOUNCE loop (slice A/B with the WAIT rule and the UNBOUNCE window) turn by turn. An adversary chooses:

A move-up walk costs w₂ per slot. Over 16 test runs (more than 200 boardings), every wait was within W(p), and the largest ratio was above 0.4. In ad-hoc runs during the trace (1,600 configurations), the worst non-walk latency from the later of the previous BOUNCE and a slot release to the next BOUNCE was 18 turns, against the derived 21. A bound without the hold term is violated (test).

8. Gate spec for queues.no-stuck-queue#

Scope: attractions whose script passes bounce_loop and whose .sam has RunsContinuously 1 and DUR ≤ 30. That is all four BOUNCE rides at upgrade 0, including Belly Bounce. Other attractions keep the existing §9a FAIL rules, and their wait bound stays UNRESOLVED (section 9).

Runtime inputs (no new constants):

SymbolValue (Belly Bounce)Read from
T248 msParkCalendar.TurnMilliseconds
CAP5RideVisitorBridge.Parameters.Capacity (= VAR_CAPACITY)
DUR30 sRideVisitorBridge.Parameters.Duration (= VAR_DURATION)
P41 + ⌈WAIT operand / T⌉. WAIT operand 500 from the loop WAIT of the ride's script (RideScriptAnalysis listing). The gate may also pin it to the Bouncy.RSE SHA above
R121R(DUR) = 4·DUR + 1 for DUR ≤ 30 (section 5); out of scope otherwise
H₀2117 + P (section 7.1)
w2⌈d_s / (0.7·v·T)⌉ + 1. d_s = largest distance from a slot-0 point (GuestSimulation.QueuePositionPoint(·, 0, 114..141)) to GuestSimulation.StandPoint = 13.5/255 = 0.053 cell. v = GuestSettings.WalkSpeedCellsPerSecond (1.0). 0.7 is the low-energy factor of GuestSimulation.Speed
w₂6the same formula with d_u = slot 3 → slot 0 = √((191/255)² + (27/255)²) = 0.757 cell
H29H₀ + w + w₂
Qmax21RideVisitorBridge.MaximumQueueLength = min(limit, 4·cells); Belly Bounce's limit is trunc(130·5/30) = 21 (QUEUE-plan §4; this row said 100 until ORACLE-V F1 corrected the HasQueue polarity)

Assertions:

  1. Unchanged: the §9a FAIL rules (head not ready beyond HeadNotReadyBound, blocked handshake on two consecutive evaluations).

  2. Every completed wait (GuestSimulation.QueueWaitCompleted, W turns, join position p) that does not overlap an excluded turn must satisfy W ≤ (p + 1)·H + (⌊p/CAP⌋ + 1)·R + 1. A violation is a FAIL.

  3. Every guest still queued at the end must satisfy the same bound on its age, using its join position. A violation is a FAIL (a stuck queue).

  4. Excluded turns (A3): a turn where the ride is closed or broken (RideVisitorBridge.IsBroken, VAR_BREAKSTAT ≠ 0, VAR_RIDECLOSED ≠ 0, or not open), or where CAP or DUR changed during the wait. Waits that overlap one are counted and reported, not judged.

  5. Verdict: PASS when (1) to (3) hold and at least one wait was judged. UNRESOLVED when none was judged.

  6. Report: H, R, the τ_max line (CAP·H + R + 1 − (DUR + 1 s)/T = 142 turns = 35.216 s) and W_max = W(Qmax − 1) = 5321 turns = 1319.608 s. Also report the measured values as evidence (the existing tauMeasured), not as thresholds.

The baseline (queue max 51, worst wait 254.4 s) would pass. At p = 50 the bound is 51·29 + 11·121 + 1 = 2811 turns = 697 s.

Approximation tag. Only w and w₂ rest on OpenTPW's walk model. Replace [APPROX:GATE-003] with a narrower tag: "walk terms w, w₂ of the boarding bound use WalkSpeedCellsPerSecond and the QUEUE-006/007 geometry; evidence needed: original steering speed floor and 0xde1d8/0xdde74 geometry". Add the row to M3-GATE.md's list of passing rows that rest on approximations, as the arrival and needs rows already are. HeadNotReadyBound already uses the same walk speed. If the integrator does not accept an implementation-bounded walk term, the row stays UNRESOLVED, and w and w₂ are the only blockers.

OpenTPW differs from the original in ways that only shorten waits, so the bound stays a valid ceiling. RideVisitorBridge.TryPerform releases a slot at Until ≤ now without the 1 s / 200 ms window. Its scripts run per 60 Hz tick, not per 248 ms slice. It marks the guest boarded at BOUNCE. None of these needs to change for the gate.

9. General rides#

The skeleton W(p) ≤ (p + 1)·H + (⌊p/CAP⌋ + 1)·R + 1 holds for any HasQueue ride admitted through 0xe1404, provided three things are known: the period P at which its script consumes LETMEON when a place is free, a per-rider hold R until the release frees capacity, and one rider released per release opportunity. H's host terms (17 turns plus w and w₂) are the same for every ride. P and R are derived here only for the four BOUNCE scripts. These are not instantiated:

10. Unresolved#

11. Witnesses and tests#

Lane tools/ppc-analysis/lanes/board/: board_evidence.py and test_board_evidence.py. The runner discovers it.

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