A self-service deterministic simulation testing (DST) environment for developers and AI coding agents has been a long time coming, and today we’re introducing TestFlows Machine to make that vision a reality. Because for many teams, deterministic simulation testing has changed how some of the most reliable software systems are built and tested. It gives you control over software execution, lets you inject failures, and makes runs reproducible, enabling you to investigate bugs that might otherwise take days to reproduce, or never show up again at all. However, getting there has usually meant walking a steep path that starts with building a custom system yourself, specific to your project, or diving into the development of a deterministic hypervisor for a more generic approach. That takes specialized knowledge, infrastructure, and a significant investment, and most teams would rather spend that time and tokens on their own software. And our vision is different.

Our vision

We all see that software development is changing quickly, and AI coding agents now write, test, and debug most, if not all, of the software today. They can investigate a bug, propose a fix, and run the tests, but they still run into the same problem developers do, which is that software doesn’t always fail the same way twice. Race conditions, timing issues, and network failures don’t become easier to reproduce just because an agent is doing the debugging.

Our vision is to make deterministic simulation testing a natural part of the modern AI-driven development cycle. An agent should be able to reproduce a failure, step back through the execution, attach a debugger at the exact point where things went wrong, and try a fix against the same conditions. It should be able to inject faults precisely, compress execution time, and read logs after the fact with retroactive logging, without waiting for fuzzers. And you should be able to do all of that yourself, without having to build or maintain a deterministic hypervisor, or break your engineering budget to get access to systems that already provide this capability.

With TestFlows Machine, you can start doing that today.

Agent first, but for the human in the loop

DST gives you an enormous amount of control over execution, including which vCPU and thread runs and when (yes, we do support multiple vCPUs, as the example at the end will show), which system call fails, what time the machine sees, and where a run branches. That control is the whole point, but it is also what makes the technique hard to adopt, as few developers have the time to learn a new execution model, its vocabulary, and a long list of commands before they see their first result. Many engineers struggle to even remember all the GDB commands, and that is without adding time travel, branches, and support for more debugging commands that you can run from the outside without disturbing the system state.

AI coding agents don’t have that problem. They can read the code, the docs, and the command reference in seconds and drive Machine with precision, which is why we built Machine to be AI agent first. You install the Machine skill, ask your agent what Machine can do for your project, and it sets things up with you, signs in with a code from your email, and gets to work.

But agent first doesn’t mean we want to deliver an AI-driven black box. We want agents to do the heavy lifting, while developers stay in the loop and can see every step they take, repeat it, and take over at any point. That’s why the agent drives Machine through the same machine CLI client that a developer uses, and full programmatic control is available to both you and your agent through the Python SDK, which also lets you write your own custom fuzzers.

Exploring the state space together A mesh of the states a program can reach, running left to right from a single start, each state leading to the neighbouring states of the next step. Your agent's path, highlighted, ends where it found a failure. From a shared point along it, your own branch takes a different path, a passing run. shared pointfailure foundpassing runyour agentyoustart
Every run is one path through the state space of your software. You and your agent explore it together: fork from any point, take a different path, and replay any of them exactly.

Name the bug, verify the fix

We believe the most valuable thing you can give an agent is fine-grained control over execution and fast feedback on its fixes. An agent that suspects a race shouldn’t have to start hours of fuzzing and hope for the best, as it can hold one thread at the exact line, run the other one through, and see the failure in seconds. It can then apply its fix, run the same interleaving again, and know that the fix holds, which turns a guess into a verified fix.

Fuzzing still matters once the bugs you can name are fixed and you need to search for the ones you can’t. Machine supports that today with plans and seeds, and with the Python SDK.

We walk through exactly what this looks like on a real example at the end of this post.

Beyond the deterministic hypervisor

We stand on the shoulders of prior art, and deterministic simulation testing is gaining momentum. We’re excited to see new deterministic hypervisor projects appearing in research and open source. We think that’s great, as more people working on deterministic execution means more innovation and more attention to a technology that has been out of reach for too long.

However, a deterministic hypervisor is only the foundation, and building a complete deterministic simulation testing system is a much bigger undertaking. You need to manage recordings, checkpoints, and branches, control execution, inject faults, debug failures, explore different schedules, and make all of that work together reliably, and then make it accessible through tools that developers and AI agents can actually use. The goal was never just to build a hypervisor but to make deterministic simulation testing practical for everyone, and that also takes the infrastructure to run it, as deterministic execution needs machines prepared for it. That’s why, with Machine, we run that infrastructure for you as a cloud service, where you create a session sized to your work when you need it, and you only pay while your sessions run.

What a deterministic simulation testing system takes A stack of layers. At the top, you and your AI coding agent. Below, the machine CLI, the Python SDK and the Agent skill; execution control, fault injection, debugging and schedules; recordings, checkpoints, branches and replay; your software and its containers; then the foundation of three layers, Linux in the machine, the deterministic hypervisor and host Linux; and at the bottom, cloud infrastructure with sessions on demand. A bracket marks every layer below you and your agent as TestFlows Machine, with your software shown as yours. You and your AI coding agentmachine CLI · Python SDK · Agent skillExecution control · Fault injection · Debugging · SchedulesRecordings · Checkpoints · Branches · ReplayYour software and its containersLinux in the machineDeterministic hypervisorHost LinuxCloud infrastructure · Sessions on demand TestFlowsMachine DST foundation
The deterministic hypervisor, with the Linux it runs on and the Linux it runs, is only the foundation. Machine provides the whole system around it and runs it for you.

