Jumping 2.4 Million Lines of Code to Light Speed. The Zero-Downtime Python 3 Migration of EVE Online. A black circle with a blue orbit and an arrow breaking away, on a blueprint grid labeled File: CARBON-ENG-001, Target: Python 3.12, LOC: 2,400,000+, Status: Live Deployment.

EVE Online's Move to Python 3, a Visual Guide

TL;DR: EVE Online has run on Python 2 since it launched in 2003, and its roughly 2.4 million lines of Python are now headed for Python 3.12. The studio proved the jump on its sister game, EVE Frontier, first. Getting the syntax right turned out to be the easy part. The hard work is 6,500 lines of division, 100 gigabytes of pickled objects, a pile of C++ extensions and a game server that has to stay up every day.

EVE Online's Python 3 migration is happening right now. The space MMO launched in 2003 and has run on Python 2 the whole time, on a heavily customized build of Stackless Python. That's about 2.4 million lines of Python behind a single universe that every player shares.

Why is this harder than your average upgrade? A destroyed ship in EVE is gone for good, and the servers have to be up every single day. Taking the servers down for a few hours at a stretch isn't an option. The migration has to happen in pieces while the game keeps running.

The destination is Python 3.12, by way of a stop on Stackless Python 3.8, which was already end of life by the time the work happened. The build pipelines have been reworked so later upgrades get easier, and a jump to 3.15 is planned for later this year, at the time of recording. The studio, Fenris Creations, announced all of it in a post called "The Move to Python 3 Begins." The title is a little cheeky, since EVE Frontier runs on the same engine and is already on Python 3. What's new is that EVE Online itself is on the path, and the first batch of changes has already shipped to the live game.

This guide follows the migration from the start. It covers why EVE picked Python and Stackless in the first place, why staying on 2.7 stopped being an option, and the phased plan. Then it gets into the three places where valid Python 3 still breaks, what Frontier taught the team, and the advice that applies to anyone sitting on an old codebase of their own.

Listen to the full episode

What is EVE Online? One universe, full loss and an economy economists study

Operating in a Zero-Margin Environment. A continuously running, single-shard universe defined by permanent consequences. Panels around a hexagonal hub: Scale, 2.4 million lines of Python running since 2003; Concurrency, ~15,000 characters sharing one un-instanced universe; The Stakes, full loss; The Constraint, zero downtime, online 24/7.

What exactly is being migrated here? EVE Online is an MMORPG in the classic sense, a massively multiplayer, open-world sandbox that has been running since 2003. It's set in a far future where humanity has gone through a wormhole to a new system, and players mine, trade, pirate and fight their way through it. Its lineage runs back to Elite, one of the early 3D space games with trading at its center, and to classic role-playing games.

Three design choices decide what the code underneath has to do.

One universe. EVE is a single shard. Players aren't sorted into separate game servers, so any two of them who go to the same place will meet and see each other. The largest player group is about 15,000 characters, and in principle all of them could converge on one place at one time for a huge fight. The game holds, as far as the team recalls, two Guinness World Records for the most people taking part in a PvP fight. The engine was built so that thousands of players can share one solar system.

Full loss. When a ship is destroyed, it's removed from the game for good, with no getting it back. The game is built on creation and destruction, so the numbers behind a fight have to come out right every time. Keep that in mind, because it's why a small change in how arithmetic is rounded turns into a big deal later in this guide.

Everything is recorded. The game keeps every single transaction, which is why economists have studied it: that's more accurate, more detailed data than real-world economies offer. There's no formal mechanic for banks, yet players built banks anyway, along with loan schemes and welfare groups. The bigger groups run chains of command with scouts feeding a fleet commander, and some have their own IT departments.

“The distinctive factor is the game is full loss. If you kill someone's ship, that's a ship removed from the game. There's no getting things back. Nothing lasts forever. So the game is built on creation and destruction.”

Jamie Bannister

Why EVE Online chose Python, and the runtime it built around it

