Fission

Checking a decompiler by running it

December 2026 · Fission

A decompiler's output is a claim: this C does what that machine code does. Most ways of grading decompilers do not test that claim. They compare the output with the original source, or with another decompiler's output, by how similar the two look. Similarity is useful for readability, but it can reward wrong code. A function that reads a value one instruction too late can look exactly like the source and still return the wrong number.

So Fission has a verify command that tests the claim directly: run the decompiled function and the original machine code on the same inputs and compare what they do. This post explains how it works, what it found in Fission itself, and how we check that the checker is worth trusting.

What verify compares

The ground-truth tier takes the tree the pseudocode was printed from and interprets it. Next to it, Fission's own emulator runs the function's machine code. Both sides get the same arguments, the same memory, and the same value returned from every call the function makes. Then three things are compared:

Calls are stubbed on both sides rather than run. The emulator stops at each call, records its arguments, and continues with a chosen return value, alternating between zero and a pointer to a zeroed buffer. That keeps a check about one function from turning into a check of the whole program.

fission_cli verify ./a.out --addr 0x1139 --tier ground-truth --json
fission_cli verify ./a.out --all --tier ground-truth > verify.jsonl

The answer is equivalent, diverged (with the first difference), unsupported or harness. Where the input is something verify cannot model honestly, it refuses instead of guessing: an incomplete decode, a run that jumps outside the decoded function, or 32-bit PE __stdcall, where the callee cleans the stack. An unsupported is not a pass, and the docs say to report its count next to the diverged count.

Every verdict carries its denominator

"Equivalent" means "agreed on every run that was checked." That is only as strong as the number of runs. If the interpreter can run 2 of 64 sampled inputs, an "equivalent" over those 2 is weak evidence, and it should not be counted the same as one over 64.

So the JSON accounts for every run: planned, attempted, checked, agreed, diverged, and each reason a run was skipped. Run n of a seed is always the same input, so any divergence can be replayed from its seed and run number.

What it found

In November we ran verify on 689 x86-64 functions from small programs built with zig cc at -O0, -O1 and -O2. Most were compiler runtime routines: integer division, float conversion, bit counting. 48 came back diverged. We traced each one by hand: in 39 the decompiler was wrong, and in 9 the verify harness itself was.

The 39 traced back to five families of bugs. Two examples:

Others were loops inside a single instruction (bit-scan sequences folding to a constant), wrong widths and sign extensions, and values lost at join points. Some are fixed, some are still open. None of them would have shown up as a worse similarity score.

The 9 harness bugs mattered as much. One bound arguments by position and ignored which register a parameter came from. Another read return values from rax only, so float returns in xmm0 were never compared. A verifier with bugs like these produces false alarms, and worse, false "equivalent"s.

Checking the checker

A verifier that agrees with everything is easy to build. To measure how much verify actually catches, verify --mutate breaks the decompiled tree on purpose and counts how many broken copies each tier notices. There are six kinds of break: flip a comparison, change a constant by one, drop a store, swap call arguments, swap zero- and sign-extension, remove a mask.

fission_cli verify ./a.out --all --mutate --mutate-sites 2 --runs 64

On the 13 x86-64 fixtures in Fission's CI verify gate (144 functions, about 3 minutes, identical across two runs):

tiermutantskilledsurvivedkill rate
ground truth2141396767.5%
concrete (no machine code)101346733.7%

Kill rate is killed / (killed + survived). 8 ground-truth mutants were inconclusive and are left out of the rate.

A kill rate is not a grade until someone reads the survivors, so we did. Most were equivalent mutants: edits that do not change behavior. In a clamp function, v < lo and v <= lo return the same value; a widen-then-truncate cast survives a sign swap because the bits that differ are thrown away. Some were sampling gaps: a routine that behaves differently only at -4095, which no random input drew. And some were thin baselines, where the original "equivalent" rested on 2 of 64 runs. Each kind of survivor points at different work: input search for the gaps, flagging for the thin results.

Checking the oracle

Every verdict above trusts the emulator to say what the machine code does. --cross-check-oracle tests that trust by running each function's lifted p-code a second time, on a small, independent interpreter, from the emulator's exact entry state, and comparing every general-purpose register at return and every byte stored.

On the same 144 functions and 9,216 planned runs: 76 functions agreed over 4,617 runs, 0 disagreed, and 68 were refused, mostly because the small interpreter does not follow calls. Zero disagreements on that set is a useful result, and the refusals show where it says nothing.

What it does not do

None of that makes it a proof. (The symbolic tier does ask Fission's solver for a proof, but of something narrower: that the printed tree is equivalent to the tree before structuring, for loop-free bodies. It does not look at the machine code.) Against the machine code, verify is a test, and it tells you how much testing it did.

Try it

brew install fission-systems/tap/fission-cli
fission_cli list ./your-binary
fission_cli verify ./your-binary --addr 0x... --tier ground-truth --json

If it reports diverged on your binary, that is a decompiler bug we want to see. An issue with the binary and the address is the most useful report there is. The full reference is in the CLI docs.