gpujs / gpu.js

GPU Accelerated JavaScript
https://gpu.rocks
MIT License
15.04k stars 646 forks source link

Which parts of GPU.js are deterministic, same bits in to same bits out? #764

Open benrayfield opened 2 years ago

benrayfield commented 2 years ago

I want to use GPU.js as a compile target (for wikibinator203) and need to know which parts are deterministic and repeatable across (nearly?) all computers. For using the nondeterministic parts, I can only compile to that depending on a strict flag, else I would compile to javascript directly to not use GPU.js.

Java and javascript seem to always give the same float and double bits for some operators, including + * Math.sin /, and some of those match GPU.js but others dont. I dont even care if its the same as other systems, as long as its deterministic. Theres IEEE754 standards for float and double math, which is built into most hardware. Maybe GPU.js is not directly using it since its transferring stuff through canvas bytes?

What are the opcodes supported, in terms of exactly n bits in -> exactly which m bits out.