Software engineer · seven years at Frameplay, an in-game advertising company

Patrick Reece

I spent most of seven years on Frameplay's ad SDKs for Unity and native C++, and was the only SDK engineer from December 2024. In 2026 I took an inherited analytics platform to production on AWS.

Download full CV (PDF) Contact

I'm hiring for

Can the player see the ad?

An in-game ad only counts if the player could see it. Frameplay's Unity plugin used to answer that with up to 120 CPU rays per ad, and a ray can only hit a physics collider. I replaced the rays with up to 1,024 GPU samples of the pixels as drawn. Move the object across either ad and compare both estimates with the ground truth.

Ground truth-what the player sees
GPU sampling-1,024 samples
Raycasts-120 rays
An illustration of the idea, not the SDK's code. Move your pointer over either ad to place the object.
Read the case study →

Case studies

Data platform · 2026

An inherited analytics platform, taken to production

I took over Frameplay's part-built analytics platform from its original author and shipped it across dev, test and prod.

1,700 → 3,100+passing Python tests, September to NovemberOpen case study →
Data correctness · 2026

Making a green status mean the numbers are right

I mapped Frameplay's datasets and what feeds and reads them, then proposed and ran a project to make a job's status show whether its output is right.

0 of 36,630queries hit the old read errors after cutoverOpen case study →
Infrastructure · 2026

Alerting and access, managed as code

Datadog monitors and CI pipeline permissions written as code, plus new scaling rules for the impression tracker.

22 → 0alerts in a 70-hour soak: old monitor, then its replacementOpen case study →
Native SDK · 2023 to 2026

One native SDK core, five platforms, one engineer

The C++ core behind Frameplay's Unity and Unreal plugins, and my work on its unreleased 8.0 line.

300 → 1,200+GoogleTest cases on the 8.0 working branchOpen case study →
Unity and native SDK · 2023 to 2024

Running a buyer's tracking scripts inside someone else's game

A hidden WebView runs the HTML and JavaScript that programmatic buyers send with a bid, off the game's thread.

2,000×+increase in ad inventoryOpen case study →
Unity SDK · 2019 to 2020

Measuring whether a player can see an ad

GPU pixel sampling replaced CPU raycasts for viewability measurement in Frameplay's Unity plugin.

1,024 vs 120samples per ad, at mostOpen case study →
Unity SDK · 2020

Loading ad textures without a frame hitch

Chunked GPU upload, a native image decoder per platform and a web worker on WebGL.

~600 → 174 MBAndroid texture memory in a worst-case test sceneOpen case study →
Unity SDK · 2022 to 2023

Moving a shipped Unity plugin onto a shared native core

Version 3 of Frameplay's ad SDK plugin for Unity moved it onto the shared C++ core. I wrote the upgrader that brings version 2 projects across.

v2 → v3released August 2023, with an editor upgraderOpen case study →
Unity SDK · 2021 to 2023

Nightly tests across more Unity setups than one night can run

PowerShell scripts that ran the Unity SDK's tests in a different mix of Unity versions, render pipelines and platforms each night.

1,512combinations the scripts could generate on one build machineOpen case study →
AI-assisted engineering · 2026

Seven agents, one engineer accountable

A multi-agent workflow where agents write the code and I authorise every release.

900+decisions and actions logged in five weeksOpen case study →

Data platform · 2026

An inherited analytics platform, taken to production

I took over Frameplay's part-built analytics platform from its original author and shipped it across dev, test and prod.

The situation

The platform was part-built when I took it over: SQLMesh models on Athena and Iceberg, a Rust job scheduler on ECS Fargate, and Terraform. It had 45 SQLMesh models when I took it over and has 52 now. It had not yet been deployed to production.

Why it was hard

  • Dev, test and prod shared one data catalogue, and table names did not carry the environment. The same code deployed to two environments claimed the same physical tables.
  • SQLMesh kept its record of what had been built in a file that only one process could write.
  • There was no working deploy pipeline, so deploys were done by hand.

What I chose, and why

  • State in Postgres, not a lock around the file. A lock would have kept an unsupported state store and added machinery around it. Postgres is a supported backend that takes more than one writer.
  • A paused scheduler during deploys. The file lock had also been the only thing stopping a scheduled run and a deploy from writing the same interval twice, so the deploy now pauses the scheduler around every task that writes state.
  • One branch per environment, which matched how the company's other repositories deploy.
  • A gate in front of prod. With a branch per environment, a push straight to the prod branch would deploy prod, and an approval step only asks whether someone meant it. The gate checks that the commit has already been through test.

