Skip to content

Fault classification

An HFIM campaign injects one fault per run and compares each run with the golden run: the same program executed once without any fault. When a run ends, HFIM gives it exactly one outcome. This page lists the five outcomes and shows how HFIM decides between them, in the order its classifier checks them. The first check that holds decides the outcome, so the order matters as much as the checks.

Outcomes

Each injection gets one of these five values in the outcome column of injections.csv, the comma-separated file with one row per injection.

Outcome Program finished Output correct Condition
masked yes yes observable state identical to the golden run
sdc yes no observable state differs, no error reported
detected yes no the benchmark's own check reported the error (fim_exit(1))
crash no exit code above 1, CPU exception, or a crash pattern on the console
timeout no time limit or instruction limit exceeded

sdc stands for silent data corruption: the program finished normally and nothing reported an error, but its result is wrong.

The order HFIM checks

The classifier reads the evidence of a finished run (its console output, its exit code, whether a limit stopped it, the error message the backend recorded, and the observable variables read at the end) and walks six checks from top to bottom.

A finished injection goes through six checks in order, and the first that holds decides the outcome: a crash pattern on the console gives crash, a time or instruction limit gives timeout, a framework failure gives infrastructure_failure, the backend's crash verdict or a run cut short with an error gives crash, fim_exit(1) or the detection string gives detected, and a result equal to the golden run gives masked; otherwise the outcome is sdc. A finished injection goes through six checks in order, and the first that holds decides the outcome: a crash pattern on the console gives crash, a time or instruction limit gives timeout, a framework failure gives infrastructure_failure, the backend's crash verdict or a run cut short with an error gives crash, fim_exit(1) or the detection string gives detected, and a result equal to the golden run gives masked; otherwise the outcome is sdc.

  1. Crash pattern on the console. If the console output contains any string from crash_patterns, the outcome is crash. This comes first because an operating system that halts after a fatal error then sits idle until the time limit, and the crash is the real cause.
  2. Time or instruction limit. If the wall-clock limit or the instruction limit stopped the run, the outcome is timeout.
  3. Framework failure. If the error message says the fault was never applied (the simulator failed to start or exited immediately, or the debugger failed to connect), the outcome is infrastructure_failure. This run measured nothing about the chip, so it is kept out of the masked, sdc, detected, crash and timeout rates.
  4. Crash. If the backend's crash verdict is set, the outcome is crash. For a run that did not complete, an exit code above 1 or any error message also gives crash.
  5. Detected. If the program ended with fim_exit(1), or its console output contains detection_string, the outcome is detected.
  6. Masked or sdc. HFIM compares the result with the golden run: the observable variables when the campaign names them, otherwise the console output. Equal gives masked; different gives sdc.

A consequence of this order surprises some readers: a run that reports a detected error and then hangs is a timeout, not detected, because the limit check comes before the detection check.

How masked and sdc are decided

The campaign names the observable variables, usually in the file that every campaign of the benchmark includes. At fim_exit, HFIM reads them from the simulated memory and compares each one with its value in the golden run.

# campaigns/fibonacci/fibonacci.yaml
benchmark: fibonacci
observable_outputs:
  comparison: exact
  variables:
    - name: result

With comparison: exact, any difference makes the run sdc. With comparison: tolerance, a variable's tolerance sets how far its value may drift before the run counts as sdc. An observable must be a file-scope volatile variable; What counts as correct lists every key.

The sdc_details column names what differed. Here is a memory campaign on fibonacci in which HFIM flipped bit 4 of one byte of result[]:

injection_id,timestamp,instruction_count,target_type,target_name,original_value,faulty_value,bit_position,hit_instance,actual_pc,outcome,...
2,2026-09-16T12:46:43,942,memory,0x80000210,0x8,0x18,4,0,0x8000021e,sdc,...

The byte held 8 and held 24 after the flip, the program still ended with fim_exit(0), and sdc_details reads result[6]: expected 8, got 24. The state_match column is True when the observables equal the golden run, False when they differ, and empty when no state was compared.

Without observable_outputs, HFIM compares the console output with the golden run's console output instead. By default it ignores leading and trailing whitespace; comparison_mode: strict compares byte for byte. Observables are the safer choice, because a fault can corrupt a printed line without changing the result, or the reverse. The campaign log says which comparison is active, for example Comparison mode: variable-based.

When observable_outputs is set but HFIM could not read the variables at the end of a run, the run cannot be compared. If the console output shows a simulator abort (a gem5 panic: or fatal:, a failed assertion, a segmentation fault), the outcome is crash; otherwise it is infrastructure_failure. HFIM never falls back to the console in this case, because a benchmark that publishes its result in memory often prints nothing, and every run would then look masked.

How detected is decided

The benchmark checks its own result, for example by computing it twice, and ends with fim_exit(1) when the check fails. Exit code 1 means detected, not crash. The observables are not compared for such a run.

A campaign can also set detection_string. If that exact text (case-sensitive) appears anywhere in the console output, the run is detected. For a benchmark with observables and no completion_patterns, the detection string also ends the run when it appears, so HFIM does not wait for the time limit.

detection_string: "MISMATCH"

How crash is decided

Each backend turns its raw evidence into one crash verdict, and the classifier trusts that verdict. A run is a crash when:

  • the exit cause or error message contains an abort signature: panic, abort, fatal, segfault, segmentation fault or page table fault;
  • the run did not complete and the program exited with a code above 1 (fim_exit(2) is FIM_EXIT_CRASH);
  • the debugger lost the target and there is no exit status at all;
  • the console shows a string from crash_patterns (check 1 above).
crash_patterns:
  - "ZEPHYR FATAL ERROR"

A run stopped by a time or instruction limit is a timeout, not a crash, unless its console also shows a string from crash_patterns. A run whose error message says the fault was never applied is never a crash.

How timeout is decided

Every injection has a wall-clock limit, and a run that exceeds it is timeout. You can add an instruction limit, which stops a run that executes too many instructions.

Key Default Effect
timeout required wall-clock limit per injection, in seconds, or auto
timeout_factor 1.5 with auto: the limit is this multiple of the golden run time
timeout_floor 30 with auto: the limit is never below this many seconds
injection_timeout unset exact limit in seconds; replaces timeout, auto included
hang_icount_factor unset instruction limit, as a multiple of the golden run's instruction count
crash_patterns empty console strings that end the run as crash

With timeout: auto, the limit is max(timeout_floor, ceil(timeout_factor * golden_execution_time)). A wall-clock limit depends on how loaded the host is, so the same injection can finish on an idle machine and time out on a busy one. The instruction limit does not depend on the host. Keep both: a run stalled waiting on a device executes no instructions, so only the wall-clock limit ends it. The timed_out column is True for either limit, and on QEMU the hang_cutoff column is True when the instruction limit was the one that fired. Time limits has the full rules.

Outcomes outside the five

Two more values describe HFIM itself rather than the chip: infrastructure_failure (the fault was never applied, or the run could not be compared) and unknown (there was neither an observable nor a golden console output to compare with). results.txt and metadata.json compute the chip outcome percentages over the remaining rows, the VALID count, and show these two values as a share of all rows.

On gem5, some fault targets refine the outcome after the six checks, using what the simulator saw inside the hardware structure:

Target Rule applied after classification
Cache ECC (error-correcting code) the decoder detected 2 bits: detected. The decoder corrected the bit but the run reads as sdc: masked. The faulty line was evicted unread: latent_clean or latent_dirty. A check-bit fault miscorrected a clean bit: ecc_false_correct
Cache tags a lookup matched the wrong line: tag_false_hit. A hit became a miss: tag_false_miss. No lookup used the corrupted tag: tag_latent
NVM tags and endurance (non-volatile memory) a cell exceeded its write endurance: stuck_after_wear, whatever the program did

These values describe the chip, so they count in the rates. Their pages explain each one.

Differences between backends

The checks are the same on every backend: QEMU, gem5, OVP (the Open Virtual Platforms simulator) and real hardware. What changes is where the evidence comes from.

QEMU gem5 OVP Hardware
Instruction limit an instruction-counting plugin inside QEMU; needs injection_mode: icount committed instructions of the CPU model (--max-insts) required: hang_icount_factor above 1.0; the driver stops the run at that budget not available
State read at fim_exit through GDB (the GNU debugger) written by HFIM's controller inside gem5 to state_dump.json the bytes the OVP driver reads when the program exits through GDB
Crash evidence exit code and debugger errors exit code and abort messages; a run that completed is not a crash only because gem5 exits non-zero on teardown a trap in the program, reported with its mcause (the RISC-V trap cause register) a run that neither completed nor timed out, or a crash_patterns match

On OVP, a fault that never landed before the program ended is infrastructure_failure, not masked.

Comparing rates between campaigns

Rates are comparable only between campaigns that use the same observable variables and the same limits. A tighter time limit turns slow runs into timeout, and a different set of observables changes what counts as sdc. provenance.json records the timeout and a hash of the campaign file and of every file it includes, so you can check before you compare.

When a campaign has detected rows, results.txt also prints a DMR Effectiveness line (DMR is dual modular redundancy, computing the result twice): detected / (detected + sdc + crash), the share of harmful faults that the benchmark's own check caught.

See also: Campaign configuration · Writing a benchmark · Output files · Configuration keys