For anyone wondering, Mocha Doom is an awesome piece of machinery. Maes has taken the original Doom source distro, and converted it, module-by-module, line-by-line, into a byte-exact duplication of the original masterpiece, in the Java language. Honestly, I wasn't sure what to expect, but, now, Mocha is freaking playing IWAD demos (!!), which, if you know anything about demo sync, then you KNOW that it must be *real damn close*.
As for UD DEMO4, I can remember when I was working on demo sync - DEMO4 gave me a fit. I was still using ZDoom's v1.11 angle lookup table generator (yes, ZDoom v1.11). The demo would desync right at the beginning, when doom guy turns right, and takes out 2 shotgunners with one shot. In my demo playback, only one of the shotgunners died, and it was because that angle generator exactly recreated the original lookup table - except for one single angle, the number was off by one. That caused the shot to miss.
So, I *know* that, for an engine to play an IWAD demo properly, it has to be arbitrarily close to the original. As Maes stated, a single line of code can kill you.