proomt

Search

Search posts, papers, and topics

All posts

LobstersBruno Croci17 min readintermediate

When adding a fractional part to a number fixes your shader

Summary

A Voronoi fragment shader stutters on an RTX 4070; the author discovers that replacing `fract()` with `x‑floor(x)` eliminates the glitch, suspects a driver miscompile, and documents a week‑long manual debugging process with code, device tests, and LLM‑assisted hypotheses.

  • GPU driver bugs can manifest as subtle visual artifacts; even well‑tested GLSL functions like `fract` may misbehave on specific hardware/driver versions.
  • When a shader behaves inconsistently across devices, isolate the offending code by stripping features and testing on multiple GPUs.
  • Replacing `fract(x)` with the mathematically equivalent `x - floor(x)` can sidestep certain driver miscompilations because it forces a different instruction sequence.
  • LLMs can suggest plausible fixes but may not reliably reproduce the underlying bug; manual inspection and minimal repro cases are still essential.

Shader developers often assume GLSL built‑ins are reliable across all GPUs. This post shows that driver‑level miscompilations can break that assumption, and that a tiny change in expression form can be a practical workaround. It also illustrates a disciplined debugging workflow that blends manual t…

6/10

Related reading

  1. Can we make default Tailwind a more accessible choice?

    The post examines Tailwind’s default rem‑based breakpoints, showing how they scale with a user’s root‑font‑size and can shift layouts, which helps some users but can break designs. It argues that pixel breakpoints remain a defensible alternative for preserving layout stability while still supporting accessibility.

    Freek Van der Hertenfreek.dev1 min
  2. Lies, Damn Lies and Benchmarks

    Codename One engineers dissect why benchmark numbers can be misleading, then share concrete work on GC tuning, proper weak/soft references, and a new probing sequence for their open‑addressed HashMap that cuts miss‑probe counts from >16 k to ~1.5 per lookup.

    CodeName Onecodenameone.com20 min
  3. Reversing Factorio's RNG

    The author reverse‑engineers Factorio’s RNG, confirms it’s the Boost taus88 generator (a 3‑LFSR XOR combo), proves equivalence with the game’s compiled code via decompilation and symbolic Python checks, and explains how the weak LFSR structure lets you predict future “random” quality outcomes.

    Hacker News front pagegithub.io61 minHN25248lobste.rs26