AI Coded Pacman Inspired Arcade Game

AI coded pacman inspired arcade game

First part of this series Lapzilla & Qwen3.8-27B Round One

This time around, I am going to use an AI coding tool more like how I use them professionally. This means different models for different purposes and managing context windows. Ollama hosting qwen3.8-27B-mlx will still be used for the local LLM. We’re going to constrain the context window to ~128KB to prevent memory corruption and kernel panics. We’re also going to explicitly set the effort level to medium to fix the extreme slowness caused by the default xhigh and it’s respective reasoning token overhead.

Professionally I use a planning session with a more expensive model. Once that is all set, I tend to switch to lower cost model for the execution session. I used Anthropic’s Fable for the planning. I spend a decent amount of time describing the goals of the project along with the problems and lessons learned from the first round. This produced both the CLAUDE.md, ARCADE-SPEC.md, the PLAN.md, and especially the PROGRESS.md which is the checkpointing in case of a kernel panic. I also included a LESSONS.md for the agentic coding feedback loop.

For context management, I gave instructions to use a subagent for development and testing but never run more than 1 subagent at a time because Ollama running a local LLM is only going to support a synchronous flow. There isn’t enough hardware to support concurrent LLM calls.

Once the plan was all set, I exited claude and restarted with the ollama wrapper.

ollama launch claude --model qwen3.8:27b-mlx

Here’s the usage stats to get to a releasable milestone…

claude usage stats – ollama hosting qwen3.8-27b-mlx

I would let this “cook” while I went and did other things or slept overnight. While it took ~68 hours of linear “compute” time to build, long blocks of time were spent idling while waiting for me to approve something. The qwen model really wants to bias to cat commands with pipings and redirects which the anthropic models don’t do.

Here’s the breakdown using current Anthropic API list pricing (per million tokens, as of September 2026), based on the 116.7M input / 1.3M output tokens:

ModelInput rateOutput rateInput costOutput costTotal
Claude Haiku 4.5$1$5$116.70$6.50$123.20
Claude Sonnet 5$2$10$233.40$13.00$246.40
Claude Opus 5$5$25$583.50$32.50$616.00
Claude Fable 5.1 / Mythos 5.1$10$50$1,167.00$65.00$1,232.00

The qwen3.8-27b-mlx model is considered “Opus” level. Excluding the Fable usage for planning, let’s simplify and consider it cost $616 to build this pacman inspired implementation.

Is the qwen3.8-27b hype worth it? In my opinion yes. I have lots things I want to build or experiments I want to run. If I was spending $2K/month on tokens, I’d have a strong incentive to monetize this work. By running the LLM model locally I am essentially trading hardware cost (macbook M5 ultra) for token cost. The more I build the more the hardware costs amortize.

Frontier models for the planning. Local LLMs for the execution and build phases.

Here’s the github repo. Clone it and give it a play.
https://github.com/sean-foley/pacman

Lapzilla & Qwen3.8-27B Round One

I bought a fully kitted out Apple Macbook Pro to do local AI development. I’ve been buying a decent amount of tokens to justify an ROI. I heard all the buzz about Qwen3.8-27B being near Anthropic Opus quality so I decided to try it. Before I get into the details, this is not how I normally use AI coding tools. This was meant to be a test of how someone that doesn’t know anything about software engineering would vibe code Pacman. Here’s the screenshot of the javascript app it built.

qwen3.8-27b LLM coded pacman

Macbook Pro Specs: M5 Max, 128GB ram, 8TB ssd. Mac OS 26.6.2. Installed Homebrew, Claude Code, VS Code. Time to start my agentic testing…

ollama launch claude --model qwen3.8:27b-mlx

The prompt:
This is an agentic coding test to see how well a local LLM can implement the arcade game Pacman. You can chose the tech stack and strategy to implement. I want you to work fully autonomous.

