Skip to content

feat: add native set, frozenset, and bytes encoding - #11

Merged
goblinmode2700 merged 2 commits into
mainfrom
release/0.3.0b4-native-types
Aug 14, 2026
Merged

goblinmode2700 merged 2 commits into
mainfrom
release/0.3.0b4-native-types

Conversation

@goblinmode2700

Copy link
Copy Markdown
Owner

Intent

Release msgspec-toon 0.3.0b4 as a narrow 0.3.x beta bugfix. Add native encode support for set, frozenset, and exact bytes with msgspec-compatible projection and enc_hook ordering; document unordered set output and decode projection boundaries; preserve byte-exact TOON 4.1.1 conformance, canonical token output, payload-safe errors, and G2/G3/G5 invariants. Keep the public benchmark harness and GitHub Actions release path governed by the law 'Python collects raw timings; R owns inference', with familywise power planning and simultaneous Bonferroni intervals. Do not turn this into a 0.4.x release or rerun the old long local benchmark graph. Publish through the repository's verified wheel, revision-bound evidence, Trusted Publishing, and GitHub prerelease workflow.

What Changed

  • Encode set and frozenset as arrays in Python iteration order and exact bytes as padded base64 strings, before enc_hook dispatch.
  • Document projected decode boundaries, extend the executable support matrix, and bump the package to 0.3.0b4.
  • Enforce manifest-declared benchmark designs and add R-owned familywise power planning with simultaneous Bonferroni intervals for release gates.

Risk Assessment

✅ Low: The native projections, hook ordering, documented boundaries, familywise benchmark planning, and release metadata are internally consistent and well covered by behavioral tests.

Testing

After replacing uv’s initial CPython 3.14t selection with the required CPython 3.13 ABI and correcting a probe-only version lookup, targeted tests, canonical byte/token locks, G2 instrumentation, R/release governance checks, revision-bound wheel verification, all 538 TOON 4.1.1 fixtures, and installed-wheel manual behavior passed; no long benchmark graph or full repository suite was run.

Evidence: Installed-wheel native-type transcript
{
  "bytes_subclass_boundary": {
    "error_contains_payload": false,
    "hook_route_wire_utf8": "YWI=",
    "without_hook_error": "unsupported type: BytesSubclass"
  },
  "distribution_version": "0.3.0b4",
  "exact_bytes": {
    "decoded_type": "str",
    "decoded_value": "AGFi/w==",
    "enc_hook_calls": [],
    "input_hex": "006162ff",
    "matches_msgspec_projection": true,
    "wire_utf8": "AGFi/w=="
  },
  "frozenset_projection": {
    "decoded_type": "list",
    "decoded_value": [
      1,
      2,
      3
    ],
    "iteration_order": [
      1,
      2,
      3
    ],
    "matches_iteration_projection": true,
    "python_type": "frozenset",
    "wire_utf8": "[3]: 1,2,3"
  },
  "installed_native_extension": "/Users/darcyrose/.no-mistakes/worktrees/4598d837086a/01KZZG3J8FT0QPR9MWRBWZB9SN/.venv-e2e/lib/python3.13/site-packages/msgspec_toon/_native.abi3.so",
  "installed_package": "/Users/darcyrose/.no-mistakes/worktrees/4598d837086a/01KZZG3J8FT0QPR9MWRBWZB9SN/.venv-e2e/lib/python3.13/site-packages/msgspec_toon/__init__.py",
  "nested_struct": {
    "matches_msgspec_projection": true,
    "wire_utf8": "tags[2]: beta,alpha\nfrozen_tags[1]: gamma\nblob: YWI="
  },
  "set_projection": {
    "decoded_type": "list",
    "decoded_value": [
      "alpha",
      "gamma",
      "beta"
    ],
    "iteration_order": [
      "alpha",
      "gamma",
      "beta"
    ],
    "matches_iteration_projection": true,
    "python_type": "set",
    "wire_utf8": "[3]: alpha,gamma,beta"
  }
}
Evidence: TOON 4.1.1 conformance transcript
corpus v4.1.1 @ 62f16b369408 (538 tests)
  decode: 359/359 pass, 0 fail, 0 unsupported-option
  encode: 179/179 pass, 0 fail, 0 unsupported-option
  error fixtures: 84/84 raise as required
