{"id":"t1-wander-gate","title":"T1 — The Convention-Wander Gate","subtitle":"Gate semantics for cross-engine barrier comparisons: |barrier_A − barrier_B| ≤ offset wander, so wander above the 40 meV gate downgrades a VASP-referenced verdict to convention-contaminated.","category":"references","tags":["t1","wander","gate","cross-engine","theorem-commons"],"source":"articles/docs/analysis/t1-wander-gate.md","lang":"en","words":1090,"readMinutes":5,"toc":[{"depth":2,"text":"1. Measured evidence — one failure, one win, same wander","id":"1-measured-evidence-one-failure-one-win-same-wander"},{"depth":2,"text":"2. Why the wander, not the mean","id":"2-why-the-wander-not-the-mean"},{"depth":2,"text":"3. Gate semantics","id":"3-gate-semantics"},{"depth":2,"text":"4. Why this is the theorem-commons loop working","id":"4-why-this-is-the-theorem-commons-loop-working"},{"depth":2,"text":"5. Future work — Lean formalization sketch","id":"5-future-work-lean-formalization-sketch"},{"depth":2,"text":"Reproduce","id":"reproduce"}],"html":"<h1 id=\"t1-the-convention-wander-gate\">T1 — The Convention-Wander Gate</h1><p><strong>Theorem line:</strong> T1 (first theorem contributed from our own campaign failure) ·\n<strong>Script:</strong> <code>tools/analysis/t1_wander.py</code> (stdlib-only) · <strong>Tests:</strong> <code>tools/analysis/test_t1_wander.py</code> ·\n<strong>Wired into:</strong> <code>gcp/sparse-dft-pilot/union_pilot.py</code> assembly (<code>per_path[].t1_gate</code>, <code>t1_summary</code>) ·\n<strong>Amendment:</strong> <code>docs/plans/2026-07-21-sparse-dft-pilot-amendment-01.md</code> (§A1) · <strong>Recorded:</strong> 2026-07-21</p>\n<p>Per evaluated image of a NEB path, the cross-engine offset is\n<code>offset(image) = E_GPAW(image) − E_VASP(image)</code>. <strong>T1 reports the offset mean\nand the offset wander (max − min) per path, and gates on the wander.</strong></p>\n<h2 id=\"1-measured-evidence-one-failure-one-win-same-wander\">1. Measured evidence — one failure, one win, same wander</h2><div class=\"table-wrap\"><table><thead><tr>\n<th>Path</th>\n<th>Anchors</th>\n<th>Offset wander</th>\n<th>Cross-engine barrier error</th>\n<th>Verdict vs ≤40 meV gate</th>\n</tr>\n</thead><tbody><tr>\n<td data-label=\"Path\">path-7, <code>mp-770939_10_1_1_0_1</code></td>\n<td data-label=\"Anchors\">4 (images 0,1,2,4)</td>\n<td data-label=\"Offset wander\"><strong>139.4 meV</strong></td>\n<td data-label=\"Cross-engine barrier error\"><strong>118.8 meV</strong></td>\n<td data-label=\"Verdict vs ≤40 meV gate\">FAIL</td>\n</tr>\n<tr>\n<td data-label=\"Path\">smoke path, <code>mp-760344</code></td>\n<td data-label=\"Anchors\">chgnet-guided set</td>\n<td data-label=\"Offset wander\"><strong>~122 meV</strong></td>\n<td data-label=\"Cross-engine barrier error\"><strong>32.2 meV</strong></td>\n<td data-label=\"Verdict vs ≤40 meV gate\">WIN</td>\n</tr>\n</tbody></table></div><p>Path-7 numbers are reproduced by the gate from the receipt\n(<code>/tmp/z1-sparse-local/chgnet/path-7.json</code>, imported as union checkpoints\n<code>lupine.z1.union_pilot.anchor.v1</code>): per-image offsets −14756.1, −14698.1,\n−14616.8, −14666.2 meV → wander <strong>139.3758 meV</strong>, mean −14684.3 meV, driven by\nthe image pair <strong>(0, 2)</strong>. The smoke-path figures are the recorded trigger\nevidence of amendment 01 (its anchor receipts predate the union checkpoint\nlayout; only <code>/tmp/gpaw-pilot/run.py</code> survives).</p>\n<p>The two rows are the whole argument: <strong>two paths, two opposite verdicts, the\nsame wander magnitude.</strong> Under a single VASP-referenced basis, the pilot&#39;s\nverdict measures where the engine-convention wander happens to land, not\nprotocol quality. Wander is <em>necessary but not sufficient</em> for a cross-engine\nfailure — the smoke path won because its wander landed off the\nbarrier-defining images. That is exactly why T1 is a <strong>gate with a\ncontamination flag, not a hard refusal</strong>.</p>\n<h2 id=\"2-why-the-wander-not-the-mean\">2. Why the wander, not the mean</h2><p>A barrier is an energy <em>difference between different structures</em>:\n<code>barrier = max_i E(i) − min_i E(i)</code>. A constant offset — however large —\ncancels in every difference; the −14.7 eV mean above is barrier-irrelevant.\nOnly <em>variation</em> of the offset across images injects into the comparison, and\nthe worst-case injection over a path is bounded by the wander:</p>\n<pre><code>|barrier_GPAW − barrier_VASP| ≤ wander = max offset − min offset\n</code></pre>\n<p>(proof sketch in §5). With measured wander ~3× the 40 meV verdict gate, every\ncross-engine verdict on these paths was one unlucky landing away from\nflipping. Amendment 01 therefore splits the basis (same-engine primary,\nVASP-referenced secondary) and promotes T1 to its own experiment.</p>\n<h2 id=\"3-gate-semantics\">3. Gate semantics</h2><p>Default threshold is the frozen verdict gate, 40 meV\n(<code>WIN_THRESHOLD_MEV</code> in <code>gcp/mlip-cell-runner/z1_sparse_dft.py</code>).</p>\n<ul>\n<li><code>wander ≤ 40 meV</code> → <strong>clean</strong>: the path&#39;s cross-engine numbers may be\nquoted at face value (they remain secondary to the same-engine basis).</li>\n<li><code>wander &gt; 40 meV</code> → <strong>contaminated</strong>: the path&#39;s cross-engine\n(VASP-referenced) verdict is downgraded to <strong>&quot;convention-contaminated&quot;</strong> —\nit measures engine-convention luck, and the same-engine basis of amendment\nA1 is the <em>only</em> trustworthy score for that path. Path-7&#39;s 118.8 meV FAIL\nstays in the record under exactly this label: a T1 datapoint, not a\nprotocol verdict.</li>\n<li>Fewer than two evaluated images → <strong>insufficient_data</strong>: a one-point wander\ncarries no information; the gate abstains rather than declaring &quot;clean&quot;.</li>\n</ul>\n<p>The gate also reports the <strong>driver pair</strong> — the (min-offset, max-offset)\nimage pair whose difference <em>is</em> the wander — so a contaminated path names\nits own contaminated span (path-7: images 0↔2, which are also the\nbarrier-defining extrema of its sparse profile; the contamination sits\ndirectly on the barrier). Per-image drift vs a least-squares linear trend in\nimage index, and a Spearman rank monotonicity, are reported alongside as\ndiagnostics (path-7: slope ≈ +22.1 meV/image, ρ = 0.8 — the offset shallows\noverall along the reaction coordinate).</p>\n<p>In <code>campaign.json</code> (<code>lupine.z1.union_pilot.campaign.v1</code>, additive fields\nonly): <code>per_path[].t1_gate = {wander_mev, verdict, driver_pair}</code>,\n<code>t1_summary.paths_contaminated</code> / <code>contaminated_path_indices</code>, and\n<code>thresholds.t1_gate_mev</code>. The gate is wired into <code>union_pilot.py</code> assembly as\na <strong>reported line item</strong> — it downgrades interpretation, never refuses a path.</p>\n<h2 id=\"4-why-this-is-the-theorem-commons-loop-working\">4. Why this is the theorem-commons loop working</h2><p>T1 is the first theorem contributed from our <em>own</em> campaign failure. The loop\nran: a frozen preregistration produced a FAIL → the per-anchor receipts\nlocalized the cause to a <em>protocol-external</em> quantity (engine-convention\nwander) → an amendment split the basis so each verdict measures one thing →\nthe localized cause became a <strong>reusable gate that anyone comparing barriers\nacross engines can apply to their own receipts</strong>, before quoting a\ncross-engine number. The failure is now load-bearing: it defines the\nhypothesis (<code>wander ≤ ε</code>) under which cross-engine barrier comparisons are\ntrustworthy at tolerance ε, and it ships as a stdlib-only function with the\nmeasured counterexample pair encoded in its tests. Every future path in this\npilot — and any external GPAW↔VASP, or generally engine-A↔engine-B, barrier\ncomparison — gets flagged by the same gate instead of rediscovering the\ncontamination as a spurious verdict.</p>\n<h2 id=\"5-future-work-lean-formalization-sketch\">5. Future work — Lean formalization sketch</h2><p>The gate is the decidable hypothesis check of an elementary transfer theorem.\nState <code>barrier f s = s.max&#39; f − s.min&#39; f</code> over a nonempty <code>Finset ι</code>; the\noffset <code>o : ι → ℝ</code> is the cross-engine convention difference. Then:</p>\n<pre><code class=\"language-lean\">theorem barrier_transfer_of_bounded_offset_wander\n    {ι : Type*} (s : Finset ι) (hs : s.Nonempty)\n    (E o : ι → ℝ) {ε : ℝ}\n    (h : ∀ x ∈ s, ∀ y ∈ s, |o x - o y| ≤ ε) :\n    |barrier (fun i =&gt; E i + o i) s - barrier E s| ≤ ε := ...\n</code></pre>\n<p>Proof idea (two inequalities, both one-liners from <code>Finset.le_max&#39;</code> /\n<code>Finset.min&#39;_le</code>): with <code>x*</code>/<code>x⁻</code> the extrema of <code>E + o</code>,\n<code>barrier (E+o) − barrier E ≤ o x* − o x⁻ ≤ ε</code>, because\n<code>barrier E ≥ E x* − E x⁻</code>; with <code>y*</code>/<code>y⁻</code> the extrema of <code>E</code>,\n<code>barrier E − barrier (E+o) ≤ o y⁻ − o y* ≤ ε</code>. No library changes are needed\nfor the statement; the hypothesis is decidable on receipts because\n<code>max_{x,y} |o x − o y| = max o − min o = wander</code>, i.e. <strong>the gate IS the\nhypothesis evaluated on data</strong>, with <code>ε</code> the verdict gate. Two honest\nboundary notes for the formalization: the converse is false (bounded wander\nis sufficient, not necessary — the smoke path&#39;s 32.2 meV win under 122 meV\nwander is the counterexample, since only the offset difference between the\n<em>barrier-defining</em> pair enters the error), and a refined theorem bounding the\nerror by <code>|o(argmax) − o(argmin)|</code> alone would formalize that observation at\nthe cost of needing the extrema identified — which the sparse protocol is\nitself trying to estimate. The wander form is the version checkable <em>before</em>\ntrusting any verdict.</p>\n<h2 id=\"reproduce\">Reproduce</h2><pre><code class=\"language-bash\"># unit + real-receipt tests (receipt-cross-checks skip if /tmp files absent)\npython3 -m pytest tools/analysis/test_t1_wander.py -q\npython3 -m pytest gcp/sparse-dft-pilot/test_union_pilot.py -q\n\n# gate on the real path-7 anchor pool (offline assembly; no GPAW)\npython3 gcp/sparse-dft-pilot/union_pilot.py \\\n    --workdir /tmp/z1-union-local --local /tmp/z1-union-local/inputs \\\n    --paths 7 --assemble-only --no-import --out /tmp/campaign.json\n# -&gt; path-7: wander=139.4 meV, t1_gate=contaminated, driver_pair=[0, 2]\n</code></pre>\n"}