Parallel Consensus

The Actor framework for human decision making

I just realized that the books I tossed away (see previous post) included a book with a personal inscription: "Corba Unleashed", from Suhail Ahmed. (Sorry about that, Suhail!)

He once told me he wrote a letter to Steve Jobs, saying how much he loved NeXT OpenStep, but that there was no way on earth he would ever be able to buy a copy of it. He got a copy for free, and recommended us to try things like this more often. The short story: that's how I got his book with a personal inscription.

Any way, the other important thing Suhail tried to explain to me is that

"everything in life is about search and sort"

Define up

He could be right about that. One thing is for sure, you do it a lot, and usually, it's not all that hard. However, if you need to reach consensus among a group of people on what's most important, it can be extremely hard. None of the sorting algorithms are going to help you with that, since the fact of the matter is that all of these people have a different answer to the question 'what is up?'.

You will have to look really hard to find two people with exactly the same values, personal believes and taste. If there's only the slightest difference in personal opinion, it will be really hard to achieve consensus on relative importance.

Think about it: say you would just print all of the things for which you need to determine the priority on index cards, and put them all on the floor, telling a team of people to sort them according to priority. I guarantee: that team of people will spend an hour and a half just talking about the three most important things.

The case

A couple of years ago, we decided (as an organization) to start compiling a list of things / patterns / practices / ideas we considered to be important for good craftsmen. Gathering those ideas wasn't all that hard. In just a few weeks I had a huge (!) pile of things people considered important.

We wanted to print these things on a convenient set of memo cards. But a box of 500 cards would be to heavy to conveniently carry around. So we needed to create a subset from the original set, with only 'the most important' cards.

First stab

As a first stab, Iwein Fuld and me gathered around the table in our living room, and decided to split the pile in two. Each of us would take half of the pile and sort them according to our own personal taste. Once done, we would have two rows of cards, which we could then simply merge together.

With Iwein, that was a pretty safe exercise, since we generally agree on a lot of things, and if we disagree, he's right most of the time. However, even in this case we tended to have debates about things that really were only two cards separated of each other. I mean, for the inclusion in the deck of 80 cards, that would hardly matter, but still.

Two rows of cards

Second stab: parallel triage

A couple of weeks after that, we had to do it again, but now with four people in the room. This is how I eventually organized it:

Before anyone was in, I made sure there were only four tables in that room, organized in a circle. Every perspon was going to get a private table of his own. Then I put chairs between the tables. So we would have a circle of tables, separated by chairs.

Then I split the pile of cards into four decks of the same size, and put them on the four chairs between the tables.

When everybody came in, this is what I told them:

  1. You have a chair on your right-hand. That's your inbox. You can take cards from that inbox.

  2. If you take a card from your inbox, then there are two things you can do: either you put it on your desk, as one of twenty you can have on your desk, or you mark it as seen, and pass it to the inbox of the person to your right.

  3. If you pull a card from the inbox that already has your signature (you have already seen it), you drop it on the floor. That's your waste basket.

  4. You can change your mind on what you want to hold on to, but you can never have more than 20 cards on your desk, so if you already have 20 and you want to add another one as well, you need to let one of the other cards go.

  5. Cards on your desk will make it in the final set.

  6. If there are no more cards circulating, then we're done.

Parallel sort in action

Fast!

I can't tell you how much that sped up the process. If I remember well, then we had a bottle neck at some point, preventing the inflow of messages into the inboxes of other people in the ring, and I think we solved it by some way work stealing, but I don't recall the details.

Energy levels stayed up for the entire exercise, there were piles of paper gathering on the floor and we invented new rules while we were at it.

Limitations

There are some limitations with this approach.

  • Two people could have included a similar card on their table. There's no de-duping. Those were the things we settled afterwards. This method probably needs a solution for that.

  • Work-stealing is a little problematic in this situation. You might steal work that - when routed through the original ring - would have never arrived on your desk, or you might get cards that you have seen before. (Now I come to think of it, that might actually not be a big problem, since it would continue it's ordinary path through the ring anyway, and it would still arrive to the person who would have taken it out - unless somebody else would have already considered it to be important enough to stay in.)

Afterthoughts

Looking at it now, I think this is basically what an actor framework does. Everybody has his own queue, everything is non-blocking. It makes you wonder what else there is to learn from software in human decision making.