You’re a Maya user, right? 
And of course once you get these basics down, you still have to have a system that checks which attrs are dirty, build a list of what attrs need to be calculated in what order, and then traverse the graph in the correct order, solving as you go. That’s likely a bit of a pain. Haven’t done it yet myself.
The way I understand dirty bits best is the push/pull method (I’m pretty sure this is how Maya does it…)
Each attribute (input and output) has a ‘dirty’ bit
Each attribute also has a cached value.
If an input is changed, it’s attribute’s dirty bit is set to 1, this is then PUSHED through the network:
-
Whenever an input attribute’s dirty bit is set to 1, any output attributes in that node have their dirty bits set to 1 (2)
-
Whenever an output attribute’s dirty bit is set to 1, each of the inputs connected from it have their dirty bits set to 1. (1)
-
That will filter the dirty bit down through all of the nodes that would be affected by the changed attribute…
Data is then PULLED from the bottom of the network:
-
When data is requested from an output, if it’s dirty bit is 0, it returns the current cached value. If the dirty bit is 1, it asks the node to calculate the value of the output. (5) When it gets this, it stores it in it’s cache, sets it’s dirty bit to 0, and returns the cached value
-
To calculate the output, the node asks the input attributes for their values (6), does what it needs to to, and then returns it
-
In an input attribute, when it is asked for it’s value, it it’s dirty bit is 0, it returns it’s cached value. Otherwise it requests the data from the output it’s connected to. (4)
There is one major upgrade to this system as described - dependencies - this affects step (1) above… Each output to a node is told which inputs it depends on. In doing this, each input finds out which output(s) depend on it. Then, when an input changes, it only needs to send the dirty bit to the outputs that depend on it.
Anyway, I hope this makes sense - if not, I’ve probably missed out a step or not explained it properly… I talked Dan through a basic version of this yesterday (or was it monday?)…
On a side note, Shake does this a slightly different way… Instead of having dirty bits, it has what it calls a ‘cacheId’ - this is a compressed string representation of all of the nodes above it in the tree. Whenever a node’s contents are requested, it figures out it’s cacheId by asking each of it’s inputs for their cacheIds and then combining them with it’s own parameters. If the cacheId it generates is the same as the one stored internally, and it has a cached image stored, then it just passes that one out rather than calculating it all again…
And no I’m not copying their MEL syntax… completely… hehehe…