Sizing Failover in an Agentic HiL Rig: How Many Stale Cycles Can the Device Under Test Absorb?

In a hardware-in-the-loop rig, the failover budget is set in cycles of stale I/O, the inputs the device under test keeps receiving while the simulator recovers. Wall-clock milliseconds come second. The agent layer that drives stress campaigns can stall, crash or emit a bad command, so the real-time loop has to keep running without it. How much redundancy you need then depends on one ratio: recovery time divided by loop period. Size that ratio first and the architecture follows from it.

Keep the agent out of the loop that must not miss

The agentic layer may plan fault-injection sequences over MCP or run generated test logic inside a WebAssembly sandbox. Either way it belongs on the supervisory plane, where it writes setpoints into a double-buffered parameter table that the real-time core reads only at cycle boundaries. Because of that separation, an agent failure costs the rig nothing in determinism. The core keeps running the last validated scenario, and a constitutional guardrail rejects any parameter outside the envelope approved for the device under test. The harder failure is the real-time node itself. When the simulator core dies, the device under test receives no error. It sees plausible sensor values that have stopped changing. Frozen inputs are the failure mode that matters here, because an ECU will build a stuck wheel-speed or rail-voltage signal into a wrong control decision and log nothing.

The sizing formula and one worked case

Recovery time is the sum of three terms: detection T_det, switchover T_sw and state resynchronisation T_sync. The number of stale cycles the device under test sees is N_stale = ceil((T_det + T_sw + T_sync) / T_cycle). Detection is the number of missed heartbeats allowed, m, times the heartbeat period. Switchover is dominated by the I/O multiplexer or by backplane arbitration, and resynchronisation is the time the standby needs to load model state and align its clock to the bus schedule of the device under test. Almost all the uncertainty sits in T_det and T_sync. Heartbeat jitter on a shared Ethernet backplane and the spread in snapshot transfer time both grow with load, so measure them under the heaviest stress campaign the agent will ever run, not at idle. As a worked case, take a plant model stepping at T_cycle = 1 ms, labelled here as an estimate for this rig, and a warm-standby node whose total recovery time, detection and snapshot reload included, is estimated at 2.5 ms ± 1 ms. Dividing and rounding up gives an estimated 3 stale cycles, with a plausible spread between 2 and 4 depending on where in the cycle the fault lands and how loaded the backplane is.

Turning the number into an architecture decision

Compare N_stale against k, the number of consecutive cycles of held inputs the device under test's own plausibility monitoring tolerates before it flags a fault, or acts on the frozen data. That tolerance comes from the safety concept the device was developed under, so take it from the functional safety work products produced under standards such as ISO 26262 or IEC 61508. Do not guess it from a datasheet. The decision rule is simple: if N_stale is greater than or equal to k, warm standby is not valid for that test case, and you need a lockstep hot-standby core that shares state every cycle. That drives T_sync toward zero and leaves detection as the only term worth optimising. If N_stale sits clearly below k, warm standby is acceptable. The rig must still mark every recovery window in the test log, so the agent does not score the device's reaction to stale data as a real defect. Lockstep costs a second real-time target, a deterministic state replication link, and the engineering work to prove both cores stay bit-identical, so buy it only for the test cases where k is small.

What remains open

The term you cannot size away is T_det: shortening the heartbeat timeout to shrink N_stale raises the rate of false failovers under heavy agent-driven stress, every spurious switchover is a short burst of stale cycles of its own making, so the next decision is the timeout that best balances missed detections against those self-inflicted interruptions on your specific backplane.

Does the agent layer itself need a hot standby?

Rarely. The real-time core keeps running the last validated scenario through an agent outage, so a crashed agent pauses test progress without corrupting the loop. A cold restart of the agent, followed by a replay of its campaign log, is usually enough, provided the guardrail keeps rejecting out-of-envelope parameters while the agent comes back up.

Back to HILAgentic · Domains

← Back to HILAgentic
Engineering & Architecture Brief

Sizing Failover in an Agentic HiL Rig: How Many Stale Cycles Can the Device Under Test Absorb?

