Launching TestFlows Machine: self-service deterministic simulation testing environment Read the post

Deterministic simulation

8 posts on deterministic simulation.

Case studies

Making Bombadil Exclaim: libvoidstar dlopen successful!

Did you know that Bombadil tries to reach for the star? Given the mysterious fellow he is, one would expect so. A voidstar, to be exact, and whether he reaches it depends on where he runs. When Bombadil starts, it tries to load a library, /usr/lib/libvoidstar.so. If the library is not there, Bombadil runs as it would locally on your laptop and makes every decision itself. If it is there, Bombadil draws its random values from the library, and tells it the moments when the program it tests reaches a new state and the results of the properties it checks. When it finds the library, Bombadil says so on its standard error with one line: libvoidstar dlopen successful! In Why Run Bombadil in a Deterministic Hypervisor?, it never printed that line. In this post, we look at what Bombadil does with the library, and how we got it to exclaim that line inside TestFlows Machine.

Vitaliy Zakaznikov Deterministic simulation
Read more

Case studies

Why Run Bombadil in a Deterministic Hypervisor?

Bombadil is a property-based testing tool for web and terminal UIs. It allows you to describe how your application should behave and what actions can be taken to interact with it using a TypeScript specification. Bombadil uses this specification to explore your application, selecting and performing actions based on its current state while checking your properties along the way. You can run it in your local development environment, in CI, or inside Antithesis. Naturally, we also wanted to see how it would run inside Machine, our deterministic hypervisor behind the TestFlows Machine simulation testing environment. Inside Antithesis, though, Bombadil runs differently because it is integrated with their fuzzer. What we can do is run Bombadil much as you would run it locally, but deterministically.

Vitaliy Zakaznikov Deterministic simulation
Read more

Deterministic hypervisor

So We Did Write a Deterministic Hypervisor

Almost two years ago, which in the age of AI is a long time, we set out to achieve what back then seemed to be an unachievable goal: to write our own deterministic hypervisor. Why? Well, maybe because that would make you a cool systems engineer. No, it was because, after working on designing memory chip testing solutions in the semiconductor industry and then on testing real-time operating systems, we knew that anything software can do still has its limits, but this was a clear path to get closer to hardware again. Nonetheless, the challenge was interesting, and the need for an affordable solution was clear.

Vitaliy Zakaznikov Deterministic simulation
Read more

Deterministic hypervisor

A Deterministic Hypervisor: How Many vCPUs Can You Run?

Production software rarely runs on a single CPU. A database sizes its thread pools by the number of CPUs it finds, the Linux kernel keeps per-CPU queues and caches, and locks behave differently when two CPUs contend for them. Software tested on one CPU is tested on a configuration it will probably never run on. That is why we made TestFlows Machine able to have many vCPUs, so that Linux and the software under test see a multi-CPU server just like the one they run on in production, while keeping every run deterministic. So how many vCPUs can you run? Spoiler: up to 64 in one machine. In this post we show what that looks like and what it costs.

Vitaliy Zakaznikov Deterministic simulation
Read more

Deterministic hypervisor

A Deterministic Hypervisor: Is Execution Really Deterministic?

When we tell people that a replay in a deterministic hypervisor is the same run, the first question is always the same: really? Bit for bit? It is a fair question, because it is a strong promise. The short answer is that execution is deterministic on a CPU compatible with the one the run was recorded on, and that you don’t have to take our word for it, because you can check it yourself. This post explains why a recording belongs to its original CPU, what the state of a machine actually consists of, and how TestFlows Machine confirms that a replay reaches the same state, using a small example that boots Linux and prints 256 random bytes from /dev/random.

Vitaliy Zakaznikov Deterministic simulation
Read more

Case studies

Is It Really Fixed? Confirming a JuiceFS Fix in a Deterministic Hypervisor

Back in August, JuiceFS 1.3.1 in our cloud silently started to return different bytes than we wrote, and unfortunately we had to switch to a different storage solution. A few weeks later, a JuiceFS user reported a bug upstream that looked a lot like ours, and the fix shipped in JuiceFS 1.3.4 and 1.4.2. That left us with two questions. Was it really our bug? And is it really fixed? This post is about how we answered both by combining our AI coding agent and TestFlows Machine to reproduce the wrong reads on the version we had used, replay it exactly, and then run the same test against the fixed release with added fault injection.

Vitaliy Zakaznikov Deterministic simulation
Read more

Case studies

Running Jepsen in a Deterministic Hypervisor: A Stale Read That Replays Exactly

Jepsen is a well-known framework used for finding bugs in distributed databases, and its approach is simple to describe. A control node drives a cluster over SSH, runs operations against it while a nemesis partitions the network, kills processes or skews clocks, and then a checker decides whether the history it recorded could have happened on a correct system. What Jepsen doesn’t promise is that a failure it finds will happen again, because the cluster runs on real machines with real scheduling and real timing, so the next run takes a different path. We wanted to see what happens when the whole Jepsen setup runs inside a deterministic hypervisor, and whether a failure it catches can be replayed exactly.

Vitaliy Zakaznikov Deterministic simulation
Read more

Deterministic simulation

Introducing TestFlows Machine: Self-Service Deterministic Simulation Testing Environment

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.

Vitaliy Zakaznikov
Read more