Definition
A probability distribution over a system’s runs says how likely one chosen random process, such as a test generator or a workload, is to produce each run; a run, or execution, is one complete behavior of the system. An execution set is the set of every run that a system model §1.1 allows, with no weights attached: every input, environment behavior and attacker choice the model admits. The distribution says how often a run occurs under one process; the execution set says whether it can occur at all.
The idea
An interpreter §2.13, a program that runs other programs, reads programs written in a two-bit instruction code. The codes 00, 01 and 10 are defined, and 11 is reserved for future use. The interpreter looks up each code in a table of three handlers, so the reserved code 11 reads a fourth table slot that does not exist, past the end of the table. The test inputs come from a compiler that only ever emits 00 and 01. A million tests find no failure, because under the compiler’s distribution the code 11 has probability zero. An attacker does not use the compiler. The attacker writes the input by hand, sends 11, and the interpreter reads memory outside its table.
The difference is who chooses the run. A distribution describes a process that chooses at random with fixed weights, so it answers questions about typical behavior and average reliability. An attacker is not such a process. An attacker picks whichever admitted run serves the attacker, and so can put all of the weight on one run that the test process never produces. A safety claim meant to hold against an attacker must therefore speak about the execution set: it must hold for every admitted run, whatever probability any test process gives that run.
How it works
To keep the two apart in an argument, state each one separately and say which one a claim is about.
State the execution set. List what the model lets vary: every input the interface accepts, every order in which concurrent events can happen, and every action that the threat model §1.2, the written account of what an attacker can do, allows. The execution set is every run that these choices produce.
State the property. A safety property §1.11, a property saying that some bad thing never happens, names the bad states that no run may reach, for example ‘reads memory outside the table’. The runs in the execution set that reach a bad state are the bad runs.
State the form of the claim. A universal claim says that the execution set contains no bad run. One bad run refutes it, whatever its probability. A probabilistic claim says that a run drawn from a named distribution is bad with probability at most some number . It must name the distribution, because a different distribution gives a different probability.
Match the claim to the evidence. Testing and fuzzing §10.9, the automatic generation of many test inputs, draw runs from a distribution, so a test campaign supports a probabilistic claim about that distribution. A proof, or a check that covers every run of the execution set, can support a universal claim.
Ask who controls each source of randomness. Probability is the right tool for randomness that the attacker cannot control. The statement that one guess at a 32-bit authentication §1.6 tag, a check value computed from a message with a secret key, is right with probability is a probability over the randomly chosen key, and it holds for every message the attacker picks. For choices that the attacker controls, such as the input bytes, the claim must hold for every choice; treating them as random is the mistake.
Worked example
Take the two-bit instruction code from above, and programs of a single instruction. The execution set holds four runs, one for each code 00, 01, 10 and 11. Only the run for 11 is bad. Compute the probability of a bad run for three ways of choosing the code.
The compiler chooses
00or01, each with probability . The probability of a bad run is , because the code11has weight .A uniform test generator chooses each of the four codes with probability . The probability of a bad run is .
The attacker chooses
11with probability . The probability of a bad run is .
The interpreter is the same in all three cases. Only the weights changed, and the failure probability went from to to . The universal claim, ‘no admitted run is bad’, is false in all three cases, because the execution set contains the bad run for 11.
The weights also decide whether testing finds the fault. With the uniform generator, each test misses 11 with probability . Ten independent tests all miss it with probability , and twenty with probability . With the compiler as generator, every test misses it, so all tests miss it with probability , however many tests are run.
Stated precisely
Let be the execution set, and let be the set of bad runs, where means that every member of is a member of . The universal safety claim is : no run in is bad. Let be a probability distribution over , and write for the probability that a run drawn from is bad. When is finite, is the sum of over the bad runs , where is the probability that gives to run . Three facts connect the two kinds of claim.
If , then for every distribution over . A universal claim implies failure probability zero under every process that draws only admitted runs.
for one distribution implies only if for every run in . That is possible only when is finite or can be listed as an infinite sequence, and a test generator rarely meets the condition.
holds exactly when for every distribution over . Fact 1 gives one direction. For the other, take the distribution that puts all its weight on one run : if is bad, that distribution fails with probability , and an attacker who controls the choice can use exactly that distribution.
The universal claim rests on one assumption above all: the execution set contains every run the real system can perform. A run that the model leaves out, such as one caused by a hardware fault that the model does not admit, is covered by no claim about .
Limits and common mistakes
Probability zero is not impossibility, even inside a correct model. In a model with continuous quantities, every exact value has probability zero. If an interrupt §6.11 arrives at a time drawn uniformly between 0 and 1 ms, the chance that it arrives at exactly 0.5 ms is , yet 0.5 ms is in the sample space, the set of all possible outcomes. A fault that needs that exact instant has probability zero in the model. A real processor counts time in whole clock ticks, so on the machine the same coincidence has a positive probability, and an attacker who controls timing can aim at it.
A small observed failure rate measures one distribution. A million passing tests support the claim that failures are rare under the test generator. They say nothing about runs the generator never produces, which an attacker can choose, and a rate measured under a laboratory workload does not carry over to a field workload that weights the runs differently.
A universal safety claim says nothing about progress or speed. A system that rejects every input never reaches a bad state, so it satisfies the safety claim, and it is useless. Whether useful work gets done is a liveness property §1.12, a separate claim that needs its own argument.
Questions answered
Can a probability-zero event still matter in a universal safety argument?
Yes, a probability-zero event can still matter in a universal safety argument. Probability zero describes how often one chosen random process produces a run, while a universal safety argument is about every run that the system model admits, whatever its weight. If a test generator never produces the input that triggers a fault, that input has probability zero under the generator. It is still an admitted input, and an attacker who writes inputs by hand can choose it every time. One admitted bad run refutes the universal claim.
Probability-zero runs arise in two ways. A sampling process may give the run no weight, as a compiler-based test generator gives no weight to a reserved instruction code. Or the model has continuous quantities, such as an arrival time drawn uniformly from an interval, where every exact value has probability zero although each value is possible. In both cases ask one question: does the model exclude the run, or does the distribution merely give it no weight? Only exclusion by the model removes a run from a universal argument.
Related entries: Safety property (§1.11), Population and sample (§11.1), Fuzzing (§10.9), eBPF verifier (§3.3), Threat model (§1.2), Liveness property (§1.12), Why fuzzing cannot certify universal safety (§17.18).