Wire codec: implement generated packet encode/decode and golden bytes #47

Closed
opened 2026-08-08 08:18:17 +00:00 by hugo · 1 comment
Owner

Objective

Implement native Rust packet serialization/deserialization over the generated types.

Deliverables

  • Cover headers, IDs/frequencies, ACKs, block counts, variable fields, endian rules, zero coding boundaries, truncation, and unknown packets.
  • Use bounded borrowed parsing and checked length arithmetic.
  • Link every golden packet fixture to its translated test and template.

Validation

  • All translated packet/message golden tests pass byte-for-byte.
  • Malformed corpus never panics or allocates unbounded memory.
  • Encode/decode round trips retain all public fields.

Prerequisite

The fixed API/test gates, Types, StructuredData, and relevant imaging foundations are complete.

Project constraints

  • All LibreMetaverse-specific generation and wire behavior is new native Rust code.
  • Generated Rust is deterministic, checked in, and covered by the fixed public API and semantic tests.
  • No normal build or release may depend on .NET, Roslyn, C# assemblies, or the reference checkout.
## Objective Implement native Rust packet serialization/deserialization over the generated types. ## Deliverables - Cover headers, IDs/frequencies, ACKs, block counts, variable fields, endian rules, zero coding boundaries, truncation, and unknown packets. - Use bounded borrowed parsing and checked length arithmetic. - Link every golden packet fixture to its translated test and template. ## Validation - All translated packet/message golden tests pass byte-for-byte. - Malformed corpus never panics or allocates unbounded memory. - Encode/decode round trips retain all public fields. ## Prerequisite The fixed API/test gates, Types, StructuredData, and relevant imaging foundations are complete. ## Project constraints - All LibreMetaverse-specific generation and wire behavior is new native Rust code. - Generated Rust is deterministic, checked in, and covered by the fixed public API and semantic tests. - No normal build or release may depend on .NET, Roslyn, C# assemblies, or the reference checkout.
hugo added this to the 07 - Wire codegen milestone 2026-08-08 08:18:17 +00:00
hugo added the enhancement label 2026-08-08 08:18:17 +00:00
Author
Owner

Implemented and verified in commit 74801c3.

Implementation:

  • Generated real native Rust encode/decode implementations for all 483 packet types and 905 block types, including high/medium/low headers and IDs, flags and sequences, appended ACKs, all scalar/vector/UUID field encodings, fixed and length-prefixed data, fixed/variable block counts, quaternion normalization, zerocoding, dispatch validation, and MTU splitting.
  • Added bounded borrowed wire readers, checked length/allocation arithmetic, strict truncation/unknown-packet errors, and panic-free malformed-input handling.
  • Added native Rust golden-compatible LLSD message codecs and BitPack behavior required by the existing translated wire suite.
  • Added exact reference fixtures linked to the packet template/header cases, plus generated non-default round trips for every public packet field and every truncation boundary.
  • Added deterministic generation, documentation, and Ubuntu Gitea gates; normal builds do not invoke C# or .NET.

Verification:

  • cargo test -p libremetaverse-compat-tests --test wire_semantics: 54 passed
  • cargo test -p libremetaverse --test packet_wire: 6 passed
  • cargo test -p libremetaverse --lib generated_codec_tests: all 483 packet types passed with non-default fields
  • cargo test -p libremetaverse-codegen: 5 passed
  • cargo run -p libremetaverse-codegen -- check: passed
  • cargo clippy for libremetaverse and libremetaverse-codegen with -D warnings: passed
  • cargo check for the fixed API compile crate: passed
  • cargo test --workspace --no-run: passed
  • cargo build -p libremetaverse --locked: passed
  • cargo fmt --check and git diff --check: passed

A full libremetaverse test audit was also run. The issue-owned tests pass; 90 tests for unrelated future-milestone stubs remain failing and are outside milestone 07 / issue #47.

Implemented and verified in commit 74801c3. Implementation: - Generated real native Rust encode/decode implementations for all 483 packet types and 905 block types, including high/medium/low headers and IDs, flags and sequences, appended ACKs, all scalar/vector/UUID field encodings, fixed and length-prefixed data, fixed/variable block counts, quaternion normalization, zerocoding, dispatch validation, and MTU splitting. - Added bounded borrowed wire readers, checked length/allocation arithmetic, strict truncation/unknown-packet errors, and panic-free malformed-input handling. - Added native Rust golden-compatible LLSD message codecs and BitPack behavior required by the existing translated wire suite. - Added exact reference fixtures linked to the packet template/header cases, plus generated non-default round trips for every public packet field and every truncation boundary. - Added deterministic generation, documentation, and Ubuntu Gitea gates; normal builds do not invoke C# or .NET. Verification: - cargo test -p libremetaverse-compat-tests --test wire_semantics: 54 passed - cargo test -p libremetaverse --test packet_wire: 6 passed - cargo test -p libremetaverse --lib generated_codec_tests: all 483 packet types passed with non-default fields - cargo test -p libremetaverse-codegen: 5 passed - cargo run -p libremetaverse-codegen -- check: passed - cargo clippy for libremetaverse and libremetaverse-codegen with -D warnings: passed - cargo check for the fixed API compile crate: passed - cargo test --workspace --no-run: passed - cargo build -p libremetaverse --locked: passed - cargo fmt --check and git diff --check: passed A full libremetaverse test audit was also run. The issue-owned tests pass; 90 tests for unrelated future-milestone stubs remain failing and are outside milestone 07 / issue #47.
hugo closed this issue 2026-08-09 08:17:25 +00:00
Sign in to join this conversation.