# p-choose (batch e1-gate-p): Gate P, reference check, and the qt1-ref baseline on 60000..61023 Credit: the replica, policy, Gaussian filter and qm tables are by Taylor (gtmcknight). They come from [amm-sim `research/solved` @4812a638](https://github.com/gtmcknight/amm-sim/tree/4812a6382311624e1506aca131ca35c378f930d9/research/solved). Two more sources were used: - The reference policy `qmref.py` and qt1's Strategy.sol come from the qt1 artifact, [Q](https://api.imdnotdead.fun/artifacts/8a6e303b662e1a5ea9bb47f31acedd3988ef65b3ddb66d074517aa59ad41ca40). - The 10,167-byte QMS1 blob is qm-spline's, from [its artifact](https://api.imdnotdead.fun/artifacts/17d249ab0c33fc44931d9b105cf3f9e3846a560bd518b67310c2a56defacdecc). I changed none of Taylor's files and tuned nothing. Everything here ran on the pure-Python replica. No engine seeds were used. **Summary** - **Gate P: PASS.** All 12 printed values equal the brief's table to every digit (Python 3.9.6). - **Reference check: PASS.** The three values are 443.101741 / 571.454483 / 525.908441. - **Baseline: complete.** qt1-ref ran on replica seeds 60000..61023, n = 1024, each seed once: - mean **529.971160**, sd 91.977882, se 2.874309; - 0.1451 s per seed in one process; - 18.35 s wall for the whole window with `Pool(10)`. ## Gate P **Verdict: PASS.** `python3 -I gates.py` was run unmodified in `research/solved` and printed exactly the brief's table: all four columns, all three seeds, every digit. It took 5.0 s. **Python version:** CPython **3.9.6** (`/usr/bin/python3`, macOS arm64 build), standard library only, isolated mode `-I`. qm-spline and qt1 report the same digits under Python 3.12.3, and qt1 states Linux x86_64. So the replica reproduces to the printed digit across these Python versions and platforms. Printed table (verbatim): ``` seed perfect-info gaussian+plain gaussian+qm lattice+qm 10000 448.261189 443.455598 443.522608 443.663520 10001 576.779199 571.463409 571.623551 571.977293 10002 531.886497 525.168028 525.865859 526.411631 ``` | seed | expected (brief) | printed | match | |---|---|---|---| | 10000 | 448.261189 443.455598 443.522608 443.663520 | 448.261189 443.455598 443.522608 443.663520 | yes, 4/4 | | 10001 | 576.779199 571.463409 571.623551 571.977293 | 576.779199 571.463409 571.623551 571.977293 | yes, 4/4 | | 10002 | 531.886497 525.168028 525.865859 526.411631 | 531.886497 525.168028 525.865859 526.411631 | yes, 4/4 | **Checkout.** The sandbox refused `git clone` (see Problems), so T is GitHub's archive of the exact commit: - `https://github.com/gtmcknight/amm-sim/archive/4812a6382311624e1506aca131ca35c378f930d9.tar.gz` - 2,109,402 bytes, sha256 `b698daa9ab70151157c9b1b75007b64bc5b61eda3c9309f1711229e6aa2bcb36` - It extracts to `amm-sim-4812a6382311624e1506aca131ca35c378f930d9/`. Every file this work depends on is byte-identical to `raw.githubusercontent.com/gtmcknight/amm-sim/4812a6382311624e1506aca131ca35c378f930d9/research/solved/`: | file | sha256 (archive = raw) | |---|---| | README.md | `02d2b51f17adbb5411a2a67f7a37255143ba381a73ff10abba557d7d23c0cef2` | | gates.py | `603280c1f595ca163ffaf2ba1ebdc7945fdb08dabae67fc53c922d39e1cce604` | | replica2.py | `6e37b4e61e1ffa5ffb1e43912ddb8659105989aa986eb48fcd1d7608f8dca685` | | real.py | `1305b5333731c046c3e6736cc2578eff4635c88132a39c22f5780d78aef2c81e` | | evalpol.py | `6e67667bfed7798bdd3384652a6efc6ba0b1fce653740d0f9af2bcbcb8e6a27c` | | latt.py | `925c0fe996b19fd51fb79a85d5e4dba4bc2f5453d0a156cc1e480f65a6a00cc8` | | pol_mid.json | `efbb5ee102db4d312f64565d9bf7232b6becbe02b624164f744a402bbbf2983b` | | qm_k1e-5.json | `5ff53e42ca87390e5f65d1caa3f7a480e67a8212fb0670274dfd562b05ba1afd` | After all runs, I diffed the checkout against a fresh extract of the same archive. The comparison excluded the two added files, `__pycache__` and the harness's empty `.claude/` folders. The diff exited 0, so Taylor's files are unchanged. ## Reference check Both artifacts were fetched from api.imdnotdead.fun. The sha256 of each body equals its artifact id. I extracted the pieces with `extract.py` (below) and checked the hashes the sources state: | piece | bytes | sha256 (computed) | stated | match | |---|---:|---|---|---| | Q, the qt1 artifact (markdown) | 62,223 | `8a6e303b662e1a5ea9bb47f31acedd3988ef65b3ddb66d074517aa59ad41ca40` | artifact id | yes | | qt1 `Strategy.sol` (Q's `## Strategy.sol` fenced block, with its final newline) | 42,990 | `c68887cff61180e12ba2b1ceb333edf76a830f91f63b5d775a8806fb9ec08aca` | `c68887cf…08aca`, 42,990 bytes (brief and Q) | **yes** | | `qmref.py` (Q's `## Python reference` fenced block, with its final newline) | 7,739 | `1dfc9b7a3c2237ff7a93dd9f0af54b9bdab16f2ce0a7eb00784cb4432598db92` | Q states no hash | n/a | | qm-spline artifact (markdown) | 29,486 | `17d249ab0c33fc44931d9b105cf3f9e3846a560bd518b67310c2a56defacdecc` | artifact id | yes | | `blob.bin` (base64 under `## Data`, decoded) | 10,167 | `3ac7cb8811ecfb6a17f499aa4e9b70dd55f7fb6432b3aec3b904e11a3dece38e` | `3ac7cb88…e38e`, 10,167 bytes (qm-spline and Q) | **yes** | The stated Strategy.sol hash is that of the block with its final newline. Without the newline it is 42,989 bytes with sha256 `f3179686…`, which does not match. I copied `qmref.py` and `blob.bin` into `research/solved` as they were and ran `replica2.run(seed, QMRef('blob.bin'))['edge']`: | seed | expected | got (6 dp) | full precision | match | |---|---|---|---|---| | 10000 | 443.101741 | **443.101741** | 443.1017411146671 | yes | | 10001 | 571.454483 | **571.454483** | 571.4544833819275 | yes | | 10002 | 525.908441 | **525.908441** | 525.9084411612362 | yes | - The first run was serial, in one process. The table decode took 1.13 s and each seed about 0.11 s. - I ran the same three seeds again through the baseline's exact code path: `baseline.py`, `Pool` workers spawned under `-I`. The values were identical to full precision. So the worker path computes what the serial path does. ## Baseline **How it ran** - Each seed was scored with `replica2.run(seed, QMRef('blob.bin'))['edge']`. Taylor's `replica2.py` and Q's `qmref.py` are unmodified, and `n_steps` is the default 10000. - Runner: `multiprocessing.Pool(10)` on 10 cores, `imap_unordered` with one seed per task. Each worker decoded the tables once, in its initializer. - Each result was appended to a state file (`test/scratch/state/`) as it finished. Seeds already in the state file are never run again. **Timing first.** Seeds 60000..60015 (16 seeds) took 1.97 s wall, including each worker's 1.1 s table decode. At that rate the window needs well under a minute, far inside the 40-minute limit. So the whole window was run: the remaining 1,008 seeds (60016..61023) took 16.38 s wall. **Coverage.** The state file has 1,024 rows: one per seed 60000..61023, no duplicates, no gaps. Every seed was run exactly once. **Stats** (from the full-precision edges; computing from the 6-decimal values gives the same figures to 6 dp): | n | mean | sd (sample, n−1) | se | median | min (seed) | max (seed) | |---:|---:|---:|---:|---:|---|---| | 1024 | 529.971160 | 91.977882 | 2.874309 | 526.726176 | 328.751730 (60317) | 849.013574 (60210) | - `seconds_per_seed` = **0.1451**. This is the mean `time.perf_counter()` time of one seed's `replica2.run` inside one worker process. The range was 0.1128 to 0.2256 s. - With 10 processes, the whole window took 18.35 s of wall time, 0.0179 s per seed. - The per-seed sd is 92. Levels on different seed windows are therefore not comparable: pair against these per-seed values. Edges are rounded to 6 decimals. The keys are the seeds 60000..61023, all of them. ```json {"policy":"qt1-ref","seeds":"60000..61023","n":1024,"mean":529.971160,"sd":91.977882,"seconds_per_seed":0.1451,"edges":{ "60000":486.160768,"60001":490.786874,"60002":591.010155,"60003":589.694856,"60004":553.191798,"60005":622.414276,"60006":539.008265,"60007":448.207935, "60008":384.002665,"60009":469.210165,"60010":591.764527,"60011":449.539487,"60012":452.852589,"60013":485.015154,"60014":565.388332,"60015":492.443652, "60016":408.895490,"60017":592.989825,"60018":618.110164,"60019":513.721808,"60020":583.771847,"60021":368.818747,"60022":545.175264,"60023":707.401576, "60024":523.882421,"60025":704.281470,"60026":655.929091,"60027":610.588587,"60028":554.402399,"60029":624.851985,"60030":393.275464,"60031":669.320414, "60032":550.614644,"60033":671.166217,"60034":475.227318,"60035":617.297050,"60036":689.039367,"60037":551.071560,"60038":539.945805,"60039":538.993357, "60040":584.314860,"60041":532.763528,"60042":402.553751,"60043":542.349030,"60044":436.212376,"60045":599.574274,"60046":529.636218,"60047":488.068627, "60048":527.000880,"60049":447.157223,"60050":416.816460,"60051":412.274312,"60052":603.021470,"60053":465.434740,"60054":437.762737,"60055":539.368616, "60056":540.510420,"60057":579.227057,"60058":618.691086,"60059":419.526953,"60060":466.518326,"60061":373.257345,"60062":534.452460,"60063":394.300666, "60064":452.782890,"60065":560.132288,"60066":515.307340,"60067":581.777509,"60068":485.391712,"60069":523.510990,"60070":579.354003,"60071":489.170484, "60072":604.949398,"60073":571.684743,"60074":375.879165,"60075":498.015518,"60076":550.221327,"60077":426.615329,"60078":498.182765,"60079":481.925601, "60080":427.764565,"60081":601.345539,"60082":517.801940,"60083":570.621657,"60084":584.815544,"60085":534.406249,"60086":565.604162,"60087":707.015661, "60088":499.740297,"60089":503.676483,"60090":430.395793,"60091":592.869758,"60092":566.002754,"60093":454.551127,"60094":396.215754,"60095":603.182890, "60096":428.672109,"60097":475.024342,"60098":467.827760,"60099":434.129480,"60100":499.463951,"60101":581.297444,"60102":501.264607,"60103":591.770898, "60104":677.985358,"60105":626.047107,"60106":531.619745,"60107":482.446911,"60108":390.505514,"60109":409.551351,"60110":578.731490,"60111":602.859306, "60112":487.167251,"60113":650.643785,"60114":429.465133,"60115":595.928958,"60116":404.724540,"60117":601.104237,"60118":388.498942,"60119":422.690430, "60120":537.929658,"60121":597.086497,"60122":681.377589,"60123":500.129354,"60124":600.935404,"60125":526.532232,"60126":672.062527,"60127":454.165807, "60128":582.481350,"60129":404.895838,"60130":544.038285,"60131":581.274325,"60132":487.371198,"60133":446.399527,"60134":571.970464,"60135":500.703228, "60136":635.416822,"60137":529.169369,"60138":596.543586,"60139":518.310545,"60140":438.823892,"60141":507.183214,"60142":558.335417,"60143":782.278408, "60144":464.863708,"60145":631.590607,"60146":509.773115,"60147":671.144623,"60148":632.074753,"60149":736.850677,"60150":461.309291,"60151":432.518916, "60152":642.818478,"60153":509.555475,"60154":696.732437,"60155":540.526111,"60156":371.271547,"60157":498.488381,"60158":439.223161,"60159":359.748033, "60160":336.187970,"60161":448.628349,"60162":691.438560,"60163":522.677836,"60164":505.041912,"60165":464.504899,"60166":393.781033,"60167":484.893613, "60168":378.081952,"60169":642.088455,"60170":560.387201,"60171":407.847639,"60172":510.235925,"60173":651.066561,"60174":509.781506,"60175":395.767248, "60176":582.962183,"60177":485.445865,"60178":549.855903,"60179":363.063875,"60180":732.691913,"60181":568.348095,"60182":429.529033,"60183":394.596481, "60184":609.165919,"60185":419.737961,"60186":514.386069,"60187":407.963218,"60188":467.982178,"60189":396.670929,"60190":553.754377,"60191":640.555319, "60192":480.065997,"60193":504.736526,"60194":634.612933,"60195":525.127146,"60196":420.862343,"60197":568.350580,"60198":449.253192,"60199":504.780579, "60200":667.876910,"60201":453.668848,"60202":523.005683,"60203":667.349898,"60204":528.526252,"60205":708.650923,"60206":597.640788,"60207":638.252008, "60208":535.083985,"60209":489.979350,"60210":849.013574,"60211":536.422534,"60212":494.232074,"60213":451.906353,"60214":506.931966,"60215":562.748702, "60216":470.685686,"60217":692.841909,"60218":719.531935,"60219":579.021435,"60220":376.682379,"60221":417.771024,"60222":580.096472,"60223":520.513115, "60224":415.742340,"60225":449.829033,"60226":422.125420,"60227":418.643395,"60228":560.435927,"60229":702.036080,"60230":590.988264,"60231":506.914902, "60232":382.551357,"60233":476.147353,"60234":598.754150,"60235":599.380609,"60236":495.682009,"60237":492.720292,"60238":554.665874,"60239":527.371224, "60240":627.912644,"60241":473.327778,"60242":491.309095,"60243":446.120790,"60244":621.944327,"60245":372.300607,"60246":623.144938,"60247":587.307532, "60248":538.481201,"60249":492.506130,"60250":538.307626,"60251":600.920859,"60252":570.304535,"60253":360.653385,"60254":359.110988,"60255":513.227613, "60256":553.844305,"60257":476.613239,"60258":419.294495,"60259":514.377869,"60260":592.140635,"60261":414.191276,"60262":530.679408,"60263":594.312351, "60264":654.943569,"60265":468.129845,"60266":500.446668,"60267":537.407183,"60268":651.957743,"60269":477.852602,"60270":505.101375,"60271":501.732978, "60272":393.843714,"60273":505.784815,"60274":528.893397,"60275":589.818950,"60276":600.487929,"60277":659.977206,"60278":549.842544,"60279":502.741795, "60280":422.059767,"60281":601.127676,"60282":451.673931,"60283":446.740969,"60284":516.939084,"60285":650.738522,"60286":443.027324,"60287":623.618283, "60288":525.114148,"60289":435.642763,"60290":393.909102,"60291":529.147742,"60292":590.392649,"60293":371.692398,"60294":509.778546,"60295":603.811752, "60296":507.515423,"60297":411.940687,"60298":517.913633,"60299":437.017764,"60300":558.354512,"60301":605.051760,"60302":513.501500,"60303":459.478350, "60304":630.064972,"60305":412.663497,"60306":529.250592,"60307":436.021916,"60308":547.593237,"60309":407.685873,"60310":498.470847,"60311":498.126497, "60312":436.456087,"60313":520.501647,"60314":517.248894,"60315":434.228324,"60316":478.976299,"60317":328.751730,"60318":557.557617,"60319":520.875537, "60320":550.467375,"60321":788.043652,"60322":577.379679,"60323":515.494061,"60324":434.300846,"60325":562.847373,"60326":435.917259,"60327":611.294018, "60328":605.158375,"60329":411.814240,"60330":467.371882,"60331":397.564213,"60332":763.154747,"60333":682.090191,"60334":557.918717,"60335":728.699648, "60336":507.434160,"60337":644.705294,"60338":719.998230,"60339":345.975840,"60340":524.817242,"60341":585.923013,"60342":540.682934,"60343":616.465776, "60344":471.016501,"60345":577.923123,"60346":605.402580,"60347":558.479639,"60348":545.908409,"60349":485.066185,"60350":725.433951,"60351":380.529561, "60352":569.304144,"60353":525.552887,"60354":602.021952,"60355":438.369705,"60356":650.979167,"60357":526.565514,"60358":506.387910,"60359":494.414139, "60360":552.280059,"60361":696.042747,"60362":374.303885,"60363":557.620398,"60364":486.827115,"60365":667.608342,"60366":631.722874,"60367":536.649293, "60368":609.380586,"60369":574.938644,"60370":629.422683,"60371":428.860642,"60372":538.599052,"60373":468.511167,"60374":561.753032,"60375":668.229300, "60376":467.759394,"60377":505.561363,"60378":524.133741,"60379":455.572609,"60380":460.648321,"60381":475.360701,"60382":652.124227,"60383":479.696962, "60384":437.075688,"60385":604.153755,"60386":598.609484,"60387":686.806465,"60388":439.057332,"60389":628.156882,"60390":557.236961,"60391":552.094091, "60392":445.145575,"60393":614.755240,"60394":418.605619,"60395":634.509683,"60396":558.949251,"60397":543.446370,"60398":605.326075,"60399":421.695052, "60400":516.785429,"60401":480.396154,"60402":483.346404,"60403":572.673791,"60404":615.872836,"60405":654.717762,"60406":434.945972,"60407":592.562285, "60408":716.276498,"60409":558.243577,"60410":483.393129,"60411":673.287360,"60412":571.434684,"60413":536.856419,"60414":444.245429,"60415":469.364708, "60416":354.585875,"60417":682.707475,"60418":445.758722,"60419":384.829305,"60420":397.217124,"60421":428.342761,"60422":407.844295,"60423":466.783353, "60424":651.478263,"60425":490.672768,"60426":583.788379,"60427":513.190707,"60428":429.791174,"60429":465.272505,"60430":531.312689,"60431":601.044781, "60432":461.955954,"60433":672.645357,"60434":583.239539,"60435":493.967930,"60436":411.107296,"60437":542.041534,"60438":687.640297,"60439":509.652805, "60440":651.833458,"60441":467.705866,"60442":598.796348,"60443":472.176489,"60444":472.078035,"60445":539.273839,"60446":630.468333,"60447":459.759416, "60448":481.268791,"60449":425.517870,"60450":452.638335,"60451":417.582583,"60452":569.502349,"60453":817.192157,"60454":574.048071,"60455":494.424672, "60456":616.391440,"60457":520.241417,"60458":511.764397,"60459":607.787959,"60460":558.064695,"60461":536.201086,"60462":511.963162,"60463":657.302345, "60464":478.685681,"60465":366.710059,"60466":546.833034,"60467":799.982482,"60468":455.924161,"60469":638.232047,"60470":578.154460,"60471":447.704854, "60472":492.527381,"60473":482.720182,"60474":699.422308,"60475":588.967602,"60476":463.539140,"60477":534.634139,"60478":513.146091,"60479":480.605215, "60480":763.211368,"60481":428.226600,"60482":679.684481,"60483":566.946302,"60484":415.802809,"60485":627.791485,"60486":386.386194,"60487":555.084740, "60488":434.767082,"60489":450.164798,"60490":515.374696,"60491":351.051544,"60492":490.293413,"60493":586.217997,"60494":432.619331,"60495":680.593616, "60496":675.607102,"60497":661.373076,"60498":356.910219,"60499":499.479816,"60500":519.959659,"60501":548.596412,"60502":455.282257,"60503":661.308674, "60504":624.217391,"60505":431.448436,"60506":636.173286,"60507":382.421258,"60508":527.677079,"60509":571.069488,"60510":535.320776,"60511":571.290926, "60512":391.762082,"60513":491.806119,"60514":515.396949,"60515":444.512073,"60516":489.915225,"60517":406.621340,"60518":519.470670,"60519":506.602191, "60520":546.287200,"60521":546.259999,"60522":638.231416,"60523":531.672730,"60524":524.478205,"60525":570.848441,"60526":538.862533,"60527":749.677765, "60528":412.247640,"60529":396.839079,"60530":450.208972,"60531":445.219018,"60532":597.808841,"60533":426.019381,"60534":380.632243,"60535":408.828495, "60536":515.193779,"60537":508.441924,"60538":390.194453,"60539":559.262939,"60540":616.699756,"60541":555.335845,"60542":434.825681,"60543":717.288233, "60544":428.639898,"60545":600.229418,"60546":690.665872,"60547":586.975301,"60548":443.676284,"60549":523.063273,"60550":550.498232,"60551":637.906963, "60552":439.566990,"60553":404.206613,"60554":552.797049,"60555":550.211535,"60556":582.353769,"60557":424.937665,"60558":538.166254,"60559":549.856397, "60560":403.342124,"60561":448.683774,"60562":634.296012,"60563":585.330951,"60564":596.817631,"60565":636.027042,"60566":641.558723,"60567":632.790202, "60568":606.093201,"60569":683.403300,"60570":581.375361,"60571":574.226599,"60572":613.948247,"60573":518.191583,"60574":524.346274,"60575":510.815096, "60576":595.797917,"60577":692.111871,"60578":524.667414,"60579":540.613868,"60580":419.033838,"60581":639.412658,"60582":523.727009,"60583":564.885793, "60584":473.229753,"60585":490.584488,"60586":551.614550,"60587":548.208327,"60588":675.460505,"60589":623.100982,"60590":452.583900,"60591":500.643801, "60592":553.105999,"60593":432.368531,"60594":681.612187,"60595":607.113238,"60596":454.233019,"60597":531.732364,"60598":510.418750,"60599":433.391436, "60600":537.260036,"60601":477.148271,"60602":543.017701,"60603":618.040357,"60604":620.769672,"60605":376.892575,"60606":467.039368,"60607":389.885103, "60608":638.406023,"60609":586.477656,"60610":639.963346,"60611":516.294111,"60612":603.937204,"60613":527.258092,"60614":386.845947,"60615":452.862257, "60616":410.345475,"60617":360.005573,"60618":541.991429,"60619":415.428028,"60620":466.632969,"60621":577.238533,"60622":394.313688,"60623":647.840178, "60624":482.764411,"60625":543.851415,"60626":450.928925,"60627":606.315970,"60628":494.783208,"60629":613.199729,"60630":593.017774,"60631":532.190711, "60632":601.050283,"60633":577.691896,"60634":658.442066,"60635":688.087703,"60636":441.210200,"60637":556.603505,"60638":535.994686,"60639":395.949976, "60640":530.235982,"60641":655.541076,"60642":570.982293,"60643":393.888047,"60644":520.612808,"60645":395.024344,"60646":475.492081,"60647":587.476420, "60648":628.493686,"60649":443.207478,"60650":407.830942,"60651":434.750401,"60652":615.362250,"60653":658.527384,"60654":482.139507,"60655":503.073956, "60656":616.911583,"60657":416.630130,"60658":579.331963,"60659":648.163721,"60660":597.683894,"60661":578.850800,"60662":530.337510,"60663":606.660445, "60664":445.826822,"60665":452.474829,"60666":469.371044,"60667":592.988916,"60668":540.305532,"60669":472.567380,"60670":429.842481,"60671":492.111328, "60672":471.998436,"60673":431.493330,"60674":596.547957,"60675":409.700389,"60676":532.556277,"60677":748.263520,"60678":497.903277,"60679":703.436651, "60680":793.879764,"60681":523.727885,"60682":473.376940,"60683":378.491390,"60684":517.060429,"60685":383.563669,"60686":479.673140,"60687":523.392089, "60688":575.565080,"60689":640.203386,"60690":609.850529,"60691":433.378164,"60692":575.637549,"60693":333.487560,"60694":484.962953,"60695":599.126542, "60696":567.196427,"60697":529.996563,"60698":424.044794,"60699":432.184550,"60700":394.619810,"60701":391.650811,"60702":709.649774,"60703":696.994166, "60704":634.886685,"60705":553.084835,"60706":642.647550,"60707":468.388983,"60708":367.533682,"60709":569.323359,"60710":615.140892,"60711":551.448432, "60712":481.150204,"60713":580.656088,"60714":373.133379,"60715":444.943879,"60716":522.738109,"60717":548.068451,"60718":614.520967,"60719":391.840900, "60720":394.279017,"60721":532.019303,"60722":572.615528,"60723":626.662267,"60724":679.089252,"60725":642.884812,"60726":384.771343,"60727":452.646945, "60728":415.720990,"60729":548.547558,"60730":599.345605,"60731":536.654079,"60732":533.926018,"60733":578.552241,"60734":488.734952,"60735":610.976311, "60736":746.038221,"60737":468.108108,"60738":390.214688,"60739":462.460031,"60740":469.818307,"60741":482.107517,"60742":725.013741,"60743":547.629896, "60744":581.046291,"60745":619.862643,"60746":406.791243,"60747":599.675626,"60748":543.535746,"60749":452.996614,"60750":416.548272,"60751":428.376962, "60752":616.810823,"60753":513.592202,"60754":470.563065,"60755":532.317736,"60756":495.543932,"60757":529.376253,"60758":594.905064,"60759":741.886602, "60760":457.243672,"60761":574.464639,"60762":599.904720,"60763":622.850790,"60764":418.285933,"60765":597.459552,"60766":664.880740,"60767":385.685153, "60768":520.712542,"60769":420.619898,"60770":477.937951,"60771":476.138320,"60772":536.021398,"60773":544.777471,"60774":417.503774,"60775":516.965417, "60776":455.396745,"60777":447.704655,"60778":581.494911,"60779":442.493167,"60780":396.392183,"60781":468.592076,"60782":652.083548,"60783":642.707646, "60784":637.744103,"60785":405.128806,"60786":480.047614,"60787":539.194854,"60788":402.335971,"60789":486.842928,"60790":549.437623,"60791":393.923929, "60792":452.213747,"60793":514.254076,"60794":501.841665,"60795":516.885315,"60796":528.015349,"60797":383.282709,"60798":433.063905,"60799":531.832811, "60800":574.921980,"60801":551.897818,"60802":739.370888,"60803":650.472291,"60804":503.632607,"60805":556.859149,"60806":618.542918,"60807":485.897425, "60808":433.714419,"60809":691.597210,"60810":602.550656,"60811":599.981561,"60812":490.603996,"60813":624.266027,"60814":626.956191,"60815":492.295241, "60816":548.120888,"60817":630.834949,"60818":633.054692,"60819":677.884028,"60820":356.538875,"60821":667.968193,"60822":559.754897,"60823":432.437783, "60824":450.650038,"60825":605.877862,"60826":519.201060,"60827":526.886837,"60828":401.384501,"60829":384.205694,"60830":487.101629,"60831":480.263022, "60832":534.962693,"60833":392.653634,"60834":518.981329,"60835":580.657308,"60836":449.379231,"60837":404.679927,"60838":466.096161,"60839":716.670286, "60840":688.979130,"60841":540.281762,"60842":457.277405,"60843":556.822801,"60844":526.369675,"60845":573.066593,"60846":607.452542,"60847":679.440875, "60848":702.990944,"60849":430.358377,"60850":500.630905,"60851":450.386371,"60852":518.522673,"60853":613.771036,"60854":608.118107,"60855":622.456089, "60856":464.001539,"60857":507.815633,"60858":612.776667,"60859":554.880853,"60860":429.925641,"60861":417.467756,"60862":458.097078,"60863":457.026067, "60864":399.495379,"60865":461.960683,"60866":439.170775,"60867":408.813128,"60868":513.502665,"60869":683.528753,"60870":505.062108,"60871":610.042541, "60872":439.186979,"60873":567.725980,"60874":594.659243,"60875":442.207492,"60876":550.858146,"60877":642.078591,"60878":675.042974,"60879":540.944679, "60880":418.097308,"60881":582.028824,"60882":459.369522,"60883":530.050788,"60884":489.625416,"60885":612.484542,"60886":463.067000,"60887":564.610830, "60888":544.012044,"60889":530.967300,"60890":663.664943,"60891":624.063573,"60892":611.702757,"60893":481.716277,"60894":558.099613,"60895":553.149719, "60896":520.557963,"60897":440.338343,"60898":466.140569,"60899":564.224278,"60900":695.742033,"60901":464.379223,"60902":472.171242,"60903":547.774182, "60904":426.471440,"60905":506.555058,"60906":445.000971,"60907":388.894303,"60908":543.847126,"60909":517.471435,"60910":428.789630,"60911":559.201945, "60912":707.198387,"60913":517.668752,"60914":395.293178,"60915":617.243026,"60916":646.518613,"60917":623.755710,"60918":462.455339,"60919":639.464823, "60920":406.750738,"60921":434.851263,"60922":445.679131,"60923":623.486841,"60924":401.976852,"60925":397.332997,"60926":550.698582,"60927":499.110373, "60928":618.386710,"60929":676.654230,"60930":662.944427,"60931":626.563604,"60932":394.591062,"60933":609.629828,"60934":518.087727,"60935":511.631292, "60936":543.846086,"60937":530.734792,"60938":454.642442,"60939":513.994779,"60940":443.031678,"60941":546.567432,"60942":645.206228,"60943":686.383184, "60944":562.404114,"60945":566.476570,"60946":607.293750,"60947":393.767958,"60948":562.555878,"60949":590.282817,"60950":410.920428,"60951":515.489103, "60952":414.764065,"60953":570.438485,"60954":432.818498,"60955":530.307882,"60956":410.280099,"60957":578.884736,"60958":600.849450,"60959":389.481410, "60960":649.620594,"60961":608.847265,"60962":709.833311,"60963":667.976289,"60964":715.411392,"60965":690.268381,"60966":374.705024,"60967":395.647013, "60968":572.739846,"60969":509.034949,"60970":434.203709,"60971":421.595018,"60972":639.515242,"60973":560.568344,"60974":474.844296,"60975":701.492993, "60976":669.668012,"60977":602.057462,"60978":476.058616,"60979":426.931690,"60980":570.355516,"60981":562.318532,"60982":664.188434,"60983":601.355814, "60984":630.534152,"60985":509.947969,"60986":468.211106,"60987":606.611584,"60988":513.434538,"60989":678.625765,"60990":455.205369,"60991":605.472301, "60992":659.399293,"60993":585.848726,"60994":596.623396,"60995":452.839639,"60996":619.102791,"60997":437.932112,"60998":401.598177,"60999":502.333205, "61000":524.093798,"61001":470.895172,"61002":379.204558,"61003":489.276808,"61004":666.880042,"61005":503.267160,"61006":549.555270,"61007":462.461874, "61008":478.834770,"61009":465.225485,"61010":443.639732,"61011":526.311889,"61012":669.922307,"61013":718.788136,"61014":500.321375,"61015":420.301981, "61016":687.669966,"61017":547.951666,"61018":435.294827,"61019":594.363297,"61020":466.025369,"61021":468.246129,"61022":506.556838,"61023":603.566722 }} ``` ## Commands Paths are relative to the workspace root, and `cd` lines are shown as they were run. `S` = `test/scratch/T/amm-sim-4812a6382311624e1506aca131ca35c378f930d9/research/solved`. My scripts live in `test/scratch/tools/`, and their full source is below. 1. `ls -la && git log --oneline | head -5 && which python3 && python3 --version && sysctl -n hw.ncpu` - Python 3.9.6. - `sysctl` failed with `Operation not permitted` (exit 1). 2. `python3 -I -c "import os, sys, platform; print(os.cpu_count(), sys.version, platform.platform())"` printed 10 cores, 3.9.6, macOS arm64. 3. `cd test/scratch && git clone https://github.com/gtmcknight/amm-sim.git amm-sim` failed: the sandbox refused writing `.git/hooks/*` in the nested repo. 4. `git clone --template= https://github.com/gtmcknight/amm-sim.git amm-sim` failed: `could not lock config file .../amm-sim/.git/config: Operation not permitted`. 5. `curl -LsSf https://github.com/gtmcknight/amm-sim/archive/4812a6382311624e1506aca131ca35c378f930d9.tar.gz -o dl/amm-sim-4812a63.tar.gz && shasum -a 256 dl/amm-sim-4812a63.tar.gz && mkdir -p T && tar --no-same-owner -xzf dl/amm-sim-4812a63.tar.gz -C T` 6. `cd $S && /usr/bin/time -p python3 -I gates.py` was refused by the tool's permission check before it started. 7. **`cd $S && time python3 -I gates.py`** printed the Gate P table above (5.0 s). 8. Fetch both artifacts and list their headings: ``` mkdir -p dl/q dl/b curl -LsSf https://api.imdnotdead.fun/artifacts/8a6e303b662e1a5ea9bb47f31acedd3988ef65b3ddb66d074517aa59ad41ca40 -o dl/q/Q.md curl -LsSf https://api.imdnotdead.fun/artifacts/17d249ab0c33fc44931d9b105cf3f9e3846a560bd518b67310c2a56defacdecc -o dl/b/B.md shasum -a 256 dl/q/Q.md dl/b/B.md grep -n '^#' dl/q/Q.md grep -n '^#' dl/b/B.md ``` 9. `python3 -I tools/extract.py dl/q/Q.md dl/b/B.md extracted` produced the hashes in the Reference check table. 10. **`cp extracted/qmref.py extracted/blob.bin $S/ && shasum -a 256 $S/qmref.py $S/blob.bin && time python3 -I tools/refcheck.py $S`** gave the three reference values. 11. **`time python3 -I tools/baseline.py $S 60000 60015 state/qt1ref_60000_61023.jsonl 10`** was the 16-seed timing batch (1.97 s wall). 12. **`time python3 -I tools/baseline.py $S 60016 61023 state/qt1ref_60000_61023.jsonl 10`** ran the remaining 1,008 seeds (16.38 s wall). 13. `python3 -I tools/summarize.py state/qt1ref_60000_61023.jsonl 60000 61023 state/baseline_block.json` checked coverage and computed the stats. 14. `python3 -I tools/baseline.py $S 10000 10002 state/poolpath_check_10000_10002.jsonl 3` was the pool-path check of the reference values. 15. Diff against a fresh extract: ``` mkdir -p T2 && tar --no-same-owner -xzf dl/amm-sim-4812a63.tar.gz -C T2 diff -r -x __pycache__ -x qmref.py -x blob.bin T2/amm-sim-4812a63… T/amm-sim-4812a63… ``` - The diff exited 1. Its only output was `Only in T/…: .claude` and `Only in T/…/research/solved: .claude`. - `ls -laR` showed both are empty `.claude/.cc-writes` folders that the harness creates in directories it enters. 16. `diff -r -x __pycache__ -x qmref.py -x blob.bin -x .claude T2/amm-sim-4812a63… T/amm-sim-4812a63…` exited 0. 17. For each f in README.md gates.py replica2.py real.py evalpol.py latt.py pol_mid.json qm_k1e-5.json: - `curl -LsSf https://raw.githubusercontent.com/gtmcknight/amm-sim/4812a6382311624e1506aca131ca35c378f930d9/research/solved/$f -o dl/raw/$f` - then compared `shasum -a 256` with the archive copy. All 8 were the same. 18. `curl -sSI ` for both artifacts and the raw README returned 200 `text/plain; charset=utf-8`. This checked how the source URLs are served. 19. The following was run 5 times from the workspace root, once after each wording edit to the template. The last run produced this file. ``` python3 -I test/scratch/tools/write_result.py test/scratch/tools/result_template.md test/scratch/state/qt1ref_60000_61023.jsonl test/scratch/tools artifacts/goal/batches/e1-gate-p/items/p-choose/result.md ``` It writes this file from the state file and checks it: - n, coverage and every stat stated here are asserted against the state file; - the JSON block must parse back and match the state file within 5e-7; - the size must be under 60,000 bytes. 20. `python3 -I test/scratch/tools/check_sources.py artifacts/goal/batches/e1-gate-p/items/p-choose/sources.json` re-fetched every source URL. All 18 quotes were found verbatim. 21. `node -e 'JSON.parse(require("fs").readFileSync(process.argv[1], "utf8"))' artifacts/goal/batches/e1-gate-p/items/p-choose/sources.json` parsed it OK. 22. Read-only inspection of the outputs. In the first two commands, FENCE stands for three backticks: ``` grep -n -E '^(#|FENCE)' sed -n '/^FENCEjson/,+3p' wc -c git status --porcelain --untracked-files=all [--ignored] git check-ignore -v grep -c '' ``` - `.git/info/exclude` ignores `artifacts/`, so the outputs stay untracked. - The last command checks that no absolute local path is in the outputs; the count was 0. Scripts (in `test/scratch/tools/`, not submitted; shown in full): `tools/extract.py` ```python """Extract qt1's Strategy.sol + qmref.py from Q (markdown) and blob.bin from qm-spline's artifact. usage: python3 -I extract.py Q.md B.md OUTDIR Prints sha256 and byte length of every extracted piece (with and without a trailing newline).""" import base64, hashlib, os, sys def section_lines(lines, heading_prefix): start = None for i, ln in enumerate(lines): if ln.startswith(heading_prefix): start = i break if start is None: raise SystemExit('heading not found: ' + heading_prefix) end = len(lines) for i in range(start + 1, len(lines)): if lines[i].startswith('## '): end = i break return lines[start:end] def first_fence(sec): """content of the first fenced block in the section (list of lines, without the fences)""" i = next(k for k, ln in enumerate(sec) if ln.startswith('```')) j = next(k for k in range(i + 1, len(sec)) if sec[k].startswith('```')) return sec[i + 1:j] def report(name, data): print(f'{name}: {len(data)} bytes, sha256 {hashlib.sha256(data).hexdigest()}') def main(): qpath, bpath, out = sys.argv[1], sys.argv[2], sys.argv[3] os.makedirs(out, exist_ok=True) qlines = open(qpath, encoding='utf-8').read().split('\n') blines = open(bpath, encoding='utf-8').read().split('\n') sol = first_fence(section_lines(qlines, '## Strategy.sol')) sol_nl = ('\n'.join(sol) + '\n').encode('utf-8') sol_nonl = '\n'.join(sol).encode('utf-8') report('Strategy.sol (+trailing newline)', sol_nl) report('Strategy.sol (no trailing newline)', sol_nonl) open(os.path.join(out, 'Strategy.sol'), 'wb').write(sol_nl) py = first_fence(section_lines(qlines, '## Python reference')) py_nl = ('\n'.join(py) + '\n').encode('utf-8') report('qmref.py (+trailing newline)', py_nl) open(os.path.join(out, 'qmref.py'), 'wb').write(py_nl) b64 = ''.join(ln.strip() for ln in first_fence(section_lines(blines, '## Data'))) blob = base64.b64decode(b64, validate=True) report('blob.bin', blob) open(os.path.join(out, 'blob.bin'), 'wb').write(blob) if __name__ == '__main__': main() ``` `tools/refcheck.py` ```python """Reference check: replica2.run(seed, QMRef('blob.bin'))['edge'] for seeds 10000..10002. usage: python3 -I refcheck.py SOLVED_DIR""" import os, sys, time SOLVED = os.path.abspath(sys.argv[1]) sys.path.insert(0, SOLVED) os.chdir(SOLVED) # 'blob.bin' is resolved relative to research/solved, as in the brief import replica2 from qmref import QMRef t0 = time.time() QMRef('blob.bin') # decode the tables once (class-level cache) print(f'table decode {time.time() - t0:.2f}s', flush=True) for seed in (10000, 10001, 10002): t1 = time.time() e = replica2.run(seed, QMRef('blob.bin'))['edge'] print(f'{seed} {e:.6f} ({time.time() - t1:.2f}s)', flush=True) ``` `tools/baseline.py` ```python """qt1-ref baseline on Taylor's replica: replica2.run(seed, QMRef('blob.bin'))['edge'] per seed, multiprocessing.Pool, each seed run exactly once. Results are appended to STATE (jsonl) as they finish; seeds already present in STATE are never run again. usage: python3 -I baseline.py SOLVED_DIR FIRST LAST STATE.jsonl NPROC""" import json, multiprocessing as mp, os, sys, time _R = None _Q = None def _init(solved): global _R, _Q sys.path.insert(0, solved) os.chdir(solved) import replica2, qmref _R, _Q = replica2, qmref.QMRef _Q('blob.bin') # decode the tables once per worker (class-level cache) def _one(seed): t0 = time.perf_counter() edge = _R.run(seed, _Q('blob.bin'))['edge'] return seed, edge, time.perf_counter() - t0, os.getpid() def main(): solved = os.path.abspath(sys.argv[1]) first, last = int(sys.argv[2]), int(sys.argv[3]) state = os.path.abspath(sys.argv[4]) nproc = int(sys.argv[5]) done = set() if os.path.exists(state): with open(state) as f: for ln in f: if ln.strip(): done.add(json.loads(ln)['seed']) todo = [s for s in range(first, last + 1) if s not in done] print(f'{len(todo)} seeds to run in {first}..{last} ({len(done)} already in state), {nproc} processes', flush=True) if not todo: return t0 = time.perf_counter() secs = [] with mp.Pool(nproc, initializer=_init, initargs=(solved,)) as pool, open(state, 'a') as out: t_ready = time.perf_counter() for k, (seed, edge, sec, pid) in enumerate(pool.imap_unordered(_one, todo, chunksize=1), 1): out.write(json.dumps({'seed': seed, 'edge': edge, 'edge6': f'{edge:.6f}', 'sec': round(sec, 4), 'pid': pid}) + '\n') out.flush() secs.append(sec) if k % 64 == 0 or k == len(todo): el = time.perf_counter() - t0 print(f' {k}/{len(todo)} done, wall {el:.1f}s', flush=True) wall = time.perf_counter() - t0 print(f'wall {wall:.2f}s for {len(todo)} seeds ({wall / len(todo):.4f} s/seed wall with {nproc} procs, ' f'pool start {t_ready - t0:.2f}s); in-worker mean {sum(secs) / len(secs):.4f} s/seed, ' f'max {max(secs):.4f}s', flush=True) if __name__ == '__main__': main() ``` `tools/summarize.py` ```python """Check coverage of the baseline state file and print the Baseline JSON block + stats. usage: python3 -I summarize.py STATE.jsonl FIRST LAST OUT.json""" import json, math, statistics, sys state, first, last, outp = sys.argv[1], int(sys.argv[2]), int(sys.argv[3]), sys.argv[4] rows = [json.loads(ln) for ln in open(state) if ln.strip()] seeds = [r['seed'] for r in rows] assert len(seeds) == len(set(seeds)), 'a seed appears twice' by = {r['seed']: r for r in rows} # contiguous prefix covered cov = [] for s in range(first, last + 1): if s not in by: break cov.append(s) extra = sorted(set(seeds) - set(cov)) print(f'rows {len(rows)}, unique {len(set(seeds))}, contiguous prefix {cov[0]}..{cov[-1]} (n={len(cov)}), outside prefix: {extra[:10]}') e = [by[s]['edge'] for s in cov] e6 = [float(f'{x:.6f}') for x in e] n = len(e) mean = statistics.fmean(e) sd = statistics.stdev(e) mean6 = statistics.fmean(e6) sd6 = statistics.stdev(e6) secs = [by[s]['sec'] for s in cov] print(f'n {n} mean {mean:.6f} sd {sd:.6f} se {sd / math.sqrt(n):.6f} | from 6-dp values: mean {mean6:.6f} sd {sd6:.6f}') print(f'min {min(e):.6f} (seed {cov[e.index(min(e))]}) max {max(e):.6f} (seed {cov[e.index(max(e))]}) median {statistics.median(e):.6f}') print(f'in-worker seconds per seed: mean {statistics.fmean(secs):.4f} min {min(secs):.4f} max {max(secs):.4f}') print(f'pids used: {len(set(by[s]["pid"] for s in cov))}') for s in cov: assert by[s]['edge6'] == f'{by[s]["edge"]:.6f}' obj = { 'policy': 'qt1-ref', 'seeds': f'{cov[0]}..{cov[-1]}', 'n': n, 'mean': round(mean, 6), 'sd': round(sd, 6), 'seconds_per_seed': round(statistics.fmean(secs), 4), } # hand-format: header, then the edges 6 per line, values exactly as recorded to 6 decimals head = json.dumps(obj)[:-1] items = [f'"{s}":{by[s]["edge6"]}' for s in cov] lines = [', '.join(items[i:i + 6]) for i in range(0, len(items), 6)] text = head + ',"edges":{\n' + ',\n'.join(lines) + '\n}}' parsed = json.loads(text) assert parsed['n'] == len(parsed['edges']) == n assert all(abs(parsed['edges'][str(s)] - by[s]['edge']) <= 5e-7 for s in cov) open(outp, 'w').write(text + '\n') print(f'wrote {outp}: {len(text) + 1} bytes') ``` ## Problems 1. **`git clone` was refused by the sandbox.** It could not write the nested repo's `.git/hooks`, then its `.git/config`. I used GitHub's archive of the exact commit instead. As a result: - There is no `.git` metadata to show `git log`. - Provenance rests on the archive URL naming the full commit hash and on the 8 files above being byte-identical to `raw.githubusercontent.com` at that hash. 2. **The platform differs from qm-spline's and qt1's.** This run used Python 3.9.6 on macOS arm64. Both of them state Python 3.12.3; qt1 also states Linux x86_64, and qm-spline states no OS. - All 15 check values (12 Gate P, 3 reference) match to the printed digit. - The 1,024 window values have no published counterpart, so they could not be cross-checked on another platform. - A worker pairing against this baseline on another machine should first reproduce the 3 reference values. It can then compare a few window seeds against the JSON above. A last-digit libm difference is possible in principle; none showed up in the 15 values checked. 3. **Seeds 10000..10002 ran twice under qmref:** the serial check and the pool-path check. Both are outside the baseline window. Each baseline seed ran exactly once. 4. **Extra files in the checkout.** Importing the modules writes a `__pycache__` (bytecode cache) into `research/solved`, and the harness created empty `.claude/.cc-writes` folders. Neither is a change to Taylor's files: the diff above (exit 0) excludes only these and the two added files. 5. **This window is qm-spline's choose window.** qm-spline chose its compression setting on 60000..61023, where its choose loss vs the full qm tables was 0.0549. So qt1's tables were selected on these seeds. The goal brief uses this window for choosing and 10000..12047 for reporting. Final claims should come from the report window. 6. **Replica levels are not board scores.** Taylor's README says they do not convert. Use this baseline only for paired replica comparisons against qt1-ref. 7. **Two commands never ran.** `/usr/bin/time` was refused by a permission check and `sysctl` by the sandbox. Shell `time` and `os.cpu_count()` were used instead. Neither affects any result.