# Merge 02: spread 3 and spread 4 seats (12 items) All figures below come from the twelve result files under `.imd/reads/artifacts/item-*` (named by item below). "Unseen" means simulator seeds 60000..67999 filtered to the seat's spread (2035 spread-3 runs, 2009 spread-4 runs). "Diff" is the mean paired per-run edge gain over the base, with its standard error (SE) in brackets. All twelve files report `blocked: null`. ## 1. Outcome in one table | Item | Spread | Returned | Unseen diff (SE) | Retail diff | Arb diff | Timing (200 runs, s: base / yours) | Candidate by the brief's rule? | |---|---|---|---|---|---|---|---| | s3-flow | 3 | changed code | **+2.445 (0.665)** | -1.280 | +3.725 | 209.90 / 207.19 | Yes: gain, 0 failures, others identical (900 runs), not slower | | s3-free | 3 | changed code | +0.946 (0.207) | +0.934 | +0.013 | 106.24 / 106.81 | **Doubtful**: it is 0.54% slower on the 200-run timing (see 3.2) | | s3-clock | 3 | changed code | +0.258 (0.067) | -0.139 | +0.397 | 131.23 / 130.13 | Yes | | s3-middle | 3 | base unchanged | 0 | 0 | 0 | same file | No gain | | s3-queue | 3 | base unchanged | 0 | 0 | 0 | 313.10 / 301.44 (same file, CPU time) | No gain | | s4-bids | 4 | changed code | **+0.606 (0.084)** | -0.231 | +0.837 | 163.13 / 159.97 | Yes | | s4-asks | 4 | changed code | +0.330 (0.077) | +0.427 | -0.097 | 39.87 / 39.79 | Yes | | s4-queue | 4 | changed code | +0.278 (0.070) | +0.585 | -0.308 | 164.65 / 163.91 | Yes | | s4-middle | 4 | changed code | +0.258 (0.136) | -1.616 | +1.874 | 46.31 / 46.45 | **Weak**: about 1.9 SE, and 0.29% slower on the one timing run | | s4-free | 4 | changed code | +0.123 (0.060) | -0.190 | +0.313 | 132.27 / 129.23 | Yes, but small (about 2 SE) | | s4-clock | 4 | base unchanged | 0 | 0 | 0 | 119.12 / 115.74 (same file) | No gain | | s4-stock | 4 | base unchanged | 0 | 0 | 0 | 0.0 / 0.0 (not timed) | No gain | Every changed file reports 0 failed simulations and `others_identical: true` over 900 other-spread runs (300 each for the three other spreads). Exception: s3-middle, s3-queue (returned base), s4-clock and s4-stock return the base file, so the other spreads are identical by construction. s3-middle's `others_identical` shows 0 runs executed. The timing columns are single measurements by each seat. They show noise of about 1% in both directions, and the no-slower test is only weakly informed by them. Spread-3 base on unseen runs: mean 118.8167 (retail 149.0582, arb -30.2416). Spread-4 base on unseen runs: mean 163.4781 (retail 191.2076, arb -27.7295). All seats agree on these. ## 2. Setup check (step 1 of the brief) Every item except s3-middle reports `base_mean_edge` as 98.4694596619638, which is the author's figure. - **Measured directly with the CLI, 4000 runs, `--workers 4`, seeds 4000..7999:** s3-clock, s4-bids, and s4-queue each say they reproduced the figure exactly, with 0 failures. - **Measured another way:** s3-flow ran the CLI with `--workers 6` in chunks, weighted back to the 4000-run mean. s3-free computed the mean with its own harness over the same seeds, because the single CLI command did not finish within the 10-minute command limit. These are weaker checks. - **Not measured:** s3-middle left `base_mean_edge` null. Its machine had one core (about 0.8 s a run), and the check would have taken about 53 minutes. - **Not described:** the other items (s3-queue, s4-asks, s4-clock, s4-free, s4-middle, s4-stock) report the same number without describing how they got it. I did not re-run any of this. ## 3. What each seat did ### Spread 3 **3.1 s3-flow (best result at this spread, +2.445 (0.665)).** It replaces the base's clipped-fill flow estimate with a per-run Bayesian estimate of retail rate and mean order size, read from the base's own fills on both sides. These feed the quantile sizing of bids and asks, the ammo targets, and the tick-1 stock target. - A fill that used up our size is treated as a lower bound (censored). Without that, arbitrageur sweeps look like large retail orders and the size estimate is biased up. Weighting censored fills at 0.5 cut the rms log flow error at step 1000 from 0.181 / 0.157 / 0.148 as the weight rose through 0.05 / 0.15 / 0.5, with the bias at +0.015. - Flow estimate error (rms of log(est/true buy flow), 977 tuning runs): 0.237 at step 200, 0.183 at step 500, 0.145 at step 1000. The base's own estimator gave 0.335, 0.318, 0.299. - Mechanism: low-flow runs quote less into the arbitrageur and high-flow runs quote more. Retail falls a little (-1.28) and arbitrage loss falls more (+3.73). - Tuning gain was about +1.0 (+1.151 on the half it was found on, +0.898 on the other half). The unseen gain of +2.445 is larger. The seat says the two agree within standard errors and that about +1 is the more cautious expectation. - Oracle ceiling (cheating with the run's true rate and size): +1.49 for sizing + stock + ammo target on the tuning half, against +1.15 for the estimate. Sizing alone with the oracle gave +1.125; stock alone +0.101. - Rejected variants: a constant shift instead of a per-run estimate (-0.201, so the gain comes from per-run information), exponents of 1.5 or 0.75, rescaling size by 1.05 or 1.11, and kA 0.6 (-0.010, optimum is flat). - Caveat: tuning used a sorted-book patch of the simulator, checked identical on sample seeds. Holdout, identity, and timing used the unmodified simulator. **3.2 s3-free (+0.946 (0.207)).** At spread 3 only, in the "sticky" rule of `top()`: for asks at tick 8 or lower, queue priority at the rival's ask is kept only while the remainder is worth at least $10 (q * tick / 100 >= 10). Below that it undercuts by one tick with its full covered size. Bids, asks above tick 8, and other spreads are unchanged. - Reason: under 5 cents a retail buy spends dollars, so a small remainder takes almost none of the order and the rival, one queue place behind, fills the rest. Measured on 160 base runs: dollars of retail buys per run filled by the rival while the base sat on such a remainder were 2.05 under 1c, 1.53 at 1-2c, 0.40 at 2-3c, 1.31 at 3-5c. - Tuning: A +1.042 (0.427), B +1.275 (0.249), both 960 runs +1.158 (0.247), against +0.946 unseen. - **Timing disagreement, stated by the seat itself:** on the idle 200-run measurement it is 0.57 s (0.54%) slower than the base (106.24 vs 106.81), so by that one measurement the no-slower test is not met. A separate 60-run idle timing had it faster (34.92 base vs 34.78 yours), and an earlier 200-run measurement taken under load gave 215.12 vs 218.12. The seat reads these as noise. That judgement is the seat's; I cannot settle it. - Rejected: a $20 threshold on all prices (-2.034), $30 at ticks <= 5 (gained retail +1.150 but lost 0.513 to the arbitrageur), $15 at ticks <= 8 (-0.189 against the kept version), and uncovered asks from 5c (+0.001). $10 at ticks <= 12 (+0.042 over the kept version) is noise. **3.3 s3-clock (+0.258 (0.067)).** A gate suppresses ammunition bids at ticks >= 2 above the estimated fair price while more than 500 steps remain. Premium stock bought early gets adverse fills and may wait a long time for retail. The bridge logic and the tick-1 reserve are kept. Selection used tuning seeds 0..400 and 400..1000, then gained on the remaining 954 (+0.276 (0.107)) and over all 1954 (+0.329 (0.067)). Unseen gain is lower (+0.258) than tuning (+0.329). - Rejected: a 1000-step cutoff (weaker), linear sizing-loss clocks A/B/C (-1.4 to -2.2), clock D (0.75 to 1.25, +0.88 on 400 runs) was tried but is not the kept rule, bridge-fraction clocks (about 0 to -0.43), and demand-horizon caps of 300 or 600 steps (-3.48 and -0.89). - A runtime repair that materialised the belief-grid pairs once per step gave results identical to the initial policy on all 4889 checked seeds. - Base time profile (per 250-step window from the start to the end of the run; retail, arb): retail edge rises from 7.0 to 45.9 per window and arb loss from -1.5 to -7.0, so both concentrate late in the run. **3.4 s3-middle (returned base).** Tested kA (mid-price loss multiplier, base 0.7) at 0.45 and at 1.0 for 5-95 cents on 200 tuning seeds: -1.208 (0.580) and -0.071 (0.427). Neither gained. No unseen scoring was possible on a one-core machine, so its unseen row just repeats the base. Its `seconds` pair is the same file timed once. **3.5 s3-queue (returned base).** The frozen candidate raised the spread-3 ask-refill threshold at ticks 4 and 5 from 70% to 90% ("topup", refill asks at ticks <= 5 below 99% of target before the rival joins). It gained on discovery (+0.726 (0.351), 240 runs) and validation (+0.190 (0.303), 360 runs), but **lost edge over all 2035 unseen runs** and cost more CPU than the base in its predeclared timing comparison. The seat therefore returned the base. Its unseen loss figure is not in the part of the file I read, so I do not give it. Other approaches in its `tried` list all lost on 240 discovery runs: keepask (-12.64), depth4_5 (-13.90), acquirelow (-4.39), reserve (-11.38), keepfront (-0.09), frontask (-0.35), frontlow (+0.012, noise). ### Spread 4 **4.1 s4-bids (+0.606 (0.084), best at this spread).** For `phat < 0.05` and bid tick >= 2, halve the regular-bid target. Retail sells often consume only part of the resting depth, whereas arbitrage sweeps remove all overpriced depth. - Fill audit on 200 base runs showed arbitrage losses at 2-5 cents (about -5.28 per run there, 2348 shares, 361 fills). - Selection: 120-run screening, best six on 80 more, then 200-run validation (+0.52 for "excess_normal" and +0.376 for "excess_moderate", +0.465 for low_main_half) and 300-run confirmation. **Disagreement inside this seat:** "excess_normal" lost its gain on the final 300-run confirmation (-0.079 (0.383)) while "low_main_half" held (+0.320 (0.186)) and "excess_moderate" held (+0.310 (0.151)). The seat kept half-depth bids ("low_main_half"). It passed the later 2009 unseen runs at +0.606. - The first, unoptimized version was 0.1% slower. Caching the belief-grid tuple and the `math.exp` binding for spread 4 made it faster (163.13 vs 159.97), with identical results on all 2009 unseen seeds. - Dead ends: removing main orders (-4.75 to -53.1), shrinking near-price depth (-0.95 to -3.9), and several ammo, bridge, and tick-1 stock tweaks near zero or negative. - A moderate inventory-loss penalty also passed the independent checks; the seat did not combine them. **4.2 s4-asks (+0.330 (0.077)).** For `phat < 5c` on asks only, the sticky rule needs at least 50 shares of ahead-of-rival stock instead of 2 before staying at the rival's tick; below that it undercuts at ca-1. Instrumenting 600 base tuning runs: retail buy notional under 5c is about 125.1 per run, of which the base fills about 119.8. Half A +0.3438 (0.0678), half B +0.1549 (0.2776), unseen +0.330 (0.077). Size multipliers (x0.6, x0.8, x1.5) and banking more queue priority at tick 5 (1000 or 2500 shares) lost; min_ahead 200 or 600 swung single runs by hundreds. - **Overlap with s3-free:** it is the same idea (a sticky-priority remainder too small to absorb a retail buy) applied to a different spread and side, which supports the mechanism. **4.3 s4-queue (+0.278 (0.070)).** Front SELL orders at the rival's own tick may stay up to 3 times the current desired size instead of 1.5 times, preserving FIFO priority. Retention at 6 times, unlimited, or on bids lost. Discovery used 300 seeds, validation the other 1743. The seat froze its code at 2026-11-06T08:43:21Z before evaluating any candidate on target-spread unseen seeds. A performance-only change (reusing the belief-grid pairs) made the run faster than the base with identical results on all 2043 tuning runs. - **Related to s4-asks:** both touch the rival-tick sticky ask logic at spread 4, so their gains may not add. **4.4 s4-middle (+0.258 (0.136)).** For 5-95 cents the expected arbitrage loss used to size our ask is multiplied by 1.4 (effective weight about 1.0 instead of 0.7). Mid asks lost 12.7 a run to the arbitrageur against 6.2 for mid bids; in the last 250 steps they made 1.62 from retail and lost 3.14 to arb. Tuning gain +0.369 (0.250); unseen +0.258 (0.136), under 2 SE. The seat itself calls the plateau for size tweaks "worth about +0.3". On the base's tuning runs, 5-95 cents was retail 74.2 and arb -19.0. - **Disagreement with s4-bids:** s4-bids cuts losses at low prices (2-5 cents), while s4-middle shows its x1.4 on bids at mid prices lost (-0.846 (0.178)); they cover different price bands (mid-price bids are untouched by s4-bids). **4.5 s4-free (+0.123 (0.060)).** Lower `ydem` from 0.4 to 0.2 at spread 4. All 2043 tuning seeds gave +0.199, and the unseen runs gave +0.123 with lower retail edge and lower arb loss. Other values lost: ydem 0.8, `f1` 0.0, 0.3 (about 0), 1.2 (with failures), `qmax` 1000, `ydf1` 0.0 and 1.2. - **Disagreement with s4-stock:** s4-stock found that both 0.3x and 3x changes to the tick-1 stock rate `ydf1` (a related stock parameter) lost on its tuning slices. s4-free's own `ydf1` tests also lost. They agree that tick-1 stock itself should not move; s4-free's gain comes from `ydem`, which is a different parameter. **4.6 s4-clock (returned base).** Clock schedules for tick-1 stock and for low-price uncovered asks. The stock clock looked good on 103 runs (+0.133) and failed on an independent 102 runs (-0.031); the late-only push lost (-0.082); the uncovered-ask clock (+0.007) was never validated. Python 3.13.5 was used, unlike most others (3.12.3). **4.7 s4-stock (returned base).** Changed the tick-1 stock rate `ydf1` by 50% either way on independent 75-run slices. Both lost (136.35 vs 136.60, and 160.57 vs 160.80). Frozen base on 2009 unseen spread-4 runs: mean 163.478, retail 191.208, arb -27.729, 0 failures. ## 4. What stacks, and what does not The brief says gains in different spreads add exactly, because a run has one spread. Using the unseen diffs and each spread being a quarter of runs: - **Best single file per spread:** s3-flow (+2.445) and s4-bids (+0.606). Network-wide: 2.445/4 + 0.606/4 = about **+0.76** mean edge. - **If every changed file in a spread were added with no overlap** (this was **not tested**; it needs one combined run): spread 3 up to +3.65 (flow + free + clock), spread 4 up to +1.60 (bids + asks + queue + middle + free). That would be about +1.3 network-wide. It is an upper bound, since several files change the same code (the sticky and priority rules in s3-free / s4-asks / s4-queue, and the sizing in s3-flow / s3-clock / s4-middle) and gains from the same mechanism may overlap or interact. s3-flow changes the sizing inputs that s3-free and s3-clock also depend on. - **Gap to first place:** 109.59 - 106.80 = 2.79. Even the optimistic stack is about +1.3, so no combination here closes it on its own. The seats' ceilings (below) point to larger levers than any of these files. ## 5. Dead ends and ceilings across seats (nothing dropped) - Sizing-constant tuning is flat: s3-flow (kA 0.6, exponents), s3-middle (kA 0.45 and 1.0), s4-asks (size x0.6 to x1.5), s4-middle (loss-weight plateau, about +0.3). This matches the brief's note that one-at-a-time re-tuning is worth little. - Wider queue retention, deeper asks, or bigger stock lose edge through the arbitrageur: s3-queue (keepask -12.6, depth4_5 -13.9), s4-queue (fourfold ask depth -21.7 and -3.4; retention 6x or unlimited), s4-asks (banking priority -0.3 to -2.0), s4-stock (any change to tick-1 stock rate), s4-bids (shrinking near-price depth, -0.95 to -3.9). - Clock rules are mixed: positive at spread 3 only when gating early premium bids (s3-clock, +0.258), negative or unvalidated for other forms at spread 3 (s3-clock) and spread 4 (s4-clock). s3-middle and s3-clock both point to late-run arbitrage losses. - Remaining ideas stated by the seats: - s3-flow: count retail arrivals from probes as well, and treat the 20-80 cent size rule, where the base takes only 40% of retail buy dollars ($261 of $646). - s3-free: keep the small remainder as overflow cover; make the threshold depend on the tick; about $9.5 of retail buys per run at 5-10c arrive while the base has no ask. - s3-queue: add only just before a rival bid is exhausted. - s4-asks: tie the threshold to an online retail-size estimate (the remaining gap is about 1.6 per run from tick choice plus about 4 from 5.3 notional still missed). - s4-middle: pre-place orders at the ticks where the rival will refill (consumed tick +/- 4). - s4-queue: a state-dependent retirement threshold for front asks. - s4-bids: depth reduction that depends on inventory. - s4-free: an adaptive low-price inventory target. - s4-stock: trace unsold inventory with engine-level instrumentation. ## 6. Sources, and what could not be checked - **Cited sources.** I found no URLs in any of the twelve result files, and none lists sources. The brief says one source each failed re-reading for s3-queue, s4-asks, s4-stock, s4-bids, s4-middle, s4-clock, and s4-free. I cannot tell which of their claims relied on those sources. Everything above rests on each seat's own simulator runs; the only external reference they share is the simulator commit b244530 (named by s3-free, s3-queue, s4-queue) and the base's 98.4694596619638. I treat the claims of those seven items as less well supported than the brief's own figures, particularly small gains: s4-asks, s4-bids, s4-middle, s4-free. I did not re-run any simulation. - **Not verified by me:** I did not read or run any seat's `code` field or confirm the `code_sha256` values. s3-middle, s3-queue, s4-clock, and s4-stock all have the same hash (`dcf68e0c9a7b...`), which is consistent with returning the base unchanged. - **Unknown:** s3-queue's unseen loss figure, whether any of the changed files combine without interaction, and the true timing margin for s3-free and s4-middle.