What I did

  • Stood up separate dev, test and prod environments, each with its own schemas, write scope and warehouse prefix.
  • Moved SQLMesh state from a single-writer DuckDB file on a network disk to Postgres.
  • Built the deploy pipeline: one branch per environment, and prod only accepts commits already promoted through test.
  • Ported finance and billing datasets into versioned models with decimal money columns, uniqueness audits and a monthly reconciliation.
  • Hardened the Rust scheduler, which runs over 40 production jobs: repaired six alarms, added a dispatch canary, and made a timed-out SQL job stop fully before the next one starts.

How it works

How a change reaches production. A commit that skips test is turned away at the gate.

What the first promotion showed

The first promotion to test failed on a permission error. It showed that a dev view and a test view were reading the same physical table. I gave each environment its own schema prefix and made that a condition of the production deploy. The check at the end found 44 views per environment, each reading only its own tables.

Result

Before the first production deploy I planned every stack by hand, read-only. The test environment had already been deployed from an empty store, and its timings went into the runbook for prod. I ran that first deploy in October 2026. By November the work came to about 160 merged pull requests. The largest model I inherited now adds about 1.1 billion rows a day in production.

Built with

  • SQLMesh
  • Athena
  • Iceberg
  • Rust
  • ECS Fargate
  • Postgres
  • Terraform
  • CircleCI

Data correctness · 2026

Making a green status mean the numbers are right

I mapped Frameplay's datasets and what feeds and reads them, then proposed and ran a project to make a job's status show whether its output is right. By November 2026, 65 tickets were done.

The situation

A job could finish with a success status and still have produced no data, stale data or wrong data. The status only showed that the job had run. Before proposing changes, I recorded what the platform contained: the datasets, the pipelines that feed them and what reads them.

An illustration. Five runs report success. Where a report never arrived nothing ran, so there is no status at all, which looks the same as no problem. The checks compare each status with what the run produced, and a run that could not be checked is not counted as healthy.

Why it was hard

  • A green tick says one thing: the job did not throw an error. A job that succeeds on empty input also refreshes the "last updated" signal, so it produces evidence that everything is fine.
  • Some tables are copies of a production database. Every ten minutes each copy was deleted and rewritten in place, while it was being read. A query that landed in the gap got an error, or zero rows and a success status.
  • Queries arrived almost continuously, so there was no quiet moment to rewrite a table in.

What I chose, and why

  • A catalogue that admits what it does not know. Each fact cites saved evidence and is labelled measured, declared, derived or unknown. A confidently wrong catalogue is worse than none, because people will trust it.
  • Checks that never let "could not check" count as "healthy". Each one looks for evidence a job's own status cannot give: whether the source had rows, how fresh the output is, whether a report arrived.
  • Retries alone were not the fix. A retry turns the status green without removing the fault.
  • Each changed load is written to a new folder, and readers are moved to it in one step. I dropped three earlier designs, each for a specific flaw. One let storage delete any copy that had not been refreshed recently, including the copy in use: if the publisher had stopped for long enough, every table would have emptied, and queries would still have reported success.
  • Moving the tables to a different table format, Iceberg, is probably the right long-term answer. I kept it as a separate decision.

What I did

Know what exists

  • Built a catalogue of 196 datasets, the 33 pipelines that feed them, and 91 readers: QuickSight data sets, dashboards and an analysis, Tableau workbooks, backend services and reporting pages in Frameplay's own web app. The platform runs about 90,000 production Athena queries a month. The catalogue holds 713 recorded facts, and about 500 of them were measured directly from saved observations.
  • Wrote a data dictionary covering 203 production objects, and the runbooks the platform is now operated from.

Catch what fails quietly

  • Designed checks for jobs that succeed without producing data: empty sources, stale outputs, late reports and missing exchange rates. Seven run on a schedule in production.
  • Changed the older data jobs so that a failure the code had caught still ends the run as failed, and sends one alert. A test that fires the alert check 15 times at once for the same failure publishes exactly one alert.
  • Added an hourly check on one data feed for fields the source has removed. In its first real event it named the removed field 15 minutes after the first failed run.

Fix what was wrong

  • Shipped a publisher that swaps each copied database table in one step, so analysts never read a half-written table. It publishes 64 of the 70 copied tables and holds the other 6 back on purpose.
  • Corrected the models behind finance and partner reporting. Each fix came with unit tests that fail on the old logic.
  • Rebuilt six weeks of ad-request data in stages: 495.5 million rows across 1,039 hours, with identical row counts and record IDs before and after.

How it works

An illustration, not the real catalogue. It traces what feeds each dataset and what reads it. About 500 of its 713 facts were measured directly from saved observations.
How a table is published. A full copy is written and verified beside the old one, then readers are switched to it in one step.

Result

65 tickets were complete by November 2026. In the three days after the publisher went live, none of 36,630 queries hit the old read errors. Since late October it has run over 2,700 cycles and 10,700 table swaps in production with no failed swap.

Built with

  • Athena
  • Glue
  • Iceberg
  • Lambda
  • DMS
  • Step Functions
  • Go
  • Python
  • Datadog

Infrastructure · 2026

Alerting and access, managed as code

Frameplay's Datadog monitors and CI pipeline permissions written as code, plus new scaling rules for the impression tracker.

The situation

Monitors were applied by hand and the CI config for monitor changes was disabled. Error alerts based on percentages were unreliable on services with little traffic, and one monitor fired on errors it should have ignored.

Why it was hard

  • Most environments are nearly idle, so the share of failing requests swings on a handful of them. On an idle load balancer, two bad requests can read as a 50% error rate.
  • The tracker's autoscaling reacted over minutes to traffic that could jump within one.

What I chose, and why

  • Counts on quiet services and percentages on busy ones. A count of errors per 15 minutes means the same thing at any traffic level. On the busy production exchange a count would only restate the day's traffic, so it keeps percentages.
  • Thresholds from measured traffic. A threshold at the 99th percentile would have notified 5 to 13 times in 14 days, almost all of it scanner traffic. The level I chose would have notified none.
  • A soak before switching. A new monitor runs in production beside the old one, recording what it would have done and notifying nobody.
  • A pipeline that plans and never applies. The stacks had only ever been applied by hand, so the first plans needed reading before anything was allowed to act on them.
  • Two roles for CI. The deploy role can write to every environment, so only the three deploy branches may use it. Any branch can use the plan role, so it has no write actions.
  • Step scaling on a one-minute alarm. The built-in policies waited for three one-minute readings above target and then added tasks gradually.

What I did

  • Became the main contributor to the Datadog monitors-as-code repository and replaced its disabled CI config with a plan-only pipeline covering every stack.
  • Added count-based load balancer error monitors across four services where percentage alerts were unreliable, with thresholds sized from 14 days of measured traffic.
  • Corrected 18 Fargate memory monitors across five services through the shared module.
  • Wrote the IAM permissions for CI pipelines across six repositories. The analytics deploy role is restricted to its three deploy branches, and feature branches get a read-only plan role.
  • With a colleague, diagnosed slow scale-out on the impression tracker, then implemented one-minute step scaling and wrote the capacity runbook.
  • Switched 14 Firehose streams to GZIP Parquet. Files came out 25 to 53% smaller on most streams.

How it works

Which role the analytics pipeline gets depends on its branch. A feature branch can only preview a change. Only the three deploy branches can apply one.

The replacement exchange monitor fires only when two things are true for the same partner: the failure rate is over its threshold, and the request volume is over a minimum.

Result

In a 70-hour production soak the old exchange monitor fired 22 times and its replacement none. All 22 were one error class that the new monitor excludes by design.

Built with

  • Datadog
  • Terraform
  • OpenTofu
  • IAM
  • CircleCI
  • ECS Fargate
  • Firehose

Native SDK · 2023 to 2026

One native SDK core, five platforms, one engineer

The C++ core behind Frameplay's Unity and Unreal plugins, and my work on its unreleased 8.0 line.

The situation

The shared core is C++ with a flat C interface that the Unity and Unreal plugins call. I was its only engineer in 2025 and 2026. The released SDKs were sending 20 to 40 million ad requests a day through mid-2026.

Why it was hard

  • One C++ core has to build for 13 targets across Windows, macOS, Linux, iOS and Android.
  • It is called from C# in Unity and C++ in Unreal, and it reaches Kotlin on Android and Objective-C on iOS. Each of those languages represents an empty value differently.
  • No network call may happen before the player's consent is known.

What I chose, and why

  • One Zig build file in place of CMake, vcpkg and PowerShell. It builds everything with one command and cross-compiles without toolchain files or a choice of generator. Gradle and Xcode only package the results.
  • Each platform's own HTTP stack in place of a third-party wrapper, so the SDK carries no HTTP dependency of its own.
  • On Android, HttpURLConnection and not OkHttp. It adds no new dependency, so it cannot clash with a version of OkHttp already inside a publisher's game.
  • Consent starts as unknown. The core holds back start-up, network calls and advertising-ID access until the engine reports that consent was granted or denied.

What I did

  • Replaced CMake, vcpkg and PowerShell with a single Zig build that cross-compiles the SDK and its dependencies for every platform from one macOS host.
  • Replaced a third-party HTTP wrapper with platform-native backends: NSURLSession, WinHTTP, libcurl and an Android bridge written in Kotlin.
  • Added a consent state API that holds back network calls and advertising-ID access until consent is resolved.
  • Added libFuzzer harnesses, sanitiser lanes, and iOS and Android device tests.
  • Rebuilt CI on CircleCI in place of Jenkins, with platform fan-out, build caching and short-lived credentials.
  • Made the SDK compatible with Android 16 KB page sizes and delivered updated packages to publishers in October 2025, ahead of the Google Play deadline.

How it works

The engine plugins call one C++ core through a flat C interface. The core passes each network request to the native networking code for that platform.

Result

I prepared the 8.0 line in 2026, directing AI-assisted development. Its changelog lists 4 breaking changes and 11 features across Windows, macOS, Linux, iOS and Android. It had not been released when the SDK work stopped. As of November 2026, Unity 3.8.2 on native 7.0.x carries 90% of SDK sessions.

Built with

  • C++
  • Zig
  • Kotlin
  • Objective-C++
  • GoogleTest
  • libFuzzer
  • CircleCI

Unity and native SDK · 2023 to 2024

Running a buyer's tracking scripts inside someone else's game

A hidden WebView runs the tracking markup that programmatic buyers send with a bid. I wrote the C++ core side and the Unity glue, and later ported the Android side into the shared native core.

The situation

A programmatic buyer answers a bid with ad markup: a piece of HTML and JavaScript, part of the OpenRTB standard, that carries the buyer's own tracking. Frameplay's SDK drew ads as images on surfaces inside a game and had no browser to run that markup in. A planning page from August 2023 records that this had caused roadblocks with potential demand partners. The aim was that a buyer should not have to change its bid response to work with Frameplay.

Why it was hard

  • The page is never shown. The ad still reaches the game as an image, and the WebView exists only so the buyer's scripts run on the device. That leaves the SDK with no reliable way to tell whether a page worked.
  • An Android WebView may only be touched on the app's UI thread, and the SDK is called from the game's thread. Code that checks the WebView on one thread and uses it later on the other can find it gone in between.
  • A Java callback object can outlive the C++ object it points to, and the handle C++ uses to call Java is only valid inside one call on one thread.
  • Some devices cannot create a WebView at all.
  • It runs inside someone else's game, so its cost had to be measured in a running game.

What I chose, and why

  • One WebView for the whole session, with the pages queued, and not one WebView per ad. This was the team's design.
  • The queue and its timer live in the shared C++ core. They replaced a queue that had been inside the Unity plugin's Android code.
  • Each page is held open for a fixed time set by the server, whatever the WebView's load callbacks say, because the SDK cannot reliably tell whether a server-provided page worked. The SDK does not retry.
  • Markup runs even when the response carries no ad, so scripts such as invalid-traffic checks can run without an ad on screen.
  • An "unsupported" state. Creating the WebView is wrapped so that a failure sets a state the rest of the SDK checks, and the SDK tells the ad server at the start of a session whether the device can run HTML.
  • One Android archive for the native version. It holds both the compiled C++ libraries and the Java classes that call each other. In Unity 3.8.1 it also replaced four plugin folders, one per CPU architecture, with one file.

What I did

  • Wrote the C++ core side in November 2023: reading the markup from the ad response, a queue of text commands to the engine, running markup when no ad is returned, and the timed queue.
  • Connected the core to the Unity plugin's WebView, which a colleague had written, and hardened it: the page's console messages go to the SDK log, each page reports success or failure once, and a device that cannot create a WebView is marked unsupported.
  • Wrote an end-to-end test that proves the JavaScript ran. The test page posts a freshly generated random value to a small web app, and the test then checks that the value arrived.
  • Profiled it in a running game on my own Android phone. Loading production markup used about 187 ms of CPU time on one background thread over about two seconds, 133 ms of it verifying server certificates.
  • In 2024, ported the Android WebView into the shared native core: a bridge between C++ and Java, the Java packaged in an Android archive, and tests that run on a device. It is listed in native 7.0.0 (October 2024) with five related fixes.

