Types: implement Quaternion and Matrix4 geometry #29

Closed
opened 2026-08-08 08:16:22 +00:00 by hugo · 1 comment
Owner

Objective

Implement quaternion and matrix construction, arithmetic, transformations, inversion, decomposition, interpolation, and formatting.

Deliverables

  • Preserve multiplication direction, handedness, row/column conventions, component order, normalization, zero/identity handling, and vector rotation semantics.
  • Port every constructor/operator/conversion and checked failure path.
  • Document conventions at the public API.

Validation

  • All Quaternion/Matrix tests and rotation regression cases pass.
  • Golden transform chains match C# within original tolerances.
  • Focused benchmarks detect accidental pathological allocation but are not correctness gates.

Prerequisite

The full API shim and semantic test-suite gates are complete.

Project constraints

  • Implement only in native Rust; no LibreMetaverse/.NET bridge, subprocess, RPC, or fallback.
  • Keep mapped public signatures fixed and do not weaken translated parity assertions.
  • Remove failing bodies only for owned behavior and leave unrelated modules untouched.
  • Update docs, coverage/parity status, and focused plus workspace validation evidence.
## Objective Implement quaternion and matrix construction, arithmetic, transformations, inversion, decomposition, interpolation, and formatting. ## Deliverables - Preserve multiplication direction, handedness, row/column conventions, component order, normalization, zero/identity handling, and vector rotation semantics. - Port every constructor/operator/conversion and checked failure path. - Document conventions at the public API. ## Validation - All Quaternion/Matrix tests and rotation regression cases pass. - Golden transform chains match C# within original tolerances. - Focused benchmarks detect accidental pathological allocation but are not correctness gates. ## Prerequisite The full API shim and semantic test-suite gates are complete. ## Project constraints - Implement only in native Rust; no LibreMetaverse/.NET bridge, subprocess, RPC, or fallback. - Keep mapped public signatures fixed and do not weaken translated parity assertions. - Remove failing bodies only for owned behavior and leave unrelated modules untouched. - Update docs, coverage/parity status, and focused plus workspace validation evidence.
hugo added this to the 04 - Types implementation milestone 2026-08-08 08:16:22 +00:00
hugo added the enhancement label 2026-08-08 08:16:22 +00:00
Author
Owner

Implemented and pushed in commit 6699712 (Implement quaternion and matrix geometry).

Implementation:

  • Replaced all Quaternion and Matrix4 failure-only shims with native Rust: 119 mapped members covering constructors, operators, arithmetic, transforms, inversion, decomposition, interpolation, parsing, formatting, byte serialization, equality, and hashing.
  • Preserved the golden C# x/y/z/w component order, Hamilton multiplication direction, normalization thresholds, identity/zero behavior, row-major Matrix4 storage, row-vector transforms, translation in row four, and checked failure behavior.
  • Added public convention documentation, Object compatibility, mutable quaternion byte output mapping, generated coverage updates (10 native Types / 419 members), and controlled red-suite parity updates.
  • Added seven focused geometry regressions and a stable allocation benchmark. The optimized benchmark completed 250000 combined transform/interpolation iterations with 0 allocations and 0 reallocations.

Validation:

  • cargo test -p libremetaverse-types: 32 passed
  • translated TypeTests.Quaternions: passed
  • translated TypeTests.TestMatrix: passed
  • workspace-wide quaternion filter: passed
  • workspace-wide matrix filter: owned geometry tests passed; the only failures stop at unrelated GltfDocument.LoadGltf and Rendering.Joint shims
  • cargo bench -p libremetaverse-types --bench geometry: passed, 0 allocations
  • cargo build --workspace: passed
  • cargo test --workspace --no-run: passed
  • cargo clippy --workspace --all-targets -- -D warnings: passed
  • RUSTDOCFLAGS=-D warnings cargo doc --workspace --no-deps: passed
  • mapping/shim regeneration checks, API coverage, downstream API compile, test parity, test-surface regeneration, controlled red-suite audit, and git diff check: passed
  • controlled red suite is current at 56 passing and 1282 expected shim failures

Final review found every issue-owned mapped member implemented in native Rust with no .NET bridge, subprocess, fallback, or placeholder path.

Implemented and pushed in commit 6699712 (Implement quaternion and matrix geometry). Implementation: - Replaced all Quaternion and Matrix4 failure-only shims with native Rust: 119 mapped members covering constructors, operators, arithmetic, transforms, inversion, decomposition, interpolation, parsing, formatting, byte serialization, equality, and hashing. - Preserved the golden C# x/y/z/w component order, Hamilton multiplication direction, normalization thresholds, identity/zero behavior, row-major Matrix4 storage, row-vector transforms, translation in row four, and checked failure behavior. - Added public convention documentation, Object compatibility, mutable quaternion byte output mapping, generated coverage updates (10 native Types / 419 members), and controlled red-suite parity updates. - Added seven focused geometry regressions and a stable allocation benchmark. The optimized benchmark completed 250000 combined transform/interpolation iterations with 0 allocations and 0 reallocations. Validation: - cargo test -p libremetaverse-types: 32 passed - translated TypeTests.Quaternions: passed - translated TypeTests.TestMatrix: passed - workspace-wide quaternion filter: passed - workspace-wide matrix filter: owned geometry tests passed; the only failures stop at unrelated GltfDocument.LoadGltf and Rendering.Joint shims - cargo bench -p libremetaverse-types --bench geometry: passed, 0 allocations - cargo build --workspace: passed - cargo test --workspace --no-run: passed - cargo clippy --workspace --all-targets -- -D warnings: passed - RUSTDOCFLAGS=-D warnings cargo doc --workspace --no-deps: passed - mapping/shim regeneration checks, API coverage, downstream API compile, test parity, test-surface regeneration, controlled red-suite audit, and git diff check: passed - controlled red suite is current at 56 passing and 1282 expected shim failures Final review found every issue-owned mapped member implemented in native Rust with no .NET bridge, subprocess, fallback, or placeholder path.
hugo closed this issue 2026-08-08 22:54:56 +00:00
Sign in to join this conversation.