I hate reinventing the wheel, but who knows what kind of innovation could happen by combining unique experiences and lessons someone can learn for future use.
For instance, I made a laser pointer, I could have bought one for $10-$100, but I decided to make my own, learn about Electrical Engineering and optics. I never finished it, but it taught me a ton about EE along the way. Now I am quite comfortable with EE, except the parts I'm uncomfortable about ofc :)
For a open source path tracer with a full glTF compatible material model and lighting and runs in the browser check out:
https://github.com/gkjohnson/three-gpu-pathtracer
Or if you want hardcore features look at Moonray from Dreamworks:
I feel like nvcc supports at least 17 maybe even 20 already.
It makes me wonder if CPUs will start adding a lot of matrix math specific extensions in the near future.
From a cursory glance, you might also be able to speed up the CPU backend by getting rid of the shared_ptrs and defining a stricter memory ownership model.