The 20-Year-Old Bespoke Runtime. CARBON engine architecture in three layers: Python gameplay logic and network stack on top, an embedded custom Python interpreter in the middle, C++ physics (Destiny) and graphics (Trinity) engines at the base. The Ecosystem Isolation: dependencies meant extracting PyPI zip files and patching build paths. No pip, no uv.

Development on EVE started around 1999, and the game shipped in 2003, when Python itself was still fairly new. Why bet a game on it? The reason was people more than performance. It was the dot-com era, programmers were scarce and expensive, and Python let junior developers and even game designers write straightforward sequential code. That sped up development, and it mattered even more in Iceland, with its much smaller pool of people to hire from.

The physics engine, Destiny, and the graphics engine, Trinity, are C++. The gameplay logic, much of the network stack and the clustering stack are Python. Being that early also meant building a lot from scratch: a way to cluster an application across CPUs and nodes, logging, telemetry. The cluster tooling now looks a lot like what Redis and container systems do, but nothing like it existed off the shelf at the time. EVE also predates Django and NumPy, both of which arrived around 2006.

Then there's packaging. EVE has never had a package manager, so no pip and no uv. Adding a library meant taking the zip file from PyPI, extracting it into the game's environment and seeing what happens. Native extensions were worse. Each one has to run on the Windows server cluster, the Windows and Mac clients, and (in the past) Linux, and against a forked interpreter. The team found modules built for Python 2.7.18 that corrupted memory, because the layout of PyTypeObject changed in 2.7.6 and EVE's fork never picked up that change.

Shipping is just as custom. Embedding Python means the application is the main program and calls the interpreter when it needs to run Python code, instead of the other way around. For 20 years, the studio has embedded the interpreter in its own binary, controlled which paths and environment variables it sees, and packaged everything else to fit the layout that binary expects. Python's build process wants system-specific paths, and those had to be patched out. The team's own verdict is "more like a 75% solution than a real one." Python 3 makes initializing an embedded interpreter more straightforward.

Internal tools feel it too. Designers' tools share code with the game when they create static data, and distributing them has been a struggle for years, because people break their setup by changing the Python path or running the wrong version. A new hire's first few days often go to setting up a machine, sometimes including disabling the Python that ships with Windows so the right 2.7 or 3 runs.

“The programming resources were scarce and heavily sought after. So very expensive. So part of the reason why they chose Python was to get more junior people and even designers to be able to write sequential code in Python in order to speed up development.”

Kristinn Þór Sigurbergsson

Stackless Python vs asyncio vs free-threaded Python at EVE

The Concurrency Evolution Matrix. A table compares Stackless Python (legacy: tasklets and channels, sequential standard Python, core to 20 years of game code), asyncio (event loop and coroutines, explicit async/await colored functions, 'out of the window', requires rewriting 2.4M lines) and free-threaded Python 3.13+ (true parallel threads, needs an audit for implicit GIL locks).

EVE needed serious concurrency long before Python had a good answer for it. Thousands of players can be in the same solar system, and the server can't block while one of them waits on the database. Back then, the answer was Stackless Python.

Stackless is a fork of CPython that adds microthreads, called tasklets, plus channels for them to talk to each other and a built-in scheduler. It works as its own runtime. A stackless library monkey patches the threading and socket modules so they don't block, much like gevent does. On top of that, EVE built an abstraction so developers write plain sequential code without realizing it runs asynchronously. That's what let the game scale the way it did.

It's not all unicorns and rainbows, however. Hiding the async part means even experienced developers forget that a database call yields, so they need a lock. EVE also layered its own changes onto Stackless for things like metrics and memory allocation, which made every interpreter upgrade harder. And the rest of Python moved on. Python 3 got asyncio, built on the Twisted model, and in the Python 2 world gevent became far more popular than Stackless, presumably because you could simply import it into standard CPython.

So why not switch to asyncio? Because every function that can pause has to be marked async, and so does everything that calls it:

import asyncio

async def load_ship(ship_id):
    await asyncio.sleep(0)  # stands in for a database call
    return {'id': ship_id}

async def undock(ship_id):  # has to be async too, because it awaits
    return await load_ship(ship_id)

