My first open source contribution: a one-frame flash in Bench
Blog post #98

AI-generated illustration.
Two days ago I wrote about my first mocked hardware app, built in Bench, a browser simulator for ESP32 boards. One small thing bothered me the whole time: every time I opened the page in full screen, the 3D view flashed. Just for a moment, but every time.
Bench is open source. So instead of living with it, I went looking for the cause. Today that turned into my first pull request to someone else’s project: sjunnesson/porous-bench#1.
What shipped
- The cause of the flash. The 3D view is drawn with WebGL. When the window changes size, the view resizes its canvas, and resizing a canvas wipes it clean. The code that handles the resize only set a few flags and waited for the next frame to draw again. The browser got to paint in between, so for one frame there was an empty canvas and the grey background showed through. That was the flash.
- A seven-line fix. The view now draws straight away when it is resized, so there is never an empty frame to paint.
- Proof, not just a theory. I measured it in the browser by copying the canvas right after a resize and counting the pixels. On the live site: zero drawn pixels. With the fix, the scene is there in the same frame, every time.
What’s working
- Finding the project was the first puzzle. I knew Bench was open source but not where the code lived. The link was inside the site’s own JavaScript, pointing to the repository on GitHub.
- The project tells you how it wants to be worked with. The repository has a
CLAUDE.mdthat describes its conventions, down to how commit messages should read: a short title, then a body that says why. My commit and pull request follow that, so they look like they belong there. - The maintainer had already seen the bug. So this was not me pointing at a problem. It was me showing up with the cause and a fix.
What’s unclear or broken
- Six tests fail on my machine, with or without my change. They fail the same way on the main branch on Windows and have nothing to do with the 3D view. I wrote that in the pull request instead of hiding it.
- It is not merged yet. That is the maintainer’s call, which is how it should be.
Why this made me happy
- This is what open source is for. Someone builds a tool and puts the code out there. Someone else uses it, finds a rough edge, and sends a fix back. Nobody needs permission to look, and everybody gets a better tool.
- The AI community around me is growing. More and more people I know are building things in the open, many of them with AI agents doing a lot of the work. That makes it much easier to help each other: I can read a stranger’s code base in minutes, understand it, and contribute something useful the same afternoon.
- It was a small fix, and that is fine. My first contribution is seven lines. It still makes the tool a bit better for everyone who opens it in full screen.
Tooling & process
- Claude did the digging, I did the steering. Claude found the repository, read the code, reproduced the flash with a measurement, wrote the fix, tested it on a local copy and opened the pull request from my fork. My part was noticing the bug, deciding it was worth fixing and saying “send it”.
— Stefan