Skip to content

Comment on Every Computer System Is a State Machineparent

Comments

I'm not saying state machines don't have changing state. I'm referring to the closed world assumption in the model. Also, I'm not saying state machines are not useful models for some types of computer use as in 'all models are wrong, some models are useful'. I use state machines in solutions all the time. It is a very useful pattern.

However, a statemachine model will not let me predict whether my computer driving an actuator will dribble this basketball or just randomly slap it. It is not going to help me predicting the size of a buffer needed to losslesly accept a certain rate of incoming packets.

Now in each of these cases I could extend my initial computer model to capture the relevant information. I could add a clock running 'ticks' for my 'computer', I could add a second clock running 'ticks' for the universe (i know, but let's keep it simple, remember, all models are wrong) and model the external system with wich my 'computer' interacts inside my new model and the above questions could be answered. But now I have no longer modeled a just a computer. You have modeled a closed world universe as a statemachine.

There is a huge difference for me in saying 'some computations can usefully be modeled as a state machine' and, to quote from the article, '[A] Computer, physically, is nothing more than a storage of various states, and combinational logic based on all the states (Program Counter, register values, RAM, Carry Flag, etc.) for state transition.'. Because even though usefull, like Newtinion Physics, or atomic models that look like small planets orbiting a sun can be usefull models, it is not complete. It will never tell me how my linear algebra library needs to be optimized for specific processor dies to minimize thermal throttling.

it is not just an incomplete but a leaky abstraction.

As an aside remember 'Row Hammer' [1]? That was sheer poetry in this regard. Using physical properties of a computer system to influence computation in a virtual computer from a different virtual computer just because they run on the same physical underlying hardware. The computer memory hardware itself was supposed to have abstracted this, the hypervisor was supposed to ahve abstracted the computer, and the VM was supposed to be a computer abstraction on top of the hypervisor.

I see what you mean but I think it is not totally correct to attribute this to a closed world assumption, after all state machines can have inputs and outputs. I would say the important thing is that in most of those scenarios there is an external feedback loop, the output affects future inputs and this makes the behavior unpredictable as you do not know the sequence of inputs unless you can accurately model the effect of the output on the input.

On the other hand that is not really different from a scenario without external feedback where you just do not know the input - if you do not know the sensor input, you can not predict the movement of the actuator but it does not really make a difference whether you just do not know the sensor input for arbitrary reasons or because of unknown effects of the outputs via the actuator on the sensor inputs.

Thermal throttling is a similar example, there is a feedback loop between the computations you perform, the heat this generates, and how the processor reacts to the resulting temperature sensor inputs. The unknown variable is again the sensor input, whether due to heat from the die are me removing the cooling fins.

Row Hammer is an example where the physical implementation has additional state changes not intended by the designer and which are even subject to variation in the production process. If you are just modelling the intended behavior than the model we obviously not be correct in cases were the unintended behavior is relevant.

In the end I would say that a computer is just a state machine as long as you stay in a regime where the physical implementation is not relevant but at some point this will break. But I also think that this is pretty academic, modern computers are so complex that thinking about it as a state machine will almost always not be useful at all, even in the most well behaved scenarios without the physical implementation becoming relevant or complex external feedback loops.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.