print(asyncio.run(undock(7)))

That ripples up through every caller, and EVE's 2.4 million lines were written without that in mind, so the option was "out of the window for us." asyncio also only helps while code waits on I/O, not while it crunches numbers. EVE's engine already does its I/O on worker threads in the background, with a scheduler acting as the synchronization point that hands data to the main Python thread. A newer runtime like TonIO, a multi-threaded async runtime for Python written in Rust, isn't straightforward to integrate into that stack either.

Free-threaded Python is the third option. Since 3.13, CPython has had a build with the GIL disabled, so threads run in parallel on multiple cores. It's on the radar, and resource loading could benefit. The catch is that many places implicitly rely on the GIL for synchronization, and those have to be found first. The community tracker of which packages support free-threading is the place to watch, and it's very data science heavy, presumably because data scientists do the most number crunching and stand to gain the most. Michael Kennedy's worry isn't his own code but the libraries written by people who assumed the GIL was there: a hidden race condition could turn into a deadlock once someone adds locks to fix it.

“Stackless Python itself was a very great solution at the time, right? I mean, it's basically Golang's goroutines, but in Python, before things like this co-routine model became so popular as it is in recent years.”

Thomas Dähling

Why EVE Online couldn't stay on Python 2.7

The Gravity of Obsolescence. A spaceship is pulled into a gravity well labeled Technical Debt by three forces: Dead Runtime (Stackless Python repo archived, no Pydantic or FastAPI), Hardware Incompatibility (Python 2.7 knows nothing about Apple Silicon) and Team Drain (a sub-team maintaining a bespoke interpreter).

A heavily customized interpreter can work for a very long time. EVE's did, for 20 years. So what finally forced the move? Three things piled up.

The runtime stopped. As the team tells it, Stackless Python didn't go any further than 3.8, and that version was already end of life by the time the work happened. The project's GitHub repository is now archived and read-only. Python 2 itself was sunset on January 1, 2020.

The ecosystem was out of reach. Libraries a developer would grab today, such as Pydantic, FastAPI or aioredis, weren't an option on EVE's Stackless. With no package manager, every package the team took on needed a close look at whether it would even work in their stack, and whether it would run on every environment they support. That was a major headache for the team.

The hardware moved. The push on the game engine side came from the native Mac client the studio worked on in the early 2020s. Python 2.7 knew nothing about Apple silicon. On top of that, macOS handles Unicode in system calls very differently from Windows. Before the native client, Mac players went through a translation layer similar to Wine.

Could the team have kept patching its own Python 2 forever? In principle, sure. The price would be a small team doing nothing but maintaining the interpreter. That's one possible solution, but not the best one for a studio that wants to move quickly and keep adding features.

“If we don't go up to Python 3, we are stuck with having a small team that is dedicated to nothing else but maintaining the Python interpreter.”

Thomas Dähling

The Python 2 to 3 migration roadmap for 2.4 million lines

The Navigational Trajectory. A five-stop route: Basecamp, Legacy to 2.7 (eliminate 2.4/2.5 idioms); Camp 1, Syntactic Compatibility (the futurize pass); Camp 2, The Runtime Hazards (math execution, C++ extensions); Camp 3, The Data At Rest (100GB of serialized memory); Target Orbit, Python 3.12 ('Mix Mode' heterogeneous cluster deployment).

2.4 million lines of code can't move from Python 2 to Python 3 in a single commit, and a live game can't afford one big switch either. So EVE's plan is a series of phases, each one making the next less risky. The team is a couple of them in.

Legacy to 2.7. A lot of the code still used Python 2.4 and 2.5 idioms. The first phase brings all of it up to a Python 2.7 standard, because many of those changes are also forward compatible with Python 3. It leans on the futurize fixers, and its first batch is already deployed. The details are in phase one.

Two unstable branches. This is the current phase. The Python 2 branch was forked into a Python 3 branch, and immediately many things failed and the tests went red. That branch is called Python 3 unstable, and the work is to get the tests passing until it settles down. Beside it sits a 2.7 unstable branch full of shims and adapters, code that forks on the interpreter version - if Python 2 do this, if Python 3 do that.

