Skip to content

fix: isolate buffer normalization from native layout - #15

Merged
goblinmode2700 merged 1 commit into
mainfrom
release/0.3.0b5-buffer-normalization
Aug 14, 2026
Merged

fix: isolate buffer normalization from native layout#15
goblinmode2700 merged 1 commit into
mainfrom
release/0.3.0b5-buffer-normalization

Conversation

@goblinmode2700

Copy link
Copy Markdown
Owner

What changed

  • Normalize exact bytearray and C-contiguous memoryview values through the existing Python default-hook membrane.
  • Preserve pre-copy size checks, hook ordering, BufferError for non-contiguous views, and refusal/hook behavior for binary subclasses.
  • Remove the new native buffer-copy paths, leaving src/encode.rs identical to v0.3.0b4 apart from the required non-string mapping-key guidance.

Why

The first publication-disabled 0.3.0b5 rehearsal established a regression in the unrelated control-nested-tag-decode@512 endpoint: +8.6%, simultaneous Bonferroni interval [+7.7%, +9.5%]. The Issue 13 behavior is cold-path normalization and does not require changing native decode code layout, so this follow-up isolates it at the existing Python membrane.

User impact

Exact bytearray and contiguous memoryview inputs encode as padded base64 before a user enc_hook. Invalid mapping keys still refuse conversion, but the root and nested errors now explicitly name msgspec.to_builtins(..., str_keys=True).

Validation

  • make qualify: 488 Python tests passed, 11 skipped; 43 Rust tests passed; official TOON corpus 538/538; G2 zero-intermediate-container checks passed.
  • Focused CPython 3.13 ABI3 public-API tests and a sparse 4 GiB pre-copy rejection check passed.
  • One preregistered same-machine guard against the public 0.3.0b4 wheel: 36 randomized pairs, 22 endpoints, R 4.4.2 paired-log model, simultaneous Bonferroni intervals.
  • Former regression endpoint: +0.5%, interval [-0.4%, +1.5%], non_inferior.
  • Family: INCONCLUSIVE, zero regression endpoints. Three unrelated endpoints were inconclusive because only their upper simultaneous bounds crossed 3%; no data-dependent rerun was performed.

@goblinmode2700
goblinmode2700 merged commit 253383d into main Aug 14, 2026
4 checks passed
@goblinmode2700
goblinmode2700 deleted the release/0.3.0b5-buffer-normalization branch August 14, 2026 21:34
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