Get started

We hope you are as excited about the future as we are. You can create a free account and have your first run in about five minutes, either on your own or together with your AI coding agent. Then head over to our public testflows/Machine repository on GitHub, where you’ll find the examples, the Python SDK, and the Machine skill for coding agents, and when you need more than the free plan gives you, take a look at our pricing. Sessions run in our Europe region today, and North America and Asia-Pacific are coming soon.

We’d love to hear what you find, so come and share it with us in the repository’s Discussions.

What this looks like

To show what this looks like, take missed-wakeup.c, one of the examples in our public repository. Here are the waiter and the signaler of this simple C program, with their line numbers:

1
2
3
4
5
6
7
8
9
10
11
12
13
 67	pthread_mutex_lock(&mutex);
68 waiter_ready = 1;
69 if (!done) {
75 pthread_mutex_unlock(&mutex);
76 pthread_mutex_lock(&mutex);
...
86 rc = pthread_cond_timedwait(&cond, &mutex, &ts);
87 if (rc == ETIMEDOUT && done) { /* the missed wakeup */

106 pthread_mutex_lock(&mutex); /* signaler */
107 done = 1;
108 pthread_cond_signal(&cond);
109 pthread_mutex_unlock(&mutex);

The race window is between lines 75 and 76, where the waiter has already seen done == 0 and dropped the lock. If the signaler runs lines 106 to 109 right then, the signal arrives before the wait on line 86 is armed, wakes nobody, and the waiter sleeps out its whole 50 ms timeout with done already set. On real hardware, that window is only a few instructions wide, so the failure shows up once in a while and, you can bet, almost never when you are looking for it.

The missed wakeup in missed-wakeup.c The waiter checks done under the lock, sees 0, and drops the lock at line 75. While Machine holds it before line 76, the signaler takes the lock, sets done to 1, signals and unlocks. The signal wakes nobody. The waiter then retakes the lock, waits at line 86, and times out after 50 ms with done already 1. Waiter Shared state (mutex, done) Signaler lock67 sees done == 069 unlock75 Machine holds waiter after unlock, before relock lock106 done = 1107 signal wakes nobody✕108 unlock109 lock76 pthread_cond_timedwait()86 50 ms, nobody signals ETIMEDOUT with done == 1: FAILURE: missed wakeup
Machine holds the waiter between unlocking and relocking the mutex, allowing the signaler to send its signal before the waiter begins waiting. The signal is lost, and the waiter times out.

Instead of running the program thousands of times, an agent reads the code and names that window as the suspect.

First, it creates a session with two vCPUs, so that both threads can run at once:

1
machine sessions create --cpus 2

Then it builds the program with debug information and makes a disk from it that runs a single trial:

1
2
gcc -O0 -g -static -pthread -o missed-wakeup missed-wakeup.c
machine disks build --binary ./missed-wakeup mw -- 1

Inside, the machine has two CPUs of its own, and if we were to read /proc/cpuinfo in it, we would see the following:

1
2
3
4
5
6
7
8
9
10
11
12
13
$ machine exec mw run -- grep -E '^(processor|model name|cpu MHz|siblings|core id|cpu cores)' /proc/cpuinfo
processor : 0
model name : TestFlows Machine v1
cpu MHz : 999.933
siblings : 2
core id : 0
cpu cores : 2
processor : 1
model name : TestFlows Machine v1
cpu MHz : 999.933
siblings : 2
core id : 1
cpu cores : 2

The 999.933 MHz is the machine’s clock, a steady 1 GHz that keeps its time deterministic. It does not mean the machine runs at 1 GHz: where it can, the program runs at the full speed of the actual CPU underneath.

Next, it creates a run from the disk, focuses the program so that its threads can be steered, and runs the machine until the program has started:

1
2
3
4
machine create mw --disk mw --cpus 2
machine focus mw add comm=missed-wakeup
machine run mw --until comm=missed-wakeup:exec
machine run mw --until comm=missed-wakeup:sched

Then it lists the program’s threads to learn the ID of its main thread. The process and thread IDs shown below are from our run and will differ in yours:

1
2
3
$ machine tasks mw --focused
TID TGID PID COMM CPU NEXT KIND FOCUS HOLD YIELD PIN SLICE EXE
257 257 missed-wakeup user ✔

Now, it sets a breakpoint on line 76 in the program, using the ID of its main thread, and runs until a thread stops there. The thread that stops is the waiter:

1
2
3
4
$ machine break mw add 257 missed-wakeup.c:76
✔ Breakpoint 1 at waiter+137, missed-wakeup.c:76, in tgid 257
$ machine run mw --iters 0
✔ Stopped at breakpoint 1: waiter+137, missed-wakeup.c:76, in tid 277

With the waiter in the race window, it holds it there, removes the breakpoint, and runs the signaler until it has sent its signal. The signaler is the only thread that reaches line 109:

1
2
3
4
5
6
$ machine tasks mw hold 277
✔ Marked 277 to hold
$ machine break mw delete 1
✔ Deleted breakpoint 1
$ machine run mw --until 'tgid=257:at=missed-wakeup.c:109'
✔ Reached signaler+139, missed-wakeup.c:109, in tid 278

Finally, it releases the waiter and lets the program finish:

1
2
3
4
5
$ machine tasks mw release 277
✔ Marked 277 to release
$ machine run mw --until 'console~(FAILURE: missed|SUCCESS:)'
$ machine output mw -n : | grep -E 'FAILURE:|SUCCESS:'
app | FAILURE: missed wakeup (trial 0)

The bug shows up on the first try. The agent then applies its fix, which rechecks done in a loop around the wait:

1
2
3
4
-		rc = pthread_cond_timedwait(&cond, &mutex, &ts);
+ rc = 0;
+ while (!done && rc != ETIMEDOUT)
+ rc = pthread_cond_timedwait(&cond, &mutex, &ts);

To verify the fix, it builds the fixed program into a disk of its own, mwfix, and creates a run from it the same way:

1
2
3
4
5
6
7
gcc -O0 -g -static -pthread -o missed-wakeup missed-wakeup.c
machine disks build --binary ./missed-wakeup mwfix -- 1
machine create mwfix --disk mwfix --cpus 2
machine focus mwfix add comm=missed-wakeup
machine run mwfix --until comm=missed-wakeup:exec
machine run mwfix --until comm=missed-wakeup:sched
machine tasks mwfix --focused

Now, it stops the waiter on the same line and holds it there:

1
2
3
4
5
6
7
8
$ machine break mwfix add 259 missed-wakeup.c:76
✔ Breakpoint 1 at waiter+137, missed-wakeup.c:76, in tgid 259
$ machine run mwfix --iters 0
✔ Stopped at breakpoint 1: waiter+137, missed-wakeup.c:76, in tid 279
$ machine tasks mwfix hold 279
✔ Marked 279 to hold
$ machine break mwfix delete 1
✔ Deleted breakpoint 1

Then it runs the signaler past its signal, which is now on line 111 because the fix added two lines, and releases the waiter:

1
2
3
4
5
6
7
$ machine run mwfix --until 'tgid=259:at=missed-wakeup.c:111'
✔ Reached signaler+139, missed-wakeup.c:111, in tid 280
$ machine tasks mwfix release 279
✔ Marked 279 to release
$ machine run mwfix --until 'console~(FAILURE: missed|SUCCESS:)'
$ machine output mwfix -n : | grep -E 'FAILURE:|SUCCESS:'
app | SUCCESS: every wait saw the signal

The same interleaving that broke the original now passes, and both runs are recorded, so you can replay either one, step through it, and see for yourself.

You can also run these steps as a Python program with the SDK. Here is the core of missed_wakeup.py:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import testflows.machine.v1 as machine

client = machine.Client()

with client.sessions.create(cpus=2) as session:
client.sessions.use(session)
disk = client.disks.build("mw", binary="./missed-wakeup", command=["1"])
with client.create("mw", disk=disk.name, cpus=2) as run:
run.focus.add("comm=missed-wakeup")
run.run(until="comm=missed-wakeup:exec")
run.run(until="comm=missed-wakeup:sched")
main = run.tasks(focused=True)[0].tid

# Stop the waiter in its window and hold it there.
stop = run.task(main).breakpoint("missed-wakeup.c:76")
waiter = run.run(iters=0).hits[0].hit_tid
run.tasks.hold(waiter)
run.breakpoints.delete(stop.number)

# The signaler alone reaches the signal line: run it past its signal.
run.run(until=f"tgid={main}:at=missed-wakeup.c:109", within="60s")
run.tasks.release(waiter)

run.run(until="console~(FAILURE: missed|SUCCESS:)")
print(next(line for line in run.output() if "FAILURE:" in line or "SUCCESS:" in line))
client.disks.delete(disk)
1
2
$ python3 missed_wakeup.py ./missed-wakeup
app | FAILURE: missed wakeup (trial 0)

Here is how long each step of the first run took, in the machine’s time and in real time. These numbers are from a single run and are only for reference, to give you an idea; yours will vary:

Step Machine time Real time
Boot Linux and start the program 4.52 s 7.0 s
Stop the waiter on line 76 0.018 s 2.7 s
Run the signaler past its signal 0.002 s 3.2 s
Release the waiter and finish 0.56 s 2.4 s
The whole run, every command 5.10 s 21 s

In 5.10 seconds of machine time, which took about 21 seconds of real time, the machine executed 2.94 billion instructions, every one of them deterministically. Two runs of the fixed program’s disk boot to the program in exactly the same 4.776033982 seconds of machine time and the same 2,747,697,931 instructions.

Conclusion

It’s been a lot of hard work, and we’re excited to finally be launching TestFlows Machine so that everyone can try it out. More technical articles that go deeper are coming, and we look forward to sharing more of our Machine with you.