Skip to content

fix: use average O(1) ordinary-record key lookup - #9

Merged
goblinmode2700 merged 9 commits into
mainfrom
release/0.3.0b3-public
Aug 13, 2026
Merged

goblinmode2700 merged 9 commits into
mainfrom
release/0.3.0b3-public

Conversation

@goblinmode2700

Copy link
Copy Markdown
Owner

Intent

Release msgspec-toon 0.3.0b3 from a branch based on public origin/main. Fix issue 11 by making ordinary-record key lookup average O(1) in distinct-key count without changing canonical bytes or weakening conformance, G2, G3, G5, or payload-safe errors. Keep the permanent 32-key and 512-key ten-worker A/B guard, publish the full fixed-size 4-to-1024-key curve and exact source-bound evidence, preserve the lazy cache layout that avoids typed-path regressions, include the public benchmark module required by ab.py, and open a reviewable PR. Do not include private development files or unrelated user changes. Do not tag or publish PyPI until PR CI and the verified wheel workflow are green.

What Changed

  • Replace linear ordinary-record key-cache scans with lazy, decoder-local content hash lookups while preserving the typed decoder layout.
  • Add the fixed-size 4–1,024 distinct-key benchmark curve, public benchmark modules, and permanent ten-worker A/B guards at 32 and 512 keys.
  • Bump msgspec-toon to 0.3.0b3 and refresh the changelog, conformance report, benchmark evidence, assets, and documentation.

Risk Assessment

🚨 High: The implementation appears sound, but a required release-performance guard is not executed with the explicitly required worker count.

Testing

On Python 3.13.1, focused behavioral and release tests plus the pinned conformance corpus succeeded; live ten-worker and same-session A/B artifacts demonstrate average-O(1)-style cardinality scaling while G2, G3, G5, canonical bytes, safe errors, and publication controls remain satisfied. An initial default-Python setup was superseded by the complete release-Python rerun, and all temporary worktree artifacts were cleaned.

