Summer brings some pretty low daytime tides to Witter Beach. On the most extreme days, our beach stretches out more than two hundred yards from the bulkhead — pretty amazing and endless exploration for human and dog alike.
Over the last two years there’s been a resurgence of starfish and sand dollars out on the sand bars. On those low tide days, a few babies get stranded in the sun and dry out — bummer for them but amazing little treasures for me.
I’ve wanted to make some jewelry with these finds for quite a while, and finally got around to it over the last couple of weeks. The final product isn’t perfect by any means (my sausage fingers were not made for fine work), but I love it nevertheless. A ton of neat new techniques to learn along the way!
I’m a big fan of dangly earrings, despite the fact that Lara doesn’t wear them much (she does have other positive qualities). The plan was to embed the ocean goodies in clear resin within circular frames, then link the circles together into a dangle.
Alder Circles
The Glowforge was the obvious tool to cut out the wooden circles; it can make remarkably precise and small cuts. The only thing was, I really didn’t want to buy wood — my whole vibe here is things I can fabricate from the natural world (ok, findings are an exception and we’ll get there).
The good news is I have a nearly unlimited supply of Red Alder from the bluff and beach. It’s on the soft end of the hardwoods, but that’s fine — makes it a bit easier to work with. I had a nice little chunk from a tree that was cut in 2023 (part of the bluff maintenance balance… trees are awesome at sucking up water, but if they get too big they act like sails in the wind).
I wanted a height of about an eight of an inch, maybe 3/16ths. For strength and appearance I wanted the grain to run with the plane of the circle. The band saw is the obvious tool for this, but I struggle to get truly parallel cuts out of mine. Granted, it was super-cheap.
Anyways, I was able to break the piece down into small enough pieces to cut into strips with my table saw. A trick for small strips: lower your blade and put a piece of blue painters tape over the hole. Turn on the saw and slowly raise the blade so that it cuts through the tape. This gives you “zero clearance” protection so that tiny cuts don’t get sucked down into the saw and destroyed.
A light sanding on each side, a little Unicorn Spit, and these were good to go. I’m always tempted to throw in a little video of the Glowforge in action because it’s so cool, but I will be restrained today. In short: laser cutting is super-awesome and it’s almost impossible to obtain such precise results any other way. I am in awe of what some folks can do on a scroll saw, but that ain’t me.
Eye Pins (i.e., an excuse to buy more tools)
Next up I needed to attach little metal eyes to the circles so I could link them together. I found the perfect little wire eye pins, but needed a way to attach them securely without breaking the tiny bits of wood. My heavily-retail solution:
With all of this kit I was able to drill pilot holes, cut down the pins, and maneuver them into place with the smallest little drops of CA glue. Not the sexiest part of the build, but honestly kind of my favorite — a much more professional look than I expected to get.
This project was a great opportunity to try UV resin instead. Lara uses a version of it on her fingernails; basically it’s clear liquid that hardens within minutes under UV light. I got this starter kit from Amazon that includes the resin and a light with a timer.
It took me a few tries to get the technique right — I wanted the ocean bits to be fully encased in resin inside the circles with no/minimal overspill. The magic here turned out to be plain old clear packing tape:
Put a piece of tape sticky-side up on the table and press the circle onto it.
Add just enough resin to coat the bottom of the circle.
Cure for 3 minutes on one side, then flip and 2 on the other.
Flip again, add the item, and drip in enough resin to cover. Make sure that the item is fully covered and not hiding any bubbles underneath.
Cure again for 3 minutes on one side, then flip and 2 on the other.
Remove the tape. If it leaves any adhesive residue, clean with Goo Gone.
The tape makes a leak-proof seal that contains the first layer of resin, but is easily removed at the end. Flipping the piece ensures that the light hits all of the resin equally, which is key to getting a solid cure.
The really neat thing about this material is that it locks in place almost immediately when the UV light hits it. So if I want to, say, ensure that an item stays in the center of the circle, I can hold it in place with the tip of a pin, turn on the light and by the time I remove the pin it’s not going anywhere. Woot!
Assembly!
OK, at this point I had four circles filled with resin, each with eye pins ready for connecting. Simple earring hooks and open jump rings were cheap and easy to work with (thanks again to my magnifier, would have taken me forever without that).
I’m pretty pleased with the end result. My brother’s kids are coming to the beach in a few weeks and I’ll definitely use the same techniques with them — maybe for a backpack or luggage charm. Or add some seaglass and it’d make a beautiful mobile. Too many fun projects!
There’s a rule of multithreaded programming that says that if something can happen, it will. Package delivered at the same time the kitchen catches on fire and ALF is on live TV? For sure. I’ve been in countless debugging sessions where things that “can’t” happen absolutely, 100% happen.
Users are clever
Users are the same way. They may not all be tech savvy, but they’re incredibly creative. As with most things in my career, I first really learned this in the early 90s on the Microsoft Works team.
Works included simple desktop publishing features for making newsletters, invitations, posters, that kind of thing. Our customer service team sent us a case they were stuck on — the app would no longer let a user add content to their newsletter. It was a simple one-page document: header, footer, a few columns of content, maybe an image or two. That’s it. They tried saving a copy and using the new file, but no luck. They really didn’t want to start from scratch (I think they’d inherited the document from their predecessor).
The aha moment finally came when the rep asked the user to describe every action they were taking. Take last month’s article content, drag it off the page, add a new …. wait, what?
It turns out that this user didn’t know how to “delete” content blocks. But they realized that objects outside of the page boundaries on screen didn’t print — so each month they would just drag the old content blocks off the page and add new ones. Genius!
Except of course, the file got bigger and bigger and slower and slower until it just broke. I don’t remember if it was a memory problem, or if there were limits on the number of objects in a file, or what — but either way, a little education on “delete” and the newsletter was back in business.
We never expected users to be confused about deleting things. We never expected them to consider the off-the-page area as part of the real working space. More subtly, we’d never thought much at all about “periodicals” that used the same template time after time. And all of that’s on us — the user just found a creative way to do what they needed to do.
Whose car is it anyway?
A couple of weeks ago we traded in our Tesla Model X for a Rivian R1S. If you know me you know how conflicted and sad I am about Elon (see here, here and here), but that’s a story for another day. We’ll take the Rivian on its first Cali road trip soon, and I’ll write up a comparison then. Stay tuned.
Before we traded in the Tesla, I logged us out of all the various accounts that we’d set up on the vehicle. At the Rivian service center we signed over the title, handed them the key fobs, and waved goodbye to “Miss Scarlet” as we drove our new car home. Done and dusted!
Later that day I got a phone notification that the Tesla doors were unlocked. When I opened the app it turned out that I was still fully in control of the car. Huh. I honked the horn a few times for fun and then moved on with my afternoon.
Now this isn’t really all that surprising — of course Tesla didn’t know we’d sold the car; that’s not how it “works” in the industry. But it’s an interesting edge case, and one I thought about frequently over the course of the next week as Miss Scarlet made its way through the resale process. I didn’t snap pictures of the car sitting at the Bellevue service center, but once it moved down to Kent I thought it’d be fun to keep a record.
First stop, Manheim Seattle Auto Auction. The Manheim facility is pretty huge; the car started in the middle of a huge lot, then next to a little outbuilding. It then appeared to move into a garage — probably for detailing — before bouncing from spot to spot in the lot again.
After a few days I got a navigation alert and found the car driving on its merry way to Worldwide Auto Group in Auburn. Two days later another alert and it was en route to a private home in Tacoma. I’ve masked out the address on that one because I’m assuming it’s an actual person who bought the car.
FINALLY, after eight days, a notification popped up on Lara’s phone that Worldwide was asking to take “ownership” of the Tesla — we agreed and and off she went into the sunset, leaving the Ventura Powerwall as the only Tesla product in our world.
What to make of this? Certainly I wasn’t “intended” to retain control of the car after I no longer owned it — but did it really matter? I think so — during this period I could see exactly where the car was, lock and unlock it, remote start, summon it if I was anywhere near by, and quite a bit more. It seems like bad guys have managed some pretty nasty stuff given a lot less access.
It’s always the edges
As someone who built their career around the craft of software engineering, it’s tough to get old and watch crappy AI and copy/paste code take over more and more of the world. Don’t get me wrong, it’s happening because mostly it does the job, and usually cheaper. But that doesn’t mean I need to like it.
Still, at least for now, the game is still on. Designing for the unexpected and the edges and future still matters, and those aren’t, so far, things the machines do well. Sometimes it’s an issue of technology and errors and such; more often it’s about user interaction. Don’t write us off quite yet!
I’ve never been shy about my disdain for management “theory” — because let’s be honest, it’s not really that complicated. Have a plan, reduce complexity, take punches for your team, chip in. I’m not saying it’s easy, but the right move is usually pretty obvious. MBA strategies are just cover for folks that don’t want to do the hard work.
But sometimes they’re worse than just passive noise — they’re evil. Of course, disciples of evil strategies don’t call them that. But they’re pervasive and, for some folks, undeniably personally effective. After writing about memecoins the other day, it occurred to me that the worst of these could best be called “pump and dump management.”
Pump and dump managers are usually (but not always) hired from the outside. They parachute in with a lot of sound and fury, often show positive results in the short term by destroying long term value, and get out of Dodge while the getting’s good. Off to their next adventure, they ride these “successes” while avoiding blame for the true impact of their actions. It. Is. Infuriating.
Please, make sure you don’t hire these folks. But if it happens, send them on their way as quickly as possible — and pay your learning forward by warning that next hiring manager looking for a reference! Some key things to watch for:
The last guy sucked
PDMs love to talk about how bad everything is — and how lucky you are they’re around to fix it. Monoliths should be microservices; or perhaps microservices should be monoliths. Misaligned vendors need to be replaced with FTEs; or perhaps FTEs should be let go for more nimble vendors.
If schedules slip, it’s because they’re still “cleaning up” after their crappy predecessor. They probably need to swap out existing managers for folks they’ve worked with before. Things that somehow have supported the business for years need to be re-written from scratch. Sometimes they’ll dress all this up with false praise, like “it was probably ok back when the company didn’t have many customers.”
The best part of this dynamic is that it never ends. Nothing is ever the PDM’s fault; everything can always be traced back to sins of the “before” times.
Metric manipulation
Two things are true: (1) every good business runs on metrics, and (2) every metric can be gamed. It’s easy to increase sales if you start selling everything at a loss. Recruiting numbers can always be met by hiring underqualified people. Q1 costs look great if you stiff your vendors until Q2.
PDMs use their teams as personal labor — work harder, work longer, for ME. They claim personal credit for success, passing failure up the chain as if they had nothing to do with it. They flatter their bosses and never say no — even when it hurts their teams.
Honest leaders understand this, and use metrics to guide behavior with constant fine-tuning, interpretation and improvement. PDMs hit metrics at any cost — even at the expense of the company’s real goals. Slash and burn.
Punch down, kiss up
The best PDMs are master manipulators. By bottlenecking all communication through themselves they control the narrative, playing the savior while throwing all sides under the bus.
This always collapses eventually — but of course, a savvy PDM sees it coming and jumps to their next opportunity before they’re exposed.
Destroy relationships
Productive relationships require give and take. Trust and respect develop over time, as each side proves to the other that they’re committed to win-win exchanges. One party may get a bit more in one trade, knowing it’ll balance out in the next.
But PDMs don’t care about relationships, only transactions. And they typically have exactly one negotiating style: bully the other guy, spend positive capital created by others and call it “the art of the deal.”
Make an outrageous first offer, so extreme that it knocks the other party off balance. Threaten and bully and generally be an unpredictable a**hole.
Act like you’re doing them a favor by reducing your demand a bit.
Declare victory.
The thing is, this often works — once. Or maybe even twice depending on the relationship. So it’s great for the PDM, who signs a few “great” deals and jumps ship for the next opportunity before the destruction catches up with them. The companies they leave behind pay the price.
I’ve been lucky through most of my career; only a few times was I on the receiving end of a PDM. But those times were the worst (friends, IYKYK). And now there’s a PDM in charge of my country. Blaming his predecessors, destroying long-won relationships, pointing fingers at everyone but himself, jumping from issue to issue so he never pays the price of failure. Truth is, he’s really good at it — and we’re left holding the bag.
Endnote: I get that the “evil boss” images I’ve scattered about here don’t really represent the specific PDM phenotype — they’re bad in all kinds of different ways. But we see suffer with enough photos of the master PDM every day, and I’m not about to add to that sorry display. So just enjoy some great movie memories … maybe a rewatch is in order!
So much corruption sails through American headlines these days, it’s become hard to pay appropriate attention to any one outrage. And of course that’s the point — shock and awe until it’s completely normalized and we just let it go. So in the spirit of not letting it go, let’s talk about one example that I actually can speak to in some detail: the $TRUMP memecoin.
You’ve probably heard about it in the news. Just before taking office in January, Trump owned and affiliated companies (basically the same folks selling his shoes and bibles and other shlock) launched a crypto “coin” branded $TRUMP and promoted by the jacka** himself. Its value quickly soared before steadily dropping to the $14 or so it is today, still with a market cap in the billions.
So just what is a crypto “memecoin” anyway, and why did he bother? The TLDR is at the end — but hopefully you’ll find the longer story illuminating too. Let’s dig in.
Tokens and “Coins”
Crypto “coins” are just crypto tokens, so we have to start there. If you want to go even deeper, I’ve written about crypto and blockchain stuff more generally; see here, here and here.
It’s useful to start by thinking about tokens like baseball cards. At the beginning of the season, Topps (or Fleer or whoever) prints up a bunch of cards that make up the “supply.” The cards themselves don’t have any intrinsic value, they’re just cardboard. People can buy the cards from Topps, they can trade or sell them to other individuals, and the price goes up or down based on how much people want them. Easy peasy.
In this case it’s better to think about it as if every card in the supply was just Cal Raleigh — so it doesn’t matter which specific physical card you have, they’re all exactly the same. That’s the difference between “fungible” (every instance is the same) and “non-fungible” (every instance is unique) tokens.
$TRUMP is one of these. Trump’s merch companies used the Solana Token Program to define a token/coin with one billion instances (the supply). No intrinsic value, just data they made up on the Solana blockchain. Anybody holding $TRUMP tokens can interact with the program to move them into other wallets in return for a small transaction fee that goes to the Solana stakers (not the Trump organizations yet, stay tuned).
The Meme in Memecoin
Tokens are actually a pretty neat little tool. They can help broker access to limited resources, track rights in voting organizations, be used as currency in virtual (or physical worlds), and a ton more. The “memecoin” use case, however — at best it’s a toy, and honestly it’s just a scam.
“Memecoins” don’t have a use, value or other reason to exist beyond amplifying some trend or capturing news cycles. Except they’re really good for stealing money from people, as in the uniquely American coin $HAWK promoted by the “Hawk Tuah” girl. Minters use viral techniques to con people into “pumping up” the value of their memecoin, “dump” their own holdings at a profit, and leave everybody else holding the bag.
But the grift goes way deeper than that. Sure, by holding 80% of the coins, even at $14 a pop they’ve “created” staggering wealth on paper. But there’s a great side game here too — liquidity fees.
Remember we said that anybody who holds a token can give it to somebody else by paying a small fee to the Solana stakers (the same fee that any transaction incurs). But that’s not the way markets typically work — I don’t go hunting for somebody holding Microsoft shares and ask to buy from them directly. Instead, “market makers” sit between buyers and sellers and grease the wheels. This basically happens in two ways (simplifying for my own sanity):
Centralized Exchanges (e.g. Coinbase)
Sites like Coinbase are “custodial” exchanges, meaning that they abstract away all of the crypto/blockchain complexity by holding users’ tokens for them in one big centralized pot.
The exchange then keeps a trading “order book” — lists of users that want to buy or sell tokens. The book matches up these users to fulfill orders automatically, floating the price up or down as demand indicates. No tokens actually move on the blockchain as part of these trades; it all stays in the Coinbase pot and they just remember who owns what.
Of course this relies on trust in the exchange, which isn’t always well-founded. Still, as crypto becomes ever more mainstream (for better or worse), exchanges are incented to behave conservatively.
Exchanges only do this for tokens with significant demand — most memecoins don’t make the cut. $TRUMP is an exception because of its “unique” brand advantage.
Decentralized Liquidity Pools (e.g., Raydium)
Here’s where things get more interesting. Centralized Exchanges are increasingly regulated and require users to prove their identity, report to the IRS, and so on. This is fine for most people most of the time, but can be unattractive to folks that want to trade anonymously (or more generously, without placing trust in a custodial exchange).
These users can instead trade via a “Decentralized Exchange” (DEX) like Raydium that uses “liquidity pools” and its own order book to facilitate exchange.
Any user can create a liquidity pool on Raydium by registering equivalent dollar values of two tokens into an account there. For example, I might create a pool that has $1,000 each of $TRUMP and USDT. Right now that’d be about 71 $TRUMP ($1,000 / $14) and 1,000 USDT tokens.
My pool is now available to the Raydium order book to fulfill orders. This gets a bit complicated, but bear with me. If somebody wants to buy 10 $TRUMP tokens from my pool, the system computes a price that will keep the product of the token count (71,000) constant:
y in this case equals about 164 USDT, or $16.40 / $TRUMP
The platform adds a fee of around 0.3% to that $164, makes the trade on the blockchain, and shares a portion of the fee back to the owner of the liquidity pool (me). In short, I’m using my personal holdings to create market liquidity, and I get paid for it. Cool!
A side note: while Raydium isn’t a custodian of tokens in the same sense as Coinbase, in any real sense they are acting as one. When you commit your tokens to a liquidity pool, Raydium’s smart contract can move them at will. So there’s still trust involved — just a different kind.
Now remember that the Trump companies still hold about 80% of all $TRUMP tokens. They’ve used 10% of their holdings to create liquidity pools largely on the Meteora platform (equivalent to Raydium). And since they are such a disproportionate holder, their pools are party to many, many DEX transactions. Again, to wit: Trump’s meme coin business racks up fees as buyers jump at the chance for access to the president. Crypto data company Chainalysis estimates $320 million. Yikes.
“Buy my coin, meet me for dinner!”
OK, so we’ve established that the President is using the power of the United States to shake down naïve users for millions. But of course there’s no bottom for these people, so they’ve upped the ante even more.
Now of course politicians sell access for funds all the time — hey, just last Monday Trump pulled in $1.5M a plate despite the fact that he can’t even run again. That’s its own huge problem of course, but at least there are some rules around disclosure and how the funds are supposed to be used.
Not so for the $TRUMP contest. The increased value and transaction fees that result from people vying for access here go directly to Trump’s companies and to Trump personally. It is the most obvious, blatant, unbelievable act of corruption one could imagine.
The mechanics are fascinating; unwinding it all is a game I typically enjoy. But the actuality of what is happening is just so craven, it ruins the fun:
Trump is using his office to inflate the value of a meaningless asset for his own benefit.
Trump is also profiting from fees incurred on almost every trade of the asset.
Trump is openly advertising untraceable access in return for dollars.
When I was little my idols were mostly Red Sox players: Rice, Yaz, Boomer, Butch. Thankfully back then there was very little “off the field” news coverage, so in large part my heroes remained intact. But grownup Sean knows that was just a fantasy — they were just people, with their own balance sheets of good and bad, strong and weak, kind and cruel.
Back then we had the luxury of imagining that our role models were perfect in every way. Today, nobody survives the spotlight of social media unscathed very long. An impatient glance at a fan or an inappropriate joke after a few drinks, and boom.
It can be a bummer, but it also forces us all — even kids — to be a bit more judicious (and realistic) with our esteem. I’ve been thinking about this a lot lately, and perhaps the key is to be explicit about the specific actions or behaviors we admire. Kindness and empathy in Fred Rogers, creativity in Jim Henson, bravery in John Young and Jim Lovell. The things that persist even when the humans that model them disappoint us in other ways, as they inevitably do.
This seems important, because the only other way to reconcile the state of our modern world is to go full cynic — everybody sucks, so why try to be good at all? Morals and empathy are for suckers. Frankly that’s increasingly what I see in the public sphere, and it’s just too ugly for me to accept.
So here in my little corner of the world, I present a random three of the many folks that, despite their very obviously flawed human selves, exhibit(ed) qualities that I admire and try to model in my life.
Put Yourself Out There (John Denver)
I typically get up before the rest of the house, and at least once a week the morning playlist is all JD, preferably recorded live (“so if you sing, sing good, and I’ll try to do the same!”). I’m not much of a concert-goer, but I saw him twice and each time was simply remarkable. He so obviously loved being on stage, drawing everyone into the experience like they were just hanging out. And the percussion set, my goodness… but I digress.
So the music is great — but what I admired was Denver’s ability to stand up on that stage and share his own, raw, internal, personal feelings and fears and loves. Often ridiculed for being cheesy, he really was John Lennon’s Imagine in human form.
It was the winter of my 27th year, not the summer, but Rocky Mountain High played on repeat in my son’s NICU cocoon until he came home.
Flying for Me plays at home every January 28th and February 1.
Listen to the live intro to This Old Guitar; he’s just begging to be shoved in a locker.
And dozens, dozens more that leave me teary and pretending it’s allergies.
John Denver used his gifts to talk to the world about important things big (wilderness and animal preservation, nuclear weapons, world hunger) and small (falling in and out of love, missing home, being lonely, having a child). I’m not by nature a guy who can be so open and vulnerable … but I try.
Be Curious and Build Things (Buckminster Fuller)
“Guinea Pig B” kept a detailed record (the Dymaxion Chronofile) of his entire life, an ongoing experiment that began when he decided that his planned suicide was a cop-out. Instead, he decided to take advantage of his time to leave something for the world and find ways to make it “work for 100% of humanity.” Seriously.
Image credit Justin Kunimune, Wikipedia
Bucky was one of the first and loudest people to challenge the idea that we live in a world of scarcity. Scarcity is literally written in our DNA, so it’s a hard concept to think around — but the truth is, we have more than enough energy, food, water, and shelter for everyone on the planet; we just don’t distribute it with that goal in mind. World Game and the Dymaxion Map (projected so all landmasses are shown in true proportion) were attempts to help people see beyond nations and politics — Quixotic perhaps, but not wrong either. Someday.
The Dymaxion House envisioned shelter for everyone. Shipped as a kit weighing just 3,000 pounds, the house hung from a central mast (tension or “tensegrity” was a hallmark of his building approach) and could be assembled without specialized knowledge and no heavy equipment. The roof elements were built on the ground, then hauled up the mast. The next level was added and hoisted, and so on until the full house was constructed. The only foundation was for the central mast, so it was earthquake proof. The materials needed no painting. Air flowed naturally down through floor vents that also served as air filters. Bathroom fixtures were made of pressed sheet metal with no sharp corners, so they could be easily sanitized with a sponge. The thing was amazing (I got to see the last one made in the Henry Ford museum in Detroit).
And so so many other cool things. He was the ultimate generalist, but not a theorist — he actually built the things he thought up, working through materials and packaging and fabrication and maintenance in the real world. I would so love to have been able to invent with him.
Details Matter (Walt Disney)
When we were in Disneyland for my son’s 4th birthday, he wanted to meet Minnie at her house. When we finally made it to the front of the line and he told her it was his birthday, she pantomimed that she wanted him to meet somebody and was that ok? He said yes, she took him by the hand, and they walked straight across the street to Mickey’s house so they could wish him a happy birthday together. To this day I still don’t quite understand how they managed the logistics of this — that line was long with tons of people waiting! Maybe it was a clever way to shift change? But whatever it was was, simply, magic.
My daughter was dangerously allergic to dairy proteins, so eating out was always a challenge (remember this was the 90s). Her choices were often limited — but never at Disney. At every restaurant, the chef would come out to our table to understand her restrictions and make versions of the same dishes everyone else got to try, just safe for her. Everywhere. Inclusion matters.
And of course the fun facts you’ve probably heard before: the way music and smells blend as you walk from land to land; forced perspective; secret tunnels to quickly swap out characters; every cast member picking up trash; hidden mickeys; the monorail to keep you “in world” between the park and hotels.
The idea seems so simple in retrospect: a place not just for kids, not just for adults, but for everyone. But it’s the details that made it work, and they’re not easy to get right when time is money (and money is money). Sure it was “fake” — but who cares? Disney built the most amazing, immersive, enchanting getaway in history.
Sadly, it’s lost some of that magic these days — you can only get so big and so corporate before corners start being cut, I guess. But my family was lucky to grow up there when it was brilliant.
Details matter so much. I try to remember this whenever I’m turning a bowl and am tired of sanding the inside that nobody will see — or handling exceptions in software that probably will never happen.
So many lessons from so many good — not perfect — people in our world. Nice to think about at a time when the public sphere seems so full of our worst. Until next time.
The “longevity” industry really rubs me the wrong way — mostly a bunch of rich white guys clinging desperately to their 30s with marathons and trophy wives and Rogaine. But a friend I respect recently started building tech for a “longevity” venture and told me I had to read this book, so I did. And while I’m no convert, Attia is clearly a smart guy who makes a credible case.
His fundamental goal is to increase “healthspan,” which starts with being alive longer, but more importantly is about living your final years better and stronger — avoiding or reducing the risk of “slow death” conditions like diabetes, Alzheimer’s, cancer, and cardiovascular disease. His approach in a nutshell looks like this:
Measure the crap out of yourself, early and deeply and often. Be data-driven and address issues even if they aren’t (yet) presenting clinically.
Mostly do what we all know we should: eat well, exercise a ton, get enough sleep and take care of your mental health.
Don’t shy away from drugs if #2 doesn’t get you there.
Start all of this really early, like in your 20s (or at least “now”).
In short he’s an advocate of preventative vs. reactive medicine — and I certainly have no argument with that. For example, my LDL of 98 is “optimal” by standard ranges but Attia suggests it should be more like 30 — yeesh! A reasonable number is probably somewhere in between, but clearly I’m nudging the upper end of “OK” and that’s worth a bit of attention now vs. later when it’s worse.
Still, it’s hard for me to imagine spending hours every day of my life hyper-optimizing for the end of it. But that’s obviously not how Attia thinks about it, and many of his recommendations pay dividends in the immediate term as well. So I’m keeping an open mind and trying to keep my middle-aged self on the right path with some exercise and a reasonable diet and all of that. Check back when I’m seventy and we’ll see if I’m still so cavalier. 😉
The Internet looked very different back in the early 1990s. Unless you were in school or the military, very little of it was truly “online.” A few times each day, the NeXTstation Turbo Color in my home office would dial out to Northwest Nexus (still kicking as “NuOz”) and establish a UUCP link.
My email address at the time was mickey@fantasy.wa.com, but this was a shortcut for my real address: uunet!nwnexus!fantasy!mickey. If you read this backwards, you see the path that messages would take to find me:
uunet, an enormous commercial ISP that had live connections to the academic and military Internet.
nwnexus, our local provider, which would “store and forward” messages for us.
fantasy, my beautiful, wonderful, favorite-ever NeXTstation.
mickey, my personal username (you’ll be shocked to learn that Lara was minnie).
The UUCP connection had four jobs:
Download new email for fantasy users.
Upload any email we’d sent off-machine, e.g., to my dad using MCI Mail.
Download any new Usenet posts in groups we’d configured (definitely not alt.sex).
Upload any new Usenet posts we’d written, which would send them on their way to the rest of the world.
Email was basically what it is today of course, but Usenet was everything else: Facebook, Reddit, WordPress, Instagram, RedNote, Substack — if it was group-focused content, it was on Usenet. Lara still talks to folks she first met through alt.parenting.attachment and rec.crafts.quilting (or maybe rec.crafts.textiles.quilting, I don’t remember for sure).
While Usenet had been a part of our lives since college, there was a singular moment sometime around 1993 when I realized just how truly powerful and global this “network” stuff really was.
I had inherited an old TRS-80 Model 100 from my Dad — one of the first laptops and allegedly the last computer that BillG actually wrote code for. It’s a really neat little machine, and the simplicity of its design makes it a wonderful platform for exploration, like an 80-era Flipper Zero.
Anyways, the Model 100’s built-in BASIC has some useful machine-language functions, but to really write native code you need an assembler, and in particular I wanted a cross-assembler, so I could write code on my NeXT and then download it to the 100. Finding a cross-assembler for a long-discontinued and obsolete piece of hardware is most definitely a needle/haystack kind of thing — generously a couple of hundred people worldwide might care.
Enter Usenet; specifically comp.sys.tandy. My plea went out to NWNexus, then UUNET, then all over the world — and in a story clearly too good to be true, some guy I’d never met in rural Sweden had exactly what I needed. He sent it my way less than one day later (one day!) and I was good to go.
There are lots of anecdotes like this. But what just walloped me over the head was the combination of speed, cost, obscurity and generosity. I was able to send a message of clearly no importance, basically for free, across the entire world, in minutes — and of the billions of people on the planet, the one who happened to be in my exact situation heard the ask and was happy to help me out. That is just insane. INSANE.
The Dad Machine
One of the quintessential “dad jobs” I believe in is to know, most of the time, how everyday stuff works, and how to fix it. Righty-tighty-lefty-loosey; the difference between a fuse and a circuit breaker and a GFCI; unclogging toilets; cleaning gutters; putting air into tires; sanding or salting the driveway; getting a cashier’s check; turning off the gas; holding the mail; finding somebody to pump the septic; boiling an egg; hanging pictures; what type of glue to use … you get the idea.
Lara and I share “dad” duties with our kids and each other — our skills are pretty complementary and between us we cover things pretty OK. But man, things are WAY more complicated than they used to be and there is far, far too much out there for anybody to just “know” even a fraction of it.
However, while there is a ton of bad — maybe apocalyptically bad — caused by social media and the Internet in general, nothing has revolutionized this aspect of being a Dad like YouTube videos. It is almost inconceivable just how much solid, positive, useful content there is hiding behind that “skip ad” button.
YouTube can teach you to do anything. It’s that Usenet guy in Sweden, on steroids, for the 21st century. I re-prove this to myself almost every day.
Example #1: West Country Whipping
My folks recently moved into a place in Colorado. It’s a great place for walking and hiking, with the neighborhoods of Boulder on one side and trails around Mount Sanitas on the other. But their walking sticks are still back in Maine, so I thought I’d make them a couple of new ones using Whidbey driftwood.
For the handles, I wanted to do a wrap with suede strips (actually fake suede like this) — it’s a nice, soft material that looks cool and doesn’t slip. But I didn’t have a clue how to do a wrap that would actually stay on without a ton of messy glue. Enter “West Country Whipping,” which (if I do say so myself) turned out beautifully:
Example #2: The Oven Door Won’t Close
The oven at our place on Whidbey is ancient and, well, pretty much garbage. The temp is off by a sometimes-consistent 25 degrees and the upper half gets way hotter than the lower half. But it is “there” and it still gets hot, so there are plenty of other things to replace first.
Except a few years ago, the door stopped closing all the way, making it impossible to keep an even temperature (not to mention being super-wasteful). Before deciding on a full replacement, I went to my old friend YouTube. And of course, there are step-by-step, detailed videos that both explain what was going on (weak door hinges) and how to fix it. With a bit of model-number searching I found the right parts on Amazon and boom — the oven and I were able to return to our unhappy but stable relationship.
Example #3: Johnny Appleseed
A few years ago my daughter gifted me two apple trees for our front yard. They are wonderful and last Spring I thought they’d grown enough to remove their stabilizing poles. Of course a big windstorm came up and broke off one of the trees, right at the graft point. Bummer.
Our neighbor’s grandson is a great kid; he loves gardening and compost and recycling and the dump. When he saw my tree had gone down, he came over with a seed from a Cosmic Crisp apple he’d been eating earlier so I could replace it. What a neat guy.
I hadn’t a clue if it was even possible to do this — so hello YouTube. It turns out that if you put apple seeds in a wet paper towel in a ziplock in the fridge, it will encourage them to germinate. Success is usually about 50%, but a couple of months later my little seed had sprouted and now nine months on it’s a real live little plant spending the winter in my greenhouse.
To be clear, a tree grown like this may not (probably won’t) produce great apples — but who cares, it’s a living thing created from snacktime leftovers! As my wife says — DIRECTIVE.
Example #4: The Key is Stuck in the Subaru
I love me a Subaru. The AWD is fantastic, and even with pretty lax maintenance they seem to keep running forever. I’ve bought and recommended them many times and taught both of my kids to drive in one. I’m just not sure which of the five Subaru demographics I belong to (outdoor; medical; engineer; teacher; lesbian).
A couple of weeks ago though, I parked my current 2016 Impreza Sport and the key wouldn’t come out of the ignition. I’ve had that happen in a few cars when the steering column locks up, but that wasn’t it. Eventually by starting and stopping the car a few times and moving it into and out of Park it released, but it was pretty annoying.
This behavior accelerated over the next few days until I became pretty concerned that at some point I wouldn’t be able to get the key out at all. A quick Internet search told me that this was a pretty common problem, that there’s a “sensor” that needs to be replaced, and that the dealer could do it for probably about $600.
But come on, this car is ratty and old and I kind of want a pickup anyways (OK I really want a Subaru BRAT, but good luck finding one in fair shape at a fair price). Is it really worth the hassle and cost of repair? Maybe I just drive the car to a dealer and trade it in and move on.
One last look at YouTube saved me again — it turns out that the switch in question is just a little metal tab that contacts the gear shift when it’s in Park. Over time the tab gets bent down and becomes unreliable. But if you know where the magic Phillips screw is, you can remove it, the center console, the coin tray and the gear shift knob to expose the tab. Bend it back a few millimeters and Bob’s Your Uncle — thank you Kurt!
We Can’t Lose This
The funny thing is, I’m not even a “video” guy. My favorite literary format is “bulleted list” and I find most videos, podcasts and non-fiction books to be infuriatingly full of wasted time and repetitive fluff. But for these knowledge transfers, being able to actually see how the parts go together, how the tools work, how much force should be required, etc. — it’s just invaluable.
I don’t know what’s going to happen over the next twenty years. It frankly doesn’t look great and I worry about our collective future. But one thing I am certain of is that this worldwide, grass roots, incredibly deep repository of knowledge needs to live on. Never ever ever has so much power been in the hands of individual people. My examples are trivial, but — Learn to blacksmith? Create a memecoin? Run for Congress? Defend the persecuted? Build a rocket or root cellar or treehouse or cooperative farm? It’s all there.
A lot to figure out — but for now, be a great Dad and learn with your kids. You don’t even have to tell them you found it on YouTube. Until next time!
This has been a tough piece to finish — not because of the subject itself, which is super-fun, but because I keep getting distracted by unexpected behavior I want to understand. At nearly every turn, there’s something neat to see in this little world of evolving 2D cellular automata we’ve created. So bear with me as I try to boil down a lot of wandering into a few key points. There will be pictures!
Vertical Stripes and Hyperparameters
And the end of part one we taught our organisms to “black out” the grid — a simple task that could be optimally achieved with a single rule — and they did great. For the next few rounds I’ve made the goal a bit more difficult: turn the grid into a set of vertical one-pixel stripes, alternating black and white.
Our first fitness calculation for this is pretty straightforward: the first stripe can be either black or white, and the total number of correct pixels is divided by total pixels to get a fraction. Using a Von Neumann neighborhood and conservative parameters, the outcome was … horrible. Over three runs (details here, here and here):
Green is the best performance, red the worst and blue the average. A few pops but results regressed to 0.5 on every run — which is effectively a random grid (one out of every two pixels correct).
My first thought was, perhaps we’re just not getting enough variation. So let’s start tweaking the hyperparameters, i.e., the values that drive evolution. Mutation rate is an easy one, so we’ll increase that from 0-5% to 5-10% on each reproduction. Three more runs (here, here and here):
No love. Our changes did make a difference — there are more “pops” as we find potentially good solutions, but they don’t last and we regress again back to 0.5. But why? My next theory was that perhaps good solutions were being lost because they weren’t consistent. That is, a “random” rule is likely to get around 0.5 every time. But a rule that produces perfect stripes most of the time may perform terribly once in awhile. This corresponds nicely with real life — we don’t (usually) kick a decades-long good performer to the curb for a single failure.
To account for this I added a hyperparameter LastFitnessWeight, which attributes some fraction of fitness from the last iteration to the current one — the idea being that a success yesterday will lift your score today even if it’s an off day. Setting this to 25% gave these results (here, here and here):
Sad trombone noise. This is getting annoying — maybe the middle one showed some increased consistency, but really that’s just wishful thinking.
What we’re seeing here is one of the first rules (and a bit of a dirty secret) of digital evolution, and machine learning in general — hyperparameters don’t matter nearly as much as it seems like they should. With the right features and feedback you almost can’t help but succeed — and without them you’re usually hosed.
Fitness matters
Our fitness metric seems to make perfect sense — we know what each pixel should be, so the more pixels that are “correct,” the closer we are to a solution. But it turns out that that’s not quite right. Let’s look more closely at the history of one organism that did really well and then imploded:
This organism is the offspring of two parents that were basically generating random fields. About half of their pixels were correct, giving them fitness around 0.5 (see the blue highlights). For some reason this match created a really capable organism that for its first two generations delivered absolutely perfect (yellow highlight) scores — amazing!
But look what happened in the third generation (green highlight). It’s visually obvious that this is still a pretty good result, but because of the column skip on the left side (the double-wide white bar), all the pixels to the right were incorrect, so this promising organism was killed off (even with the history-preserving hyperparameter).
Tyranny of the mediocre
The end result of this dynamic is that over time the “interesting” organisms get squeezed out by mediocre but consistent ones (in particular all-white and all-black). This page details the final cycle of one such run: short-lived mostly random organisms at the top, newly-born random ones at the bottom, and a huge swath of 0.5 fitness blanks in the middle.
We can address this in two ways — both are pretty effective. The first is to simply use a better fitness metric. VStripesCombo combines two measures for a more balanced assessment:
“Stripey-ness” assesses the average length of a correct vertical stripe.
“Even-ness” rewards an even split between black and white pixels.
With this new metric, a solid block has fitness 0.25 (.5 for stripey-ness, 0 for even-ness), “interesting” organisms have a chance to succeed, and stripes emerge quickly. Finally, some success (here, here and here):
Another approach is to be more picky about who gets to reproduce. Our initial implementation kills off the bottom third of the population with each cycle, allowing the top two-thirds to reproduce. Since two-thirds includes that middle belt of consistent mediocrity, it can persist and grow.
Instead we can kill off the bottom half of the population, and allow each organism in the top half to mate twice. Just as with biological siblings, each mating crosses over and mutates differently, providing more chances for the strengths of the parents to compound.
As it turns out, this mode of reproduction also wins the day (here, here and here):
Strategies and weaknesses
The hallmark of evolved learning is solutions that our conscious, logical minds would never think of and often can’t really comprehend even after the fact. It’s frankly a little spooky. To wit, watch this organism solve the vertical stripes problem from random, along with the rules it employs. WTF man? (I have to say I do love the back and forth “wiggle” once it hits a final solution.)
All of these organisms were trained from a random starting grid. Running a few of them (all winners during training) from a single black pixel in the middle highlights two things: (1) their strategies are wildly divergent; (2) sometimes a strategy that tends to work in one case is an utter fail with a different starting configuration (last two examples below):
That second point can’t be overstated: you get what you train for — and we didn’t train for a single pixel initial state. Environment, fitness, reproduction rules, they all are critically important to the final product. This is going to come up again and again in the emerging world of AI. LLMs hallucinate because they have been rewarded for answering questions, not for saying they don’t know. We’d better get really, really good at this if we’re going to make it as a species (some more thoughts on that here).
Doh. It’s not even that it just doesn’t learn well — it doesn’t seem to learn at all. No matter what we do or how we define things, we can’t crack this nut. Why?
The answer is simple but important: there is simply zero information in the system about what an “edge” even is. Remember that the neighborhood computations “wrap” around so the grid appears to be an infinite plane. The edges are obvious to us when we draw the grid, but completely invisible to the organisms living inside it.
And you can’t “learn” something that you can’t perceive — it’s impossible, like asking a completely blind person to raise their hand when the lights come on. You can be mad about it, but it is what it is. This is surprisingly easy to forget, because evolved organisms are so good and finding subtle and non-obvious patterns, we just assume they’re omniscient. Nope.
OK, so let’s add an “edge” sense to our organisms by defining a new “relative” type in the Neighborhood class. When we include this new sense in our neighborhood, magic happens (here):
It’s a simple example, and perhaps not that shocking — by providing the boolean “edge” value, we enable the organism to effectively keep two sets of rules: one for the edges (turn them black) and one for everything else (turn them white).
But still, it’s cool. Just for fun, here’s a slightly less obvious example. By adding senses for which half of the grid a point is in (North/South, East/West), we can easily learn rules that expect different content in each quadrant (details here):
OK, that’s enough of a random walk for now. I could do this stuff forever, and each new lesson really does say something about evolution and learning in the real world. I hope I’ve put in enough eye candy to keep you entertained along the way, but even if I didn’t — it was good for me.
The first entry in my 2025 book journal took a few more words than fit in that format, so adding them here. I’m always looking for more good reads; please share!
There’s a lot in Nexus about AI taking over the world, and Harari has some pretty impressive stuff to say about that. But for me the most novel part of the book is the framework of information flow that he develops on the way to that part. He’s not the most concise guy; my (surely flawed) summation is:
Human progress is characterized by a quest for truth and order. Truth helps us manipulate the world more effectively, and order allows us to live in larger and larger groups without killing each other.
Information is the raw material for both of these. But information is not truth and doesn’t necessarily lead to truth. E.g., information can be used by scientists to uncover new truths, but it can also be used to propagandize a population into collective beliefs — whether those beliefs are true or not.
There are two broad classes of societies: those that rely on an infallible higher power (e.g., the Bible or Stalin) and those that do not (e.g., Ancient Athens or the United States). The former prioritize order over truth; the latter rely on competing mechanisms of self-correction to balance the two.
Advances in information technology have made it ever-easier to share information, which has had a significant impact on which sorts of societies are more effective at balancing truth and order. These advances have benefited both democratic and autocratic models in different ways at different times
Artificial Intelligence is not a new information technology; it’s a new form of life that in many ways is superior to ours (primarily around information recall and pattern recognition) but with different motivations. E.g., it may not have the same regard for the individual that we do. AI participation will have dramatic and unpredictable impacts to how our societies, both democratic and autocratic, operate.
Harari does a remarkable job at building this all up with a ton of historical, real world examples. That alone is worth the cost of entry. His jump to AI taking over the world seems a bit disconnected — I struggled to see the thread leading from one to the other, until I looked at it in terms of fallibility.
We’re increasingly used to giving computers authority over important stuff. And this can come with negative consequences — Harari’s prime example for this is Facebook’s role in the violence against the Rohingya in Myanmar. In hindsight that picture is clear: (1) Facebook coded its feed algorithms to prioritize engagement; (2) outrage increases engagement: (3) the algorithm overwhelmingly picked inflammatory (and largely false) content to show folks in Myanmar.
This is a trap that anybody who has ever tried to “manage with data” will recognize — you get what you ask for. It’s not uniquely an “AI” problem at all; how many mid-level managers have received short-term kudos for firing essential employees in the name of cost-cutting? Or been promoted for hitting sales targets based on volume by giving discounts that kill margin?
The Myanmar/FB issue wasn’t AI, it was a poor metric coded by human engineers. But Harari is right that the more we consider AI as an infallible agent in society, the more its motivations (metrics) matter. And it’s a compounding problem — we are increasingly asking AI to create metrics that build on top of its underlying implicit values.
An example close to my heart is recruiting algorithms. It is a fact of history that many, many more men have been hired into software jobs than women (and thus, by volume, more successful engineers are men). If we ask AI to do a first screen of candidates, it’s for sure going to notice this and bias its decisions towards hiring men. Because we never explained that this bias was a problem, it simply does the job we asked it to.
Presumably we could solve this if we created the perfect set of underlying motivations in the first place — we could reward the AI during training for finding historical bias and compensating. That’s basically what we do as humans with diversity programs (maligned as they are these days), and we’ll clearly have to do the same with AI.
Bottom line: AI is no less fallible than humans — but it can screw up at a scale far beyond what humans can accomplish. Can we create the right checks and balances before AI becomes self-reinforcing and we lose control of the process? Because surely that will happen.
And of course the answer is, who the heck knows. But Harari does a great job making us think about it and face the reality — so worth the read. Highly recommended for both the setup/framework and the AI thoughts. Just be prepared to read a LOT of words.
Our world feels increasingly magic — I can have normal adult conversations with a computer; feel very much “in person” with my far-flung family playing VR minigolf; and sit back comfortably while my car drives me to California. Every once in awhile, we stupid, fallible humans build incredible, beautiful things.
But “magic” is also dangerous. When you rely on something that you don’t understand, you’re an easy mark. This annoys me every time I have to call in an expert to work on the house because I don’t know how to test (just a random example, not something that happened last month, but if it did happen, the guy was totally cool, I just don’t like being in that position) the pressure switch assemblies in my HVAC system.
Of course, the world is way too complex for us all to understand everything. But the good news is, complex things are just lots of simple things put together — and often understanding the simple version is good enough. If you know a bit about how real and fake neurons work, you can develop a pretty solid intuition for what LLMs are and aren’t good at. If you build a treehouse, you’ll gain some appreciation for how real houses work. And, the point of this article, if you code up a really simple genetic algorithm, full-blown evolution seems a little less supernatural (but a lot more awesome).
Evolution & Genetic Algorithms
The only honest knock on Darwin is just basic incredulity. “Come on, do you really believe that all the complexity of the human mind and body just spontaneously popped up, by random chance?” Often these are perfectly intelligent folks that believe evolution can do little things, like maybe select for sharper teeth in wolves — they just can’t buy the admittedly huge leap to a modern human.
And I get it, I guess. But the history of our species is basically just a long parade of thinking that things are magic or supernatural, figuring out that they’re not, and levelling up the magic another click until we figure that out too. So why are we always sure that this time is the one? Seems unlikely.
Watching simple evolution in action helps me buy that real evolution is comfortably up to the task of shaping the world we live in. And it turns out that building a digital environment in which to do that isn’t all that hard. It’s also super-fun, so let’s give it a try.
Genetic algorithms use digital versions of evolutionary concepts like crossover, mutation and fitness to iteratively solve problems. There are tons of ways to put them together; I wanted to start from scratch and build things up one step at a time. If you’re so inclined, I hope you’ll build and run the code yourself — it’s all open source and up on Github.
I should mention up front that I have basically no formal background in this stuff — I played with GA’s a bit in college but that’s it. So we’re truly exploring together here; apologies in advance if I do or say something stupid.
2D Cellular Automata
Before we get into the “genetic” part of all this, we have to create the world our evolving organisms will inhabit. For reasons that will become clear later, two-dimensional cellular automata provide a lot of advantages, so we’ll use that.
These worlds are two-dimensional grids of squares, where each square is “on” (black, true, or alive) or “off” (white, false, or dead). As time passes, the squares change value based on their current value and those of their neighbors (the cells surrounding them) according to some set of rules.
The most famous set of 2DCA rules is called “The Game of Life” — a surprisingly simple configuration devised by John Conway that generates satisfyingly rich behaviors. Life considers the cell itself and each of its eight neighbors (N, NE, E, SE, S, SW, W, NW):
If the cell is alive and
has 2 or 3 live neighbors, it lives on to the next cycle,
otherwise it dies.
If the cell is dead and has exactly 3 neighbors,
it comes to life in the next cycle,
otherwise it stays dead.
The only tricky thing about this is what happens at the edges of the grid, where there are no “neighbors” on one side or the other. Typically implementations “wrap” the grid around itself so that, for example, the neighbor to the west of square (0,0) is (dx-1,0) where dx is the width of the grid.
Life rules generate some pretty neat patterns — shapes that blink or oscillate, others that move across the grid, some that stay static, etc. The animation below shows a few common patterns in action; follow through to the Wikipedia page for an interactive version you can play with.
OK, back to business. Life rules generate some visually cool stuff, but they’re only one example of the tons of possible rule sets we could apply. That’s the crux of what we’re going to do here — use evolutionary processes to discover rule sets that accomplish something we’re interested in. The general approach is this:
Establish a goal state for the world (grid). A very simple example of this might be “All squares of the grid are black.”
Create a bunch of organisms (rule sets) at random.
Let each organism exist for awhile and then measure how close it is to the goal.
Kill off the worst and mate the best to replenish the population.
Repeat.
In this model, each “organism” inhabits its own “world” — there is no direct organism-to-organism competition for resources or space. Obviously this is a departure from natural evolution, in which organisms typically go head-to-head. But there is still performance-based competition for mates, so it works out.
We’ll see this again and again — there are infinite ways to tweak an evolutionary process. The real world is so wide, and so basically eternal, that nature just tries them all. We have to be a bit more judicious, but there are still a ton of different levers to pull.
Concepts and Code
Bitmaps, Edge Strategies and Neighborhoods
The Bitmapclass is the workhorse of this whole system. Space and speed are important, and we do pretty well at both by cramming the bits into an array of longs. Also as we’ll see later, the array-of-longs approach helps with some other evolution-y stuff.
This class also defines the EdgeStrategy enum, which defines how the class should respond when asked about a coordinate that is off the grid. We use the “Wrap” strategy almost exclusively, but the alternatives might be useful in specific cases.
The Neighborhood class encapsulates approaches to identifying the relevant context for a particular square in the grid. The rules of “Life” which we saw earlier use a Moore Neighborhood, which is basically the 3×3 grid centered on each square. The Von Neumann Neighborhood is also common, which excludes the diagonal corners of Moore. There are others as well.
The neighborhood defines everything that a square “knows” about its environment at a given point in time, so it’s obviously super-important to the learning process. We’ll see this in action in part two of the series.
Organisms, rules and “DNA”
Unpacked, real DNA is basically a sequential chain of four nucleotide bases (A, C, G and T). In order to apply genetic algorithms to digital organisms, their digital DNA must also be representable by a chain of primitive building blocks.
Digital DNA must also be resilient to random mix-and-match operations during reproduction. A single mutation in an organism’s genes can be:
Irrelevant. Much of our DNA is “non-coding” and a mutation within these regions may be pretty much unnoticeable (ok it’s a bit more complicated than this, but close enough).
Advantageous. A mutation may make the organism more fit for its environment — maybe the shark’s teeth angle back a little more to hold onto prey.
Disadvantageous. Perhaps it makes the organism unable to create a particular enzyme, like the lactase that helps us digest dairy products.
Catastrophic. A mutation may render the organism completely unviable due to a structural problem that stops the DNA from functioning at all.
Evolution doesn’t work very well if #4 happens with any real frequency.
This is a major design challenge for GAs, but manageable for our particular problem. The NeighborhoodRulesProcessorclass uses our array-of-longs Bitmap approach to create a sequence of bits that can be easily manipulated, perhaps to advantage or disadvantage, but without damaging their viability.
This next bit is a little hairy; bear with me. Or just skip to the next section, understanding that our rule sets are represented by a resilient array of long integers. Here goes. Neighborhoods are stored as arrays of relative coordinates: e.g., (0,0) is the target square itself, while (-1,0) represents one position to the West. Neighborhood Rules assign each of these relative coordinates to a bit in an integer. For a Neighborhood that looks at X squares, this results in 2x possible integers: 32 for Von Neumann, 512 for Moore.
The “outcome” for each of these integers is either “black” or “white”, which we represent using a one-dimensional bitmap indexed on the integer itself. The array of longs underlying this bitmap is our DNA, which is pretty cool. Any bit in the rule set can be altered and we will still have a viable outcome — maybe better or worse, but never catastrophic. Sweet.
Fitness
Once our population of organisms has run for awhile, we need to asses how “well” each one did, so we know who should die off and who should hook up.
This is the job of the Fitnessclass. The simplest type is MostOn, which simply counts the number of black squares and reports it as a fraction of the total. The best possible fitness score in this case is 1.0 — solid black.
Fitness can really be anything measurable — in part two we’ll look at vertical stripes, alternating black and white one-pixel wide vertical lines. We’ll also see how different ways of measuring Vertical Stripes fitness can make a huge difference.
Selection
The Reproductionclass sorts the population by fitness and uses that ordering to decide which organisms should reproduce (the best two-thirds) and which should die off (the bottom third).
The reproducing population is paired up using a strategy defined in the PairingTypeenum. The default is “Prom,” which pairs the organisms ranked #1 with #2, #3 with #4, and so on. Random mixes this up so anyone can pair with anyone. There are other ways to do this too — March Madness-style bracket seeding, anyone? It also might be interesting to change the proportions and allow some or all of the winners to have multiple offspring.
Again, this isn’t exactly the way it happens in real life. But it’s close enough — and we get more levers to play with along the way.
Crossover and Mutation
The last bit we need to code up is the actual reproduction between two organisms — combining the DNA of each parent into a brand new, novel offspring. This happens in two steps:
Crossover takes subsections of each parent’s DNA to create a new sequence by picking a random set of indices to be “swap” points. Bits are taken from parent #1 up to the first index, then we start taking bits from parent #2 until we hit the next one, we swap again, and so on. The number of crossovers is random but subject to a configured maximum.
Mutation takes the new DNA strand and twiddles a few bits at random, again subject to a configured minimum and maximum rate of mutation.
The new organism takes the places of one that didn’t make the cut, and we start the whole process over again. If things go the way we hope, maximum and average fitness for the population goes up and up until we, seemingly by magic, have found our answer.
Putting it all together: Evolving a blackout
Our first run will be a 25-cycle evolution of 200 organisms trying to turn all squares in their environments black. Each cycle will run for 200 iterations over a 100×100 grid initialized with a random pattern. (Fun fact: it’s a very poor choice to start with an empty (all white) environment for this challenge — can you guess why?)
We’ll use the same Moore neighborhood as we did for Life. We’ll use Prom-style pairing, allow a maximum of 10 crossover points, and mutate at a rate between 2.5% and 7.5%. This mutation rate is way higher than in nature, and while it can create some chaos, it also introduces novel configurations more quickly, which can reduce the number of cycles required to progress.
…and it’s pretty cool! Now to be clear, this is an easy task. The single rule “no matter what is in my neighborhood, turn me on” will accomplish it in a single iteration. But our organisms didn’t know that. They each started with a totally random set of rules, and all we did is measure how that random set did, pick the best and mix/mate them together, and try again. This graph shows the best, worst and average fitness scores over each of the 25 cycles; by cycle 17 we’d found rules that seem to work perfectly:
Another fun way to look at this progression is to look at the best-performing result at key points along the way:
We’ll see more of this next time, but you can also get a sense for the different strategies that can emerge. In cycle 18 for example, there are dots and lines and blobs and all sorts of mechanisms at work.
Success is Usually Messy
The last thing I’ll call out from the blackout run is that evolutionary success is rarely what you’d expect. I pointed out above that you can achieve a blackout in one iteration with a single rule — but that’s not what our evolution produced.
Moore neighborhoods generate 512 individual rules, and that’s just hard to look at. So I ran the blackout evolution again using a Von Neumann neighborhood of 32 rules. Results for that run are here — similar except in this case we got really lucky and one organism hit perfect fitness on the very first run.
Anyway, the rules for the winning organism in this run look like this; the top section are rules that turn their cell white, and the bottom turn their cell black:
There are significantly more black rules than white.
Only four rules (highlighted in red) make the grid “whiter” — all others are either neutral or black.
Progress reinforces progress — ignoring the center value, all of the rules with three or more black inputs have a black outcome.
Run over 200 iterations, these rules are basically guaranteed to get us to a blackout. But it sure is a roundabout trip compared to the “optimal” rule (I’ve put an animation of our winning rule going through just 12 iterations at the end of the article). However, it’s important to understand that, given our fitness rules and environment, our evolved rule is exactly as good as that “optimal” one. As long as the blackout was attained by iteration #200, it did the job perfectly. Nothing about our world indicated that speed mattered — only the final outcome.
OK, that’s enough for this session. We’ve done a lot — learned about 2D Cellular Automata, wrote code that lets us mimic evolution in digital form, and even saw the first glimmers of some pretty cool outcomes. Next time I’ll get deeper into the weeds so we can really see how this machine ticks. There are just unlimited cool things in the world.