← Index
Source
Data provenance
ex-2.1.8
·
87755d7
· run 2026-08-04
via reports/m2/ex-2.1.8/arrays, reports/m2/ex-2.1.8/metrics
ex-2.1.9
·
aa30757-dirty
(dirty) · run 2026-08-06
via reports/m2/ex-2.1.9/arrays, reports/m2/ex-2.1.9/metrics
import%20marimo%0A%0A__generated_with%20%3D%20%220.23.16%22%0Aapp%20%3D%20marimo.App(%0A%20%20%20%20width%3D%22medium%22%2C%0A%20%20%20%20app_title%3D%22Ex%202.1.9%3A%20Softmin%20sequence%20pooling%22%2C%0A%20%20%20%20css_file%3D%22..%2F..%2Freport.css%22%2C%0A%20%20%20%20auto_download%3D%5B%22html%22%5D%2C%0A)%0A%0Awith%20app.setup(hide_code%3DTrue)%3A%0A%20%20%20%20import%20json%0A%20%20%20%20import%20tempfile%0A%20%20%20%20from%20pathlib%20import%20Path%0A%20%20%20%20from%20typing%20import%20cast%0A%0A%20%20%20%20import%20marimo%20as%20mo%0A%20%20%20%20import%20matplotlib.pyplot%20as%20plt%0A%20%20%20%20import%20numpy%20as%20np%0A%0A%20%20%20%20%23%20Marimo%20puts%20the%20notebook%20directory%20on%20sys.path%2C%20so%20the%20design%20constants%20come%0A%20%20%20%20%23%20from%20the%20experiment%20module%20rather%20than%20a%20copy%20of%20them%20in%20the%20prose.%0A%20%20%20%20import%20experiment%20as%20ex%0A%20%20%20%20from%20mini.reports%20import%20report_bundle%2C%20use_publisher%0A%20%20%20%20from%20mini.store%20import%20project_store%0A%20%20%20%20from%20mini.vis%20import%20AxesGrid%2C%20figure_html%2C%20light_dark%2C%20themed%0A%0A%20%20%20%20use_publisher(report_bundle(__file__))%0A%0A%20%20%20%20def%20load_results()%20-%3E%20tuple%5Bdict%2C%20dict%5Bstr%2C%20np.ndarray%5D%5D%20%7C%20None%3A%0A%20%20%20%20%20%20%20%20%22%22%22Resolve%20metrics%20and%20the%20stacked%20per-run%20arrays%20from%20the%20store%2C%20or%20None%20if%20unpublished.%22%22%22%0A%20%20%20%20%20%20%20%20store%20%3D%20project_store()%0A%20%20%20%20%20%20%20%20arts%20%3D%20store.get_refs(%5Bex.METRICS_REF%2C%20ex.ARRAYS_REF%5D)%0A%20%20%20%20%20%20%20%20m_art%2C%20a_art%20%3D%20arts%5Bex.METRICS_REF%5D%2C%20arts%5Bex.ARRAYS_REF%5D%0A%20%20%20%20%20%20%20%20if%20m_art%20is%20None%20or%20a_art%20is%20None%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20None%0A%20%20%20%20%20%20%20%20with%20tempfile.TemporaryDirectory()%20as%20d%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20m_path%2C%20a_path%20%3D%20store.get_many(%5B(m_art%2C%20Path(d)%20%2F%20%22metrics.json%22)%2C%20(a_art%2C%20Path(d)%20%2F%20%22arrays.npz%22)%5D)%0A%20%20%20%20%20%20%20%20%20%20%20%20with%20np.load(a_path)%20as%20z%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20arrays%20%3D%20%7Bk%3A%20z%5Bk%5D%20for%20k%20in%20z.files%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20metrics%20%3D%20json.loads(m_path.read_text())%0A%20%20%20%20%20%20%20%20return%20metrics%2C%20arrays%0A%0A%20%20%20%20def%20load_ex218()%20-%3E%20tuple%5Bdict%2C%20dict%5Bstr%2C%20np.ndarray%5D%5D%20%7C%20None%3A%0A%20%20%20%20%20%20%20%20%22%22%22Ex-2.1.8's%20published%20results%2C%20for%20the%20%CF%84%20calibration%20and%20the%20reproduction%20targets.%22%22%22%0A%20%20%20%20%20%20%20%20store%20%3D%20project_store()%0A%20%20%20%20%20%20%20%20arts%20%3D%20store.get_refs(%5Bex.EX218_METRICS_REF%2C%20ex.EX218_ARRAYS_REF%5D)%0A%20%20%20%20%20%20%20%20m_art%2C%20a_art%20%3D%20arts%5Bex.EX218_METRICS_REF%5D%2C%20arts%5Bex.EX218_ARRAYS_REF%5D%0A%20%20%20%20%20%20%20%20if%20m_art%20is%20None%20or%20a_art%20is%20None%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20None%0A%20%20%20%20%20%20%20%20with%20tempfile.TemporaryDirectory()%20as%20d%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20m_path%2C%20a_path%20%3D%20store.get_many(%5B(m_art%2C%20Path(d)%20%2F%20%22metrics.json%22)%2C%20(a_art%2C%20Path(d)%20%2F%20%22arrays.npz%22)%5D)%0A%20%20%20%20%20%20%20%20%20%20%20%20with%20np.load(a_path)%20as%20z%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20arrays%20%3D%20%7Bk%3A%20z%5Bk%5D%20for%20k%20in%20z.files%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20metrics%20%3D%20json.loads(m_path.read_text())%0A%20%20%20%20%20%20%20%20return%20metrics%2C%20arrays%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%20Ex%202.1.9%3A%20Softmin%20pooling%20over%20sequences%0A%0A%20%20%20%20%2F%2F%2F%20tip%20%7C%0A%20%20%20%20%3C!--%20tl%3Bdr%20--%3E%0A%20%20%20%20Anchoring%20on%20op1%20alone%20worked%20best%20so%20far%2C%20but%20in%20natural%20language%20we%20won't%20know%20which%20tokens%20hold%20the%20concept.%20So%20we%20pool%20over%20sequences%20with%20a%20soft%20minimum%20(mellowmax)%20and%20let%20the%20pull%20choose%20its%20own%20position.%20At%20the%20embedding%20it%20picks%20op1%20unaided%2C%20the%20operating%20point%20stays%20healthy%2C%20and%20grading%20improves.%20It%20wins%20no%20margin%20though%2C%20and%20only%20the%20softest%20pooling%20stays%20graded%20in%20every%20run.%0A%20%20%20%20%2F%2F%2F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Findings%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(a_op1%2C%20a_span%2C%20acc%2C%20grading_r2%2C%20m_span%2C%20pi_bar%2C%20read_gain%2C%20retention)%3A%0A%20%20%20%20_P%20%3D%20ex.PRIMARY%0A%20%20%20%20_ctrl%20%3D%20acc(%22lam0%22).mean()%0A%20%20%20%20_gain%20%3D%20m_span(_P).mean()%20-%20m_span(ex.MEAN_ARM).mean()%0A%20%20%20%20_headroom%20%3D%20m_span(ex.ORACLE_ARM).mean()%20-%20m_span(ex.MEAN_ARM).mean()%0A%20%20%20%20_drop%20%3D%20a_span(ex.MEAN_ARM).mean()%20-%20a_span(_P).mean()%0A%20%20%20%20_ret%20%3D%20retention(_P)%0A%20%20%20%20assert%20_ret%20is%20not%20None%0A%20%20%20%20mo.md(rf%22%22%22%0A%20%20%20%20**H1%20(task%20cost)%20%E2%80%94%20holds.**%20The%20largest%20%60named_holdout%60%20exact-match%20gap%20from%20the%20control%20across%20all%20five%20anchored%20conditions%20is%20%7Bmax(abs(acc(c).mean()%20-%20_ctrl)%20for%20c%20in%20%5B%22span-mean%22%2C%20*ex.POOLED_NAMES%2C%20ex.ORACLE_ARM%5D)%3A.4f%7D%2C%20against%20a%20gate%20of%20%7Bex.TASK_GATE%3Ag%7D.%0A%0A%20%20%20%20**H2%20(pooling%20increases%20selectivity)%20%E2%80%94%20unmet.**%20On%20the%20primary%20condition%20(%60%7B_P%7D%60)%3A%0A%20%20%20%20(a)%20the%20margin%20gain%20over%20the%20span%20mean%20is%20%7B_gain%3A%2B.3f%7D%20against%20a%20gate%20of%20%7Bex.POOL_GAIN_GATE%3Ag%7D%20(partial%20%7Bex.POOL_GAIN_PARTIAL%3Ag%7D)%2C%20and%0A%20%20%20%20(b)%20the%20syntax-role%20drift%20falls%20by%20%7B_drop%3A.3f%7D%20against%20a%20required%20%7Bex.SYNTAX_DRIFT_GATE%3Ag%7D%20%E2%80%94%20the%20predicted%20direction%20on%20both%2C%20short%20of%20both%20gates%2C%20and%20neither%20partial%20applies.%20One%20piece%20of%20context%2C%20unpacked%20in%20the%20selectivity%20section%3A%20the%20op1%20oracle%20itself%20beats%20the%20span%20mean%20by%20only%20%7B_headroom%3A.3f%7D%20on%20%24m_%5Ctext%7B%7Bspan%7D%7D%24%20here%2C%20so%20H2(a)'s%20gate%20was%20out%20of%20reach%20for%20any%20pull%3B%20%60%7B_P%7D%60%20recovered%20%7B_gain%20%2F%20_headroom%3A.0%25%7D%20of%20the%20headroom%20that%20existed.%0A%0A%20%20%20%20**H3%20(the%20operating%20point%20survives%20pooling)%20%E2%80%94%20holds.**%20On%20%60%7B_P%7D%60%3A%20containment%20%24%5Cbar%5Calpha%24%20%3D%20%7Ba_op1(_P).mean()%3A.3f%7D%20(gate%20%E2%89%A4%20%7Bex.MEAN_ALIGN_GATE%3Ag%7D)%3B%20retention%20%7B_ret%3A.2f%7D%20(gate%20%E2%89%A5%20%7Bex.RETENTION_GATE%3Ag%7D%2C%20minimum%20across%20seeds)%3B%20and%20grading%20%24r%5E2%24%20%3D%20%7Bgrading_r2(_P)%3A.2f%7D%20against%20the%20span%20mean's%20%7Bgrading_r2(ex.MEAN_ARM)%3A.2f%7D%20%E2%80%94%20the%20gate%20tolerated%20a%20drop%20of%20%7Bex.GRADE_R2_DROP%3Ag%7D%20and%20instead%20the%20response%20got%20better%20graded.%0A%0A%20%20%20%20**H4%20(the%20weight%20lands%20where%20the%20concept%20lives)%20%E2%80%94%20holds.**%20At%20the%20embedding%20slice%20%60%7B_P%7D%60%20puts%20%7Bpi_bar(_P)%5B0%2C%200%5D%3A.2f%7D%20of%20the%20softmin%20weight%20on%20op1%20(gate%20%E2%89%A5%20%7Bex.LEAD_GATE%3Ag%7D%3B%20uniform%20is%200.25)%20%E2%80%94%20the%20only%20span%20position%20whose%20state%20can%20carry%20the%20concept%20there%20%E2%80%94%20and%20the%20weighted%20readability%20gain%20is%20%7Bread_gain(_P)%3A%2B.2f%7D%20(gate%20%E2%89%A5%20%7Bex.READ_GAIN_GATE%3Ag%7D).%20At%20depth%20the%20concentration%20is%20winner-take-all%20seed%20by%20seed%3A%20at%20the%20two%20sharper%20%CF%84%20some%20seeds%20latch%20onto%20%60%2B%60%20in%20the%20first%20few%20epochs%2C%20and%20only%20%CF%84%20%3D%200.1%20keeps%20a%20graded%20profile%20on%20op1%20in%20every%20seed%20(*Where%20the%20weight%20went*).%0A%0A%20%20%20%20So%20the%20pull%20finds%20the%20concept-bearing%20position%20without%20the%20oracle%2C%20and%20holding%20the%20operating%20point%20costs%20nothing%20%E2%80%94%20but%20finding%20it%20buys%20almost%20no%20additional%20margin%20here.%20What%20that%20means%20for%20M3's%20document-level%20labels%20is%20taken%20up%20in%20the%20*Discussion*.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%2F%2F%2F%20admonition%20%7C%20How%20to%20read%20this%20report%0A%20%20%20%20This%20report%20was%20preregistered%3A%20the%20method%2C%20hypotheses%20and%20decision%20thresholds%20were%20frozen%20before%20the%20experiment%20ran%20(commit%20%600abebb8%60%2C%20with%20pre-launch%20review%20corrections%20noted%20in%20comments).%20Results%20replaced%20the%20%60TODO%60%20placeholders%20in%20place%3B%20everything%20conceived%20after%20seeing%20the%20data%20is%20under%20*Exploratory%20analyses*%2C%20marked%20as%20post%20hoc.%0A%20%20%20%20%2F%2F%2F%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20Ex-2.1.6%20pulled%20the%20whole%20prompt%20span%20of%20*red*-labeled%20lines%20toward%20the%0A%20%20%20%20anchor%20axis.%20The%20term%20was%20mostly%20satisfied%20by%20moving%20the%20whole%20color%20cube%2C%0A%20%20%20%20so%20we%20got%20alignment%20without%20selectivity.%20Ex-2.1.7%20found%20that%20two%20fixes%0A%20%20%20%20stack%3A%0A%20%20%20%20**(a)**%20a%20repulsive%20anti-subspace%20term%2C%20and%0A%20%20%20%20**(b)**%20narrowing%20the%20pull%20to%20op1%20alone.%0A%20%20%20%20Ex-2.1.8%20tuned%20the%20schedule%20of%20the%20repulsion%20(a)%20and%20landed%20on%20an%20operating%0A%20%20%20%20point%20(%60end90-hold30%60)%20where%20the%20span%20pull%20holds%20the%20cube%20near%20the%20control%0A%20%20%20%20(%E1%BE%B1%20%3D%20%7BALPHA%7D)%20while%20keeping%20the%20margin%20(%7BMOP1%7D).%0A%0A%20%20%20%20That%20leaves%20the%20narrowing%20fix%20(b)%2C%20which%20we%20can't%20keep.%20Pulling%20only%20op1%0A%20%20%20%20works%20because%20this%20language%20has%20exactly%20one%20position%20that%20names%20the%0A%20%20%20%20labeled%20concept%2C%20and%20we%20know%20which%20one%20it%20is%2C%20whereas%20a%20document-level%20label%20on%0A%20%20%20%20natural%20text%20gives%20us%20a%20span%20and%20nothing%20else.%20Can%20the%20pull%20*find*%20the%0A%20%20%20%20right%20position%20on%20its%20own%2C%20given%20the%20freedom%20to%20spread%20its%20budget%20unevenly%3F%0A%0A%20%20%20%20The%20pooled%20term%20(below)%20asks%20only%20that%20each%20labeled%20line%20align%20*somewhere*%0A%20%20%20%20in%20its%20span%2C%20so%20the%20gradient%20concentrates%20on%20whichever%20position%20is%20already%0A%20%20%20%20cheapest%20to%20align.%20The%20cheapest%20position%20is%20a%20shared%20syntax%20token%3A%20%60%2B%60%20and%0A%20%20%20%20%60%3D%60%20appear%20in%20every%20line%2C%20so%20one%20nudge%20to%20their%20embedding%20satisfies%20every%0A%20%20%20%20labeled%20line%20at%20once.%0A%0A%20%20%20%20The%20anti-subspace%20term%20should%20make%20that%20option%20unattractive.%20Every%20line%2C%0A%20%20%20%20labeled%20or%20not%2C%20feels%20repulsion%20on%20a%20syntax%20token%20that%20sits%20on%20the%20axis%2C%0A%20%20%20%20while%20repulsion%20on%20an%20alignment%20*specific%20to%20red%20operands*%20is%20countered%20by%0A%20%20%20%20the%20pull%20where%20red%20actually%20occurs.%20If%20that%20balances%20out%2C%20the%20pull%20should%0A%20%20%20%20settle%20on%20op1%20at%20the%20embedding%2C%20the%20only%20span%20position%20whose%20state%20varies%0A%20%20%20%20with%20the%20labeled%20color%2C%20and%20then%20follow%20the%20concept%20as%20it%20migrates%20across%0A%20%20%20%20positions%20with%20depth%2C%20which%20ex-2.1.6%20saw%20the%20un-anchored%20model%20do.%0A%0A%20%20%20%20It%20might%20not%20work%20out.%20The%20ex-2.1.8%20span%20pull%20actually%20aligned%20the%20syntax%0A%20%20%20%20tokens%20the%20most%3A%20at%20the%20embedding%20its%20best-aligned%20span%20roles%20(positions%0A%20%20%20%20named%20by%20their%20job%20in%20the%20line%3A%20op1%2C%20%60%2B%60%2C%20op2%2C%20%60%3D%60)%20are%20%60%2B%60%20and%20%60%3D%60%2C%20and%0A%20%20%20%20the%20cube-wide%20drift%20is%20there%20too.%20%E1%BE%B1%20measured%20at%20op1%20is%20%7BALPHA%7D%2C%20but%20the%0A%20%20%20%20same%20statistic%20maxed%20over%20the%20span%20roles%20is%20%7BASPAN%7D.%5B%5Easpan%5D%20The%20pooled%0A%20%20%20%20term%20would%20happily%20settle%20on%20that.%20Call%20that%20outcome%20the%20*syntax%20latch*%20%E2%80%94%0A%20%20%20%20a%20latch%20because%20the%20softmin's%20concentration%20is%20self-reinforcing%20(the%0A%20%20%20%20leading%20position%20gets%20the%20pull%2C%20which%20extends%20its%20lead)%2C%20so%20whatever%20it%0A%20%20%20%20closes%20on%20first%2C%20it%20holds.%20The%20question%20is%20whether%20the%20repulsion%20redirects%0A%20%20%20%20it%20before%20it%20closes.%0A%0A%20%20%20%20%5B%5Easpan%5D%3A%20Ex-2.1.8%20gated%20%E1%BE%B1%20at%20op1%20only%3B%20the%20maxed-over-roles%20number%20is%0A%20%20%20%20%20%20%20%20computed%20here%20from%20its%20published%20arrays.%20Note%20the%20repulsion%20already%0A%20%20%20%20%20%20%20%20acts%20on%20every%20position%20%E2%80%94%20the%20syntax%20tokens%20climbed%20the%20axis%20despite%0A%20%20%20%20%20%20%20%20it%2C%20because%20the%20span-mean%20pull%20itself%20pushes%20them%20there%20(three%20of%20the%0A%20%20%20%20%20%20%20%20four%20pulled%20positions).%20Raising%20the%20repulsion%20floor%20would%20set%20up%20a%0A%20%20%20%20%20%20%20%20tug-of-war%20on%20those%20same%20states%2C%20and%20ex-2.1.8%20left%20that%20lever%20untested%0A%20%20%20%20%20%20%20%20(its%20best%20floor%20was%20its%20highest).%20Pooling%20goes%20after%20the%20cause%0A%20%20%20%20%20%20%20%20instead%3A%20it%20lets%20the%20pull%20withdraw%20from%20positions%20it%20doesn't%20need.%0A%20%20%20%20%22%22%22.replace(%22%7BALPHA%7D%22%2C%20f%22%7Bex.EX218_REFERENCE%5B'end90-hold30'%5D%5B'alpha_op1'%5D%3A.2f%7D%22)%0A%20%20%20%20%20%20%20%20.replace(%22%7BMOP1%7D%22%2C%20f%22%7Bex.EX218_REFERENCE%5B'end90-hold30'%5D%5B'm_op1'%5D%3A.2f%7D%22)%0A%20%20%20%20%20%20%20%20.replace(%22%7BASPAN%7D%22%2C%20f%22%7Bex.EX218_REFERENCE%5B'end90-hold30'%5D%5B'alpha_span'%5D%3A.2f%7D%22)%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Method%0A%0A%20%20%20%20Everything%20follows%20ex-2.1.8%20except%20the%20pooling%3A%20the%20word-level%20%60v216%60%20corpus%20from%20ex-2.1.3%20(216%20colors%2C%20one%20token%20each%2C%20d64-L4)%2C%20the%20same%20seeds%2C%20sequence-level%20labels%2C%20measurements%2C%20anchor%20schedule%2C%20and%20the%20anti-subspace%20schedule%20fixed%20at%20the%20operating%20point%20of%20that%20experiment%20(%60end90-hold30%60)%20in%20every%20anchored%20cell.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%23%20The%20pooled%20term%0A%0A%20%20%20%20Previously%2C%20the%20anchor%20term%20averaged%20%24x_t%20%3D%201%20-%20%5Ccos(h_t%2C%20%5Chat%20v)%24%20over%20every%0A%20%20%20%20pulled%20position.%20We%20replace%20that%20mean%2C%20per%20labeled%20line%2C%20with%20a%20soft%0A%20%20%20%20minimum%20over%20the%20span%20of%20the%20line%2C%20the%20*mellowmax*%5B%5Emm%5D%0A%0A%20%20%20%20%24%24%5Cmathrm%7Bmm%7D_%5Ctau(x)%20%3D%20-%5Ctau%20%5Clog%20%5Cfrac%7B1%7D%7Bn%7D%20%5Csum_%7Bt%20%5Cin%20%5Ctext%7Bspan%7D%7D%20e%5E%7B-x_t%20%2F%20%5Ctau%7D%2C%24%24%0A%0A%20%20%20%20where%20%CF%84%20is%20a%20%22temperature%22%20that%20shapes%20how%20the%20pull%20distributes%20over%20the%0A%20%20%20%20span%3A%20an%20even%20spread%20at%20large%20%CF%84%2C%20concentrating%20on%20the%20cheapest%20positions%0A%20%20%20%20as%20%CF%84%20falls.%20The%20per-line%20pooled%20values%20are%20averaged%20over%20labeled%20lines%0A%20%20%20%20and%20residual-stream%20slices%20as%20before.%5B%5Ers%5D%0A%0A%20%20%20%20%7BFIGURE%7D%0A%0A%20%20%20%20Three%20properties%20made%20us%20pick%20this%20form%20over%20the%20other%20things%20called%0A%20%20%20%20%22softmin%22.%0A%20%20%20%20First%2C%20its%20gradient%20is%20the%20softmin%20weights%0A%20%20%20%20%24%5Cpi_t%20%3D%20%5Cmathrm%7Bsoftmax%7D(-x%2F%5Ctau)_t%24%2C%20which%20are%20non-negative%20and%20sum%20to%201%2C%0A%20%20%20%20so%20the%20pull%20budget%20of%20each%20line%20is%20conserved%20and%20%24%5Clambda_a%24%20means%20the%20same%0A%20%20%20%20thing%20at%20every%20%CF%84.%0A%20%20%20%20Second%2C%20the%20%241%2Fn%24%20inside%20the%20log%20makes%20%24%5Ctau%20%3D%20%5Cinfty%24%0A%20%20%20%20the%20span%20mean%20(we'll%20pin%20that%20with%20a%20unit%20test)%2C%20so%20the%20%CF%84%20%3D%20%E2%88%9E%20condition%0A%20%20%20%20reproduces%20the%20ex-2.1.8%20pull%20and%20the%20%CF%84%20sweep%20interpolates%20from%20there%20down%0A%20%20%20%20toward%20a%20hard%20min%20at%20%CF%84%20%3D%200.%0A%20%20%20%20Third%2C%20it%20never%20pushes.%0A%0A%20%20%20%20That%20last%20property%20is%20why%20we%20avoid%20the%20other%20common%20%22softmin%22%2C%20the%0A%20%20%20%20softmax-*weighted%20average*%20%24%5Csum_t%20%5Cpi_t%20x_t%24.%20Its%20gradient%20terms%20flip%20sign%0A%20%20%20%20once%20the%20cost%20of%20a%20position%20is%20%CF%84%20past%20the%20pooled%20value%2C%20so%20poorly-aligned%0A%20%20%20%20positions%20would%20be%20actively%20pushed%20off%20the%20axis%20(on%20a%20two-position%20toy%20at%0A%20%20%20%20%CF%84%20%3D%200.4%2C%20about%2010%25%20of%20the%20gradient%20budget).%20That%20would%20confound%20this%0A%20%20%20%20experiment%3A%20we%20would%20be%20pulling%20the%20best%20position%20and%20pushing%20the%20rest.%0A%0A%20%20%20%20A%20training%20crop%20can%20truncate%20a%20line%2C%20so%20the%20pool%20runs%20over%20the%20*visible*%0A%20%20%20%20span%20positions%20of%20the%20line%2C%20and%20each%20labeled%20line%20counts%20once.%20At%20%CF%84%20%3D%20%E2%88%9E%0A%20%20%20%20that's%20a%20per-line%20mean%20of%20means%20rather%20than%20the%20flat%20mean%20over%20positions%0A%20%20%20%20used%20in%20ex-2.1.8.%20The%20two%20differ%20only%20on%20truncated%20lines%2C%20and%20the%0A%20%20%20%20reproduction%20check%20below%20will%20say%20whether%20that%20(or%20anything%20else%20in%20the%20new%0A%20%20%20%20code%20path)%20moved%20the%20numbers.%0A%0A%20%20%20%20%5B%5Ers%5D%3A%20The%20*residual%20stream*%20is%20the%20running%20vector%20each%20token%20carries%0A%20%20%20%20%20%20%20%20through%20the%20network%3B%20a%20slice%20is%20that%20vector%20read%20off%20at%20one%20depth.%0A%0A%20%20%20%20%5B%5Emm%5D%3A%20%5BAsadi%20%26%20Littman%2C%202017%5D(https%3A%2F%2Farxiv.org%2Fabs%2F1612.05628).%20A%0A%20%20%20%20%20%20%20%20temperature-controlled%20interpolation%20between%20min%20(%CF%84%20%E2%86%92%200)%20and%20mean%0A%20%20%20%20%20%20%20%20(%CF%84%20%E2%86%92%20%E2%88%9E)%3B%20%22softmin%22%20is%20ambiguous%20between%20this%20and%20the%20softmax-weighted%0A%20%20%20%20%20%20%20%20average%2C%20hence%20the%20care.%0A%20%20%20%20%22%22%22.replace(%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%7BFIGURE%7D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20mo.image(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Path(__file__).parent%20%2F%20%22public%22%20%2F%20%22pooling.svg%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20alt%3D%22A%20training%20batch%20drawn%20as%20a%20cube%3A%20mellowmax%20pools%20within%20each%20line's%20span%20at%20every%20slice%2C%20then%20plain%20means%20collapse%20lines%2C%20slices%2C%20and%20batch%20rows.%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20caption%3D%22Pooling%20happens%20within%20each%20slice%2C%20so%20the%20pull%20can%20choose%20different%20positions%20at%20different%20depths%2C%20following%20the%20concept%20as%20it%20migrates.%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20).text%2C%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20%23%20Joined%20with%20the%20block's%20own%20indent%20so%20every%20row%20dedents%20evenly%20under%20mo.md.%0A%20%20%20%20_rows%20%3D%20%22%5Cn%20%20%20%20%22.join(%0A%20%20%20%20%20%20%20%20f%22%7C%20%60%7Bc%5B'name'%5D%7D%60%20%7C%20%7Bc%5B'lam'%5D%3Ag%7D%20%7C%20%7B'%E2%88%9E'%20if%20np.isinf(c%5B'tau'%5D)%20else%20f'%7Bc%5B%22tau%22%5D%3Ag%7D'%7D%20%7C%20%22%0A%20%20%20%20%20%20%20%20f%22%7B'op1%20only'%20if%20c%5B'span'%5D%20%3D%3D%201%20else%20'prompt%20span'%7D%20%7C%22%0A%20%20%20%20%20%20%20%20for%20c%20in%20ex.CONDITIONS%0A%20%20%20%20)%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%23%20Conditions%0A%0A%20%20%20%20Six%20conditions%2C%20three%20seeds%20each.%20Every%20anchored%20cell%20runs%20the%0A%20%20%20%20anti-subspace%20term%20at%20the%20ex-2.1.8%20operating%20point%3B%20only%20the%20pooling%0A%20%20%20%20varies.%0A%0A%20%20%20%20%7C%20condition%20%7C%20%24%5Clambda_a%24%20%7C%20%CF%84%20%7C%20pulled%20positions%20%7C%0A%20%20%20%20%7C---%7C---%7C---%7C---%7C%0A%20%20%20%20%7BROWS%7D%0A%0A%20%20%20%20%60span-mean%60%20re-runs%20the%20%60end90-hold30%60%20condition%20of%20ex-2.1.8%20through%20the%0A%20%20%20%20pooled%20code%20path%20at%20%CF%84%20%3D%20%E2%88%9E%3A%20the%20baseline%20the%20pooled%20conditions%20have%20to%20beat%2C%0A%20%20%20%20differing%20from%20them%20only%20in%20%CF%84.%20%60op1-oracle%60%20is%20the%20op1-only%20pull%20of%0A%20%20%20%20ex-2.1.7%20at%20the%20new%20operating%20point%3A%20what%20knowing%20the%20right%20position%20buys%2C%0A%20%20%20%20measured%20through%20identical%20code%2C%20so%20we%20can%20say%20what%20fraction%20of%20it%20pooling%0A%20%20%20%20recovers.%20It%20is%20a%20reference%20rather%20than%20a%20strict%20ceiling%20%E2%80%94%20the%20oracle%0A%20%20%20%20pulls%20op1%20at%20every%20slice%2C%20and%20ex-2.1.6%20saw%20the%20concept%20migrate%20to%20later%0A%20%20%20%20roles%20with%20depth%2C%20so%20a%20per-slice%20pool%20could%20in%20principle%20beat%20it.%0A%20%20%20%20%22%22%22.replace(%22%7BROWS%7D%22%2C%20_rows)%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Calibrating%20%CF%84%0A%0A%20%20%20%20The%20interesting%20%CF%84%20range%20depends%20on%20how%20much%20%24x_t%24%20varies%20across%20the%20span%2C%20which%20we%20can%20read%20off%20the%20stored%20alignment%20maps%20of%20ex-2.1.8%20before%20running%20anything.%20The%20figure%20below%20computes%20what%20the%20softmin%20weights%20*would*%20be%20on%20two%20reference%20profiles%3A%20a%20fresh%20run%20(the%20un-anchored%20control)%20and%20a%20trained%20one%20(the%20span%20pull%20at%20the%20operating%20point).%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20_e218%20%3D%20load_ex218()%0A%20%20%20%20mo.stop(%0A%20%20%20%20%20%20%20%20_e218%20is%20None%2C%0A%20%20%20%20%20%20%20%20mo.md(%22_Ex-2.1.8's%20published%20results%20aren't%20reachable%20from%20here%3B%20the%20calibration%20figure%20needs%20them._%22)%2C%0A%20%20%20%20)%0A%20%20%20%20assert%20_e218%20is%20not%20None%0A%20%20%20%20_metrics218%2C%20arrays218%20%3D%20_e218%0A%0A%20%20%20%20def%20ex218_alpha(cond%3A%20str)%20-%3E%20np.ndarray%3A%0A%20%20%20%20%20%20%20%20%22%22%22Ex-2.1.8's%20seed-mean%20alignment%20map%20for%20a%20condition%3A%20(slices%2C%20colors%2C%20positions).%22%22%22%0A%20%20%20%20%20%20%20%20return%20np.mean(%5Barrays218%5Bf%22%7Bcond%7D-s%7Bs%7D%2Falpha%22%5D%20for%20s%20in%20%5B0%2C%201%2C%202%5D%5D%2C%20axis%3D0)%0A%0A%20%20%20%20def%20leading_weight(alpha%3A%20np.ndarray%2C%20tau%3A%20float)%20-%3E%20np.ndarray%3A%0A%20%20%20%20%20%20%20%20%22%22%22Label-weighted%20mean%20of%20the%20leading%20softmin%20weight%2C%20per%20residual%20slice.%22%22%22%0A%20%20%20%20%20%20%20%20w%20%3D%20ex.softmin_weights(1.0%20-%20alpha%5B%3A%2C%20%3A%2C%20%3A%20ex.SPAN%5D%2C%20tau)%0A%20%20%20%20%20%20%20%20return%20np.einsum(%22lc%2Cc-%3El%22%2C%20w.max(axis%3D-1)%2C%20ex.LABEL_W)%0A%0A%20%20%20%20ALPHA218%20%3D%20%7Bc%3A%20ex218_alpha(c)%20for%20c%20in%20%5B%22lam0%22%2C%20%22end90-hold30%22%5D%7D%0A%20%20%20%20return%20ALPHA218%2C%20arrays218%2C%20leading_weight%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(ALPHA218%2C%20leading_weight)%3A%0A%20%20%20%20_taus%20%3D%20np.geomspace(0.003%2C%201.0%2C%2060)%0A%20%20%20%20_lead%20%3D%20%7Bc%3A%20np.array(%5Bleading_weight(a%2C%20t)%20for%20t%20in%20_taus%5D)%20for%20c%2C%20a%20in%20ALPHA218.items()%7D%0A%0A%20%20%20%20%40themed(%0A%20%20%20%20%20%20%20%20name%3D%22tau-calibration%22%2C%0A%20%20%20%20%20%20%20%20alt_text%3D%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20Two%20line%20charts%20of%20leading%20softmin%20weight%20against%20temperature%20tau%20on%20a%20log%20scale%20from%200.003%20to%201.%20Left%20panel%3A%20the%20un-anchored%20control's%20alignment%20profile%3B%20right%20panel%3A%20the%20ex-2.1.8%20span%20pull%20at%20the%20operating%20point.%20Each%20panel%20has%20five%20curves%2C%20one%20per%20residual%20slice%2C%20all%20starting%20near%201%20at%20the%20left%20edge%20and%20descending%20to%200.25%20at%20the%20right%20edge.%20A%20horizontal%20band%20from%200.6%20to%200.8%20is%20shaded%2C%20and%20three%20vertical%20dashed%20lines%20mark%20tau%20%3D%200.01%2C%200.03%20and%200.1.%20Most%20curves%20pass%20through%20the%20shaded%20band%20between%20tau%20%3D%200.005%20and%200.03%3B%20in%20the%20right%20panel%20the%20last%20slice's%20curve%20sits%20noticeably%20higher%2C%20crossing%20the%20band%20nearer%200.06%20to%200.09.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20caption%3Dr%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20**Calibrating%20the%20%CF%84%20grid%20from%20the%20ex-2.1.8%20stored%20alignments.**%20The%20leading%20span%20position's%20share%20of%20the%20softmin%20weight%2C%20by%20residual%20slice%2C%20if%20the%20weights%20were%20computed%20from%20the%20alignment%20profile%20of%20the%20un-anchored%20control%20(**left**)%20or%20the%20span%20pull%20at%20the%20operating%20point%20(**right**).%20The%20shaded%20band%20is%20the%200.6%E2%80%930.8%20target%20from%20the%20design%20note%3B%20dashed%20verticals%20are%20the%20chosen%20grid.%20Both%20profiles%20put%20the%20band%20at%20%CF%84%20%E2%89%88%200.01%E2%80%930.03%2C%20so%20the%20grid%20brackets%20it%20with%20one%20rung%20toward%20the%20mean.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20)%0A%20%20%20%20def%20_plot()%3A%0A%20%20%20%20%20%20%20%20_grey%20%3D%20light_dark(%22%23666%22%2C%20%22%23999%22)%0A%20%20%20%20%20%20%20%20_slice_colors%20%3D%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20light_dark(%22%237b3fa0%22%2C%20%22%23b98ce0%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20light_dark(%22%231f6fb4%22%2C%20%22%235fa8dd%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20light_dark(%22%232a9d8f%22%2C%20%22%235fc9bd%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20light_dark(%22%23b4531f%22%2C%20%22%23dd8f5f%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20light_dark(%22%23a02040%22%2C%20%22%23d06080%22)%2C%0A%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20fig%2C%20axs%20%3D%20plt.subplots(1%2C%202%2C%20figsize%3D(7.2%2C%202.7)%2C%20layout%3D%22constrained%22%2C%20sharey%3DTrue)%0A%20%20%20%20%20%20%20%20for%20ax%2C%20(cond%2C%20title)%20in%20zip(%0A%20%20%20%20%20%20%20%20%20%20%20%20axs%2C%20%5B(%22lam0%22%2C%20%22control%20profile%22)%2C%20(%22end90-hold30%22%2C%20%22span-pull%20profile%22)%5D%2C%20strict%3DTrue%0A%20%20%20%20%20%20%20%20)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.axhspan(*ex.LEAD_BAND%2C%20color%3D_grey%2C%20alpha%3D0.15%2C%20lw%3D0)%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20li%20in%20range(5)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.plot(_taus%2C%20_lead%5Bcond%5D%5B%3A%2C%20li%5D%2C%20color%3D_slice_colors%5Bli%5D%2C%20lw%3D1.4%2C%20label%3Df%22slice%20%7Bli%7D%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20t%20in%20ex.TAUS%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.axvline(t%2C%20color%3D_grey%2C%20ls%3D(0%2C%20(4%2C%203))%2C%20lw%3D0.8%2C%20alpha%3D0.7)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.axhline(1%20%2F%20ex.SPAN%2C%20color%3D_grey%2C%20lw%3D0.5%2C%20alpha%3D0.45%2C%20zorder%3D-1)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_xscale(%22log%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_xlabel(%22%CF%84%22%2C%20fontsize%3D%22x-small%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_title(title%2C%20fontsize%3D%22small%22%2C%20color%3D_grey)%0A%20%20%20%20%20%20%20%20axs%5B0%5D.set_ylabel(%22leading%20weight%22%2C%20fontsize%3D%22x-small%22)%0A%20%20%20%20%20%20%20%20axs%5B0%5D.set_ylim(0.2%2C%201.02)%0A%20%20%20%20%20%20%20%20axs%5B1%5D.legend(fontsize%3D%22x-small%22%2C%20loc%3D%22upper%20right%22%2C%20frameon%3DFalse)%0A%20%20%20%20%20%20%20%20return%20fig%0A%0A%20%20%20%20mo.Html(_plot())%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(ALPHA218%2C%20arrays218)%3A%0A%20%20%20%20_x0%20%3D%20np.einsum(%22ct%2Cc-%3Et%22%2C%201.0%20-%20ALPHA218%5B%22end90-hold30%22%5D%5B0%2C%20%3A%2C%20%3A%20ex.SPAN%5D%2C%20ex.LABEL_W)%0A%0A%20%20%20%20def%20_seed_mean(stat%2C%20cond%3A%20str)%20-%3E%20float%3A%0A%20%20%20%20%20%20%20%20%22%22%22Mean%20of%20the%20per-run%20statistic%20%E2%80%94%20the%20convention%20every%20result%20is%20scored%20under.%0A%0A%20%20%20%20%20%20%20%20Both%20pooled%20statistics%20take%20a%20max%20over%20roles%2C%20so%20computing%20them%20on%20the%0A%20%20%20%20%20%20%20%20seed-mean%20map%20instead%20would%20suppress%20the%20max-of-noise%20inflation%20that%0A%20%20%20%20%20%20%20%20the%20control%20subtraction%20is%20there%20to%20absorb%2C%20and%20understate%20the%0A%20%20%20%20%20%20%20%20control's%20%E1%BE%B1_span%20in%20particular.%0A%20%20%20%20%20%20%20%20%22%22%22%0A%20%20%20%20%20%20%20%20return%20float(np.mean(%5Bstat(arrays218%5Bf%22%7Bcond%7D-s%7Bs%7D%2Falpha%22%5D)%20for%20s%20in%20(0%2C%201%2C%202)%5D))%0A%0A%20%20%20%20_m218%20%3D%20_seed_mean(lambda%20a%3A%20ex.pooled_margin(a%2C%20ex.LABEL_W)%2C%20%22end90-hold30%22)%0A%20%20%20%20_m218c%20%3D%20_seed_mean(lambda%20a%3A%20ex.pooled_margin(a%2C%20ex.LABEL_W)%2C%20%22lam0%22)%0A%20%20%20%20_as218%20%3D%20_seed_mean(ex.alpha_span%2C%20%22end90-hold30%22)%0A%20%20%20%20_as218c%20%3D%20_seed_mean(ex.alpha_span%2C%20%22lam0%22)%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20rf%22%22%22%0A%20%20%20%20The%20design%20note%20targets%20a%20leading%20position%20taking%200.6%E2%80%930.8%20of%20the%20weight%2C%20which%20lands%20at%20%CF%84%20%E2%89%88%200.01%E2%80%930.03%20on%20both%20profiles.%0A%0A%20%20%20%20So%20the%20grid%20is%20%24%5Ctau%20%5Cin%20%5C%7B%7B%7B%22%2C%20%22.join(f%22%7Bt%3Ag%7D%22%20for%20t%20in%20ex.TAUS)%7D%5C%7D%7D%24%3A%20the%20sharp%20edge%20of%20the%20band%2C%20the%20soft%20edge%2C%20and%20one%20rung%20toward%20the%20mean%20end%20of%20the%20%CF%84%20axis%20(%CF%84%20%3D%200.1%2C%20weights%20nearer%20uniform)%3B%20the%20mean%20itself%20is%20the%20%CF%84%20%3D%20%E2%88%9E%20condition%2C%20which%20closes%20the%20family.%20%CF%84%20%3D%200.01%20sits%20below%20the%20per-seed%20margin%20noise%20(%7Bex.NOISE_PER_SEED%3Ag%7D)%2C%20so%20at%20that%20rung%20the%20pool%20will%20commit%20hard%20to%20early%20differences%20that%20may%20just%20be%20noise.%20That%20is%20the%20winner-take-most%20end%20of%20the%20sweep.%0A%0A%20%20%20%20The%20ex-2.1.8%20arrays%20give%20the%20reproduction%20targets%20for%20the%20%60span-mean%60%20condition%2C%20as%20means%20of%20per-run%20statistics%20%E2%80%94%20the%20convention%20the%20results%20are%20scored%20under%3A%20pooled%20margin%20m_span%20%3D%20%7B_m218%3A.2f%7D%20(control%20%7B_m218c%3A.2f%7D)%20and%20%E1%BE%B1_span%20%3D%20%7B_as218%3A.2f%7D%20(control%20%7B_as218c%3A.2f%7D).%20They%20also%20put%20numbers%20on%20the%20syntax%20latch%3A%20at%20the%20embedding%20slice%2C%20the%20alignment%20%24%5Ccos(h%2C%20%5Chat%20v)%24%20of%20the%20span-pull%20run's%20states%2C%20averaged%20over%20colors%20with%20label-affinity%20weights%2C%20is%20%60%2B%60%20%7B1%20-%20_x0%5B1%5D%3A.2f%7D%20and%20%60%3D%60%20%7B1%20-%20_x0%5B3%5D%3A.2f%7D%2C%20against%20op1%20%7B1%20-%20_x0%5B0%5D%3A.2f%7D%20and%20op2%20%7B1%20-%20_x0%5B2%5D%3A.2f%7D%20%E2%80%94%20a%20pool%20applied%20to%20*this*%20profile%20would%20close%20on%20the%20syntax%20tokens.%0A%20%20%20%20%22%22%22%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%23%20Measurements%0A%0A%20%20%20%20Alignment%20maps%20(%24%5Ccos(h%2C%20%5Chat%20v)%24%20at%20every%20slice%2C%20color%2C%20and%20role%2C%20each%20color%20averaged%20over%20its%2027%20probe%20lines)%2C%20task%20evals%2C%20trajectories%20and%20probes%20are%20from%20ex-2.1.8%20unchanged.%20Labels%20also%20still%20key%20on%20the%20color%20of%20op1%20alone%2C%20as%20in%20every%20experiment%20since%20ex-2.1.6%3A%20pooling%20moves%20where%20the%20*pull*%20acts%2C%20never%20which%20lines%20are%20labeled.%20Three%20statistics%20are%20new%20or%20newly%20scored%2C%20all%20computed%20from%20the%20same%20maps%3A%0A%0A%20%20%20%20**The%20pooled%20margin%20m_span**%20is%20the%20mean%20over%20slices%20of%20the%20max-over-span%20margin%3A%20for%20each%20slice%2C%20take%20the%20margin%20at%20each%20span%20role%20and%20keep%20the%20largest%2C%20then%20average%20over%20slices.%20The%20margin%20at%20a%20role%20is%20selectivity%20rather%20than%20raw%20alignment%3A%20over%20the%20216%20colors%2C%20the%20affinity-weighted%20mean%20alignment%20of%20their%20states%20at%20that%20(slice%2C%20role)%2C%20minus%20the%20unweighted%20mean%20%E2%80%94%20how%20much%20closer%20a%20line%20sits%20to%20the%20axis%20for%20having%20a%20red%20op1.%20At%20depth%20the%20syntax%20roles'%20states%20vary%20with%20the%20color%20of%20op1%20too%20(they%20attend%20back%20to%20it)%2C%20so%20the%20margin%20means%20the%20same%20thing%20at%20every%20role%3B%20there%20is%20no%20separate%20notion%20of%20how%20aligned%20a%20role%20*should*%20be.%20We%20can't%20score%20the%20margin%20at%20op1%20alone%2C%20because%20one%20condition%20pulls%20exactly%20where%20we%20would%20be%20scoring%2C%20and%20op1%20may%20not%20be%20where%20the%20concept%20belongs%20at%20depth%20anyway.%0A%0A%20%20%20%20The%20max%20is%20applied%20identically%20to%20every%20condition%20and%20to%20the%20control%2C%20so%20the%20maximum-of-noise%20inflation%20it%20invites%20cancels%20out%20in%20the%20control-subtracted%20comparisons%20the%20hypotheses%20make.%20We%20report%20%24m_%5Ctext%7Bop1%7D%24%20beside%20it%20for%20continuity%20with%20ex-2.1.7%20and%20ex-2.1.8.%0A%0A%20%20%20%20**%E1%BE%B1_span**%20is%20the%20counterpart%20for%20containment%2C%20with%20the%20same%20max%20treatment%3A%20for%20each%20slice%2C%20the%20unweighted%20mean%20alignment%20over%20the%20216%20colors'%20states%20at%20each%20span%20role%2C%20keeping%20the%20largest%20role%3B%20then%20the%20mean%20over%20slices.%20Color%20enters%20only%20through%20that%20mean%20%E2%80%94%20this%20is%20drift%20of%20the%20whole%20cloud%2C%20not%20selectivity.%20The%20usual%20%E1%BE%B1%20reads%20at%20op1%20only%2C%20which%20the%20ex-2.1.8%20operating%20point%20shows%20isn't%20enough%20here%3A%20its%20cube-wide%20drift%20sits%20on%20the%20syntax%20roles%2C%20where%20the%20op1%20statistic%20can't%20see%20it.%0A%0A%20%20%20%20**The%20softmin%20weight%20profile**%20%24%5Cbar%5Cpi(l%2C%20t)%24%20records%20what%20the%20pull%20actually%20chose.%20(%CF%80%2C%20since%20%24w%24%20collides%20with%20model%20weights.)%20At%20the%20end%20of%20training%20we%20compute%20the%20weights%20%24%5Cmathrm%7Bsoftmax%7D(-x%2F%5Ctau)%24%20on%20the%20alignment%20probe%20set%20(every%20color%20as%20op1%20against%20all%2027%20closed%20partners)%2C%20per%20slice%20and%20span%20role%2C%20weighted%20by%20label%20affinity%20over%20colors.%0A%0A%20%20%20%20Its%20reference%20is%20**the%20readability%20profile%20of%20the%20control**%20%24R%5E2(l%2C%20t)%24%3A%20a%20ridge%20probe%20predicting%20the%20redness%20of%20op1%20from%20the%20state%20of%20the%20*un-anchored%20control*%20at%20each%20(slice%2C%20role)%2C%20with%20one%20op1%20color%20held%20out%20at%20a%20time.%20This%20%24R%5E2%24%20is%20the%20probe's%20held-out%20coefficient%20of%20determination%20(negative%20on%20a%20role%20that%20carries%20nothing)%2C%20a%20different%20quantity%20from%20the%20squared%20Pearson%20correlation%20that%20grading%20uses%3B%20earlier%20reports%20wrote%20both%20as%20%24R%5E2%24%2C%20so%20here%20they%20are%20%24R%5E2%24%20(probes)%20and%20%24r%5E2%24%20(grading).%20At%20the%20embedding%20we%20know%20this%20profile%20in%20advance%2C%20since%20op1%20is%20the%20only%20span%20position%20whose%20state%20varies%20with%20the%20color%20of%20op1.%20H4(a)%20relies%20on%20this%20for%20its%20prediction.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20%23%20REVIEW%3A%20H2(a)'s%20gate%20of%200.15%20was%20described%20as%20%22about%20a%20third%22%20of%20ex-2.1.7's%0A%20%20%20%20%23%20op1-oracle%20gain%3B%20that%20gain%20is%200.22%2C%20so%20it%20is%20about%20two%20thirds.%20Corrected%20the%0A%20%20%20%20%23%20prose%20and%20interpolated%20the%20number%20rather%20than%20restating%20it.%20The%20gate%20itself%0A%20%20%20%20%23%20is%20unchanged%20%E2%80%94%20its%20noise-based%20derivation%20(~3.3%C3%97%20the%20seed-mean%20difference%0A%20%20%20%20%23%20noise)%20is%20the%20binding%20one.%20Verify%3A%20%60EX217_OP1_GAIN%60%20in%20experiment.py.%0A%20%20%20%20%23%20REVIEW%3A%20H4(b)%20said%20%22the%20four%20position-aware%20slices%22%20without%20saying%20which%20of%0A%20%20%20%20%23%20the%20five%20they%20are%3B%20fixed%20to%20the%20four%20after%20the%20embedding%2C%20since%20at%20the%0A%20%20%20%20%23%20embedding%20a%20token's%20state%20cannot%20depend%20on%20any%20other%20position%2C%20which%20is%20the%0A%20%20%20%20%23%20same%20fact%20H4(a)%20relies%20on.%20Verify%3A%20the%20R%C2%B2%20profile's%20embedding%20row%20should%20be%0A%20%20%20%20%23%20~0%20off%20op1.%0A%20%20%20%20%23%20REVIEW%3A%20P%20was%20%22the%20task-clean%20finite-%CF%84%20condition%20with%20the%20largest%20seed-mean%0A%20%20%20%20%23%20m_span%22%2C%20which%20selects%20by%20the%20statistic%20H2(a)%20then%20gates%20%E2%80%94%20a%20maximum%20over%0A%20%20%20%20%23%20three%20arms%20scored%20against%20a%20single-comparison%20gate.%20P%20is%20now%20fixed%20in%0A%20%20%20%20%23%20advance%20to%20%60pool-t030%60%20by%20the%20calibration-band%20criterion%20(its%20%CF%84%20sits%20inside%0A%20%20%20%20%23%20the%200.6%E2%80%930.8%20band%2C%20at%20its%20soft%20edge%2C%20on%20both%20reference%20profiles)%2C%20which%20is%0A%20%20%20%20%23%20independent%20of%20every%20gated%20statistic%3B%20the%20other%20pooled%20arms%20demote%20to%20a%0A%20%20%20%20%23%20reported%20sweep.%20Verify%3A%20the%20calibration%20figure%20%E2%80%94%20if%20the%20band%20moves%20off%0A%20%20%20%20%23%20%CF%84%20%3D%200.03%20when%20recomputed%2C%20the%20choice%20of%20P%20should%20move%20with%20it%20before%20the%0A%20%20%20%20%23%20freeze.%0A%20%20%20%20%23%20REVIEW%3A%20H3(c)%20said%20%22within%200.1%22%20of%20the%20span-mean%20arm's%20grading%2C%20which%20reads%0A%20%20%20%20%23%20two-sided%3B%20the%20intent%20is%20a%20floor%2C%20so%20it%20now%20says%20%22no%20more%20than%200.1%20below%0A%20%20%20%20%23%20(higher%20is%20fine)%22.%20Verify%3A%20%60GRADE_R2_DROP%60%20names%20a%20drop%2C%20not%20a%20distance.%0A%20%20%20%20%23%20REVIEW%20(pre-launch)%3A%20recomputing%20the%20calibration%20puts%20%CF%84%20%3D%200.03's%20leading%0A%20%20%20%20%23%20weight%20at%20the%20band's%20soft%20edge%20on%20the%20two%20shallowest%20slices%20and%200.4%E2%80%930.5%0A%20%20%20%20%23%20on%20the%20deeper%20three%2C%20so%20%22sits%20at%20the%20soft%20edge%22%20over-claimed%3B%20P%20and%20its%0A%20%20%20%20%23%20criterion%20are%20unchanged%2C%20the%20wording%20now%20says%20%22at%20or%20just%20below%22.%20The%0A%20%20%20%20%23%20reproduction%20targets%20are%20likewise%20now%20means%20of%20per-run%20statistics%0A%20%20%20%20%23%20(per-run%20max%20over%20roles%2C%20then%20mean)%2C%20matching%20how%20results%20are%20scored%20%E2%80%94%0A%20%20%20%20%23%20on%20the%20seed-mean%20map%20the%20max-of-noise%20inflation%20cancels%20and%20the%0A%20%20%20%20%23%20control's%20%E1%BE%B1_span%20reads%20~2.6%C3%97%20lower%20than%20the%20scoring%20convention's.%0A%20%20%20%20mo.md(%0A%20%20%20%20%20%20%20%20r%22%22%22%0A%20%20%20%20%23%23%20Hypotheses%0A%0A%20%20%20%20Gates%20and%20noise%20floors%20are%20from%20ex-2.1.6%20through%20ex-2.1.8%20wherever%20the%0A%20%20%20%20statistic%20is%20unchanged.%20Derivations%20for%20the%20new%20gates%20are%20in%0A%20%20%20%20%5Bexperiment.py%5D(.%2Fexperiment.py)%2C%20next%20to%20their%20constants.%0A%0A%20%20%20%20In%20the%20hypothesis%20statements%2C%20*P*%20names%20the%20primary%20pooled%20condition%2C%0A%20%20%20%20fixed%20in%20advance%20as%20%60%7BPRIMARY%7D%60%3A%20on%20both%20reference%20profiles%20its%20%CF%84%20sits%20at%0A%20%20%20%20the%20calibration%20band's%20soft%20edge%20on%20the%20shallow%20slices%2C%20and%20below%20the%0A%20%20%20%20band%20on%20the%20deeper%20ones%20%E2%80%94%20the%20conservative%20end%20of%20the%20target%20range%20%E2%80%94%20a%0A%20%20%20%20criterion%20independent%20of%20every%20gated%20statistic.%20H2%E2%80%93H4%20all%20score%20P%3B%20the%0A%20%20%20%20results%20prose%20calls%20it%20%60%7BPRIMARY%7D%60%20or%20%22the%20primary%20condition%22.%20The%20other%0A%20%20%20%20two%20pooled%20conditions%20are%20the%20%CF%84%20sweep%2C%20reported%20beside%20P%20but%20not%20gated.%0A%20%20%20%20If%20P%20turns%20out%20task-dirty%2C%20H2%E2%80%93H4%20go%20unscored%20and%20the%20refuted%20H1%20is%20the%0A%20%20%20%20finding.%0A%0A%20%20%20%20**H1%3A%20Task%20cost.**%20Every%20condition%20is%20task-clean%3A%20%60named_holdout%60%20exact%0A%20%20%20%20match%20within%20%7BTASK%7D%20(absolute)%20of%20the%20seed%20mean%20of%20the%20in-experiment%0A%20%20%20%20control.%20No%20partial%20credit%3A%20ex-2.1.7%20found%20no%20task%20cost%20even%20at%20ten%20times%0A%20%20%20%20this%20anchor%20weight%2C%20and%20nothing%20in%20this%20design%20should%20add%20task%20pressure.%0A%0A%20%20%20%20**H2%3A%20Pooling%20increases%20selectivity%20over%20the%20span%20mean.**%0A%20%20%20%20(a)%20%24m_%5Ctext%7Bspan%7D(P)%20-%20m_%5Ctext%7Bspan%7D(%5Ctext%7Bspan-mean%7D)%20%5Cge%20%7BGAIN%7D%24%2C%0A%20%20%20%20about%20two%20thirds%20of%20what%20the%20op1%20oracle%20gave%20at%20op1%20in%20ex-2.1.7%0A%20%20%20%20(%7BOP1GAIN%7D)%2C%20and%20roughly%203%C3%97%20the%20noise%20of%20a%20difference%20of%20three-seed%0A%20%20%20%20means.%0A%20%20%20%20(b)%20The%20syntax-role%20drift%20falls%3A%20%24%5Cbar%5Calpha_%5Ctext%7Bspan%7D(P)%20%5Cle%0A%20%20%20%20%5Cbar%5Calpha_%5Ctext%7Bspan%7D(%5Ctext%7Bspan-mean%7D)%20-%20%7BSDRIFT%7D%24.%0A%20%20%20%20Partial%3A%20(b)%20holds%20and%20(a)%20lands%20in%20%24%5B%7BGAINP%7D%2C%20%7BGAIN%7D)%24%3B%20or%20exactly%20one%0A%20%20%20%20of%20(a)%2C%20(b)%20holds%20outright.%20(b)%20is%20a%20prediction%20of%20the%20mechanism%3A%20a%0A%20%20%20%20pull%20that%20concentrates%20its%20budget%20should%20stop%20spending%20alignment%20on%0A%20%20%20%20positions%20that%20don't%20help%20it.%20A%20condition%20that%20gains%20margin%20while%20leaving%0A%20%20%20%20the%20syntax%20drift%20in%20place%20has%20found%20some%20other%20mechanism.%0A%0A%20%20%20%20**H3%3A%20The%20operating%20point%20survives%20pooling.**%20On%20P%3A%0A%20%20%20%20(a)%20containment%2C%20%24%5Cbar%5Calpha%20%5Cle%20%7BALPHA%7D%24%20at%20op1%3B%0A%20%20%20%20(b)%20retention%2C%20every%20run%20whose%20running%20maximum%20of%20%24m_%5Ctext%7Bspan%7D%24%20reaches%0A%20%20%20%20%7BFLOOR%7D%20ending%20at%20%24%5Cge%20%7BRET%7D%5Ctimes%24%20that%20maximum%20(quoted%20as%20the%20minimum%0A%20%20%20%20across%20seeds)%3B%0A%20%20%20%20(c)%20grading%2C%20the%20squared%20Pearson%20correlation%20%24r%5E2%24%20against%20%60sim%C2%B9%C2%B7%E2%81%B5%60%20of%0A%20%20%20%20P's%20seed-mean%20op1%20response%20no%20more%20than%20%7BDROP%7D%20below%20the%20%60span-mean%60%0A%20%20%20%20condition's%20(higher%20is%20fine).%5B%5Egrading-note%5D%0A%20%20%20%20Partial%3A%20(a)%20and%20(b)%20hold%2C%20(c)%20misses.%0A%0A%20%20%20%20**H4%3A%20The%20weight%20lands%20where%20the%20concept%20lives.**%20On%20the%20weight%20profile%20of%20P%3A%0A%20%20%20%20(a)%20at%20the%20embedding%20slice%2C%20the%20leading%20role%20is%20op1%20with%20weight%0A%20%20%20%20%24%5Cge%20%7BLEAD%7D%24%20(uniform%20is%200.25%3B%20this%20gates%20the%20*trained*%20weights%2C%20where%0A%20%20%20%20the%200.6%E2%80%930.8%20calibration%20band%20described%20weights%20recomputed%20on%20reference%0A%20%20%20%20profiles)%3B%0A%20%20%20%20(b)%20across%20the%20four%20slices%20after%20the%20embedding%2C%20the%20weighted%20readability%20gain%20%E2%80%94%0A%20%20%20%20%24%5Csum_t%20%5Cbar%5Cpi(l%2Ct)%20R%5E2(l%2Ct)%20-%20%5Cmathrm%7Bmean%7D_t%20R%5E2(l%2Ct)%24%2C%20averaged%20over%0A%20%20%20%20slices%20%E2%80%94%20is%20at%20least%20%7BRGAIN%7D.%0A%20%20%20%20Partial%3A%20(a)%20holds%20and%20(b)%20lands%20in%20%24%5B0%2C%20%7BRGAIN%7D)%24.%0A%20%20%20%20Two%20contrary%20outcomes%2C%20both%20leading%20to%20the%20same%20conclusion%3A%20span%20labels%0A%20%20%20%20need%20help%20from%20the%20label%20side%20(per-line%20reweighting)%2C%20not%20just%20the%20loss%0A%20%20%20%20side.%20*Latch*%3A%20the%20syntax%20latch%20from%20the%20intro%20arrives%20%E2%80%94%20the%20embedding%0A%20%20%20%20weight%20concentrates%20on%20%60%2B%60%20or%20%60%3D%60%2C%20meaning%20the%20pull%20took%20the%20cheap%20shared%0A%20%20%20%20tokens%20and%20the%20repulsion%20failed%20to%20make%20them%20unattractive%3B%20a%20latch%20would%0A%20%20%20%20take%20H2(b)%20down%20with%20it%20%E2%80%94%20one%20mechanism%2C%20seen%20from%20the%20loss%20side%20there%0A%20%20%20%20and%20the%20weight%20side%20here.%20*Uniform*%3A%20no%20slice%20reaches%20%7BLEAD%7D%20in%20any%0A%20%20%20%20pooled%20condition%2C%20meaning%20the%20pool%20can't%20tell%20the%20positions%20apart%20at%20any%0A%20%20%20%20%CF%84%20short%20of%20collapse.%0A%0A%20%20%20%20%5B%5Egrading-note%5D%3A%20The%20Spearman%20%CF%81%20grading%20track%20is%20retired%20as%20of%20this%0A%20%20%20%20%20%20%20%20experiment.%20The%20ceiling%20analysis%20in%20ex-2.1.8%20showed%20that%20%CF%81%20against%0A%20%20%20%20%20%20%20%20%60redness%60%20can't%20reach%20its%200.8%20gate%20alongside%20full-amplitude%20containment%0A%20%20%20%20%20%20%20%20(best%20reachable%200.59%E2%80%930.82)%2C%20because%20the%20response%20target%20isn't%20monotone%0A%20%20%20%20%20%20%20%20in%20redness.%20The%20%24r%5E2%24%20track%20survives%2C%20but%20as%20a%20relative%20gate%3B%20ex-2.1.8%0A%20%20%20%20%20%20%20%20left%20the%20question%20of%20where%20a%20realistic%20absolute%20bar%20sits%20to%20a%20later%0A%20%20%20%20%20%20%20%20grid.%0A%20%20%20%20%22%22%22.replace(%22%7BTASK%7D%22%2C%20f%22%7Bex.TASK_GATE%3Ag%7D%22)%0A%20%20%20%20%20%20%20%20.replace(%22%7BPRIMARY%7D%22%2C%20ex.PRIMARY)%0A%20%20%20%20%20%20%20%20.replace(%22%7BGAIN%7D%22%2C%20f%22%7Bex.POOL_GAIN_GATE%3Ag%7D%22)%0A%20%20%20%20%20%20%20%20.replace(%22%7BGAINP%7D%22%2C%20f%22%7Bex.POOL_GAIN_PARTIAL%3Ag%7D%22)%0A%20%20%20%20%20%20%20%20.replace(%22%7BOP1GAIN%7D%22%2C%20f%22%7Bex.EX217_OP1_GAIN%3Ag%7D%22)%0A%20%20%20%20%20%20%20%20.replace(%22%7BSDRIFT%7D%22%2C%20f%22%7Bex.SYNTAX_DRIFT_GATE%3Ag%7D%22)%0A%20%20%20%20%20%20%20%20.replace(%22%7BALPHA%7D%22%2C%20f%22%7Bex.MEAN_ALIGN_GATE%3Ag%7D%22)%0A%20%20%20%20%20%20%20%20.replace(%22%7BFLOOR%7D%22%2C%20f%22%7Bex.RETENTION_FLOOR%3Ag%7D%22)%0A%20%20%20%20%20%20%20%20.replace(%22%7BRET%7D%22%2C%20f%22%7Bex.RETENTION_GATE%3Ag%7D%22)%0A%20%20%20%20%20%20%20%20.replace(%22%7BDROP%7D%22%2C%20f%22%7Bex.GRADE_R2_DROP%3Ag%7D%22)%0A%20%20%20%20%20%20%20%20.replace(%22%7BLEAD%7D%22%2C%20f%22%7Bex.LEAD_GATE%3Ag%7D%22)%0A%20%20%20%20%20%20%20%20.replace(%22%7BRGAIN%7D%22%2C%20f%22%7Bex.READ_GAIN_GATE%3Ag%7D%22)%0A%20%20%20%20)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20_res%20%3D%20load_results()%0A%20%20%20%20mo.stop(_res%20is%20None%2C%20mo.md(%22_Results%20are%20not%20published%20yet%3B%20the%20analysis%20cells%20below%20render%20once%20they%20are._%22))%0A%20%20%20%20assert%20_res%20is%20not%20None%0A%20%20%20%20metrics%2C%20arrays%20%3D%20_res%0A%20%20%20%20cells%20%3D%20%7Bc%5B%22label%22%5D%3A%20c%20for%20c%20in%20metrics%5B%22cells%22%5D%7D%0A%0A%20%20%20%20CONDS%3A%20list%5Bstr%5D%20%3D%20%5Bc%5B%22name%22%5D%20for%20c%20in%20ex.CONDITIONS%5D%0A%20%20%20%20ANCHORED%20%3D%20%5Bc%20for%20c%20in%20CONDS%20if%20c%20!%3D%20%22lam0%22%5D%0A%0A%20%20%20%20def%20over_seeds(cond%3A%20str%2C%20fn)%20-%3E%20np.ndarray%3A%0A%20%20%20%20%20%20%20%20%22%22%22One%20value%20per%20seed%20for%20a%20condition%2C%20in%20seed%20order.%22%22%22%0A%20%20%20%20%20%20%20%20return%20np.array(%5Bfn(cells%5Bf%22%7Bcond%7D-s%7Bs%7D%22%5D)%20for%20s%20in%20ex.SEEDS%5D)%0A%0A%20%20%20%20def%20acc(cond%3A%20str%2C%20set_name%3A%20str%20%3D%20%22named_holdout%22%2C%20key%3A%20str%20%3D%20%22accuracy%22)%20-%3E%20np.ndarray%3A%0A%20%20%20%20%20%20%20%20return%20over_seeds(cond%2C%20lambda%20c%3A%20c%5B%22sets%22%5D%5Bset_name%5D%5Bkey%5D)%0A%0A%20%20%20%20def%20alpha_map(cond%3A%20str)%20-%3E%20np.ndarray%3A%0A%20%20%20%20%20%20%20%20%22%22%22Seed-mean%20alignment%20map%20for%20a%20condition%3A%20(slices%2C%20colors%2C%20roles).%22%22%22%0A%20%20%20%20%20%20%20%20return%20np.mean(%5Barrays%5Bf%22%7Bcond%7D-s%7Bs%7D%2Falpha%22%5D%20for%20s%20in%20ex.SEEDS%5D%2C%20axis%3D0)%0A%0A%20%20%20%20def%20m_span(cond%3A%20str)%20-%3E%20np.ndarray%3A%0A%20%20%20%20%20%20%20%20%22%22%22Per-seed%20m_span%20%E2%80%94%20the%20statistic%20H2(a)%20reads.%22%22%22%0A%20%20%20%20%20%20%20%20return%20over_seeds(cond%2C%20lambda%20c%3A%20c%5B%22m_span%22%5D)%0A%0A%20%20%20%20def%20a_span(cond%3A%20str)%20-%3E%20np.ndarray%3A%0A%20%20%20%20%20%20%20%20%22%22%22Per-seed%20%E1%BE%B1_span%20%E2%80%94%20the%20drift%20statistic%20H2(b)%20reads.%22%22%22%0A%20%20%20%20%20%20%20%20return%20over_seeds(cond%2C%20lambda%20c%3A%20c%5B%22alpha_span%22%5D)%0A%0A%20%20%20%20def%20m_op1(cond%3A%20str)%20-%3E%20np.ndarray%3A%0A%20%20%20%20%20%20%20%20return%20over_seeds(cond%2C%20lambda%20c%3A%20c%5B%22m_op1%22%5D)%0A%0A%20%20%20%20def%20a_op1(cond%3A%20str)%20-%3E%20np.ndarray%3A%0A%20%20%20%20%20%20%20%20%22%22%22Per-seed%20%E1%BE%B1%20at%20op1%20%E2%80%94%20the%20containment%20statistic%20H3(a)%20reads.%22%22%22%0A%20%20%20%20%20%20%20%20return%20over_seeds(cond%2C%20lambda%20c%3A%20c%5B%22alpha_mean_op1%22%5D)%0A%0A%20%20%20%20def%20traj(cond%3A%20str%2C%20seed%3A%20int%2C%20key%3A%20str)%20-%3E%20np.ndarray%3A%0A%20%20%20%20%20%20%20%20return%20np.asarray(cells%5Bf%22%7Bcond%7D-s%7Bseed%7D%22%5D%5B%22traj%22%5D%5Bkey%5D%2C%20dtype%3Dfloat)%0A%0A%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20ANCHORED%2C%0A%20%20%20%20%20%20%20%20CONDS%2C%0A%20%20%20%20%20%20%20%20a_op1%2C%0A%20%20%20%20%20%20%20%20a_span%2C%0A%20%20%20%20%20%20%20%20acc%2C%0A%20%20%20%20%20%20%20%20alpha_map%2C%0A%20%20%20%20%20%20%20%20arrays%2C%0A%20%20%20%20%20%20%20%20cells%2C%0A%20%20%20%20%20%20%20%20m_op1%2C%0A%20%20%20%20%20%20%20%20m_span%2C%0A%20%20%20%20%20%20%20%20metrics%2C%0A%20%20%20%20%20%20%20%20traj%2C%0A%20%20%20%20)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(alpha_map%2C%20cells%2C%20metrics%2C%20traj)%3A%0A%20%20%20%20def%20retention(cond%3A%20str)%20-%3E%20float%20%7C%20None%3A%0A%20%20%20%20%20%20%20%20%22%22%22Lowest%20final-over-peak%20m_span%20across%20the%20seeds%20that%20reached%20the%20floor.%0A%0A%20%20%20%20%20%20%20%20The%20minimum%2C%20per%20%60ex.RETENTION_STAT%60%3B%20None%20when%20no%20run%20reached%20the%0A%20%20%20%20%20%20%20%20floor%20(the%20control)%2C%20leaving%20the%20criterion%20vacuous%20rather%20than%20failed.%0A%20%20%20%20%20%20%20%20%22%22%22%0A%20%20%20%20%20%20%20%20r%20%3D%20%5Bt%5B-1%5D%20%2F%20t.max()%20for%20s%20in%20ex.SEEDS%20if%20(t%20%3A%3D%20traj(cond%2C%20s%2C%20%22m_span%22)).max()%20%3E%3D%20ex.RETENTION_FLOOR%5D%0A%20%20%20%20%20%20%20%20return%20min(r)%20if%20r%20else%20None%0A%0A%20%20%20%20def%20pi_bar(cond%3A%20str)%20-%3E%20np.ndarray%3A%0A%20%20%20%20%20%20%20%20%22%22%22Seed-mean%20weight%20profile%20%CF%80%CC%84(l%2C%20t)%3A%20(slices%2C%20span%20roles).%22%22%22%0A%20%20%20%20%20%20%20%20return%20np.mean(%5Bnp.asarray(cells%5Bf%22%7Bcond%7D-s%7Bs%7D%22%5D%5B%22pi%22%5D%2C%20dtype%3Dfloat)%20for%20s%20in%20ex.SEEDS%5D%2C%20axis%3D0)%0A%0A%20%20%20%20READ%3A%20np.ndarray%20%3D%20np.mean(%0A%20%20%20%20%20%20%20%20%5Bnp.asarray(v%2C%20dtype%3Dfloat)%20for%20k%2C%20v%20in%20metrics%5B%22readability%22%5D.items()%20if%20k.startswith(%22lam0%22)%5D%2C%20axis%3D0%0A%20%20%20%20)%0A%20%20%20%20%23%20The%20control's%20readability%20profile%20R%C2%B2(l%2C%20t)%2C%20mean%20over%20the%20three%20un-anchored%0A%20%20%20%20%23%20seeds.%20The%20probe%20also%20covers%20the%20anchored%20cells%20(exploratory%2C%20added%20in%20the%0A%20%20%20%20%23%20results%20round)%3B%20those%20rows%20are%20read%20in%20*Exploratory%20analyses*%2C%20never%20here.%0A%0A%20%20%20%20def%20grading_r2(cond%3A%20str)%20-%3E%20float%3A%0A%20%20%20%20%20%20%20%20%22%22%22r%C2%B2%20of%20the%20seed-mean%20per-color%20op1%20response%20against%20sim%C2%B9%C2%B7%E2%81%B5%20%E2%80%94%20H3(c)'s%20statistic.%22%22%22%0A%20%20%20%20%20%20%20%20return%20ex.r2_sim(alpha_map(cond)%5B%3A%2C%20%3A%2C%200%5D.mean(axis%3D0))%0A%0A%20%20%20%20def%20read_gain(cond%3A%20str)%20-%3E%20float%3A%0A%20%20%20%20%20%20%20%20%22%22%22H4(b)%3A%20mean%20over%20the%20four%20slices%20after%20the%20embedding%20of%20%CE%A3_t%20%CF%80%CC%84%C2%B7R%C2%B2%20%E2%88%92%20mean_t%20R%C2%B2.%22%22%22%0A%20%20%20%20%20%20%20%20g%20%3D%20(pi_bar(cond)%20*%20READ).sum(axis%3D1)%20-%20READ.mean(axis%3D1)%0A%20%20%20%20%20%20%20%20return%20float(g%5B1%3A%5D.mean())%0A%0A%20%20%20%20return%20READ%2C%20grading_r2%2C%20pi_bar%2C%20read_gain%2C%20retention%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Task%20cost%20(H1)%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(CONDS%3A%20list%5Bstr%5D%2C%20acc)%3A%0A%20%20%20%20_CTRL%20%3D%20float(acc(%22lam0%22).mean())%0A%0A%20%20%20%20def%20_cell(cond%3A%20str%2C%20set_name%3A%20str%2C%20key%3A%20str%2C%20fmt%3A%20str%20%3D%20%22%7B%3A.3f%7D%22)%20-%3E%20str%3A%0A%20%20%20%20%20%20%20%20v%20%3D%20acc(cond%2C%20set_name%2C%20key)%0A%20%20%20%20%20%20%20%20return%20f%22%7Bfmt.format(v.mean())%7D%20%3Cspan%20class%3D'range'%3E%C2%B1%7B(v.max()%20-%20v.min())%20%2F%202%3A.3f%7D%3C%2Fspan%3E%22%0A%0A%20%20%20%20_rows%20%3D%20%22%22.join(%0A%20%20%20%20%20%20%20%20f%22%3Ctr%3E%3Cth%3E%3Ccode%3E%7Bc%7D%3C%2Fcode%3E%3C%2Fth%3E%22%0A%20%20%20%20%20%20%20%20f%22%3Ctd%20class%3D'num'%3E%7B_cell(c%2C%20'named_seen'%2C%20'accuracy')%7D%3C%2Ftd%3E%22%0A%20%20%20%20%20%20%20%20f%22%3Ctd%20class%3D'num'%3E%7B_cell(c%2C%20'named_holdout'%2C%20'accuracy')%7D%3C%2Ftd%3E%22%0A%20%20%20%20%20%20%20%20f%22%3Ctd%20class%3D'num'%3E%7B_cell(c%2C%20'named_holdout'%2C%20'nll')%7D%3C%2Ftd%3E%22%0A%20%20%20%20%20%20%20%20f%22%3Ctd%20class%3D'num'%3E%7B_cell(c%2C%20'open'%2C%20'guess_dist')%7D%3C%2Ftd%3E%22%0A%20%20%20%20%20%20%20%20f%22%3Ctd%20class%3D'num'%3E%7Bacc(c).mean()%20-%20_CTRL%3A%2B.4f%7D%3C%2Ftd%3E%22%0A%20%20%20%20%20%20%20%20f%22%3Ctd%3E%7B'clean'%20if%20abs(acc(c).mean()%20-%20_CTRL)%20%3C%3D%20ex.TASK_GATE%20else%20'not%20clean'%7D%3C%2Ftd%3E%3C%2Ftr%3E%22%0A%20%20%20%20%20%20%20%20for%20c%20in%20CONDS%0A%20%20%20%20)%0A%20%20%20%20_table%20%3D%20f%22%22%22%0A%20%20%20%20%3Cdiv%20class%3D%22report-table-scroll%22%3E%3Ctable%20class%3D%22report-table%22%3E%0A%20%20%20%20%20%20%3Cthead%3E%3Ctr%3E%0A%20%20%20%20%20%20%20%20%3Cth%3Econdition%3C%2Fth%3E%3Cth%20class%3D%22num%22%3Eseen%20EM%20%E2%86%91%3C%2Fth%3E%3Cth%20class%3D%22num%22%3Eholdout%20EM%20%E2%86%91%3C%2Fth%3E%0A%20%20%20%20%20%20%20%20%3Cth%20class%3D%22num%22%3Eholdout%20NLL%20%E2%86%93%3C%2Fth%3E%3Cth%20class%3D%22num%22%3E%3Ccode%3Eopen%3C%2Fcode%3E%20dist%20%E2%86%93%3C%2Fth%3E%0A%20%20%20%20%20%20%20%20%3Cth%20class%3D%22num%22%3E%CE%94%20holdout%20EM%3C%2Fth%3E%3Cth%3EH1%20gate%3C%2Fth%3E%0A%20%20%20%20%20%20%3C%2Ftr%3E%3C%2Fthead%3E%0A%20%20%20%20%20%20%3Ctbody%3E%7B_rows%7D%3C%2Ftbody%3E%0A%20%20%20%20%3C%2Ftable%3E%3C%2Fdiv%3E%0A%20%20%20%20%22%22%22%0A%20%20%20%20_caption%20%3D%20f%22%22%22%0A%20%20%20%20Behavior%20by%20condition.%20Each%20value%20is%20the%20seed%20mean%2C%20with%20half%20the%20seed%20range%20beside%20it.%20EM%20is%20exact%20match%20on%20the%20answer%20token%2C%20NLL%20its%20surprise%20in%20nats%2C%20and%20%3Ccode%3Eopen%3C%2Fcode%3E%20dist%20the%20RGB%20distance%20from%20the%20guessed%20color%20to%20the%20true%20mix%20on%20pairs%20with%20no%20named%20answer.%20%CE%94%20holdout%20EM%20is%20the%20signed%20gap%20to%20the%20in-experiment%20control%2C%20which%20the%20H1%20gate%20scores%20at%20%7Bex.TASK_GATE%3Ag%7D.%0A%20%20%20%20%22%22%22%0A%20%20%20%20mo.Html(figure_html(_table%2C%20caption%3D_caption%2C%20class_%3D%22report-figure%22))%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(CONDS%3A%20list%5Bstr%5D%2C%20acc)%3A%0A%20%20%20%20_ctrl%20%3D%20float(acc(%22lam0%22).mean())%0A%20%20%20%20_worst%20%3D%20max((c%20for%20c%20in%20CONDS%20if%20c%20!%3D%20%22lam0%22)%2C%20key%3Dlambda%20c%3A%20abs(acc(c).mean()%20-%20_ctrl))%0A%20%20%20%20mo.md(rf%22%22%22%0A%20%20%20%20**H1%20holds.**%20The%20largest%20gap%20from%20the%20control%20is%20%7Babs(acc(_worst).mean()%20-%20_ctrl)%3A.4f%7D%2C%20at%20%60%7B_worst%7D%60%2C%20against%20a%20gate%20of%20%7Bex.TASK_GATE%3Ag%7D.%20Every%20condition%20solves%20the%20task%2C%20so%20H2%E2%80%93H4%20are%20all%20scored.%20Concentrating%20the%20whole%20pull%20budget%20of%20a%20line%20onto%20one%20position%20%E2%80%94%20which%20at%20%CF%84%20%3D%200.01%20is%20nearly%20a%20hard%20min%20%E2%80%94%20costs%20nothing%20the%20task%20loss%20can%20see%2C%20consistent%20with%20every%20anchored%20experiment%20on%20this%20testbed%20so%20far.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20%23%20REVIEW%3A%20the%20method%20promises%20a%20reproduction%20check%20on%20the%20%60span-mean%60%20arm%20but%0A%20%20%20%20%23%20no%20section%20scored%20it%3B%20folded%20it%20into%20this%20placeholder%2C%20where%20its%20targets%0A%20%20%20%20%23%20already%20live.%20It%20gates%20nothing%20on%20its%20own%20%E2%80%94%20a%20miss%20would%20be%20read%20as%20the%20new%0A%20%20%20%20%23%20code%20path%20having%20moved%20the%20numbers%2C%20which%20changes%20how%20H2%20is%20read.%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Selectivity%20against%20the%20span%20mean%20(H2)%0A%0A%20%20%20%20First%20the%20reproduction%20check%20the%20method%20promises%2C%20so%20any%20drift%20introduced%20by%20the%20new%20code%20path%20is%20visible%20before%20a%20pooled%20condition%20is%20read%3A%20the%20%60span-mean%60%20condition%20re-runs%20ex-2.1.8's%20operating%20point%20through%20the%20pooled%20code%20at%20%CF%84%20%3D%20%E2%88%9E%2C%20so%20it%20should%20land%20on%20that%20experiment's%20numbers.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(a_op1%2C%20a_span%2C%20m_op1%2C%20m_span)%3A%0A%20%20%20%20_stats%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%22m_span%22%3A%20m_span%2C%0A%20%20%20%20%20%20%20%20%22alpha_span%22%3A%20a_span%2C%0A%20%20%20%20%20%20%20%20%22m_op1%22%3A%20m_op1%2C%0A%20%20%20%20%20%20%20%20%22alpha_op1%22%3A%20a_op1%2C%0A%20%20%20%20%7D%0A%20%20%20%20_names%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%22m_span%22%3A%20%22m%3Csub%3Espan%3C%2Fsub%3E%22%2C%0A%20%20%20%20%20%20%20%20%22alpha_span%22%3A%20%22%E1%BE%B1%3Csub%3Espan%3C%2Fsub%3E%22%2C%0A%20%20%20%20%20%20%20%20%22m_op1%22%3A%20%22m%3Csub%3Eop1%3C%2Fsub%3E%22%2C%0A%20%20%20%20%20%20%20%20%22alpha_op1%22%3A%20%22%E1%BE%B1%20(op1)%22%2C%0A%20%20%20%20%7D%0A%0A%20%20%20%20def%20_row(cond%3A%20str%2C%20ref_key%3A%20str)%20-%3E%20str%3A%0A%20%20%20%20%20%20%20%20ref%20%3D%20ex.EX218_REFERENCE%5Bref_key%5D%0A%20%20%20%20%20%20%20%20tds%20%3D%20%22%22%0A%20%20%20%20%20%20%20%20for%20k%2C%20fn%20in%20_stats.items()%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20v%20%3D%20fn(cond)%0A%20%20%20%20%20%20%20%20%20%20%20%20tds%20%2B%3D%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22%3Ctd%20class%3D'num'%3E%7Bv.mean()%3A.3f%7D%20%3Cspan%20class%3D'range'%3E%C2%B1%7Bv.std(ddof%3D1)%3A.3f%7D%3C%2Fspan%3E%3C%2Ftd%3E%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22%3Ctd%20class%3D'num'%3E%7Bref%5Bk%5D%3A.3f%7D%3C%2Ftd%3E%3Ctd%20class%3D'num'%3E%7Bv.mean()%20-%20ref%5Bk%5D%3A%2B.3f%7D%3C%2Ftd%3E%22%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20return%20f%22%3Ctr%3E%3Cth%3E%3Ccode%3E%7Bcond%7D%3C%2Fcode%3E%3C%2Fth%3E%7Btds%7D%3C%2Ftr%3E%22%0A%0A%20%20%20%20_head%20%3D%20%22%22.join(%0A%20%20%20%20%20%20%20%20f%22%3Cth%20class%3D'num'%3E%7B_names%5Bk%5D%7D%3C%2Fth%3E%3Cth%20class%3D'num'%3Eex-2.1.8%3C%2Fth%3E%3Cth%20class%3D'num'%3E%CE%94%3C%2Fth%3E%22%20for%20k%20in%20_stats%0A%20%20%20%20)%0A%20%20%20%20_table%20%3D%20f%22%22%22%0A%20%20%20%20%3Cdiv%20class%3D%22report-table-scroll%22%3E%3Ctable%20class%3D%22report-table%22%3E%0A%20%20%20%20%20%20%3Cthead%3E%3Ctr%3E%3Cth%3Econdition%3C%2Fth%3E%7B_head%7D%3C%2Ftr%3E%3C%2Fthead%3E%0A%20%20%20%20%20%20%3Ctbody%3E%7B_row(%22span-mean%22%2C%20%22end90-hold30%22)%7D%7B_row(%22lam0%22%2C%20%22lam0%22)%7D%3C%2Ftbody%3E%0A%20%20%20%20%3C%2Ftable%3E%3C%2Fdiv%3E%0A%20%20%20%20%22%22%22%0A%20%20%20%20_caption%20%3D%20%22%22%22%0A%20%20%20%20The%20reproduction%20check.%20Each%20statistic%20is%20this%20experiment's%20seed%20mean%20(%C2%B1%20seed%20standard%20deviation)%20beside%20the%20same%20statistic%20recomputed%20from%20ex-2.1.8's%20published%20arrays%20under%20the%20same%20per-run%20convention%2C%20and%20the%20difference.%20%3Ccode%3Espan-mean%3C%2Fcode%3E%20re-runs%20%3Ccode%3Eend90-hold30%3C%2Fcode%3E%20through%20the%20pooled%20code%20path%3B%20%3Ccode%3Elam0%3C%2Fcode%3E%20re-runs%20its%20control.%0A%20%20%20%20%22%22%22%0A%20%20%20%20mo.Html(figure_html(_table%2C%20caption%3D_caption%2C%20class_%3D%22report-figure%22))%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(a_span%2C%20m_span)%3A%0A%20%20%20%20_dm%20%3D%20m_span(%22span-mean%22).mean()%20-%20ex.EX218_REFERENCE%5B%22end90-hold30%22%5D%5B%22m_span%22%5D%0A%20%20%20%20_da%20%3D%20a_span(%22span-mean%22).mean()%20-%20ex.EX218_REFERENCE%5B%22end90-hold30%22%5D%5B%22alpha_span%22%5D%0A%20%20%20%20mo.md(rf%22%22%22%0A%20%20%20%20The%20largest%20differences%20%E2%80%94%20%7B_dm%3A%2B.3f%7D%20on%20%24m_%5Ctext%7B%7Bspan%7D%7D%24%20and%20%7B_da%3A%2B.3f%7D%20on%20%E1%BE%B1_span%20%E2%80%94%20sit%20within%20a%20seed%20spread%20of%20the%20targets%2C%20and%20the%20same%20is%20true%20of%20the%20control.%20So%20the%20per-line%20mean-of-means%20(which%20differs%20from%20ex-2.1.8's%20flat%20mean%20only%20on%20crop-truncated%20lines)%20reproduces%20the%20operating%20point%2C%20and%20the%20pooled%20conditions%20can%20be%20read%20against%20%60span-mean%60%20as%20a%20like-for-like%20baseline.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(ANCHORED%2C%20a_span%2C%20m_span)%3A%0A%20%20%20%20_CTRL_M%20%3D%20float(m_span(%22lam0%22).mean())%0A%20%20%20%20_CTRL_A%20%3D%20float(a_span(%22lam0%22).mean())%0A%20%20%20%20%23%20Control-subtracted%20per-seed%20values%2C%20computed%20once%20%E2%80%94%20%40themed%20draws%20twice.%0A%20%20%20%20_M%20%3D%20%7Bc%3A%20m_span(c)%20-%20_CTRL_M%20for%20c%20in%20ANCHORED%7D%0A%20%20%20%20_A%20%3D%20%7Bc%3A%20a_span(c)%20-%20_CTRL_A%20for%20c%20in%20ANCHORED%7D%0A%20%20%20%20_GAIN_AT%20%3D%20float(_M%5B%22span-mean%22%5D.mean())%0A%20%20%20%20_DRIFT_AT%20%3D%20float(_A%5B%22span-mean%22%5D.mean())%0A%0A%20%20%20%20%40themed(%0A%20%20%20%20%20%20%20%20name%3D%22h2-dots%22%2C%0A%20%20%20%20%20%20%20%20alt_text%3D%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20Two%20dot-plot%20panels%20sharing%20a%20horizontal%20cosine%20axis%20from%200%20to%20about%200.75%2C%20with%20five%20condition%20rows%20ordered%20by%20temperature%3A%20span-mean%20(tau%20infinite)%20on%20top%2C%20then%20the%20pooled%20conditions%20with%20tau%20falling%200.1%2C%200.03%2C%200.01%2C%20then%20op1-oracle.%20Each%20row%20shows%20three%20small%20seed%20dots%20and%20a%20vertical%20tick%20at%20their%20mean.%20Left%20panel%2C%20margin%3A%20all%20five%20rows%20cluster%20between%200.62%20and%200.69%2C%20with%20a%20dotted%20partial%20line%20at%200.71%20and%20a%20dashed%20gate%20line%20at%200.78%2C%20both%20to%20the%20right%20of%20every%20row%3B%20pool-t100%20sits%20highest%20of%20the%20pooled%20rows%20and%20the%20means%20fall%20back%20toward%20span-mean%20as%20tau%20sharpens.%20Right%20panel%2C%20drift%3A%20span-mean%20sits%20at%200.32%20and%20op1-oracle%20at%200.11%3B%20the%20pooled%20rows%20land%20between%20them%2C%20pool-t100%20leftmost%20at%200.21%20and%20the%20means%20walking%20back%20toward%20span-mean%20as%20tau%20sharpens%2C%20with%20the%20dashed%20gate%20at%200.22%20between%20pool-t100%20and%20pool-t030.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20caption%3Drf%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20**The%20H2%20statistics%2C%20control-subtracted.**%20Left%3A%20%24m_%5Ctext%7B%7Bspan%7D%7D%24%3B%20right%3A%20%E1%BE%B1_span.%20Rows%20run%20from%20the%20span%20mean%20(%CF%84%20%3D%20%E2%88%9E)%20down%20the%20sweep%20to%20the%20oracle.%20Small%20dots%20are%20seeds%2C%20the%20tick%20their%20mean%3B%20the%20%CF%84%20%3D%20%E2%88%9E%20and%20oracle%20reference%20rows%20are%20greyed.%20Dashed%20carets%20mark%20the%20H2%20gates%20for%20P%3A%20a%20margin%20gain%20of%20%7Bex.POOL_GAIN_GATE%3Ag%7D%20over%20%60span-mean%60%20(dotted%3A%20the%20%7Bex.POOL_GAIN_PARTIAL%3Ag%7D%20partial)%20and%20a%20drift%20drop%20of%20%7Bex.SYNTAX_DRIFT_GATE%3Ag%7D%20below%20it.%20The%20two%20panels%20share%20their%20scale%2C%20so%20the%20sizes%20of%20margin%20and%20drift%20compare%20directly.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20)%0A%20%20%20%20def%20_plot()%20-%3E%20plt.Figure%3A%0A%20%20%20%20%20%20%20%20from%20typing%20import%20cast%0A%0A%20%20%20%20%20%20%20%20from%20mini.vis%20import%20AxesRow%0A%0A%20%20%20%20%20%20%20%20%23%20Reads%20top-to-bottom%20by%20effective%20%CF%84%3A%20span%20mean%20(%E2%88%9E)%2C%20the%20sweep%2C%20the%20oracle.%0A%20%20%20%20%20%20%20%20_rows%20%3D%20%5Bex.ORACLE_ARM%2C%20*ex.POOLED_NAMES%2C%20ex.MEAN_ARM%5D%0A%20%20%20%20%20%20%20%20_grey%20%3D%20light_dark(%22%23999%22%2C%20%22%23777%22)%0A%20%20%20%20%20%20%20%20_gate%20%3D%20light_dark(%22%23555%22%2C%20%22%23bbb%22)%0A%20%20%20%20%20%20%20%20_ink%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22span-mean%22%3A%20_grey%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22op1-oracle%22%3A%20_grey%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22pool-t010%22%3A%20light_dark(%22%237fb3d8%22%2C%20%22%234f7ea6%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22pool-t030%22%3A%20light_dark(%22%231f6fb4%22%2C%20%22%235fa8dd%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22pool-t100%22%3A%20light_dark(%22%2312497c%22%2C%20%22%238ec4ea%22)%2C%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20fig%2C%20axes%20%3D%20plt.subplots(1%2C%202%2C%20figsize%3D(7.2%2C%202.4)%2C%20sharex%3DTrue%2C%20sharey%3DTrue%2C%20layout%3D%22constrained%22)%0A%20%20%20%20%20%20%20%20axes%20%3D%20cast(AxesRow%2C%20axes)%0A%20%20%20%20%20%20%20%20for%20ax%2C%20data%2C%20title%20in%20zip(%0A%20%20%20%20%20%20%20%20%20%20%20%20axes%2C%20(_M%2C%20_A)%2C%20(r%22%24m_%5Cmathrm%7Bspan%7D%24%20%E2%88%92%20control%22%2C%20%22%E1%BE%B1%24_%5C%5Cmathrm%7Bspan%7D%24%20%E2%88%92%20control%22)%2C%20strict%3DTrue%0A%20%20%20%20%20%20%20%20)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20yi%2C%20cond%20in%20enumerate(_rows)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20v%20%3D%20data%5Bcond%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.plot(v%2C%20%5Byi%5D%20*%20len(v)%2C%20%22o%22%2C%20ms%3D3.5%2C%20color%3D_ink%5Bcond%5D%2C%20alpha%3D0.55%2C%20mew%3D0)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.plot(v.mean()%2C%20yi%2C%20%22%7C%22%2C%20ms%3D18%2C%20color%3D_ink%5Bcond%5D)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_title(title%2C%20fontsize%3D%22small%22%2C%20color%3D_grey)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_yticks(range(len(_rows))%2C%20_rows%2C%20fontsize%3D8)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_xlim(0%2C%200.82)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.tick_params(axis%3D%22x%22%2C%20labelsize%3D8)%0A%20%20%20%20%20%20%20%20for%20x%2C%20ls%20in%20((_GAIN_AT%20%2B%20ex.POOL_GAIN_GATE%2C%20(0%2C%20(4%2C%203)))%2C%20(_GAIN_AT%20%2B%20ex.POOL_GAIN_PARTIAL%2C%20(0%2C%20(1%2C%202))))%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20axes%5B0%5D.axvline(x%2C%20color%3D_gate%2C%20lw%3D0.9%2C%20ls%3Dls)%0A%20%20%20%20%20%20%20%20axes%5B1%5D.axvline(_DRIFT_AT%20-%20ex.SYNTAX_DRIFT_GATE%2C%20color%3D_gate%2C%20lw%3D0.9%2C%20ls%3D(0%2C%20(4%2C%203)))%0A%20%20%20%20%20%20%20%20return%20fig%0A%0A%20%20%20%20mo.Html(_plot())%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(ANCHORED%2C%20a_span%2C%20grading_r2%2C%20m_op1%2C%20m_span)%3A%0A%20%20%20%20_CTRL_M%20%3D%20float(m_span(%22lam0%22).mean())%0A%20%20%20%20_headroom%20%3D%20m_span(ex.ORACLE_ARM).mean()%20-%20m_span(ex.MEAN_ARM).mean()%0A%0A%20%20%20%20def%20_row(c%3A%20str)%20-%3E%20str%3A%0A%20%20%20%20%20%20%20%20gain%20%3D%20m_span(c).mean()%20-%20m_span(ex.MEAN_ARM).mean()%0A%20%20%20%20%20%20%20%20frac%20%3D%20f%22%7Bgain%20%2F%20_headroom%3A.0%25%7D%22%20if%20c%20in%20ex.POOLED_NAMES%20else%20%22%E2%80%94%22%0A%20%20%20%20%20%20%20%20bold%20%3D%20%22%3Cstrong%3E%7B%7D%3C%2Fstrong%3E%22.format%20if%20c%20%3D%3D%20ex.PRIMARY%20else%20%22%7B%7D%22.format%0A%20%20%20%20%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20f%22%3Ctr%3E%3Cth%3E%7Bbold(f'%3Ccode%3E%7Bc%7D%3C%2Fcode%3E')%7D%3C%2Fth%3E%22%0A%20%20%20%20%20%20%20%20%20%20%20%20f%22%3Ctd%20class%3D'num'%3E%7Bm_span(c).mean()%3A.3f%7D%20%3Cspan%20class%3D'range'%3E%C2%B1%7Bm_span(c).std(ddof%3D1)%3A.3f%7D%3C%2Fspan%3E%3C%2Ftd%3E%22%0A%20%20%20%20%20%20%20%20%20%20%20%20f%22%3Ctd%20class%3D'num'%3E%7Bm_span(c).mean()%20-%20_CTRL_M%3A.3f%7D%3C%2Ftd%3E%22%0A%20%20%20%20%20%20%20%20%20%20%20%20f%22%3Ctd%20class%3D'num'%3E%7Bgain%3A%2B.3f%7D%3C%2Ftd%3E%22%0A%20%20%20%20%20%20%20%20%20%20%20%20f%22%3Ctd%20class%3D'num'%3E%7Bfrac%7D%3C%2Ftd%3E%22%0A%20%20%20%20%20%20%20%20%20%20%20%20f%22%3Ctd%20class%3D'num'%3E%7Ba_span(c).mean()%3A.3f%7D%20%3Cspan%20class%3D'range'%3E%C2%B1%7Ba_span(c).std(ddof%3D1)%3A.3f%7D%3C%2Fspan%3E%3C%2Ftd%3E%22%0A%20%20%20%20%20%20%20%20%20%20%20%20f%22%3Ctd%20class%3D'num'%3E%7Bm_op1(c).mean()%3A.3f%7D%3C%2Ftd%3E%22%0A%20%20%20%20%20%20%20%20%20%20%20%20f%22%3Ctd%20class%3D'num'%3E%7Bgrading_r2(c)%3A.2f%7D%3C%2Ftd%3E%3C%2Ftr%3E%22%0A%20%20%20%20%20%20%20%20)%0A%0A%20%20%20%20_table%20%3D%20f%22%22%22%0A%20%20%20%20%3Cdiv%20class%3D%22report-table-scroll%22%3E%3Ctable%20class%3D%22report-table%22%3E%0A%20%20%20%20%20%20%3Cthead%3E%3Ctr%3E%0A%20%20%20%20%20%20%20%20%3Cth%3Econdition%3C%2Fth%3E%3Cth%20class%3D%22num%22%3Em%3Csub%3Espan%3C%2Fsub%3E%20%E2%86%91%3C%2Fth%3E%0A%20%20%20%20%20%20%20%20%3Cth%20class%3D%22num%22%3E%E2%88%92%20control%3C%2Fth%3E%3Cth%20class%3D%22num%22%3E%E2%88%92%20span-mean%3C%2Fth%3E%0A%20%20%20%20%20%20%20%20%3Cth%20class%3D%22num%22%3Eoracle%20frac%3C%2Fth%3E%3Cth%20class%3D%22num%22%3E%E1%BE%B1%3Csub%3Espan%3C%2Fsub%3E%20%E2%86%93%3C%2Fth%3E%0A%20%20%20%20%20%20%20%20%3Cth%20class%3D%22num%22%3Em%3Csub%3Eop1%3C%2Fsub%3E%3C%2Fth%3E%3Cth%20class%3D%22num%22%3Er%C2%B2%3C%2Fth%3E%0A%20%20%20%20%20%20%3C%2Ftr%3E%3C%2Fthead%3E%0A%20%20%20%20%20%20%3Ctbody%3E%7B%22%22.join(_row(c)%20for%20c%20in%20ANCHORED)%7D%3C%2Ftbody%3E%0A%20%20%20%20%3C%2Ftable%3E%3C%2Fdiv%3E%0A%20%20%20%20%22%22%22%0A%20%20%20%20_caption%20%3D%20f%22%22%22%0A%20%20%20%20The%20%CF%84%20sweep%20beside%20its%20references%2C%20seed%20means%20(%C2%B1%20seed%20standard%20deviation%20where%20quoted).%20Only%20the%20primary%20condition%20(%3Cstrong%3Ebold%3C%2Fstrong%3E)%20is%20gated%3B%20%22oracle%20frac%22%20is%20the%20fraction%20of%20the%20span-mean-to-oracle%20gap%20recovered%2C%20whose%20denominator%20is%20%7B_headroom%3A.3f%7D.%20m%3Csub%3Eop1%3C%2Fsub%3E%20is%20carried%20for%20continuity%20with%20ex-2.1.7%2F8%2C%20and%20r%C2%B2%20previews%20the%20grading%20track%20scored%20under%20H3.%0A%20%20%20%20%22%22%22%0A%20%20%20%20mo.Html(figure_html(_table%2C%20caption%3D_caption%2C%20class_%3D%22report-figure%22))%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(a_span%2C%20cells%2C%20m_span%2C%20pi_bar)%3A%0A%20%20%20%20_P%20%3D%20ex.PRIMARY%0A%20%20%20%20_gain%20%3D%20m_span(_P).mean()%20-%20m_span(ex.MEAN_ARM).mean()%0A%20%20%20%20_drop%20%3D%20a_span(ex.MEAN_ARM).mean()%20-%20a_span(_P).mean()%0A%20%20%20%20_headroom%20%3D%20m_span(ex.ORACLE_ARM).mean()%20-%20m_span(ex.MEAN_ARM).mean()%0A%20%20%20%20%23%20op1's%20share%20of%20the%20pull%20budget%2C%20mean%20over%20slices%3B%20the%20references%20by%20construction.%0A%20%20%20%20_share%20%3D%20%7Bc%3A%20pi_bar(c)%5B%3A%2C%200%5D.mean()%20for%20c%20in%20ex.POOLED_NAMES%7D%0A%0A%20%20%20%20def%20_latched(cond%3A%20str)%20-%3E%20list%5Bint%5D%3A%0A%20%20%20%20%20%20%20%20%22%22%22Seeds%20whose%20slice-4%20softmin%20weight%20left%20op1%20(weight%20%3C%200.5).%22%22%22%0A%20%20%20%20%20%20%20%20pis%20%3D%20%7Bs%3A%20np.asarray(cells%5Bf%22%7Bcond%7D-s%7Bs%7D%22%5D%5B%22pi%22%5D%2C%20dtype%3Dfloat)%20for%20s%20in%20ex.SEEDS%7D%0A%20%20%20%20%20%20%20%20return%20%5Bs%20for%20s%2C%20pi%20in%20pis.items()%20if%20pi%5B4%2C%200%5D%20%3C%200.5%5D%0A%0A%20%20%20%20_l30%20%3D%20_latched(_P)%5B0%5D%0A%20%20%20%20mo.md(rf%22%22%22%0A%20%20%20%20**H2%20is%20unmet.**%20On%20the%20primary%20condition%20%60%7B_P%7D%60%2C%20(a)%20the%20margin%20gain%20is%20%7B_gain%3A%2B.3f%7D%20against%20a%20gate%20of%20%7Bex.POOL_GAIN_GATE%3Ag%7D%20(partial%20%7Bex.POOL_GAIN_PARTIAL%3Ag%7D)%2C%20and%20(b)%20the%20syntax-role%20drift%20falls%20by%20%7B_drop%3A.3f%7D%20against%20a%20required%20%7Bex.SYNTAX_DRIFT_GATE%3Ag%7D.%20Both%20moved%20the%20way%20the%20mechanism%20predicts%20and%20neither%20reaches%20its%20gate%2C%20so%20neither%20partial%20applies.%0A%0A%20%20%20%20Three%20things%20the%20gate%20arithmetic%20hides%3A%0A%0A%20%20%20%201.%20**The%20margin%20headroom%20collapsed%20before%20the%20sweep%20began.**%20The%20gate%20was%20sized%20from%20the%20op1%20oracle's%20%2B%7Bex.EX217_OP1_GAIN%3Ag%7D%20margin%20gain%20in%20ex-2.1.7%20%E2%80%94%20measured%20at%20op1%2C%20under%20the%20old%20schedule.%20Here%2C%20scored%20as%20%24m_%5Ctext%7B%7Bspan%7D%7D%24%20at%20the%20ex-2.1.8%20operating%20point%2C%20the%20oracle's%20whole%20advantage%20over%20the%20span%20mean%20is%20%7B_headroom%3A.3f%7D%3A%20less%20than%20half%20the%20gate.%20No%20condition%2C%20oracle%20included%2C%20could%20have%20passed%20H2(a)%20as%20preregistered.%20The%20primary%20recovered%20%7B_gain%20%2F%20_headroom%3A.0%25%7D%20of%20the%20headroom%20that%20existed.%0A%0A%20%20%20%202.%20**Neither%20statistic%20is%20monotone%20in%20%CF%84.**%20In%20the%20dot%20chart%20both%20panels%20walk%20from%20%60span-mean%60%20toward%20the%20oracle%20only%20as%20far%20as%20%CF%84%20%3D%200.1%2C%20then%20step%20back%3A%20the%20sharper%20the%20pool%2C%20the%20closer%20the%20condition%20sits%20to%20the%20span%20mean%20again.%20What%20the%20statistics%20do%20track%20is%20op1's%20share%20of%20the%20pull%20budget%20%E2%80%94%200.25%20for%20the%20span%20mean%20by%20construction%2C%20then%20%7B_share%5B%22pool-t100%22%5D%3A.2f%7D%20at%20%CF%84%20%3D%200.1%2C%20%7B_share%5B_P%5D%3A.2f%7D%20at%20%CF%84%20%3D%200.03%2C%20%7B_share%5B%22pool-t010%22%5D%3A.2f%7D%20at%20%CF%84%20%3D%200.01%20(mean%20over%20slices%20of%20the%20weight%20profiles%20under%20H4)%2C%20and%201.0%20for%20the%20oracle.%20The%20share%20peaks%20at%20%CF%84%20%3D%200.1%20because%20a%20sharper%20pool%20concentrates%20the%20budget%20harder%20but%20risks%20putting%20it%20on%20the%20wrong%20role%3A%20at%20depth%2C%20each%20seed%20of%20the%20two%20sharper%20rungs%20commits%20everything%20to%20a%20single%20role%2C%20and%20at%20%CF%84%20%3D%200.01%20two%20seeds%20of%20three%20commit%20to%20%60%2B%60%20(at%20%CF%84%20%3D%200.03%2C%20one%3B%20at%20%CF%84%20%3D%200.1%2C%20none).%20The%20same%20decomposition%20holds%20within%20a%20condition%20%E2%80%94%20%60%7B_P%7D%60's%20committed-to-%60%2B%60%20seed%20(s%7B_l30%7D)%20scores%20%24m_%5Ctext%7B%7Bspan%7D%7D%24%20%7Bm_span(_P)%5B_l30%5D%3A.2f%7D%20and%20%E1%BE%B1_span%20%7Ba_span(_P)%5B_l30%5D%3A.2f%7D%20where%20its%20op1-keeping%20seeds%20score%20%E2%89%88%7Bnp.mean(np.delete(m_span(_P)%2C%20_l30))%3A.2f%7D%20and%20%E2%89%88%7Bnp.mean(np.delete(a_span(_P)%2C%20_l30))%3A.2f%7D.%20So%20the%20finite-%CF%84%20means%20differ%20mostly%20through%20how%20many%20seeds%20latched%2C%20and%20the%20sweep's%20message%20is%20a%20latch-rate%20trend%20rather%20than%20a%20smooth%20dose%20response%3B%20with%20three%20seeds%20per%20rung%20the%20rates%20themselves%20are%20coarse%2C%20so%20carrying%20a%20%CF%84%20forward%20should%20rest%20on%20the%20latch%20mechanism%20(*Where%20the%20weight%20went*)%2C%20with%20more%20seeds%20at%20the%20chosen%20rung%20in%20the%20next%20design.%0A%0A%20%20%20%203.%20**Why%20the%20span%20mean%20scores%20near%20the%20oracle.**%20Near%20on%20the%20absolute%20scale%3A%20its%20%24m_%5Ctext%7B%7Bspan%7D%7D%24%20is%20%7Bm_span(ex.MEAN_ARM).mean()%20%2F%20m_span(ex.ORACLE_ARM).mean()%3A.0%25%7D%20of%20the%20oracle's%2C%20where%20the%20un-anchored%20control%20sits%20at%20%7Bm_span(%22lam0%22).mean()%3A.2f%7D%20%E2%80%94%20the%20whole%20sweep%20lives%20in%20the%20table's%20last%20few%20hundredths.%20The%20role%20profiles%20below%20show%20why%3A%20at%20depth%2C%20every%20span%20role%20of%20the%20%60span-mean%60%20condition%20carries%20margin%20(its%20syntax-role%20states%20attend%20back%20to%20op1%2C%20so%20they%20become%20selective%20too)%2C%20and%20a%20max%20over%20roles%20only%20needs%20one%20good%20role.%20Pooling%20*did*%20change%20the%20shape%20%E2%80%94%20margin%20and%20drift%20both%20withdraw%20from%20op2%20and%20%60%3D%60%20almost%20entirely%20%E2%80%94%20but%20op1's%20own%20margin%20is%20nearly%20the%20same%20in%20every%20anchored%20condition%2C%20so%20the%20max%20barely%20moves.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(alpha_map)%3A%0A%20%20%20%20_CONDS3%20%3D%20%5Bex.MEAN_ARM%2C%20ex.PRIMARY%2C%20ex.ORACLE_ARM%5D%0A%20%20%20%20_prof%20%3D%20%7B%7D%0A%20%20%20%20for%20_c%20in%20_CONDS3%3A%0A%20%20%20%20%20%20%20%20_a%20%3D%20alpha_map(_c)%0A%20%20%20%20%20%20%20%20_m%20%3D%20np.einsum(%22c%2Clct-%3Elt%22%2C%20ex.LABEL_W%2C%20_a)%20-%20_a.mean(axis%3D1)%0A%20%20%20%20%20%20%20%20_prof%5B_c%5D%20%3D%20%7B%22margin%22%3A%20_m%5B%3A%2C%20%3A%20ex.SPAN%5D%2C%20%22drift%22%3A%20_a%5B%3A%2C%20%3A%2C%20%3A%20ex.SPAN%5D.mean(axis%3D1)%7D%0A%0A%20%20%20%20%40themed(%0A%20%20%20%20%20%20%20%20name%3D%22role-profiles%22%2C%0A%20%20%20%20%20%20%20%20alt_text%3D%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20Six%20panels%20in%20a%20two-by-three%20grid%3A%20columns%20are%20span-mean%2C%20pool-t030%20and%20op1-oracle%3B%20the%20top%20row%20plots%20margin%20by%20role%20against%20slice%2C%20the%20bottom%20row%20drift%20by%20role%2C%20both%20from%20about%20-0.1%20to%200.9.%20Four%20marked%20lines%20per%20panel%2C%20one%20per%20span%20role.%20Top%20left%3A%20all%20four%20roles%20rise%20together%20to%20between%200.5%20and%200.8%20after%20the%20embedding.%20Top%20middle%20and%20top%20right%3A%20the%20op1%20line%20alone%20stays%20high%2C%20about%200.8%20at%20slice%201%20falling%20to%200.4%20(middle)%20or%200.5%20(right)%20at%20slice%204%2C%20while%20the%20plus%2C%20op2%20and%20equals%20lines%20sit%20below%200.3.%20Bottom%20left%3A%20plus%20and%20equals%20start%20near%200.55%20at%20the%20embedding%20and%20fall%20with%20depth%20while%20op2%20rises%20to%20about%200.28.%20Bottom%20middle%3A%20the%20plus%20line%20starts%20at%200.49%20and%20decays%20to%20near%20zero%3B%20op2%20and%20equals%20stay%20low.%20Bottom%20right%3A%20the%20same%20shape%20with%20plus%20starting%20lower%2C%20at%200.3.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20caption%3Dr%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20**Where%20the%20margin%20and%20the%20drift%20live.**%20Margin%20(top)%20and%20drift%20(bottom)%20by%20span%20role%2C%20per%20slice%2C%20seed%20means%3A%20%24m(%5Cell%2C%20t)%24%20and%20the%20unweighted%20mean%20alignment%20%24%5Cbar%5Calpha(%5Cell%2C%20t)%24.%20Columns%3A%20the%20span%20mean%2C%20the%20primary%2C%20and%20the%20op1%20oracle.%20The%20scored%20statistics%20take%20the%20per-slice%20max%20over%20these%20lines%20(%24m_%5Ctext%7Bspan%7D%24%20from%20the%20top%20row%2C%20%E1%BE%B1_span%20from%20the%20bottom)%2C%20so%20a%20single%20high%20line%20is%20all%20either%20statistic%20sees.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20)%0A%20%20%20%20def%20_plot()%20-%3E%20plt.Figure%3A%0A%20%20%20%20%20%20%20%20_role_ink%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22op1%22%3A%20light_dark(%22%23c1332a%22%2C%20%22%23f0665a%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%2B%22%3A%20light_dark(%22%231f6fb4%22%2C%20%22%235fa8dd%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22op2%22%3A%20light_dark(%22%232a9d8f%22%2C%20%22%235fc9bd%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%3D%22%3A%20light_dark(%22%237b3fa0%22%2C%20%22%23b98ce0%22)%2C%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20_grey%20%3D%20light_dark(%22%23666%22%2C%20%22%23999%22)%0A%20%20%20%20%20%20%20%20fig%2C%20axes%20%3D%20plt.subplots(2%2C%203%2C%20figsize%3D(7.5%2C%204.2)%2C%20sharex%3DTrue%2C%20sharey%3DTrue%2C%20layout%3D%22constrained%22)%0A%20%20%20%20%20%20%20%20axes%20%3D%20cast(AxesGrid%2C%20axes)%0A%20%20%20%20%20%20%20%20_x%20%3D%20np.arange(5)%0A%20%20%20%20%20%20%20%20for%20row%2C%20quantity%20in%20zip(axes%2C%20(%22margin%22%2C%20%22drift%22)%2C%20strict%3DTrue)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20ax%2C%20cond%20in%20zip(row%2C%20_CONDS3%2C%20strict%3DTrue)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.axhline(0%2C%20color%3Dlight_dark(%22%23bbb%22%2C%20%22%23555%22)%2C%20lw%3D0.8%2C%20zorder%3D0)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20for%20ti%2C%20ink%20in%20enumerate(_role_ink.values())%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.plot(_x%2C%20_prof%5Bcond%5D%5Bquantity%5D%5B%3A%2C%20ti%5D%2C%20color%3Dink%2C%20lw%3D1.5%2C%20marker%3D%22o%22%2C%20ms%3D3%2C%20mew%3D0)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20quantity%20%3D%3D%20%22margin%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.set_title(%22pool-t030%20(primary)%22%20if%20cond%20%3D%3D%20ex.PRIMARY%20else%20cond%2C%20fontsize%3D9.5)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.set_ylim(-0.12%2C%200.92)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.tick_params(labelsize%3D8)%0A%20%20%20%20%20%20%20%20for%20ax%20in%20axes%5B1%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_xticks(_x%2C%20%5B%22emb%22%2C%20%221%22%2C%20%222%22%2C%20%223%22%2C%20%224%22%5D)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_xlabel(%22slice%22%2C%20fontsize%3D%22x-small%22)%0A%20%20%20%20%20%20%20%20axes%5B0%5D%5B0%5D.set_ylabel(%22margin%22%2C%20fontsize%3D%22small%22)%0A%20%20%20%20%20%20%20%20axes%5B1%5D%5B0%5D.set_ylabel(%22drift%22%2C%20fontsize%3D%22small%22)%0A%20%20%20%20%20%20%20%20_leg%20%3D%20%5Bplt.Line2D(%5B%5D%2C%20%5B%5D%2C%20color%3Dink%2C%20lw%3D1.5)%20for%20ink%20in%20_role_ink.values()%5D%0A%20%20%20%20%20%20%20%20axes%5B0%5D%5B2%5D.legend(_leg%2C%20list(_role_ink)%2C%20fontsize%3D8%2C%20frameon%3DFalse%2C%20loc%3D%22upper%20right%22%2C%20labelcolor%3D_grey)%0A%20%20%20%20%20%20%20%20return%20fig%0A%0A%20%20%20%20mo.Html(_plot())%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(alpha_map)%3A%0A%20%20%20%20_CONDS3%20%3D%20%5Bex.MEAN_ARM%2C%20ex.PRIMARY%2C%20ex.ORACLE_ARM%5D%0A%20%20%20%20_prof%20%3D%20%7B%7D%0A%20%20%20%20for%20_c%20in%20_CONDS3%3A%0A%20%20%20%20%20%20%20%20_a%20%3D%20alpha_map(_c)%0A%20%20%20%20%20%20%20%20_m%20%3D%20np.einsum(%22c%2Clct-%3Elt%22%2C%20ex.LABEL_W%2C%20_a)%20-%20_a.mean(axis%3D1)%0A%20%20%20%20%20%20%20%20_prof%5B_c%5D%20%3D%20%7B%22margin%22%3A%20_m%5B%3A%2C%20%3A%20ex.SPAN%5D%2C%20%22drift%22%3A%20_a%5B%3A%2C%20%3A%2C%20%3A%20ex.SPAN%5D.mean(axis%3D1)%7D%0A%20%20%20%20_x%20%3D%20np.arange(ex.SPAN)%0A%0A%20%20%20%20%40themed(%0A%20%20%20%20%20%20%20%20name%3D%22position-profiles%22%2C%0A%20%20%20%20%20%20%20%20alt_text%3D%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20A%20five-by-three%20grid%20of%20small%20flush%20panels%3A%20the%20same%20margin%20and%20drift%20data%20as%20the%20previous%20figure%2C%20transposed.%20Columns%20are%20span-mean%2C%20pool-t030%20and%20op1-oracle%3B%20rows%20are%20residual%20slices%20with%20the%20last%20slice%20on%20top%20and%20the%20embedding%20at%20the%20bottom%3B%20each%20panel%20spans%20the%20four%20span%20roles%20op1%2C%20plus%2C%20op2%20and%20equals%2C%20from%200%20to%20about%200.95%20vertically.%20A%20shaded%20smooth-step%20area%20shows%20the%20margin%20and%20a%20solid%20line%20the%20drift.%20In%20the%20span-mean%20column%20every%20row%20above%20the%20embedding%20is%20a%20wide%20raised%20block%3A%20margin%20between%200.5%20and%200.8%20at%20all%20four%20roles.%20In%20the%20pool-t030%20and%20oracle%20columns%20the%20block%20narrows%20to%20a%20single%20tall%20step%20at%20op1%2C%20with%20the%20other%20roles%20below%200.3.%20The%20drift%20line%20roughly%20shadows%20the%20margin%20at%20about%20half%20its%20height%20in%20every%20panel%3B%20on%20the%20embedding%20row%20it%20is%20a%20step%20at%20plus%20and%20equals%20for%20span-mean%2C%20at%20plus%20alone%20for%20pool-t030%2C%20and%20lower%2C%20about%200.3%20at%20plus%2C%20for%20the%20oracle.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20caption%3Dr%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20**The%20same%20profiles%2C%20position-major.**%20Margin%20%24m(%5Cell%2C%20t)%24%20(shaded%20area)%20and%20drift%20%24%5Cbar%5Calpha(%5Cell%2C%20t)%24%20(line)%20over%20the%20four%20span%20roles%2C%20one%20panel%20per%20residual%20slice%20with%20the%20embedding%20at%20the%20bottom%20%E2%80%94%20the%20transpose%20of%20the%20figure%20above%2C%20in%20the%20layout%20the%20weight%20profiles%20under%20H4%20use.%20Columns%3A%20the%20span%20mean%2C%20the%20primary%2C%20and%20the%20op1%20oracle.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20)%0A%20%20%20%20def%20_plot()%20-%3E%20plt.Figure%3A%0A%20%20%20%20%20%20%20%20from%20matplotlib.layout_engine%20import%20ConstrainedLayoutEngine%0A%0A%20%20%20%20%20%20%20%20from%20mini.vis%20import%20smooth_step%2C%20smooth_step_area%0A%0A%20%20%20%20%20%20%20%20_margin_ink%20%3D%20light_dark(%22%23b4531f%22%2C%20%22%23dd8f5f%22)%0A%20%20%20%20%20%20%20%20_drift_ink%20%3D%20light_dark(%22%231f6fb4%22%2C%20%22%235fa8dd%22)%0A%20%20%20%20%20%20%20%20_grey%20%3D%20light_dark(%22%23666%22%2C%20%22%23999%22)%0A%20%20%20%20%20%20%20%20fig%2C%20axes%20%3D%20plt.subplots(5%2C%203%2C%20figsize%3D(7.0%2C%203.7)%2C%20sharex%3DTrue%2C%20sharey%3DTrue)%0A%20%20%20%20%20%20%20%20axes%20%3D%20cast(AxesGrid%2C%20axes)%0A%20%20%20%20%20%20%20%20_engine%20%3D%20fig.get_layout_engine()%0A%20%20%20%20%20%20%20%20assert%20isinstance(_engine%2C%20ConstrainedLayoutEngine)%0A%20%20%20%20%20%20%20%20_engine.set(hspace%3D0%2C%20h_pad%3D0.01%2C%20wspace%3D0.05)%0A%20%20%20%20%20%20%20%20for%20col%2C%20cond%20in%20enumerate(_CONDS3)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20row%20in%20range(5)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sl%20%3D%204%20-%20row%20%20%23%20last%20slice%20on%20top%2C%20the%20embedding%20at%20the%20bottom%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax%20%3D%20axes%5Brow%5D%5Bcol%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20smooth_step_area(ax%2C%20_x%2C%20_prof%5Bcond%5D%5B%22margin%22%5D%5Bsl%5D%2C%20ramp%3D0.5%2C%20color%3D_margin_ink%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20alpha%3Dlight_dark(0.25%2C%200.3))%20%20%23%20fmt%3A%20skip%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20smooth_step(ax%2C%20_x%2C%20_prof%5Bcond%5D%5B%22margin%22%5D%5Bsl%5D%2C%20ramp%3D0.5%2C%20color%3D_margin_ink%2C%20lw%3D1.2)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20smooth_step(ax%2C%20_x%2C%20_prof%5Bcond%5D%5B%22drift%22%5D%5Bsl%5D%2C%20ramp%3D0.5%2C%20color%3D_drift_ink%2C%20lw%3D1.5)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.set(ylim%3D(-0.08%2C%200.98)%2C%20xlim%3D(-0.4%2C%20ex.SPAN%20-%200.6)%2C%20yticks%3D%5B0.0%2C%200.4%2C%200.8%5D)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.spines%5B%3A%5D.set_visible(False)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.grid(axis%3D%22y%22%2C%20which%3D%22major%22%2C%20c%3D%22%23888%22%2C%20alpha%3D0.2)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.tick_params(axis%3D%22x%22%2C%20length%3D0%2C%20labelbottom%3DFalse)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.tick_params(axis%3D%22y%22%2C%20left%3DTrue%2C%20right%3DTrue%2C%20direction%3D%22in%22%2C%20labelleft%3DFalse%2C%20labelright%3DFalse)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20col%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.set_ylabel(%22emb%22%20if%20sl%20%3D%3D%200%20else%20f%22%7Bsl%7D%22%2C%20fontsize%3D8)%0A%20%20%20%20%20%20%20%20%20%20%20%20axes%5B0%5D%5Bcol%5D.set_title(%22pool-t030%20(primary)%22%20if%20cond%20%3D%3D%20ex.PRIMARY%20else%20cond%2C%20fontsize%3D9.5)%0A%20%20%20%20%20%20%20%20%20%20%20%20axes%5B4%5D%5Bcol%5D.set_xticks(_x%2C%20ex.ROLES)%0A%20%20%20%20%20%20%20%20%20%20%20%20axes%5B4%5D%5Bcol%5D.tick_params(axis%3D%22x%22%2C%20labelbottom%3DTrue%2C%20labelsize%3D8.5)%0A%20%20%20%20%20%20%20%20axes%5B4%5D%5B2%5D.tick_params(axis%3D%22y%22%2C%20labelright%3DTrue%2C%20labelsize%3D7%2C%20pad%3D2)%0A%20%20%20%20%20%20%20%20fig.supylabel(%22slice%22%2C%20fontsize%3D9)%0A%20%20%20%20%20%20%20%20_m_key%20%3D%20plt.Rectangle((0%2C%200)%2C%201%2C%201%2C%20fc%3D_margin_ink%2C%20alpha%3D0.35%2C%20ec%3D%22none%22)%0A%20%20%20%20%20%20%20%20_d_key%20%3D%20plt.Line2D(%5B%5D%2C%20%5B%5D%2C%20color%3D_drift_ink%2C%20lw%3D1.5)%0A%20%20%20%20%20%20%20%20fig.legend(%5B_m_key%2C%20_d_key%5D%2C%20%5Br%22margin%20%24m(%5Cell%2C%20t)%24%22%2C%20r%22drift%20%24%5Cbar%5Calpha(%5Cell%2C%20t)%24%22%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fontsize%3D8.5%2C%20frameon%3DFalse%2C%20ncols%3D2%2C%20loc%3D%22lower%20center%22%2C%20bbox_to_anchor%3D(0.5%2C%201.0)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20labelcolor%3D_grey)%20%20%23%20fmt%3A%20skip%0A%20%20%20%20%20%20%20%20return%20fig%0A%0A%20%20%20%20mo.Html(_plot())%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(alpha_map)%3A%0A%20%20%20%20_emb%20%3D%20%7Bc%3A%20alpha_map(c)%5B0%2C%20%3A%2C%20%3A%20ex.SPAN%5D.mean(axis%3D0)%20for%20c%20in%20%5Bex.MEAN_ARM%2C%20ex.PRIMARY%2C%20ex.ORACLE_ARM%5D%7D%0A%20%20%20%20mo.md(rf%22%22%22%0A%20%20%20%20The%20drift%20survives%20pooling%20only%20at%20the%20%60%2B%60%20role.%20On%20the%20embedding%20row%2C%20the%20primary's%20pooling%20released%20%60%3D%60%20almost%20entirely%20(drift%20%7B_emb%5Bex.MEAN_ARM%5D%5B3%5D%3A.2f%7D%20under%20the%20span%20mean%20%E2%86%92%20%7B_emb%5Bex.PRIMARY%5D%5B3%5D%3A.2f%7D)%20but%20left%20%7B_emb%5Bex.PRIMARY%5D%5B1%5D%3A.2f%7D%20on%20%60%2B%60%2C%20barely%20below%20the%20span%20mean's%20%7B_emb%5Bex.MEAN_ARM%5D%5B1%5D%3A.2f%7D%20%E2%80%94%20consistent%20with%20the%20~0.2%20of%20softmin%20weight%20the%20pull%20still%20spends%20there%20(H4%20below).%20The%20op1%20oracle%20complicates%20that%20account%3A%20it%20never%20pulls%20%60%2B%60%20at%20any%20slice%2C%20and%20its%20op1%20states%20cannot%20even%20read%20the%20%60%2B%60%20embedding%20(position%200%20attends%20only%20to%20itself)%2C%20yet%20its%20%60%2B%60%20embedding%20still%20ends%20at%20%7B_emb%5Bex.ORACLE_ARM%5D%5B1%5D%3A.2f%7D.%20So%20over%20half%20of%20the%20%60%2B%60%20drift%20is%20paid%20for%20by%20something%20other%20than%20the%20pull%20%E2%80%94%20and%20whatever%20pays%20for%20it%20does%20so%20against%20the%20repulsion%2C%20which%20runs%20from%20the%20first%20epoch%20and%20still%20holds%20at%20the%20end.%20The%20trajectory%20records%20no%20per-role%20drift%2C%20so%20this%20run%20can't%20say%20whether%20that%20alignment%20climbs%20early%20(against%20the%20repulsion's%20peak)%20or%20late%20(as%20the%20anneal%20decays)%3B%20the%20candidate%20mechanism%20and%20the%20timing%20are%20both%20queued%20as%20exploratory%20questions%20rather%20than%20interpreted%20here.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20The%20operating%20point%20under%20pooling%20(H3)%0A%0A%20%20%20%20The%20endpoint%20numbers%20say%20where%20each%20run%20finished%3B%20the%20trajectories%20say%20how%20it%20got%20there%20%E2%80%94%20in%20particular%20whether%20a%20pull%20that%20concentrated%20early%20slid%20once%20the%20repulsion%20annealed%20away%2C%20which%20was%20the%20contrary%20outcome%20H3%20named.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(ANCHORED%2C%20retention%2C%20traj)%3A%0A%20%20%20%20_KEYS%20%3D%20(%22alpha_op1%22%2C%20%22m_span%22)%0A%20%20%20%20%23%20Seed%20means%20once%2C%20in%20the%20cell%3A%20%40themed%20calls%20the%20plot%20function%20twice.%0A%20%20%20%20_MEAN%20%3D%20%7Bc%3A%20%7Bk%3A%20np.mean(%5Btraj(c%2C%20s%2C%20k)%20for%20s%20in%20ex.SEEDS%5D%2C%20axis%3D0)%20for%20k%20in%20_KEYS%7D%20for%20c%20in%20%5B*ANCHORED%2C%20%22lam0%22%5D%7D%0A%20%20%20%20_EPOCHS%20%3D%20np.mean(%5Btraj(ex.PRIMARY%2C%20s%2C%20%22epoch%22)%20for%20s%20in%20ex.SEEDS%5D%2C%20axis%3D0)%0A%20%20%20%20_RET%20%3D%20%7Bc%3A%20retention(c)%20for%20c%20in%20ANCHORED%7D%0A%20%20%20%20%23%20The%20schedules%20on%20a%20finer%20grid%20than%20the%20recorded%20trajectory.%20All%20anchored%0A%20%20%20%20%23%20conditions%20share%20them%20at%20the%20operating%20point%2C%20so%20one%20panel%20serves%20five.%0A%20%20%20%20_SE%20%3D%20np.linspace(0.0%2C%20float(ex.SCHEDULER.epochs)%2C%20601)%0A%20%20%20%20_ANCHOR%20%3D%20ex.anchor_weight(_SE)%0A%20%20%20%20_ANTI%20%3D%20ex.anti_subspace_weight(_SE%2C%20anneal_end%3Dex.ANTI_ANNEAL_END%2C%20hold_ratio%3Dex.ANTI_HOLD_RATIO)%0A%20%20%20%20_GRID%20%3D%20%5B%5B%22span-mean%22%2C%20%22pool-t010%22%2C%20%22pool-t030%22%5D%2C%20%5B%22pool-t100%22%2C%20%22op1-oracle%22%2C%20%22sched%22%5D%5D%0A%20%20%20%20_LEFT%20%3D%20(%22span-mean%22%2C%20%22pool-t100%22)%0A%0A%20%20%20%20%40themed(%0A%20%20%20%20%20%20%20%20name%3D%22trajectories%22%2C%0A%20%20%20%20%20%20%20%20alt_text%3D%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20Five%20trajectory%20panels%20and%20one%20schedule%20panel%20in%20a%20two-by-three%20grid%20sharing%20the%20epoch%20axis%20from%200%20to%20100.%20Each%20trajectory%20panel%20plots%20mean%20alignment%20at%20op1%20as%20a%20solid%20line%20staying%20below%200.15%2C%20and%20the%20span%20margin%20as%20a%20dashed%20line%20climbing%20to%20between%200.6%20and%200.75%20by%20epoch%2040%20and%20holding%20roughly%20level%20to%20the%20end%2C%20over%20a%20flat%20grey%20control%20pair%20near%20zero.%20The%20dashed%20line%20dips%20slightly%20after%20epoch%2090%20in%20every%20panel.%20The%20schedule%20panel%2C%20bottom%20right%2C%20shows%20the%20anchor%20weight%20ramping%20up%20to%20a%20plateau%20and%20annealing%20after%20epoch%2090%2C%20and%20the%20repulsion%20weight%20starting%20high%2C%20crossing%20below%20the%20anchor%20around%20epoch%2060%20and%20settling%20at%20about%20a%20third%20of%20it.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20caption%3Drf%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20**Training%20dynamics%20by%20condition.**%20Seed%20means%20of%20the%20two%20cosines%20on%20the%20anchor%20axis%2C%20on%20one%20shared%20scale%3A%20solid%20is%20%24%5Cbar%5Calpha%24%20at%20op1%20(contained%20at%20the%20left%20caret%2C%20%7Bex.MEAN_ALIGN_GATE%3Ag%7D)%3B%20dashed%20is%20%24m_%5Ctext%7B%7Bspan%7D%7D%24%20(its%20retention%20floor%20of%20%7Bex.RETENTION_FLOOR%3Ag%7D%20at%20the%20right%20caret).%20The%20grey%20pair%20is%20the%20un-anchored%20control%2C%20and%20the%20number%20in%20each%20panel%20is%20that%20condition's%20retention%20(final%20over%20peak%20%24m_%5Ctext%7B%7Bspan%7D%7D%24%2C%20minimum%20across%20seeds%3B%20gate%20%E2%89%A5%20%7Bex.RETENTION_GATE%3Ag%7D).%20Bottom%20right%3A%20the%20weight%20schedule%20every%20anchored%20condition%20trained%20under%20%E2%80%94%20anchor%20%24%5Clambda_%5Cmathrm%7B%7Ba%7D%7D%24%20in%20red%2C%20repulsion%20%24%5Clambda_%7B%7B%5Cbar%7B%7B%5Cmathrm%7B%7Bs%7D%7D%7D%7D%7D%7D%24%20in%20blue%2C%20log%20scale%20%E2%80%94%20shared%20here%20because%20the%20anti-subspace%20term%20is%20fixed%20at%20the%20ex-2.1.8%20operating%20point%20in%20every%20anchored%20condition.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20)%0A%20%20%20%20def%20_plot()%20-%3E%20plt.Figure%3A%0A%20%20%20%20%20%20%20%20fig%2C%20axd%20%3D%20plt.subplot_mosaic(_GRID%2C%20figsize%3D(7.5%2C%204.2)%2C%20sharex%3DTrue%2C%20layout%3D%22constrained%22)%0A%20%20%20%20%20%20%20%20_grey%20%3D%20light_dark(%22%23999%22%2C%20%22%23777%22)%0A%20%20%20%20%20%20%20%20_gate%20%3D%20light_dark(%22%23555%22%2C%20%22%23bbb%22)%0A%20%20%20%20%20%20%20%20_ink%20%3D%20light_dark(%22%231f6fb4%22%2C%20%22%235fa8dd%22)%0A%20%20%20%20%20%20%20%20_term%20%3D%20%7B%22anchor%22%3A%20light_dark(%22%23c33%22%2C%20%22%23e66%22)%2C%20%22anti%22%3A%20light_dark(%22%2336c%22%2C%20%22%237af%22)%7D%0A%20%20%20%20%20%20%20%20_dash%20%3D%20(0%2C%20(6%2C%201))%0A%20%20%20%20%20%20%20%20_top%20%3D%20max(np.max(_MEAN%5Bc%5D%5B%22m_span%22%5D)%20for%20c%20in%20ANCHORED)%0A%20%20%20%20%20%20%20%20for%20cond%20in%20ANCHORED%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ax%20%3D%20axd%5Bcond%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.plot(0%2C%20ex.MEAN_ALIGN_GATE%2C%20marker%3D9%2C%20ms%3D3%2C%20color%3D_gate%2C%20clip_on%3DFalse%2C%20zorder%3D6%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20transform%3Dax.get_yaxis_transform())%20%20%23%20fmt%3A%20skip%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.plot(1%2C%20ex.RETENTION_FLOOR%2C%20marker%3D8%2C%20ms%3D3%2C%20color%3D_gate%2C%20clip_on%3DFalse%2C%20zorder%3D6%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20transform%3Dax.get_yaxis_transform())%20%20%23%20fmt%3A%20skip%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.plot(_EPOCHS%2C%20_MEAN%5B%22lam0%22%5D%5B%22alpha_op1%22%5D%2C%20color%3D_grey%2C%20lw%3D1.1%2C%20zorder%3D3)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.plot(_EPOCHS%2C%20_MEAN%5B%22lam0%22%5D%5B%22m_span%22%5D%2C%20color%3D_grey%2C%20lw%3D1.1%2C%20ls%3D_dash%2C%20zorder%3D3)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.plot(_EPOCHS%2C%20_MEAN%5Bcond%5D%5B%22m_span%22%5D%2C%20color%3D_ink%2C%20lw%3D1.4%2C%20ls%3D_dash%2C%20zorder%3D4)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.plot(_EPOCHS%2C%20_MEAN%5Bcond%5D%5B%22alpha_op1%22%5D%2C%20color%3D_ink%2C%20lw%3D1.7%2C%20zorder%3D5)%0A%20%20%20%20%20%20%20%20%20%20%20%20_r%20%3D%20_RET%5Bcond%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20assert%20_r%20is%20not%20None%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.annotate(f%22%7B_r%3A.2f%7D%22%2C%20(0.97%2C%200.6)%2C%20xycoords%3D%22axes%20fraction%22%2C%20ha%3D%22right%22%2C%20fontsize%3D8%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20color%3Dlight_dark(%22%23444%22%2C%20%22%23bbb%22))%20%20%23%20fmt%3A%20skip%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_title(%22pool-t030%20(primary)%22%20if%20cond%20%3D%3D%20ex.PRIMARY%20else%20cond%2C%20fontsize%3D9.5%2C%20color%3D_ink)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_xlim(0%2C%20ex.SCHEDULER.epochs)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_ylim(-0.08%2C%20_top%20*%201.08)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.tick_params(labelbottom%3Dcond%20in%20_GRID%5B1%5D%2C%20labelleft%3Dcond%20in%20_LEFT%2C%20labelsize%3D8)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_ylabel(%22cosine%22%2C%20fontsize%3D%22x-small%22)%20if%20cond%20in%20_LEFT%20else%20None%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_xlabel(%22epoch%22%2C%20fontsize%3D%22x-small%22)%20if%20cond%20in%20_GRID%5B1%5D%20else%20None%0A%20%20%20%20%20%20%20%20_ax%20%3D%20axd%5B%22sched%22%5D%0A%20%20%20%20%20%20%20%20_ax.plot(_SE%2C%20_ANCHOR%2C%20color%3D_term%5B%22anchor%22%5D%2C%20lw%3D1.4)%0A%20%20%20%20%20%20%20%20_ax.plot(_SE%2C%20_ANTI%2C%20color%3D_term%5B%22anti%22%5D%2C%20lw%3D1.4)%0A%20%20%20%20%20%20%20%20_ax.set_yscale(%22log%22)%0A%20%20%20%20%20%20%20%20_ax.set_xlim(0%2C%20ex.SCHEDULER.epochs)%0A%20%20%20%20%20%20%20%20_ax.set_ylim(2e-4%2C%204)%0A%20%20%20%20%20%20%20%20_ax.set_yticks(%5B1e-3%2C%201e-2%2C%201e-1%2C%201e0%5D)%0A%20%20%20%20%20%20%20%20_ax.minorticks_off()%0A%20%20%20%20%20%20%20%20_ax.tick_params(labelsize%3D7.5)%0A%20%20%20%20%20%20%20%20_ax.set_xlabel(%22epoch%22%2C%20fontsize%3D%22x-small%22)%0A%20%20%20%20%20%20%20%20_ax.set_title(%22weights%20(all%20anchored)%22%2C%20fontsize%3D9.5%2C%20color%3D_grey)%0A%20%20%20%20%20%20%20%20for%20_x%2C%20_y%2C%20_txt%2C%20_k%20in%20((64%2C%200.13%2C%20r%22%24%5Clambda_%5Cmathrm%7Ba%7D%24%22%2C%20%22anchor%22)%2C%20(16%2C%200.5%2C%20r%22%24%5Clambda_%7B%5Cbar%7B%5Cmathrm%7Bs%7D%7D%7D%24%22%2C%20%22anti%22))%3A%20%20%23%20fmt%3A%20skip%0A%20%20%20%20%20%20%20%20%20%20%20%20_ax.annotate(_txt%2C%20(_x%2C%20_y)%2C%20fontsize%3D9%2C%20color%3D_term%5B_k%5D%2C%20va%3D%22bottom%22)%0A%20%20%20%20%20%20%20%20fig.legend(%0A%20%20%20%20%20%20%20%20%20%20%20%20%5Bplt.Line2D(%5B%5D%2C%20%5B%5D%2C%20color%3D_grey%2C%20lw%3D1.7)%2C%20plt.Line2D(%5B%5D%2C%20%5B%5D%2C%20color%3D_grey%2C%20lw%3D1.5%2C%20ls%3D_dash)%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%5Br%22%24%5Cbar%5Calpha%24%20at%20op1%22%2C%20r%22%24m_%7B%5Ctext%7Bspan%7D%7D%24%22%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20fontsize%3D8.5%2C%20frameon%3DFalse%2C%20ncols%3D2%2C%20loc%3D%22lower%20center%22%2C%20bbox_to_anchor%3D(0.5%2C%201.0)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20labelcolor%3D_grey%2C%20handlelength%3D2.4%2C%0A%20%20%20%20%20%20%20%20)%20%20%23%20fmt%3A%20skip%0A%20%20%20%20%20%20%20%20return%20fig%0A%0A%20%20%20%20mo.Html(_plot())%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(ANCHORED%2C%20a_op1%2C%20retention)%3A%0A%20%20%20%20_P%20%3D%20ex.PRIMARY%0A%20%20%20%20_ret%20%3D%20retention(_P)%0A%20%20%20%20assert%20_ret%20is%20not%20None%0A%20%20%20%20_worst%20%3D%20min((r%20for%20c%20in%20ANCHORED%20if%20(r%20%3A%3D%20retention(c))%20is%20not%20None))%0A%20%20%20%20mo.md(rf%22%22%22%0A%20%20%20%20**H3(a)%20and%20(b)%20hold.**%20On%20the%20primary%20condition%2C%20%24%5Cbar%5Calpha%24%20at%20op1%20ends%20at%20%7Ba_op1(_P).mean()%3A.3f%7D%20%3Cspan%20class%3D'range'%3E%C2%B1%7Ba_op1(_P).std(ddof%3D1)%3A.3f%7D%3C%2Fspan%3E%20against%20the%20%7Bex.MEAN_ALIGN_GATE%3Ag%7D%20gate%2C%20and%20retention%20is%20%7B_ret%3A.2f%7D%20against%20%7Bex.RETENTION_GATE%3Ag%7D.%20The%20contrary%20outcome%20%E2%80%94%20a%20concentrated%20pull%20sliding%20once%20the%20anti%20anneal%20ends%20at%20epoch%20%7Bex.ANTI_ANNEAL_END%3Ag%7D%20%E2%80%94%20shows%20up%20only%20as%20the%20small%20end-of-training%20dip%20every%20condition%20shares%20(the%20anchor's%20own%20anneal)%2C%20and%20the%20worst%20retention%20anywhere%20in%20the%20sweep%20is%20%7B_worst%3A.2f%7D.%20Pooling%20redirects%20the%20budget%20of%20the%20pull%20without%20destabilizing%20what%20ex-2.1.8%20found.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(ANCHORED%2C%20alpha_map%2C%20grading_r2%2C%20m_span)%3A%0A%20%20%20%20_ALL%20%3D%20%5B%22lam0%22%2C%20*ANCHORED%5D%0A%20%20%20%20_RESP%20%3D%20%7Bc%3A%20alpha_map(c)%5B%3A%2C%20%3A%2C%200%5D.mean(axis%3D0)%20for%20c%20in%20_ALL%7D%0A%0A%20%20%20%20def%20_fitted_target(y%3A%20np.ndarray)%20-%3E%20np.ndarray%3A%0A%20%20%20%20%20%20%20%20%22%22%22%60sim%C2%B9%C2%B7%E2%81%B5%60%20rescaled%20by%20least%20squares%20onto%20the%20response%20%E2%80%94%20the%20shape%20r%C2%B2%20scores%20against.%22%22%22%0A%20%20%20%20%20%20%20%20b%20%3D%20np.polyfit(ex.SIM_TARGET%2C%20y%2C%201)%0A%20%20%20%20%20%20%20%20return%20np.polyval(b%2C%20ex.SIM_TARGET)%0A%0A%20%20%20%20def%20_level_mean(y%3A%20np.ndarray)%20-%3E%20tuple%5Bnp.ndarray%2C%20np.ndarray%5D%3A%0A%20%20%20%20%20%20%20%20%22%22%22The%20conditional%20mean%20of%20*y*%20at%20each%20distinct%20redness%20level%20(29%20of%20them).%22%22%22%0A%20%20%20%20%20%20%20%20levels%20%3D%20np.unique(np.round(ex.REDNESS%2C%206))%0A%20%20%20%20%20%20%20%20means%20%3D%20np.array(%5By%5Bnp.round(ex.REDNESS%2C%206)%20%3D%3D%20lv%5D.mean()%20for%20lv%20in%20levels%5D)%0A%20%20%20%20%20%20%20%20return%20levels%2C%20means%0A%0A%20%20%20%20_CTRL%20%3D%20_level_mean(_RESP%5B%22lam0%22%5D)%0A%20%20%20%20_GRID%20%3D%20%5B_ALL%5B%3A3%5D%2C%20_ALL%5B3%3A%5D%5D%0A%0A%20%20%20%20%40themed(%0A%20%20%20%20%20%20%20%20name%3D%22grading%22%2C%0A%20%20%20%20%20%20%20%20alt_text%3D%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20Six%20panels%20in%20a%20two-by-three%20grid%20sharing%20both%20axes%3A%20per-color%20alignment%20at%20the%20first%20operand%2C%20from%20about%20-0.2%20to%201.2%2C%20against%20the%20redness%20of%20that%20color%20from%200%20to%201.%20Panels%20are%20the%20control%2C%20span-mean%2C%20and%20the%20three%20pooled%20conditions%20and%20the%20oracle.%20The%20control%20panel%20is%20flat%20near%20zero.%20Every%20other%20panel%20scatters%20216%20marks%20drawn%20in%20the%20color%20each%20stands%20for%2C%20forming%20a%20flat%20cluster%20at%20low%20redness%20and%20a%20rising%20tail%20of%20oranges%20and%20reds%2C%20with%20a%20thin%20conditional-mean%20line%20and%20a%20dashed%20reference%20curve%20through%20it.%20The%20flat%20cluster%20sits%20slightly%20lower%20and%20the%20rise%20slightly%20straighter%20in%20the%20pooled%20and%20oracle%20panels%20than%20in%20span-mean%3B%20in%20the%20pool-t010%20panel%20the%20rise%20has%20a%20visible%20shelf%20between%20redness%200.7%20and%200.8.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20caption%3Dr%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20**Grading%3A%20alignment%20at%20op1%2C%20per%20color.**%20%24%5Calpha_c%24%2C%20the%20mean%20over%20slices%20of%20%24%5Ccos(h%2C%20%5Chat%20v_%7B%5Ctext%7Bred%7D%7D)%24%20at%20op1%2C%20seed%20mean%2C%20against%20the%20redness%20of%20the%20color.%20One%20mark%20per%20color%2C%20drawn%20in%20that%20color%3B%20the%20thin%20dark%20line%20is%20the%20mean%20response%20at%20each%20of%20the%2029%20distinct%20redness%20levels%2C%20the%20flat%20grey%20band%20the%20same%20line%20for%20the%20control%2C%20and%20the%20dashed%20line%20%60sim%C2%B9%C2%B7%E2%81%B5%60%20rescaled%20onto%20the%20response%20by%20least%20squares%20%E2%80%94%20the%20shape%20the%20%24r%5E2%24%20statistic%20scores%20against.%20The%20dashed%20line%20wobbles%20because%20%60sim%60%20depends%20on%20the%20full%20color%20(hue%20angle%2C%20weighted%20by%20vibrancy)%2C%20so%20its%20mean%20at%20a%20redness%20level%20moves%20with%20the%20mix%20of%20colors%20that%20share%20the%20level.%20H3(c)%20gates%20the%20primary's%20%24r%5E2%24%20relative%20to%20%60span-mean%60's.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20)%0A%20%20%20%20def%20_plot()%20-%3E%20plt.Figure%3A%0A%20%20%20%20%20%20%20%20from%20typing%20import%20cast%0A%0A%20%20%20%20%20%20%20%20from%20mini.vis%20import%20AxesGrid%0A%0A%20%20%20%20%20%20%20%20fig%2C%20axes%20%3D%20plt.subplots(2%2C%203%2C%20figsize%3D(7.5%2C%205.0)%2C%20sharey%3DTrue%2C%20sharex%3DTrue%2C%20layout%3D%22constrained%22)%0A%20%20%20%20%20%20%20%20axes%20%3D%20cast(AxesGrid%2C%20axes)%0A%20%20%20%20%20%20%20%20for%20row%2C%20conds%20in%20zip(axes%2C%20_GRID%2C%20strict%3DTrue)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20ax%2C%20cond%20in%20zip(row%2C%20conds%2C%20strict%3DTrue)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20a%20%3D%20_RESP%5Bcond%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.axhline(0%2C%20color%3Dlight_dark(%22%23bbb%22%2C%20%22%23555%22)%2C%20lw%3D0.8%2C%20zorder%3D0)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.plot(*_CTRL%2C%20color%3Dlight_dark(%22%23999%22%2C%20%22%23777%22)%2C%20lw%3D3%2C%20alpha%3D0.5%2C%20zorder%3D1%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20solid_capstyle%3D%22round%22)%20%20%23%20fmt%3A%20skip%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.scatter(ex.REDNESS%2C%20a%2C%20c%3Dex.GRID_RGB%2C%20s%3D18%2C%20lw%3D0.4%2C%20zorder%3D3%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20edgecolors%3Dlight_dark(%22%2300000033%22%2C%20%22%23ffffff55%22))%20%20%23%20fmt%3A%20skip%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20cond%20!%3D%20%22lam0%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.plot(*_level_mean(_fitted_target(a))%2C%20color%3Dlight_dark(%22%23888%22%2C%20%22%23888%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20lw%3D1.0%2C%20ls%3D(0%2C%20(4%2C%202))%2C%20zorder%3D2)%20%20%23%20fmt%3A%20skip%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.plot(*_level_mean(a)%2C%20color%3Dlight_dark(%22%23222%22%2C%20%22%23eee%22)%2C%20lw%3D1.2%2C%20zorder%3D4)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.set_title(%22pool-t030%20(primary)%22%20if%20cond%20%3D%3D%20ex.PRIMARY%20else%20(%22control%22%20if%20cond%20%3D%3D%20%22lam0%22%20else%20cond)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fontsize%3D9.5)%20%20%23%20fmt%3A%20skip%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20cond%20!%3D%20%22lam0%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.annotate(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22r%C2%B2%20%3D%20%7Bgrading_r2(cond)%3A.2f%7D%5Cn%24m_%5C%5Cmathrm%7B%7Bspan%7D%7D%24%20%3D%20%7Bm_span(cond).mean()%3A.2f%7D%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(0.03%2C%200.97)%2C%20xycoords%3D%22axes%20fraction%22%2C%20va%3D%22top%22%2C%20fontsize%3D8%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20color%3Dlight_dark(%22%23444%22%2C%20%22%23bbb%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%20%20%23%20fmt%3A%20skip%0A%20%20%20%20%20%20%20%20for%20ax%20in%20axes%5B1%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_xlabel(%22redness%20of%20op1%22%2C%20fontsize%3D%22small%22)%0A%20%20%20%20%20%20%20%20for%20row%20in%20axes%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20row%5B0%5D.set_ylabel(r%22%24%5Calpha_c%24%20at%20op1%22%2C%20fontsize%3D%22small%22)%0A%20%20%20%20%20%20%20%20axes%5B0%5D%5B0%5D.set_ylim(-0.25%2C%201.25)%20%20%23%20headroom%20for%20the%20per-panel%20statistics%0A%20%20%20%20%20%20%20%20return%20fig%0A%0A%20%20%20%20mo.Html(_plot())%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(grading_r2)%3A%0A%20%20%20%20_P%20%3D%20ex.PRIMARY%0A%20%20%20%20mo.md(rf%22%22%22%0A%20%20%20%20**H3(c)%20holds%2C%20with%20the%20sign%20reversed.**%20The%20gate%20would%20have%20tolerated%20%24r%5E2%24%20on%20the%20primary%20falling%20%7Bex.GRADE_R2_DROP%3Ag%7D%20below%20the%20span%20mean's%3B%20instead%20it%20lands%20%7Bgrading_r2(_P)%20-%20grading_r2(ex.MEAN_ARM)%3A%2B.2f%7D%20*above*%20it%20(%7Bgrading_r2(_P)%3A.2f%7D%20against%20%7Bgrading_r2(ex.MEAN_ARM)%3A.2f%7D).%20The%20contrary%20expectation%20%E2%80%94%20that%20concentrating%20the%20pull%20would%20sharpen%20the%20response%20into%20a%20step%20%E2%80%94%20mostly%20has%20it%20backwards%3A%20every%20pooled%20condition%20grades%20at%20or%20above%20the%20span%20mean%2C%20and%20the%20oracle%20best%20of%20all%20(%7Bgrading_r2(ex.ORACLE_ARM)%3A.2f%7D).%20Withdrawing%20the%20pull%20from%20positions%20that%20don't%20carry%20the%20concept%20apparently%20cleans%20the%20response%20shape%20at%20the%20one%20that%20does.%20The%20exception%20is%20visible%20in%20the%20%60pool-t010%60%20panel%3A%20a%20shelf%20in%20the%20rise%20near%20redness%200.8%2C%20which%20turns%20out%20to%20belong%20to%20the%20latched%20seeds%20(*Exploratory%20analyses*).%20As%20a%20footnote%20to%20ex-2.1.8's%20open%20question%20about%20where%20a%20realistic%20absolute%20grading%20bar%20sits%3A%20the%20primary%20and%20the%20oracle%20both%20clear%20the%200.8%20that%20experiment%20couldn't%20reach.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Where%20the%20weight%20went%20(H4)%0A%0A%20%20%20%20The%20weight%20profile%20is%20the%20pull's%20own%20account%20of%20where%20each%20line's%20budget%20goes%3A%20the%20softmin%20weights%2C%20recomputed%20after%20training%20from%20the%20final%20model's%20alignments%20on%20the%20probe%20set%20%E2%80%94%20the%20same%20formula%20the%20loss's%20gradient%20uses%2C%20so%20this%20is%20what%20the%20pull%20was%20spending%20as%20training%20ended%20(the%20timing%20section%20below%20reads%20the%20logged%20version%20over%20training).%20The%20control's%20readability%20profile%20is%20the%20reference%20for%20where%20the%20concept%20actually%20lives.%20H4%20asks%20whether%20they%20agree%20%E2%80%94%20at%20the%20embedding%2C%20where%20only%20op1%20can%20carry%20the%20concept%2C%20and%20across%20depth%2C%20where%20the%20syntax%20roles%20pick%20it%20up%20through%20attention.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(READ%3A%20np.ndarray%2C%20cells%2C%20pi_bar%2C%20read_gain)%3A%0A%20%20%20%20_PI%20%3D%20%7Bc%3A%20pi_bar(c)%20for%20c%20in%20ex.POOLED_NAMES%7D%0A%20%20%20%20_PI_SEEDS%20%3D%20%7B%0A%20%20%20%20%20%20%20%20c%3A%20np.array(%5Bnp.asarray(cells%5Bf%22%7Bc%7D-s%7Bs%7D%22%5D%5B%22pi%22%5D%2C%20dtype%3Dfloat)%20for%20s%20in%20ex.SEEDS%5D)%20for%20c%20in%20ex.POOLED_NAMES%0A%20%20%20%20%7D%0A%20%20%20%20_GAIN%20%3D%20%7Bc%3A%20read_gain(c)%20for%20c%20in%20ex.POOLED_NAMES%7D%0A%20%20%20%20_x%20%3D%20np.arange(ex.SPAN)%0A%0A%20%20%20%20%40themed(%0A%20%20%20%20%20%20%20%20name%3D%22weight-profiles%22%2C%0A%20%20%20%20%20%20%20%20alt_text%3D%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20A%20five-by-three%20grid%20of%20small%20flush%20panels.%20Columns%20are%20the%20pooled%20conditions%20at%20tau%200.01%2C%200.03%20and%200.1%3B%20rows%20are%20residual%20slices%20with%20the%20last%20slice%20on%20top%20and%20the%20embedding%20at%20the%20bottom%3B%20each%20panel%20spans%20the%20four%20span%20roles%20op1%2C%20plus%2C%20op2%20and%20equals%20on%20its%20horizontal%20axis%2C%20from%200%20to%201%20vertically.%20A%20shaded%20smooth-step%20area%20shows%20the%20seed-mean%20softmin%20weight%2C%20three%20hairlines%20the%20individual%20seeds%2C%20and%20a%20dashed%20line%20the%20control's%20readability%2C%20which%20is%20identical%20across%20the%20columns%20of%20a%20row%3A%20op1%20near%200.85%20everywhere%2C%20plus%20and%20equals%20near%200.8%20on%20all%20rows%20but%20the%20embedding%2C%20where%20both%20drop%20to%20zero%2C%20and%20op2%20never%20above%200.2.%20In%20the%20bottom%20(embedding)%20row%20of%20every%20column%2C%20the%20weight%20area%20is%20a%20tall%20block%20at%20op1%2C%20about%200.77%2C%20with%20a%20small%20step%20at%20plus%2C%20and%20the%20hairlines%20hug%20the%20mean.%20On%20the%20deeper%20rows%20of%20the%20tau%200.01%20and%200.03%20columns%20the%20hairlines%20separate%20completely%3A%20each%20seed's%20profile%20is%20a%20full-height%20block%20at%20a%20single%20role%20%E2%80%94%20plus%20in%20two%20seeds%20of%20three%20at%20tau%200.01%2C%20one%20of%20three%20at%200.03%20%E2%80%94%20so%20the%20mean%20area%2C%20op1%20at%20about%20a%20third%20or%20two%20thirds%20with%20plus%20taking%20the%20rest%2C%20is%20a%20mixture%20of%20one-hot%20seeds.%20In%20the%20tau%200.1%20column%20op1%20grows%20toward%200.95%20with%20the%20other%20roles%20near%20zero%20and%20the%20hairlines%20stay%20together.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20caption%3Drf%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20**What%20the%20pull%20chose%2C%20against%20where%20the%20concept%20is%20readable.**%20The%20trained%20softmin%20weight%20profile%20of%20each%20pooled%20condition%20(shaded%20area%2C%20seed%20mean%20%24%5Cbar%5Cpi(%5Cell%2C%20t)%24%3B%20hairlines%2C%20the%20three%20seeds%20individually)%2C%20over%20the%20four%20span%20roles%2C%20one%20panel%20per%20residual%20slice%20with%20the%20embedding%20at%20the%20bottom.%20Where%20the%20hairlines%20separate%20%E2%80%94%20the%20deep%20slices%20at%20%CF%84%20%E2%89%A4%200.03%20%E2%80%94%20each%20seed's%20profile%20is%20one-hot%20on%20a%20single%20role%2C%20and%20the%20mean%20is%20a%20mixture%20of%20seeds%20rather%20than%20a%20shape%20any%20run%20has.%20The%20dashed%20line%20is%20the%20readability%20profile%20of%20the%20*un-anchored%20control*%2C%20%24R%5E2(%5Cell%2C%20t)%24%20%E2%80%94%20a%20ridge%20probe%20predicting%20op1's%20redness%20from%20the%20state%20at%20each%20(slice%2C%20role)%2C%20one%20color%20held%20out%20at%20a%20time%20%E2%80%94%20the%20same%20reference%20in%20every%20column%20of%20a%20row%20(its%20own%20seed%20spread%20is%20%E2%89%A4%200.09%20everywhere%20except%20op2%20at%20depth%2C%20%E2%89%88%200.2).%20The%20caret%20on%20the%20embedding%20row%20marks%20the%20H4(a)%20gate%3A%20op1's%20weight%20%E2%89%A5%20%7Bex.LEAD_GATE%3Ag%7D%20(uniform%20is%200.25).%20The%20number%20atop%20each%20column%20is%20its%20H4(b)%20weighted%20readability%20gain%20(gate%20%E2%89%A5%20%7Bex.READ_GAIN_GATE%3Ag%7D%2C%20scored%20on%20the%20primary).%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20)%0A%20%20%20%20def%20_plot()%20-%3E%20plt.Figure%3A%0A%20%20%20%20%20%20%20%20from%20matplotlib.layout_engine%20import%20ConstrainedLayoutEngine%0A%0A%20%20%20%20%20%20%20%20from%20mini.vis%20import%20smooth_step%2C%20smooth_step_area%0A%0A%20%20%20%20%20%20%20%20_cond_ink%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22pool-t010%22%3A%20light_dark(%22%237fb3d8%22%2C%20%22%234f7ea6%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22pool-t030%22%3A%20light_dark(%22%231f6fb4%22%2C%20%22%235fa8dd%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22pool-t100%22%3A%20light_dark(%22%2312497c%22%2C%20%22%238ec4ea%22)%2C%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20_grey%20%3D%20light_dark(%22%23666%22%2C%20%22%23999%22)%0A%20%20%20%20%20%20%20%20_read_ink%20%3D%20light_dark(%22%23555%22%2C%20%22%23aaa%22)%0A%20%20%20%20%20%20%20%20_hair%20%3D%20light_dark(%22%2300000055%22%2C%20%22%23ffffff55%22)%0A%20%20%20%20%20%20%20%20_gate%20%3D%20light_dark(%22%23555%22%2C%20%22%23bbb%22)%0A%20%20%20%20%20%20%20%20fig%2C%20axes%20%3D%20plt.subplots(5%2C%203%2C%20figsize%3D(7.0%2C%203.7)%2C%20sharex%3DTrue%2C%20sharey%3DTrue)%0A%20%20%20%20%20%20%20%20_engine%20%3D%20fig.get_layout_engine()%0A%20%20%20%20%20%20%20%20assert%20isinstance(_engine%2C%20ConstrainedLayoutEngine)%0A%20%20%20%20%20%20%20%20_engine.set(hspace%3D0%2C%20h_pad%3D0.01%2C%20wspace%3D0.05)%0A%20%20%20%20%20%20%20%20for%20col%2C%20cond%20in%20enumerate(ex.POOLED_NAMES)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ink%20%3D%20_cond_ink%5Bcond%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20row%20in%20range(5)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sl%20%3D%204%20-%20row%20%20%23%20last%20slice%20on%20top%2C%20the%20embedding%20at%20the%20bottom%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax%20%3D%20axes%5Brow%5D%5Bcol%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20smooth_step_area(ax%2C%20_x%2C%20_PI%5Bcond%5D%5Bsl%5D%2C%20ramp%3D0.5%2C%20color%3Dink%2C%20alpha%3Dlight_dark(0.22%2C%200.28))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20smooth_step(ax%2C%20_x%2C%20_PI%5Bcond%5D%5Bsl%5D%2C%20ramp%3D0.5%2C%20color%3Dink%2C%20lw%3D1.5)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20for%20seed_prof%20in%20_PI_SEEDS%5Bcond%5D%5B%3A%2C%20sl%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20smooth_step(ax%2C%20_x%2C%20seed_prof%2C%20ramp%3D0.5%2C%20color%3D_hair%2C%20lw%3D0.5)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20smooth_step(ax%2C%20_x%2C%20READ%5Bsl%5D%2C%20ramp%3D0.5%2C%20color%3D_read_ink%2C%20lw%3D1.0%2C%20ls%3D(0%2C%20(4%2C%202)))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.set(ylim%3D(-0.08%2C%201.08)%2C%20xlim%3D(-0.4%2C%20ex.SPAN%20-%200.6)%2C%20yticks%3D%5B0.0%2C%200.5%2C%201.0%5D)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.spines%5B%3A%5D.set_visible(False)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.grid(axis%3D%22y%22%2C%20which%3D%22major%22%2C%20c%3D%22%23888%22%2C%20alpha%3D0.2)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.tick_params(axis%3D%22x%22%2C%20length%3D0%2C%20labelbottom%3DFalse)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.tick_params(axis%3D%22y%22%2C%20left%3DTrue%2C%20right%3DTrue%2C%20direction%3D%22in%22%2C%20labelleft%3DFalse%2C%20labelright%3DFalse)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20col%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.set_ylabel(%22emb%22%20if%20sl%20%3D%3D%200%20else%20f%22%7Bsl%7D%22%2C%20fontsize%3D8)%0A%20%20%20%20%20%20%20%20%20%20%20%20axes%5B0%5D%5Bcol%5D.set_title(%22pool-t030%20(primary)%22%20if%20cond%20%3D%3D%20ex.PRIMARY%20else%20cond%2C%20fontsize%3D9.5%2C%20color%3Dink%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fontweight%3D%22bold%22%20if%20cond%20%3D%3D%20ex.PRIMARY%20else%20%22normal%22)%20%20%23%20fmt%3A%20skip%0A%20%20%20%20%20%20%20%20%20%20%20%20axes%5B0%5D%5Bcol%5D.annotate(f%22gain%20%7B_GAIN%5Bcond%5D%3A%2B.2f%7D%22%2C%20(0.97%2C%200.88)%2C%20xycoords%3D%22axes%20fraction%22%2C%20ha%3D%22right%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20va%3D%22top%22%2C%20fontsize%3D8%2C%20color%3Dlight_dark(%22%23444%22%2C%20%22%23bbb%22))%20%20%23%20fmt%3A%20skip%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%20The%20H4(a)%20gate%20reads%20exactly%20here%3A%20op1's%20weight%20at%20the%20embedding.%0A%20%20%20%20%20%20%20%20%20%20%20%20axes%5B4%5D%5Bcol%5D.plot(0%2C%20ex.LEAD_GATE%2C%20marker%3D9%2C%20ms%3D3%2C%20color%3D_gate%2C%20clip_on%3DFalse%2C%20zorder%3D6%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20transform%3Daxes%5B4%5D%5Bcol%5D.get_yaxis_transform())%20%20%23%20fmt%3A%20skip%0A%20%20%20%20%20%20%20%20%20%20%20%20axes%5B4%5D%5Bcol%5D.set_xticks(_x%2C%20ex.ROLES)%0A%20%20%20%20%20%20%20%20%20%20%20%20axes%5B4%5D%5Bcol%5D.tick_params(axis%3D%22x%22%2C%20labelbottom%3DTrue%2C%20labelsize%3D8.5)%0A%20%20%20%20%20%20%20%20%23%20One%20panel%20says%20what%20the%20scale%20is%3B%20numbering%20all%20fifteen%20spends%20ink%20on%20a%20fact%20stated%20once.%0A%20%20%20%20%20%20%20%20axes%5B4%5D%5B2%5D.tick_params(axis%3D%22y%22%2C%20labelright%3DTrue%2C%20labelsize%3D7%2C%20pad%3D2)%0A%20%20%20%20%20%20%20%20fig.supylabel(%22slice%22%2C%20fontsize%3D9)%0A%20%20%20%20%20%20%20%20_pi_key%20%3D%20plt.Rectangle((0%2C%200)%2C%201%2C%201%2C%20fc%3D_grey%2C%20alpha%3D0.35%2C%20ec%3D%22none%22)%0A%20%20%20%20%20%20%20%20_read_key%20%3D%20plt.Line2D(%5B%5D%2C%20%5B%5D%2C%20color%3D_read_ink%2C%20lw%3D1.0%2C%20ls%3D(0%2C%20(4%2C%202)))%0A%20%20%20%20%20%20%20%20fig.legend(%5B_pi_key%2C%20_read_key%5D%2C%20%5Br%22softmin%20weight%20%24%5Cbar%5Cpi%24%22%2C%20%22control%20readability%20%24R%5E2%24%20(redness)%22%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fontsize%3D8.5%2C%20frameon%3DFalse%2C%20ncols%3D2%2C%20loc%3D%22lower%20center%22%2C%20bbox_to_anchor%3D(0.5%2C%201.0)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20labelcolor%3D_grey)%20%20%23%20fmt%3A%20skip%0A%20%20%20%20%20%20%20%20return%20fig%0A%0A%20%20%20%20mo.Html(_plot())%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(READ%3A%20np.ndarray%2C%20cells%2C%20pi_bar%2C%20read_gain)%3A%0A%20%20%20%20_P%20%3D%20ex.PRIMARY%0A%20%20%20%20_emb%20%3D%20%7Bc%3A%20pi_bar(c)%5B0%5D%20for%20c%20in%20ex.POOLED_NAMES%7D%0A%20%20%20%20%23%20Deep-slice%20choices%20per%20seed%3A%20which%20role%20holds%20the%20slice-4%20weight%20in%20each%20run.%0A%20%20%20%20_s4%20%3D%20%7B%0A%20%20%20%20%20%20%20%20c%3A%20%5Bint(np.argmax(np.asarray(cells%5Bf%22%7Bc%7D-s%7Bs%7D%22%5D%5B%22pi%22%5D%2C%20dtype%3Dfloat)%5B4%5D))%20for%20s%20in%20ex.SEEDS%5D%0A%20%20%20%20%20%20%20%20for%20c%20in%20ex.POOLED_NAMES%0A%20%20%20%20%7D%0A%20%20%20%20_n_plus%20%3D%20%7Bc%3A%20sum(1%20for%20r%20in%20roles%20if%20r%20%3D%3D%201)%20for%20c%2C%20roles%20in%20_s4.items()%7D%0A%20%20%20%20mo.md(rf%22%22%22%0A%20%20%20%20**H4(a)%20holds.**%20At%20the%20embedding%2C%20the%20primary's%20leading%20role%20is%20op1%20with%20weight%20%7B_emb%5B_P%5D%5B0%5D%3A.2f%7D%20against%20the%20%7Bex.LEAD_GATE%3Ag%7D%20gate%20%E2%80%94%20and%20the%20same%20is%20true%20at%20every%20%CF%84%20(%7B_emb%5B%22pool-t010%22%5D%5B0%5D%3A.2f%7D%20at%200.01%2C%20%7B_emb%5B%22pool-t100%22%5D%5B0%5D%3A.2f%7D%20at%200.1).%20Neither%20contrary%20outcome%20occurred%20where%20the%20gate%20reads%3A%20no%20condition%20latched%20the%20embedding%20onto%20%60%2B%60%20or%20%60%3D%60%20(readability%20%E2%89%88%200%20there)%2C%20and%20none%20stayed%20uniform.%20The%20trained%20weights%20concentrate%20harder%20than%20the%200.6%E2%80%930.8%20calibration%20band%20predicted%20from%20the%20reference%20profiles%2C%20which%20is%20the%20softmin's%20self-reinforcement%20doing%20what%20the%20introduction%20said%20it%20would%20%E2%80%94%20just%20in%20the%20right%20place.%0A%0A%20%20%20%20**H4(b)%20holds.**%20The%20primary's%20weighted%20readability%20gain%20is%20%7Bread_gain(_P)%3A%2B.2f%7D%20against%20the%20%7Bex.READ_GAIN_GATE%3Ag%7D%20gate%20(pool-t010%20%7Bread_gain(%22pool-t010%22)%3A%2B.2f%7D%2C%20pool-t100%20%7Bread_gain(%22pool-t100%22)%3A%2B.2f%7D).%20Most%20of%20the%20gain%20comes%20from%20avoiding%20op2%20%E2%80%94%20the%20one%20span%20role%20that%20stays%20hard%20to%20read%20at%20depth%20(%24R%5E2%24%20%7BREAD%5B1%3A%2C%202%5D.mean()%3A.2f%7D%20averaged%20over%20the%20four%20deep%20slices%2C%20against%20%7BREAD%5B1%3A%2C%20%5B0%2C%201%2C%203%5D%5D.mean()%3A.2f%7D%20for%20the%20other%20three%20roles).%0A%0A%20%20%20%20Across%20depth%20the%20conditions%20diverge%2C%20and%20seed%20by%20seed%20the%20divergence%20is%20all-or-nothing%3A%20the%20hairlines%20show%20each%20run%20of%20the%20two%20sharper%20rungs%20committing%20its%20entire%20deep-slice%20weight%20to%20a%20single%20role.%20At%20%CF%84%20%3D%200.01%20that%20role%20is%20%60%2B%60%20in%20%7B_n_plus%5B%22pool-t010%22%5D%7D%20seeds%20of%20three%20and%20op1%20in%20the%20other%3B%20at%20%CF%84%20%3D%200.03%2C%20%60%2B%60%20in%20%7B_n_plus%5B%22pool-t030%22%5D%7D%3B%20at%20%CF%84%20%3D%200.1%20none%20commit%20to%20%60%2B%60%2C%20and%20the%20profile%20is%20the%20sweep's%20only%20genuinely%20graded%20one%20at%20depth%20(op1%20at%200.87%E2%80%930.97%20per%20seed%2C%20with%20real%20weight%20left%20elsewhere).%20So%20the%20seed-mean's%20apparent%20%60%2B%60%20minority%20at%20%CF%84%20%3D%200.03%20is%20a%20mixture%20of%20one-hot%20seeds%2C%20and%20the%20%CF%84%20trend%20is%20a%20latch-rate%20trend%3A%202%2F3%20%E2%86%92%201%2F3%20%E2%86%92%200%2F3.%20A%20%60%2B%60%20latch%20is%20a%20cheap%20early%20choice%20rather%20than%20a%20ruinous%20one%2C%20since%20%60%2B%60%20at%20depth%20reads%20op1's%20redness%20at%20%24R%5E2%24%20%E2%89%88%20%7BREAD%5B1%3A%2C%201%5D.mean()%3A.2f%7D.%20The%20prereg%20expected%20migration%20*toward*%20the%20syntax%20roles%20with%20depth%20in%20step%20with%20readability%3B%20what%20actually%20distinguishes%20the%20healthy%20runs%20is%20that%20they%20keep%20op1%20%E2%80%94%20which%20stays%20the%20*most*%20readable%20role%20at%20every%20slice%20%E2%80%94%20and%20the%20pull%20only%20leaves%20it%20where%20%CF%84%20is%20sharp%20enough%20to%20lock%20in%20an%20early%20accident.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Exploratory%20analyses%0A%0A%20%20%20%20Nothing%20here%20is%20preregistered%3B%20everything%20in%20this%20section%20is%20post%20hoc.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(traj)%3A%0A%20%20%20%20%23%20Post%20hoc.%20Per-seed%20trajectories%3A%20the%20seed%20mean%20at%20depth%20would%20average%0A%20%20%20%20%23%20one-hot%20runs%20into%20a%20shape%20no%20run%20has%2C%20so%20every%20run%20is%20drawn.%0A%20%20%20%20_PI_T%20%3D%20%7Bc%3A%20%5Btraj(c%2C%20s%2C%20%22pi%22)%20for%20s%20in%20ex.SEEDS%5D%20for%20c%20in%20ex.POOLED_NAMES%7D%0A%20%20%20%20_EPOCHS%20%3D%20np.mean(%5Btraj(ex.PRIMARY%2C%20s%2C%20%22epoch%22)%20for%20s%20in%20ex.SEEDS%5D%2C%20axis%3D0)%0A%0A%20%20%20%20%40themed(%0A%20%20%20%20%20%20%20%20name%3D%22concentration-timing%22%2C%0A%20%20%20%20%20%20%20%20alt_text%3D%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20Two%20line%20panels%20sharing%20an%20epoch%20axis%20from%200%20to%20100%2C%20each%20with%20nine%20thin%20curves%20%E2%80%94%20one%20per%20run%2C%20three%20per%20pooled%20condition%20at%20tau%200.01%2C%200.03%20and%200.1%20%E2%80%94%20and%20a%20horizontal%20reference%20line%20at%200.25%20for%20uniform%20weights.%20Left%20panel%2C%20op1's%20weight%20at%20the%20embedding%3A%20the%20nine%20curves%20scatter%20over%200%20to%200.8%20for%20the%20first%20few%20epochs%2C%20then%20converge%20to%20about%200.8%20by%20epoch%2020%20and%20stay%20flat%20to%20the%20end.%20Right%20panel%2C%20op1's%20weight%20at%20the%20last%20slice%3A%20every%20curve%20saturates%20by%20epoch%208%20and%20never%20moves%20again.%20Two%20of%20the%20three%20tau%200.01%20curves%20fall%20to%200%20by%20epoch%203%20and%20the%20third%20rises%20to%201%3B%20one%20tau%200.03%20curve%20falls%20to%200%20while%20the%20other%20two%20rise%20to%201%3B%20all%20three%20tau%200.1%20curves%20rise%20to%20about%200.9%20and%20hold%20there%2C%20short%20of%20saturation.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20caption%3Dr%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20**When%20the%20pull%20decides.**%20op1's%20share%20of%20the%20softmin%20weight%20over%20training%2C%20at%20the%20embedding%20(**left**)%20and%20at%20the%20last%20slice%20(**right**)%2C%20one%20line%20per%20run%3B%20the%20thin%20rule%20is%20uniform%20(0.25).%20The%20vertical%20band%20is%20the%20anchor's%20warmup%20window%20(epochs%200%E2%80%9310)%3B%20the%20repulsion%20anneal%20runs%20to%20epoch%2090.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20)%0A%20%20%20%20def%20_plot()%20-%3E%20plt.Figure%3A%0A%20%20%20%20%20%20%20%20from%20typing%20import%20cast%0A%0A%20%20%20%20%20%20%20%20from%20mini.vis%20import%20AxesRow%0A%0A%20%20%20%20%20%20%20%20_ink%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22pool-t010%22%3A%20light_dark(%22%237fb3d8%22%2C%20%22%234f7ea6%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22pool-t030%22%3A%20light_dark(%22%231f6fb4%22%2C%20%22%235fa8dd%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%22pool-t100%22%3A%20light_dark(%22%2312497c%22%2C%20%22%238ec4ea%22)%2C%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20_grey%20%3D%20light_dark(%22%23666%22%2C%20%22%23999%22)%0A%20%20%20%20%20%20%20%20fig%2C%20axes%20%3D%20plt.subplots(1%2C%202%2C%20figsize%3D(7.2%2C%202.5)%2C%20sharex%3DTrue%2C%20sharey%3DTrue%2C%20layout%3D%22constrained%22)%0A%20%20%20%20%20%20%20%20axes%20%3D%20cast(AxesRow%2C%20axes)%0A%20%20%20%20%20%20%20%20for%20ax%2C%20sl%2C%20title%20in%20zip(axes%2C%20(0%2C%204)%2C%20(%22op1%20weight%20at%20the%20embedding%22%2C%20%22op1%20weight%20at%20slice%204%22)%2C%20strict%3DTrue)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.axvspan(0%2C%20ex.SCHEDULER.warmup_epochs%2C%20color%3D_grey%2C%20alpha%3D0.12%2C%20lw%3D0)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.axhline(1%20%2F%20ex.SPAN%2C%20color%3D_grey%2C%20lw%3D0.6%2C%20alpha%3D0.5%2C%20zorder%3D0)%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20cond%2C%20ink%20in%20_ink.items()%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20for%20si%2C%20pi_t%20in%20enumerate(_PI_T%5Bcond%5D)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.plot(_EPOCHS%2C%20pi_t%5B%3A%2C%20sl%2C%200%5D%2C%20color%3Dink%2C%20lw%3D1.1%2C%20alpha%3D0.9%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20label%3Dcond%20if%20si%20%3D%3D%200%20else%20%22_%22)%20%20%23%20fmt%3A%20skip%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_title(title%2C%20fontsize%3D%22small%22%2C%20color%3D_grey)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_xlim(0%2C%20ex.SCHEDULER.epochs)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_ylim(-0.02%2C%201.02)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_xlabel(%22epoch%22%2C%20fontsize%3D%22x-small%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.tick_params(labelsize%3D8)%0A%20%20%20%20%20%20%20%20axes%5B0%5D.set_ylabel(r%22%24%5Cpi_%5Cmathrm%7Bop1%7D%24%22%2C%20fontsize%3D%22x-small%22)%0A%20%20%20%20%20%20%20%20axes%5B1%5D.legend(fontsize%3D8%2C%20frameon%3DFalse%2C%20loc%3D%22center%20right%22%2C%20labelcolor%3D_grey)%0A%20%20%20%20%20%20%20%20return%20fig%0A%0A%20%20%20%20mo.Html(_plot())%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20The%20choice%20is%20made%20during%20the%20anchor%20ramp%2C%20run%20by%20run.%20Every%20run's%20embedding%20weight%20settles%20by%20about%20epoch%2020%2C%20and%20every%20run's%20deep-slice%20choice%20is%20committed%20by%20epoch%208%20%E2%80%94%20the%20%CF%84%20%3D%200.01%20latches%20by%20epoch%202%E2%80%933%2C%20before%20the%20anchor%20has%20even%20finished%20warming%20up%20%E2%80%94%20and%20no%20choice%20changes%20for%20the%20rest%20of%20training.%20Nor%20is%20there%20much%20reason%20it%20should%3A%20once%20the%20softmin%20has%20concentrated%2C%20the%20losing%20roles%20receive%20no%20pull%2C%20and%20late%20training%20supplies%20no%20perturbation%20of%20the%20needed%20size%20%E2%80%94%20the%20learning%20rate%20is%20decaying%2C%20the%20regularizer%20weights%20are%20annealing%2C%20and%20100%20epochs%20is%20generous%20for%20this%20corpus%2C%20so%20the%20task%20loss%20has%20long%20converged.%20Two%20consequences%3A%20the%20long%20repulsion%20anneal%20that%20ex-2.1.8%20tuned%20matters%20for%20containment%20rather%20than%20for%20position%20choice%20(whatever%20the%20repulsion%20contributes%20to%20the%20choice%2C%20it%20contributes%20in%20the%20first%20few%20epochs%2C%20before%20the%20softmin%20closes)%2C%20and%20any%20intervention%20on%20the%20choice%20%E2%80%94%20a%20%CF%84%20schedule%20that%20starts%20soft%20and%20sharpens%2C%20say%20%E2%80%94%20has%20to%20land%20in%20that%20same%20window.%20The%20latch%2C%20then%2C%20is%20a%20race%20at%20initialization%3A%20whichever%20role%20happens%20to%20align%20cheapest%20in%20the%20first%20few%20hundred%20steps%20keeps%20the%20weight%2C%20which%20is%20why%20the%20winner-take-most%20rung%20latches%20most%20often.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(arrays%2C%20cells)%3A%0A%20%20%20%20%23%20Post%20hoc%3A%20the%20H3(c)%20scatter's%20pool-t010%20shelf%2C%20split%20by%20each%20run's%0A%20%20%20%20%23%20deep-slice%20choice.%0A%20%20%20%20_levels%20%3D%20np.unique(np.round(ex.REDNESS%2C%206))%0A%0A%20%20%20%20def%20_level_mean(y%3A%20np.ndarray)%20-%3E%20np.ndarray%3A%0A%20%20%20%20%20%20%20%20return%20np.array(%5By%5Bnp.round(ex.REDNESS%2C%206)%20%3D%3D%20lv%5D.mean()%20for%20lv%20in%20_levels%5D)%0A%0A%20%20%20%20def%20_resp(cond%3A%20str%2C%20s%3A%20int)%20-%3E%20np.ndarray%3A%0A%20%20%20%20%20%20%20%20%22%22%22One%20run's%20per-color%20op1%20response%3A%20the%20mean%20over%20slices%20of%20alignment%20at%20op1.%22%22%22%0A%20%20%20%20%20%20%20%20return%20arrays%5Bf%22%7Bcond%7D-s%7Bs%7D%2Falpha%22%5D%5B%3A%2C%20%3A%2C%200%5D.mean(axis%3D0)%0A%0A%20%20%20%20def%20_kept_op1(cond%3A%20str%2C%20s%3A%20int)%20-%3E%20bool%3A%0A%20%20%20%20%20%20%20%20return%20bool(np.asarray(cells%5Bf%22%7Bcond%7D-s%7Bs%7D%22%5D%5B%22pi%22%5D%2C%20dtype%3Dfloat)%5B4%2C%200%5D%20%3E%3D%200.5)%0A%0A%20%20%20%20%40themed(%0A%20%20%20%20%20%20%20%20name%3D%22grading-by-seed%22%2C%0A%20%20%20%20%20%20%20%20alt_text%3D%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20Three%20line%20panels%2C%20one%20per%20pooled%20condition%20at%20tau%200.01%2C%200.03%20and%200.1%2C%20sharing%20axes%3A%20mean%20response%20against%20redness%20of%20op1%20from%200%20to%201%2C%20three%20lines%20per%20panel%2C%20one%20per%20run%2C%20colored%20red%20if%20the%20run's%20deep%20slices%20kept%20op1%20and%20blue%20if%20they%20latched%20onto%20plus.%20Red%20lines%20rise%20smoothly%20from%20near%200%20at%20low%20redness%20to%20about%200.9%20at%20redness%201%20in%20every%20panel.%20Blue%20lines%20%E2%80%94%20two%20in%20the%20tau%200.01%20panel%2C%20one%20in%20the%20tau%200.03%20panel%2C%20none%20at%20tau%200.1%20%E2%80%94%20track%20near%20zero%20all%20the%20way%20to%20redness%200.72%2C%20then%20jump%20to%20about%200.5%20at%20redness%200.8%20and%200.7%20by%20redness%201%3A%20a%20step%20where%20the%20red%20lines%20have%20a%20slope.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20caption%3Dr%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20**The%20shelf%2C%20split%20by%20each%20run's%20deep-slice%20choice.**%20The%20grading%20response%20of%20every%20pooled%20run%20%E2%80%94%20the%20mean%20response%20at%20each%20of%20the%2029%20redness%20levels%2C%20as%20in%20the%20H3(c)%20figure%20but%20one%20line%20per%20run%20%E2%80%94%20colored%20by%20where%20that%20run's%20slice-4%20softmin%20weight%20ended%3A%20op1%20kept%20(red)%20or%20latched%20onto%20%60%2B%60%20(blue).%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20)%0A%20%20%20%20def%20_plot()%20-%3E%20plt.Figure%3A%0A%20%20%20%20%20%20%20%20from%20typing%20import%20cast%0A%0A%20%20%20%20%20%20%20%20from%20mini.vis%20import%20AxesRow%0A%0A%20%20%20%20%20%20%20%20_ink%20%3D%20%7BTrue%3A%20light_dark(%22%23c1332a%22%2C%20%22%23f0665a%22)%2C%20False%3A%20light_dark(%22%231f6fb4%22%2C%20%22%235fa8dd%22)%7D%0A%20%20%20%20%20%20%20%20_grey%20%3D%20light_dark(%22%23666%22%2C%20%22%23999%22)%0A%20%20%20%20%20%20%20%20fig%2C%20axes%20%3D%20plt.subplots(1%2C%203%2C%20figsize%3D(7.2%2C%202.4)%2C%20sharex%3DTrue%2C%20sharey%3DTrue%2C%20layout%3D%22constrained%22)%0A%20%20%20%20%20%20%20%20axes%20%3D%20cast(AxesRow%2C%20axes)%0A%20%20%20%20%20%20%20%20for%20ax%2C%20cond%20in%20zip(axes%2C%20ex.POOLED_NAMES%2C%20strict%3DTrue)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.axhline(0%2C%20color%3Dlight_dark(%22%23bbb%22%2C%20%22%23555%22)%2C%20lw%3D0.8%2C%20zorder%3D0)%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20s%20in%20ex.SEEDS%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.plot(_levels%2C%20_level_mean(_resp(cond%2C%20s))%2C%20color%3D_ink%5B_kept_op1(cond%2C%20s)%5D%2C%20lw%3D1.3)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_title(%22pool-t030%20(primary)%22%20if%20cond%20%3D%3D%20ex.PRIMARY%20else%20cond%2C%20fontsize%3D9.5)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.set_xlabel(%22redness%20of%20op1%22%2C%20fontsize%3D%22x-small%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20ax.tick_params(labelsize%3D8)%0A%20%20%20%20%20%20%20%20axes%5B0%5D.set_ylabel(r%22%24%5Calpha_c%24%20at%20op1%22%2C%20fontsize%3D%22x-small%22)%0A%20%20%20%20%20%20%20%20_keys%20%3D%20%5Bplt.Line2D(%5B%5D%2C%20%5B%5D%2C%20color%3D_ink%5Bk%5D%2C%20lw%3D1.3)%20for%20k%20in%20(True%2C%20False)%5D%0A%20%20%20%20%20%20%20%20axes%5B2%5D.legend(_keys%2C%20%5B%22deep%20pull%20kept%20op1%22%2C%20%22latched%20onto%20%2B%22%5D%2C%20fontsize%3D8%2C%20frameon%3DFalse%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20loc%3D%22upper%20left%22%2C%20labelcolor%3D_grey)%20%20%23%20fmt%3A%20skip%0A%20%20%20%20%20%20%20%20return%20fig%0A%0A%20%20%20%20mo.Html(_plot())%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(arrays%2C%20cells)%3A%0A%20%20%20%20def%20_resp_at(cond%3A%20str%2C%20s%3A%20int%2C%20level%3A%20float)%20-%3E%20float%3A%0A%20%20%20%20%20%20%20%20sel%20%3D%20np.round(ex.REDNESS%2C%202)%20%3D%3D%20level%0A%20%20%20%20%20%20%20%20return%20float(arrays%5Bf%22%7Bcond%7D-s%7Bs%7D%2Falpha%22%5D%5B%3A%2C%20sel%2C%200%5D.mean())%0A%0A%20%20%20%20_latched%20%3D%20%5Bs%20for%20s%20in%20ex.SEEDS%20if%20np.asarray(cells%5Bf%22pool-t010-s%7Bs%7D%22%5D%5B%22pi%22%5D%2C%20dtype%3Dfloat)%5B4%2C%200%5D%20%3C%200.5%5D%0A%20%20%20%20_kept%20%3D%20%5Bs%20for%20s%20in%20ex.SEEDS%20if%20s%20not%20in%20_latched%5D%5B0%5D%0A%20%20%20%20_hi%20%3D%20np.mean(%5B_resp_at(%22pool-t010%22%2C%20s%2C%200.8)%20for%20s%20in%20_latched%5D)%0A%20%20%20%20_lo%20%3D%20np.mean(%5B_resp_at(%22pool-t010%22%2C%20s%2C%200.72)%20for%20s%20in%20_latched%5D)%0A%20%20%20%20mo.md(rf%22%22%22%0A%20%20%20%20The%20shelf%20belongs%20to%20the%20latched%20runs.%20In%20the%20runs%20whose%20deep%20slices%20kept%20op1%2C%20the%20response%20grades%20smoothly%20with%20redness%20at%20every%20%CF%84.%20In%20the%20runs%20that%20latched%20onto%20%60%2B%60%2C%20it%20holds%20up%20only%20at%20the%20red%20end%20and%20drops%20sharply%20below%20redness%200.8%20%E2%80%94%20%60pool-t010%60's%20two%20latched%20runs%20average%20%7B_hi%3A.2f%7D%20at%20redness%200.8%20and%20%7B_lo%3A.2f%7D%20at%200.72%2C%20where%20its%20op1-keeping%20run%20reads%20%7B_resp_at(%22pool-t010%22%2C%20_kept%2C%200.72)%3A.2f%7D%20%E2%80%94%20which%20is%20also%20where%20the%20label%20affinity%20falls%20away%20steeply.%20That%20reading%20makes%20sense%20of%20the%20mechanism%3A%20in%20a%20latched%20run%20only%20the%20embedding%20slice%20still%20pulls%20op1%2C%20so%20a%20color%20keeps%20its%20alignment%20only%20to%20the%20extent%20that%20its%20lines%20keep%20getting%20labeled%2C%20and%20the%20graded%20contribution%20the%20deep%20slices%20add%20in%20healthy%20runs%20is%20missing.%20The%20seed-mean%20scatter%20under%20H3(c)%20blends%20the%20two%20shapes%2C%20which%20is%20what%20the%20%60pool-t010%60%20panel's%20shelf%20is.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(ANCHORED%2C%20READ%3A%20np.ndarray%2C%20metrics)%3A%0A%20%20%20%20%23%20Post%20hoc%3A%20the%20readability%20probe%2C%20re-run%20over%20the%20anchored%20checkpoints.%0A%20%20%20%20%23%20(The%20preregistered%20H4%20reference%20uses%20the%20control's%20profile%20only.)%0A%20%20%20%20_R_SEEDS%20%3D%20%7B%0A%20%20%20%20%20%20%20%20c%3A%20np.array(%5Bnp.asarray(metrics%5B%22readability%22%5D%5Bf%22%7Bc%7D-s%7Bs%7D%22%5D%2C%20dtype%3Dfloat)%20for%20s%20in%20ex.SEEDS%5D)%20for%20c%20in%20ANCHORED%0A%20%20%20%20%7D%0A%20%20%20%20_R%20%3D%20%7Bc%3A%20_R_SEEDS%5Bc%5D.mean(axis%3D0)%20for%20c%20in%20ANCHORED%7D%0A%20%20%20%20_x%20%3D%20np.arange(ex.SPAN)%0A%0A%20%20%20%20%40themed(%0A%20%20%20%20%20%20%20%20name%3D%22readability-profiles%22%2C%0A%20%20%20%20%20%20%20%20alt_text%3D%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20A%20five-by-five%20grid%20of%20small%20flush%20panels.%20Columns%20are%20the%20five%20anchored%20conditions%20from%20span-mean%20through%20the%20pooled%20taus%20to%20op1-oracle%3B%20rows%20are%20residual%20slices%20with%20the%20last%20slice%20on%20top%20and%20the%20embedding%20at%20the%20bottom%3B%20each%20panel%20spans%20the%20four%20span%20roles%20op1%2C%20plus%2C%20op2%20and%20equals%20horizontally%2C%200%20to%201%20vertically.%20A%20solid%20line%20with%20three%20faint%20hairlines%20shows%20each%20condition's%20own%20readability%2C%20a%20dashed%20line%20the%20un-anchored%20control's.%20In%20every%20column%20the%20solid%20line%20sits%20at%20or%20slightly%20above%20the%20dashed%20one%3A%20op1%20about%200.9%20on%20every%20row%2C%20plus%20and%20equals%20about%200.8%20to%200.9%20on%20all%20rows%20but%20the%20embedding%2C%20where%20both%20drop%20to%20zero%2C%20op2%20low.%20The%20one%20departure%20is%20the%20span-mean%20column%2C%20where%20op2%20rises%20to%20about%200.7%20on%20the%20deep%20rows%20against%20about%200.2%20in%20the%20dashed%20control%20and%20in%20every%20other%20column.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20%20%20%20%20caption%3Dr%22%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20**Where%20redness%20is%20readable%2C%20once%20a%20pull%20has%20acted.**%20The%20same%20leave-one-color-out%20ridge%20probe%20as%20H4(b)'s%20reference%2C%20run%20on%20the%20anchored%20checkpoints%3A%20each%20condition's%20own%20%24R%5E2(%5Cell%2C%20t)%24%20(solid%2C%20seed%20mean%3B%20hairlines%2C%20seeds)%20against%20the%20un-anchored%20control's%20(dashed).%20Compare%20the%20weight%20profiles%20above%3A%20the%20pull's%20weight%20is%20far%20sharper%20than%20readability%20anywhere%20it%20concentrates.%0A%20%20%20%20%20%20%20%20%22%22%22%2C%0A%20%20%20%20)%0A%20%20%20%20def%20_plot()%20-%3E%20plt.Figure%3A%0A%20%20%20%20%20%20%20%20from%20matplotlib.layout_engine%20import%20ConstrainedLayoutEngine%0A%0A%20%20%20%20%20%20%20%20from%20mini.vis%20import%20smooth_step%0A%0A%20%20%20%20%20%20%20%20_own_ink%20%3D%20light_dark(%22%23b4531f%22%2C%20%22%23dd8f5f%22)%0A%20%20%20%20%20%20%20%20_read_ink%20%3D%20light_dark(%22%23555%22%2C%20%22%23aaa%22)%0A%20%20%20%20%20%20%20%20_hair%20%3D%20light_dark(%22%2300000040%22%2C%20%22%23ffffff40%22)%0A%20%20%20%20%20%20%20%20_grey%20%3D%20light_dark(%22%23666%22%2C%20%22%23999%22)%0A%20%20%20%20%20%20%20%20fig%2C%20axes%20%3D%20plt.subplots(5%2C%205%2C%20figsize%3D(7.0%2C%203.7)%2C%20sharex%3DTrue%2C%20sharey%3DTrue)%0A%20%20%20%20%20%20%20%20axes%20%3D%20cast(AxesGrid%2C%20axes)%0A%20%20%20%20%20%20%20%20_engine%20%3D%20fig.get_layout_engine()%0A%20%20%20%20%20%20%20%20assert%20isinstance(_engine%2C%20ConstrainedLayoutEngine)%0A%20%20%20%20%20%20%20%20_engine.set(hspace%3D0%2C%20h_pad%3D0.01%2C%20wspace%3D0.05)%0A%20%20%20%20%20%20%20%20for%20col%2C%20cond%20in%20enumerate(ANCHORED)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20for%20row%20in%20range(5)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20sl%20%3D%204%20-%20row%20%20%23%20last%20slice%20on%20top%2C%20the%20embedding%20at%20the%20bottom%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax%20%3D%20axes%5Brow%5D%5Bcol%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20for%20seed_prof%20in%20_R_SEEDS%5Bcond%5D%5B%3A%2C%20sl%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20smooth_step(ax%2C%20_x%2C%20seed_prof%2C%20ramp%3D0.5%2C%20color%3D_hair%2C%20lw%3D0.5)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20smooth_step(ax%2C%20_x%2C%20_R%5Bcond%5D%5Bsl%5D%2C%20ramp%3D0.5%2C%20color%3D_own_ink%2C%20lw%3D1.5)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20smooth_step(ax%2C%20_x%2C%20READ%5Bsl%5D%2C%20ramp%3D0.5%2C%20color%3D_read_ink%2C%20lw%3D1.0%2C%20ls%3D(0%2C%20(4%2C%202)))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.set(ylim%3D(-0.08%2C%201.08)%2C%20xlim%3D(-0.4%2C%20ex.SPAN%20-%200.6)%2C%20yticks%3D%5B0.0%2C%200.5%2C%201.0%5D)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.spines%5B%3A%5D.set_visible(False)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.grid(axis%3D%22y%22%2C%20which%3D%22major%22%2C%20c%3D%22%23888%22%2C%20alpha%3D0.2)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.tick_params(axis%3D%22x%22%2C%20length%3D0%2C%20labelbottom%3DFalse)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.tick_params(axis%3D%22y%22%2C%20left%3DTrue%2C%20right%3DTrue%2C%20direction%3D%22in%22%2C%20labelleft%3DFalse%2C%20labelright%3DFalse)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20col%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ax.set_ylabel(%22emb%22%20if%20sl%20%3D%3D%200%20else%20f%22%7Bsl%7D%22%2C%20fontsize%3D8)%0A%20%20%20%20%20%20%20%20%20%20%20%20axes%5B0%5D%5Bcol%5D.set_title(%22pool-t030%5Cn(primary)%22%20if%20cond%20%3D%3D%20ex.PRIMARY%20else%20cond%2C%20fontsize%3D8%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fontweight%3D%22bold%22%20if%20cond%20%3D%3D%20ex.PRIMARY%20else%20%22normal%22)%20%20%23%20fmt%3A%20skip%0A%20%20%20%20%20%20%20%20%20%20%20%20axes%5B4%5D%5Bcol%5D.set_xticks(_x%2C%20ex.ROLES)%0A%20%20%20%20%20%20%20%20%20%20%20%20axes%5B4%5D%5Bcol%5D.tick_params(axis%3D%22x%22%2C%20labelbottom%3DTrue%2C%20labelsize%3D7.5)%0A%20%20%20%20%20%20%20%20axes%5B4%5D%5B4%5D.tick_params(axis%3D%22y%22%2C%20labelright%3DTrue%2C%20labelsize%3D7%2C%20pad%3D2)%0A%20%20%20%20%20%20%20%20fig.supylabel(%22slice%22%2C%20fontsize%3D9)%0A%20%20%20%20%20%20%20%20_own_key%20%3D%20plt.Line2D(%5B%5D%2C%20%5B%5D%2C%20color%3D_own_ink%2C%20lw%3D1.5)%0A%20%20%20%20%20%20%20%20_read_key%20%3D%20plt.Line2D(%5B%5D%2C%20%5B%5D%2C%20color%3D_read_ink%2C%20lw%3D1.0%2C%20ls%3D(0%2C%20(4%2C%202)))%0A%20%20%20%20%20%20%20%20fig.legend(%5B_own_key%2C%20_read_key%5D%2C%20%5B%22own%20readability%20%24R%5E2%24%20(redness)%22%2C%20%22control%20readability%20%24R%5E2%24%22%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fontsize%3D8.5%2C%20frameon%3DFalse%2C%20ncols%3D2%2C%20loc%3D%22lower%20center%22%2C%20bbox_to_anchor%3D(0.5%2C%201.0)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20labelcolor%3D_grey)%20%20%23%20fmt%3A%20skip%0A%20%20%20%20%20%20%20%20return%20fig%0A%0A%20%20%20%20mo.Html(_plot())%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(ANCHORED%2C%20READ%3A%20np.ndarray%2C%20cells%2C%20metrics)%3A%0A%20%20%20%20_R%20%3D%20%7B%0A%20%20%20%20%20%20%20%20c%3A%20np.mean(%5Bnp.asarray(metrics%5B%22readability%22%5D%5Bf%22%7Bc%7D-s%7Bs%7D%22%5D%2C%20dtype%3Dfloat)%20for%20s%20in%20ex.SEEDS%5D%2C%20axis%3D0)%0A%20%20%20%20%20%20%20%20for%20c%20in%20ANCHORED%0A%20%20%20%20%7D%0A%20%20%20%20_op1_min%20%3D%20min(_R%5Bc%5D%5B%3A%2C%200%5D.min()%20for%20c%20in%20ANCHORED)%0A%20%20%20%20_syn%20%3D%20np.array(%5B_R%5Bc%5D%5B1%3A%2C%20%5B1%2C%203%5D%5D%20for%20c%20in%20ANCHORED%5D)%20%20%23%20%60%2B%60%20and%20%60%3D%60%20past%20the%20embedding%0A%20%20%20%20_latched10%20%3D%20%5Bs%20for%20s%20in%20ex.SEEDS%20if%20np.asarray(cells%5Bf%22pool-t010-s%7Bs%7D%22%5D%5B%22pi%22%5D%2C%20dtype%3Dfloat)%5B4%2C%200%5D%20%3C%200.5%5D%0A%20%20%20%20_latched_op1%20%3D%20np.mean(%0A%20%20%20%20%20%20%20%20%5Bnp.asarray(metrics%5B%22readability%22%5D%5Bf%22pool-t010-s%7Bs%7D%22%5D%2C%20dtype%3Dfloat)%5B4%2C%200%5D%20for%20s%20in%20_latched10%5D%0A%20%20%20%20)%0A%20%20%20%20mo.md(rf%22%22%22%0A%20%20%20%20Redness%20is%20readable%20almost%20everywhere%20in%20the%20anchored%20runs.%20In%20every%20anchored%20condition%2C%20op1%20reads%20at%20%24R%5E2%24%20%E2%89%A5%20%7B_op1_min%3A.2f%7D%20at%20every%20slice%2C%20so%20the%20anchor%20axis%20itself%20now%20encodes%20redness.%20Past%20the%20embedding%2C%20%60%2B%60%20and%20%60%3D%60%20read%20at%20%7B_syn.mean()%3A.2f%7D%20on%20average%20and%20never%20below%20%7B_syn.min()%3A.2f%7D%2C%20much%20as%20in%20the%20control%3A%20attention%20copies%20the%20operand's%20color%20into%20each%20syntax%20role%2C%20whether%20or%20not%20anything%20pulls%20there.%0A%0A%20%20%20%20So%20the%20weight%20profile%20is%20not%20proportional%20to%20readability%2C%20and%20it%20couldn't%20be%3A%20at%20depth%20%CF%80%CC%84%20is%20one-hot%2C%20while%20%24R%5E2%24%20is%20high%20at%20three%20roles%20of%20four.%20The%20softmin%20allocates%20by%20*alignment%20cost*%20among%20positions%20nearly%20all%20of%20which%20could%20host%20the%20concept%2C%20which%20is%20part%20of%20why%20the%20latch%20is%20a%20race%20rather%20than%20a%20search.%20The%20latched%20runs%20of%20%60pool-t010%60%20still%20read%20op1%20at%20%7B_latched_op1%3A.2f%7D%20at%20the%20last%20slice%3A%20the%20pull%20wasn't%20blind%20there%3B%20it%20had%20found%20%60%2B%60%20cheaper%20first.%0A%0A%20%20%20%20The%20influence%20also%20runs%20the%20other%20way%3A%20where%20the%20pull%20keeps%20spending%2C%20it%20*creates*%20readability.%20op2%20is%20the%20one%20role%20the%20control%20barely%20reads%2C%20at%20%7BREAD%5B3%3A%2C%202%5D.mean()%3A.2f%7D%20across%20the%20two%20deepest%20slices.%20The%20span%20mean%20never%20stops%20pulling%20op2%2C%20and%20there%20it%20reads%20%7B_R%5B%22span-mean%22%5D%5B3%3A%2C%202%5D.mean()%3A.2f%7D%3B%20the%20primary%20condition's%20pool%20withdrew%20from%20op2%2C%20and%20there%20it%20reads%20%7B_R%5B%22pool-t030%22%5D%5B3%3A%2C%202%5D.mean()%3A.2f%7D%2C%20back%20at%20the%20control's%20level.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20Candidates%20we%20didn't%20run%2C%20queued%20in%20the%20project%20backlog%3A%0A%0A%20%20%20%20-%20Per-color%20weight%20maps%3A%20do%20strongly-red%20lines%20concentrate%20differently%20from%20weakly-red%20ones%3F%0A%20%20%20%20-%20Where%20the%20%60%2B%60%20embedding%20drift%20comes%20from%2C%20and%20when%3A%20it%20persists%20even%20under%20the%20op1%20oracle%2C%20as%20noted%20under%20H2.%20Recording%20drift%20per%20role%20in%20the%20trajectory%20would%20settle%20the%20timing.%0A%20%20%20%20-%20Two%20ways%20to%20avoid%20the%20latch%3A%20a%20%CF%84%20schedule%20that%20starts%20soft%20and%20sharpens%2C%20or%20position%20dropout%20in%20the%20pool%20%E2%80%94%20mask%20a%20random%20subset%20of%20span%20positions%20out%20of%20the%20softmin%20each%20step%2C%20so%20no%20single%20position%20can%20absorb%20the%20whole%20pull%20early.%0A%20%20%20%20-%20More%20seeds%20at%20the%20chosen%20rung.%20Three%20per%20condition%20gives%20only%20a%20coarse%20estimate%20of%20the%20latch%20rate.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Discussion%0A%0A%20%20%20%20What%20this%20experiment%20adds%20to%20the%20program%20is%20placement%20*along%20the%20sequence*.%20Where%20the%20concept%20lives%20in%20representation%20space%20is%20still%20chosen%20up%20front%2C%20as%20everywhere%20in%20SCA%3A%20the%20pull%20aims%20at%20the%20same%20fixed%20anchor%20direction%20throughout.%20The%20mellowmax%20adds%20one%20further%20choice%3A%20which%20token%20positions%20receive%20that%20pull.%20Left%20to%20choose%2C%20the%20pull%20chooses%20correctly%20at%20the%20embedding%20%E2%80%94%20the%20one%20slice%20where%20the%20architecture%20fixes%20the%20right%20answer%2C%20rather%20than%20the%20pull%20picking%20a%20favorite.%20Later%20milestones%20need%20that%2C%20because%20natural-language%20labels%20name%20concepts%2C%20not%20token%20positions.%0A%0A%20%20%20%20The%20margin%20question%20mostly%20dissolved.%20Under%20the%20max-over-roles%20statistic%2C%20the%20span%20mean%20is%20already%20near%20the%20oracle%2C%20so%20position-finding%20was%20never%20going%20to%20improve%20the%20margin%20much.%20What%20it%20improves%20is%20the%20shape%3A%20the%20pooled%20pull%20withdraws%20drift%20from%20op2%20and%20%60%3D%60%20nearly%20entirely%2C%20and%20the%20response%20it%20leaves%20at%20op1%20grades%20better%20than%20the%20response%20under%20the%20span%20mean.%0A%0A%20%20%20%20The%20qualification%20is%20the%20latch.%20Below%20%CF%84%20%3D%200.1%2C%20the%20deep-slice%20choice%20is%20a%20per-run%20race%20(see%20the%20readability%20probe%20above)%3A%20it%20settles%20in%20the%20first%20few%20epochs%2C%20is%20never%20revisited%2C%20and%20a%20run%20that%20latches%20onto%20%60%2B%60%20loses%20some%20of%20the%20graded%20response%20that%20makes%20the%20anchor%20usable.%20So%20sharpening%20%CF%84%20is%20not%20free%20%E2%80%94%20more%20concentration%20comes%20with%20more%20risk%20of%20committing%20to%20the%20wrong%20role%20before%20the%20representation%20has%20formed.%0A%0A%20%20%20%20One%20possible%20remedy%20is%20a%20%CF%84%20schedule%20that%20starts%20soft%20and%20sharpens%20as%20the%20geometry%20stabilizes.%20M1%20makes%20that%20plausible%3A%20there%2C%20schedules%20that%20shaped%20the%20latent%20space%20at%20the%20right%20time%20worked%20where%20curricula%20didn't.%5B%5Euntested%5D%20It%20may%20be%20hard%20to%20design%20in%20a%20larger%20model%2C%20though.%20A%20concept%20that%20only%20forms%20late%20in%20training%20would%20meet%20a%20pull%20that%20has%20already%20sharpened%20around%20whatever%20was%20cheap%20early.%20The%20schedule%20has%20to%20anticipate%20that%20timing%2C%20and%20three%20seeds%20per%20rung%20is%20too%20few%20to%20estimate%20the%20latch%20rates%20that%20would%20score%20it.%0A%0A%20%20%20%20Mellowmax%20is%20an%20interesting%20finding%20for%20M3%2C%20where%20labels%20get%20coarser.%20Its%20softmin%20weights%20are%20the%20same%20per-position%20responsibilities%20that%20an%20EM-flavored%20label-assignment%20scheme%20would%20compute%2C%5B%5Eem%5D%20so%20the%20pooled%20term%20is%20already%20such%20a%20scheme%2C%20with%20single%20tokens%20as%20the%20unit.%20This%20experiment%20says%20it%20can%20locate%20a%20concept%20when%20the%20label%20covers%20a%20whole%20line%2C%20although%20our%20lines%20only%20had%20four%20tokens%20to%20pool%20over.%0A%0A%20%20%20%20Coarser%20labels%2C%20whether%20per%20sentence%2C%20per%20document%2C%20or%20a%20sliding%20window%20with%20graded%20scores%2C%20would%20widen%20the%20pool%3A%20more%20candidates%2C%20and%20cheaper%20wrong%20ones.%20Nothing%20here%20rules%20that%20in%20or%20out%2C%20but%20this%20experiment%20does%20name%20the%20failure%20mode%20to%20design%20for%3A%20early%20winner-take-all%20latching%2C%20not%20diffuse%20smearing.%20The%20softest%20rung%20suggests%20the%20useful%20regime%20is%20soft%20pooling%20with%20a%20considered%20choice%20of%20*when*%20to%20sharpen%2C%20rather%20than%20hard%20selection%20from%20the%20start.%0A%0A%20%20%20%20%5B%5Euntested%5D%3A%20Regularizer%20weight%20schedules%20are%20an%20inheritance%20from%20M1.%20We%20haven't%20tested%20whether%20this%20architecture%20*needs*%20them%3A%20perhaps%20constant%20term%20weights%20would%20work.%0A%0A%20%20%20%20%5B%5Eem%5D%3A%20Expectation-maximization%3A%20alternate%20between%20assigning%20each%20item%20a%20soft%20share%20of%20responsibility%20to%20each%20component%2C%20and%20refitting%20the%20components%20to%20those%20shares.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
47ea9744394ada890182572d25bf7efc