Sizing the pose loop for the day the GPU disappears

The frame budget sets the size of an in-browser movement recognizer. The real design question is what happens when inference no longer fits inside it. FitnessRecognition runs pose estimation on the user's device and scores it against a reference video, so no server is there to absorb a slow phone or a lost GPU context. The model below follows one calculation from the healthy path to the degraded one, and every figure is marked as an estimate with its error bar.

The budget and the inequality

Take a frame budget B of 33 ms (estimate). Above that cadence, scoring visibly lags the beat of the reference. The pose loop holds up when t_pose + t_score + t_draw ≤ B, and since scoring and drawing are small next to inference, the test reduces to t_pose against B. On the GPU path, reached through web compute standards such as WebGL, WebGPU and WebAssembly, a mid-range phone runs the pose model in 20 ± 6 ms (estimate). That stays inside the budget even at the top of its error bar. The error bar covers thermal throttling, background load and the spread between handsets, and it is why the design treats B as a ceiling, not a target.

Where it breaks

The failure that matters is GPU context loss. Browsers trigger it on driver resets, memory pressure or a backgrounded tab, and it removes the fast backend in the middle of a session without warning. The recognizer survives by falling back to the WebAssembly CPU path, where the same model costs 55 ± 15 ms (estimate), so even the optimistic end of that bar overruns B. In a coupled design, where each camera frame waits for its pose, the video now stalls, the reference drifts out of sync and the score stops meaning anything. A decoupled design keeps running: camera and reference playback each keep their own clock, the pose loop runs at f_pose = 1/t_pose, well under one inference per displayed frame, and each result carries the capture timestamp of the frame it came from. Scoring then compares each user pose with the reference pose at the same instant, so the degradation shows up as coarser time resolution, not as wrong answers.

The decision rule

Measure the slow tail of inference on the backend that is actually active, and as soon as it exceeds B, stop pacing the camera on the pose, let the pose loop fall behind on its own clock, and widen the scoring window to at least t_pose so a slower loop is judged on fewer samples instead of missing ones.

What the wide error bar costs

The wide CPU error bar shows what decimation costs. Between samples the system either holds the last pose or interpolates keypoints, and interpolation error grows with limb speed, so fast footwork loses accuracy first while slow arm phrases barely suffer. The scoring window has to widen with t_pose, which gives up temporal sharpness for stability: a dancer on a throttled laptop gets a fairer but blunter score. No frame leaves the device on either path, because privacy and fault tolerance come from the same architectural choice. The open decision is whether to ship a lighter pose model for the CPU path, which would pull t_pose back under B at the cost of keypoint precision on hands and feet.

Why not just lower the camera resolution when the GPU is lost?

The pose model's input resolution is fixed. A smaller camera frame saves capture and copy time but leaves t_pose almost unchanged. The model is the lever that moves inference cost, not the camera.

Back to FitnessRecognition · Domains

← Back to FitnessRecognition
Engineering & Architecture Brief

Sizing the pose loop for the day the GPU disappears

The frame budget sets the size of an in-browser movement recognizer. The real design question is what happens when inference no longer fits inside it. FitnessRecognition runs pose estimation on the user's device and scores it against a reference video, so no server is there to absorb a slow phone or a lost GPU context. The model below follows one calculation from the healthy path to the degraded one, and every figure is marked as an estimate with its error bar.

The budget and the inequality

Take a frame budget B of 33 ms (estimate). Above that cadence, scoring visibly lags the beat of the reference. The pose loop holds up when t_pose + t_score + t_draw ≤ B, and since scoring and drawing are small next to inference, the test reduces to t_pose against B. On the GPU path, reached through web compute standards such as WebGL, WebGPU and WebAssembly, a mid-range phone runs the pose model in 20 ± 6 ms (estimate). That stays inside the budget even at the top of its error bar. The error bar covers thermal throttling, background load and the spread between handsets, and it is why the design treats B as a ceiling, not a target.

Where it breaks

The failure that matters is GPU context loss. Browsers trigger it on driver resets, memory pressure or a backgrounded tab, and it removes the fast backend in the middle of a session without warning. The recognizer survives by falling back to the WebAssembly CPU path, where the same model costs 55 ± 15 ms (estimate), so even the optimistic end of that bar overruns B. In a coupled design, where each camera frame waits for its pose, the video now stalls, the reference drifts out of sync and the score stops meaning anything. A decoupled design keeps running: camera and reference playback each keep their own clock, the pose loop runs at f_pose = 1/t_pose, well under one inference per displayed frame, and each result carries the capture timestamp of the frame it came from. Scoring then compares each user pose with the reference pose at the same instant, so the degradation shows up as coarser time resolution, not as wrong answers.

The decision rule

Measure the slow tail of inference on the backend that is actually active, and as soon as it exceeds B, stop pacing the camera on the pose, let the pose loop fall behind on its own clock, and widen the scoring window to at least t_pose so a slower loop is judged on fewer samples instead of missing ones.

What the wide error bar costs

The wide CPU error bar shows what decimation costs. Between samples the system either holds the last pose or interpolates keypoints, and interpolation error grows with limb speed, so fast footwork loses accuracy first while slow arm phrases barely suffer. The scoring window has to widen with t_pose, which gives up temporal sharpness for stability: a dancer on a throttled laptop gets a fairer but blunter score. No frame leaves the device on either path, because privacy and fault tolerance come from the same architectural choice. The open decision is whether to ship a lighter pose model for the CPU path, which would pull t_pose back under B at the cost of keypoint precision on hands and feet.

Technical FAQ: Why not just lower the camera resolution when the GPU is lost?

The pose model's input resolution is fixed. A smaller camera frame saves capture and copy time but leaves t_pose almost unchanged. The model is the lever that moves inference cost, not the camera.

Related Architecture Specifications (DANCEGOAL): rehabdance.com · bundledport.com · flashbackdance.com