Controller version
develop at 2ea66c10e96d88013a04441134d3d4f8e8c88510. This is controller-side display-state handling; firmware is not changed.
Reproduction
Run one WHB04 display callback while CNC.vars has no curspindle entry:
pendant._cnc.vars = {
"wx": 0.0,
"wy": 0.0,
"wz": 0.0,
"wa": 0.0,
"curfeed": 0.0,
}
pendant._handle_display_update(daemon)
Malformed (None, "invalid"), non-finite (nan, +inf, -inf), negative, over-range, and finite integers too large for float conversion also reproduce an exception or setter rejection. For example, float(10**10000) raises OverflowError in the sanitizing path.
Expected
The scheduled display refresh should remain live. Missing, malformed, or non-finite spindle values should display as zero; finite values should be clamped to the WHB04's supported 0..65535 range.
Actual
The callback indexes curspindle directly and passes it unsanitized to a strict setter: display callback, setter. The daemon schedules that handler onto the GUI clock from its device loop (scheduling call, clock executor).
Impact
The GUI-clock callback raises and the pendant can retain a stale spindle value (and skip the remainder of that display update). Because the callback is scheduled asynchronously, this is not evidence that the HID read loop reconnects, nor does the callback itself command or alter spindle motion.
Regression proof
An eleven-case test starts the daemon display at a nonzero value and covers missing, None, malformed text, negative, over-range, numeric text, nan, +inf, -inf, and huge positive/negative integers. Against the pinned base all eleven cases raise or retain invalid behavior. The previous patch revision passed the first nine but failed both huge-integer cases with OverflowError.
Controller version
developat2ea66c10e96d88013a04441134d3d4f8e8c88510. This is controller-side display-state handling; firmware is not changed.Reproduction
Run one WHB04 display callback while
CNC.varshas nocurspindleentry:Malformed (
None,"invalid"), non-finite (nan,+inf,-inf), negative, over-range, and finite integers too large forfloatconversion also reproduce an exception or setter rejection. For example,float(10**10000)raisesOverflowErrorin the sanitizing path.Expected
The scheduled display refresh should remain live. Missing, malformed, or non-finite spindle values should display as zero; finite values should be clamped to the WHB04's supported
0..65535range.Actual
The callback indexes
curspindledirectly and passes it unsanitized to a strict setter: display callback, setter. The daemon schedules that handler onto the GUI clock from its device loop (scheduling call, clock executor).Impact
The GUI-clock callback raises and the pendant can retain a stale spindle value (and skip the remainder of that display update). Because the callback is scheduled asynchronously, this is not evidence that the HID read loop reconnects, nor does the callback itself command or alter spindle motion.
Regression proof
An eleven-case test starts the daemon display at a nonzero value and covers missing,
None, malformed text, negative, over-range, numeric text,nan,+inf,-inf, and huge positive/negative integers. Against the pinned base all eleven cases raise or retain invalid behavior. The previous patch revision passed the first nine but failed both huge-integer cases withOverflowError.