Why keep a branch you'll never release? Because it's a sorting tool. For any given change, it answers the question that matters on a live game: can this go into 2.7 and stay Python 3 compatible, or is it a breaking change that belongs on the Python 3 side? It's the middle ground, and it's allowed to be slow because nobody ships it.

Data, not just code. Serialized Python sits in the database and travels across the network, and it has to work on both sides of the jump. See the pickled objects.

Mix mode. Once the code and the data formats are sorted out, the plan is to swap parts of the server cluster to Python 3 one piece at a time instead of all at once. That's covered in mix mode.

How long will the branch work take? The team's own estimate is "our next however many months of work," about as honest as an estimate gets for a codebase this size.

“The downside of that is it's going to be a lot slower. So that's more of a compatibility proof versus a releasable version.”

Jamie Bannister

Phase one: futurize, has_key and 99.8% valid Python 3

Phase 1: Syntactic Forward-Compatibility. A Python 2.7 idiom, if my_dict.has_key(ship_id):, is struck through and replaced by the Python 3 compatible if ship_id in my_dict:. Tooling: futurize subset (maintaining 2.7 deployability). Progress: jumped from 94% to 99.8% syntactically valid Python 3 in production. Insight: parsing is not the same as behaving.

If the goal is Python 3, why does the first phase target Python 2.7? Because much of EVE's code was written in the Python 2.4 and 2.5 style, and bringing it up to a 2.7 standard makes a lot of it forward compatible along the way. The game keeps shipping on 2.7 while the code creeps toward Python 3. The team calls the phase "legacy to 2.7."

The tool doing most of the work is futurize, part of the python-future project. It runs a set of fixers, and each fixer takes one Python 2 idiom and rewrites it for Python 3. Some of them produce code that still runs on 2.7, and that subset is what EVE has applied so far. Futurize's own docs call this first pass stage 1: the safe fixes, which don't break 2.7 compatibility and don't add a dependency on the future package. The docs also warn that stage 1 output will probably not run on Python 3 yet. The point is to get most of the diff out of the way without introducing bugs.

Here's what one fixer does to a file:

$ futurize --stage1 ships.py
-    if ships.has_key(ship_id):
+    if ship_id in ships:

(Add -w to write the changes instead of just printing the diff.) The change the team met most often was exactly this one: testing whether a key is in a dictionary. Python 2 code called the has_key method, Python 3 removed it, and the in operator works on both:

>>> ships = {'rifter': 1}
>>> ships.has_key('rifter')
AttributeError: 'dict' object has no attribute 'has_key'
>>> 'rifter' in ships
True

The same stage 1 pass also rewrites except MyException, e, the old way of declaring an exception, as except MyException as e. Python 3 rejects the old form as a syntax error.

The numbers: 94% of EVE's code was syntactically valid Python 3 before this pass, and it's 99.8% now. And it isn't sitting on a branch somewhere. The first part of the work was deployed to the live game a few weeks before the recording, around the time the announcement post went out.

So is the migration nearly done? No. Valid syntax only means the file parses. The next section explains what parsing leaves out.

“94% of our code was technically Python 3 syntactically valid. We've now got up to 99.8%.”

Jamie Bannister

Why valid Python 3 syntax is the easy part

The Hazard Map: Where Parsing Meets Reality. Syntax is the easy part; state, runtime and ecosystem are the hard parts. Three peaks on a terrain map: the math hazard (6,500 lines of division), the state hazard (100GB of historical data the new runtime cannot read) and the engine hazard (a C++ runtime in a chicken-and-egg loop).

Syntactically valid means the file parses under Python 3's grammar. It says nothing about what the code does when it runs. A line like x / y parses on both versions and means different things on each, so a codebase can sit at 99.8% valid and still be a long way from working. Or, as the team puts it: "It doesn't mean it's going to do the right thing when you put it in Python."

