{
  "schema": "s1-mini-device-gate/1",
  "device": "iPhone 17 Pro (iPhone18,1), A19 Pro",
  "bundle": "s1_mini_decode_int8lin (759 MB, JIT .aimodel, no AOT needed)",
  "app": "ondevice/PipelinedBench, Release, COREAI_CHUNK_THRESHOLD=1, coreai-pipelined",
  "date": "2026-08-25",
  "claim": "device == Mac == fp32 HF, below a hard 1024-token ceiling",
  "numerics": {
    "nat": {
      "case": "323-token dictation transcript -> its 276-token rewrite (599 total)",
      "result": "276/276 PASS, token-identical to the Mac engine, EOS included"
    },
    "oracle": {
      "case": "currency + date normalization (the case int4 corrupted)",
      "result": "27/27 PASS, token-identical to the Mac engine, EOS included"
    }
  },
  "dynamic_kv_g1024_gate": {
    "required_by": "the zoo protocol for every dynamic-KV model (g<=256 cannot see the bug)",
    "result": "PASS — 1024-token generation completes, numerics still exact"
  },
  "ceiling": {
    "finding": "prompt + generated must stay under 1024 tokens on iOS",
    "measurement": {
      "case": "611-token transcript whose Mac rewrite runs 603 tokens (1214 total)",
      "device_generated": 413,
      "device_tokens_matching_mac": 413,
      "wrong_tokens": 0,
      "stopped_at_absolute_position": 1024,
      "reading": "truncation, NOT corruption — every token produced was correct"
    },
    "cause": {
      "verified_in": "coreai-models swift/Sources/CoreAILanguageModels/InferenceEngines/CoreAIPipelinedEngine.swift",
      "mechanism": "#if os(iOS) + GrowingKVCache -> iosDynamicKVCapacityCap = 1024; maxTokens is capped to 1024 - processed - prompt.count, and a prompt that leaves no budget throws contextLengthExceeded",
      "why_it_exists": "the iOS on-device compiler miscompiles growing-KV specializations at seq >= 2048 (apple/coreai-models#124); truncating is the guard working, and it is shipped engine behaviour, not a bench artifact",
      "arithmetic_check": "1024 - 0 - 611 = 413 == the 413 tokens the device produced"
    },
    "product_rule": "S1-mini's card recommends inputs up to ~1000 tokens; on iPhone a ~1000-token prompt leaves almost no room for the rewrite, and a >=1024-token prompt throws. Chunk to roughly <=450-500 input tokens so prompt + rewrite clears the cap.",
    "evidence": {
      "mac_prompt_ids": [
        151644,
        8948,
        198,
        2610,
        525,
        264,
        1467,
        4622,
        3135,
        369,
        8806,
        4686,
        9345,
        60312,
        13,
        576,
        1946,
        12033,
        448,
        264,
        2524,
        1555,
        37838,
        279,
        41328,
        11,
        5944,
        11,
        323,
        2266,
        5003,
        26,
        4240,
        279,
        35715,
        311,
        2432,
        1846,
        5003,
        323,
        2550,
        1172,
        279,
        27722,
        1467,
        13,
        151645,
        198,
        151644,
        872,
        198,
        58,
        623,
        98607,
        25,
        18267,
        8460,
        278,
        60,
        508,
        22952,
        25,
        60701,
        60,
        508,
        1972,
        25,
        4586,
        921,
        704,
        4443,
        16910,
        1077,
        752,
        1101,
        633,
        678,
        315,
        419,
        1495,
        1573,
        600,
        10667,
        432,
        582,
        1030,
        279,
        50434,
        3395,
        419,
        6556,
        323,
        43744,
        1052,
        1033,
        13221,
        2326,
        2513,
        429,
        3697,
        700,
        315,
        432,
        1156,
        279,
        15301,
        5109,
        525,
        3520,
        2664,
        1091,
        582,
        3381,
        1075,
        582,
        7877,
        93835,
        12506,
        304,
        2804,
        2326,
        537,
        81397,
        279,
        78005,
        572,
        43744,
        1378,
        12506,
        429,
        2684,
        32970,
        389,
        18491,
        5923,
        1156,
        4518,
        315,
        83649,
        270,
        2106,
        72,
        769,
        2086,
        3166,
        374,
        279,
        80869,
        4379,
        3937,
        504,
        3040,
        1459,
        1378,
        3266,
        1495,
        311,
        2326,
        1459,
        825,
        3266,
        892,
        374,
        43744,
        279,
        15457,
        432,
        594,
        1012,
        2474,
        582,
        3855,
        14849,
        432,
        304,
        17073,
        17073,
        3040,
        28047,
        1466,
        15482,
        429,
        594,
        1576,
        315,
        279,
        389,
        37569,
        4344,
        582,
        27259,
        304,
        70619,
        323,
        600,
        1744,
        1340,
        594,
        1290,
        4843,
        323,
        419,
        374,
        279,
        825,
        429,
        600,
        1744,
        582,
        1184,
        311,
        3520,
        3061,
        911,
        374,
        43744,
        23134,
        582,
        8039,
        291,
        369,
        4743,
        24198,
        419,
        4279,
        323,
        582,
        3003,
        21446,
        1378,
        279,
        15301,
        374,
        15430,
        600,
        1744,
        582,
        3003,
        2684,
        7196,
        3040,
        11178,
        518,
        1590,
        6430,
        323,
        1378,
        315,
        1105,
        582,
        2299,
        4658,
        2087,
        311,
        9052,
        311,
        11243,
        6081,
        773,
        4443,
        847,
        1349,
        374,
        582,
        1265,
        2987,
        4828,
        279,
        20892,
        476,
        582,
        1265,
        4193,
        429,
        582,
        2299,
        2087,
        311,
        387,
        518,
        3040,
        537,
        4743,
        323,
        421,
        582,
        2299,
        518,
        3040,
        1221,
        279,
        68817,
        3880,
        311,
        2297,
        1576,
        279,
        6371,
        975,
        19110,
        4236,
        1251,
        8028,
        14019,
        1083,
        600,
        1184,
        311,
        1795,
        705,
        448,
        5777,
        911,
        279,
        20728,
        5116,
        279,
        825,
        429,
        27902,
        389,
        15217,
        26127,
        1156,
        17073,
        17073,
        4743,
        807,
        4829,
        311,
        1414,
        421,
        582,
        2299,
        13873,
        287,
        518,
        279,
        1852,
        25996,
        892,
        374,
        43744,
        29235,
        16183,
        3040,
        7739,
        11192,
        264,
        1042,
        476,
        421,
        582,
        2299,
        2087,
        705,
        311,
        279,
        20179,
        25996,
        892,
        374,
        26127,
        825,
        16183,
        4236,
        7739,
        847,
        30555,
        374,
        4717,
        1380,
        582,
        525,
        369,
        2441,
        1042,
        323,
        64778,
        432,
        3055,
        582,
        1414,
        279,
        1968,
        1830,
        6534,
        4443,
        1128,
        770,
        14019,
        21639,
        279,
        10455,
        504,
        1537,
        259,
        7047,
        582,
        5558,
        911,
        35398,
        4236,
        4420,
        315,
        13914,
        389,
        279,
        6028,
        323,
        43744,
        279,
        1736,
        92611,
        336,
        374,
        4152,
        79313,
        600,
        1053,
        600,
        4172,
        3270,
        279,
        24808,
        3772,
        773,
        600,
        1184,
        311,
        3520,
        653,
        429,
        279,
        3704,
        5240,
        572,
        264,
        2193,
        2297,
        429,
        3937,
        700,
        2041,
        279,
        13475,
        3395,
        323,
        279,
        5046,
        374,
        43744,
        582,
        2299,
        7842,
        264,
        2567,
        2984,
        423,
        389,
        429,
        15867,
        892,
        1265,
        614,
        1012,
        1052,
        2669,
        26044,
        1077,
        752,
        1083,
        6099,
        311,
        3624,
        279,
        9530,
        311,
        3594,
        56340,
        1573,
        279,
        4479,
        6438,
        389,
        279,
        10510,
        44607,
        566,
        4829,
        432,
        43744,
        35398,
        8063,
        4115,
        8305,
        773,
        429,
        3363,
        279,
        42541,
        835,
        315,
        1899,
        323,
        279,
        5109,
        304,
        432,
        1184,
        311,
        2432,
        1128,
        17017,
        4652,
        389,
        279,
        30387,
        537,
        279,
        9960,
        504,
        279,
        2086,
        600,
        1744,
        429,
        594,
        4297,
        4443,
        14019,
        902,
        3783,
        825,
        803,
        3166,
        279,
        6002,
        304,
        44581,
        4588,
        911,
        821,
        52866,
        1549,
        807,
        1366,
        19539,
        304,
        4378,
        429,
        4302,
        10901,
        279,
        15555,
        323,
        1290,
        1431,
        600,
        646,
        944,
        2968,
        1105,
        429,
        1576,
        315,
        279,
        27875,
        20728,
        773,
        2987,
        582,
        3271,
        429,
        20728,
        311,
        458,
        15555,
        5537,
        476,
        582,
        79637,
        1105,
        700,
        369,
        429,
        2692,
        600,
        3278,
        2548,
        279,
        5339,
        2083,
        1128,
        279,
        11893,
        374,
        389,
        279,
        15555,
        5537,
        2999,
        151645,
        198,
        151644,
        77091,
        198,
        151667,
        271,
        151668,
        271
      ],
      "mac_gen_ids": [
        32313,
        11,
        1077,
        752,
        1101,
        633,
        678,
        315,
        419,
        1495,
        1573,
        358,
        10667,
        432,
        13,
        1205,
        1030,
        279,
        50434,
        3395,
        419,
        6556,
        11,
        323,
        1052,
        1033,
        13221,
        2326,
        2513,
        429,
        3697,
        700,
        315,
        432,
        382,
        5338,
        11,
        279,
        15301,
        5109,
        525,
        3520,
        2664,
        1091,
        582,
        3381,
        13,
        1205,
        7877,
        220,
        16,
        24,
        12506,
        304,
        1207,
        18,
        11,
        537,
        220,
        16,
        22,
        13,
        576,
        78005,
        572,
        1378,
        12506,
        429,
        2684,
        32970,
        389,
        6527,
        220,
        16,
        4518,
        315,
        6122,
        220,
        18,
        15,
        382,
        15666,
        11,
        279,
        80869,
        4379,
        3937,
        504,
        220,
        19,
        13,
        17,
        4,
        1495,
        311,
        220,
        18,
        13,
        16,
        13384,
        892,
        374,
        279,
        15457,
        432,
        594,
        1012,
        2474,
        582,
        3855,
        14849,
        432,
        304,
        220,
        17,
        15,
        17,
        19,
        13,
        20445,
        15482,
        429,
        594,
        1576,
        315,
        279,
        389,
        37569,
        4344,
        582,
        27259,
        304,
        6156,
        11,
        323,
        358,
        1744,
        1340,
        594,
        1290,
        382,
        36975,
        11,
        419,
        374,
        279,
        825,
        429,
        358,
        1744,
        582,
        1184,
        311,
        3520,
        3061,
        911,
        25,
        23134,
        13,
        1205,
        8039,
        291,
        369,
        4743,
        24198,
        419,
        4279,
        11,
        323,
        582,
        3003,
        21446,
        1378,
        13,
        576,
        15301,
        374,
        15430,
        13,
        358,
        1744,
        582,
        3003,
        2684,
        7196,
        3040,
        11178,
        518,
        1590,
        6430,
        11,
        323,
        1378,
        315,
        1105,
        582,
        2299,
        4658,
        2087,
        311,
        9052,
        311,
        11243,
        6081,
        382,
        4416,
        847,
        1349,
        374,
        582,
        1265,
        2987,
        4828,
        279,
        20892,
        476,
        582,
        1265,
        4193,
        429,
        582,
        2299,
        2087,
        311,
        387,
        518,
        220,
        19,
        11,
        537,
        220,
        21,
        13,
        1597,
        421,
        582,
        2299,
        518,
        220,
        19,
        11,
        1221,
        279,
        68817,
        3880,
        311,
        2297,
        11,
        1576,
        279,
        6371,
        975,
        19110,
        220,
        20,
        1251,
        8028,
        382,
        11908,
        11,
        1083,
        11,
        358,
        1184,
        311,
        1795,
        705,
        448,
        5777,
        911,
        279,
        20728,
        5116,
        11,
        279,
        825,
        429,
        27902,
        389,
        5470,
        220,
        18,
        16,
        11,
        220,
        17,
        15,
        17,
        21,
        13,
        2379,
        4829,
        311,
        1414,
        421,
        582,
        2299,
        13873,
        287,
        518,
        279,
        1852,
        25996,
        11,
        892,
        374,
        400,
        16,
        17,
        11,
        19,
        15,
        15,
        264,
        1042,
        11,
        476,
        421,
        582,
        2299,
        2087,
        705,
        311,
        279,
        20179,
        25996,
        11,
        892,
        374,
        400,
        18,
        16,
        11,
        20,
        15,
        15,
        13,
        3017,
        30555,
        374,
        4717,
        1380,
        582,
        525,
        369,
        2441,
        1042,
        323,
        64778,
        432,
        3055,
        582,
        1414,
        279,
        1968,
        1830,
        6534,
        382,
        3838,
        770,
        30,
        8670,
        21639,
        11,
        279,
        10455,
        504,
        1537,
        7589,
        11,
        582,
        5558,
        911,
        220,
        19,
        20,
        4420,
        315,
        13914,
        389,
        279,
        6028,
        11,
        323,
        279,
        1736,
        92611,
        336,
        374,
        4152,
        6602,
        13,
        358,
        1053,
        358,
        4172,
        3270,
        279,
        24808,
        3772,
        11,
        773,
        358,
        1184,
        311,
        3520,
        653,
        429,
        13,
        576,
        3704,
        5240,
        572,
        264,
        2193,
        2297,
        429,
        3937,
        700,
        2041,
        279,
        13475,
        3395,
        11,
        323,
        279,
        5046,
        374,
        582,
        2299,
        7842,
        264,
        2567,
        2984,
        423,
        389,
        429,
        15867,
        11,
        892,
        1265,
        614,
        1012,
        1052,
        2669,
        13,
        70947,
        11,
        1077,
        752,
        1083,
        6099,
        311,
        3624,
        279,
        9530,
        311,
        35683,
        1573,
        279,
        4479,
        6438,
        389,
        279,
        220,
        16,
        16,
        339,
        13,
        1260,
        4829,
        432,
        220,
        19,
        23,
        4115,
        8305,
        11,
        773,
        429,
        3363,
        279,
        220,
        24,
        339,
        835,
        315,
        1899,
        11,
        323,
        279,
        5109,
        304,
        432,
        1184,
        311,
        2432,
        1128,
        17017,
        4652,
        389,
        279,
        220,
        22,
        339,
        11,
        537,
        279,
        9960,
        504,
        279,
        220,
        17,
        303,
        382,
        40,
        1744,
        429,
        594,
        4297,
        13,
        8670,
        902,
        11,
        3783,
        11,
        825,
        803,
        3166,
        13,
        576,
        6002,
        304,
        19846,
        4588,
        911,
        821,
        52866,
        1549,
        13,
        2379,
        1366,
        19539,
        304,
        4378,
        429,
        4302,
        10901,
        279,
        9812,
        11,
        323,
        1290,
        1431,
        358,
        646,
        944,
        2968,
        1105,
        429,
        1576,
        315,
        279,
        27875,
        20728,
        13,
        2055,
        2987,
        582,
        3271,
        429,
        20728,
        311,
        458,
        9812,
        5537,
        11,
        476,
        582,
        79637,
        1105,
        700,
        369,
        429,
        2692,
        13,
        358,
        3278,
        2548,
        279,
        5339,
        2083,
        1128,
        279,
        11893,
        374,
        389,
        279,
        9812,
        5537,
        2999,
        13,
        151645
      ],
      "device_gen_ids": [
        32313,
        11,
        1077,
        752,
        1101,
        633,
        678,
        315,
        419,
        1495,
        1573,
        358,
        10667,
        432,
        13,
        1205,
        1030,
        279,
        50434,
        3395,
        419,
        6556,
        11,
        323,
        1052,
        1033,
        13221,
        2326,
        2513,
        429,
        3697,
        700,
        315,
        432,
        382,
        5338,
        11,
        279,
        15301,
        5109,
        525,
        3520,
        2664,
        1091,
        582,
        3381,
        13,
        1205,
        7877,
        220,
        16,
        24,
        12506,
        304,
        1207,
        18,
        11,
        537,
        220,
        16,
        22,
        13,
        576,
        78005,
        572,
        1378,
        12506,
        429,
        2684,
        32970,
        389,
        6527,
        220,
        16,
        4518,
        315,
        6122,
        220,
        18,
        15,
        382,
        15666,
        11,
        279,
        80869,
        4379,
        3937,
        504,
        220,
        19,
        13,
        17,
        4,
        1495,
        311,
        220,
        18,
        13,
        16,
        13384,
        892,
        374,
        279,
        15457,
        432,
        594,
        1012,
        2474,
        582,
        3855,
        14849,
        432,
        304,
        220,
        17,
        15,
        17,
        19,
        13,
        20445,
        15482,
        429,
        594,
        1576,
        315,
        279,
        389,
        37569,
        4344,
        582,
        27259,
        304,
        6156,
        11,
        323,
        358,
        1744,
        1340,
        594,
        1290,
        382,
        36975,
        11,
        419,
        374,
        279,
        825,
        429,
        358,
        1744,
        582,
        1184,
        311,
        3520,
        3061,
        911,
        25,
        23134,
        13,
        1205,
        8039,
        291,
        369,
        4743,
        24198,
        419,
        4279,
        11,
        323,
        582,
        3003,
        21446,
        1378,
        13,
        576,
        15301,
        374,
        15430,
        13,
        358,
        1744,
        582,
        3003,
        2684,
        7196,
        3040,
        11178,
        518,
        1590,
        6430,
        11,
        323,
        1378,
        315,
        1105,
        582,
        2299,
        4658,
        2087,
        311,
        9052,
        311,
        11243,
        6081,
        382,
        4416,
        847,
        1349,
        374,
        582,
        1265,
        2987,
        4828,
        279,
        20892,
        476,
        582,
        1265,
        4193,
        429,
        582,
        2299,
        2087,
        311,
        387,
        518,
        220,
        19,
        11,
        537,
        220,
        21,
        13,
        1597,
        421,
        582,
        2299,
        518,
        220,
        19,
        11,
        1221,
        279,
        68817,
        3880,
        311,
        2297,
        11,
        1576,
        279,
        6371,
        975,
        19110,
        220,
        20,
        1251,
        8028,
        382,
        11908,
        11,
        1083,
        11,
        358,
        1184,
        311,
        1795,
        705,
        448,
        5777,
        911,
        279,
        20728,
        5116,
        11,
        279,
        825,
        429,
        27902,
        389,
        5470,
        220,
        18,
        16,
        11,
        220,
        17,
        15,
        17,
        21,
        13,
        2379,
        4829,
        311,
        1414,
        421,
        582,
        2299,
        13873,
        287,
        518,
        279,
        1852,
        25996,
        11,
        892,
        374,
        400,
        16,
        17,
        11,
        19,
        15,
        15,
        264,
        1042,
        11,
        476,
        421,
        582,
        2299,
        2087,
        705,
        311,
        279,
        20179,
        25996,
        11,
        892,
        374,
        400,
        18,
        16,
        11,
        20,
        15,
        15,
        13,
        3017,
        30555,
        374,
        4717,
        1380,
        582,
        525,
        369,
        2441,
        1042,
        323,
        64778,
        432,
        3055,
        582,
        1414,
        279,
        1968,
        1830,
        6534,
        382,
        3838,
        770,
        30,
        8670,
        21639,
        11,
        279,
        10455,
        504,
        1537,
        7589,
        11,
        582,
        5558,
        911,
        220,
        19,
        20,
        4420,
        315,
        13914,
        389,
        279,
        6028,
        11,
        323,
        279,
        1736,
        92611,
        336,
        374,
        4152,
        6602,
        13,
        358,
        1053,
        358,
        4172,
        3270,
        279,
        24808,
        3772,
        11,
        773,
        358,
        1184,
        311,
        3520,
        653,
        429,
        13,
        576,
        3704,
        5240,
        572
      ],
      "device_is_exact_prefix_of_mac": true,
      "recheck": "device_gen_ids must equal mac_gen_ids[:len(device_gen_ids)] and len(mac_prompt_ids) + len(device_gen_ids) must equal 1024"
    }
  },
  "speed": {
    "settled": {
      "prefill_tok_s": 69.0,
      "decode_tok_s": 62.4,
      "protocol": "p=128 g=256, n=3, cold device, PipelinedBench Release",
      "run": "s1mini_cool.log"
    },
    "reproduced_by": {
      "prefill_tok_s": 71.3,
      "decode_tok_s": 64.7,
      "protocol": "p=128 g=256, n=2, first run of the session",
      "run": "s1mini_r1.log"
    },
    "thermal_envelope": {
      "sustained_tok_s": {
        "prefill": 34.9,
        "decode": 30.5
      },
      "note": "after back-to-back 1024-token generations the same bundle measured 34.9/30.5 (s1mini_speed.log) — roughly half. Seven minutes idle restored 69.0/62.4, so it is thermal, not a regression. Published number is the cold one because that is the protocol every other card uses; the sustained number is recorded because a dictation post-processor runs repeatedly and will meet it."
    }
  },
  "raw_runs": {
    "note": "the probe logs themselves are *.log and the repo gitignores those, so the lines that carry the verdict are transcribed here instead of linked",
    "runs": {
      "s1mini_cool": [
        "engine ready in 1.0 s",
        "NUMERICS nat=276/276 PASS",
        "NUMERICS oracle=27/27 PASS",
        "TRIAL 1 (p=128 g=256) prefill=70.9 decode=64.5 tok/s",
        "TRIAL 2 (p=128 g=256) prefill=68.6 decode=62.2 tok/s",
        "TRIAL 3 (p=128 g=256) prefill=67.5 decode=60.5 tok/s",
        "STATS prefill=69.0 decode=62.4 nat=276/276 oracle=27/27"
      ],
      "s1mini_final": [
        "engine ready in 0.2 s",
        "NUMERICS nat=276/276 PASS",
        "NUMERICS oracle=27/27 PASS",
        "TRIAL 1 (p=128 g=1024) prefill=71.7 decode=61.2 tok/s",
        "TRIAL 2 (p=128 g=1024) prefill=65.6 decode=49.7 tok/s",
        "STATS prefill=68.6 decode=55.4 nat=276/276 oracle=27/27"
      ],
      "s1mini_g1024": [
        "engine ready in 0.2 s",
        "NUMERICS nat=11/11 PASS",
        "NUMERICS oracle=27/27 PASS",
        "TRIAL 1 (p=128 g=1024) prefill=72.9 decode=60.3 tok/s",
        "STATS prefill=72.9 decode=60.3 nat=11/11 oracle=27/27"
      ],
      "s1mini_long": [
        "engine ready in 0.8 s",
        "NUMERICS nat=413/603 MISMATCH",
        "NUMERICS oracle=27/27 PASS",
        "TRIAL 1 (p=128 g=1024) prefill=69.9 decode=59.9 tok/s",
        "STATS prefill=69.9 decode=59.9 nat=413/603 oracle=27/27"
      ],
      "s1mini_r1": [
        "engine ready in 4.7 s",
        "NUMERICS nat=11/11 PASS",
        "NUMERICS oracle=27/27 PASS",
        "TRIAL 1 (p=128 g=256) prefill=71.2 decode=64.8 tok/s",
        "TRIAL 2 (p=128 g=256) prefill=71.3 decode=64.6 tok/s",
        "STATS prefill=71.3 decode=64.7 nat=11/11 oracle=27/27"
      ],
      "s1mini_speed": [
        "engine ready in 0.2 s",
        "NUMERICS nat=276/276 PASS",
        "NUMERICS oracle=27/27 PASS",
        "TRIAL 1 (p=128 g=256) prefill=39.8 decode=32.3 tok/s",
        "TRIAL 2 (p=128 g=256) prefill=35.0 decode=29.5 tok/s",
        "TRIAL 3 (p=128 g=256) prefill=29.9 decode=29.8 tok/s",
        "STATS prefill=34.9 decode=30.5 nat=276/276 oracle=27/27"
      ]
    }
  }
}
