Skip to content

Instantly share code, notes, and snippets.

@why-not
Last active April 1, 2026 19:13
Show Gist options
  • Select an option

  • Save why-not/a144229aac519a9e7b495cb87442d70e to your computer and use it in GitHub Desktop.

Select an option

Save why-not/a144229aac519a9e7b495cb87442d70e to your computer and use it in GitHub Desktop.
Pebbles: an atomic protocol.

The pebble protocol.

I think this prototol is an atomic one, and is very generative and needs our attention. So let me mention why I named it the pebble protocol in my versions, and the story is also a great example based explaination of what it is.

"After overhearing their parents' plan to abandon them in the forest, Hansel sneaks out and gathers shiny white pebbles. As they are led into the woods the next day, he drops them along the path.

Following the Moonlight: Once night falls, the white pebbles shine in the moonlight, allowing the children to follow the trail directly back to their house" - Wikipedia.

"The story is often remembered for a second, failed attempt. When their parents try to abandon them again, Hansel is locked in the house and cannot gather more pebbles. He tries to use breadcrumbs instead, but birds eat the trail, leaving them lost and leading them to the famous gingerbread house." - Gemini.

The pebble is an elegant entanglement of compute & memory. In my own formulation, this is what I call STATE. Memory without any compute entangled in it is not state. It is something else. When memory is recruited for compute, it is State. State is always portrayed as the bad guy in the general programmer understanding of it. Hence I had to move left slightly and make up this new neutral understanding of it. State is both good and bad. Like friction. It is upto us to make the best use of it.

And the pebble protocol is an elegant way to entangle compute and memory. As you can see from the bread crumb example, some thought is needed to choose a good pebble and also to come up a protocol on when to drop one. If you are led at night - and have to find the way back in the morning, the white pebbles might give the game away in adversarial situations.

I have been using it for mostly non adversarial situations. Dropping pebbles into various objects and looking for them later makes elegant trees out of messy complex graph access patterns.

Bonus: Pebble protocol as an analytical tool.

When I was fresh off the boat immigrant in the US, the super markets will overwhealm me with all the variety of items - and I know none of them or do not have any preference profile or family memory passed on to cut the noise. Saturdays are a good day to browse, because you can clearly see the pattern of the local population. There will be just one left in one bread, and another will be fully stocked. You have to do it a few times to understand the noise that restocking causes. But they were a college town grocery and weren't that fast with restocking.

Here in this lab management protocol, they are using it as an Analytics tool. https://scottlawsonbc.com/post/dot-system

Generative potential.

Should you doubt the generative potential of this protocol, I will leave with this advanced example of its application in the wild. A 50 year old theoritical computer science lower bound on "the amount of compute that can be pushed into memory" (My formulation of the theorem, hence the scare quotes) was broken using the pebble protocol, specifically by finding the "white stones" instead of the "bread crumbs" for that variation of the problem.

https://www.quantamagazine.org/for-algorithms-a-little-memory-outweighs-a-lot-of-time-20250521/

https://www.youtube.com/watch?v=kQo30UaEh8I

(There is one more youtube link that explains the algorithm elegantly. Unable to find it right now. Will update. The above two links are good primers. But super briefly leaving a pebble can encode only 2 states in a single unit of memory. Pebble or not. But the 5th root of unity (complex number) can encode 5 states in a single unit of memory. that's about it. the rest is details)

Notes:

They call it the pebble game, and I discovered they also converged on the word "pebble" as the name completely independent of my naming it. Probably both influenced by the Grimm stories. There is a protocol fomulation hiding in there about how people without communication can come up with the same name. I am unable to grasp it at the moment, but a starting point for folks if you wanna develop it.

"Ariadne's thread is a Greek mythological metaphor for a solution to a complex problem, derived from the story of Ariadne giving Theseus a ball of thread to navigate the Minotaur's Labyrinth. It symbolizes a "lifeline" or methodical approach used to find a way out of a confusing, dangerous, or intricate situation." - Wikipedia.

Looking collectively that both the Grimm story and the greek mythology have converged on memory based compute, I wonder what other protocols are hiding in mythology and near mythology (like grimm). Another fertile thread to launch into.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment