I am currently working on implementing needed reduction
for interaction nets. To do that, I first needed to refactor a lot of somewhat ugly fast-written code in
. At some point, I changed retrieving an element from an array to
Many commits later, I decided to play with the program a little bit and compare performance between
ing. Boom! The program appeared to be broken. Even worse, invariance of the queue that is represented by that array with respect to the order in which it is processed is the whole point of interaction nets, namely the property of strong confluence also known as the one-step diamond property. I thought I fucked up hard.
First, I took a look at
for the line of code that calls
, and found the corresponding commit
. Then, I marked its parent commit as good with
. After a few steps,
found the first bad commit
Evidently, the problem had something to do with indirection applied by non-deterministic extension of interaction nets. And it did not take more than a couple of minutes to figure out a simple one-liner fix
Overall, it took less than half an hour from finding a bug to fixing it which I first thought would take hours if not days. To me, it looks like yet another evidence that the idea of
is totally genius. So, thanks again, Linus!
P. S. Free advice: when making commits, it is always useful to keep in mind 1) a possible need to
some lines of code later, and 2) almost inevitable need to deal with bugs which is a lot easier when commits are suitable for