April 16, 2013

Programmer’s Guide to Baby Software/Firmware


Newly instantiated baby objects can be quite confusing. The initial software they come preloaded with is quite buggy. Luckily there’s a series of patches that get gradually applied that improve functionality considerably.

Today’s lesson: The object-permanence-patch:

Initially babies are born with a single level cache of size 1. An object in view of the baby is inserted into the cache, evicting the previous object in view. The baby’s memory access function is rather error-proned, and cannot access anything not in the cache. This is not very useful memory system, so somewhere between four and seven months the object-permanence-patch is applied. This patch upgrades the cache to a two level cache with increased size. Now when something’s evicted from the first level cache it enters the second level cache. Baby can now remember things that are no longer within visual range.

One side effect of the patch is the so-called separation anxiety bug. The separation anxiety bug can occur when an object, usually the parent object, is evicted from the first level cache to the second level cache. The baby’s main process attempts to promote the object back to the top level cache, but fails. Alas, babies do not have an error handler nor do they recover gracefully from errors. (Aside: a patch for graceful error handling is sadly not forthcoming any time soon.) A secondary bug can occur when the baby’s main process predicts the parent object is about to be evicted from the first level cache, before the actual eviction.

While it may seem that baby is stuck in an endless cry loop, there is a work around. Baby’s main process is still a single threaded at this point. A well timed interrupt can push a new function onto the function stack, distracting baby from checking the memory cache. Once the parent object has been successfully evicted from the second level cache in memory, baby will cease trying to restore it to the first level.

There is a patch for the separation anxiety bug, but sadly it is usually not applied until about 2 years.

Yes, we’re working on separation anxiety.

Posted in Family Life | Tags:


  1. Love this post, Sarah! 🙂

    • Thanks!


Leave a Reply

Your email address will not be published. Required fields are marked *