Skip to content

feat(hands): get up on the referee's count: a visible beat, a verdict for every press, fair over a slow link - #299

Merged
user1303836 merged 4 commits into
mainfrom
feature/hands-get-up
Nov 17, 2026
Merged

user1303836 merged 4 commits into
mainfrom
feature/hands-get-up

Conversation

@user1303836

@user1303836 user1303836 commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

The get-up mini-game a knocked-down player plays under the referee's count was ambiguous and close to unplayable over a real connection. This rebuilds it. Engine, protocol (version 7), CPU, client panel, input, sound, haptics and the end-to-end script all change.

What was wrong

  • A new random left or right prompt every 0.47 s, scored only in a 0.37 s window that opened 0.1 s after the prompt appeared. By the time the arrow had reached the screen, been read and the press had reached the server, the window was usually over.
  • Early, late, wrong-side and repeated presses all drained the meter with nothing on screen to say so. The panel showed an arrow, "NOW!" and a bare bar.
  • Mashing worked: in the same harness a player pressing four times a second got up 80% of the time from a fresh first knockdown.

The rules now

  1. One prompt on each count from 2 to 9. A ring closes on a large arrow and reaches it on the beat, the moment the count changes; the next side shows small beside it.
  2. One press a count. On the beat (within a tick) is PERFECT, +2; within three ticks is GOOD, +1; before the zone is EARLY and up to three ticks after it is LATE, both scoring nothing; the wrong side costs 1. Extra presses do nothing, and a late press never uses up the next count's press.
  3. He needs 4 points for each knockdown so far plus 1 for every 300 of head trauma. The panel shows how many more and what the total is made of.
  4. Every press that is judged is answered on screen at once, and the ring turns green while a press would be in time and gold at the perfect middle.
  5. The ring is drawn for the tick at which a press made now would reach the server (latest snapshot, time since it arrived, measured round trip), so it holds over a slow link. The new private snapshot field get_up_next_prompt lets the next side show a full count ahead at any latency.

Also: a beat cue by sound and haptic on the downed player's own device (obeying volume and haptics settings), a pair of large pads on touch (the wanted one lit) in place of the fight controls, a short screen-reader announcement of only what changed, a Controls line, and the CPU pressing on the beat with a per-level timing error. All numbers live in combat-manifest.json.

Measured

Monte Carlo over the real engine (scripts/hands_get_up.py, 1000 trials a cell; heavy = 1200 head trauma):

Player, link 1st fresh 1st heavy 2nd fresh 2nd heavy
attentive (50 ms timing error), 0 ms 100.0% 97.4% 97.5% 63.8%
attentive, 150 ms each way + 40 ms jitter 100.0% 97.1% 95.7% 55.2%
sloppy (110 ms, 10% wrong side), 0 ms 91.0% 42.1% 42.8% 4.7%
sloppy, 150 ms + 40 ms jitter 90.5% 39.1% 39.1% 4.0%
nine mashing patterns, idle 0% 0% 0% 0%

CPU get-up rates stay within about 5 points of main for contender and champion; the rookie at typical first-knockdown trauma is 7 points higher.

End to end through the real client and server on a GPU-backed Chromium, pressing when the client's own ring says now:

  • getup at 0 ms: 60 presses, 60 judged, all PERFECT.
  • getup at 150 ms each way + 40 ms jitter (about 350 ms measured input latency): 60 presses, 60 judged, all PERFECT, on each of three runs.
  • mash: 67 presses while down, nothing scored, counted out.
  • ko, finish, cpu, touch (real taps on the pads): pass, no client or server errors.

Checks

ruff check, ruff format --check, mypy src/, pytest tests/ (2436), hands_replay.py --check, hands_parity_fixtures.py --check (now also writes the engine's 104 get-up verdicts, which the client's judgement test runs from), check_hands_wheel.py, npm run typecheck, npm run test:run (1757), npm run build with the committed bundle, npm run scan:build, npm run audit:high.

audit:high needed one reviewed entry: picomatch GHSA-fc5q-39xc-vjpf was published against every release including the latest (4.0.7). It is build and test tooling (vite, vitest, tinyglobby, fdir) and is not in the shipped bundle.

Review

An independent review of the first commit found no blockers, five defects worth fixing and nine nits, fixed in the second commit: the press clock ran on while a bout was paused; the server judged the last press in a tick where the rule says the first; the ring ran ahead for seconds after the link slowed or the server dropped ticks; the end-to-end check ignored presses with no verdict; the screen-reader text rewrote a long sentence several times a count.

A second pass over those fixes confirmed twelve, found two only partly done (the live region stayed silent when the same news came twice; the spent last pad stayed lit for a moment) and four new small things: a frozen panel during a pause, a guard frame deleting a queued press, the press clock stepping back and replaying a beat, and safe-area insets going stale after a half turn. All six are fixed in the last commit, which was read but not independently reviewed a third time.

Known limits

  • The scripted player presses exactly when the ring says, so the end-to-end runs prove the clock and the judging, not human timing. The GOOD zone's edges are covered by engine tests and the parity table, never hit end to end.
  • The beat sound, the haptic pulse and reduced motion were not checked on a real device, and touch taps come from Playwright, not a phone.
  • On a phone held sideways the panel is about 0.6 of its desktop size.

Deploy

The engine and protocol change, so the bot must be restarted after the pull. A tab still on the old bundle is refused with client_outdated and told to reload.

…rdict for every press and timing that holds over a slow link
…n a tick, the press clock after the link changes, an exact end-to-end check
…nel while paused, a press kept through a guard frame, a press clock that never steps back
@user1303836
user1303836 merged commit 5797cca into main Nov 17, 2026
6 checks passed
@user1303836
user1303836 deleted the feature/hands-get-up branch November 17, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant