Skip to content

fix: keep mapping-key guidance off native hot paths - #16

Merged
goblinmode2700 merged 1 commit into
mainfrom
release/0.3.0b5-python-key-error
Aug 14, 2026
Merged

fix: keep mapping-key guidance off native hot paths#16
goblinmode2700 merged 1 commit into
mainfrom
release/0.3.0b5-python-key-error

Conversation

@goblinmode2700

Copy link
Copy Markdown
Owner

What changed

  • Restore src/encode.rs exactly to the published v0.3.0b4 native source.
  • Rewrite the fixed non-string-key message through the existing Python-supplied encode-error constructor.
  • Preserve the Issue 13 API behavior and the Python buffer-normalization membrane unchanged.

Why

The tag-time 0.3.0b5 guard established regressions in all four typed/functional encode endpoints while untyped encode remained non-inferior. The only remaining native source difference from b4 was the cold mapping-key error text inside encode.rs. This change removes that native layout perturbation entirely; the error factory is called only after an encode error has already occurred.

Performance evidence that rejected the prior candidate

R 4.4.2 analyzed 36 randomized baseline/current pairs across the preregistered 22-endpoint family using paired log process means and simultaneous Bonferroni intervals:

  • typed encode @64: +6.7% [+5.2%, +8.3%], regressed
  • typed encode @4096: +6.5% [+4.9%, +8.1%], regressed
  • functional encode @16: +5.6% [+3.5%, +7.8%], regressed
  • functional encode @4096: +6.8% [+4.6%, +9.1%], regressed

The lower bound exceeds the +3% margin for each endpoint, so these are established regressions. No unchanged-candidate rerun was performed.

Validation

  • git diff v0.3.0b4 -- src: empty
  • uv run pytest -q tests/test_native_encode_types.py: 40 passed
  • make qualify: 488 Python tests passed, 11 skipped; 43 Rust tests passed; official TOON corpus 538/538; G2 zero-intermediate-container proof passed

The next performance decision belongs to the release workflow’s R-owned guard on verified release wheels.

@goblinmode2700
goblinmode2700 merged commit b0343dd into main Aug 14, 2026
4 checks passed
@goblinmode2700
goblinmode2700 deleted the release/0.3.0b5-python-key-error branch August 14, 2026 22:02
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