Casual Shadertoy Path Tracing 1: Basic Camera, Diffuse, Emissive
blog.demofox.org
blog.demofox.org
I've written some CUDA code and GPU assembly for unrelated projects, but it was designed to avoid warp divergence and I don't know you would go about doing that with a ray tracer.
I find this to be an issue. Inexperienced devs see the pretty pictures on shadertoy and get mislead as to what they're really learning. They're learning how to solve a puzzle "how do I draw pretty pictures given a single function who's only input is the position of the pixel". That can be great fun to challenge yourself with. It's similar to writing to write something in brainfuck or make an interesting dwitter doodle but it's not remotely a "best practice".
However, this technique of doing everything in a fragment shader can actually make sense for some types of unusual/experimental scenes. Stuff like infinite repetition or fractal detail, smooth liquid-looking geometry with constantly morphing topology, detailed translucent volume rendering. These can be considerably easier to create as a fragment shader.
So, while some people are indeed doing this as an esoteric programming exercise, others also realize that this technique can allow the exploration of different types of realtime generated images.