-
Notifications
You must be signed in to change notification settings - Fork 0
Description
⚠️ Issue: Cold-Start Data Inconsistency (Empty Deque Exception)
The Regulator and Display modules attempt to perform statistical operations (like max() or mean()) on the glob_bin. If these operations occur before the first Pump cycle completes, the system throws a ValueError: max() arg is an empty sequence.
🎯 Location:
robot/vtc/pump.py -> Pump.__init()__
robot/vtc -> display_tick
🦠 Symptoms:
- Immediate crash on startup with
ValueError. - "Flickering" UI where values appear as
NaNorNonefor the first 500ms of operation. - Race conditions where the Regulator tries to normalize a sensor that hasn't been "discovered" yet.
🩺 Diagnosis:
The system follows a Lazy Initialization pattern where deques are created only when data arrives. In a multi-threaded environment, the consumer (Regulator) often outruns the producer (Pump) during the first 100ms of the lifecycle.
💡 Proposal:
The "Neutral Seed" Initialization
Modify the Pump initialization to perform a Hardware Discovery Probe. This ensures that the glob_bin is fully populated with "Safe Defaults" before any timer-based consumers are allowed to run.
- Mandatory Seeding: Every deque marked
active: truein the YAML must be initialized with at least oneNoneor0.0. - Discovery Probe: The Pump should attempt one synchronous harvest of all active conduits during the
INITstate to replace neutral seeds with real hardware values. - Atomic Hand-off: The
glob_binmust be fully "shaped" before theRUNNINGstate is declared.
Metadata
Metadata
Assignees
Labels
Projects
Status