Skip to content

Verification ​

Every capability of GIDEON is backed by a verification case: a Fortran program in src/tests/ that runs the compiled kernels and asserts the result against something it shares no code with: the monomials a row must be exact on, a smooth function and its exact derivatives, a mirror or symmetry identity, ADAM's own code compiled verbatim, the host for the device. The generator adds a case of its own (C1): it checks the rows before any Fortran exists. The programs are the test suite (bash scripts/run_tests.sh), and with GIDEON_REPORT_DIR set they also write the data from which these pages are drawn (scripts/run_report.sh). Every table and figure of this section is generated from that data: rerun the script after any change of the generator or the kernels.

Each page has the same sections: case and scope, models and numerics with links to the code, the program and how to run it, results, findings. The tag of a card says what kind of check it is:

  • contract: an identity that must hold exactly or within a stated tolerance: rows by their meaning, exactness, mirrors and symmetries, dispatch, equivalence with ADAM, host and device;
  • accuracy: an order of accuracy, a convergence rate, a spectral property.
A wave packet advected over two periods, 128 cells, by GIDEON's compiled first derivatives: the centred kernels disperse (c2 lags behind the exact packet, c4 nearly keeps up), the upwind one dissipates. Case A3.

What a user of the kernels should know ​

The findings that change how the kernels are used, each documented on its page:

  • The orders of every kernel are observed in quadruple precision only. In double precision the round-off floor hides the asymptotic range of the wide stencils; the R16P build resolves all of them (A1). The generator measures the rows themselves at 100 digits (C1).
  • Only the one- and two-cell upwind first derivatives are stable advection operators on their own. From three cells on, every fully one-sided first derivative amplifies a band of wavenumbers of a wave moving towards it (A3). The wider rows are exact and kept as building blocks.
  • A centred row does not dissipate. The pair form makes the imaginary part of the modified wavenumber zero to round-off, in the compiled kernels as in the rows (A3); a centred scheme needs its dissipation from elsewhere.
  • The FV centred cell-average derivatives have the rows of the FD node derivatives of the same window, exactly: the averaging factor of a Fourier mode cancels. The kernels differ in arithmetic (a flux difference, a pair form), not in the operator (C1).
  • ADAM's left-side upwind face value and first derivative are wrong for two or more cells, and ADAM's upwind names flip between the first derivative and the others; GIDEON fixes both and is bitwise equal to ADAM wherever ADAM is right (C5).
  • A run-time order costs a select case per call, and an order without a kernel returns a NaN, never a number (C4).
  • An upwind-biased face value is the centred one plus one face difference, exactly: a sensor can dial the dissipation between the two. The one-sided values do not split this way (C7).
  • The compact operators reach their orders on periodic lines, the centred ones without dissipation, the biased ones dissipative on their upwind side; the line solves are bitwise equal on the device (A4, C8).
  • Rows replaced by given values keep the compact order away from them: the band's inverse decays geometrically (A5).

Contracts ​

What must hold exactly, or bit for bit: the rows, their compiled values, their identities, the dispatch, ADAM's values, the device.

Accuracy ​

The design order of every kernel and every 3-D operator, and how the operators treat each Fourier mode.

Regression ​

The values themselves, pinned by golden files, the suite's power to catch planted defects, and the CI that runs it all: Regression.

Running it ​

bash
fobis build --mode tests-gnu && bash scripts/run_tests.sh   # the suite, double precision
fobis build --mode tests-gnu-r16 && bash scripts/run_tests.sh --exe-dir exe-r16   # the orders, quadruple precision
scripts/run_report.sh [--gpu]                                 # every build, the data, tables, figures, casts
python3 scripts/gen_gideon.py --check                         # C1: the rows, before any Fortran

The programs and the page of each:

ProgramPageBuilds
scripts/gen_gideon.py --checkC1 Rows by their meaningPython 3, exact rationals
gideon_test_tablesC2 Exactness and leading errorevery
gideon_test_propertiesC3 Mirrors and symmetriesevery
gideon_test_dispatchC4 Run-time dispatchevery
gideon_test_adamC5 Equivalence with ADAMR8P only
gideon_test_deviceC6 Host and deviceevery (on the device with OpenACC)
gideon_test_orderA1 Orders of accuracyevery
gideon_test_operators_3dA2 3-D operatorsevery
gideon_test_spectral, gideon_vv_advectionA3 Spectral propertiesevery
scripts/gen_gideon.py --check, gideon_test_splitC7 The upwind–central splitPython 3; every
gideon_test_solversC8 The line solversevery (on the device with OpenACC)
gideon_test_linesA4 Compact operatorsevery (on the device with OpenACC)
gideon_test_couplingA5 Compact-WENO couplingevery (on the device with OpenACC)
gideon_test_goldenGolden valuesevery (one golden file per kind)
gideon_test_lines_goldenGolden valuesevery (the compact operators)
gideon_test_kindsthe kinds reach a client through use gideonevery

From the data to the pages ​

No number of this section is typed. scripts/run_report.sh builds the test programs (R8P, R16P, R4P, and with --gpu the OpenACC build), runs each with GIDEON_REPORT_DIR set so that it writes its data (CSV files, the frames of the advection), keeps every output, and then draws the pages from them with the scripts of docs/scripts:

ScriptReadsWrites
make_tables.pythe generator's JSON, the test outputs and CSV files, the golden files, the recorded mutation run (notes/mutation-run-*.txt), the benchmark data (notes/bench-data)docs/verification/_tables, docs/regression/_tables
make_figures.pythe sameevery figure of docs/public/guide, docs/public/verification, docs/public/regression, light and dark
make_animations.pythe frames of gideon_vv_advectiondocs/public/verification/casts: WebM, MP4 and a poster per theme (needs ffmpeg)
make_cookbook_tables.pysrc/lib/*.F90 only (--check: exit 1 when a table is stale)the tables of the cookbook and of the API overview (docs/ford.md)

The figures share two modules: figure_theme.py, the light (washi) and dark (smoked bronze) styles, SETH's and ADAM's copy with GIDEON's dark tokens (its identity), which draws every figure a second time as <name>-dark.png for the dark theme; and gideon_palette.py, the grounds and the colours of the data. The Python needs numpy and matplotlib (GIDEON_DOCS_PYTHON, else exe/.docs-venv/bin/python, else python3).

What the pages say about the code is checked too: scripts/check_docs.py fails when a public entity, a module, a test program, an example, a fobos mode, a script or a figure is named on no page, when a page names a gideon_* procedure or an ADAM routine that does not exist, or when an image, a link, an include or a snippet does not resolve. The code of the tutorials and the cookbook is compiled and run by scripts/run_examples.sh, each output compared with the one the page shows.

Released under your choice of GPL-3.0-or-later, BSD-2-Clause, BSD-3-Clause or MIT.