by raphlinus · 6y ago · 0 comments
http://cwyman.org/papers/hpg16_oitContinuum.pdf
The GPU / accelerator BVH traversals are perhaps more applicable (e.g., https://www.embree.org/papers/2019-HPG-ShortStack.pdf) but they also have a different "I can restart my computation" property that say JSON parsing wouldn't have (though maybe if you're willing to do a lot of restarts once you parse the inner portions and push them onto a heap...).
Anyway, cool problem!
The problem is slightly different, though, because the major focus for transparency is concurrent writing from potentially many different shaders, while in the stack case each thread can build its data structure without any concurrency or need for atomics; once an aggregate is built, it is "published" (see my prefix sum blog for details on that) and treated as immutable.
These kinds of concurrent approaches do become important for later stages in the JSON parsing process, like building hashmaps for keys in a dictionary. I'm pretty sure the whole problem is tractable and have thoughts how to solve it, but deliberately kept the scope of this blog post limited, as I figured it was challenging enough. But it's very cool to reach people who appreciate the ideas, and if you find anything else that's relevant, I'd love to hear from you.
[1]: https://on-demand.gputechconf.com/gtc/2014/presentations/S43...