Decoupling Cadence Ingestion from Frame Stepping in Browser Cycling Simulation

Binding the physics integrator directly to incoming sensor interrupts stalls the rendering pipeline whenever radio interference drops a cadence packet. Before freezing the client architecture for our transition from keyboard input to physical trainers, we evaluated synchronous peripheral polling against an autonomous inertial flywheel model with local input fallback. Our primary constraint is keeping avatar propulsion continuous when wireless telemetry degrades mid-session.

The Case for Direct Interrupt Binding

A synchronous pipeline advances the cyclist state only when a hardware event arrives from the trainer or keyboard controller. That design eliminates synthetic interpolation drift, guarantees deterministic replay validation across client nodes, and keeps memory overhead minimal inside the browser thread. Under clean laboratory conditions with wired test rigs, direct binding delivers zero-latency feedback between pedal stroke and road gradient resistance. We rejected it only because consumer apartments introduce dense spectrum contention that breaks the assumption of steady packet arrival.

Once packet jitter exceeds a 250 milliseconds threshold, a synchronous loop freezes the road geometry and induces immediate visual nausea for the rider.

Inertial State Estimation and Graceful Degradation

Our chosen architecture separates the rendering loop from peripheral ingestion through a dual-buffer state estimator governed by virtual angular momentum. Wireless fitness profiles such as FTMS broadcast crank data asynchronously through WebBluetooth, while keyboard cadence pulses write to the same normalized torque queue. When a GATT notification dropout occurs during radio contention, the physics engine decays virtual flywheel velocity along the current road grade rather than zeroing propulsion. If the peripheral disconnect persists beyond an estimated two seconds, the input multiplexer automatically unmutes the keyboard listener so the rider can finish the interval manually without losing session state.

Reversal Conditions Before Design Freeze

Architects reviewing this boundary should apply a clear decision rule: adopt synchronous sensor binding only when the execution environment guarantees deterministic wired buses and hardware-enforced interrupt deadlines. Moving our simulation to a dedicated arcade cabinet with direct serial telemetry and an estimated sub-millisecond jitter floor would justify stripping out the inertial estimator. Until the deployment target shifts away from consumer browsers and shared wireless spectra, the decoupled flywheel buffer remains mandatory, trading a slight phase delay during sudden sprints for uninterrupted frame delivery.

How does the state estimator prevent phantom watts when a rider stops pedaling right as the radio link drops?

The decay curve applies rolling resistance and aerodynamic drag on every tick, bleeding kinetic energy to zero within a brief coasting window unless fresh torque events replenish the buffer.

Back to CyclingPlay · Domains

← Back to CyclingPlay
Engineering & Architecture Brief

Decoupling Cadence Ingestion from Frame Stepping in Browser Cycling Simulation

Binding the physics integrator directly to incoming sensor interrupts stalls the rendering pipeline whenever radio interference drops a cadence packet. Before freezing the client architecture for our transition from keyboard input to physical trainers, we evaluated synchronous peripheral polling against an autonomous inertial flywheel model with local input fallback. Our primary constraint is keeping avatar propulsion continuous when wireless telemetry degrades mid-session.

The Case for Direct Interrupt Binding

A synchronous pipeline advances the cyclist state only when a hardware event arrives from the trainer or keyboard controller. That design eliminates synthetic interpolation drift, guarantees deterministic replay validation across client nodes, and keeps memory overhead minimal inside the browser thread. Under clean laboratory conditions with wired test rigs, direct binding delivers zero-latency feedback between pedal stroke and road gradient resistance. We rejected it only because consumer apartments introduce dense spectrum contention that breaks the assumption of steady packet arrival.

Once packet jitter exceeds a 250 milliseconds threshold, a synchronous loop freezes the road geometry and induces immediate visual nausea for the rider.

Inertial State Estimation and Graceful Degradation

Our chosen architecture separates the rendering loop from peripheral ingestion through a dual-buffer state estimator governed by virtual angular momentum. Wireless fitness profiles such as FTMS broadcast crank data asynchronously through WebBluetooth, while keyboard cadence pulses write to the same normalized torque queue. When a GATT notification dropout occurs during radio contention, the physics engine decays virtual flywheel velocity along the current road grade rather than zeroing propulsion. If the peripheral disconnect persists beyond an estimated two seconds, the input multiplexer automatically unmutes the keyboard listener so the rider can finish the interval manually without losing session state.

Reversal Conditions Before Design Freeze

Architects reviewing this boundary should apply a clear decision rule: adopt synchronous sensor binding only when the execution environment guarantees deterministic wired buses and hardware-enforced interrupt deadlines. Moving our simulation to a dedicated arcade cabinet with direct serial telemetry and an estimated sub-millisecond jitter floor would justify stripping out the inertial estimator. Until the deployment target shifts away from consumer browsers and shared wireless spectra, the decoupled flywheel buffer remains mandatory, trading a slight phase delay during sudden sprints for uninterrupted frame delivery.

Technical FAQ: How does the state estimator prevent phantom watts when a rider stops pedaling right as the radio link drops?

The decay curve applies rolling resistance and aerodynamic drag on every tick, bleeding kinetic energy to zero within a brief coasting window unless fresh torque events replenish the buffer.

Related Architecture Specifications (CYCLINGPLAY): vrindoorcycling.com · cyclingplay.com