4 ms·
What is non-determinism in the browser?
by cocochanel 7y ago
What is non-determinism in the browser?
- jstummbillig 7y agoInputs that are either random or subject to change (api responses, user prompts i.e.)
- correct_horse 7y agoBased on the grandparent, it sounds like race-conditions and random number generation fit the bill.
- gitgud 7y agoMy guess is that "optimisations" (shortcuts) in calculating the final layout, mean that the final layout is not entirely deterministic. It probably varies slightly, due to the entangled nest of dependencies that is responsive HTML rendering...
- janpot 7y agoI don't know but if I had to guess: order of responses coming in from the server, interleaved with timer events and user events.
- Jyaif 7y agoOnce source comes from the memory allocator, and the pointers it gives out. If you have an ordered map of pointers (e.g. std::map<void*>), iterating over the map will not be deterministic because the pointers given by a (regular) allocator are not deterministic.
- dgoldstein0 7y agoThis may be true in c++ but I believe is not in JavaScript. The language defines iteration order over keys of an object to be the insertion order (except numeric keys which are in ascending order). Not sure if there's anywhere that iteration order is actually nondeterministic that's allowed by the spec.
- implicit 7y agoNondeterminism is every place where information can enter your program from the outside world. It's random numbers, the system clock, data off the internet, and input events from the user. What it sounds like is that Mozilla has come up with a debugging environment that bottles all that nondeterminism up into a neat little package so that it can replay a specific run of your program any time you want.