I've never used or written distributed event ordering code, so take my feedback with a huge grain of salt, or perhaps as a request for clarification instead of criticism.
Almost none of the public types or functions are commented, which makes it a bit harder to work through the code. I'd definitely have an easier time with it if you had done so. It is succinct enough that I didn't have a huge amount of trouble though.
Many of the functions both modify inputs and return them, which looks odd to me. See for example:
func (s *Stamp) enc(packer *BitPacker) *BitPacker {
s.id.enc(packer)
s.event.enc(packer)
return packer
}
It is obvious from examining the code that the BitPacker returned is the same as the input, which begs the question of why it was returned at all. I would suggest this instead:
func (s *Stamp) enc(packer *BitPacker) {
s.id.enc(packer)
s.event.enc(packer)
}
Also, the name "BitPacker" is not idiomatic. Usually names with -er suffixes are intended to be interfaces with a single method - see the Stringer interface, which is satisfied by types which implement a String method. In BitPacker's case, it is a type instead of an interface, and there is no BitPack method.
I'm also a little concerned about the grow(i *id, e *event) function, which seems to have a magic number 99,999 in it, which gets sent to an ignored output later on? I don't know what's happening there.
On to more interesting stuff that I know substantially less about:
How do you think this would fit into the typical Go method of determining causality - specifically, channels? Do you see this being used as a synchronization method among pools of goroutines that communicate with each other (basically, the actor model)? Do you think it would be composed with other types, and then sent along the channels? It would be very interesting to me to see an example using goroutines to see what kind of idioms show up. How would you handle cases where sending a clock update to another goroutine blocks?
In any case, I found this quite interesting to read and I'll probably go through the code & paper a few more times.