Three places stand between a parsing codebase and a running one:

  • The math. Division changes meaning, and about 6,500 lines in EVE divide something. See integer division.
  • The data. Pickled Python 2 objects in the database and on the network can't be fixed by any syntax tool. See the pickled objects.
  • The engine. The Python code can't run without its C++ modules, and the C++ modules make little sense without the Python. See the C++ extensions.

Python 3 integer division: 6,500 lines that decide who wins a fight

Division is the classic example of code that parses on both Python versions and behaves differently on each. In Python 2, / on two integers floors the result and throws the fraction away. In Python 3, / always gives a float, and // is the floor division that Python 2's / did for integers (PEP 238 made the change). Here's Python 3:

>>> 100 / 3
33.333333333333336
>>> 100 // 3
33
>>> 1 / 10 * 3 == 3 / 10
False

On Python 2, 100 / 3 is 33. Same line, different answer.

The last line is the quieter problem. Once integers quietly become floating point numbers, equality checks stop being trustworthy, because floats carry rounding error that integers never had.

The fix is mechanical in principle and tedious in practice. Look at each division and decide which behavior the code wanted. Where it wanted the integer, write //. Where it wanted the fraction, / is now right. Python 2.7 can opt in early, which lets code be written the Python 3 way before the switch:

from __future__ import division  # on 2.7, / now means true division

ratio = 100 / 3   # 33.333333333333336, as on Python 3
steps = 100 // 3  # 33 on both versions

How much of this is in EVE? It's a game that does a lot with a lot of numbers, and about 6,500 lines feature a division. They won't all break, but some will if the code just moves to Python 3 untouched. Sorting out which ones is part of the next phase of the work.

Why does a decimal place matter so much here? Combat is damage math, one ship shooting another, and if the numbers come out differently after the upgrade, the winner of a fight can change. That's why the team flags it as something it has to get right.

“If you're doing a lot of damage calculations, you've got one ship shooting another ship, that can make a lot of difference if suddenly your damage changes and now I should have won this fight and now I've lost it because the maths is working out differently.”

Jamie Bannister

Migrating 100 GB of pickled Python objects

Hazard 2: The Pickle Time Capsule. A pipe labeled The Vault: 100 gigabytes of stored memory over 20 years runs from a 2006 node, which serializes an NPC agent interaction using a Python 2 old-style class into a pickle byte stream, to a 2026 Python 3 node that rejects it. The solution: migrate to version-independent formats, Protocol Buffers or FlatBuffers.

Fixing code is only half of a Python 2 to 3 migration. A lot of EVE's data is serialized Python too, some of it sitting in the database and some of it travelling across the network between servers, and all of it has to survive the jump.

The format is pickle, which turns live objects into bytes. Its format is Python-specific, so non-Python programs may not be able to rebuild what it wrote. A pickle names the class to rebuild by module and name, plus the object's state, so the reading side needs a compatible class to load it into. Python 2 and 3 disagree about plenty here: old-style classes don't exist in Python 3, and Python 2's plain str is bytes.

That last difference shows up the moment a Python 3 node reads old data. These are the bytes Python 2 writes for the byte string '\xe9' with protocol 2:

import pickle

data = b'\x80\x02U\x01\xe9q\x00.'

pickle.loads(data)                     # UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9
pickle.loads(data, encoding='latin1')  # 'é'
pickle.loads(data, encoding='bytes')   # b'\xe9'

encoding tells Python 3 how to decode the 8-bit strings Python 2 wrote, and it defaults to ASCII. The other direction exists too. While both runtimes share a cluster, a Python 3 node can write a pickle Python 2 can read by capping the protocol, since protocol 3 and up can't be unpickled by Python 2:

pickle.dumps(obj, protocol=2)

Those are stopgaps, and the scale is the bigger issue. EVE's agents are non-player characters (nothing to do with LLM agents) that remember you. Talk to one, and later it might hand you a mission to go fetch something or go kill something. That memory is saved in the database as pickled Python, and it goes back 20 years. The estimate is about 100 gigabytes of it.

Why not run a migration script? A SQL script can't serialize or deserialize Python objects. It has no idea what it's looking at.

