Mutation testing
| ID | Group | Type | Backends | Figure | Program |
|---|---|---|---|---|---|
| R2 | Regression | C | CPU (gfortran) | yes | scripts/mutation_test.py |
Case and scope
A test suite is only as good as the defects it catches. The mutation run plants one defect at a time in a scratch copy of the tree, rebuilds the tests, runs the whole suite (scripts/run_tests.sh) and records which test programs fail. A mutant no test catches is a defect the suite cannot see. The mutants edit the generated Fortran, not the generator: what is measured is the tests, and the tests never run the generator.
Setup
Each mutant replaces the first occurrence of a text after an anchor in code (never in a comment: a mutated comment is an equivalent mutant). They cover one coefficient of each row family (one of them the smallest coefficient of the widest FD first derivative), the pair signs and offsets of the centred kernels, the division by the step, the mirror of a left-side kernel and its sign, the order of a flux difference, a dispatcher's case and its NaN, the NaN constant itself, and the wiring of the 3-D operators; for the FD face kernels of phase 2, a coefficient of each new row type, the pair sign and step of a face derivative, the mirror read of a one-sided and of a biased kernel, and a biased dispatcher's case; and for roadmap #2, a face-difference row, a dissipation part's sign and constant, an FV biased row and its mirror, a filter row and pair sign, a dissipation dispatcher's case, the line solvers' pivot, periodic column, border, factor reuse and masks, a compact operator's band, right side, pair sign, step,
| Item | Choice | Code |
|---|---|---|
| Copy | the tracked and untracked files of the working tree and the fetched PENF, into --workdir (default a new temporary directory); the working tree is never modified | mutation_test.py |
| Build | fobis build --mode tests-gnu --force-compile per mutant: FoBiS does not rebuild the dependents of a changed cpp #include, so an incremental build could keep a stale mutant | failing_tests |
| Baseline | the unmutated copy must be green first | |
| Killed | at least one test program fails (FAIL or XPASS in the report of run_tests.sh) |
python3 scripts/mutation_test.py --mode tests-gnu [--workdir DIR] [--only NAME ...]
python3 scripts/mutation_test.py > notes/mutation-run-<date>[-<label>].txt # recorded: the tables pick it upThe tables below are those of the newest recorded run that lists exactly the current mutants (docs/scripts/make_tables.py): a run of an older mutant list documents an older suite.
Results
The recorded run of the current suite and its 56 mutants, notes/mutation-run-2026-11-18-factored.txt. The earlier runs stay recorded: the first release's 22 mutants (notes/mutation-run-2026-11-17.txt), the same against the suite with the spectral test (notes/mutation-run-2026-11-17-spectral.txt), phase 2's 30 (notes/mutation-run-2026-11-17-phase2.txt) and roadmap #2's 53 (notes/mutation-run-2026-11-18-p2.txt), every mutant killed in each.
56 of 56 mutants killed (mutation-run-2026-11-18-factored.txt, 2026-11-18).
| Mutant | File | Change | Killed by (gideon_test_…) | Tests |
|---|---|---|---|---|
row-fd-d1-c6 | gideon_tables.F90 | 3._R_P/4._R_P → 0.7501_R_P | adam, golden, operators_3d, order, tables | 5 |
row-fd-d1-c10-tail | gideon_tables.F90 | 1._R_P/1260._R_P → 1._R_P/1261._R_P | adam, golden, operators_3d, order, tables | 5 |
row-fv-face-c4 | gideon_tables.F90 | 7._R_P/12._R_P → 0.5834_R_P | adam, golden, operators_3d, order, properties, split, tables | 7 |
row-fv-uface-3 | gideon_tables.F90 | -7._R_P/6._R_P → -1.1667_R_P | adam, golden, order, properties, tables | 5 |
row-fv-point-c6 | gideon_tables.F90 | 3._R_P/640._R_P → 3._R_P/641._R_P | adam, golden, order, properties, tables | 5 |
pair-sign-fd-d2-c4 | gideon_fd_centred.F90 | (q(m) + q(-m)) → (q(m) - q(-m)) | adam, golden, operators_3d, order, properties, spectral, tables | 7 |
pair-offset-fd-face-c8 | gideon_fd_centred.F90 | q(m) + q(1-m) → q(m) + q(-m) | adam, golden, order, properties, split, tables | 6 |
pair-sign-fd-average-c6 | gideon_deconvolution.F90 | (q(m) + q(-m)) → (q(m) - q(-m)) | adam, golden, order, properties, tables | 5 |
flux-face-offset-fv-d1-c6 | gideon_fv_centred.F90 | (q(m-1) + q(-m)) → (q(m) + q(-m)) | adam, golden, operators_3d, order, properties, spectral, tables | 7 |
scale-fd-d3-c4 | gideon_fd_centred.F90 | d = d/ds/ds/ds → d = d/ds/ds | adam, golden, order, properties | 4 |
scale-fv-d2-c4 | gideon_fv_centred.F90 | /(ds*ds) → /ds | adam, golden, operators_3d, order, properties | 5 |
scale-fv-d6-ur2 | gideon_fv_upwind.F90 | /(ds*ds*ds*ds*ds*ds) → /(ds*ds*ds*ds*ds) | golden, properties | 2 |
mirror-fv-face-ul3 | gideon_fv_upwind.F90 | q(1-m) → q(-m) | adam, golden, order, properties, tables | 5 |
mirror-sign-fv-face-d1-ul2 | gideon_fv_upwind.F90 | d = -d/ds → d = d/ds | adam, golden, order, properties, tables | 5 |
difference-order-fv-d2-ul2 | gideon_fv_upwind.F90 | d = (gl-gr) → d = (gr-gl) | adam, golden, order, properties, spectral, tables | 6 |
face-offset-fv-d1-ur3 | gideon_fv_upwind.F90 | gl = gl + FV_UFACE_S3(m)*q(m-1) → gl = gl + FV_UFACE_S3(m)*q(m) | adam, golden, order, properties, spectral, tables | 6 |
dispatch-wrong-kernel | gideon_dispatch.F90 | case(4) ; call gideon_fd_d1_c4 → case(4) ; call gideon_fd_d2_c4 | adam, dispatch | 2 |
dispatch-no-nan | gideon_dispatch.F90 | case default ; f = GIDEON_NAN → case default ; f = 0._R_P | dispatch | 1 |
nan-constant | gideon_kind_parameters.F90 | 9221120237041090560_I8P → 4607182418800017408_I8P | dispatch, operators_3d | 2 |
curl-component | gideon_operators_3d.F90 | c(2) = dvx_dz - dvz_dx → c(2) = dvz_dx - dvx_dz | adam, operators_3d | 2 |
divergence-step | gideon_operators_3d.F90 | call gideon_fd_d1_c4(vy_y, dxyz(2), dy) → call gideon_fd_d1_c4(vy_y, dxyz(1), dy) | adam, operators_3d | 2 |
laplacian-direction | gideon_operators_3d.F90 | call gideon_fv_d2_c6(qz, dxyz(3), dz) → call gideon_fv_d2_c6(qy, dxyz(3), dz) | adam, operators_3d | 2 |
row-fd-face-d1-c4 | gideon_tables.F90 | 9._R_P/8._R_P → 1.1251_R_P | golden, order, tables | 3 |
row-fd-uface-3 | gideon_tables.F90 | -5._R_P/4._R_P → -1.2501_R_P | golden, order, properties, tables | 4 |
row-fd-bface-5-tail | gideon_tables.F90 | -5._R_P/128._R_P → -5._R_P/127._R_P | golden, order, properties, split, tables | 5 |
pair-sign-fd-face-d2-c4 | gideon_fd_centred.F90 | (q(m) + q(1-m)) → (q(m) - q(1-m)) | golden, order, properties, tables | 4 |
scale-fd-face-d2-c4 | gideon_fd_centred.F90 | d = d/ds/ds → d = d/ds | golden, order, properties | 3 |
mirror-fd-face-ul3 | gideon_fd_upwind.F90 | q(1-m) → q(m-3) | golden, order, properties, tables | 4 |
mirror-fd-face-bl5 | gideon_fd_upwind.F90 | q(1-m) → q(m-1) | golden, order, properties, split, tables | 5 |
dispatch-wrong-kernel-bl | gideon_dispatch.F90 | case(5) ; call gideon_fd_face_bl5 → case(5) ; call gideon_fd_face_bl3 | dispatch | 1 |
row-face-diff-5 | gideon_tables.F90 | 5._R_P → 5.001_R_P | golden, order, split, tables | 4 |
bdiss-sign-fd-br5 | gideon_dissipation.F90 | -FD_BDISS_S2*d → FD_BDISS_S2*d | golden, order, properties, split, tables | 5 |
bdiss-constant-fv-3 | gideon_tables.F90 | 1._R_P/12._R_P → 1._R_P/11._R_P | golden, order, split, tables | 4 |
row-fv-bface-5 | gideon_tables.F90 | 47._R_P/60._R_P → 0.7834_R_P | golden, order, properties, split, tables | 5 |
mirror-fv-face-bl5 | gideon_fv_upwind.F90 | q(1-m) → q(m-1) | golden, order, properties, split, tables | 5 |
row-filter-c6 | gideon_tables.F90 | 15._R_P/64._R_P → 0.2344_R_P | golden, order, properties, tables | 4 |
pair-sign-fv-filter-c4 | gideon_filters.F90 | (q(m) + q(-m)) → (q(m) - q(-m)) | golden, order, properties, tables | 4 |
dispatch-wrong-kernel-diss | gideon_dispatch.F90 | case(6) ; call gideon_fd_face_diss_c6 → case(6) ; call gideon_fd_face_diss_c4 | dispatch | 1 |
thomas-pivot | gideon_line_solvers.F90 | p = b - a*w(i-1) → p = b + a*w(i-1) | lines, lines_golden, solvers | 3 |
tri-periodic-column | gideon_line_solvers.F90 | z(n-1) = z(n-1) + c(n-1) → z(n-1) = z(n-1) + a(n-1) | solvers | 1 |
penta-resolve-pivot | gideon_line_solvers.F90 | bp = bp - ap*u1(i-1) → bp = bp + ap*u1(i-1) | lines, lines_golden, solvers | 3 |
penta-border | gideon_line_solvers.F90 | x1 = (r1 - s12*x2)/s11 → x1 = (r1 + s12*x2)/s11 | lines, lines_golden, solvers | 3 |
masked-diagonal | gideon_line_solvers.F90 | p = merge(1._R_P, b, mask(i)) → p = b | solvers | 1 |
masked-offdiagonal | gideon_line_solvers.F90 | ap = ap - merge(0._R_P, e, mask(i)) → ap = ap - e | solvers | 1 |
band-fd-d1-p8 | gideon_tables.F90 | 4._R_P/9._R_P → 0.4445_R_P | lines, lines_golden | 2 |
right-fd-d2-p6 | gideon_tables.F90 | 12._R_P/11._R_P → 1.0910_R_P | lines, lines_golden | 2 |
pair-sign-fd-face-d1-p6 | gideon_compact.F90 | (q(m) - q(1-m)) → (q(m) + q(1-m)) | lines, lines_golden | 2 |
scale-fd-d2-p4 | gideon_compact.F90 | r = r/ds/ds → r = r/ds | lines, lines_golden | 2 |
filter-alpha-row-p6 | gideon_tables.F90 | 17._R_P/32._R_P → 0.5313_R_P | lines, lines_golden | 2 |
filter-alpha-term-p4 | gideon_compact.F90 | alpha*FD_FILTER_P4_ALPHA(m) → alpha*FD_FILTER_P4_ALPHA(0) | lines, lines_golden | 2 |
mirror-fv-face-pbl7 | gideon_compact.F90 | q(1-m) → q(m-1) | coupling, lines, lines_golden | 3 |
band-fv-face-pbl5 | gideon_tables.F90 | 1._R_P/2._R_P → 0.5001_R_P | coupling, lines, lines_golden | 3 |
band-fv-face-p6 | gideon_tables.F90 | 1._R_P/3._R_P → 0.3334_R_P | lines, lines_golden | 2 |
factor-pivot-tri | gideon_line_solvers.F90 | fac(i,1) = 1._R_P/(b - a*wp) → fac(i,1) = 1._R_P/(b + a*wp) | solvers | 1 |
factor-carry-penta | gideon_line_solvers.F90 | u1pp = u1p ; u2pp = u2p → u1pp = u1 ; u2pp = u2 | solvers | 1 |
factored-border-penta | gideon_line_solvers.F90 | x1 = (r1 - fac(n-1,2)*x2)*fac(n-1,1) → x1 = (r1 + fac(n-1,2)*x2)*fac(n-1,1) | solvers | 1 |

