April 1, 2026
Ray-marching, rage-marching
Jax's true calling: Ray-Marching renderers on WebGL
Python in the browser paints 3D — JAX fans rejoice, skeptics shrug, iPhone Firefox says 'black'
TLDR: A dev built a browser 3D demo in ~100 lines of Python using JAX, turning math into moving shapes. Comments split between JAX hype and PyTorch shade, skeptics questioning real-world use, and a Firefox-on-iPhone black-screen bug—fueling a bigger debate about GPUs powering more than just AI
Benoît Paris just dropped a tiny flex: a ~100‑line Python renderer that runs in your browser using JAX, the math‑friendly library people normally use for AI. Instead of building with fiddly 3D models, he uses “distance to shape” math to draw a ball and cube, then lets JAX’s automatic differentiation handle shiny lighting. It’s nerd magic, but it looks smooth, and the code is right here.
The comments? Absolute chaos in the best way. One camp is ready to crown JAX the new hotness outside AI. VHRanger torches PyTorch with a meme‑worthy burn about “Heisen‑deprecation,” and others pile on with “this is what GPUs were made for” energy. heisenzombie backs it up with a real‑world win: they rewired decades‑old FORTRAN physics code with JAX and let auto‑diff do the grunt work. Meanwhile, vatsachak declares the bigger picture: GPU compilers aren’t just for chatbots—parallel = good, full stop.
But the skeptics showed up with receipts. dvt says SDFs (those mathy shapes) are cool for demos, yet real 3D work—collisions, meshes, textures—gets hard fast. The vibe: awesome toy, but is it a tool? And then there’s mobile reality. corndoge reports the Firefox on iOS demo goes “black screen and page scroll,” spawning a mini‑thread about web graphics fragility.
So yes, it’s gorgeous math made clickable—and it’s a flashpoint. Is JAX secretly the browser graphics hero we didn’t know we needed, or just a shiny proof‑of‑concept? The community can’t decide, but it’s having a very loud, very funny time trying
Key Points
- •A ray‑marching renderer is implemented in JAX with about 100 lines of Python.
- •The demo renders a 512×512×3 image tensor defined by a function of inputs like mouse position and time.
- •The project uses Signed Distance Functions for geometry, with smooth unions to preserve differentiability.
- •`jax.vmap` is applied twice to vectorize per‑pixel computations across the entire image in parallel.
- •Surface normals are obtained via `jax.grad` (SDF gradient), enabling compile‑time diffuse and reflective lighting without runtime hacks.