{"item":"all","batch":"e08-small-floor","experiment":"Hybrid, training only. Gate = every afterSwap call. After G's final tail-compression + clampFee and before the fees are stored and returned, the lower final fee becomes min(max(original lower fee, F), higher fee); the higher fee and ties are unchanged; stale shift, direction skew, estimators and all other mapping terms are kept as in G. F in {1,2,4,8} bps.","blocked":null,"confirmation":null,"board_claim":null,"result_summary":"Every floor variant loses to V2, and the loss grows almost linearly with F (about -0.5 edge per bp). Screen (256 seeds): F1 -0.483, F2 -0.983, F4 -2.009, F8 -4.158; G control +0.0004. Best valid variant F=1 bp on the 512-seed tuning block: -0.4801 (se 0.0093). At F=1 on the tuning block, the floor costs retail edge (-0.558/seed) far more than it gains on arb (+0.078/seed), even though mean retail volume falls only about 0.27%. On this evidence, a floor on G's lower fee is not worth pursuing.","code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport {AMMStrategyBase} from \"./AMMStrategyBase.sol\";\nimport {TradeInfo} from \"./IAMMStrategy.sol\";\n\ncontract Strategy is AMMStrategyBase {\n    uint256 constant ELAPSED_CAP = 8;\n    uint256 constant SIGNAL_THRESHOLD = WAD / 650;\n    uint256 constant DIR_DECAY = 750000000000000000;\n    uint256 constant ACT_DECAY = 530000000000000000;\n    uint256 constant SIZE_DECAY = 530000000000000000;\n    uint256 constant TOX_DECAY = 910000000000000000;\n    uint256 constant SIGMA_DECAY = 690000000000000000;\n    uint256 constant LAMBDA_DECAY = 990000000000000000;\n    uint256 constant SIZE_BLEND_DECAY = 828000000000000000;\n    uint256 constant TOX_BLEND_DECAY = 51000000000000000;\n    uint256 constant ACT_BLEND_DECAY = 985000000000000000;\n    uint256 constant PHAT_ALPHA = 270000000000000000;\n    uint256 constant PHAT_ALPHA_RETAIL = 60000000000000000;\n    uint256 constant PHAT_ALPHA_SAME = 120000000000000000;\n    uint256 constant REVERT_U = 0;\n    uint256 constant DIR_IMPACT_MULT = 4;\n    uint256 constant GATE_SIGMA_MULT = 7200000000000000000;\n    uint256 constant MIN_GATE = 30000000000000000;\n    uint256 constant TRADE_TOX_BOOST = 3500 * BPS;\n    uint256 constant STALE_ATTRACT_FRAC = 1050000000000000000;\n    uint256 constant RET_CAP = WAD / 35;\n    uint256 constant TOX_CAP = WAD / 5;\n    uint256 constant TRADE_RATIO_CAP = WAD / 5;\n    uint256 constant LAMBDA_CAP = 1820000000000000000;\n    uint256 constant STEP_COUNT_CAP = 64;\n    uint256 constant BASE_FEE = 4 * BPS;\n    uint256 constant SIGMA_COEF = 200000000000000000;\n    uint256 constant LAMBDA_COEF = 12 * BPS;\n    uint256 constant FLOW_SIZE_COEF = 4842 * BPS;\n    uint256 constant TOX_COEF = 300 * BPS;\n    uint256 constant TOX_QUAD_COEF = 15000 * BPS;\n    uint256 constant ACT_COEF = 91843 * BPS;\n    uint256 constant DIR_COEF = 20 * BPS;\n    uint256 constant DIR_TOX_COEF = 100 * BPS;\n    uint256 constant STALE_DIR_COEF = 6850 * BPS;\n    uint256 constant SIGMA_TOX_COEF = 500 * BPS;\n    uint256 constant TAIL_KNEE = 600 * BPS;\n    uint256 constant TAIL_SLOPE_PROTECT = 930000000000000000;\n    uint256 constant TAIL_SLOPE_ATTRACT = 850000000000000000;\n    uint256 constant LOW_FEE_FLOOR = 1 * BPS;\n\n    function afterInitialize(uint256 initialX, uint256 initialY) external override returns (uint256, uint256) {\n        slots[0] = BASE_FEE; slots[1] = BASE_FEE; slots[3] = WAD; \n        slots[5] = initialX > 0 ? wdiv(initialY, initialX) : 100 * WAD;\n        slots[6] = 950000000000000; slots[7] = 800000000000000000; slots[8] = 2000000000000000;\n        slots[13] = 902500000000; slots[14] = slots[5]; \n        return (BASE_FEE, BASE_FEE);\n    }\n\n    function afterSwap(TradeInfo calldata trade) external override returns (uint256, uint256) {\n        uint256 prevBidFee = slots[0]; uint256 prevAskFee = slots[1]; uint256 lastTs = uint64(slots[2]);\n        uint256 dirState = slots[3]; uint256 actEma = slots[4]; uint256 pHat = slots[5];\n        uint256 sigmaHat = slots[6]; uint256 lambdaHat = slots[7]; uint256 sizeHat = slots[8];\n        uint256 toxEma = slots[9]; uint256 stepTradeCount = slots[10];\n\n        uint256 sigmaForFast = sigmaHat;\n        uint256 fastHat = slots[14];\n        uint256 uncertainty = slots[13];\n        uint256 silent = trade.timestamp > lastTs ? trade.timestamp - lastTs : 0;\n        bool isNewStep = trade.timestamp > lastTs;\n        if (isNewStep) {\n            uint256 elapsedRaw = trade.timestamp - lastTs;\n            uint256 elapsed = elapsedRaw > ELAPSED_CAP ? ELAPSED_CAP : elapsedRaw;\n            dirState = _decayCentered(dirState, DIR_DECAY, elapsed);\n            actEma = wmul(actEma, _powWad(ACT_DECAY, elapsed));\n            sizeHat = wmul(sizeHat, _powWad(SIZE_DECAY, elapsed));\n            toxEma = wmul(toxEma, _powWad(TOX_DECAY, elapsed));\n            if (stepTradeCount > 0 && elapsedRaw > 0) {\n                uint256 lambdaInst = (stepTradeCount * WAD) / elapsedRaw;\n                if (lambdaInst > LAMBDA_CAP) lambdaInst = LAMBDA_CAP;\n                lambdaHat = wmul(lambdaHat, LAMBDA_DECAY) + wmul(lambdaInst, WAD - LAMBDA_DECAY);\n            }\n            uncertainty += wmul(sigmaForFast, sigmaForFast) * elapsedRaw;\n            if (uncertainty > 100000000000000) uncertainty = 100000000000000;\n            stepTradeCount = 0;\n        }\n\n        bool firstInStep = stepTradeCount == 0;\n        uint256 spot = trade.reserveX > 0 ? wdiv(trade.reserveY, trade.reserveX) : pHat;\n        if (pHat == 0) pHat = spot;\n\n        uint256 feeUsed = trade.isBuy ? prevBidFee : prevAskFee;\n        uint256 gamma = feeUsed < WAD ? WAD - feeUsed : 0;\n        uint256 pImplied;\n        if (gamma == 0) { pImplied = spot; }\n        else { pImplied = trade.isBuy ? wmul(spot, gamma) : wdiv(spot, gamma); }\n\n        // S: infer a no-trade interval center from the last post-trade spot.\n        uint256 silenceScale = WAD;\n        if (firstInStep && silent > 1) {\n            uint256 g = silent - 1;\n            if (g > 1) g = 1;\n            uint256 w = WAD - _powWad(800000000000000000, g);\n            uint256 s = slots[2] >> 64;\n            if (s == 0) s = pHat;\n            uint256 c = (wmul(s, WAD - prevBidFee) + wdiv(s, WAD - prevAskFee)) / 2;\n            if (c >= pHat) pHat += wmul(w, c - pHat);\n            else pHat -= wmul(w, pHat - c);\n            silenceScale = WAD - wmul(300000000000000000, w);\n        }\n\n        {\n            uint256 ret = pHat > 0 ? wdiv(absDiff(pImplied, pHat), pHat) : 0;\n            uint256 alpha = firstInStep ? PHAT_ALPHA : PHAT_ALPHA_RETAIL;\n            uint256 prePhat = pHat;\n            bool secondPrint = !firstInStep && stepTradeCount == 1;\n            bool sameDir = false; bool oppDir = false;\n            if (secondPrint) {\n                bool up2 = pImplied >= pHat;\n                uint256 d1 = slots[12];\n                if (d1 != 0) { sameDir = (d1 == 1) == up2; oppDir = !sameDir; }\n                if (sameDir) alpha = PHAT_ALPHA_SAME;\n            }\n            if (firstInStep) { slots[12] = pImplied >= pHat ? 1 : 2; }\n            uint256 adaptiveGate = wmul(sigmaHat, GATE_SIGMA_MULT);\n            if (adaptiveGate < MIN_GATE) adaptiveGate = MIN_GATE;\n            alpha = wmul(alpha, silenceScale);\n            adaptiveGate = wmul(adaptiveGate, silenceScale);\n            if (ret <= adaptiveGate) { pHat = wmul(pHat, WAD - alpha) + wmul(pImplied, alpha); }\n            if (oppDir && REVERT_U > 0) {\n                uint256 pre = slots[11];\n                if (pre > pHat) pHat = pHat + wmul(pre - pHat, REVERT_U);\n                else pHat = pHat - wmul(pHat - pre, REVERT_U);\n            }\n            if (firstInStep) {\n                if (ret > RET_CAP) ret = RET_CAP;\n                sigmaHat = wmul(sigmaHat, SIGMA_DECAY) + wmul(ret, WAD - SIGMA_DECAY);\n            }\n        }\n\n        // Interior retail routing equalizes fee-adjusted marginal prices.\n        // Subsequent trades in a step cannot be the initial arbitrage trade.\n        if (!firstInStep && feeUsed > 30 * BPS && gamma > 0) {\n            uint256 normalSpot = trade.isBuy\n                ? wdiv(wmul(spot, gamma), WAD - 30 * BPS)\n                : wdiv(wmul(spot, WAD - 30 * BPS), gamma);\n            pHat = wmul(pHat, 90 * WAD / 100) + wmul(normalSpot, 10 * WAD / 100);\n        }\n\n        {\n            uint256 ret = fastHat > 0 ? wdiv(absDiff(pImplied, fastHat), fastHat) : 0;\n            uint256 alpha;\n            if (firstInStep) {\n                uint256 processSigma = sigmaForFast;\n                uint256 obsVar = uncertainty + wmul(processSigma, processSigma);\n                uint256 probArb;\n                uint256 z2 = wdiv(wmul(ret, ret), obsVar);\n                uint256 density = _powWad(wdiv(WAD, WAD + z2 / 16), 8);\n                uint256 sigmaObs = _isqrt(obsVar * WAD);\n                uint256 odds = wmul(density, wdiv(6700000000000000, sigmaObs));\n                bool arbFlag = ret <= wmul(sigmaForFast, 1220000000000000000);\n                uint256 prior = arbFlag ? 650000000000000000 : 400000000000000000;\n                uint256 tr = trade.reserveY > 0 ? wdiv(trade.amountY, trade.reserveY) : 0;\n                if (tr > 3000000000000000) prior = wmul(prior, 6 * WAD / 10);\n                if (silent > 1) prior = wmul(prior, 8 * WAD / 10);\n                odds = wmul(odds, wdiv(prior, WAD - prior));\n                probArb = wdiv(odds, WAD + odds);\n                alpha = wmul(probArb, 600000000000000000) + wmul(WAD - probArb, 80000000000000000);\n                slots[15] = pImplied >= fastHat ? 1 : 2;\n                uncertainty = wmul(uncertainty, WAD - alpha);\n            } else {\n                if ((slots[15] == 1) == (pImplied >= fastHat)) alpha = PHAT_ALPHA_RETAIL;\n            }\n            uint256 gate = wmul(sigmaHat, GATE_SIGMA_MULT);\n            if (gate < MIN_GATE) gate = MIN_GATE;\n            if (ret <= gate) fastHat = wmul(fastHat, WAD - alpha) + wmul(pImplied, alpha);\n            slots[13] = uncertainty;\n        }\n\n        if (!firstInStep && feeUsed > 30 * BPS && gamma > 0) {\n            uint256 normalObs = trade.isBuy\n                ? wdiv(wmul(spot, gamma), WAD - 30 * BPS)\n                : wdiv(wmul(spot, WAD - 30 * BPS), gamma);\n            if ((slots[15] == 1) == (normalObs >= fastHat)) {\n                fastHat = wmul(fastHat, 9 * WAD / 10) + wmul(normalObs, WAD / 10);\n            }\n        }\n        slots[14] = fastHat;\n        uint256 tradeRatio = trade.reserveY > 0 ? wdiv(trade.amountY, trade.reserveY) : 0;\n        if (tradeRatio > TRADE_RATIO_CAP) tradeRatio = TRADE_RATIO_CAP;\n\n        if (tradeRatio > SIGNAL_THRESHOLD) {\n            uint256 push = tradeRatio * DIR_IMPACT_MULT;\n            if (push > WAD / 4) push = WAD / 4;\n            if (trade.isBuy) {\n                dirState = dirState + push;\n                if (dirState > 2 * WAD) dirState = 2 * WAD;\n            } else {\n                dirState = dirState > push ? dirState - push : 0;\n            }\n            actEma = wmul(actEma, ACT_BLEND_DECAY) + wmul(tradeRatio, WAD - ACT_BLEND_DECAY);\n            sizeHat = wmul(sizeHat, SIZE_BLEND_DECAY) + wmul(tradeRatio, WAD - SIZE_BLEND_DECAY);\n            if (sizeHat > WAD) sizeHat = WAD;\n        }\n\n        uint256 tox = pHat > 0 ? wdiv(absDiff(spot, pHat), pHat) : 0;\n        if (tox > TOX_CAP) tox = TOX_CAP;\n        toxEma = wmul(toxEma, TOX_BLEND_DECAY) + wmul(tox, WAD - TOX_BLEND_DECAY);\n        uint256 toxSignal = toxEma;\n\n        stepTradeCount = stepTradeCount + 1;\n        if (stepTradeCount > STEP_COUNT_CAP) stepTradeCount = STEP_COUNT_CAP;\n\n        uint256 flowSize = wmul(lambdaHat, sizeHat);\n        uint256 fBase = BASE_FEE + wmul(SIGMA_COEF, sigmaHat) + wmul(LAMBDA_COEF, lambdaHat) + wmul(FLOW_SIZE_COEF, flowSize);\n        uint256 fMid = fBase + wmul(TOX_COEF, toxSignal) + wmul(TOX_QUAD_COEF, wmul(toxSignal, toxSignal)) + wmul(ACT_COEF, actEma);\n        fMid = fMid + wmul(SIGMA_TOX_COEF, wmul(sigmaHat, toxSignal));\n\n        uint256 dirDev; bool sellPressure;\n        if (dirState >= WAD) { dirDev = dirState - WAD; sellPressure = true; }\n        else { dirDev = WAD - dirState; sellPressure = false; }\n\n        uint256 skew = wmul(DIR_COEF, dirDev) + wmul(DIR_TOX_COEF, wmul(dirDev, toxSignal));\n        uint256 bidFee; uint256 askFee;\n        if (sellPressure) {\n            bidFee = fMid + skew;\n            askFee = fMid > skew ? fMid - skew : 0;\n        } else {\n            askFee = fMid + skew;\n            bidFee = fMid > skew ? fMid - skew : 0;\n        }\n\n        {\n            uint256 staleHat = wmul(pHat, 700000000000000000) + wmul(fastHat, 300000000000000000);\n            uint256 staleTox = wdiv(absDiff(spot, staleHat), staleHat);\n            if (staleTox > TOX_CAP) staleTox = TOX_CAP;\n            uint256 staleShift = wmul(STALE_DIR_COEF, staleTox);\n            uint256 attractShift = wmul(staleShift, STALE_ATTRACT_FRAC);\n            if (spot >= staleHat) {\n                bidFee = bidFee + staleShift;\n                askFee = askFee > attractShift ? askFee - attractShift : 0;\n            } else {\n                askFee = askFee + staleShift;\n                bidFee = bidFee > attractShift ? bidFee - attractShift : 0;\n            }\n        }\n\n        {\n            bool tradeAligned = (trade.isBuy && spot >= pHat) || (!trade.isBuy && spot < pHat);\n            if (tradeAligned) {\n                uint256 tradeBoost = wmul(TRADE_TOX_BOOST, tradeRatio);\n                if (trade.isBuy) { bidFee = bidFee + tradeBoost; }\n                else { askFee = askFee + tradeBoost; }\n            }\n        }\n\n        if (sellPressure) {\n            bidFee = clampFee(_compressTailWithSlope(bidFee, TAIL_SLOPE_PROTECT));\n            askFee = clampFee(_compressTailWithSlope(askFee, TAIL_SLOPE_ATTRACT));\n        } else {\n            askFee = clampFee(_compressTailWithSlope(askFee, TAIL_SLOPE_PROTECT));\n            bidFee = clampFee(_compressTailWithSlope(bidFee, TAIL_SLOPE_ATTRACT));\n        }\n\n        // Floor the lower final fee at LOW_FEE_FLOOR, bounded above by the unchanged higher fee; ties unchanged.\n        if (bidFee < askFee) { if (bidFee < LOW_FEE_FLOOR) bidFee = LOW_FEE_FLOOR < askFee ? LOW_FEE_FLOOR : askFee; }\n        else if (askFee < bidFee) { if (askFee < LOW_FEE_FLOOR) askFee = LOW_FEE_FLOOR < bidFee ? LOW_FEE_FLOOR : bidFee; }\n\n        slots[0] = bidFee; slots[1] = askFee; slots[2] = (spot << 64) | trade.timestamp;\n        slots[3] = dirState; slots[4] = actEma; slots[5] = pHat;\n        slots[6] = sigmaHat; slots[7] = lambdaHat; slots[8] = sizeHat;\n        slots[9] = toxEma; slots[10] = stepTradeCount;\n\n        return (bidFee, askFee);\n    }\n\n    function _compressTailWithSlope(uint256 fee, uint256 slope) internal pure returns (uint256) {\n        if (fee <= TAIL_KNEE) return fee;\n        return TAIL_KNEE + wmul(fee - TAIL_KNEE, slope);\n    }\n\n    function _powWad(uint256 factor, uint256 exp) internal pure returns (uint256 result) {\n        result = WAD;\n        while (exp > 0) {\n            if (exp & 1 == 1) result = wmul(result, factor);\n            factor = wmul(factor, factor);\n            exp >>= 1;\n        }\n    }\n\n    function _decayCentered(uint256 centered, uint256 decayFactor, uint256 elapsed) internal pure returns (uint256) {\n        uint256 mul = _powWad(decayFactor, elapsed);\n        if (centered >= WAD) { return WAD + wmul(centered - WAD, mul); }\n        uint256 below = wmul(WAD - centered, mul);\n        return below < WAD ? WAD - below : 0;\n    }\n\n    // Floor square root: bit-length seed and seven Newton steps (all uint256).\n    function _isqrt(uint256 x) internal pure returns (uint256 r) {\n        if (x == 0) return 0;\n        unchecked {\n            uint256 y = x;\n            r = 1;\n            if (y >> 128 != 0) { y >>= 128; r <<= 64; }\n            if (y >> 64 != 0) { y >>= 64; r <<= 32; }\n            if (y >> 32 != 0) { y >>= 32; r <<= 16; }\n            if (y >> 16 != 0) { y >>= 16; r <<= 8; }\n            if (y >> 8 != 0) { y >>= 8; r <<= 4; }\n            if (y >> 4 != 0) { y >>= 4; r <<= 2; }\n            if (y >> 2 != 0) { r <<= 1; }\n            r = (r + x / r) >> 1;\n            r = (r + x / r) >> 1;\n            r = (r + x / r) >> 1;\n            r = (r + x / r) >> 1;\n            r = (r + x / r) >> 1;\n            r = (r + x / r) >> 1;\n            r = (r + x / r) >> 1;\n            uint256 t = x / r;\n            return r < t ? r : t;\n        }\n    }\n\n    function getName() external pure override returns (string memory) { return \"no_cubic\"; }\n}\n","sha256":"0cd56aadd3211149c3816a547990ba584ba461d977e158b092dbde53a961f219","base_sha256":"610c1905e7dd5559b84e40a3b2d6f8e0b53a7b0ac7574ae33b6c1770a28367cb","v2_sha256":"28417e116f57f1029fdd1803832e852574902c1ae7253c05657f317db76da4ab","selected_variant":{"name":"G_F1","F_bps":1,"sha256":"0cd56aadd3211149c3816a547990ba584ba461d977e158b092dbde53a961f219"},"variants":[{"name":"G_F1","F_bps":1,"floor_wad":"100000000000000","constant":"LOW_FEE_FLOOR = 1 * BPS","sha256":"0cd56aadd3211149c3816a547990ba584ba461d977e158b092dbde53a961f219"},{"name":"G_F2","F_bps":2,"floor_wad":"200000000000000","constant":"LOW_FEE_FLOOR = 2 * BPS","sha256":"6e2ea893e2cf36d4abfd85ebe29f81920f3f29ed52f2413551b02cb562f2739a"},{"name":"G_F4","F_bps":4,"floor_wad":"400000000000000","constant":"LOW_FEE_FLOOR = 4 * BPS","sha256":"a2565d156166389f090df9e43e6846366dc59fec9cb4fc110d9fd0b5a2e6e9b7"},{"name":"G_F8","F_bps":8,"floor_wad":"800000000000000","constant":"LOW_FEE_FLOOR = 8 * BPS","sha256":"ff6ed49a35d1347dbc5eee5637294b9d8f3962e902cbb94df4fa34540dbcf887"}],"paired":{"stage":"tuning","candidate":"G_F1","reference":"V2","seeds_inclusive":[32000,32511],"n":512,"mean_diff":-0.4800817049385696,"se":0.009288127783237921,"worst":{"seed":32416,"diff":-1.1445386962817565,"edge_cand":564.5880753344431,"edge_v2":565.7326140307249},"valid":true,"invalid_reasons":[]},"seeds":{"screen_inclusive":[30000,30255],"tuning_inclusive":[32000,32511],"platform_check_v2_only_inclusive":[[0,4],[10000,10004]],"note":"No seed >= 4000000 was used. Seeds 0..4 and 10000..10004 were run for V2 only, to check this platform against the published per-seed V2 edges; they were not used for selection or scoring.","all_requested_seeds_returned":true},"stages":{"screen":{"seeds_inclusive":[30000,30255],"n":256,"method":"Each strategy measured on its own: amm_sim_rs.run_batch(X, VanillaStrategy, configs, 8), chunks of 32 seeds. One V2 run reused as the paired baseline for every candidate.","v2":{"sha256":"28417e116f57f1029fdd1803832e852574902c1ae7253c05657f317db76da4ab","gas":{"max_ok":243625,"init_max":236377,"oog":3,"other_errors":0,"afterSwap_calls":2652729,"oog_seeds":[[30105,2],[30238,1]],"vanilla_oog":0,"vanilla_other_errors":0},"run_checks":{"complete":true,"counters_per_seed_match_global":true,"max_abs_reconciliation_error":7.105427357601002e-12},"seconds":20.036},"results":{"G":{"valid":true,"invalid_reasons":[],"sha256":"610c1905e7dd5559b84e40a3b2d6f8e0b53a7b0ac7574ae33b6c1770a28367cb","paired":{"n":256,"mean_diff":0.00039321248717394397,"se":0.00036075265929951016,"sd":0.0057720425487921626,"worst":{"seed":30000,"diff":0.0,"edge_cand":490.4303030450311,"edge_v2":490.4303030450311},"worst5":[{"seed":30000,"diff":0.0},{"seed":30001,"diff":0.0},{"seed":30002,"diff":0.0},{"seed":30003,"diff":0.0},{"seed":30004,"diff":0.0}],"n_nonzero":2,"n_positive":2,"max_abs_diff":0.09197746966322029},"edge_deltas_vs_v2":{"retail":{"n":256,"mean":0.00023811344432256298,"se":0.0002091768131006757},"arb":{"n":256,"mean":0.00015509904284377596,"se":0.000152334281230755},"retail_volume_y":{"n":256,"mean":-0.05379525029161414,"se":0.04915859030209582}},"mean_edges":{"cand":{"total":523.9792636760604,"retail":550.0502218945945,"arb":-26.070958218534038},"v2":{"total":523.9788704635732,"retail":550.0499837811502,"arb":-26.07111331757688}},"v2_volume_terciles":[{"tercile":"low","n":85,"v2_volume_y_range":[57958.173777823984,71367.46033922448],"mean_diff":0.0011842634907827019,"se":0.0010856894492193413},{"tercile":"mid","n":85,"v2_volume_y_range":[71485.34483236422,81895.58707545145],"mean_diff":0.0,"se":0.0},{"tercile":"high","n":86,"v2_volume_y_range":[82014.30158686683,94014.40846824755],"mean_diff":0.0,"se":0.0}],"gas":{"max_ok":208815,"init_max":220944,"oog":0,"other_errors":0,"afterSwap_calls":2652729,"oog_seeds":[],"vanilla_oog":0,"vanilla_other_errors":0},"run_checks":{"complete":true,"counters_per_seed_match_global":true,"max_abs_reconciliation_error":7.105427357601002e-12},"seconds":17.714,"F_bps":null},"G_F1":{"valid":true,"invalid_reasons":[],"sha256":"0cd56aadd3211149c3816a547990ba584ba461d977e158b092dbde53a961f219","paired":{"n":256,"mean_diff":-0.48320832907969313,"se":0.010847028677641974,"sd":0.17355245884227158,"worst":{"seed":30069,"diff":-0.9511295420571741,"edge_cand":625.231058677343,"edge_v2":626.1821882194001},"worst5":[{"seed":30069,"diff":-0.9511295420571741},{"seed":30204,"diff":-0.9081206548305545},{"seed":30075,"diff":-0.8979001940214175},{"seed":30231,"diff":-0.8914571051437861},{"seed":30183,"diff":-0.8655794877325889}],"n_nonzero":256,"n_positive":1,"max_abs_diff":0.9511295420571741},"edge_deltas_vs_v2":{"retail":{"n":256,"mean":-0.5573481050305067,"se":0.010581330205515627},"arb":{"n":256,"mean":0.07413977595078089,"se":0.004099467923096476},"retail_volume_y":{"n":256,"mean":-212.49484237259156,"se":2.3123572100295458}},"mean_edges":{"cand":{"total":523.4956621344936,"retail":549.4926356761197,"arb":-25.9969735416261},"v2":{"total":523.9788704635732,"retail":550.0499837811502,"arb":-26.07111331757688}},"v2_volume_terciles":[{"tercile":"low","n":85,"v2_volume_y_range":[57958.173777823984,71367.46033922448],"mean_diff":-0.4015572345188482,"se":0.015523586244877772},{"tercile":"mid","n":85,"v2_volume_y_range":[71485.34483236422,81895.58707545145],"mean_diff":-0.4927772198925361,"se":0.017611311211474037},{"tercile":"high","n":86,"v2_volume_y_range":[82014.30158686683,94014.40846824755],"mean_diff":-0.5544523676678346,"se":0.019341398737856133}],"gas":{"max_ok":211309,"init_max":220944,"oog":0,"other_errors":0,"afterSwap_calls":2645377,"oog_seeds":[],"vanilla_oog":0,"vanilla_other_errors":0},"run_checks":{"complete":true,"counters_per_seed_match_global":true,"max_abs_reconciliation_error":5.8548721426632255e-12},"seconds":17.688,"F_bps":1},"G_F2":{"valid":true,"invalid_reasons":[],"sha256":"6e2ea893e2cf36d4abfd85ebe29f81920f3f29ed52f2413551b02cb562f2739a","paired":{"n":256,"mean_diff":-0.9828328197474507,"se":0.016164575422834622,"sd":0.25863320676535395,"worst":{"seed":30194,"diff":-1.6713400709215875,"edge_cand":632.3940817030267,"edge_v2":634.0654217739483},"worst5":[{"seed":30194,"diff":-1.6713400709215875},{"seed":30204,"diff":-1.6569162903600727},{"seed":30129,"diff":-1.5039764112566445},{"seed":30038,"diff":-1.485184137273336},{"seed":30048,"diff":-1.4723141037868004}],"n_nonzero":256,"n_positive":0,"max_abs_diff":1.6713400709215875},"edge_deltas_vs_v2":{"retail":{"n":256,"mean":-1.127701005092406,"se":0.016111751227280646},"arb":{"n":256,"mean":0.14486818534506687,"se":0.005063665450707224},"retail_volume_y":{"n":256,"mean":-429.1290350760836,"se":3.7701794774000095}},"mean_edges":{"cand":{"total":522.9960376438258,"retail":548.9222827760577,"arb":-25.926245132231816},"v2":{"total":523.9788704635732,"retail":550.0499837811502,"arb":-26.07111331757688}},"v2_volume_terciles":[{"tercile":"low","n":85,"v2_volume_y_range":[57958.173777823984,71367.46033922448],"mean_diff":-0.8287575669396835,"se":0.022957001086224053},{"tercile":"mid","n":85,"v2_volume_y_range":[71485.34483236422,81895.58707545145],"mean_diff":-1.0003066976668606,"se":0.025231763311400424},{"tercile":"high","n":86,"v2_volume_y_range":[82014.30158686683,94014.40846824755],"mean_diff":-1.1178458065557109,"se":0.026509761684590107}],"gas":{"max_ok":211309,"init_max":220944,"oog":0,"other_errors":0,"afterSwap_calls":2638146,"oog_seeds":[],"vanilla_oog":0,"vanilla_other_errors":0},"run_checks":{"complete":true,"counters_per_seed_match_global":true,"max_abs_reconciliation_error":7.44648787076585e-12},"seconds":17.546,"F_bps":2},"G_F4":{"valid":true,"invalid_reasons":[],"sha256":"a2565d156166389f090df9e43e6846366dc59fec9cb4fc110d9fd0b5a2e6e9b7","paired":{"n":256,"mean_diff":-2.008488830207085,"se":0.028100740409779265,"sd":0.44961184655646824,"worst":{"seed":30126,"diff":-3.4839148235840867,"edge_cand":571.5431663676494,"edge_v2":575.0270811912335},"worst5":[{"seed":30126,"diff":-3.4839148235840867},{"seed":30183,"diff":-3.056867284088298},{"seed":30226,"diff":-2.92084419493915},{"seed":30231,"diff":-2.84923489084656},{"seed":30031,"diff":-2.8346841857908203}],"n_nonzero":256,"n_positive":0,"max_abs_diff":3.4839148235840867},"edge_deltas_vs_v2":{"retail":{"n":256,"mean":-2.305531042900875,"se":0.029730309534770048},"arb":{"n":256,"mean":0.29704221269372544,"se":0.007549030728519966},"retail_volume_y":{"n":256,"mean":-887.9342834366489,"se":6.888379529213499}},"mean_edges":{"cand":{"total":521.9703816333662,"retail":547.7444527382493,"arb":-25.774071104883156},"v2":{"total":523.9788704635732,"retail":550.0499837811502,"arb":-26.07111331757688}},"v2_volume_terciles":[{"tercile":"low","n":85,"v2_volume_y_range":[57958.173777823984,71367.46033922448],"mean_diff":-1.6689312944187737,"se":0.03744672612847242},{"tercile":"mid","n":85,"v2_volume_y_range":[71485.34483236422,81895.58707545145],"mean_diff":-2.0652517237884154,"se":0.0391167590218463},{"tercile":"high","n":86,"v2_volume_y_range":[82014.30158686683,94014.40846824755],"mean_diff":-2.2879951626209625,"se":0.0434779327826131}],"gas":{"max_ok":208936,"init_max":220944,"oog":0,"other_errors":0,"afterSwap_calls":2623072,"oog_seeds":[],"vanilla_oog":0,"vanilla_other_errors":0},"run_checks":{"complete":true,"counters_per_seed_match_global":true,"max_abs_reconciliation_error":5.5990767577895895e-12},"seconds":17.465,"F_bps":4},"G_F8":{"valid":true,"invalid_reasons":[],"sha256":"ff6ed49a35d1347dbc5eee5637294b9d8f3962e902cbb94df4fa34540dbcf887","paired":{"n":256,"mean_diff":-4.157830660712666,"se":0.049830327347318064,"sd":0.797285237557089,"worst":{"seed":30177,"diff":-6.55183297547967,"edge_cand":550.7945609303075,"edge_v2":557.3463939057872},"worst5":[{"seed":30177,"diff":-6.55183297547967},{"seed":30124,"diff":-6.500375702195356},{"seed":30126,"diff":-6.123717465601203},{"seed":30087,"diff":-5.942386163028459},{"seed":30226,"diff":-5.820453550181696}],"n_nonzero":256,"n_positive":0,"max_abs_diff":6.55183297547967},"edge_deltas_vs_v2":{"retail":{"n":256,"mean":-4.771177618577285,"se":0.05230201384095052},"arb":{"n":256,"mean":0.6133469578646814,"se":0.010064767743683206},"retail_volume_y":{"n":256,"mean":-1897.2686986295591,"se":12.567574315096948}},"mean_edges":{"cand":{"total":519.8210398028606,"retail":545.2788061625729,"arb":-25.4577663597122},"v2":{"total":523.9788704635732,"retail":550.0499837811502,"arb":-26.07111331757688}},"v2_volume_terciles":[{"tercile":"low","n":85,"v2_volume_y_range":[57958.173777823984,71367.46033922448],"mean_diff":-3.4423436992906162,"se":0.06132102752247817},{"tercile":"mid","n":85,"v2_volume_y_range":[71485.34483236422,81895.58707545145],"mean_diff":-4.271930418543843,"se":0.05836312148374115},{"tercile":"high","n":86,"v2_volume_y_range":[82014.30158686683,94014.40846824755],"mean_diff":-4.752224989843179,"se":0.07009975294628523}],"gas":{"max_ok":211309,"init_max":220944,"oog":0,"other_errors":0,"afterSwap_calls":2589086,"oog_seeds":[],"vanilla_oog":0,"vanilla_other_errors":0},"run_checks":{"complete":true,"counters_per_seed_match_global":true,"max_abs_reconciliation_error":6.73594513500575e-12},"seconds":17.214,"F_bps":8}}},"tuning":{"seeds_inclusive":[32000,32511],"n":512,"candidate":"G_F1","v2":{"sha256":"28417e116f57f1029fdd1803832e852574902c1ae7253c05657f317db76da4ab","gas":{"max_ok":243734,"init_max":236377,"oog":8,"other_errors":0,"afterSwap_calls":5340621,"oog_seeds":[[32338,2],[32341,3],[32485,1],[32491,2]],"vanilla_oog":0,"vanilla_other_errors":0},"run_checks":{"complete":true,"counters_per_seed_match_global":true,"max_abs_reconciliation_error":5.8548721426632255e-12},"seconds":40.395},"result":{"valid":true,"invalid_reasons":[],"sha256":"0cd56aadd3211149c3816a547990ba584ba461d977e158b092dbde53a961f219","paired":{"n":512,"mean_diff":-0.4800817049385696,"se":0.009288127783237921,"sd":0.21016634048175073,"worst":{"seed":32416,"diff":-1.1445386962817565,"edge_cand":564.5880753344431,"edge_v2":565.7326140307249},"worst5":[{"seed":32416,"diff":-1.1445386962817565},{"seed":32215,"diff":-1.1401285912602361},{"seed":32374,"diff":-1.0556844228243563},{"seed":32266,"diff":-0.9985405730080856},{"seed":32459,"diff":-0.9570299383864267}],"n_nonzero":512,"n_positive":5,"max_abs_diff":1.328409161405716},"edge_deltas_vs_v2":{"retail":{"n":512,"mean":-0.5583984240523615,"se":0.008948435676175114},"arb":{"n":512,"mean":0.07831671911365776,"se":0.0034593457106304715},"retail_volume_y":{"n":512,"mean":-209.51818190735972,"se":1.6734762830884677}},"mean_edges":{"cand":{"total":534.2001777345998,"retail":561.0561775262635,"arb":-26.855999791663756},"v2":{"total":534.6802594395383,"retail":561.6145759503158,"arb":-26.934316510777414}},"v2_volume_terciles":[{"tercile":"low","n":170,"v2_volume_y_range":[56052.948368339996,72427.80387736329],"mean_diff":-0.40586223233277846,"se":0.011588756611689689},{"tercile":"mid","n":171,"v2_volume_y_range":[72627.84617869854,82792.24448278104],"mean_diff":-0.5039784810226443,"se":0.01383430399939679},{"tercile":"high","n":171,"v2_volume_y_range":[82827.67478912619,96206.62367075495],"mean_diff":-0.5299703694567434,"se":0.020052432695277823}],"gas":{"max_ok":213370,"init_max":220944,"oog":0,"other_errors":0,"afterSwap_calls":5327163,"oog_seeds":[],"vanilla_oog":0,"vanilla_other_errors":0},"run_checks":{"complete":true,"counters_per_seed_match_global":true,"max_abs_reconciliation_error":7.958078640513122e-12},"seconds":35.747},"mean_retail_volume_y":{"v2":77298.76706125554,"G_F1":77089.24887934819},"per_seed_diff_G_F1_minus_V2_rounded_1e-6":{"first_seed":32000,"diffs":[-0.740858,-0.496289,-0.464484,-0.623381,-0.696244,-0.551826,-0.759051,-0.449137,-0.256429,-0.39052,-0.481601,-0.380519,-0.360091,-0.345058,-0.448507,-0.71271,-0.568885,-0.354841,-0.581346,-0.538441,-0.145494,-0.448087,-0.410293,-0.566978,-0.778278,-0.169445,-0.607044,-0.409419,-0.337772,-0.359603,-0.359025,-0.430623,-0.175504,-0.55834,-0.44154,-0.413174,-0.360429,-0.39388,-0.415016,-0.529294,-0.643729,-0.21457,-0.793984,-0.620206,-0.158401,-0.358613,-0.541229,-0.312294,-0.324613,-0.534451,-0.383688,-0.921123,-0.354482,-0.41409,-0.419121,-0.680091,-0.358953,-0.566623,-0.457713,-0.325086,-0.753101,-0.303417,-0.322785,-0.494599,-0.605569,-0.346645,-0.431864,-0.423045,-0.380436,-0.324477,-0.447778,-0.716268,-0.173273,-0.497382,-0.374829,-0.224699,-0.548409,-0.430235,-0.40492,-0.57366,-0.467185,-0.647765,-0.490411,-0.877736,-0.456856,-0.221275,-0.290428,-0.486128,-0.512935,-0.203797,-0.431215,-0.612786,-0.387536,-0.265303,-0.499683,-0.622053,-0.522099,-0.538269,-0.256663,-0.429576,-0.426822,-0.882465,-0.325898,-0.464029,-0.797933,-0.603008,-0.537742,-0.380822,-0.247421,-0.47373,-0.372481,-0.469859,-0.247821,-0.332267,-0.47249,-0.607537,-0.586747,-0.382912,-0.475501,-0.524284,-0.195548,-0.709211,-0.393241,-0.335041,-0.801768,-0.548855,-0.457655,-0.384956,-0.621828,-0.338322,-0.408002,-0.385178,-0.582088,-0.94436,-0.426227,-0.510679,-0.537969,-0.911947,-0.611991,-0.136221,-0.61153,-0.596923,-0.714439,-0.799232,-0.528204,-0.409989,0.340227,-0.668712,-0.512444,-0.402749,-0.403671,-0.380811,-0.42135,-0.564094,-0.726175,-0.219675,-0.536802,-0.433192,-0.378969,-0.447744,-0.477798,-0.282562,-0.81404,-0.137328,-0.621605,-0.301458,-0.466212,-0.555877,-0.401153,-0.748424,-0.410659,-0.798935,-0.496402,-0.592142,-0.362987,-0.616579,-0.56039,-0.327849,-0.533547,-0.444236,-0.530422,-0.167784,-0.366923,-0.159382,-0.36461,-0.670291,-0.436752,-0.598728,-0.423321,-0.700932,-0.608512,-0.712923,-0.479205,-0.307513,-0.338198,-0.569422,-0.382942,-0.387998,-0.213112,-0.487722,-0.595716,-0.572719,-0.437983,-0.579764,-0.335104,-0.227341,-0.439846,-0.627991,-0.705451,-0.796335,-0.413584,-0.53407,-0.454104,-0.827959,-0.529409,-1.140129,-0.637333,-0.363382,-0.602424,-0.242264,-0.464061,-0.280978,-0.502276,-0.661431,-0.490275,-0.578396,-0.625003,-0.490929,-0.350045,-0.352705,-0.923036,-0.526524,-0.589671,-0.306341,-0.467,-0.309642,-0.435706,-0.389242,-0.93445,-0.479491,-0.549321,-0.245589,-0.352724,-0.61968,-0.772592,-0.660741,-0.65261,-0.767957,-0.470128,-0.247123,-0.864264,-0.256594,-0.618154,-0.567982,-0.55368,-0.361542,-0.601038,-0.646356,-0.315622,-0.328203,-0.481615,-0.240081,-0.751675,1.328409,-0.407176,-0.643483,-0.998541,-0.446656,-0.448738,-0.330588,-0.50224,-0.596637,-0.589566,-0.396878,-0.317563,-0.665641,-0.398951,-0.57898,-0.459415,-0.56008,-0.382192,-0.775391,-0.732195,-0.592265,-0.392542,-0.250565,-0.18661,-0.565995,-0.430553,-0.404152,-0.342375,-0.485852,-0.523195,-0.831585,-0.607334,-0.48657,-0.469498,-0.492695,-0.556699,-0.625145,-0.643502,-0.182877,-0.49251,-0.597302,-0.237961,-0.686913,-0.28106,-0.121449,-0.444762,-0.599648,-0.559198,-0.656788,-0.266013,-0.357749,-0.380724,-0.856332,-0.932899,-0.27362,-0.828999,-0.650862,-0.685939,-0.275486,-0.633505,-0.462322,-0.383796,-0.742216,-0.378519,-0.282505,-0.486862,-0.443545,-0.247649,-0.249508,-0.584864,-0.565061,-0.600212,-0.670949,-0.386801,-0.525881,-0.418581,-0.730044,-0.476127,0.166036,-0.349967,-0.572114,-0.486298,-0.263374,-0.670097,-0.664002,-0.46851,-0.740046,-0.724357,-0.335066,-0.355314,-0.326244,-0.480851,-0.412044,-0.47533,-0.594786,-0.349133,-0.14141,-0.446702,-0.365256,-0.421405,-0.459136,-0.507645,-0.549146,-0.526001,-0.719209,-0.459366,-0.503695,-0.48394,-0.797486,-0.467149,-0.261183,-1.055684,-0.526697,-0.358661,-0.561273,-0.44977,-0.554443,-0.415934,-0.34625,-0.229344,-0.413275,-0.430861,-0.19146,-0.85103,-0.516767,-0.41967,-0.438255,0.861397,-0.600617,-0.385158,-0.542897,-0.509638,-0.660936,-0.435341,-0.507477,-0.619943,-0.745208,-0.321501,-0.379833,-0.683851,-0.531827,-0.688933,-0.538279,-0.496854,-0.720761,-0.371978,-0.200364,-0.547945,-0.405929,-0.505679,-0.450319,-0.570649,-0.760579,-1.144539,-0.258097,-0.633821,-0.680959,-0.402502,-0.19687,-0.492071,-0.547603,-0.305146,-0.504395,-0.478072,-0.397932,-0.410252,-0.644906,-0.513806,-0.373651,-0.11256,-0.919022,-0.366117,-0.397477,-0.688524,-0.694716,-0.363434,-0.572412,-0.821069,-0.286339,-0.490976,-0.443986,-0.448786,-0.414259,-0.527387,-0.468681,-0.728748,-0.529893,-0.189584,-0.191444,-0.666167,-0.547144,-0.396022,-0.464235,-0.342757,-0.564759,-0.744201,-0.95703,-0.60343,-0.473809,-0.416704,-0.539696,-0.567864,-0.429878,-0.309749,-0.672762,-0.37999,-0.23555,-0.485738,-0.210835,-0.678956,-0.460513,-0.19581,-0.389282,-0.472237,-0.664278,-0.653396,0.025746,-0.625936,-0.476561,-0.500809,-0.612655,-0.606762,-0.213069,-0.681462,-0.368761,-0.716569,-0.470998,-0.443671,-0.104999,-0.44257,-0.17243,-0.003001,-0.313367,-0.272101,-0.383258,-0.688061,-0.532415,-0.782848,-0.367349,-0.471103,-0.22529,-0.345205,-0.396084,-0.566501,-0.373529,-0.69888,-0.910725,-0.329628,-0.688574]}}},"selection":{"rule":"highest screen mean_diff vs V2 among valid floor variants (candidate OOG <= V2 OOG and every other harness validity check passed); only that variant was run on the tuning block","screen_ranking":[{"name":"G_F1","F_bps":1,"mean_diff":-0.48320832907969313,"se":0.010847028677641974,"valid":true},{"name":"G_F2","F_bps":2,"mean_diff":-0.9828328197474507,"se":0.016164575422834622,"valid":true},{"name":"G_F4","F_bps":4,"mean_diff":-2.008488830207085,"se":0.028100740409779265,"valid":true},{"name":"G_F8","F_bps":8,"mean_diff":-4.157830660712666,"se":0.049830327347318064,"valid":true}],"selected":"G_F1","all_variants_negative":true,"monotone_in_F":true},"freeze":{"frozen_after":"tuning","name":"G_F1","sha256":"0cd56aadd3211149c3816a547990ba584ba461d977e158b092dbde53a961f219","source":"field code","status":"frozen training candidate; negative vs V2 on both training blocks, so not recommended for confirmation"},"gas":{"max_ok":213370,"init_max":220944,"oog":0,"other_errors":0,"afterSwap_calls":5327163,"oog_seeds":[],"vanilla_oog":0,"vanilla_other_errors":0,"stage":"tuning","note":"max_ok = afterSwap max gas of successful calls; init_max = afterInitialize"},"v2_gas":{"max_ok":243734,"init_max":236377,"oog":8,"other_errors":0,"afterSwap_calls":5340621,"oog_seeds":[[32338,2],[32341,3],[32485,1],[32491,2]],"vanilla_oog":0,"vanilla_other_errors":0,"stage":"tuning"},"oog_rule":{"candidate_oog_tuning":0,"v2_oog_tuning":8,"candidate_oog_screen":{"G":0,"G_F1":0,"G_F2":0,"G_F4":0,"G_F8":0},"v2_oog_screen":3,"valid_when":"candidate OOG <= V2 OOG on the same seeds","afterSwap_gas_limit":250000},"g_control":{"stage":"screen","seeds_inclusive":[30000,30255],"n":256,"sha256":"610c1905e7dd5559b84e40a3b2d6f8e0b53a7b0ac7574ae33b6c1770a28367cb","mean_diff":0.00039321248717394397,"se":0.00036075265929951016,"n_nonzero":2,"nonzero_seeds":[30105,30238],"v2_oog_seeds":[30105,30238],"nonzero_only_on_v2_oog_seeds":true,"valid":true,"gas":{"max_ok":208815,"init_max":220944,"oog":0,"other_errors":0,"afterSwap_calls":2652729,"oog_seeds":[],"vanilla_oog":0,"vanilla_other_errors":0}},"edge_deltas":{"tuning_G_F1":{"retail":{"n":512,"mean":-0.5583984240523615,"se":0.008948435676175114},"arb":{"n":512,"mean":0.07831671911365776,"se":0.0034593457106304715},"retail_volume_y":{"n":512,"mean":-209.51818190735972,"se":1.6734762830884677}},"screen":{"G":{"retail":{"n":256,"mean":0.00023811344432256298,"se":0.0002091768131006757},"arb":{"n":256,"mean":0.00015509904284377596,"se":0.000152334281230755},"retail_volume_y":{"n":256,"mean":-0.05379525029161414,"se":0.04915859030209582}},"G_F1":{"retail":{"n":256,"mean":-0.5573481050305067,"se":0.010581330205515627},"arb":{"n":256,"mean":0.07413977595078089,"se":0.004099467923096476},"retail_volume_y":{"n":256,"mean":-212.49484237259156,"se":2.3123572100295458}},"G_F2":{"retail":{"n":256,"mean":-1.127701005092406,"se":0.016111751227280646},"arb":{"n":256,"mean":0.14486818534506687,"se":0.005063665450707224},"retail_volume_y":{"n":256,"mean":-429.1290350760836,"se":3.7701794774000095}},"G_F4":{"retail":{"n":256,"mean":-2.305531042900875,"se":0.029730309534770048},"arb":{"n":256,"mean":0.29704221269372544,"se":0.007549030728519966},"retail_volume_y":{"n":256,"mean":-887.9342834366489,"se":6.888379529213499}},"G_F8":{"retail":{"n":256,"mean":-4.771177618577285,"se":0.05230201384095052},"arb":{"n":256,"mean":0.6133469578646814,"se":0.010064767743683206},"retail_volume_y":{"n":256,"mean":-1897.2686986295591,"se":12.567574315096948}}},"definition":"per-seed candidate minus V2 for the submission's retail edge, arb edge and retail_volume_y; mean and se over seeds"},"v2_volume_terciles":{"definition":"seeds ranked by V2 submission retail_volume_y and split into thirds; mean paired diff (candidate - V2) within each third","tuning_G_F1":[{"tercile":"low","n":170,"v2_volume_y_range":[56052.948368339996,72427.80387736329],"mean_diff":-0.40586223233277846,"se":0.011588756611689689},{"tercile":"mid","n":171,"v2_volume_y_range":[72627.84617869854,82792.24448278104],"mean_diff":-0.5039784810226443,"se":0.01383430399939679},{"tercile":"high","n":171,"v2_volume_y_range":[82827.67478912619,96206.62367075495],"mean_diff":-0.5299703694567434,"se":0.020052432695277823}],"screen":{"G":[{"tercile":"low","n":85,"v2_volume_y_range":[57958.173777823984,71367.46033922448],"mean_diff":0.0011842634907827019,"se":0.0010856894492193413},{"tercile":"mid","n":85,"v2_volume_y_range":[71485.34483236422,81895.58707545145],"mean_diff":0.0,"se":0.0},{"tercile":"high","n":86,"v2_volume_y_range":[82014.30158686683,94014.40846824755],"mean_diff":0.0,"se":0.0}],"G_F1":[{"tercile":"low","n":85,"v2_volume_y_range":[57958.173777823984,71367.46033922448],"mean_diff":-0.4015572345188482,"se":0.015523586244877772},{"tercile":"mid","n":85,"v2_volume_y_range":[71485.34483236422,81895.58707545145],"mean_diff":-0.4927772198925361,"se":0.017611311211474037},{"tercile":"high","n":86,"v2_volume_y_range":[82014.30158686683,94014.40846824755],"mean_diff":-0.5544523676678346,"se":0.019341398737856133}],"G_F2":[{"tercile":"low","n":85,"v2_volume_y_range":[57958.173777823984,71367.46033922448],"mean_diff":-0.8287575669396835,"se":0.022957001086224053},{"tercile":"mid","n":85,"v2_volume_y_range":[71485.34483236422,81895.58707545145],"mean_diff":-1.0003066976668606,"se":0.025231763311400424},{"tercile":"high","n":86,"v2_volume_y_range":[82014.30158686683,94014.40846824755],"mean_diff":-1.1178458065557109,"se":0.026509761684590107}],"G_F4":[{"tercile":"low","n":85,"v2_volume_y_range":[57958.173777823984,71367.46033922448],"mean_diff":-1.6689312944187737,"se":0.03744672612847242},{"tercile":"mid","n":85,"v2_volume_y_range":[71485.34483236422,81895.58707545145],"mean_diff":-2.0652517237884154,"se":0.0391167590218463},{"tercile":"high","n":86,"v2_volume_y_range":[82014.30158686683,94014.40846824755],"mean_diff":-2.2879951626209625,"se":0.0434779327826131}],"G_F8":[{"tercile":"low","n":85,"v2_volume_y_range":[57958.173777823984,71367.46033922448],"mean_diff":-3.4423436992906162,"se":0.06132102752247817},{"tercile":"mid","n":85,"v2_volume_y_range":[71485.34483236422,81895.58707545145],"mean_diff":-4.271930418543843,"se":0.05836312148374115},{"tercile":"high","n":86,"v2_volume_y_range":[82014.30158686683,94014.40846824755],"mean_diff":-4.752224989843179,"se":0.07009975294628523}]}},"checks":{"G_sha256_verified":true,"V2_sha256_verified":true,"V2_derived_from_base_artifact":"the code of artifact 1f4f14f0... with 'if (g > 4) g = 4;' -> 'if (g > 1) g = 1;' and '_powWad(925000000000000000, g)' -> '_powWad(800000000000000000, g)' has sha256 28417e11...ab and is byte-identical to bundle V2.sol","harness_tests_py":{"matchrunner_equal_10000_10031":true,"far_block_len":4,"far_block_seconds":0.0,"allocation_scales_with_n":true,"far_seed_equals_single":true,"validity_cases":{"cand_oog_equal_v2_valid":true,"cand_oog_less_valid":true,"cand_oog_more_invalid":true,"v2_oog_alone_not_invalid":true,"revert_invalid":true,"ref_revert_invalid":true,"vanilla_oog_invalid":true,"vanilla_other_invalid":true,"incomplete_invalid":true,"counter_mismatch_invalid":true,"reconciliation_threshold_invalid":true,"control_oog_match_valid":true,"control_oog_mismatch_invalid":true},"all_pass":true},"amm_match_validate":{"StarterStrategy":true,"V2":true,"G":true,"G_F1":true,"G_F2":true,"G_F4":true,"G_F8":true},"floor_unit_test":{"F1":{"cases":300,"match_floor_of_G":300,"floor_binding_cases":274,"tie_cases":0,"mismatches":[]},"F2":{"cases":300,"match_floor_of_G":300,"floor_binding_cases":276,"tie_cases":0,"mismatches":[]},"F4":{"cases":300,"match_floor_of_G":300,"floor_binding_cases":276,"tie_cases":0,"mismatches":[]},"F8":{"cases":300,"match_floor_of_G":300,"floor_binding_cases":283,"tie_cases":0,"mismatches":[]},"all_pass":true,"method":"pyrevm via amm_competition EVMStrategyAdapter: fresh deploy + afterInitialize(100,10000) + one afterSwap with each of 300 random trades; G_F output must equal min(max(lower,F),higher) applied to G output from identical state"},"platform_reproduction":{"seeds":[0,1,2,3,4,10000,10001,10002,10003,10004],"max_abs_diff_vs_published_linux_edges":1.872422217275016e-10,"bit_identical_count":0,"published_values_from":"https://api.imd.fun/artifacts/206a4888de6fa1bda53cd2c9bad1632ccdbb63d32e7f09b6a332746b7a3ac3c3 (calibration.paired_control.worst, identity_diagnostic.paired.worst, paired.worst edge_b)"},"harness_validity_enforced":"complete seeds, no duplicates, finite edges; no revert/tx_error/other_halt/bad_return; Vanilla zero failures incl. OOG; per-seed counters == process-global counters; |total-retail-arb| < 1e-8; candidate OOG <= V2 OOG","max_abs_reconciliation_error_all_runs":7.958078640513122e-12,"counters_per_seed_match_global_all_runs":true,"chunk_size":32,"n_workers":8,"n_steps":10000,"gas_limits":{"afterInitialize":250000,"afterSwap":250000,"getName":50000},"configs":"harness.config_for_seed: default_rng(seed) -> size, rate, sigma uniforms in that order; build_config(seed=seed) (engine: price seed, retail seed+1); tests.py checked equality with MatchRunner._build_configs on 10000..10031"},"deviations":["Platform: this machine is macOS (Darwin 27) arm64, not the Linux x86_64 the brief asks for; no Linux x86_64 host was available. setup.sh was adapted (scratch/setup_macos.sh): uv aarch64-apple-darwin build; system Apple clang as cc; rustup-init aarch64-apple-darwin with RUSTUP_USE_CURL=1 because the sandbox blocked rustup's native TLS certificate check and mktemp under /var/folders; the Linux micromamba fallbacks were not used. Toolchain: rustc 1.99.1, CPython 3.12.16, maturin 1.16.0, solc 0.8.24 (macOS universal binary).","Platform effect: V2 per-seed edges on 10 seeds differ from the published Linux values by at most 1.87e-10 (none bit-identical), so per-seed rows are not bit-identical across platforms. That is far below the paired effects here (about 0.48 to 4.2); exactly where V2's rare OOG halts land may also differ across platforms.","Source: the GitHub archive tarball of commit 6b6921f8d463314aa7c96234e1be25a25245f704 (tarball sha256 fa91b175c4b0db13fa44657903f55f664c80fb34796172c94d57ebebba71ec9e) instead of git clone, because the sandbox refused writes to the nested .git config/hooks.","instrumentation.patch applied with 'patch -p1' (all 5 files patched cleanly) because 'git apply' inside the enclosing workspace repo skipped every hunk. The patch went in before the first release build, so one build replaced setup's build plus the rebuild; the end state is the same (patched, --release).","Crate wasi-0.11.1+wasi-snapshot-preview1 was unpacked by hand without its .gitmodules file (the sandbox denies writing .gitmodules) and marked .cargo-ok. Cargo still checked the downloaded .crate file's checksum, and .gitmodules is not compiled.","The bundled harness.py defaults to CHUNK=64; every scored run here used harness.run(..., chunk=32) from a wrapper (scratch/exp.py)."],"commands":["curl -L https://github.com/benedictbrady/amm-challenge/archive/6b6921f8d463314aa7c96234e1be25a25245f704.tar.gz | tar -xz --strip-components=1 (into test/scratch/amm-challenge)","decode artifact 206a4888... reusable_sources_bundle -> scratch/{setup.sh,instrumentation.patch,harness.py,tests.py}, contracts/src/{V2.sol,G.sol}; verify sha256","patch -p1 < scratch/instrumentation.patch","sh scratch/setup_macos.sh  (= setup.sh with macOS arm64 uv/rustup; includes maturin develop --release --uv and amm-match validate contracts/src/StarterStrategy.sol)",". scratch/env.sh && python scratch/tests.py",". scratch/env.sh && python scratch/gen_variant.py contracts/src/G.sol F contracts/src/G_F{F}.sol  (F=1,2,4,8); amm-match validate each",". scratch/env.sh && python scratch/test_floor.py",". scratch/env.sh && python scratch/exp.py 30000 30256 V2=contracts/src/V2.sol G=contracts/src/G.sol G_F1=... G_F2=... G_F4=... G_F8=...",". scratch/env.sh && python scratch/analyze.py 30000 30256 scratch/screen.json G=610c1905e7dd G_F1=0cd56aadd321 G_F2=6e2ea893e2cf G_F4=a2565d156166 G_F8=ff6ed49a35d1",". scratch/env.sh && python scratch/exp.py 32000 32512 G_F1=contracts/src/G_F1.sol V2=contracts/src/V2.sol && python scratch/analyze.py 32000 32512 scratch/tuning.json G_F1=0cd56aadd321"],"variant_generator":"\"\"\"Generate G_F<F>.sol from G.sol: floor the lower FINAL fee at F bps (all afterSwap calls),\nbounded above by the unchanged higher fee; ties unchanged; stale/other adjustments kept.\nNew lower = min(max(original lower, F*BPS), higher). Inserted after clampFee, before fees are stored/returned.\"\"\"\nimport hashlib, sys\nsrc_path, F, out_path = sys.argv[1], int(sys.argv[2]), sys.argv[3]\nsrc = open(src_path).read()\nassert hashlib.sha256(src.encode()).hexdigest() == \"610c1905e7dd5559b84e40a3b2d6f8e0b53a7b0ac7574ae33b6c1770a28367cb\"\nanchor_c = \"    uint256 constant TAIL_SLOPE_ATTRACT = 850000000000000000;\\n\"\nanchor_s = \"        slots[0] = bidFee; slots[1] = askFee; slots[2] = (spot << 64) | trade.timestamp;\\n\"\nassert src.count(anchor_c) == 1 and src.count(anchor_s) == 1\nsrc = src.replace(anchor_c, anchor_c + \"    uint256 constant LOW_FEE_FLOOR = %d * BPS;\\n\" % F)\nfloor = (\"        // Floor the lower final fee at LOW_FEE_FLOOR, bounded above by the unchanged higher fee; ties unchanged.\\n\"\n         \"        if (bidFee < askFee) { if (bidFee < LOW_FEE_FLOOR) bidFee = LOW_FEE_FLOOR < askFee ? LOW_FEE_FLOOR : askFee; }\\n\"\n         \"        else if (askFee < bidFee) { if (askFee < LOW_FEE_FLOOR) askFee = LOW_FEE_FLOOR < bidFee ? LOW_FEE_FLOOR : bidFee; }\\n\\n\")\nsrc = src.replace(anchor_s, floor + anchor_s)\nopen(out_path, \"w\").write(src)\nprint(F, out_path, hashlib.sha256(src.encode()).hexdigest())\n","variant_patch_G_to_G_F1":"--- a/contracts/src/G.sol\n+++ b/contracts/src/G_F1.sol\n@@ -44,6 +44,7 @@\n     uint256 constant TAIL_KNEE = 600 * BPS;\n     uint256 constant TAIL_SLOPE_PROTECT = 930000000000000000;\n     uint256 constant TAIL_SLOPE_ATTRACT = 850000000000000000;\n+    uint256 constant LOW_FEE_FLOOR = 1 * BPS;\n \n     function afterInitialize(uint256 initialX, uint256 initialY) external override returns (uint256, uint256) {\n         slots[0] = BASE_FEE; slots[1] = BASE_FEE; slots[3] = WAD; \n@@ -258,6 +259,10 @@\n             bidFee = clampFee(_compressTailWithSlope(bidFee, TAIL_SLOPE_ATTRACT));\n         }\n \n+        // Floor the lower final fee at LOW_FEE_FLOOR, bounded above by the unchanged higher fee; ties unchanged.\n+        if (bidFee < askFee) { if (bidFee < LOW_FEE_FLOOR) bidFee = LOW_FEE_FLOOR < askFee ? LOW_FEE_FLOOR : askFee; }\n+        else if (askFee < bidFee) { if (askFee < LOW_FEE_FLOOR) askFee = LOW_FEE_FLOOR < bidFee ? LOW_FEE_FLOOR : bidFee; }\n+\n         slots[0] = bidFee; slots[1] = askFee; slots[2] = (spot << 64) | trade.timestamp;\n         slots[3] = dirState; slots[4] = actEma; slots[5] = pHat;\n         slots[6] = sigmaHat; slots[7] = lambdaHat; slots[8] = sizeHat;\n","variant_patch_note":"For F in {2,4,8}, the same patch with 'LOW_FEE_FLOOR = 1 * BPS' replaced by 'LOW_FEE_FLOOR = F * BPS' (sha256s under variants). The patch only adds the constant and the two-line floor right before 'slots[0] = bidFee; slots[1] = askFee; ...'; getName is unchanged.","not_measured":["No confirmation run; confirmation is a separate episode (confirmation = null).","No seeds >= 4000000 were used.","No board submission and no board or rank claim.","G was not run on the tuning block; the brief allows only the selected variant there. The G control is from the screen."]}