4 ms·
This is a pretty nice comment from the source that explains how it works: https://github.com/mozilla/gecko-dev/blob/11d9c7b7fa82fdfb8ac2a8f0864e9d8d5fe2b926/mfb
by inglor 7y ago
This is a pretty nice comment from the source that explains how it works: https://github.com/mozilla/gecko-dev/blob/11d9c7b7fa82fdfb8ac2a8f0864e9d8d5fe2b926/mfbt/RecordReplay.h#L32-L73 https://github.com/mozilla/gecko-dev/blob/11d9c7b7fa82fdfb8a...
```
// Recording and replaying works by controlling non-determinism in the browser:
// non-deterministic behaviors are initially recorded, then later replayed
// exactly to force the browser to behave deterministically. Two types of
// non-deterministic behaviors are captured: intra-thread and inter-thread.
// Intra-thread non-deterministic behaviors are non-deterministic even in the
// absence of actions by other threads, and inter-thread non-deterministic
// behaviors are those affected by interleaving execution with other threads.
```
- cocochanel 7y agoWhat 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.
- BoppreH 7y agoSounds like Mozilla is applying the concepts they developed for their C/C++ debugger, rr (https://rr-project.org https://rr-project.org).
- yowlingcat 7y agoExactly what I was thinking. I wonder when Chrome's going release their version!
- wizzwizz4 7y agoDepends whether anybody writes it for them, or whether Google has to make it on their own.
- jasonlaster11 7y agoThat's exactly right Brian Hackett collaborated early on with ROC. Here are the basic principles of Replay (https://developer.mozilla.org/en-US/docs/Mozilla/Projects/WebReplay https://developer.mozilla.org/en-US/docs/Mozilla/Projects/We...). In a nutshell, replay records Firefox's OS system calls, so that that Firefox can read from the recording when replaying.
- gnufx 7y agoFor what it's worth, the DMTCP [1] user-space checkpoint/restore system does that (and more). C/R is a way of doing coarse batch-based reversible debugging, typically of distributed HPC programs, and FReD [2] is a(n unfortunately dead) reversible debugger using DMTCP record/replay. 1. http://dmtcp.sourceforge.net/ http://dmtcp.sourceforge.net/ 2. https://arxiv.org/abs/1212.5204 https://arxiv.org/abs/1212.5204
- jasonlaster11 7y agoThanks for sharing!
- jasonlaster11 7y ago