results written to /Users/darcyrose/.no-mistakes/worktrees/4598d837086a/01KZZG3J8FT0QPR9MWRBWZB9SN/conformance/conformance-results.json
Evidence: Revision-bound wheel verification
{
  "artifact": {
    "filename": "msgspec_toon-0.3.0b4-cp313-abi3-macosx_11_0_arm64.whl",
    "kind": "wheel",
    "sha256": "dd4a9965b42bdb34dc923d5ad01828744f62c780cc1dfcbd39c8ba49591d0139",
    "size": 371702
  },
  "schema_version": 1,
  "source_revision": "00c9d71003f628b77a17e4ea572f96608e86c51c",
  "target": {
    "architecture": "aarch64",
    "operating_system": "macos",
    "python_abi": "cp313-abi3"
  },
  "verification": {
    "distribution_version": "0.3.0b4",
    "gil_enabled": true,
    "machine": "arm64",
    "native_path": "/Users/darcyrose/.no-mistakes/worktrees/4598d837086a/01KZZG3J8FT0QPR9MWRBWZB9SN/.venv-e2e/lib/python3.13/site-packages/msgspec_toon/_native.abi3.so",
    "package_path": "/Users/darcyrose/.no-mistakes/worktrees/4598d837086a/01KZZG3J8FT0QPR9MWRBWZB9SN/.venv-e2e/lib/python3.13/site-packages/msgspec_toon/__init__.py",
    "platform": "macOS-15.1-arm64-arm-64bit-Mach-O",
    "python": "3.13.12",
    "python_implementation": "CPython",
    "status": "passed"
  }
}
Evidence: Wheel manifest
{
  "artifact": {
    "filename": "msgspec_toon-0.3.0b4-cp313-abi3-macosx_11_0_arm64.whl",
    "kind": "wheel",
    "sha256": "dd4a9965b42bdb34dc923d5ad01828744f62c780cc1dfcbd39c8ba49591d0139",
    "size": 371702
  },
  "schema_version": 1,
  "source_revision": "00c9d71003f628b77a17e4ea572f96608e86c51c",
  "target": {
    "architecture": "aarch64",
    "operating_system": "macos",
    "python_abi": "cp313-abi3"
  }
}
- Evidence: Built macOS cp313-abi3 wheel (local file: /var/folders/pt/19wwr80d5bs38zmww5rm2vsc0000gn/T/no-mistakes-evidence/01KZZG3J8FT0QPR9MWRBWZB9SN/wheel/msgspec_toon-0.3.0b4-cp313-abi3-macosx_11_0_arm64.whl)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • uv sync --python /opt/homebrew/opt/python@3.13/bin/python3.13 --locked and uv run --no-sync maturin develop --release
  • uv run --no-sync pytest -q tests/test_native_encode_types.py tests/test_support_matrix.py tests/test_efficiency_lock.py tests/test_errors.py tests/test_typed_allocations.py
  • make g2
  • uv sync --python /opt/homebrew/opt/python@3.13/bin/python3.13 --group bench --locked and uv run --no-sync pytest -q tests/test_efficiency_lock.py
  • Focused pytest selectors covering familywise R power planning, simultaneous Bonferroni intervals, immutable sampling design, missing-R fail-closed behavior, release workflow governance, revision identity, and compatibility reporting.
  • Built, manifested, installed, and verified msgspec_toon-0.3.0b4-cp313-abi3-macosx_11_0_arm64.whl against revision 00c9d71003f628b77a17e4ea572f96608e86c51c.
  • .venv-e2e/bin/python -I conformance/run.py against the installed wheel.
  • Installed-wheel public API probe for set/frozenset iteration projection, exact bytes/base64, enc_hook ordering, nested Structs, decode boundaries, and bytes-subclass failure/hook behavior.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@goblinmode2700
goblinmode2700 merged commit 00f98e9 into main Aug 14, 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