So what replaces pickle? The leading option is probably Protocol Buffers, because a big part of EVE's internal and external APIs is already built on it, with FlatBuffers as the alternative depending on size. Protocol Buffers is a language-neutral, platform-neutral way to serialize structured data: define the structure once, then generate code to read and write it in each language. FlatBuffers lets you read serialized data without parsing or unpacking it first. JSON, msgspec or Pydantic models are other version-independent choices. A side effect of a neutral format is that a node that only passes data along might never need to deserialize it.

Pickling objects into Redis is a common habit, and it works fine until the shape of those objects changes between Python versions. Pickle's own docs add a second warning: only unpickle data you trust.

“We have those going back now for 20 years. I think there's about 100 gigabytes of Python memory in the DB, of agent memory in the DB in the form of pickled Python objects.”

Jamie Bannister

C++ extensions and the all-or-nothing jump to Python 3

Hazard 3: The C++ Dependency Loop. Orange arrows circle The Bind. Step 1: Python 3 gameplay code cannot run until the C++ graphics/physics modules are importable. Step 2: but the C++ modules make no sense and cannot be verified without the Python glue tying them together. All or nothing: you cannot put the base interpreter on Python 3 and leave native extensions on Python 2.

A native extension is a module written in C or C++ and compiled against CPython's C API, which Python code then imports like any other module. EVE leans on these heavily. CARBON, the engine EVE Online and EVE Frontier share, embeds the interpreter and exposes its C++ engine modules, the graphics and physics work among them, to Python.

Python 3 changed the C API, and a compiled extension is tied to the interpreter it was built for. Even the entry point differs: a Python 2 extension defines an initspam function, while a Python 3 extension defines PyInit_spam and describes itself with a PyModuleDef struct. This is the minimal Python 3 shape:

#include <Python.h>

static PyMethodDef methods[] = {
    {NULL, NULL, 0, NULL}
};

static struct PyModuleDef spam_module = {
    PyModuleDef_HEAD_INIT, "spam", NULL, -1, methods
};

PyMODINIT_FUNC PyInit_spam(void) {
    return PyModule_Create(&spam_module);
}

So you can't move the interpreter to Python 3 and leave the native extensions on Python 2. Everything goes at once, or it doesn't work.

That creates a chicken-and-egg problem. The Python gameplay code can't run on Python 3 until the C++ modules are importable from it, and the C++ modules make little sense, and can't be verified, without the Python glue tying them together. Neither half can be finished first. The team's biggest early worry was whether a push that size could be pulled off in one go.

Their answer was to shrink the jump where they could. Rather than heading straight to modern CPython, they went to Stackless Python 3.8 first, so only the Python major version changed. The scheduler and async machinery underneath stayed the same, which matters because a lot of the code still has some timing dependency somewhere. From 3.8 they moved on to Python 3.12.

Porting the extensions also dug up fossils. Code relying on Python 2.3 behavior turned up that shouldn't have been in use, kept alive by the customized Stackless interpreter.

The CARBON upgrade is the subject of a Fanfest 2025 talk, linked below.

“You can't just put the base interpreter on Python 3 and then keep all your native extensions to Python 2, right? You need to go all the way. Otherwise, it just doesn't work.”

Thomas Dähling

EVE Frontier as the Python 3 proving ground

The Proving Ground: EVE Frontier. The EVE Online main server links by a test branch to a small EVE Frontier testbed. The Fork: Frontier shares the CARBON engine but has a small alpha player base. The Abyss: the first Python 3 release had hourly downtime; unseen deadlocks froze processes. The Climb: TeamCity CI pushed further into the build.

EVE Frontier is a fork, not a sequel. It started from the EVE Online codebase and still shares much of the underlying engine, but the two have drifted far enough apart that changes are no longer pulled across.

The two games also differ in design. EVE Online drops you into an established society, with NPC police and infrastructure already in place. Frontier drops you into an uninhabited zone where players build everything, with more survival gameplay and smaller, more claustrophobic environments, which is hard to pull off in a space game because space is pretty vast. A newer game can make dramatic gameplay changes more easily, where a 20-year-old one finds that very hard.

