Why the HIL Island Does Not Wait for the Ray Tracer: A Co-Simulation ADR

We rejected a single global lockstep barrier across traffic, network, RF channel and hardware-in-the-loop federates. In its place, a real-time HIL island is decoupled from the discrete-event core through a bounded buffer, and every federate has a defined degraded mode. This record states the rejected design on its own merits first, then names the failure that ruled it out and the condition under which we would choose it again.

The case for global lockstep

Lockstep is the honest default for a V2X digital twin, and we took it seriously. One barrier, advanced by a single time master, means every federate sees the same logical instant: a CAM generated in the traffic model, propagated by the channel model and decoded by the ECU under test all share one causal timeline. Replay is trivial, because a seed and the barrier sequence reproduce the run bit for bit. Debugging is also simpler, since there is never a question of which federate was ahead, and the interfaces map cleanly onto co-simulation standards such as FMI and HLA, both of which assume a coordinator that grants time advances. For pure software campaigns at city scale, the design would serve well.

The failure that decided it

The HIL rig runs on a fixed 1 ms real-time step, and that one number broke lockstep. In urban canyon scenes the ray-tracing channel federate has highly variable compute time. When a dense intersection fills with reflective façades and several hundred communicating vehicles, one step of that federate can take far longer than the wall-clock budget, and the global barrier holds every other federate until it returns. The software federates absorb the stall harmlessly because they only live in logical time. The ECU under test cannot. It misses its input deadline, its watchdog fires, the radio stack resets, and the whole run becomes worthless as validation evidence. Worse, the failure is silent in the logs, because logically nothing went wrong. Our estimate from early integration runs is that a stall long enough to trip the watchdog would hit at least one step in most dense urban scenarios longer than a few minutes, which makes long soak tests impossible.

What we built instead

The discrete-event core, made up of traffic, network and channel federates, keeps conservative synchronisation among itself, and the HIL island consumes its output through a bounded lookahead buffer filled ahead of wall-clock time. If the buffer drains because a federate upstream stalls, the island does not block: the channel model falls back to a precomputed statistical fading profile for the affected links, the frames are tagged as degraded, and the run continues with a marker that post-processing uses to exclude or weight those intervals. A crashed federate is restarted from its last checkpoint while the island keeps running on the fallback model, and the core rejoins at the next consistent cut. Each federate therefore has three declared states, nominal, degraded and recovering, and the coordinator treats a missing heartbeat as a transition to degraded, never as a reason to hold time. The cost is real: a degraded interval is no longer exactly reproducible, and the replay tooling has to rebuild the fallback decisions from the tags, not from the seed alone. We estimate the bookkeeping adds a modest but noticeable share to orchestration complexity, and we accept that.

The condition that would reverse this

If the deliverable were certification evidence that demands bit-exact reproducibility of every frame, or if no federate in the run had a wall-clock deadline, global lockstep would win, and our decision rule is exactly that: a federate bound to real time must never sit behind a barrier owned by a federate that is not.

Can a run that contains degraded intervals still count as validation evidence?

Yes, for the intervals that stayed nominal, which is why the tags matter. Reviewers get the run with the degraded spans marked, so they can reject it if the scenario's critical event falls inside one. The next decision is whether to rerun those scenarios automatically in pure software lockstep to produce a reproducible reference that can be compared against the HIL trace.

Back to V2XTwins · Domains

← Back to V2XTwins
Engineering & Architecture Brief

Why the HIL Island Does Not Wait for the Ray Tracer: A Co-Simulation ADR

We rejected a single global lockstep barrier across traffic, network, RF channel and hardware-in-the-loop federates. In its place, a real-time HIL island is decoupled from the discrete-event core through a bounded buffer, and every federate has a defined degraded mode. This record states the rejected design on its own merits first, then names the failure that ruled it out and the condition under which we would choose it again.

The case for global lockstep

Lockstep is the honest default for a V2X digital twin, and we took it seriously. One barrier, advanced by a single time master, means every federate sees the same logical instant: a CAM generated in the traffic model, propagated by the channel model and decoded by the ECU under test all share one causal timeline. Replay is trivial, because a seed and the barrier sequence reproduce the run bit for bit. Debugging is also simpler, since there is never a question of which federate was ahead, and the interfaces map cleanly onto co-simulation standards such as FMI and HLA, both of which assume a coordinator that grants time advances. For pure software campaigns at city scale, the design would serve well.

The failure that decided it

The HIL rig runs on a fixed 1 ms real-time step, and that one number broke lockstep. In urban canyon scenes the ray-tracing channel federate has highly variable compute time. When a dense intersection fills with reflective façades and several hundred communicating vehicles, one step of that federate can take far longer than the wall-clock budget, and the global barrier holds every other federate until it returns. The software federates absorb the stall harmlessly because they only live in logical time. The ECU under test cannot. It misses its input deadline, its watchdog fires, the radio stack resets, and the whole run becomes worthless as validation evidence. Worse, the failure is silent in the logs, because logically nothing went wrong. Our estimate from early integration runs is that a stall long enough to trip the watchdog would hit at least one step in most dense urban scenarios longer than a few minutes, which makes long soak tests impossible.

What we built instead

The discrete-event core, made up of traffic, network and channel federates, keeps conservative synchronisation among itself, and the HIL island consumes its output through a bounded lookahead buffer filled ahead of wall-clock time. If the buffer drains because a federate upstream stalls, the island does not block: the channel model falls back to a precomputed statistical fading profile for the affected links, the frames are tagged as degraded, and the run continues with a marker that post-processing uses to exclude or weight those intervals. A crashed federate is restarted from its last checkpoint while the island keeps running on the fallback model, and the core rejoins at the next consistent cut. Each federate therefore has three declared states, nominal, degraded and recovering, and the coordinator treats a missing heartbeat as a transition to degraded, never as a reason to hold time. The cost is real: a degraded interval is no longer exactly reproducible, and the replay tooling has to rebuild the fallback decisions from the tags, not from the seed alone. We estimate the bookkeeping adds a modest but noticeable share to orchestration complexity, and we accept that.

The condition that would reverse this

If the deliverable were certification evidence that demands bit-exact reproducibility of every frame, or if no federate in the run had a wall-clock deadline, global lockstep would win, and our decision rule is exactly that: a federate bound to real time must never sit behind a barrier owned by a federate that is not.

Technical FAQ: Can a run that contains degraded intervals still count as validation evidence?

Yes, for the intervals that stayed nominal, which is why the tags matter. Reviewers get the run with the degraded spans marked, so they can reject it if the scenario's critical event falls inside one. The next decision is whether to rerun those scenarios automatically in pure software lockstep to produce a reproducible reference that can be compared against the HIL trace.

Related Architecture Specifications (AUTOMOTIVEV2X): v2fleet.com · v2satellite.com · v2swarm.com

More Technical Articles on v2xtwins.com

Simulating 1,000 Vehicles per Square Kilometer: Channel Saturation and Packet Delivery Ratios →Simulating Collective Perception in CARLA: Synthetic LiDAR Point Clouds over Virtual PC5 Sidelink →Why We Did Not Put the Hardware Bench Inside the Global Lockstep →Why the Ray Tracer Lost Its Veto Over the Simulation Clock →