Received preset encodings are value-only end to end#488
Merged
Conversation
zenoh-flat-jni#6 makes the delivered encoding handle CONDITIONAL on schema presence (binding-local encoding_if_schema behind prebindgen#84's field! leaf): a received preset re-sends through the id arm for free, so no per-message native handle — clone + Box + JVM wrapper + gc-Cleaner registration + Cleaner free — is ever materialized for it. Schema- carrying encodings keep the send-ready handle. Adapt the delivery plumbing: Sample.fromParts encH becomes nullable (Query's already was), the reply callback drops its non-null assertion, and EncodingHandleTest's preset round-trip flips to assert the received copy has NO handle — the new contract. CI pin bumped to the flat-jni#6 tip. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The previous pin was a branch commit deleted on merge; 1e040c9 is ZettaScaleLabs/zenoh-flat-jni#6 on main (conditional encoding handle, final fun!+sig! syntax). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Consumes ZettaScaleLabs/zenoh-flat-jni#6 (merged as
1e040c9): the encoding handle delivered with a received sample/query/reply is conditional on schema presence. A received preset (schema-less) encoding arrives value-only — it re-sends through the(id, schema)value arm for free, so the per-message native handle it used to carry (Rust clone+Box, JVM wrapper + atomic cell + gc-Cleaner registration, later Cleaner free — the +150 ns class measured in milyin/prebindgen#83) is never materialized. Schema-carrying (custom) encodings keep the send-ready handle from #485.The condition lives in the binding tier (
encoding_if_schemain zenoh-flat-jni, declared with prebindgen's binding-localfun!(crate::…).sig(sig!(…))vocabulary from milyin/prebindgen#84) — zenoh-flat stays pure.Changes
Sample.fromPartsencHbecomes nullable (Query.fromPartsalready was); the reply callback drops its non-null assertion on the ok-arm handle leaf.EncodingHandleTest: the preset round-trip flips toassertNull(received.encoding.handle)— the new contract, asserted end to end; the custom-encoding round-trip still verifies a delivered handle + same-handle re-send.1e040c9).110 jvmTest, 0 failures against merged flat-jni main.
🤖 Generated with Claude Code