> One of my goals was “use as much of the same code as possible on the CPU and GPU”.
Great idea, it's hard to debug GPU code, and super convenient to have something that you can run & debug on the CPU, then just flip a switch and get GPU speedups!
> Another obvious limitation is that GPU code cannot recurse.
Yep. I bet this changes relatively soon, since you can sometimes use recursion in OpenCL & CUDA.
It's a fun exercise in ShaderToy to write a recursive ray tracer. Here's mine: https://www.shadertoy.com/view/XllBRf
And here's a much better one: https://www.shadertoy.com/view/4scfz4