Sometimes you encounter clear examples of how the timing of feedback can lead to problems. Yesterday I encountered an interesting bug in our software platform, due to a strangely implemented PHP function. Due to an incorrect choice by a core PHP developer, a bug on our side was hidden for a few years, becoming apparent on January 1st, 2011.
Some background:
The "mktime" function within PHP (which is a modified copy of the C-code mktime function) can be used to do various smart calculations on dates and time. One of its parameters is the year. This parameters has two ranges of valid values: 00 to 99 and the four character full year (e.g. 2011). The C-code version has a different definition: it takes the amount of years since 1900. Effectively this means that up until the year 2000 these two variant had overlapping valid input. To make things worse, a standard usage off this function in C would be to feed the result of the "localtime()" function into mktime. Localtime() uses the same years since 1900 as mktime in C. In PHP localtime() is also available. (Identical to C, years since 1900) The standard way of using this in C therefore worked correctly in PHP up until the year 2000. In many ways a standard millenium problem: code that worked correctly would brake on January 1st 2000.
Most PHP code in the world will have fixed in that period. (for example by adding 1900 to the result of localtime() before feeding it into mktime)
But then, in 2005, for reasons I can't really imagine, a core PHP developer decided to change the implementation of mktime by allowing 3 number dates (years since 1900). So far, so good, this would not be a big problem, but he did this only by allowing values up until 110 instead of the more logical 999! Effectively he reintroduced the same millenium bug for the year 2011.
Back to the concept of feedback:
What this change did was to hide (for a few years) incorrect implementations. Instead of calling out, spectacularly crashing, or some other obvious feedback, it didn't provide information for the developers that they did something wrong. No, at some inconvenient moment (by definition in the middle of the night) it just stopped producing valid output, creating a potential dangerous situation. (Murphy's law 2.0: All software ever developed will be used in some life critical situation)
Through the lack of correctly timed feedback this created an unstable situation. Especially the timing of the moment at which the problem would become known has been moved from during development and testing, to during production.
Saturday, January 8, 2011
Sunday, January 2, 2011
Feedback to create order
Interference by itself is not a very complete model of reality and complexity. It doesn't account for the difference between "random" structures and the stable, highly complex entities that have emerged. The interference between two sound waves can easily lead to some random noise, without any musically appealing structure. The main difference between random emergence and complex, emergent entities, lies in the concept of feedback. Without some form of feedback the emergent patterns are semi-static: They might be random or might be highly repetitive.
Feedback is a term commonly found in the field of control systems engineering. It stands for the effect of using the current result of a system to control the future results of the system. In general this is as 'simple' as putting a sensor in the system, which measures the result and compares this result with the requested demand. If the result is not equal to the request, this difference (the error signal) can be used to steer the system to the required output. There are some well known examples of such systems, like the thermostat at home, car cruise control, but also our own sense of balance, allowing us to stand.
If an emergent entity would 'want' to have a longer existence (longer than just the random appearance due to interference) it needs to provide feedback to the separate entities that form it. In most complex structures in the world around us, this form of feedback is easily discernible:
Feedback is a term commonly found in the field of control systems engineering. It stands for the effect of using the current result of a system to control the future results of the system. In general this is as 'simple' as putting a sensor in the system, which measures the result and compares this result with the requested demand. If the result is not equal to the request, this difference (the error signal) can be used to steer the system to the required output. There are some well known examples of such systems, like the thermostat at home, car cruise control, but also our own sense of balance, allowing us to stand.
If an emergent entity would 'want' to have a longer existence (longer than just the random appearance due to interference) it needs to provide feedback to the separate entities that form it. In most complex structures in the world around us, this form of feedback is easily discernible:
- In evolutionary systems this feedback would be called the reward function.
- In astronomy this feedback is provided in the form of gravity, in which the emergent system (stars, planets, rocks, etc) are formed by separate atoms, which through their own mass keep the emergent system stable.
- In social environments, this feedback is formed by social control, laws, norms, etc.
Subscribe to:
Posts (Atom)