Testing CumbiaDance When the Phone Gets Hot: Catching Score Drift Before Users Do

The failure that matters in an in-browser pose trainer never shows up on a cool laptop. It appears well into a session, when the phone throttles, inference slows and the scorer quietly starts grading poses that are already old. Nothing crashes. The score is simply wrong, and the user blames their own dancing.

Where the coupling hides

Under nominal conditions the pose loop, the video clock and the scorer look like one pipeline because they run at the same pace. Under load they come apart: the reference video keeps its own media clock, the camera keeps delivering frames, but the pose model falls behind and, if the code is careless, returns landmarks stamped with the moment they were delivered rather than the moment the frame was captured. A scorer that compares the latest available pose against the current beat is then comparing a body from the past with music from the present. The design that survives treats the video's media time as the single master clock, stamps every pose with the capture time of its source frame, and refuses any pose older than an alignment tolerance of 50 ms. That refusal is what keeps the system honest when inference cannot keep up.

The test that provokes it

Replace the camera with a canvas capture stream replaying a recorded dancer whose beat alignment is known frame by frame, so every score has a ground truth. Run the same session twice on a mid-range phone, once cool and idle, once after a background worker has saturated the CPU long enough for the device to reach thermal steady state, which in our experience takes about a quarter of an hour of sustained load (an estimate that varies by chassis). Midway through the loaded run, force a WebGL context loss with the browser's debugging extension and let the app fall back to its CPU backend. The pass criterion is not the absence of errors: the loaded run must either match the nominal scores within tolerance or flag the affected segments as low confidence, and it must never emit a confident score built on a stale pose. Instrument the run with the web performance specifications designed for this, such as Long Tasks and Event Timing, so every degraded segment can be tied to a measured main-thread stall instead of a guess.

The decision rule

When tail inference latency on the loaded run exceeds the 50 ms alignment tolerance, the build ships only if the scorer visibly degrades to a confidence flag on those segments, because a silently wrong score does more damage than an honest gap.

What the fallback costs

The CPU backend that rescues the session after a context loss runs a lighter model, so landmark jitter rises and wrist and ankle keypoints wobble more. A scorer tuned on the GPU path reads that jitter as sloppy footwork and penalises it. Qualify the fallback path with its own threshold set and replay the same ground-truth dancer through it. The trade-off that remains comes from the privacy design itself: since footage never leaves the device, there is no server to absorb inference when the phone struggles, so every degradation is handled locally, and the test lab is the only place you will see it before users do.

Why not simply qualify on the slowest supported device?

A device that is consistently slow keeps the loops in step with each other. The failure comes from a change in rate during the session, so the test has to move a device from nominal to throttled while the session is running.

Back to CumbiaDance · Domains

← Back to CumbiaDance
Engineering & Architecture Brief

Testing CumbiaDance When the Phone Gets Hot: Catching Score Drift Before Users Do

The failure that matters in an in-browser pose trainer never shows up on a cool laptop. It appears well into a session, when the phone throttles, inference slows and the scorer quietly starts grading poses that are already old. Nothing crashes. The score is simply wrong, and the user blames their own dancing.

Where the coupling hides

Under nominal conditions the pose loop, the video clock and the scorer look like one pipeline because they run at the same pace. Under load they come apart: the reference video keeps its own media clock, the camera keeps delivering frames, but the pose model falls behind and, if the code is careless, returns landmarks stamped with the moment they were delivered rather than the moment the frame was captured. A scorer that compares the latest available pose against the current beat is then comparing a body from the past with music from the present. The design that survives treats the video's media time as the single master clock, stamps every pose with the capture time of its source frame, and refuses any pose older than an alignment tolerance of 50 ms. That refusal is what keeps the system honest when inference cannot keep up.

The test that provokes it

Replace the camera with a canvas capture stream replaying a recorded dancer whose beat alignment is known frame by frame, so every score has a ground truth. Run the same session twice on a mid-range phone, once cool and idle, once after a background worker has saturated the CPU long enough for the device to reach thermal steady state, which in our experience takes about a quarter of an hour of sustained load (an estimate that varies by chassis). Midway through the loaded run, force a WebGL context loss with the browser's debugging extension and let the app fall back to its CPU backend. The pass criterion is not the absence of errors: the loaded run must either match the nominal scores within tolerance or flag the affected segments as low confidence, and it must never emit a confident score built on a stale pose. Instrument the run with the web performance specifications designed for this, such as Long Tasks and Event Timing, so every degraded segment can be tied to a measured main-thread stall instead of a guess.

The decision rule

When tail inference latency on the loaded run exceeds the 50 ms alignment tolerance, the build ships only if the scorer visibly degrades to a confidence flag on those segments, because a silently wrong score does more damage than an honest gap.

What the fallback costs

The CPU backend that rescues the session after a context loss runs a lighter model, so landmark jitter rises and wrist and ankle keypoints wobble more. A scorer tuned on the GPU path reads that jitter as sloppy footwork and penalises it. Qualify the fallback path with its own threshold set and replay the same ground-truth dancer through it. The trade-off that remains comes from the privacy design itself: since footage never leaves the device, there is no server to absorb inference when the phone struggles, so every degradation is handled locally, and the test lab is the only place you will see it before users do.

Technical FAQ: Why not simply qualify on the slowest supported device?

A device that is consistently slow keeps the loops in step with each other. The failure comes from a change in rate during the session, so the test has to move a device from nominal to throttled while the session is running.

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

More Technical Articles on cumbiadance.com

Testing CumbiaDance where it breaks: clock skew under sustained load →