Evidence: 10-worker 4–1,024-key cardinality curve
{
  "records": 4096,
  "distinct_key_counts": [
    4,
    8,
    16,
    32,
    64,
    128,
    256,
    512,
    1024
  ],
  "wire_bytes": {
    "distinct_keys_4": 117681,
    "distinct_keys_8": 117681,
    "distinct_keys_16": 117681,
    "distinct_keys_32": 117681,
    "distinct_keys_64": 117681,
    "distinct_keys_128": 117681,
    "distinct_keys_256": 117681,
    "distinct_keys_512": 117681,
    "distinct_keys_1024": 117681
  },
  "decode_us": {
    "distinct_keys_4": 662.3,
    "distinct_keys_8": 665.3,
    "distinct_keys_16": 663.16,
    "distinct_keys_32": 661.47,
    "distinct_keys_64": 668.74,
    "distinct_keys_128": 675.1,
    "distinct_keys_256": 679.37,
    "distinct_keys_512": 697.89,
    "distinct_keys_1024": 726.9
  },
  "worker_observations": [
    {
      "records": 4096,
      "distinct_key_counts": [
        4,
        8,
        16,
        32,
        64,
        128,
        256,
        512,
        1024
      ],
      "wire_bytes": {
        "distinct_keys_4": 117681,
        "distinct_keys_8": 117681,
        "distinct_keys_16": 117681,
        "distinct_keys_32": 117681,
        "distinct_keys_64": 117681,
        "distinct_keys_128": 117681,
        "distinct_keys_256": 117681,
        "distinct_keys_512": 117681,
        "distinct_keys_1024": 117681
      },
      "decode_us": {
        "distinct_keys_4": 656.92,
        "distinct_keys_8": 671.5,
        "distinct_keys_16": 674.58,
        "distinct_keys_32": 675.05,
        "distinct_keys_64": 656.39,
        "distinct_keys_128": 666.4,
        "distinct_keys_256": 675.61,
        "distinct_keys_512": 730.88,
        "distinct_keys_1024": 726.84
      }
    },
    {
      "records": 4096,
      "distinct_key_counts": [
        4,
        8,
        16,
        32,
        64,
        128,
        256,
        512,
        1024
      ],
      "wire_bytes": {
        "distinct_keys_4": 117681,
        "distinct_keys_8": 117681,
        "distinct_keys_16": 117681,
        "distinct_keys_32": 117681,
        "distinct_keys_64": 117681,
        "distinct_keys_128": 117681,
        "distinct_keys_256": 117681,
        "distinct_keys_512": 117681,
        "distinct_keys_1024": 117681
      },
      "decode_us": {
        "distinct_keys_4": 682.39,
        "distinct_keys_8": 678.82,
        "distinct_keys_16": 670.33,
        "distinct_keys_32": 658.02,
        "distinct_keys_64": 702.84,
        "distinct_keys_128": 663.77,
        "distinct_keys_256": 671.54,
        "distinct_keys_512": 689.53,
        "distinct_keys_1024": 716.23
      }
    },
    {
      "records": 4096,
      "distinct_key_counts": [
        4,
        8,
        16,
        32,
        64,
        128,
        256,
        512,
        1024
      ],
      "wire_bytes": {
        "distinct_keys_4": 117681,
        "distinct_keys_8": 117681,
        "distinct_keys_16": 117681,
        "distinct_keys_32": 117681,
        "distinct_keys_64": 117681,
        "distinct_keys_128": 117681,
        "distinct_keys_256": 117681,
        "distinct_keys_512": 117681,
        "distinct_keys_1024": 117681
      },
      "decode_us": {
        "distinct_keys_4": 651.21,
        "distinct_keys_8": 650.85,
        "distinct_keys_16": 653.22,
        "distinct_keys_32": 643.77,
        "distinct_keys_64": 652.31,
        "distinct_keys_128": 668.0,
        "distinct_keys_256": 661.33,
        "distinct_keys_512": 695.81,
        "distinct_keys_1024": 721.09
      }
    },
    {
      "records": 4096,
      "distinct_key_counts": [
        4,
        8,
        16,
        32,
        64,
        128,
        256,
        512,
        1024
      ],
      "wire_bytes": {
        "distinct_keys_4": 117681,
        "distinct_keys_8": 117681,
        "distinct_keys_16": 117681,
        "distinct_keys_32": 117681,
        "distinct_keys_64": 117681,
        "distinct_keys_128": 117681,
        "distinct_keys_256": 117681,
        "distinct_keys_512": 117681,
        "distinct_keys_1024": 117681
      },
      "decode_us": {
        "distinct_keys_4": 692.82,
        "distinct_keys_8": 679.2,
        "distinct_keys_16": 685.0,
        "distinct_keys_32": 687.98,
        "distinct_keys_64": 692.59,
        "distinct_keys_128": 698.92,
        "distinct_keys_256": 707.91,
        "distinct_keys_512": 732.61,
        "distinct_keys_1024": 776.35
      }
    },
    {
      "records": 4096,
      "distinct_key_counts": [
        4,
        8,
        16,
        32,
        64,
        128,
        256,
        512,
        1024
      ],
      "wire_bytes": {
        "distinct_keys_4": 117681,
        "distinct_keys_8": 117681,
        "distinct_keys_16": 117681,
        "distinct_keys_32": 117681,
        "distinct_keys_64": 117681,
        "distinct_keys_128": 117681,
        "distinct_keys_256": 117681,
        "distinct_keys_512": 117681,
        "distinct_keys_1024": 117681
      },
      "decode_us": {
        "distinct_keys_4": 648.44,
        "distinct_keys_8": 684.62,
        "distinct_keys_16": 665.94,
        "distinct_keys_32": 660.44,
        "distinct_keys_64": 665.7,
        "distinct_keys_128": 674.23,
        "distinct_keys_256": 676.32,
        "distinct_keys_512": 688.59,
        "distinct_keys_1024": 722.5
      }
    },
    {
      "records": 4096,
      "distinct_key_counts": [
        4,
        8,
        16,
        32,
        64,
        128,
        256,
        512,
        1024
      ],
      "wire_bytes": {
        "distinct_keys_4": 117681,
        "distinct_keys_8": 117681,
        "distinct_keys_16": 117681,
        "distinct_keys_32": 117681,
        "distinct_keys_64": 117681,
        "distinct_keys_128": 117681,
        "distinct_keys_256": 117681,
        "distinct_keys_512": 117681,
        "distinct_keys_1024": 117681
      },
      "decode_us": {
        "distinct_keys_4": 645.42,
        "distinct_keys_8": 646.17,
        "distinct_keys_16": 646.17,
        "distinct_keys_32": 655.36,
        "distinct_keys_64": 663.04,
        "distinct_keys_128": 667.54,
        "distinct_keys_256": 673.44,
        "distinct_keys_512": 686.19,
        "distinct_keys_1024": 723.59
      }
    },
    {
      "records": 4096,
      "distinct_key_counts": [
        4,
        8,
        16,
        32,
        64,
        128,
        256,
        512,
        1024
      ],
      "wire_bytes": {
        "distinct_keys_4": 117681,
        "distinct_keys_8": 117681,
        "distinct_keys_16": 117681,
        "distinct_keys_32": 117681,
        "distinct_keys_64": 117681,
        "distinct_keys_128": 117681,
        "distinct_keys_256": 117681,
        "distinct_keys_512": 117681,
        "distinct_keys_1024": 117681
      },
      "decode_us": {
        "distinct_keys_4": 661.91,
        "distinct_keys_8": 651.85,
        "distinct_keys_16": 652.81,
        "distinct_keys_32": 660.43,
        "distinct_keys_64": 665.45,
        "distinct_keys_128": 664.52,
        "distinct_keys_256": 674.81,
        "distinct_keys_512": 688.87,
        "distinct_keys_1024": 716.47
      }
    },
    {
      "records": 4096,
      "distinct_key_counts": [
        4,
        8,
        16,
        32,
        64,
        128,
        256,
        512,
        1024
      ],
      "wire_bytes": {
        "distinct_keys_4": 117681,
        "distinct_keys_8": 117681,
        "distinct_keys_16": 117681,
        "distinct_keys_32": 117681,
        "distinct_keys_64": 117681,
        "distinct_keys_128": 117681,
        "distinct_keys_256": 117681,
        "distinct_keys_512": 117681,
        "distinct_keys_1024": 117681
      },
      "decode_us": {
        "distinct_keys_4": 645.88,
        "distinct_keys_8": 657.74,
        "distinct_keys_16": 646.43,
        "distinct_keys_32": 653.66,
        "distinct_keys_64": 657.86,
        "distinct_keys_128": 682.06,
        "distinct_keys_256": 700.35,
        "distinct_keys_512": 698.82,
        "distinct_keys_1024": 721.34
      }
    },
    {
      "records": 4096,
      "distinct_key_counts": [
        4,
        8,
        16,
        32,
        64,
        128,
        256,
        512,
        1024
      ],
      "wire_bytes": {
        "distinct_keys_4": 117681,
        "distinct_keys_8": 117681,
        "distinct_keys_16": 117681,
        "distinct_keys_32": 117681,
        "distinct_keys_64": 117681,
        "distinct_keys_128": 117681,
        "distinct_keys_256": 117681,
        "distinct_keys_512": 117681,
        "distinct_keys_1024": 117681
      },
      "decode_us": {
        "distinct_keys_4": 681.01,
        "distinct_keys_8": 675.2,
        "distinct_keys_16": 675.99,
        "distinct_keys_32": 663.11,
        "distinct_keys_64": 668.19,
        "distinct_keys_128": 698.11,
        "distinct_keys_256": 677.25,
        "distinct_keys_512": 682.65,
        "distinct_keys_1024": 722.21
      }
    },
    {
      "records": 4096,
      "distinct_key_counts": [
        4,
        8,
        16,
        32,
        64,
        128,
        256,
        512,
        1024
      ],
      "wire_bytes": {
        "distinct_keys_4": 117681,
        "distinct_keys_8": 117681,
        "distinct_keys_16": 117681,
        "distinct_keys_32": 117681,
        "distinct_keys_64": 117681,
        "distinct_keys_128": 117681,
        "distinct_keys_256": 117681,
        "distinct_keys_512": 117681,
        "distinct_keys_1024": 117681
      },
      "decode_us": {
        "distinct_keys_4": 657.02,
        "distinct_keys_8": 657.02,
        "distinct_keys_16": 661.18,
        "distinct_keys_32": 656.92,
        "distinct_keys_64": 663.01,
        "distinct_keys_128": 667.45,
        "distinct_keys_256": 675.14,
        "distinct_keys_512": 685.0,
        "distinct_keys_1024": 722.34
      }
    }
  ],
  "relative_to_smallest": {
    "distinct_keys_4": 1.0,
    "distinct_keys_8": 1.005,
    "distinct_keys_16": 1.001,
    "distinct_keys_32": 0.999,
    "distinct_keys_64": 1.01,
    "distinct_keys_128": 1.019,
    "distinct_keys_256": 1.026,
    "distinct_keys_512": 1.054,
    "distinct_keys_1024": 1.098
  },
  "wire_relative_to_smallest": {
    "distinct_keys_4": 1.0,
    "distinct_keys_8": 1.0,
    "distinct_keys_16": 1.0,
    "distinct_keys_32": 1.0,
    "distinct_keys_64": 1.0,
    "distinct_keys_128": 1.0,
    "distinct_keys_256": 1.0,
    "distinct_keys_512": 1.0,
    "distinct_keys_1024": 1.0
  },
  "worker_spread_pct": {
    "decode_us.distinct_keys_4": 2.57,
    "decode_us.distinct_keys_8": 2.11,
    "decode_us.distinct_keys_16": 2.02,
    "decode_us.distinct_keys_32": 1.84,
    "decode_us.distinct_keys_64": 2.42,
    "decode_us.distinct_keys_128": 1.99,
    "decode_us.distinct_keys_256": 2.05,
    "decode_us.distinct_keys_512": 2.65,
    "decode_us.distinct_keys_1024": 2.43
  },
  "cache_policy": "decoder-local content cache; average O(1) hash lookup; unbounded only for one decode call"
}
Evidence: 32-key base-versus-target A/B
{
  "records": [
    4,
    8,
    16,
    64,
    512,
    4096
  ],
  "baseline_venv": ".venv-base",
  "current_venv": ".venv",
  "gated": true,
  "block_sequence": [
    "baseline",
    "current",
    "current",
    "baseline",
    "baseline",
    "current",
    "current",
    "baseline",
    "baseline",
    "current",
    "current",
    "baseline",
    "baseline",
    "current",
    "current",
    "baseline"
  ],
  "baseline_instrumented": false,
  "canary": {
    "metric": "untyped distinct-32-key decode@4096",
    "reads_us": [
      1029.09,
      1033.97,
      1050.74
    ],
    "spread_pct": 2.103800445053406,
    "note": "one fixed metric read on the baseline side before, between, and after the interleaved rounds; reported context only, never a gate"
  },
  "method": "one metric at one size per block, B C C B interleaved across all metric points \u2014 every block-position runs across the whole ladder before the next, so each metric's samples span the full run and slow drift inflates variance (reported as MDE) instead of biasing means; loop counts calibrated once per point up front and shared by both sides; two-sample two-tailed t-test at alpha 0.95; a change smaller than the reported minimum detectable effect is published as no significant difference; a slowdown must reproduce in an independent solo confirmation run at double the block count to fail the gate",
  "results": [
    {
      "metric": "untyped distinct-32-key decode@4096",
      "baseline_us": [
        1042.81,
        1030.38,
        1115.2,
        1038.58,
        1055.4,
        1045.89,
        1035.06,
        1039.78
      ],
      "current_us": [
        650.78,
        653.52,
        661.42,
        667.05,
        676.19,
        656.81,
        648.2,
        661.17
      ],
      "verdict": "faster",
      "confirmation": null,
      "gating": true,
      "non_gating_reason": null,
      "change_pct": -37.22388166271972,
      "significant": true,
      "minimum_detectable_effect_pct": 2.07453174043226
    }
  ]
}
Evidence: 512-key base-versus-target A/B
{
  "records": [
    4,
    8,
    16,
    64,
    512,
    4096
  ],
  "baseline_venv": ".venv-base",
  "current_venv": ".venv",
  "gated": true,
  "block_sequence": [
    "baseline",
    "current",
    "current",
    "baseline",
    "baseline",
    "current",
    "current",
    "baseline",
    "baseline",
    "current",
    "current",
    "baseline",
    "baseline",
    "current",
    "current",
    "baseline"
  ],
  "baseline_instrumented": false,
  "canary": {
    "metric": "untyped distinct-512-key decode@4096",
    "reads_us": [
      5711.55,
      5693.39,
      5651.22
    ],
    "spread_pct": 1.0675570938664558,
    "note": "one fixed metric read on the baseline side before, between, and after the interleaved rounds; reported context only, never a gate"
  },
  "method": "one metric at one size per block, B C C B interleaved across all metric points \u2014 every block-position runs across the whole ladder before the next, so each metric's samples span the full run and slow drift inflates variance (reported as MDE) instead of biasing means; loop counts calibrated once per point up front and shared by both sides; two-sample two-tailed t-test at alpha 0.95; a change smaller than the reported minimum detectable effect is published as no significant difference; a slowdown must reproduce in an independent solo confirmation run at double the block count to fail the gate",
  "results": [
    {
      "metric": "untyped distinct-512-key decode@4096",
      "baseline_us": [
        5667.22,
        5676.47,
        5694.49,
        5710.04,
        5687.87,
        5659.58,
        5677.94,
        5782.0
      ],
      "current_us": [
        702.24,
        689.51,
        702.65,
        672.98,
        685.37,
        693.6,
        741.93,
        687.69
      ],
      "verdict": "faster",
      "confirmation": null,
      "gating": true,
      "non_gating_reason": null,
      "change_pct": -87.76008048185503,
      "significant": true,
      "minimum_detectable_effect_pct": 0.583754486623798
    }
  ]
}
Evidence: G2 allocation proof
{
  "payload_records": 64,
  "build": "alloc-stats (instrumented; never the benchmarked wheel)",
  "counter_semantics": {
    "builtin_dicts": "dict built by the untyped builder",
    "builtin_lists": "list built by the untyped builder",
    "final_lists": "list or tuple the target type declared",
    "final_dicts": "dict the target type declared",
    "final_structs": "Struct instance constructed by the typed consumer"
  },
  "typed": {
    "builtin_dicts": 0,
    "builtin_lists": 0,
    "final_lists": 1,
    "final_dicts": 0,
    "final_structs": 129
  },
  "wrapper": {
    "builtin_dicts": 129,
    "builtin_lists": 1,
    "final_lists": 0,
    "final_dicts": 0,
    "final_structs": 0
  },
  "gate_G2_zero_builtin_containers": true,
  "probe_observed_the_typed_path": true,
  "note": "An `Any` field asks for a builtin tree; containers inside an `Any` subtree are requested output and are not a G2 violation. See tests/test_typed_allocations.py for that case."
}
Evidence: G3 typed-path benchmark
{
  "records": 4096,
  "toon_bytes": 132061,
  "incumbent_pipeline_bytes": 385976,
  "json_bytes": 349111,
  "decode_us": {
    "typed_direct": 985.73,
    "functional": 989.92,
    "untyped_tree": 1042.29,
    "keyed_document": 953.48,
    "entry_document": 736.29,
    "convert_only": 442.21,
    "wrapper_tree_plus_convert": 1495.54,
    "incumbent_pipeline_python_toon_plus_convert": 30238.5,
    "msgspec_json_native": 648.84
  },
  "plan_us": {
    "decoder_construction_cached": 0.59
  },
  "encode_us": {
    "typed_direct_whole": 402.09,
    "functional": 402.14,
    "entry_document": 604.25,
    "wide_dict_document": 8577.09,
    "to_builtins_alone": 450.32,
    "incumbent_pipeline_to_builtins_plus_python_toon": 24564.89,
    "msgspec_json_native": 190.41
  },
  "notes": {
    "incumbent_pipeline": "known-inefficient composition (to_builtins + python-toon, convert + python-toon); a benchmark to beat, not the strongest alternative"
  },
  "worker_observations": [
    {
      "records": 4096,
      "toon_bytes": 132061,
      "incumbent_pipeline_bytes": 385976,
      "json_bytes": 349111,
      "decode_us": {
        "typed_direct": 952.26,
        "functional": 962.6,
        "untyped_tree": 1035.99,
        "keyed_document": 933.98,
        "entry_document": 720.21,
        "convert_only": 446.59,
        "wrapper_tree_plus_convert": 1489.47,
        "incumbent_pipeline_python_toon_plus_convert": 30035.27,
        "msgspec_json_native": 646.63
      },
      "plan_us": {
        "decoder_construction_cached": 0.59
      },
      "encode_us": {
        "typed_direct_whole": 412.98,
        "functional": 393.61,
        "entry_document": 627.46,
        "wide_dict_document": 8429.53,
        "to_builtins_alone": 447.23,
        "incumbent_pipeline_to_builtins_plus_python_toon": 24005.34,
        "msgspec_json_native": 181.81
      },
      "notes": {
        "incumbent_pipeline": "known-inefficient composition (to_builtins + python-toon, convert + python-toon); a benchmark to beat, not the strongest alternative"
      }
    },
    {
      "records": 4096,
      "toon_bytes": 132061,
      "incumbent_pipeline_bytes": 385976,
      "json_bytes": 349111,
      "decode_us": {
        "typed_direct": 1030.3,
        "functional": 985.29,
        "untyped_tree": 1027.97,
        "keyed_document": 924.47,
        "entry_document": 735.9,
        "convert_only": 433.79,
        "wrapper_tree_plus_convert": 1459.99,
        "incumbent_pipeline_python_toon_plus_convert": 29797.84,
        "msgspec_json_native": 638.58
      },
      "plan_us": {
        "decoder_construction_cached": 0.58
      },
      "encode_us": {
        "typed_direct_whole": 394.22,
        "functional": 387.86,
        "entry_document": 585.73,
        "wide_dict_document": 8803.63,
        "to_builtins_alone": 443.48,
        "incumbent_pipeline_to_builtins_plus_python_toon": 26637.83,
        "msgspec_json_native": 191.62
      },
      "notes": {
        "incumbent_pipeline": "known-inefficient composition (to_builtins + python-toon, convert + python-toon); a benchmark to beat, not the strongest alternative"
      }
    },
    {
      "records": 4096,
      "toon_bytes": 132061,
      "incumbent_pipeline_bytes": 385976,
      "json_bytes": 349111,
      "decode_us": {
        "typed_direct": 1008.64,
        "functional": 1003.79,
        "untyped_tree": 1047.46,
        "keyed_document": 1020.54,
        "entry_document": 764.53,
        "convert_only": 453.68,
        "wrapper_tree_plus_convert": 1578.88,
        "incumbent_pipeline_python_toon_plus_convert": 30479.78,
        "msgspec_json_native": 664.49
      },
      "plan_us": {
        "decoder_construction_cached": 0.59
      },
      "encode_us": {
        "typed_direct_whole": 409.97,
        "functional": 435.44,
        "entry_document": 634.05,
        "wide_dict_document": 8425.0,
        "to_builtins_alone": 457.65,
        "incumbent_pipeline_to_builtins_plus_python_toon": 25029.71,
        "msgspec_json_native": 205.63
      },
      "notes": {
        "incumbent_pipeline": "known-inefficient composition (to_builtins + python-toon, convert + python-toon); a benchmark to beat, not the strongest alternative"
      }
    },
    {
      "records": 4096,
      "toon_bytes": 132061,
      "incumbent_pipeline_bytes": 385976,
      "json_bytes": 349111,
      "decode_us": {
        "typed_direct": 967.43,
        "functional": 971.7,
        "untyped_tree": 1010.31,
        "keyed_document": 941.1,
        "entry_document": 743.02,
        "convert_only": 442.35,
        "wrapper_tree_plus_convert": 1474.74,
        "incumbent_pipeline_python_toon_plus_convert": 30156.72,
        "msgspec_json_native": 645.32
      },
      "plan_us": {
        "decoder_construction_cached": 0.58
      },
      "encode_us": {
        "typed_direct_whole": 400.49,
        "functional": 402.6,
        "entry_document": 610.33,
        "wide_dict_document": 8261.21,
        "to_builtins_alone": 460.38,
        "incumbent_pipeline_to_builtins_plus_python_toon": 24321.68,
        "msgspec_json_native": 185.54
      },
      "notes": {
        "incumbent_pipeline": "known-inefficient composition (to_builtins + python-toon, convert + python-toon); a benchmark to beat, not the strongest alternative"
      }
    },
    {
      "records": 4096,
      "toon_bytes": 132061,
      "incumbent_pipeline_bytes": 385976,
      "json_bytes": 349111,
      "decode_us": {
        "typed_direct": 970.7,
        "functional": 972.2,
        "untyped_tree": 1026.73,
        "keyed_document": 926.47,
        "entry_document": 729.85,
        "convert_only": 435.7,
        "wrapper_tree_plus_convert": 1472.76,
        "incumbent_pipeline_python_toon_plus_convert": 30482.38,
        "msgspec_json_native": 657.64
      },
      "plan_us": {
        "decoder_construction_cached": 0.59
      },
      "encode_us": {
        "typed_direct_whole": 405.47,
        "functional": 399.1,
        "entry_document": 602.02,
        "wide_dict_document": 8236.71,
        "to_builtins_alone": 455.16,
        "incumbent_pipeline_to_builtins_plus_python_toon": 24051.53,
        "msgspec_json_native": 185.76
      },
      "notes": {
        "incumbent_pipeline": "known-inefficient composition (to_builtins + python-toon, convert + python-toon); a benchmark to beat, not the strongest alternative"
      }
    },
    {
      "records": 4096,
      "toon_bytes": 132061,
      "incumbent_pipeline_bytes": 385976,
      "json_bytes": 349111,
      "decode_us": {
        "typed_direct": 998.92,
        "functional": 1014.03,
        "untyped_tree": 1066.13,
        "keyed_document": 958.14,
        "entry_document": 734.74,
        "convert_only": 446.7,
        "wrapper_tree_plus_convert": 1507.17,
        "incumbent_pipeline_python_toon_plus_convert": 30188.37,
        "msgspec_json_native": 650.08
      },
      "plan_us": {
        "decoder_construction_cached": 0.59
      },
      "encode_us": {
        "typed_direct_whole": 397.33,
        "functional": 401.03,
        "entry_document": 575.93,
        "wide_dict_document": 8276.73,
        "to_builtins_alone": 444.69,
        "incumbent_pipeline_to_builtins_plus_python_toon": 24041.65,
        "msgspec_json_native": 201.62
      },
      "notes": {
        "incumbent_pipeline": "known-inefficient composition (to_builtins + python-toon, convert + python-toon); a benchmark to beat, not the strongest alternative"
      }
    },
    {
      "records": 4096,
      "toon_bytes": 132061,
      "incumbent_pipeline_bytes": 385976,
      "json_bytes": 349111,
      "decode_us": {
        "typed_direct": 974.82,
        "functional": 973.31,
        "untyped_tree": 1058.91,
        "keyed_document": 960.78,
        "entry_document": 743.66,
        "convert_only": 433.23,
        "wrapper_tree_plus_convert": 1468.73,
        "incumbent_pipeline_python_toon_plus_convert": 30384.04,
        "msgspec_json_native": 641.23
      },
      "plan_us": {
        "decoder_construction_cached": 0.6
      },
      "encode_us": {
        "typed_direct_whole": 406.67,
        "functional": 401.41,
        "entry_document": 611.5,
        "wide_dict_document": 8797.38,
        "to_builtins_alone": 444.8,
        "incumbent_pipeline_to_builtins_plus_python_toon": 24122.15,
        "msgspec_json_native": 182.85
      },
      "notes": {
        "incumbent_pipeline": "known-inefficient composition (to_builtins + python-toon, convert + python-toon); a benchmark to beat, not the strongest alternative"
      }
    },
    {
      "records": 4096,
      "toon_bytes": 132061,
      "incumbent_pipeline_bytes": 385976,
      "json_bytes": 349111,
      "decode_us": {
        "typed_direct": 973.54,
        "functional": 999.48,
        "untyped_tree": 1063.33,
        "keyed_document": 972.17,
        "entry_document": 729.9,
        "convert_only": 449.9,
        "wrapper_tree_plus_convert": 1534.78,
        "incumbent_pipeline_python_toon_plus_convert": 30480.9,
        "msgspec_json_native": 656.83
      },
      "plan_us": {
        "decoder_construction_cached": 0.6
      },
      "encode_us": {
        "typed_direct_whole": 400.63,
        "functional": 409.82,
        "entry_document": 617.28,
        "wide_dict_document": 9510.78,
        "to_builtins_alone": 446.78,
        "incumbent_pipeline_to_builtins_plus_python_toon": 24788.81,
        "msgspec_json_native": 195.18
      },
      "notes": {
        "incumbent_pipeline": "known-inefficient composition (to_builtins + python-toon, convert + python-toon); a benchmark to beat, not the strongest alternative"
      }
    },
    {
      "records": 4096,
      "toon_bytes": 132061,
      "incumbent_pipeline_bytes": 385976,
      "json_bytes": 349111,
      "decode_us": {
        "typed_direct": 979.82,
        "functional": 1020.83,
        "untyped_tree": 1046.51,
        "keyed_document": 951.1,
        "entry_document": 742.84,
        "convert_only": 441.34,
        "wrapper_tree_plus_convert": 1476.46,
        "incumbent_pipeline_python_toon_plus_convert": 30068.81,
        "msgspec_json_native": 646.24
      },
      "plan_us": {
        "decoder_construction_cached": 0.59
      },
      "encode_us": {
        "typed_direct_whole": 397.36,
        "functional": 389.26,
        "entry_document": 585.39,
        "wide_dict_document": 8655.77,
        "to_builtins_alone": 448.44,
        "incumbent_pipeline_to_builtins_plus_python_toon": 24116.19,
        "msgspec_json_native": 190.59
      },
      "notes": {
        "incumbent_pipeline": "known-inefficient composition (to_builtins + python-toon, convert + python-toon); a benchmark to beat, not the strongest alternative"
      }
    },
    {
      "records": 4096,
      "toon_bytes": 132061,
      "incumbent_pipeline_bytes": 385976,
      "json_bytes": 349111,
      "decode_us": {
        "typed_direct": 1000.82,
        "functional": 995.94,
        "untyped_tree": 1039.57,
        "keyed_document": 946.08,
        "entry_document": 718.25,
        "convert_only": 438.77,
        "wrapper_tree_plus_convert": 1492.45,
        "incumbent_pipeline_python_toon_plus_convert": 30310.87,
        "msgspec_json_native": 641.32
      },
      "plan_us": {
        "decoder_construction_cached": 0.59
      },
      "encode_us": {
        "typed_direct_whole": 395.82,
        "functional": 401.32,
        "entry_document": 592.82,
        "wide_dict_document": 8374.2,
        "to_builtins_alone": 454.56,
        "incumbent_pipeline_to_builtins_plus_python_toon": 24534.0,
        "msgspec_json_native": 183.45
      },
      "notes": {
        "incumbent_pipeline": "known-inefficient composition (to_builtins + python-toon, convert + python-toon); a benchmark to beat, not the strongest alternative"
      }
    }
  ],
  "worker_spread_pct": {
    "decode_us.typed_direct": 2.37,
    "decode_us.functional": 2.01,
    "decode_us.untyped_tree": 1.71,
    "decode_us.keyed_document": 2.94,
    "decode_us.entry_document": 1.82,
    "decode_us.convert_only": 1.58,
    "decode_us.wrapper_tree_plus_convert": 2.44,
    "decode_us.incumbent_pipeline_python_toon_plus_convert": 0.76,
    "decode_us.msgspec_json_native": 1.29,
    "plan_us.decoder_construction_cached": 1.13,
    "encode_us.typed_direct_whole": 1.58,
    "encode_us.functional": 3.34,
    "encode_us.entry_document": 3.18,
    "encode_us.wide_dict_document": 4.55,
    "encode_us.to_builtins_alone": 1.35,
    "encode_us.incumbent_pipeline_to_builtins_plus_python_toon": 3.29,
    "encode_us.msgspec_json_native": 4.31
  },
  "gates": {
    "G3_typed_decode_beats_wrapper": true,
    "G4_whole_encode_beats_to_builtins_alone": true,
    "typed_beats_incumbent_pipeline_decode": true,
    "typed_beats_incumbent_pipeline_encode": true
  }
}
- Evidence: G5 codec-floor benchmark (local file: /var/folders/pt/19wwr80d5bs38zmww5rm2vsc0000gn/T/no-mistakes-evidence/01KZYBEM8QNRQXN69HCXN8F1GA/g5-codec-4096.json)
Evidence: Commit, runtime, and evidence SHA-256 binding
target_commit=abef34e0d6f60709de7e58a259e263d833063dfe
base_commit=6cb36cb50fd7ab2ded0e298c27574357c676bda1
python=3.13.1
msgspec-toon=0.3.0b3
SHA2-256(/var/folders/pt/19wwr80d5bs38zmww5rm2vsc0000gn/T/no-mistakes-evidence/01KZYBEM8QNRQXN69HCXN8F1GA/ab-distinct-32.json)= b89fb70da5235b9737659d27b2bca12c7a024444064de0a5958c9f47477dca7f
SHA2-256(/var/folders/pt/19wwr80d5bs38zmww5rm2vsc0000gn/T/no-mistakes-evidence/01KZYBEM8QNRQXN69HCXN8F1GA/ab-distinct-512.json)= bbfdc8e06aa637a80d7a8b376621beccf64d3996c5c0ebd3133658762caeca09
SHA2-256(/var/folders/pt/19wwr80d5bs38zmww5rm2vsc0000gn/T/no-mistakes-evidence/01KZYBEM8QNRQXN69HCXN8F1GA/g2-allocation-proof.json)= 5dd4c7a99f33c56d24651f4c75bca7d16d6aed63562b11af9d5e99bb6008ad94
SHA2-256(/var/folders/pt/19wwr80d5bs38zmww5rm2vsc0000gn/T/no-mistakes-evidence/01KZYBEM8QNRQXN69HCXN8F1GA/g3-typed-4096.json)= f1d4650d26ce3dbdaee3ca5f9fbe19e4526403d9ac3bdad816897f44017f1dda
SHA2-256(/var/folders/pt/19wwr80d5bs38zmww5rm2vsc0000gn/T/no-mistakes-evidence/01KZYBEM8QNRQXN69HCXN8F1GA/g5-codec-4096.json)= f22d475bc380bbe533647d8ba6e4133989bcd9054356eb78489d76d1cd8ec5e7
SHA2-256(/var/folders/pt/19wwr80d5bs38zmww5rm2vsc0000gn/T/no-mistakes-evidence/01KZYBEM8QNRQXN69HCXN8F1GA/target-key-cardinality.json)= 535751326e252273e6cf0a5a06290dfcf344e9517cd7a5f745e75e74c4c81fc4

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 error
  • 🚨 README.md:242 - Intent requires “exact source-bound evidence.” This line claims 36.8% and 87.9%, but the referenced final report records improvements of 35.8309% and 87.4457% (35.8% and 87.4% rounded); CHANGELOG.md:13 repeats the stale values. Synchronize both claims with the final guard, or regenerate evidence that supports the claimed figures.

