NaCl interplanar spacing d=2.820 Å recovered from X-ray Bragg diffraction peaks, chained to Avogadro's number (Bragg 1913)
You cannot see atoms — so how do you measure the distance between the ions in a grain of salt, and could that atomic ruler possibly weigh out a whole mole?
Forward-model the founding crystallography experiment (Bragg, 1913). Monochromatic X-rays (Cu Kα, λ=1.5406 Å) reflect off a stack of N=48 parallel atomic planes spaced d apart; the pair-of-planes path difference 2d·sinθ makes the diffracted intensity I(θ)=sin²(Nφ/2)/sin²(φ/2) (φ=2π·2d·sinθ/λ) spike only at the Bragg angles 2d·sinθ=mλ. The simulated diffractometer trace is generated on a 0.01° grid (d enters ONLY here, as the physical crystal); principal maxima are located by a threshold plus parabolic sub-grid refinement, and each peak angle θ_m is inverted via d=mλ/(2·sinθ_m) — a recovery formula that never contains d (only λ and the measured angle). The cubic cell edge a=2d then feeds N_A=Z·M/(ρ·a³) from the macroscopic NaCl density. A crystal-spacing sweep is run as a perturbation, and the transmission-grating law d·sinθ=mλ (no factor of 2) as a falsification control.
The law it recovers
2 d sin(theta) = m lambda
Measurements, controls & cross-checks
Peak angles deg
15.85
33.11
55.03
Orders found
3
Fourth order
forbidden (sin(theta) > 1)
Perturbation worst rel error
1.4100e-7
Cell edge recovered A
5.6402
Control
Name
Transmission-grating law d·sinθ=mλ (missing Bragg's factor of 2)
Recovered d A
5.6402
Ratio to bragg d
2
Note
ruled out — recovers 2d (exactly 2× the true spacing), so the pair-of-planes path difference 2d·sinθ is physical, not cosmetic
Avogadro crosscheck
Known value
6.0221e+23
Recovered value
6.0177e+23
Rel error
0.000742
Note
N_A = Z·M/(ρ·a³) with a=2d; the atomic-scale spacing measured by diffraction weighs a mole to 0.07%
Module honesty
Status
validated + honest module — every on-screen number is pinned bit-exact from a verbatim transcription of BraggModule's own deterministic degree-space scan and reconciled with the oracle's radian-space grid
Module protocol
BraggModule is fully DETERMINISTIC (no RNG; the entire recovery — 6200-point θ scan → threshold + parabolic peak refinement → d = mλ/(2·sinθ_m) → a = 2d → N_A) runs ONCE at init. The module iterates the grid in DEGREES (th += 0.01, converting per sample) while the oracle generator iterates in RADIANS (th += 0.01·π/180) — same nominal grid, different float accumulation, so the pins are an independent discretization, not a copy of the oracle path. Pinned strict-=== at full float precision (gate E): the three peak angles (15.85157728042775°, 33.11304426112735°, 55.028679249002714°), d_rec = 2.8201000929936093 Å, a_rec = 5.640200185987219 Å, N_A = 6.0176751859270905e23, and the grating-law value 5.640200185987219 Å — which equals the cell edge BIT-FOR-BIT: each per-order grating inversion mλ/sinθ is exactly 2× the Bragg inversion because power-of-2 scaling commutes with float rounding, so the on-screen '2× wrong' is exact in floats, not approximate.
Hud vs oracle
Module-grid vs oracle-grid recovered d differ by 1.17e-13 relative (worst peak 8.8e-12°), gated a-priori at 1e-11/1e-9° (≥100× the measured float-accumulation gap, ~10⁶× tighter than the physics tolerance) — the screen and the oracle are the same physics on two grids. Both share the SAME +3.3e-8 relative recovery systematic vs the exact d (grid + parabolic refinement on the sin²(Nφ/2)/sin²(φ/2) lineshape) — disclosed, five orders below the 1% gate. The HUD's 'within 0.07%' CODATA claim is pinned as a string ('0.07' === the module value's toFixed(2)), consistent with the oracle's 7.42e-4.
Hud replica
All 11 static HUD strings rebuilt exactly as render() builds them and pinned verbatim (gate F): header, the λ/N line, both separator rules, 'peaks θ = 15.85, 33.11, 55.03°', 'd = mλ/(2·sinθ) = 2.8201 Å (NaCl 2.820 Å)', 'cell edge a = 2d = 5.6402 Å', 'N_A = Z·M/(ρ·a³) = 6.018e+23 /mol', ' CODATA 6.022e+23 → within 0.07%', 'grating law (no ×2) would give 5.64 Å — 2× wrong', and the chart status prefix 'd 2.820 Å'. The one animated line (θ sweeps 6→68° on a 15 s triangle wave) is gated by format regex + range.
Live readback
Live headless read-back of the BUILT worktree (npx vite preview + playwright-core, channel chrome): 5/5 samples of #phs-bragg.textContent had all 10 static lines byte-identical to the pins, the animated line matched the pinned regex with θ in range every time — and sample 4 caught the live m=3 BRAGG-PEAK flare at θ = 55.2° (pinned peak 55.03°) — plus the chart status string matching its pin.
Reference integrity
known_value is bound into the generator inputs (gate H): known_value === inputs.d_true_A strict, inputs.a_true_A === 2·known_value strict (exact in floats), avogadro known === CODATA-2018 exactly. The disclosed circularity — the simulated crystal IS the known spacing — is defused because the recovery formula never contains d and the grating rival fed the SAME peaks lands on exactly 2d. Tamper self-test exits 1 both ways: a known_value edit trips 3 gates (A, E, H) with the recovered value unchanged; a >1-ulp edit of the d_rec pin trips gate E. (A last-decimal-digit pin edit was verified to parse to the SAME double — decimal granularity, not a gate defect.)
What it reduces to
Bragg's law 2d·sinθ=mλ (W. H. & W. L. Bragg, 1913; Nobel Prize 1915), the founding result of X-ray crystallography. Validates a textbook result: the NaCl (200) interplanar spacing d=2.820 Å is recovered to ~1e-8 purely from the three peak angles, tracks the input crystal spacing across d∈[2.0,4.0] Å, and the transmission-grating law (no factor of 2) is falsified because it recovers exactly 2d. The recovered cell edge a=2d=5.6402 Å reproduces Avogadro's number to 0.07% — the macroscopic-to-atomic bridge. Distinct from ?world=debroglie's electron diffraction (Davisson–Germer, surface d·sinθ=λ, which recovers the electron wavelength): Bragg reflects X-rays off 3-D volume planes to recover the lattice geometry itself. It does NOT derive the atomic spacing from a deeper theory; it assumes coherent scattering off periodic planes and shows the emergent, measurable peak angles recover the real rock-salt lattice while the factor-of-2-free alternative cannot. The lab's first crystallography world.
Confidence & reproduction
Confidence
high
Validation
derisk-pass
Re-run the check
npm run derisk -- bragg (scripts/bragg-derisk.mjs)
Oracle
scripts/oracles/bragg.reference.json
Sources
W. H. Bragg & W. L. Bragg, Proc. R. Soc. Lond. A 88, 428 (1913); NaCl a=5.6402 Å, d(200)=a/2=2.8201 Å (Kittel, Introduction to Solid State Physics, 8th ed.); ρ=2.165 g/cm³, M=58.44 g/mol, Z=4; CODATA-2018 N_A=6.02214076e23 /mol.
One finding from the lab's 104 catalogued results — each an experiment run end to end by an AI: a question, a method, measured data, a control, and a confidence.