3 ms·
Author here. Completely agreed. My jaws dropped when I saw the INITIAL_JIFFIES. The kernel developers really saved our butt. I could not imagine debugging this
by askldjd 9y ago
Author here. Completely agreed. My jaws dropped when I saw the INITIAL_JIFFIES. The kernel developers really saved our butt.
I could not imagine debugging this problem if INITIAL_JIFFIES was randomized. It may takes days/weeks/months for this bug to appear.
- lfowles 9y agoSimilarly, Unreal Engine 4 offsets platform time (a double) by some large value so if it's stored in a float, accuracy errors will be exposed almost immediately. Looking it up, the offset starts out large enough that the epsilon is two seconds.
- vageli 9y agoDo you have a link with more info? I'd love to read more about this.
- lfowles 9y agoSorry, no. It's not something documented other than a cryptic comment in the source code ( FPlatformTime::Seconds() ) assuming some knowledge of floating point number gotchas. Edit: Here's a more detailed post o made about the specific gotcha if you're interested: https://community.gamedev.tv/t/why-is-fplatformtime-seconds-already-past-6-months/9701 https://community.gamedev.tv/t/why-is-fplatformtime-seconds-...
- aaronchall 9y agoHere's the patch that applies this: https://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.5/2.5.62/2.5.62-mm2/broken-out/initial-jiffies.patch https://www.kernel.org/pub/linux/kernel/people/akpm/patches/...
- askldjd 9y agoNice! I was looking for it, and it predates git. Thank you!!