I built a terrarium simulation using Pygame a while back:
Let's check whether Gemini can add entirely new features to this Python codebase without blowing everything up.
Let's open up the project in VS Code:
I am using ReptClip for VS Code (an extension I built) to build the context and apply the diffs.
Let's addREADME.md, requirements.txt, and all Python files into the context (I know it's not ideal, but let's try):
Already 64,000 tokens. Let's paste it in:
What? The browser chat UI silently truncated the context I pasted in, without showing a single warning!
Luckily, the limit is larger if you upload the context as a file:
Let's type the prompt and hit send!
A 108-line diff. Now, I can copy the diffs and click Apply Diffs in my extension. It will automatically read them from the clipboard and apply the changes:
Let's try once more:
Even though ReptClip supports fuzzy matching in SEARCH blocks, the AI hallucinated too much, so the extension wasn't able to find a match.
Here is my new plan:
- Give the AI only the project structure, README, and
requirements.txt - Ask it which files it needs to see to implement the feature
It gave a list of the files it wants to see:
Since we already added the project structure and output format, let's uncheck them and add the files Gemini asked for:
Luckily, this time it didn't get truncated:
The new diff was 165 lines:
Let's apply the diffs:
Only one fuzzy match. Let's launch the terrarium:
There we go! We got the feature we asked for.
Time to make it harder. The new feature:
A suspiciously tiny diff that literally fits into a single screenshot:
I applied it anyway:
And ran the simulation:
The worms looked a bit different, but it was definitely far from what I asked. Let's try again with Gemini Pro.
It's using some big words:
It gave me a 265-line diff modifying 2 files. Let's see what it did.
I can't even see the worms.
I thought maybe they were still growing. I waited in front of the simulation at 8x speed for days*:
Still empty. Let's try with Gemini Extended Thinking:
According to Gemini, it found the exact bug:
I applied its recommended patch:
Still no worms.
Let me handle this alone without taking a screenshot every 5 seconds. I'll come back soon.
🏃 ...
So, according to Gemini, this was the reason:
Anyway, I gave it ant.py so it could refer to it and generate proper diffs. This time, I was able to see something!
Now THAT is what actual peristalsis looks like!
I think that's enough for now without breaking it even more.












