For the upgrade, the useful difference is risk. Breaking things on Frontier costs a lot less than breaking EVE Online, whose servers have to run every single day. Frontier could prove out the approach before EVE had to be online 24/7. The plan was a good one, as the team sees it, and Frontier is where it was more or less carried out first. The stakes are higher for EVE Online.

It wasn't smooth. The first Python 3 release had hourly downtime: after an hour and a half or two, some process somewhere would stop responding, and the team was in the dark about why. The cause "turned out to be something really, really stupid."

Why lean on the build system? A game this old doesn't come with a robust suite of unit tests. Automated testing wasn't a big thing when much of the code was written, and graphics and physics are hard to test automatically anyway. That made a purely incremental, test-driven approach hard.

TeamCity is JetBrains' CI/CD server, and the team used it to run the real build and get further and further into it, fixing whatever broke at each step.

“The first release we did, we had hourly downtime because after like one and a half, two hours, some process somewhere would just stop responding at all and we were like a bit in the dark there. It was like a very stressful time and it turned out to be something really, really stupid.”

Kristinn Þór Sigurbergsson

Mix mode: upgrading a 200-node cluster one node at a time

Summit Approach: Heterogeneous Mix Mode. Reject the 'Big Bang' deployment; EVE servers must run 24/7. A grid of about 200 orange legacy nodes running stable Python 2.7, with a few blue upgraded nodes on Python 3.12, wired to a box labeled The Router. Traffic passes between heterogeneous nodes (and environments like Linux vs Windows), spreading risk over time.

EVE Online isn't one server process. It's an application spread across about 200 nodes in a server cluster, each with certain jobs to do, all deployed and configured as one giant cluster with coordination tools the studio built over the years. Add every player's game client on top. Today, every one of those pieces runs Python 2.7.

So how do you move all of that to Python 3? The obvious way is a big-bang deployment day where everything switches at once. Big deployments like that are very stressful. For a game whose servers need to run every single day, taking the servers down for hours at a stretch isn't an option.

The alternative is a rolling upgrade, which the team calls mix mode. Instead of replacing the whole cluster at once, you replace one piece at a time with its Python 3 equivalent, so a cluster of Python 2.7 and Python 3 nodes runs side by side while the upgrade works through it. The risk and the load get spread over a long stretch instead of resting on a single day.

Mix mode comes later in the plan, once the data formats that need to change and the runtime code are worked out. It also needs tooling the migration doesn't strictly require: a way to deploy a heterogeneous mix of builds.

That tooling pays off beyond the migration. Once a cluster can run a mix of builds, other options open up, like asking whether some nodes should run on Linux and others on Windows. That's an option the tooling would make available, not a decision.

To be clear about where this stands: mix mode is the next stage, not something running in production today, and it follows the earlier phases of the roadmap.

“So rather than doing a big deployment day where we say, okay, this is the moment, we want to incrementally do it, kind of spread that risk and that load at the time.”

Jamie Bannister

Advice for a large Python 3 migration: people, branches and a linter

The Mega-Project Migration Playbook. 1. Secure the Resources: make the team untouchable; if you pause, the effort is wasted. 2. Integrate Constantly: merge from legacy to modern branches often, in small batches. 3. Ratchet the Linter: developers on the old stack write forward-compatible code. Stop digging the hole deeper.

A migration like this is as much an organizational problem as a technical one, and the advice comes down to three habits.

Protect the people doing it. The migration team should be untouchable while it runs. On a live game, a team that's also pulled into feature work gets derailed immediately, which is part of why Frontier brought in a contractor, Reckon Digital, that did a really good job migrating most of the Python code. And once you start, you can't stop halfway: a paused migration is almost wasted effort.

Stop the old codebase from digging the hole deeper. While one group pushes the migration forward, a whole bunch of developers keep adding features to the game every day, against Python 2.7. The goal is for that new code to be as forward compatible as possible. The tool for it is a linter, applied as a ratchet: the strictness only goes up, a little at a time. At the time of recording, a new linter had just been rolled out, with the plan to progressively raise its strictness, and code quality inspection like this is expected to be really important going forward.