In a hardware-in-the-loop rig, the failover budget is set in cycles of stale I/O, the inputs the device under test keeps receiving while the simulator recovers. Wall-clock milliseconds come second. The agent layer that drives stress campaigns can stall, crash or emit a bad command, so the real-time loop has to keep running without it. How much redundancy you need then depends on one ratio: recovery time divided by loop period. Size that ratio first and the architecture follows from it.

Keep the agent out of the loop that must not miss

The agentic layer may plan fault-injection sequences over MCP or run generated test logic inside a WebAssembly sandbox. Either way it belongs on the supervisory plane, where it writes setpoints into a double-buffered parameter table that the real-time core reads only at cycle boundaries. Because of that separation, an agent failure costs the rig nothing in determinism. The core keeps running the last validated scenario, and a constitutional guardrail rejects any parameter outside the envelope approved for the device under test. The harder failure is the real-time node itself. When the simulator core dies, the device under test receives no error. It sees plausible sensor values that have stopped changing. Frozen inputs are the failure mode that matters here, because an ECU will build a stuck wheel-speed or rail-voltage signal into a wrong control decision and log nothing.

The sizing formula and one worked case

Recovery time is the sum of three terms: detection T_det, switchover T_sw and state resynchronisation T_sync. The number of stale cycles the device under test sees is N_stale = ceil((T_det + T_sw + T_sync) / T_cycle). Detection is the number of missed heartbeats allowed, m, times the heartbeat period. Switchover is dominated by the I/O multiplexer or by backplane arbitration, and resynchronisation is the time the standby needs to load model state and align its clock to the bus schedule of the device under test. Almost all the uncertainty sits in T_det and T_sync. Heartbeat jitter on a shared Ethernet backplane and the spread in snapshot transfer time both grow with load, so measure them under the heaviest stress campaign the agent will ever run, not at idle. As a worked case, take a plant model stepping at T_cycle = 1 ms, labelled here as an estimate for this rig, and a warm-standby node whose total recovery time, detection and snapshot reload included, is estimated at 2.5 ms ± 1 ms. Dividing and rounding up gives an estimated 3 stale cycles, with a plausible spread between 2 and 4 depending on where in the cycle the fault lands and how loaded the backplane is.

Turning the number into an architecture decision

Compare N_stale against k, the number of consecutive cycles of held inputs the device under test's own plausibility monitoring tolerates before it flags a fault, or acts on the frozen data. That tolerance comes from the safety concept the device was developed under, so take it from the functional safety work products produced under standards such as ISO 26262 or IEC 61508. Do not guess it from a datasheet. The decision rule is simple: if N_stale is greater than or equal to k, warm standby is not valid for that test case, and you need a lockstep hot-standby core that shares state every cycle. That drives T_sync toward zero and leaves detection as the only term worth optimising. If N_stale sits clearly below k, warm standby is acceptable. The rig must still mark every recovery window in the test log, so the agent does not score the device's reaction to stale data as a real defect. Lockstep costs a second real-time target, a deterministic state replication link, and the engineering work to prove both cores stay bit-identical, so buy it only for the test cases where k is small.

What remains open

The term you cannot size away is T_det: shortening the heartbeat timeout to shrink N_stale raises the rate of false failovers under heavy agent-driven stress, every spurious switchover is a short burst of stale cycles of its own making, so the next decision is the timeout that best balances missed detections against those self-inflicted interruptions on your specific backplane.

Technical FAQ: Does the agent layer itself need a hot standby?

Rarely. The real-time core keeps running the last validated scenario through an agent outage, so a crashed agent pauses test progress without corrupting the loop. A cold restart of the agent, followed by a replay of its campaign log, is usually enough, provided the guardrail keeps rejecting out-of-envelope parameters while the agent comes back up.

Related Architecture Specifications (AGENTIC): maintenanceagentic.com · surveillanceagentic.com · avgagentic.com

More Technical Articles on hilagentic.com

HiL Benchmarking of Agentic Autonomous Emergency Braking under Corner-Case Road Hazards →FPGA-Accelerated Real-Time Plant Emulation for High-Bandwidth Actuator Co-Simulation →Sizing the Failover Budget When the Agent Driving Your HiL Rig Stops Answering →