Shit went south fast. First there was a kernel panic that caused a reboot. I thought that might be some one-off since I still had over 64GB of free memory. Then it happened again, and again, and again. I’ve earned my greybeard status and had a hunch the “video memory” was leaking and going corrupt. I was fortunate that it happened once while I was watching the screen flash green and some other artifacts before the OS tossed in the towel.

That was enough for me to get my search/chat-fu going to find a confirmation: IOGPUMemory Crash. That’s unfortunate because I was looking forward to the 262KB Qwen3.8-27B context window.

Claude code was also dogshit slow. I specifically spec’d the M5 Max cpu because of the 614GB/s memory bandwidth. You want fast ass memory bandwidth when running inference. What was happening is the reasoning was defaulting to extra high and generating a bunch of reasoning tokens.

Here’s my strategy to “fix.”

  • Reduce the context window. I going to try 128KB and manage context growth by using subagents.
  • Change the effort in Claude Code to medium

Nvidia Personal AI Super Computer

At CES, Nvidia just announced at Project Digits which is branded as your “personal AI Super Computer.” What makes this interesting:

  • 128GB of memory is enough to run 70B models. That can open up some new experimentation options.
  • You can link a couple of these together to run even larger models. This is the technique used for data center shizzle, so bringing this to the desktop is cool.
  • The Nvidia stack. Having access to the Blackwell architecture is sweet, but the secret sauce is the software stack, specifically CUDA. This is really Nvidia’s moat that gives them the competitive advantage. Build against this, and you can run on any of Nvidia’s stuff from the edge on up to hyperscale data centers.

If you are a software engineer, IMO it’s worth investing some $ in this type of hardware vs. spinning up cloud instances to learn. Why? There are things you can do locally on your own network that allow you to experiment/learn faster than in the cloud. For instance, video feeds are very high bandwidth that are easier to experiment with locally than pushing that feed to the cloud (and all the security that goes with exposing outside your firewall.)

Some related posts….
https://www.seanfoley.blog/visual-programming-with-tokens/
https://www.seanfoley.blog/musings-on-all-the-ai-buzz/

Visual Programming with Tokens

I bought a few Nvidia Jetson devices to use around the house and experiment with. I went with these vs. a discrete GPU + desktop machine because of power consumption: A desktop machine + GPU will use 300W+, and these Jetson edge devices use 10-50W.

I normally experiment with machine learning & AI shizzle using either a Jupyter notebook or a python IDE. But in this demo, I decided to check out Agent Studio. You fire up the container image, open up the link in your browser, and start dragging/dropping shizzle on to the canvas. Seriously rapid experimentation.

  • The video source is an RSTP video feed from my security camera.
  • The video output also produces an RSTP video feed. Not shown in the demo but I also experimented with overlaying the LLM output (tokens) with the video source to produce an LLM augmented video feed showing what it “saw”
  • This feeds into a multimodal LLM with a prompt of “describe the image concisely.”
  • I wire up the output to a text-to-speech model. Since video/LLM is operating in a constant loop, I also experiment with wiring up a deduping node.

This demo allowed my to get an idea of how these bits perform. I was interested in tokens/sec, memory utilization, and CPU/GPU utilization. Next, I plan to build out an Agentic AI solution architecture for my home security.

Musings on all the AI Buzz…

Some think we’re in an AI bubble where AI is being over-hyped. Massive data centers are being built specifically for AI hardware (aka NVIDIA). Power consumption is so extreme that Big Tech wants to go nuclear.

I’ve used the foundational models. I have also used LLMs on the edge. I watched the GTC March 2024 Keynote with NVIDIA CEO Jensen Huang.

