explain non-determinism bug

This commit is contained in:
Quaternions 2025-01-15 02:59:40 -08:00
parent 3413ec8740
commit 2a9e848541

View File

@ -122,7 +122,12 @@ impl MouseInterpolator{
// case 3: stop
// a mouse event is buffered, but no mouse events have transpired within 10ms
// push buffered mouse instruction and flush buffer to output
// This is a potential source of non-determinism
// since the timestamp from the first instruction after timeout is used
// and not the precise timeout timestamp.
// This can be fixed by polling the mouse interpolator for timeout externally
// and then conditionally running the timeout right before every instruction.
// Essentially moving this if statement outside where the timer is accessible.
if self.get_mouse_timedout_at(ins.time).is_some(){
// push buffered mouse instruction and flush buffer to output
self.timeout_mouse(ins.instruction.time);