How it works

An illustration. The ad reaches the game as an image, as before. Its markup waits in a queue in the core, then runs in a hidden WebView on the UI thread, where the buyer's scripts call the buyer's servers.
  1. At start-up the plugin creates one hidden, full-screen WebView on the phone's UI thread and waits up to 5 seconds for it to be ready. The SDK then tells the ad server whether this device can run HTML.
  2. An ad response can carry the buyer's markup, wrapped in a minimal HTML page, with how long to keep the page open.
  3. The core downloads the image and shows it on the in-game surface as before. When the image has loaded, the core puts the page in a first-in, first-out queue.
  4. A timer thread in the core releases one page per hold interval, so only one page is open at a time.
  5. On the engine's next update the Unity plugin picks the page up and passes it to its Java code, which posts the load to the UI thread.
  6. The hidden WebView runs the buyer's scripts, which call the buyer's servers from the device. Nothing from the page is drawn. The plugin reports the page's success or failure back to the core.

On iOS the equivalent is a hidden WKWebView, which colleagues wrote.

One crash

On 6 June 2024 a publisher reported a frequent Android crash that was blocking the global rollout of its game. A colleague could not reproduce it. The WebView plugin checked that its WebView existed on the calling thread, then used it later on the UI thread without checking again. I had fixed the same race in the page-load path in April, and the same pattern was still in three other methods. I added the missing checks, five lines in one Java file, and committed the fix about 50 minutes after the ticket was opened. It went out in Unity 3.7.2 the next day. Two weeks later the publisher confirmed the crashes had stopped.

Result

The first end-to-end test to succeed, in November 2023 on Unity on Android, made impressions appear in the buyer's own reporting. Experimental support went out in Unity 3.5.2 (December 2023), and the work was closed in April 2024 as rolled out and passing end-to-end tests. It increased ad inventory by over 2,000 times. The native Android version is in native 7.0.0, and publishers' games kept running markup through the Unity plugin's WebView.

Built with

  • C++
  • C#
  • Java
  • JNI
  • Android WebView
  • Unity
  • GoogleTest

Unity SDK · 2019 to 2020

Measuring whether a player can see an ad

GPU pixel sampling replaced CPU raycasts for viewability measurement in Frameplay's Unity plugin.

The situation

An in-game ad only counts if the player could see it. Frameplay's Unity plugin used to measure that with CPU raycasts: up to 120 for one ad, and fewer for each ad as more came on screen. A ray can only hit a physics collider, which is usually a simpler shape than the object the player sees.

Why it was hard

  • The measurement has to work on the frame as the player sees it, after the game has applied its own lighting, fog and colour correction. A darker or washed-out ad still has to count as visible.
  • There is no general way to take a game's lighting back out of a rendered image so that it can be compared with the original.
  • It had to be cheap on the GPU, and compute shaders were ruled out because not enough devices supported them.

What I chose, and why

  • I wrote up nine shader approaches, from comparing colours to comparing edges, and tried machine learning as well. The learned models reached between 75 and 85% accuracy.
  • I scored each approach on 14 artificial test scenes where the true visibility was known to be 0%, 50% or 100%, under different lighting and with different objects in the way.
  • Comparing colours failed in a telling way. With a wall in front of an ad, the colour-based version adjusted the wall's lighting until it resembled the ad, and reported the ad as 75% visible.
  • Comparing the direction of edges won. Lighting changes how strong an edge is, but not which way it runs. It took accuracy in my test scenes from around 80% to around 90%.

What I did

  • Designed and built GPU pixel sampling in 2020, taking up to 1,024 samples per ad.
  • Documented nine candidate approaches and built an accuracy test suite that compared each against a ground-truth mask.
  • Profiled the chosen approach on Windows, WebGL, macOS, iOS and Android.
  • Before that, moved the visibility checks onto Unity Jobs and Burst. On a low-end Android device with 20 ad spaces, median ray-setup time fell from about 1.3 ms to 0.5 ms.

How it works

Ground truth-what the player sees
GPU sampling-1,024 samples
Raycasts-120 rays
An illustration of the idea, not the SDK's code. Move your pointer over either ad to place the object.