Integrate constantly, in small pieces. Start with the age-old advice of really good test coverage. Then do the migration in a separate branch, but keep merging from the Python 2 side into the Python 3 side, so new pain points surface as soon as possible. On Frontier, changes would sometimes arrive that clearly weren't Python 3 compatible, and they could be fixed right away. Waiting costs more. At one stage the team merged only every other week, and each merge ate a whole day of resolving issues. The rule of thumb that came out of it: do it frequent, do it often, keep it small.

Python's own porting guide, linked below, covers the mechanics. One more thing is worth knowing before you start. When Kristinn Þór Sigurbergsson went looking for other teams' war stories, he found very few. His running theory is that plenty of people have been through a painful Python 3 migration and nobody wanted to talk about it afterward.

“The more frequent you do these integrations, like the less painful they are. If you do it once a month, oh my god. Like there was a period where we only did it like every other week, and we would basically spend a whole day just resolving all of the issues.”

Thomas Dähling

What Python 3 unlocks for EVE: speed, types, dataclasses and uv

Reaching Light Speed: What Python 3 Unlocks. Four panels: Performance, a 15% to 20% CPU performance improvement across the board, essentially for free; Architecture, native Apple Silicon support and paths to future updates (targeting 3.15 next); Code Integrity, dataclasses, type hints and type checkers on 2.4 million lines; Ecosystem, uv and uvx to install packages into the game environment.

So far, the team has seen roughly 15% to 20% better performance across the board for most things, basically for free. The exception is string handling: everything is Unicode in Python 3, and that carries a little overhead compared with operating on bytes directly.

The bigger wins are in the language. Python 3 adds annotation syntax for types. Python 2.7 is "sort of" there with the right IDE, but it isn't consistent, and annotations get much better as you move through the Python 3 versions. Python 3 also has dataclasses, which fit a pattern the codebase already repeats constantly: a small class that just defines a packet of data in a particular structure and gets passed around. A @dataclass generates the boilerplate from the annotated fields:

from dataclasses import dataclass

@dataclass(slots=True)
class DamagePacket:
    attacker_id: int
    target_id: int
    amount: float

packet = DamagePacket(attacker_id=1, target_id=2, amount=12.5)
print(packet)

Typed Python and a 2.4-million-line codebase suit each other. Static type checkers such as Pyrefly and ty read the annotations and answer, automatically, whether the code is still consistent. Test coverage is reasonable but not complete, so anything the language can do to help prove correctness is welcome.

Packaging is the slower change. The team is exploring uv run and uvx: uv run runs a command or script in a managed environment, and uvx runs a tool in a temporary isolated one. The goal is for a developer to install a package straight into the game environment, which uv can do against a specific interpreter:

uv pip install --python /path/to/game/python requests

Native extensions make that non-trivial, because they need to find the right build environment. And CARBON is now open source, so there's a path where people install its pieces into a regular Python interpreter with pip or uv. Many internal workflows probably won't change much. Since around 2011 or 2012 the engine has had an interpreter mode: start it with a special flag, and you get a Python REPL inside the game engine.

Is easy installing all upside? Not necessarily. On a large team, a bit of hassle around adding a dependency isn't all bad, since someone can flippantly add one that causes problems. The flip side, as Kristinn Þór Sigurbergsson points out, is that if upgrading is hard, you're less likely to upgrade.

The next upgrade is already planned. The build pipelines have been reworked so future updates are a lot easier, with plans at the time of recording to go to Python 3.15 later this year.

If this has you thinking about your own older code, Talk Python Training has three courses that line up with it: Python 3, an Illustrated Tour for what changed in Python 3, Async Techniques and Examples in Python for the concurrency background behind Stackless, asyncio and free-threading, and Rock Solid Python with Python Typing for adding types to a large codebase.

“So the more we can put in a kind of leverage from the language to help prove correctness and find issues, that's going to lead to a better product and less issues.”

Jamie Bannister

Talk Python's Mastodon Michael Kennedy's Mastodon