Using gpt-oss-20b to Build Asteroids and Breakout

In this post I explore how to use gpt-oss-20b, an open source 20-billion parameter language model, to prototype two classic browser games: Asteroids and Breakout. By iterating on prompts and refining the output, I generated working HTML5 Canvas implementations in around an hour or so.

gpt-oss-20b is an open-source 20-billion parameter transformer-based language model released by OpenAI under the Apache 2.0 license. It is based on the GPT-4 architecture scaled to 20B parameters, trained on a diverse mix of web text, code, and documents.

Memento Mori

“Let us prepare our minds as if we’d come to the very end of life. Let us postpone nothing. Let us balance life’s books each day. … The one who puts the finishing touches on their life each day is never short of time.”


Seneca

I have read some stoic philosophy recently and one of the ideas it presents is the awareness of death, not in a morbid sense, but as something we should remain aware of. Time passes, often without notice when we are busy in the day to day living, but stoics such as Marcus Aurelius believed it was important to acknowledge that your life span is finite and to act accordingly; use it as a call to action.

Software Architecture

What is software architecture?

It depends. Everyone in IT asks this question at some point and the answer they get is a mixed bag depending on who tries to answer it. So to deepen the general state of confusion I thought I would add yet another definition.

It depends. I think of Software architects as “Master builders”. They may not have the title “Architect” but they are doing most of the following:

On the Design of Small Things

Those who do not understand UNIX are condemned to reinvent it, poorly.
Henry Spencer

The following is from the wikipedia article on Unix Philosophy. It is interesting to apply these rules when designing Microservices, there is significant overlap. Unix did it first.

In his book, The Art of Unix Programming that was first published in 2003, Eric S. Raymond, an American programmer and open source advocate, summarizes the Unix philosophy as KISS Principle of “Keep it Simple, Stupid.” He provides a series of design rules:

2016 Round-Up

So another year draws to a close and I thought I would review the last 12 months in my favourite data struture; lists. Think of this as a far less interesting homage to Fogus yearly reviews.

Over the last few years I consume less technical books purely because the content to be found online can be of great quality and books can rarely keep track with the rate of change in tech. Usually if I am reading a tech book its of a more abstract or fundamental topic rather than specific to a language and is therefore a longer living.

Software, Estimation and the Planning Fallacy

My flight is delayed for 3 hours so I’m taking the rare opportunity to put together some thoughts on how software project estimation can trip companies, teams and individuals up.

Remember way back when everyone thought the Waterfall model was great? Well actually no, for the most part they didnt. The Waterfall model was put forward by Winston Royce back in the early 70’s as an example of a broken SDLC model. Unfortunately this little note was lost in the scramble to adopt it as the de-facto model to use. Now what is interesting to me is its original creator could see that the waterall model contained flaws, but thousands of people could either not see those same flaws, or were unable to cease its adoption even if they tried; I’m not sure which of those is worse. 30 years later you would be hard pressed to find any organizations still working under a Waterfall model, which is good. The real problem however is not that a mistake was made, its that it took a generation before we acknowledged there was a problem.

Directed Graph of hubski users created with D3

Using some c# code to scrape hubski.com I was able to produce a pretty basic directed graph showing users follower connections.

Source code on github

Demo version

Advanced Demo version

Hubski Social Graph

I started off by scanning a users profile and recording various pieces of information such as:

  • Age in days
  • Number of followers
  • Number of people followed
  • Number of badges received.

I then looped over each of that users followers and recorded the same information, and then their followers, and then their followers… you get the idea.

Data Models, functional composition and validation

While I am working my way through the Functional Javascript book I came across something that could be really useful, especially when dealing with AJAX requests.

In a nutshell you start with simple functions that do a single job and then chain them up to perform some larger task. In this example we want to validate that the json being returned from an AJAX call contains the properties we require. To do that we start with the following function:

KnockoutJS demo using Google Books API

Knockout.js

A quick and dirty demo to show off a very simple example of what you can do with some knockoutjs code and an AJAX call. I use the google books API to provide a simple search form.

JSFiddle:

Check out the jsfiddle

I also use the underscore library to work with the observableArray but that is not really a requirement. I just like it.

We start off by creating a simple html page that contains a text box, a button and a results list. In our javascript file we create a ViewModel object (function) that contains properties that match our html form. It has a field for searchInput, a function to handle searches etc. In our document ready function we apply this ViewModel to our html using ko.applyBindings(vm);. When we do this knockoutjs takes our html and resolves all the data-bind="" attributes we have added to elements and resolves them to fields on our ViewModel. This is called Model Binding and it is a powerful tool that allows us to have a single ViewModel property displayed in several places on a page, with each kept in sync to any changes. If the field we are binding to is a ko.observable then any changes made to its value will immediately show wherever it is bound.