The diagram shows the idea. The shipped version did this for up to four ads in one pass:

  1. After the frame is drawn, copy the screen to a texture.
  2. Read each ad's area from that copy and straighten it into a 64 by 64 greyscale square. Parts of the ad outside the camera's view count as blocked.
  3. Draw the original ad into a matching square, the way the screen would have sampled it.
  4. For both squares, work out the direction in which brightness changes at each pixel.
  5. At 32 by 32, compare the two sets of directions. Only pixels where the original ad has real detail are counted, which is why 1,024 is the upper limit.
  6. Reduce that to one value per ad and read it back to the CPU without holding up the frame.

An earlier, colour-based version of pixel sampling is described in public, in the Figure 8 section of a patent application Frameplay filed in 2020: US20220126206A1. The application is for a different invention and I am not one of its named inventors.

Result

GPU sampling reads the rendered pixels, so it follows the outline of whatever is drawn in front of the ad. Move the object across either ad above and compare both estimates with the ground truth.

Built with

  • Unity
  • HLSL
  • Render textures
  • Async GPU readback
  • Jobs and Burst

Unity SDK · 2020

Loading ad textures without a frame hitch

Chunked GPU upload, a native image decoder per platform and a web worker on WebGL, in Frameplay's Unity plugin.

The situation

Frameplay's Unity plugin downloads ad images while the game is running. Unity's built-in image loading sends a whole image to the GPU in one step, and a large ad could stall the game for more than 100 ms.

Why it was hard

  • Uploading an image in pieces needs its decoded pixels, and Unity does not expose its own image decoder. A separate decoder had to be built for every platform.
  • A browser cannot run that native decoder on a background thread, so WebGL needed a different design.

What I chose, and why

  • A native decoder (stb_image, a public-domain C library) on a background thread, with the upload split into chunks, on Windows, macOS, Android and iOS.
  • Unity's own loader stays as the fallback on platforms without the native decoder.
  • On WebGL, a web worker. It was the only way to get the decoding onto a separate thread.
  • Each ad is drawn into a mipmapped render texture, capped at 2048 pixels in a 16-bit colour format. The mipmaps stopped ads flickering at a distance, and the cap and the format kept memory down.

What I did

  • Built ad texture loading that avoids frame hitches: chunked GPU upload, a native image decoder compiled per platform, and a WebGL path that decodes in a web worker.
  • Added a pixel-difference test for the chunked path, which found bugs in the first version of the chunking.
  • Rewrote the WebGL path three times in three days, until it was fast enough and had no memory problems.

How it works

An illustration. The decoded image goes to the GPU one chunk per frame, so no single frame carries the whole upload.
  1. Download the compressed image.
  2. Decode it to raw pixels on a background thread.
  3. Copy one 512 by 512 chunk into a small texture that is reused for every chunk.
  4. Draw that chunk into its place in the ad's render texture, then wait a frame. Repeat until the image is complete.
  5. Keep showing the previous ad until the new one is ready, then switch.

On WebGL a worker downloads and decodes the image, cuts it into chunks and hands each one to the main thread as a small PNG, which the browser decodes without blocking the page.

Result

Drawing each ad into a mipmapped render texture, capped at 2048 pixels in a 16-bit colour format, cut Android texture memory from about 600 MB to 174 MB in a worst-case test scene. The same test recorded shorter render times, close up and far away.

Built with

  • Unity
  • C#
  • C
  • stb_image
  • WebGL
  • Web workers
  • Render textures

Unity SDK · 2022 to 2023

Moving a shipped Unity plugin onto a shared native core

Version 3 of Frameplay's ad SDK plugin for Unity moved it onto the shared C++ core. I wrote the upgrader that brings version 2 projects across.

The situation

Frameplay's Unity plugin is the ad SDK that game developers add to their Unity projects. Version 3 moved it onto the shared native core. Projects built on version 2 needed converting. The SDKs served 70 billion in-game ad requests in 2022, their peak year.

Why it was hard

  • Version 2 shipped its components inside a compiled library. Every scene and prefab in a game pointed at them by that library's file ID and a number for each class.
  • Version 3 ships the components as source scripts, with new IDs and a renamed ad space class. After a developer imports it, every ad space in their project shows as a missing script and Unity can no longer read its settings.
  • Each project's copy of the old library has its own ID, so the upgrader has to work out what it was.
  • Unity does not let code set the event hooks that a developer saved in the editor.

