# Merge 01 — retreat-cancel (RC) wrapper on base **m-plus-a**: ten blocks pooled Question answered: does CANDIDATE (= m-plus-a code + the retreat-cancel wrapper) beat BASE (= m-plus-a) by more than twice its standard error, over seeds 700000–704999, paired, in the unmodified simulator at commit `b244530ee2a6247b5f930830eeca9dd950da0e7e`? ## Verdict **Yes.** Pooled over all 5,000 seeds with equal weight per seed, CANDIDATE − BASE = **+0.3297 edge per seed, se 0.0694** (z ≈ 4.75, 95 % CI +0.194 to +0.466). The gain is 4.7 standard errors, well past the 2 × se bar. Nine of ten blocks are positive; the one negative block (rc-on-a-05, −0.314 ± 0.505) is driven by the two worst runs in the whole set (seed 702116: −197.44; seed 702325: −144.45). Dropping any one block leaves z between 4.06 and 7.58, so the conclusion does not rest on any single block, including the flagged rc-on-a-02 (without it: +0.305, se 0.073, z 4.16). What the gain costs in tail risk: the wrapper's **worst single run is −197.44** (seed 702116, spread 2), far worse than the −57.8 worst run seen in the earlier 1,000-seed measurement of RC on m-all. Four runs in 5,000 are worse than −57.8. The gain is positive in 1,844 of the 2,532 seeds where the wrapper changes anything (72.8 %), median +0.29, so it is a small, steady gain punctuated by rare large losses and rare large wins. Comparison with the prior figure the goal quotes (RC on m-all: +0.37, se 0.12, 1,000 seeds, worst −57.8): on m-plus-a the point estimate is a little lower (+0.33) and the standard error much smaller (0.069, from 5,000 seeds); the two are consistent within one se. The worst-run figure is the material difference. ## Inputs and what this merge could and could not verify - Ten item results, one per block of 500 seeds, read from `.imd/reads/artifacts/item-rc-on-a-01` … `item-rc-on-a-10` (SHA-256 of each file as listed in the assignment). All ten report `complete: true`, `n: 500`, `failures: []`, base `m-plus-a`, BASE code SHA-256 `5d1bd5272884f513b19f0e66a7c235f6c188a08e4f7787ac9346f1614dda3ed3`, CANDIDATE code SHA-256 `0d627e80d1c3ecb98da2ccddf7406e301c76e59ab86c4ee068e508b6074f76ac`. **No block is missing or empty.** - Seed coverage: the ten `per_seed` arrays together contain exactly the 5,000 seeds 700000–704999, each once, each inside its block's stated range (checked in this merge). - Internal consistency, checked in this merge for every block: the sum of the (6-dp rounded) `per_seed` differences matches the reported `sum_d` to within 1.1 × 10⁻⁵ and `sum_d2` to within 2 × 10⁻⁴; the reported `se` equals the se recomputed from `sum_d`/`sum_d2`; `by_spread` counts and sums match the per-seed rows; the reported five worst and five best match the per-seed rows (block 10's third-best, 8.09295 → 8.0929 unrounded vs 8.0930 rounded, is a rounding artifact, not a discrepancy); `mean_diff = candidate_mean − base_mean = retail_diff + arb_diff` in every block. - Inputs N and RC were fetched by this merge from `https://api.imd.fun/artifacts/db22aff7167a4798251ed3d20432509f30e511e4958799aba5b17b41bb39b4b6` and `https://api.imd.fun/artifacts/2d4b30bbc6bffbc500b37ce5e8a1ac821d6513c52a6a2377b4be3c11d97717fb`; their `code` SHA-256 values are `bf0d179f3e47d28819f6fa7e0d25548c2ced43374c216d36460b00a26a26ffae` and `3c07bdcd221ac25729c3ebc92b21ac9e2014510ecb85816c4391ed81e933291f`, as the items state. RC's code begins with N's code byte-for-byte, and the remainder (the wrapper) is 1,950 bytes, as item rc-on-a-09 reports. The wrapper's own docstring reads `"""Cancel a rival-retreated side for 1 callbacks, spreads 2/3 only."""` and its `on_step` returns the incumbent's actions unchanged unless `self.s in (2, 3)`. This is why every block reports d = 0 on every spread-1 and spread-4 seed (2,468 of 5,000 seeds): the wrapper is structurally inert there. - **Not verified here:** the BASE artifact itself. The merge brief gives only BASE's code hash, not its artifact id (`https://api.imd.fun/artifacts/5d1bd527…` returns `unknown_artifact`), so no seed could be re-simulated in this merge and the items' `check_values` (BASE total_edge for the first four seeds of each block) could not be reproduced. All numbers below are the items' local measurements, pooled. - **Flagged source (rc-on-a-02):** the assignment says one source cited by rc-on-a-02 did not hold when re-read (a page that could not be read or does not say what it was quoted for). The sources file is not among the inputs to this merge, so which source is unknown. rc-on-a-02's notes say its sources document the input code and simulator, and that its numbers are direct local measurements. Its result is internally consistent by every check above, its hashes match those fetched here, and its block mean (+0.549, se 0.212) is in line with the other nine (block means range −0.31 to +0.55; chi² of the ten block means against the pooled mean is 12.8 on 9 df, i.e. no evidence of heterogeneity). Its result is kept in the pool; the verdict is given both with and without it, and it is the only block whose simulations ran in parallel processes (up to 8 at once, some seeds re-run after a process kill, "the duplicate results were identical" per its notes) rather than strictly serially. Treat its 500 seeds as slightly less corroborated than the other 4,500. ## Per-block results (as reported by each item) d = CANDIDATE.total_edge − BASE.total_edge per seed, paired on the same sampled config and seed. se = sample sd (n−1) / √n. | Block | Seeds | n | sum_d | sum_d2 | mean d | se | retail_diff | arb_diff | BASE mean | CAND mean | Worst run (seed, spread, d) | Best run (seed, spread, d) | Python | s/sim | |---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| | rc-on-a-01 | 700000–700499 | 500 | 170.5421 | 11257.01 | +0.3411 | 0.2119 | −0.2210 | +0.5621 | 102.317 | 102.658 | 700179, 2, −65.33 | 700154, 2, +45.23 | 3.12.3 | 0.36 | | rc-on-a-02 | 700500–700999 | 500 | 274.3281 | 11398.25 | +0.5487 | 0.2123 | −0.1340 | +0.6827 | 105.390 | 105.939 | 700873, 3, −9.13 | 700964, 3, +86.34 | 3.12.3 | 3.53 | | rc-on-a-03 | 701000–701499 | 500 | 201.7863 | 5585.70 | +0.4036 | 0.1485 | −0.2140 | +0.6176 | 97.808 | 98.211 | 701153, 3, −20.12 | 701256, 3, +58.39 | 3.12.3 | 1.41 | | rc-on-a-04 | 701500–701999 | 500 | 243.9908 | 3383.27 | +0.4880 | 0.1144 | −0.0207 | +0.5086 | 96.486 | 96.974 | 701576, 3, −11.62 | 701738, 2, +24.76 | 3.12.3 | 0.72 | | rc-on-a-05 | 702000–702499 | 500 | −157.2429 | 63554.26 | **−0.3145** | 0.5045 | −0.1300 | −0.1845 | 93.234 | 92.919 | 702116, 2, −197.44 | 702356, 3, +34.05 | 3.12.3 | 1.02 | | rc-on-a-06 | 702500–702999 | 500 | 196.5233 | 4697.26 | +0.3930 | 0.1361 | −0.2451 | +0.6381 | 105.295 | 105.688 | 702513, 2, −29.50 | 702730, 2, +21.34 | 3.12.3 | 1.36 | | rc-on-a-07 | 703000–703499 | 500 | 257.3538 | 4315.41 | +0.5147 | 0.1295 | −0.1308 | +0.6455 | 91.297 | 91.811 | 703179, 3, −15.60 | 703471, 2, +42.53 | 3.12.3 | 0.71 | | rc-on-a-08 | 703500–703999 | 500 | 94.6206 | 11361.29 | +0.1892 | 0.2132 | −0.3211 | +0.5104 | 101.218 | 101.407 | 703795, 2, −63.60 | 703541, 2, +43.08 | 3.12.3 | 0.64 | | rc-on-a-09 | 704000–704499 | 500 | 119.0147 | 3819.04 | +0.2380 | 0.1233 | −0.2144 | +0.4524 | 101.263 | 101.501 | 704276, 2, −34.20 | 704447, 2, +21.48 | 3.13.5 | 0.61 | | rc-on-a-10 | 704500–704999 | 500 | 247.3848 | 1581.15 | +0.4948 | 0.0765 | −0.1034 | +0.5982 | 97.401 | 97.895 | 704867, 2, −8.18 | 704594, 2, +18.88 | 3.12.3 | 0.99 | Notes on the per-block rows: blocks 02, 05 and 07 report `sum_d`/`sum_d2` rounded to 6 dp; the others report them unrounded. All ten report `per_seed` d rounded to 6 dp. The BASE mean varies from 91.3 to 105.4 between blocks because each block samples its own configs; these means are not comparable with the board score (110.21) and are only shown to size the gain (+0.33 on a base of ≈ 99). Per block, among the seeds where the wrapper acted (spreads 2 and 3): positive / negative counts — 01: 191/69; 02: 170/70; 03: 186/53; 04: 193/74; 05: 192/70; 06: 177/81; 07: 186/60; 08: 188/80; 09: 181/71; 10: 180/60. Every block has roughly 70–78 % wins among active seeds; the block means differ mostly because of where the large single runs fell. ## Pooled result, all ten blocks, equal weight per seed Pooled from the blocks' reported `n`, `sum_d`, `sum_d2` (the per-seed rows give the same to 7 significant figures). | | n | sum_d | sum_d2 | mean d | sd of d | se | z = mean/se | |---|---|---|---|---|---|---|---| | **Overall** | **5000** | **1648.3015** | **120952.638** | **+0.32966** | 4.9078 | **0.06941** | **4.75** | - 95 % confidence interval for the mean gain: **+0.194 to +0.466** edge per seed. - **CANDIDATE beats BASE by more than twice its standard error: 0.3297 / 0.0694 = 4.75 > 2.** - Component split (pooled, equal weight per seed): retail_diff **−0.1735**, arb_diff **+0.5031**. In every block retail edge falls slightly and arb edge rises more; the wrapper earns on the arb side and gives back a part of it on the retail side. - Pooled BASE mean total_edge 99.171; pooled CANDIDATE mean 99.500. - Sign counts over all 5,000 seeds: 1,844 positive, 688 negative, 2,468 exactly zero (all the zeros are spread-1 and spread-4 seeds). - Distribution of d on the 2,532 active (spread 2/3) seeds: 1 % −10.85, 5 % −2.52, 25 % −0.05, median +0.29, 75 % +1.22, 95 % +5.55, 99 % +14.52. Runs with d < −10: 28; d < −20: 11; d < −50: 4; d < −100: 2. Runs with d > +10: 51; d > +20: 15; d > +50: 2. ### Pooled per spread | Spread | n | sum_d | sum_d2 | mean d | sd | se | z | |---|---|---|---|---|---|---|---| | 1 | 1261 | 0 | 0 | 0 | 0 | 0 | — (wrapper inert) | | 2 | 1269 | 509.9460 | 74186.633 | **+0.4018** | 7.6384 | 0.2144 | 1.87 | | 3 | 1263 | 1138.3556 | 46766.005 | **+0.9013** | 6.0203 | 0.1694 | 5.32 | | 4 | 1207 | 0 | 0 | 0 | 0 | 0 | — (wrapper inert) | | 2 + 3 together | 2532 | 1648.3015 | 120952.638 | +0.6510 | 6.8822 | 0.1368 | 4.76 | - At **spread 3** the gain is clear: +0.90 ± 0.17 (z 5.3), positive in all ten blocks (block means +0.41 to +1.64; block 05 is −0.16 ± 1.11). - At **spread 2** the gain is **not** established on its own: +0.40 ± 0.21 (z 1.9, under the 2 × se bar). Spread 2 holds all five of the worst runs (four of them are spread 2; the second-worst, 702325, is spread 3 — see below) and most of the variance: its sum_d2 (74,187) is 61 % of the total, and the single seed 702116 contributes 38,982 of it. Block means at spread 2 range from −1.07 (block 05) to +1.23 (block 07). - Spreads 1 and 4: the wrapper never changed an outcome on any of the 2,468 seeds, consistent with its `if self.s not in (2, 3): return actions` guard. ## Five worst and five best single runs across all 5,000 seeds Worst (CANDIDATE − BASE total_edge): | Rank | Seed | Spread | d | Block | |---|---|---|---|---| | 1 | 702116 | 2 | **−197.4397** | rc-on-a-05 | | 2 | 702325 | 3 | **−144.4525** | rc-on-a-05 | | 3 | 700179 | 2 | −65.3308 | rc-on-a-01 | | 4 | 703795 | 2 | −63.6048 | rc-on-a-08 | | 5 | 703512 | 2 | −36.4495 | rc-on-a-08 | Next five for context: 704276 (2, −34.20, block 09), 700076 (2, −34.01, block 01), 703796 (2, −31.48, block 08), 702513 (2, −29.50, block 06), 700360 (2, −23.24, block 01). Best: | Rank | Seed | Spread | d | Block | |---|---|---|---|---| | 1 | 700964 | 3 | **+86.3385** | rc-on-a-02 | | 2 | 701256 | 3 | +58.3946 | rc-on-a-03 | | 3 | 700154 | 2 | +45.2276 | rc-on-a-01 | | 4 | 703541 | 2 | +43.0773 | rc-on-a-08 | | 5 | 703471 | 2 | +42.5348 | rc-on-a-07 | Next five: 700829 (3, +41.14, block 02), 702356 (3, +34.05, block 05), 702222 (2, +26.60, block 05), 703618 (3, +25.27, block 08), 701738 (2, +24.76, block 04). The five worst runs sum to −507.3 and the five best to +275.6, against a total sum_d of +1,648.3. The tails are therefore not what produces the gain: with the five worst and five best removed the mean is +0.377 (se 0.037, n 4,990); with only the five worst removed +0.432 (se 0.045); with only the five best removed +0.275 (se 0.065, z 4.3). Removing just the two catastrophic seeds 702116 and 702325 gives +0.398 (se 0.049). These trimmed figures are descriptive; the headline figures include every seed. Note that the best run (+86.34) is in the flagged block rc-on-a-02. Its own notes already say that without that seed its block mean is about +0.377 instead of +0.549. ## Robustness: leave one block out | Block dropped | Mean (n = 4500) | se | z | |---|---|---|---| | rc-on-a-01 | +0.3284 | 0.0734 | 4.47 | | rc-on-a-02 (flagged) | +0.3053 | 0.0734 | 4.16 | | rc-on-a-03 | +0.3214 | 0.0753 | 4.27 | | rc-on-a-04 | +0.3121 | 0.0761 | 4.10 | | rc-on-a-05 | +0.4012 | 0.0529 | 7.58 | | rc-on-a-06 | +0.3226 | 0.0756 | 4.27 | | rc-on-a-07 | +0.3091 | 0.0758 | 4.08 | | rc-on-a-08 | +0.3453 | 0.0734 | 4.70 | | rc-on-a-09 | +0.3398 | 0.0759 | 4.48 | | rc-on-a-10 | +0.3113 | 0.0766 | 4.06 | Every leave-one-out estimate stays above 2 × se. ## Where results disagree or differ in method - **Sign:** nine blocks positive, one negative (rc-on-a-05). The negative block's own notes attribute it to seeds 702116 and 702325 and report that "without those two seeds the other 498 sum to +184.65 (mean +0.371)". This merge confirms those two seeds are the two worst in all 5,000 and that the block's sign flips without them; the block is kept in full in the pooled figures. - **Spread 2 vs spread 3:** blocks disagree on which spread gains more (01, 02, 03, 06, 10 favour spread 3; 04, 07 favour spread 2; 08 and 09 are near-flat at spread 2). Pooled, spread 3 is clearly positive and spread 2 is positive but not past 2 × se. - **Execution:** all ten state the simulator at commit `b244530ee2a6247b5f930830eeca9dd950da0e7e` unmodified, no sandbox, no `--workers`, BASE then CANDIDATE on the same `runner.sample_config(ChallengeConfig(), ParameterVariance(), seed=s)` config, fresh `loader.load_strategy_factory` per run. Differences: rc-on-a-02 ran in up to 8 concurrent processes with re-runs after a kill (duplicates reported identical); rc-on-a-05 ran as 4 serial processes of 125 seeds each; rc-on-a-07 ran as two serial invocations; rc-on-a-09 used Python 3.13.5 where the others used 3.12.3. None of these should change a deterministic per-seed result, and the block means show no heterogeneity beyond chance (chi² 12.8 on 9 df), but the Python-version difference in block 09 is unverified here. - **Rounding:** blocks 02, 05, 07 report sums rounded to 6 dp; this changes nothing at the precision shown. - **`seconds_per_simulation`** ranges 0.36–3.53 s and is defined differently per block (some include config sampling, some a contended machine); it is not comparable and not used. ## What this merge does not settle - This is the **m-plus-a** half only. The goal's question (does RC help the file that is #1042) needs the matching ten blocks on **m-plus-b** (the other merge) before a submission choice can be made. - The pooled seeds 700000–704999 are not the board's scoring seeds; the +0.33 is an expected gain per simulated seed, not a predicted change in the board score of 110.21. - Whether a −197 single run is acceptable depends on how the board scores (mean over its seeds, or something tail-sensitive). On these 5,000 seeds the gain survives the tails; on a small scoring set a single such seed would outweigh ~700 seeds of median gain (197.4 / 0.287 ≈ 688). ## Sources - Item results (local measurements; read as data): `.imd/reads/artifacts/item-rc-on-a-01` through `item-rc-on-a-10`, mirrored at `artifacts/goal/items/rc-on-a-01/result.json` … `rc-on-a-10/result.json`. All pooled figures, per-block figures, worst/best lists and notes above are computed from, or quoted from, these ten files. - N (incumbent prefix of RC): `https://api.imd.fun/artifacts/db22aff7167a4798251ed3d20432509f30e511e4958799aba5b17b41bb39b4b6` — fetched in this merge; `code` SHA-256 `bf0d179f3e47d28819f6fa7e0d25548c2ced43374c216d36460b00a26a26ffae`. - RC (retreat-cancel on N): `https://api.imd.fun/artifacts/2d4b30bbc6bffbc500b37ce5e8a1ac821d6513c52a6a2377b4be3c11d97717fb` — fetched in this merge; `code` SHA-256 `3c07bdcd221ac25729c3ebc92b21ac9e2014510ecb85816c4391ed81e933291f`; its code begins with N's code; the 1,950-byte remainder contains the lines `"""Cancel a rival-retreated side for 1 callbacks, spreads 2/3 only."""` and `if self.s not in (2, 3): return actions`. - BASE (m-plus-a): code SHA-256 `5d1bd5272884f513b19f0e66a7c235f6c188a08e4f7787ac9346f1614dda3ed3` as stated by all ten items; artifact id not available to this merge, not fetched. - Simulator: `https://github.com/danrobinson/prediction-market-challenge` at commit `b244530ee2a6247b5f930830eeca9dd950da0e7e`, as stated by all ten items; not re-run in this merge. - Prior figure for RC on m-all (+0.37, se 0.12, 1,000 seeds, worst −57.8) and the board standings (110.21 vs 110.69): from the goal statement handed to this merge, not independently checked. - Board: `https://www.paradigm.xyz/puzzles/prediction-market-challenge` (named in the goal; not consulted for any figure here).