quickjs-emscripten icon indicating copy to clipboard operation
quickjs-emscripten copied to clipboard

Determinism of the library

Open angrymouse opened this issue 4 months ago • 3 comments

Hey! Is it possible to create fully deterministic sandbox from this library? (So that same code will always give same result with same input, even if code authors try to get different results). Assuming exposing only asyncified function (no callbacks or promises) and not exposing any non-deterministic functions, would there be some other ways to produce non-determinism?

angrymouse avatar Feb 10 '24 20:02 angrymouse

I don't think the Javascript bits of the library introduce non-determinism into the VM. You should double-check the Emscripten module initialization code for your preferred variant.

As far as behavior of the upstream quickjs interpreter, I don't understand the underlying code enough to give a confident answer. You can try asking folks at quickjs-ng quickjs-ng issues, the upstream bellard/quickjs issues or the mailing list

justjake avatar Feb 10 '24 20:02 justjake

Thank you! Will do.

angrymouse avatar Feb 10 '24 20:02 angrymouse