Every mutant (rows) and the test programs that fail on it (filled), from the recorded run.
| Test | Mutants it kills | Mutants only it kills |
|---|---|---|
gideon_test_golden | 30 | 0 |
gideon_test_order | 29 | 0 |
gideon_test_tables | 26 | 0 |
gideon_test_properties | 25 | 0 |
gideon_test_adam | 19 | 0 |
gideon_test_lines | 12 | 0 |
gideon_test_lines_golden | 12 | 0 |
gideon_test_operators_3d | 10 | 0 |
gideon_test_split | 9 | 0 |
gideon_test_solvers | 9 | 6 |
gideon_test_dispatch | 5 | 3 |
gideon_test_spectral | 4 | 0 |
gideon_test_coupling | 2 | 0 |
Findings
- Every mutant is killed, most by four or more programs: the suite is redundant by design, each contract checked from more than one side.
- Only
gideon_test_dispatchkillsdispatch-no-nananddispatch-wrong-kernel-bl: an order without a kernel, and the biased dispatchers (which have no ADAM counterpart to compare with), are exercised nowhere else among the 1-D operators.gideon_test_goldenandgideon_test_propertiesare the only ones that killscale-fv-d6-ur2: the sixth-derivative upwind kernels have no ADAM counterpart (audit C), the exactness test runs atwhere a wrong power of the step is invisible, and in R8P the kernel has no plateau (A1): a kernel that does not converge is reported unresolved, not failed (the mutant's error stays near its target while the floor rises past it: one resolved step, no plateau). The mutation run uses the R8P build; the R16P order test, rebuilt with this mutant by hand, fails on it (observed order 0, design 2). - The mutant
dispatch-wrong-kernel(a d2 kernel in a d1 dispatcher's case) is caught by the dispatch test and by the comparison with ADAM, whose run-time-order operators the test calls through the dispatchers. - One mutant of roadmap #2's first draft was equivalent and was replaced: dropping the guard before a solver's read of a coefficient outside the line (
if (i < n-1) u2(i) = f(i)/bp) changes only factor entries that back substitution never uses, so no result can change and no test of results can kill it. The guard keeps a corner of the band from being read at all; its replacement,penta-resolve-pivot, mutates the factor's reuse for the border columns. - The P2 mutants are killed by the new programs.
gideon_test_solversalone kills the periodic-column and the two masked mutants: the compact operators' tests use the constant-band solvers, and the coupling test's masked band is tridiagonal with a unit diagonal, on whichmerge(1, b, mask)equalsband the pentadiagonal mutant is absent. Every compact mutant is killed bygideon_test_linesand its golden test, the biased ones also by the coupling test. - The factored solves' mutants are killed by
gideon_test_solversalone: the compact operators' tests use_const(the benchmark uses the factored solves, but it is not a test). gideon_vv_advectionkills no mutant on its own: it is a demonstration with frozen physical bounds, and every defect it would see is already caught by the contracts.