Translate packet, message, bit-pack, and zero-coding tests exactly #16

Closed
opened 2026-08-08 08:13:46 +00:00 by hugo · 2 comments
Owner

Objective

Translate the wire-format tests covering bit packing, zero coding, packet headers/blocks, generated packets, messages, and event decoding.

Deliverables

  • Copy exact packet bytes, IDs, block counts, endian values, truncation cases, and expected decoded fields.
  • Translate round-trip and regression assertions without replacing golden data.
  • Keep generated-packet cases linked to their source-generator inputs.

Validation

  • Every owned NUnit case has a reviewed Rust counterpart.
  • Tests compile against packet/message shim signatures.
  • Expected malformed-input errors are typed assertions, never generic panic acceptance.

Prerequisite

Milestone 02 must provide the complete callable public API shim. Keep all production behavior standardized as unimplemented.

Project constraints

  • Translate the original test semantics exactly; do not weaken assertions, tolerances, inputs, errors, ordering, or interaction expectations.
  • Tests must exercise the mapped Rust API and must never call LibreMetaverse/.NET as their implementation.
  • Expected C# exceptions map to specific Rust error variants; an unimplemented panic must remain a failure.
  • Do not implement production behavior during this milestone. Update parity metadata and handover status with the change.
## Objective Translate the wire-format tests covering bit packing, zero coding, packet headers/blocks, generated packets, messages, and event decoding. ## Deliverables - Copy exact packet bytes, IDs, block counts, endian values, truncation cases, and expected decoded fields. - Translate round-trip and regression assertions without replacing golden data. - Keep generated-packet cases linked to their source-generator inputs. ## Validation - Every owned NUnit case has a reviewed Rust counterpart. - Tests compile against packet/message shim signatures. - Expected malformed-input errors are typed assertions, never generic panic acceptance. ## Prerequisite Milestone 02 must provide the complete callable public API shim. Keep all production behavior standardized as unimplemented. ## Project constraints - Translate the original test semantics exactly; do not weaken assertions, tolerances, inputs, errors, ordering, or interaction expectations. - Tests must exercise the mapped Rust API and must never call LibreMetaverse/.NET as their implementation. - Expected C# exceptions map to specific Rust error variants; an unimplemented panic must remain a failure. - Do not implement production behavior during this milestone. Update parity metadata and handover status with the change.
hugo added this to the 03 - Full semantic test translation milestone 2026-08-08 08:13:46 +00:00
hugo added the enhancement label 2026-08-08 08:13:46 +00:00
Author
Owner

Implemented in 4e5d79e (Translate wire semantics parity tests).

Implementation:

  • translated all 54 issue-owned NUnit cases: 14 zero-coding, 2 bit-pack, 2 packet, and 36 message/event cases
  • preserved exact byte fixtures, IDs, flags, block counts, endianness, truncation/round-trip assertions, decoded fields, and four benchmark cases
  • linked generated-packet coverage to PacketSourceGenerator.cs and data/message_template.msg, with pinned upstream source hashes
  • corrected generated Rust mappings for mutable buffer/state APIs and inherited packet/message state
  • introduced typed ArgumentNull, Argument, and IndexOutOfRange variants while keeping every production shim standardized as Error::NotImplemented
  • updated parity and handover metadata: 145 translated, 4 benchmark-reviewed, 1,140 pending, 0 drift

Verification (all green):

  • cargo fmt --all -- --check
  • mapping, shim, API coverage, surface, and parity generator checks
  • Python generator unit tests
  • cargo check --workspace --all-targets
  • locked API compile check
  • cargo test --workspace --no-run
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo doc --workspace --no-deps

Isolation run: wire_semantics compiled and ran all 54 cases. As required for milestone 03, all success paths stopped only at their first exact failure-only production member; malformed-input cases explicitly rejected NotImplemented and demanded the mapped typed error. No generic panic was accepted as success.