What I chose, and why

  • An upgrade the developer starts from a menu, with a few documented manual steps around it.
  • Work on the project files as text. Once version 3 is imported Unity cannot read the old components, so the upgrader reads and rewrites the scene and prefab files itself.
  • Find each ad space again by its position. Nothing else identifies an ad space on both sides of the swap, so the upgrader records where each one sits in the world before the change and matches on that afterwards.
  • Rename saved events in the file before Unity loads it, because Unity will not let code set them afterwards.
  • Stop on an error and keep a record. The later stages do not run, and the developer restores their backup and sends the saved record to support.

What I did

  • Was a main contributor to version 3 of the plugin, released in August 2023.
  • Wrote the editor upgrader that migrates version 2 scenes, ad spaces and prefabs to version 3.
  • Tested the upgrader against six packaged sets of version 2 assets.
  • Wrote the upgrade guide for publishers.

How it works

The editor upgrader reads a version 2 project and converts its scenes, ad spaces and prefabs to version 3.
  1. The developer backs up the project, removes the old SDK and imports version 3.
  2. The upgrader scans the project to work out the old library's ID.
  3. It reads every scene and prefab as text and swaps the old script references for the new ones.
  4. For each ad space it saves the old settings, and works out the world position by rebuilding the object hierarchy.
  5. It replaces the old channel and settings assets with the new settings asset.
  6. It opens each scene and prefab, finds each ad space by position, applies its settings and saves.

Two cases need the developer. Prefab instances that contain ad spaces have to be unpacked first, and a helper script finds them. An ad space whose activation collider lives in another scene is logged for the developer to fix by hand.

Result

Version 3 of the plugin was released in August 2023 with the upgrader and the upgrade guide.

Built with

  • Unity
  • C#
  • C++
  • Editor tooling

Unity SDK · 2021 to 2023

Nightly tests across more Unity setups than one night can run

From 2021 to 2023 a set of PowerShell scripts ran the Unity SDK's tests in a different handful of Unity setups each night, and posted a table of passes and failures to Slack each morning. I wrote most of them.

The situation

Frameplay's Unity plugin has to work in whatever project a game developer already has: old and new Unity versions, three render pipelines, several graphics APIs, on desktop and on phones. The tests themselves already existed, written by several engineers. They ran in a hosted cloud build that only executed them on a macOS machine, and in one stage of a Jenkins pipeline a colleague had added a month earlier. Everything else was tested by hand before a release.

Why it was hard

  • There are too many setups to run. In mid-2022 the scripts could generate 1,512 combinations on the main Windows build machine alone: 4 Unity versions, 4 test targets, 3 render pipelines, 2 colour spaces, 2 scripting backends, 2 .NET API levels, graphics jobs on or off, and up to 6 graphics APIs.
  • One project does not open cleanly in every Unity version. Each Unity year needs its own package list and settings files, and Unity 2019 and older had to be switched to the old asset import mode to stop endless re-import loops when run without a window.
  • Compiling could fail the first time after a change of Unity version or render pipeline.
  • Unity can hang on a build machine without saying so.
  • On phones in a cloud device lab, and on console dev kits, Unity's normal results file could not be fetched.
  • The tests shared a build machine with the per-commit pipeline, and running both at once caused collisions.

What I chose, and why

  • A random handful each night, not the full set. I accepted that a given platform might not be picked on a given night.
  • Picks that differ from each other. For each slot the script draws five candidates at random and keeps the one whose settings differ most from those already picked. The picker keeps no record of what earlier nights covered.
  • A fixed baseline first. Random picks can miss a Unity version, so each run on the development branch began with one plain setup on every Unity version listed for that machine.
  • Unity's own Test Framework, driven from the command line: edit-mode tests, play-mode tests in the editor, and the same play-mode tests built into a player.
  • Runs at night, so that they did not collide with the per-commit pipeline on the same build machine.
  • A cache of projects that were already compiled, to cut compile time. It only worked on Windows, and from June 2022 it was switched on only for Unity 2019.

What I did

  • Built the Unity SDK's command-line test runner and its PowerShell build scripts, and owned the nightly smoke tests across Unity versions, render pipelines, and desktop and mobile targets.
  • Built the first version in about nine weeks in 2021: the runner in May, then the randomised picker, the HTML report, the Slack upload and the nightly scheduler in July.
  • Added a watchdog. It prints the last log line every 10 seconds, stops Unity if it has used no CPU time while compiling, and enforces a time limit on compiling and on each run.
  • Gave every run its own dated folder with the Unity logs, the results and a generated script that runs the same setup again.
  • Extended a colleague's results mechanism so that the tests could also report from console dev kits.

