I think i’ve finally pinpointed it?
Posted: 31 May 2026, 22:47
Mouse input on every major platform, including Windows, Mac, Linux, and consoles, has a directional drift bug rooted in floating point coordinate transformation in the compositing layer.
Modern operating systems route mouse input through a compositor before delivering it to applications. The compositor applies a floating point transformation to integer mouse deltas — scaling for DPI, logical-to-physical coordinate mapping, and other adjustments. The result of this transformation is a float which must be truncated back to an integer screen coordinate before delivery. That truncation is not neutral. It produces a directional error that accumulates rather than cancels out.
This can be demonstrated by drawing slow circles with the mouse. Clockwise rotation produces drift in one direction. Anticlockwise produces drift in the opposite direction. The pattern is deterministic and reproducible across every platform because every modern platform routes input through a compositing layer that applies floating point transformation.
This was confirmed in the nut-tree/libnut-core library on GitHub, where a developer reported that repeatedly setting the cursor to its own current position caused it to drift. The maintainer identified the bug as a rounding error in coordinate translation and fixed it in v2.5.1 by correcting the rounding.
On Windows, Desktop Window Manager was introduced with Vista and performs logical-to-physical coordinate transformation using floating point scaling, documented in Microsoft’s own Win32 API documentation. Microsoft’s mouse_event function in winuser.h uses floor rather than round when mapping absolute coordinates to screen positions, compounding the error for synthetic input.
Prior to compositing, applications received mouse deltas with minimal transformation. The drift was not present. The compositor is the common denominator across every platform and the point at which the directional truncation error is introduced.
No current consumer platform delivers mathematically correct mouse input by default.
Modern operating systems route mouse input through a compositor before delivering it to applications. The compositor applies a floating point transformation to integer mouse deltas — scaling for DPI, logical-to-physical coordinate mapping, and other adjustments. The result of this transformation is a float which must be truncated back to an integer screen coordinate before delivery. That truncation is not neutral. It produces a directional error that accumulates rather than cancels out.
This can be demonstrated by drawing slow circles with the mouse. Clockwise rotation produces drift in one direction. Anticlockwise produces drift in the opposite direction. The pattern is deterministic and reproducible across every platform because every modern platform routes input through a compositing layer that applies floating point transformation.
This was confirmed in the nut-tree/libnut-core library on GitHub, where a developer reported that repeatedly setting the cursor to its own current position caused it to drift. The maintainer identified the bug as a rounding error in coordinate translation and fixed it in v2.5.1 by correcting the rounding.
On Windows, Desktop Window Manager was introduced with Vista and performs logical-to-physical coordinate transformation using floating point scaling, documented in Microsoft’s own Win32 API documentation. Microsoft’s mouse_event function in winuser.h uses floor rather than round when mapping absolute coordinates to screen positions, compounding the error for synthetic input.
Prior to compositing, applications received mouse deltas with minimal transformation. The drift was not present. The compositor is the common denominator across every platform and the point at which the directional truncation error is introduced.
No current consumer platform delivers mathematically correct mouse input by default.