🔧 Fix: Synchronize benchmark claims with release guard evidence
1 error still open:

  • 🚨 benches/ab.py:184 - Intent requires a “32-key and 512-key ten-worker A/B guard,” but these new guard cells use the existing default --rounds=2, producing only four baseline and four current worker observations per metric; the committed guard JSON confirms four values per side. Either make ten workers the enforced guard default and regenerate the evidence, or confirm that “ten-worker” was intended to describe only the standalone cardinality curve.
✅ **Test** - passed

✅ No issues found.

  • uv sync --group bench --locked (initial environment setup, superseded by the release-Python run)
  • uv sync --python 3.13 --group bench --locked
  • uv run --no-sync maturin develop --release
  • uv run --no-sync pytest -q tests/test_benchmark_shapes.py tests/test_efficiency_lock.py tests/test_containment.py tests/test_errors.py tests/test_control_patterns.py tests/test_release_workflows.py tests/test_release_report.py
  • uv run --no-sync python conformance/run.py
  • uv run --no-sync python benches/bench_key_cardinality.py
  • Built base commit 6cb36cb50fd7ab2ded0e298c27574357c676bda1 as a Python 3.13 release wheel from git archive, then installed it into an isolated .venv-base.
  • uv run --no-sync python benches/ab.py --baseline-venv .venv-base --current-venv .venv --rounds 4 --only 'untyped distinct-32-key decode' --output …/ab-distinct-32.json
  • uv run --no-sync python benches/ab.py --baseline-venv .venv-base --current-venv .venv --rounds 4 --only 'untyped distinct-512-key decode' --output …/ab-distinct-512.json
  • make g2
  • uv run --no-sync python -c '… bench_typed.run(4096) …'
  • uv run --no-sync python -c '… bench_codecs.run(4096, shape="uniform-records") …'
  • Validated evidence contracts with jq -e, recorded SHA-256 digests, removed transient environments/build outputs, and confirmed git status --short is empty.
🔧 **Document** - 1 issue found → auto-fixed ✅
  • ⚠️ scripts/release-report.py:324 - Generated evidence metadata still says the A/B harness runs sixteen metrics, while the checked-in guard contains 100 metric-size points. Updating the authoritative generator and regenerating conformance/report.json requires a benchmark-authorized phase.

🔧 Fix: Correct release guard point count
✅ Re-checked - no issues remain.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@goblinmode2700
goblinmode2700 merged commit f6cfb27 into main Aug 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant