Slow Website Builds, Multiplayer RL, CS336, SDD, Pen-Plotted Bonsai
Week 6, day 5 at Recurse F2’25.
Slow Website Builds
It’s because of images. And it’s agonizing.
| what | duration |
|---|---|
| generating thumbhashes | ~4 min |
| eleventyImg: embedded | ~3 min |
| eleventy (incl. imgs) | ~25 min |
These are only the image-related parts, but they’re most of it.
The total build time can end up passing 30 mins, and timing out.
I looked again today for whether it has improved, and whether I could solve it.
I found a ton of version numbers had been incremented in the eleventyImg plugin (I’m on v3, I think v7 is out), and there were new ways of wrapping the outputs and doing calls. But the fundamental problem (slow builds, reprocessing images) seemed to remain.
I even quickly ran across an old GitHub issue I raised.
It seems like the solution they were leaning towards was to directly (“passthrough”) copy files. But doing this doesn’t add the width and height attributes, which I intentionally rely on to get the page layout correct right from the HTML load alone (before images load). Also, I don’t know whether it applies when I do want smaller image sizes as well.
Skipping the original would skip creating the largest (and double-compressed) copy of each image, and hopefully improve build times.
I read through the docs again, and couldn’t see a solution for this written up there.
The possible paths I can think of are:
-
ping the repo again and see whether there’s a good path yet
- not thrilled about this because the (understandably busy) maintainer’s last response time to an opened issue was 1.5 years
-
build all the image versions myself, upload to R2, then have my (Cloudflare pages) build script download all of them, and somehow have
eleventyImgnot generate them but instead look for them.- this seems hard, because it figuring out the hash would probably require running a full
eleventyImgbuild anyway. You can specify a hash manually, but it’d still have to look at all images, which is probably going to be slow knowing how that plugin usually works.
- this seems hard, because it figuring out the hash would probably require running a full
-
build the entire site myself, separately push the built site (to repo) and upload assets (to R2), then have the Cloudflare pages build script just download the assets and copy them into the built directory
- honestly this is not a bad idea
Mo photos, mo problems. I’ve probably spent a hundred hours over the years getting photos on my website to work well. Text-only blogs don’t know how good they have it.
Multiplayer RL
It’s really cool how many RL environments match the gym spec OpenAI defined.01
PufferLib has an amazing list of Third-Party (RL) Environments. These kinds of human-curated lists are a goldmine when you’re exploring a topic.
We’ll work on a simple multi-agent game for next week’s Recurse ML/RL in games group: Connect Four. It seems like PettingZoo is the collection of environments that’s built for multiple agents.02 I’m excited to see agents go head-to-head!
So Close to Cruising in DSA
I feel like I’m really close to having caught up with core data structures and algorithms. There’s a few more I want to write out in my repo (mbforbes/dsa) and notes (data structures, algorithms). Then I think I’ll be comfortable just keeping the skills sharp with regular practice, occasionally adding to the notes, but directing the full force of low-level learning effort to ML and LLM topics.
Speaking of which,
CS336
Stanford’s CS336: Language Modeling from Scratch, taught by Percy, looks extremely fun. I know a few folks in Recurse have done it. It seems like a lot of work (they even say in the course: don’t expect to get research done the quarter you take it).
Delightfully, the lectures are on YouTube.
I checked out the first lecture today. I was thinking I could resist working on the material, but they even have in the “Why you should take this course” section of the intro:
You have an obsessive need to understand how things work.
I have never felt more seen.
Spec-Driven Development
Never heard of this term before! Not much to say about it, other than wanted to write a note to remember it exists. Here’s a couple main resources to check out in the future:
Pen-Plotted Bonsai
This took 1 hour, 52 minutes:

I feel guilty not attributing the original source, but I downloaded it weeks ago and modified it a bunch and have now forgotten the provenance.
My takeaway: yes, you really do need to edit way down an SVG with any kind of overlap. (I did, but not enough.)
Footnotes
No idea actually whether they were the first to define RL APIs this way. ↩︎
In hindsight, this should have been easier to figure out. PufferLib’s docs literally say: “PettingZoo is the standard API for multi-agent reinforcement learning environments.” But somehow, there are so many environment collections, and so many games are multiplayer games, but are hardcoded so you may only run an agent for one player. ↩︎