The CPU fallback nobody has ever loaded: a pose-detection config error that sails through review

The most expensive line in DanceSaga's pose pipeline config is the one that names the CPU model to load when the GPU delegate dies. It looks correct in every diff, the reviewer has no way to prove it wrong, and CI never touches it because every runner has a working GPU. The day a patient's tablet loses its WebGL context halfway through a session, that line is the only thing between degraded tracking and a skeleton frozen in mid-air.

Why the diff gets approved

The pattern is always the same. A bundling refactor renames the model directory, someone updates the main Holistic asset path, and the fallback entry keeps pointing at a file that no longer ships. The reviewer sees a well-formed JSON key with a plausible path next to a correct one, and nothing in the diff hints that one of them now resolves to a 404. Integration tests pass, because they run on GPU-backed runners where the delegate never fails and the fallback branch is dead code in practice. The config is syntactically valid and semantically empty, and code review only checks the first of those.

What the patient actually sees

In the browser, GPU failure isn't exotic: mobile drivers drop the WebGL context when the tab goes to the background, under thermal throttling, or when another app grabs memory. The runtime catches the error, tries to initialise the fallback, gets a 404, and in most implementations swallows that second exception, because the error handler was written assuming the fallback exists. The landmark buffer keeps its last frame, scoring keeps evaluating it, and the rehab feedback praises a repetition that never happened. This is the failure mode that matters, because a frozen pose is worse than no pose: it produces confident, wrong feedback. The defence is a staleness watchdog in the scoring loop that suspends evaluation and shows the patient that tracking is lost whenever the newest landmark timestamp is more than 300 ms old, regardless of why the inference stopped. Medical device software lifecycle standards such as IEC 62304 ask for risk controls you can trace and verify, and a fallback that has never run once cannot honestly be listed as one.

The decision rule is simple: any fallback path that CI did not force to run on the last build is treated as nonexistent, both in the risk file and in the on-call runbook.

A check you can run today

Start with the cheap half, which catches the renamed-file case in seconds: `jq -r '.. |.modelAssetPath? // empty' pose.config.json | xargs -n1 curl -sfI -o /dev/null -w '%{http_code} %{url_effective}\n'` lists every model the config references, primary and fallback alike, and any status other than 200 should fail the pipeline. The expensive half proves the fallback actually produces landmarks: launch headless Chromium with `--disable-gpu`, open the session page with the CPU delegate forced, and assert that the first landmark callback arrives before the test timeout. That second job takes longer and needs a recorded video fixture, but it is the only one that exercises the code path that runs during the incident. In my estimate it adds a few minutes to the pipeline, which is cheap next to another post-mortem about a frozen skeleton. What's left is a product decision rather than an infrastructure one: the CPU model tracks fingers and face much worse, so exercises that depend on hand signals should probably be disabled in degraded mode rather than scored badly.

Why not pack the fallback into the same bundle as the main model and remove the separate path entirely?

Because that pushes the cold start of every session onto the slowest devices, which are exactly the ones most likely to need the fallback; keeping the assets separate is fine, as long as the pipeline proves on every build that both resolve and both produce landmarks.

Back to DanceSaga - Pose Detection · Domains

← Back to DanceSaga - Pose Detection
Engineering & Architecture Brief

The CPU fallback nobody has ever loaded: a pose-detection config error that sails through review

The most expensive line in DanceSaga's pose pipeline config is the one that names the CPU model to load when the GPU delegate dies. It looks correct in every diff, the reviewer has no way to prove it wrong, and CI never touches it because every runner has a working GPU. The day a patient's tablet loses its WebGL context halfway through a session, that line is the only thing between degraded tracking and a skeleton frozen in mid-air.

Why the diff gets approved

The pattern is always the same. A bundling refactor renames the model directory, someone updates the main Holistic asset path, and the fallback entry keeps pointing at a file that no longer ships. The reviewer sees a well-formed JSON key with a plausible path next to a correct one, and nothing in the diff hints that one of them now resolves to a 404. Integration tests pass, because they run on GPU-backed runners where the delegate never fails and the fallback branch is dead code in practice. The config is syntactically valid and semantically empty, and code review only checks the first of those.

What the patient actually sees

In the browser, GPU failure isn't exotic: mobile drivers drop the WebGL context when the tab goes to the background, under thermal throttling, or when another app grabs memory. The runtime catches the error, tries to initialise the fallback, gets a 404, and in most implementations swallows that second exception, because the error handler was written assuming the fallback exists. The landmark buffer keeps its last frame, scoring keeps evaluating it, and the rehab feedback praises a repetition that never happened. This is the failure mode that matters, because a frozen pose is worse than no pose: it produces confident, wrong feedback. The defence is a staleness watchdog in the scoring loop that suspends evaluation and shows the patient that tracking is lost whenever the newest landmark timestamp is more than 300 ms old, regardless of why the inference stopped. Medical device software lifecycle standards such as IEC 62304 ask for risk controls you can trace and verify, and a fallback that has never run once cannot honestly be listed as one.

The decision rule is simple: any fallback path that CI did not force to run on the last build is treated as nonexistent, both in the risk file and in the on-call runbook.

A check you can run today

Start with the cheap half, which catches the renamed-file case in seconds: `jq -r '.. |.modelAssetPath? // empty' pose.config.json | xargs -n1 curl -sfI -o /dev/null -w '%{http_code} %{url_effective}\n'` lists every model the config references, primary and fallback alike, and any status other than 200 should fail the pipeline. The expensive half proves the fallback actually produces landmarks: launch headless Chromium with `--disable-gpu`, open the session page with the CPU delegate forced, and assert that the first landmark callback arrives before the test timeout. That second job takes longer and needs a recorded video fixture, but it is the only one that exercises the code path that runs during the incident. In my estimate it adds a few minutes to the pipeline, which is cheap next to another post-mortem about a frozen skeleton. What's left is a product decision rather than an infrastructure one: the CPU model tracks fingers and face much worse, so exercises that depend on hand signals should probably be disabled in degraded mode rather than scored badly.

Technical FAQ: Why not pack the fallback into the same bundle as the main model and remove the separate path entirely?

Because that pushes the cold start of every session onto the slowest devices, which are exactly the ones most likely to need the fallback; keeping the assets separate is fine, as long as the pipeline proves on every build that both resolve and both produce landmarks.

Related Architecture Specifications (DANCEGOAL): merenguesteps.com · salsamethod.com · danceheal.com

More Technical Articles on rehabdance.com

Reference Architecture for Pose-Detection Rehabilitation Dance: On-Device Inference, FHIR Interoperability and Safety Alignment →