Skip to content

Golden values ​

IDGroupTypeBackendsFigureProgram
R1RegressionCCPU (gfortran R4P, R8P, R16P; nvfortran); the CI matrixnogideon_test_golden, gideon_test_lines_golden

Case and scope ​

The verification cases assert exactness, orders and identities. A change of a few ulp, or an error that grows inside a bound, passes them. The golden test pins the values themselves: every kernel of the registry on fixed windows, compared with a file written once by a reference build.

Setup ​

ItemValue
Kernelsevery kernel of the registry (apply)
Windows8 windows of 33 values, made by an integer linear congruential generator: multiples of 2−10 in [−32,32), exact in every kind and with every compiler (no libm, no random_number); Δs=0.75, a dyadic step
Comparison|r−g|≤TOL⋅∑k|ck|max|q|/Δsn, TOL per kind (below): other compilers and flags contract multiply-adds differently from the writer
Reportedthe values bitwise equal to the file, the worst difference relative to the magnitude
Filessrc/tests/golden/, chosen by the build's kind: gideon_golden_v3.txt (R8P), gideon_golden_r4_v3.txt (R4P), gideon_golden_r16_v3.txt (R16P); each starts with the compiler and options that wrote it
Compact operatorsgideon_test_lines_golden: every compact operator's right side on 8 windows of the same generator, and one periodic line of 16 values solved with its band (a filter's αf=0.45); the tolerance of a solved value times the band's amplification F (A4); gideon_golden_lines_v1.txt, _r4_v1, _r16_v1

332 kernels × 8 windows = 2656 values per file.

FileKindValuesWritten byTolerance (of the magnitude)Read by
gideon_golden_lines_r16_v1.txtR16P696GCC version 16.2.0, -O31⋅10−30gideon_test_lines_golden
gideon_golden_lines_r4_v1.txtR4P696GCC version 16.2.0, -O31⋅10−5gideon_test_lines_golden
gideon_golden_lines_v1.txtR8P696GCC version 16.2.0, -O31⋅10−13gideon_test_lines_golden
gideon_golden_r16_v1.txtR16P1944GCC version 16.2.0, -O31⋅10−30no (kept)
gideon_golden_r16_v2.txtR16P2304GCC version 16.2.0, -O31⋅10−30no (kept)
gideon_golden_r16_v3.txtR16P2656GCC version 16.2.0, -O31⋅10−30gideon_test_golden
gideon_golden_r4_v1.txtR4P1944GCC version 16.2.0, -O31⋅10−5no (kept)
gideon_golden_r4_v2.txtR4P2304GCC version 16.2.0, -O31⋅10−5no (kept)
gideon_golden_r4_v3.txtR4P2656GCC version 16.2.0, -O31⋅10−5gideon_test_golden
gideon_golden_v1.txtR8P1944GCC version 16.2.0, -O31⋅10−13no (kept)
gideon_golden_v2.txtR8P2304GCC version 16.2.0, -O31⋅10−13no (kept)
gideon_golden_v3.txtR8P2656GCC version 16.2.0, -O31⋅10−13gideon_test_golden

A new version ​

A golden file is never edited. A deliberate change of results (a new kernel, a changed row) gets a new file, written by the test itself, and the test's default path moves to it:

bash
./exe/gideon_test_golden write src/tests/golden/gideon_golden_v4.txt   # refuses to overwrite an existing file

The writer opens the file with status='new': an existing file stops it with an error, so a committed version cannot be replaced by accident. The new file is reviewed like code: for the kernels already in the previous version, its lines must equal the previous ones character for character when written by the same build, and the new lines are the values of the new kernels.

v1 holds the first release's 243 kernels. v2 (phase 2) adds the FD face derivatives and the one-sided and biased FD face values, 288 kernels; written by the same three builds and options as v1, its first 243 kernels equal v1's line for line in all three kinds. v3 (roadmap #2) adds the face differences, the FV biased face values, the dissipation parts and the explicit filters, 332 kernels; its first 288 equal v2's line for line in all three kinds. v1 and v2 are kept. Then GOLDEN in gideon_test_golden.F90 points to the newest, for each kind. The compact operators have their own files, v1, read by gideon_test_lines_golden.

Program ​

bash
./exe/gideon_test_golden         # from the repository root (the path is relative)

Results ​

BuildValuesBitwise equalWorst difference / magnitudeFailures
gfortran, R4P26562656 (100.0 %)00
gfortran, R8P26562656 (100.0 %)00
gfortran, R16P26562656 (100.0 %)00
nvfortran -acc, R8P26562071 (78.0 %)3.2⋅10−160

The compact operators:

BuildValuesBitwiseWorst difference / magnitudeFailures
gfortran, R4P69669600
gfortran, R8P69669600
gfortran, R16P69669600
nvfortran -acc, R8P6963801.6⋅10−160

Findings ​

  • The gfortran builds that wrote the files reproduce them bitwise, in all three kinds.
  • The nvfortran OpenACC build (its host code, strict IEEE) differs from the gfortran writer in the last bits of a share of the values, within the tolerance: the reason the comparison is a tolerance and the bitwise count is reported. The CI matrix runs the test with gfortran, nvfortran and ifx on every push (Continuous integration).
  • The data are exact in binary on purpose, so that the test measures the kernels and not libm: SETH's first golden file, built with libm, differed between gfortran -O0 and -O3 before any kernel ran.

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