Implemented in 4e5d79e (Translate wire semantics parity tests). Implementation: - translated all 54 issue-owned NUnit cases: 14 zero-coding, 2 bit-pack, 2 packet, and 36 message/event cases - preserved exact byte fixtures, IDs, flags, block counts, endianness, truncation/round-trip assertions, decoded fields, and four benchmark cases - linked generated-packet coverage to PacketSourceGenerator.cs and data/message_template.msg, with pinned upstream source hashes - corrected generated Rust mappings for mutable buffer/state APIs and inherited packet/message state - introduced typed ArgumentNull, Argument, and IndexOutOfRange variants while keeping every production shim standardized as Error::NotImplemented - updated parity and handover metadata: 145 translated, 4 benchmark-reviewed, 1,140 pending, 0 drift Verification (all green): - cargo fmt --all -- --check - mapping, shim, API coverage, surface, and parity generator checks - Python generator unit tests - cargo check --workspace --all-targets - locked API compile check - cargo test --workspace --no-run - cargo clippy --workspace --all-targets --all-features -- -D warnings - cargo doc --workspace --no-deps Isolation run: wire_semantics compiled and ran all 54 cases. As required for milestone 03, all success paths stopped only at their first exact failure-only production member; malformed-input cases explicitly rejected NotImplemented and demanded the mapped typed error. No generic panic was accepted as success.
hugo closed this issue 2026-08-08 12:50:34 +00:00
hugo reopened this issue 2026-08-08 14:24:29 +00:00
Author
Owner

Implemented and pushed in de6e611 (Translate wire semantics tests).

Implementation:

  • Added 54 explicit Rust counterparts in tests/compat/tests/wire_semantics.rs: 14 zero-coding cases, 2 bit-pack cases, 2 packet cases, and all 36 MessageTests cases (including 4 benchmark cases).
  • Preserved the pinned C# fixture hashes and generated-packet source links.
  • Each test body calls the mapped Rust API directly; pending/dispatcher/string-source wrappers are not used.
  • Added the packet/message shim shapes required by the original calls: mutable buffer borrows, mutating Deserialize/BitPack/FromBytes receivers, inherited base composition for owned message/packet types, and typed ArgumentNull/Argument/IndexOutOfRange errors distinct from Error::NotImplemented.
  • Production implementations remain standardized failure-only shims.
  • Updated mapping, compile fixture, parity catalog, generated pending inventory, and handover counts.

Review and verification:

  • Fixture SHA-256 values match LibreMetaverse 2aa70bb68513b39795da5d13c88f31b86e85a3ba.
  • Parity: pending=1140, translated=145, benchmark=4, drifted=0, unreviewed=1140.
  • Isolated #16 run: 0 passed, 54 failed, all 54 failures contained standardized NotImplemented errors.
  • Existing translated suites remain isolated red: Types/Utilities 17/17 NotImplemented; StructuredData 78/78 NotImplemented.
  • All non-translation workspace and compatibility shim tests pass.
  • Local gates passed: fmt, mapping/shim regeneration checks, API coverage, surface/parity checks, tool unit tests, workspace/all-target check, locked downstream API compile, workspace no-run, full clippy with warnings denied, workspace docs.
  • No CI action is used; every gate was run locally.
Implemented and pushed in de6e611 (Translate wire semantics tests). Implementation: - Added 54 explicit Rust counterparts in tests/compat/tests/wire_semantics.rs: 14 zero-coding cases, 2 bit-pack cases, 2 packet cases, and all 36 MessageTests cases (including 4 benchmark cases). - Preserved the pinned C# fixture hashes and generated-packet source links. - Each test body calls the mapped Rust API directly; pending/dispatcher/string-source wrappers are not used. - Added the packet/message shim shapes required by the original calls: mutable buffer borrows, mutating Deserialize/BitPack/FromBytes receivers, inherited base composition for owned message/packet types, and typed ArgumentNull/Argument/IndexOutOfRange errors distinct from Error::NotImplemented. - Production implementations remain standardized failure-only shims. - Updated mapping, compile fixture, parity catalog, generated pending inventory, and handover counts. Review and verification: - Fixture SHA-256 values match LibreMetaverse 2aa70bb68513b39795da5d13c88f31b86e85a3ba. - Parity: pending=1140, translated=145, benchmark=4, drifted=0, unreviewed=1140. - Isolated #16 run: 0 passed, 54 failed, all 54 failures contained standardized NotImplemented errors. - Existing translated suites remain isolated red: Types/Utilities 17/17 NotImplemented; StructuredData 78/78 NotImplemented. - All non-translation workspace and compatibility shim tests pass. - Local gates passed: fmt, mapping/shim regeneration checks, API coverage, surface/parity checks, tool unit tests, workspace/all-target check, locked downstream API compile, workspace no-run, full clippy with warnings denied, workspace docs. - No CI action is used; every gate was run locally.
hugo closed this issue 2026-08-08 16:00:48 +00:00
Sign in to join this conversation.