Validation and tolerances
Every algorithm is compared with Crystal-Builder or sci-form golden data. The tolerances below are the initial contract; a test that needs a wider tolerance must record the reason in the algorithm page.
| Feature | Comparison | Tolerance | Phase |
|---|---|---|---|
| Element reference data | exact | 0 (copied from Crystal-Builder) | 1 |
| Cell parameters | absolute | 1e-6 Angstrom / 1e-6 degree | 1 |
| Cell volume | relative | 1e-9 | 1 |
| Fractional coordinates | absolute | 1e-6 | 1 |
| Atom sets | up to translation and permutation | 1e-6 fractional | 1 |
| Bond length | absolute | 1e-4 Angstrom | 1 |
| Bond order | absolute | 1e-3 | 1 |
| Bond set | canonical (i, j, image) after P1 atom mapping | exact | 1 |
| Bond length (full corpus) | absolute | 0.05 Angstrom (inherits the P1 mapping tolerance) | 1 |
| Coordination numbers | exact | 0 | 1 |
| P1 atom mapping (golden) | absolute periodic distance | 0.05 Angstrom (symmetry-standardized sites) | 1 |
| Ring size/count | exact | 0 | 1 |
| Minimum-image distance | absolute | 1e-9 Angstrom | 1 |
| CIF cell parameters | absolute | 1e-6 Angstrom / degree | 1 |
| CIF atom count | exact | 0 | 1 |
| POSCAR/XYZ round trip | absolute | 1e-9 Angstrom | 1 |
| Neighbor distance | absolute | 1e-9 Angstrom | 1 |
| Slab atoms per layer | exact | 0 | 1 |
| Ring paths | atom indices and images | exact after atom mapping, translation home and direction | 1 |
| Ring budget | too-dense refusal | exact parity with the golden error | 1 |
| Functional groups | atom sets | exact after atom mapping | 1 |
| Space group number / Hall number | exact | exact | 2 |
| Wyckoff letters | exact | exact | 2 |
| Standardized cell | absolute | 1e-5 Angstrom / 1e-4 degree | 2 |
| K-path | points and labels | 1e-6 fractional | 2 |
| PXRD positions | absolute | 0.01 degree 2-theta | 5 |
| PXRD intensities | absolute after normalization | 1e-3 | 5 |
| UFF energy | absolute | 1e-6 eV per atom | 4 |
| UFF forces | absolute | 1e-4 eV/Angstrom | 4 |
| UFF stress | absolute | 1e-3 GPa | 4 |
| Phonon q frequencies | absolute | 0.5 cm^-1 (phonopy spring golden) | 4 |
| Indexing figures of merit | relative to the Python reference | 1e-4 | 7 |
| Indexed lattice (golden) | Q-spectrum agreement | 5e-4 relative | 7 |
| Peak fit centre | absolute | 2e-3 degree (synthetic Gaussian) | 7 |
| Pawley cell | absolute | 2e-3 Angstrom (golden pattern) | 7 |
| Pawley zero shift | absolute | 5e-3 degree (golden pattern) | 7 |
| Pawley intensity | absolute | 3 esds | 7 |
| Pawley Rwp / chi^2 | absolute | 0.02 (golden pattern) | 7 |
| Le Bail intensity | four esds | 90% of a noisy synthetic pattern | 7 |
| Rietveld position | absolute | 3e-3 fractional (rutile golden) | 7 |
| Rietveld cell | absolute | 2e-3 Angstrom (rutile golden) | 7 |
| Rietveld zero shift | absolute | 0.02 degree (rutile golden) | 7 |
| Rietveld Rwp | absolute | 0.25 (rutile golden, single-Gaussian model) | 7 |
| Space-group screen | exact | rutile P4_2/mnm among the candidates; 001 removes it | 7 |
| Space-group screen | exact | diamond Fd-3m among the candidates; 200 removes it | 7 |
| Extinction class | ranking | rutile P4_2/mnm is the first golden row | 7 |
| EQeq charges | absolute | 1e-3 e against the authors' program on MOF-5 | 4 |
| UFF energy | absolute | 1e-4 kcal/mol against sci-form on methane and water | 4 |
| Charges | absolute | 1e-6 e | 4 |
| Porosity | absolute | 0.01 Angstrom / 0.1 percent | 5 |
| Topology | canonical graph | exact | 5 |
| SMILES round trip | graph and charges | exact after atom mapping | 6 |
| Embedding bond length | absolute | 0.3 Angstrom for ring closure | 6 |
| MOF assembly | atom count and finite coordinates | exact/deterministic | 6 |
| Powder position | absolute | 0.1 degree 2-theta | 7 |
| Rietveld scale/background | relative | 1e-3 | 7 |
| Structural refinement | Rwp | non-increasing over accepted steps | 7 |
| Instrument doublet | ratio | 1e-9 | 7 |
Rules
- The comparison helpers live in
xtalforge-testkit(Task 0.9.4). - Golden files are generated by
scripts/golden/and never by CI. - The independent end-to-end battery (
tests/e2e/,scripts/e2e.sh) compares the WASM surface with gemmi, spglib, ASE and NumPy references and with committed 3D screenshots; its scope, findings and known gaps are in the audit page. - A deliberate deviation from Crystal-Builder is recorded in the algorithm page with the reason and the affected structures.
- Tightening a tolerance is a normal change; widening one requires a note in the changelog and in the algorithm page.