Here are the things that stuck with me:

  • Gen-ai is good at extracting context from unstructured data. This is a game changer.
  • There is a ton of investment $$$ flowing into this space. This will impact how we build software and what/how users interact with computers. This is very much like the previous Dot Com boom where the Internet/Ecommerce would fundamental change commerce… it was just the huge investments were too early for the “other” technical changes needed to make ecommerce ubiquitous: mobile phones and cheap networking.
  • Data centers and hyper-scale are needed for some workflows, but you can’t overcome physics and the round-trip latency of data transfer, which makes true interactive multimodal interactions challenging.
  • AI at the Edge is where I think the future is headed. We will want to use our phone or tablet with multi-modal gen-ai to assist us with “things.” This requires low-latency. For example, the speech-to-text models running on your phone performing real-time transcription of a voice mail is immensely useful to avoid spam calls.
  • According to Jensen Huang’s keynote, the future of programming is tokens. You feed tokens around to different “AI’s” that are specialized in a particular domain. This is the basis for Agentic AI.

I’ve seen shifts in tech and the software industry over my career. Historically, it has been about higher and higher level of abstractions:

  • Assembly abstracted machine op codes. C/C++ abstracted assembly.
  • Managed languages abstracted unmanaged languages which conversely abstracted the host CPU and hardware architecture (write once/run anywhere).
  • Operating systems abstracted the computer hardware
  • Databases abstracted the file system
  • Sockets abstracted the network.

But in each one of those abstractions, you still wrote code to sequence all that shizzle. It was deterministic logic based on discrete math. Now, in this new gen-ai world you decompose your domain into tokens. And within this domain, you have sub-domains that are specialized/optimized AIs. Each one of these gen-ai domains produces a probabilistic result based on linear algebra and statistics. Basically, it is a very smart guesstimate.

So now, tokens are abstracting the programming languages. And the holy grail everyone is chasing is Artificial General Intelligence (AGI) where the AI can do its own planning/reasoning. This abstracts out the programming language because the computer can figure out its own shizzle.

If you are a software engineer, you will absolutely need to add these tools to your toolkit. And I am not talking about just using a gen-ai API LLM wrapper. You really should dig behind that LLM API wrapper and:

BMW S1000R Accessory Light Flasher – First Prototype

I built this about a year ago.  I prototyped a circuit that used an ATTiny85 microcontroller to drive a p-channel (high side) mosfet.  The idea was to use the microcontroller to strobe the Clearwater Darla LED accessory lights.

The circuit worked as expected, but that click-click-click-click noise is bad. I thought the functionality of the led “instant-on” was via a 12v signal to the dc-dc circuit in the led light, but it is actually a mechanical relay. Strobing anything mechanical is no bueno.

I  completely changed my strategy after this test.  A little experimenting and I discovered that the accessory lights are controlled by a PWM signal which controls the light intensity (low to full power).

Wizbangadry

I met up with one of my peeps for lunch the other week.  We’re chatting about stuff, then we started talking about coding.  We have a nice rivalry – I’m very much about the “art and craft” of software engineering, and he’s all about using the latest/greatest to build stuff.  I call B.S. on his shinny new, and he calls B.S. on my old and crusty.

Me: “Dependency Injection used to be your jammy jam. You told me that my code sucked because I called a constructor directly.  So what’s your newest hotness?” Continue reading “Wizbangadry”

Progressive Web Apps and The Microsoft Store

Welcoming Progressive Web Apps to Microsoft Edge and Windows 10

Microsoft announced that Progressive Web Apps (PWA) will be added to the Microsoft Store (the “Store”).  This means just like a native app (or Universal App in Microsoft Store parlance), you can build a PWA app and have that added to the Store.  From a developer perspective, this is great.  A PWA app in theory should be much more cross-platform than a native app.  But what I find more interesting is thinking about the “why’s” a company would do something.

The big tech companies have been battling for years.  When you are building your business, trying to navigate the cesspool of technologies is a challenge.  You have to be careful of betting on a technology that could get dropped when it isn’t a strategic fit anymore.  Remember a thing called Silverlight?  As developers, we know its possible to have standards and the Web has been that shinning light.  But Apple, Google, and Microsoft all have different objectives.  Unfortunately, rather than evaluating a technology on its technical merits, it’s actually more important to evaluate it on the viability of its long term success. Continue reading “Progressive Web Apps and The Microsoft Store”