﻿# SimPy strict=False: suppressing a lateness error does not meet a real-time deadline

Evaluate RealtimeEnvironment with separate logical and wall-clock evidence, and distinguish its strict error policy from actual timeliness of a simulation callback.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/simulation-simpy-realtime-strict-false-lateness-evidence/
Language: en

## A successful run can still deliver stale interaction

A digital twin drives a human-facing panel or a hardware-in-the-loop interface through a real-time environment. Heavy computation causes lateness errors, so the developer disables strict checking and the run finishes. That result establishes a different error policy, not timely interaction. Keep logical event order and wall-clock delivery as separate evidence. A controller receiving an old observation late can violate the experiment’s timing assumptions even when every event eventually executes.

## The factor defines an intended time mapping

The [real-time guide](https://simpy.readthedocs.io/en/stable/topical_guides/real-time-simulations.html) defines factor as wall-clock duration per unit of simulation time. It controls pacing rather than accelerating the callback’s computation. A smaller intended wall interval leaves less time for the same work. Preserve the time unit, factor and actual processing times when explaining results. A smooth logical clock is insufficient because the event-based model can maintain its own timestamps while actual processing falls behind the intended mapping.

## Strict mode governs the reaction to excessive delay

The [API reference](https://simpy.readthedocs.io/en/stable/api_reference/simpy.rt.html) describes a RuntimeError when processing is too slow under strict mode and permits disabling that behavior. Setting strict=False removes that failure path; it does not subtract already spent computation time. Do not infer zero lateness from an empty error log. If continuing late is acceptable for an offline visualization, state that policy separately from a test that requires observations or commands to arrive within a real-time budget.

## Measure event lateness at the interaction boundary

A proposed fixture should retain each relevant logical event time, its intended wall-clock instant and its actual callback or external handoff time. Use a declared monotonic timing reference and distinguish computation delay from transport delay if the experiment includes an external device. Compare strict and nonstrict error handling under the same proposed workload. No real-time simulation or hardware interaction was executed here. This defines evidence to collect, not a measured latency distribution.

## Rebasing a clock is a distinct lifecycle action

The API provides sync to align the internal timing baseline with current wall time, useful when time passes between environment creation and execution. Do not describe rebasing as proof that earlier interactions met their deadlines. A chosen lifecycle may deliberately start a fresh pacing interval, but its history and external-device assumptions must remain explicit. Likewise, lowering workload or changing the factor requires a new interpretation of the experiment rather than erasing the previous timing failure.

## State the acceptance claim at its actual scope

The [simulation-validation study](/journal/cxl-pool-simulator-two-host-validation-optical-bandwidth-sweep/) covers a separate physical-evidence boundary; [stack reproducibility](/journal/software-stack-reproducibility/) helps retain pacing configuration. Here acceptance distinguishes runtime continuation from real-time compliance. It does not establish hard operating-system guarantees, safe physical control or universal latency bounds. Those need their own timing design and validation after the team can report lateness even when it deliberately chooses to continue instead of raising an exception.
