A Voronoi-diagram shader intended as a moving background produced a visible stutter on one Windows machine while running fine elsewhere. The visual artifact came from the noise that places Voronoi centers: replacing GLSL fract(x) with the mathematically equivalent x - floor(x) immediately removed the snapping. An LLM suggested a specific NVIDIA driver miscompile (driver 595.79 on an RTX 4070) that made fract temporally discontinuous for large operands, but that explanation proved incomplete after further testing.
Hands-on experiments revealed a different, subtler cause: changing a single float literal (e.g., 398.0 → 398.1) or inserting any fractional multiplication in the noise input also eliminated the stutter, even with fract still present. Capturing browser frames with RenderDoc and inspecting pixel-shader disassembly showed dramatically different compiled code paths depending on that literal, and that the browser was using DirectX 11 shader binaries. The outcome points to a GPU compiler/optimization quirk in the WebGL/driver toolchain that alters instruction emission and floating-point behavior; pragmatic fixes are to avoid fract() in critical noise kernels or force different expression forms/literals so the compiler emits safe code.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.