C3 Mirrors and symmetries
| ID | Group | Type | Backends | Figure | Program |
|---|---|---|---|---|---|
| C3 | Contracts | C | CPU (gfortran R4P, R8P, R16P; nvfortran); the CI matrix | no | gideon_test_properties |
Case and scope
Exactness (C2) checks each kernel on polynomials. This case checks identities between kernels and invariances of each kernel on random data, bitwise: they hold in floating point because of how the kernels are written, and a change of the arithmetic (an operand order, a sign, a step) breaks them before it changes an order. The mirror identity is the rule that keeps ADAM's audit item A from recurring: a left-side kernel reads the right-side row backwards, and no left row is stored.
Models and numerics
| Item | Choice | Code |
|---|---|---|
| Data | 20 trials of uniform random numbers in | gideon_test_properties.F90 |
| Mirror | ||
| Symmetry | a centred kernel on data of the parity that makes its result odd returns exactly 0: the pair form | |
| Scaling | ||
| Constant data | a derivative in pair or flux-difference form returns exactly 0; a value returns the constant within 64 ε Σ|c| | |
| Registry | which kernel mirrors which (kmirror), which return 0 on a constant (kzero_const), all generated | gideon_test_registry.F90 |
Program
bash
./exe/gideon_test_propertiesResults
| Property | Kernels | Trials | Comparison |
|---|---|---|---|
| left side = | 103 | 20 | bitwise |
| centred kernel on data of the odd symmetry returns 0 | 126 | 20 | bitwise |
| 332 | 20 | bitwise | |
| constant data: 0 for a derivative (pair or flux-difference form), the constant otherwise | 250 derivatives, 82 values | 1 | bitwise (derivatives), 64 eps Σ|c| (values) |
| Build | Kernels (properties) | Failures | Kernels (dispatch) | Failures |
|---|---|---|---|---|
| gfortran, R4P | 332 | 0 | 332 | 0 |
| gfortran, R8P | 332 | 0 | 332 | 0 |
| gfortran, R16P | 332 | 0 | 332 | 0 |
| nvfortran -acc, R8P | 332 | 0 | 332 | 0 |
The dispatch columns are the run-time dispatchers of C4, run on the same builds.
Findings
- Every identity holds bitwise in every kind and with both compilers, on the GPU build's host side too: the mirror is in the arithmetic, not only in the rows.
- The bitwise mirror needs the left-side kernel to add the same products in the same order as its right twin. The generator emits both from one template, so a hand edit of one side breaks C3 at once (the mutants
mirror-fv-face-ul3,mirror-sign-fv-face-d1-ul2,mirror-fd-face-ul3andmirror-fd-face-bl5of Mutation testing). The FD one-sided and biased face values of phase 2 follow the same rule: 13 more pairs. - The properties do not test accuracy: a kernel with a wrong but symmetric row passes C3 and fails C2 and A1.