A colleague wrote the scripts that sent phone builds to the cloud device lab.

How it works

An illustration. Each night the scripts ran one plain setup per Unity version, then about five more chosen to be unlike each other, out of 1,512 on that machine.
  1. On each build machine a PowerShell loop sleeps until a set time. In mid-2022 that was 21:45 Melbourne time.
  2. It runs one plain setup on each Unity version.
  3. It lists every combination for that machine and picks about five, each chosen to differ from the ones already picked.
  4. For each pick it rewrites the project's package files for that Unity year and render pipeline, then starts Unity without a window to set the pipeline, the colour space and a test flag.
  5. It starts Unity again with the Test Framework's arguments, to build and run the tests in the editor, in a built player or on a device. The watchdog stops a run that stalls or runs out of time.
  6. The logs, the results and the replay script go into that run's folder, and a summary goes to a shared drive.
  7. The next morning one machine merges every machine's summaries into an HTML table with the failures highlighted, and posts it to Slack.

Result

The scripts ran from July 2021 until late 2023. A page I kept in June 2022 lists 14 issues the smoke tests had surfaced. Two were later crossed out, and I rated two of the other twelve as high severity. They included pixel sampling possibly failing on iOS, black shaders on macOS with Unity 2021, and some Android devices lacking GPU read-back support. "Smoke tests all passing" became part of the SDK team's written definition of done. In December 2023 colleagues replaced the scripts with nightly Jenkins pipelines.

Built with

  • PowerShell
  • Unity
  • Unity Test Framework
  • C#

AI-assisted engineering · 2026

Seven agents, one engineer accountable

A multi-agent workflow where agents write the code and I authorise every release.

The situation

From October 2026 the data and infrastructure work at Frameplay ran through a multi-agent workflow. Agents produce confident output that nobody has checked, so I set the workflow up around review and a paper trail.

Why it was hard

  • One person cannot watch six terminals, and an agent reports with the same confidence whether or not it is right.
  • Agent summaries go stale. A draft written days earlier can be wrong by the time it is used.
  • A green CI run can pass for the wrong reason.

What I chose, and why

  • Workers talk to the controller, not to me. I am not watching continuously, and one message with every pending decision beats six interruptions. The controller numbers each question and sends them in batches, each with a recommendation.
  • The reviewer is never the author. An agent that did not write the change reviews it, read-only, in its own checkout.
  • Reviews test the tests. The reviewer breaks the code on purpose and confirms that the tests fail.
  • Claims are checked against the real query engine. The model tests run on DuckDB, which accepts some comparisons that Athena rejects.

What I did

  • Set up one controller agent and six worker agents on separate workstreams, using an open-source orchestration tool.
  • Set the scope, made the decisions the agents escalated, and authorised every push, merge and production release.
  • Had an agent that did not write the change review each substantial one, read-only, with mutation checks on the tests.
  • Kept a numbered log of decisions and actions, a dated log per ticket, and from November a "How I tested this" section in each pull request.

How it works

Workers raise questions and I decide. Substantial changes go to a read-only reviewer, and nothing is pushed, merged or released until I authorise it.

One review

On 12 November 2026 a pull request had all nine CI checks green. The reviewer rendered its SQL for Athena and ran one read-only query, which failed. A date column was being compared with a parameter that renders as text. DuckDB converts the text quietly and Athena does not. The review took 16 minutes. A fix, with a guard test that fails on the old code, was ready half an hour after the review was requested.

Result

That review caught a comparison that passed on DuckDB in CI but failed on Athena, before it reached production. Over five weeks the log passed 900 numbered decisions and actions.

Built with

  • AI coding agents
  • Git worktrees
  • Mutation testing

Skills

How this page works

The background is one WebGL fragment shader on a fixed canvas, drawn in five layers from far to near. Each layer moves at its own speed as you scroll: the far ones lag behind the page and the out-of-focus discs pass in front of it. Scrolling fast stretches the small stars into streaks. Switch the layers off and on to see what each one adds.

Previous

Before Frameplay I was a Technical Artist at Electronic Arts / Criterion Games, from July 2014 to July 2018. I built C# and Python tools for artists and designers, and wrote shaders and visual effects, in Frostbite, Houdini and Maya.