Skip to content

Add explicit serialization codec versioning - #720

Merged
zhenrongliew merged 1 commit into
mainfrom
dl/serializer-codec-versioning
Sep 25, 2026
Merged

zhenrongliew merged 1 commit into
mainfrom
dl/serializer-codec-versioning

Conversation

@zhenrongliew

@zhenrongliew zhenrongliew commented Sep 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add a Kirin-controlled integer codec_version to the serialization module.
  • Define the post Optimize shared-method serialization with method references #717 wire format as codec v2.
  • Treat missing codec_version as legacy unversioned v1.
  • Keep the existing SerializationModule.version caller-controlled and independent from the wire codec.

split from original #717 into stacked PR.
This follows the direction discussed in #618.

@zhenrongliew
zhenrongliew requested a review from kaihsin September 1, 2026 22:32
@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

☂️ Code Coverage

current status: ✅

Overall Coverage

Statements Covered Coverage Threshold Status
11868 10700 90% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
src/kirin/serialization/core/_init_.py 100% 🟢
src/kirin/serialization/core/serializationmodule.py 100% 🟢
src/kirin/serialization/jsonserializer.py 96% 🟢
TOTAL 99% 🟢

updated for commit: 2f86d5a by action🐍

@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-25 15:37 UTC

@zhenrongliew zhenrongliew added the category: breaking change Category: breaking changes or proposed changes to APIs. label Sep 1, 2026
@Roger-luo

Copy link
Copy Markdown
Collaborator

@zhenrongliew I think 1 review should be good, let's get this in!

@zhenrongliew
zhenrongliew force-pushed the dl/serializer-codec-versioning branch from 83b6a8a to 7d42dbe Compare September 25, 2026 15:07
Base automatically changed from dl/serializer-codec-version to main September 25, 2026 15:08
zhenrongliew added a commit that referenced this pull request Sep 25, 2026
### Summary
This is a breaking payload-representation change. Methods are now
defined using identity-based IDs, repeated call sites use `method_ref`,
and the previous `symbol_table`/mangled-method representation is
removed.
Payloads containing the old mangled method records are not supported by
this decoder.
Explicit codec versioning and the policy for rejecting unversioned
payloads are separated into the stacked follow-up PR #720

### Motivation
Previously, every call site serialized and reconstructed the complete
method wrapper, body already de-duplicated with `region_ref`.
On the representative shared-callee benchmark, relative to #713:
- JSON: 61,470 → 42,459 bytes (−31%)
- CBSON: 5,021 → 4,566 bytes (−9%)
- JSON round trip: 4.36 → 2.31 ms (−47%)
- CBSON round trip: 6.22 → 4.24 ms (−32%)
@codecov

codecov Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.55172% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/kirin/serialization/jsonserializer.py 94.73% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@zhenrongliew
zhenrongliew force-pushed the dl/serializer-codec-versioning branch from 7d42dbe to 2f86d5a Compare September 25, 2026 15:13
@zhenrongliew
zhenrongliew merged commit f2c6e06 into main Sep 25, 2026
11 checks passed
@zhenrongliew
zhenrongliew deleted the dl/serializer-codec-versioning branch September 25, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: breaking change Category: breaking changes or proposed changes to APIs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants