Releases: mrdav30/FixedMathSharp
FixedMathSharp v5.0.0
FixedMathSharp v5.0.0
FixedMathSharp v5.0.0 is a major API hardening, determinism, and performance release. It removes legacy API shapes, makes numeric conversion boundaries explicit, standardizes 3D transform conventions, and adds a BenchmarkDotNet performance lab.
What's Changed
- Hardened the v5 public API by removing ambiguous legacy surfaces, standardizing vector naming and mutation patterns, centralizing scalar algorithms on
FixedMath, and splitting large numeric types into focused partial files. - Renamed bounds APIs to fixed-point naming:
FixedBoundBox,FixedBoundSphere,FixedBoundArea,FixedBoundFrustum, andFixedEnclosureType. - Made
Fixed64conversions explicit:Parse/TryParsenow handle decimal value text.ParseRaw/TryParseRawhandle raw Q32.32 payload text.- Floating-point conversions now reject non-finite or out-of-range values.
- Standardized 3D transform semantics around
+Xright,+Yup,+Zforward, row-vector transforms,M41/M42/M43translation, and left-to-right affine composition. - Added
Axis3dandCoordinateConvention3dfor adapting external coordinate systems without changing core runtime semantics. - Fixed correctness issues in quaternion direction handling, matrix composition, checked floating-point conversion paths, and stale build assets.
- Added diagnostic formatting support with
ToString(...),TryFormat(...), andISpanFormattableon supported targets. - Added BenchmarkDotNet coverage for scalar math, trigonometry, vectors, quaternions, matrices, bounds, curves, ranges, RNG, serialization, and diagnostics formatting.
- Improved performance across scalar/trigonometry guards, bounds construction, vector normalization, matrix transforms/inversion, quaternion paths, span-based sphere construction, and squared-distance checks.
- Hardened local and CI workflows with isolated intermediate outputs, opt-in local coverage, and preserved
Release/ReleaseLeanvalidation paths. - Expanded tests around the new API, conversion policy, transform conventions, diagnostics formatting, geometry behavior, and benchmarked hot paths.
Breaking Changes
This release intentionally includes source-breaking API cleanup. See docs/MIGRATION.md before upgrading.
High-impact changes:
- Bounds types were renamed:
BoundingBox->FixedBoundBoxBoundingSphere->FixedBoundSphereBoundingArea->FixedBoundAreaBoundingFrustum->FixedBoundFrustumContainmentType->FixedEnclosureType
Fixed64.ParseandFixed64.TryParsenow parse decimal value text. UseParseRaw/TryParseRawfor raw Q32.32 payload text.- Removed or replaced ambiguous numeric APIs, including:
Fixed64(double)Fixed64.FractionFixed64arithmetic operators withlong- vector double constructors
FixedRange.InRange(double)DeterministicRandom.NextDouble
- Vector naming was standardized:
x/y/z/w->X/Y/Z/WNormal->NormalizedNormalize()->NormalizeInPlace()SqrMagnitude->MagnitudeSquaredSqrDistance->DistanceSquared
- Legacy public vector-result
out Vector*dhelper overloads were removed in favor of return-by-value APIs and explicit*InPlacemethods. Fixed4x4.Decomposenow returnstranslation, rotation, scale.- Matrix code should be audited for row-vector affine semantics.
Migration
Review docs/MIGRATION.md before upgrading production code, especially if you persist raw Fixed64 text, synchronize deterministic state, copy matrices from engine APIs, or depend on v4 geometry type names.
FixedMathSharp v4.0.1
FixedMathSharp v4.0.1
This patch focuses on release reliability, test hardening, and documentation for the Q32.32 Fixed64 core.
What's Changed
- Hardened NuGet publishing for release tags, including manual dispatch by tag, checked-out release refs, tag/version validation, and stricter package artifact validation.
- Updated release packaging scripts to include both
FixedMathSharpandFixedMathSharp.FluentAssertionsoutputs acrossReleaseandReleaseLean. - Moved coverage publishing to the
Releaseconfiguration. - Expanded focused test coverage to reach 100% line and branch coverage across the instrumented library.
- Removed confirmed unreachable hot-path branches in fixed-point math, bounds/ray intersection, curve evaluation, and deterministic RNG paths.
- Renamed the trigonometry partial file to
FixedMath.Trigonometry.csfor clearer source organization. - Added consistent MIT license headers across source files.
- Added
Fixed64representation documentation covering Q32.32 layout, raw values, range, precision, and scaled-integer behavior.
Notes
- No public API changes are intended in this patch.
FixedMathSharp v4.0.0
FixedMathSharp 4.0.0 is a major geometry, transform, packaging, and reliability release. This version expands the deterministic fixed-point API with frustum, plane, ray, and 4D vector support while hardening several core math paths.
Breaking Changes
- Removed the public
IBoundabstraction and genericIntersects(IBound)dispatch. Use the new strongly typedContains(...)andIntersects(...)overloads onBoundingBox,BoundingArea,BoundingSphere,BoundingFrustum,FixedPlane, andFixedRay. - Renamed the no-MemoryPack build/package path from
ReleaseNoMemoryPack/FixedMathSharp.NoMemoryPacktoReleaseLean/FixedMathSharp.Lean.
Added
- Added
BoundingFrustumwith matrix/plane construction, containment checks, intersection checks, corners, planes, and clamp support. - Added
FixedPlane,FixedPlaneIntersectionType, andContainmentTypefor richer deterministic spatial queries. - Added
FixedRaywith intersections against planes, boxes, areas, spheres, and frustums. - Added
Vector4dwith arithmetic, comparisons, normalization, distance/dot helpers, matrix transforms, fuzzy equality helpers, JSON support, and MemoryPack support. - Added expanded
Fixed4x4transform helpers, including translation, rotation, scale, look-at, world, orthographic, perspective, inversion, point transforms, andVector4dtransforms. - Added Lean package output for
FixedMathSharp.FluentAssertions.Lean.
Improved
- Hardened
BoundingBox,BoundingArea,BoundingSphere, and frustum behavior with typed containment/intersection APIs. - Hardened quaternion normalization, rotation, Euler conversion, division, interpolation, and matrix conversion behavior.
- Improved
Fixed4x4affine handling and transform/inversion coverage. - Improved release automation with centralized archive output and a NuGet publishing workflow for standard and Lean packages.
- Reorganized source files by domain while preserving the public
FixedMathSharpnamespace.
Fixed
- Fixed a
Fixed64multiplication saturation edge case where overflow during rounded 128-bit shifting could wrap before saturation. - Fixed release-configuration test discrepancies, including Lean/MemoryPack-disabled scenarios.
- Removed unreachable/dead bounding-sphere merge code surfaced during coverage hardening.
Quality
- Expanded tests across geometry, bounds, matrices, quaternions, vectors, assertions, serialization-related paths, and Lean builds.
- Added complexity exception documentation for intentionally complex performance-sensitive methods.
- Refreshed README and contributor-facing guidance for the current API and release workflow.
Full Changelog: 1bec7da...be39470
FixedMathSharp v3.0.1
Fixed
- Fixed a
Fixed64initialization issue that could trigger circular static-constructor errors when operators were used during type initialization. - Updated internal max/min fallback paths to avoid relying on static members during early initialization.
Added
- Added a
NoMemoryPackbuild/package variant for consumers that want to use FixedMathSharp without theMemoryPackdependency. - Added a compile-time shim so the library can build cleanly when
MemoryPackis disabled.
Changed
- Updated build and packaging scripts to produce both standard and
NoMemoryPackrelease outputs. - Migrated the solution to
.slnxand refreshed CI/workflow configuration accordingly. - Improved public documentation and README guidance, including package selection and Unity/Burst recommendations.
FixedMathSharp v3.0.0
- Breaking Changes
- Removed float-based numeric/vector overloads to enforce deterministic usage across
Vector2dandVector3d. - Core precision API refactor:
Fixed64.Precisionreplaced withFixed64.MinIncrement.- Default epsilon/tolerance semantics were redefined (
FixedMath.DEFAULT_TOLERANCE_L/Fixed64.Epsilon), which can change fuzzy-comparison behavior.
- Removed float-based numeric/vector overloads to enforce deterministic usage across
- Added
FixedMath.InvertedPIconstant.- New
Vector3d.SnapSmallComponentsToZero(...)helper for zeroing tiny components under a threshold.
- Changed
- Degree/radian conversion paths in trigonometry moved to fixed-point math paths for deterministic consistency.
- Vector epsilon guards improved across vector/component comparison logic.
- Fixed
- Hardened
Fixed64scalar multiply/divide operator behavior, including improved 128-bit intermediate rounding/saturation handling. - Quaternion math corrections:
- Euler conversion alignment (YXZ order consistency).
- Rotation extraction stabilization (including matrix-based paths).
- Additional
Fixed64operator corrections from #48.
- Hardened
- Maintenance
- Project/test setup cleanup and release metadata housekeeping commits.
- Migration Notes
- Replace uses of
Fixed64.PrecisionwithFixed64.MinIncrement. - Remove/update any call sites relying on removed float overloads.
- Re-validate tolerance-sensitive tests/simulations due to epsilon behavior changes.
- Replace uses of
FixedMathSharp v2.1.1
v2.1.1 is a hardening release focused on correctness, packaging reliability, and overall library quality.
This update adds a few small API improvements, including component-wise epsilon helpers for Vector2d and Vector3d, a convenience Fixed4x4.NormalizeRotationMatrix() extension, and a new companion package, FixedMathSharp.FluentAssertions, for reusable assertions in downstream test projects.
It also fixes several edge cases uncovered during the hardening pass: negative midpoint rounding in FixedMath.Round, clamped-dot handling in Vector3d.Slerp, FixedCurve nullability and small-array construction issues that triggered MemoryPack warnings, and incomplete hashing in Fixed4x4.GetHashCode. On the packaging side, .NET Standard 2.1 dependency handling was cleaned up and the temporary JSON shim was removed in favor of explicit System.Text.Json dependency handling.
Internally, BoundingArea.Intersects, BoundingBox.Intersects, and Vector3d.ClosestPointsOnTwoLines were refactored to reduce complexity without changing behavior, and an unreachable branch in FixedTrigonometry.Pow2 was removed. Along the way, test coverage was expanded substantially across the core math surface, and the repository now publishes coverage reports as part of the project’s documentation and release quality bar.
FixedMathSharp v2.1.0
This release focuses on serialization cleanup and compatibility rather than numeric behavior changes.
Refactor
- Improved serialization support across core numerics and bounds types, including Fixed64, vectors, matrices, quaternions, ranges, curves, BoundingArea, BoundingBox, and BoundingSphere.
- Added explicit System.Text.Json metadata so JSON round-trips no longer depend on IncludeFields or IgnoreReadOnlyProperties.
- Added non-.NET 8 JSON attribute shims to keep serialization annotations working across older target frameworks.
- Simplified BoundingBox serialization to a state-based payload using Min and Max, removing the old versioned serialization field.
- Expanded JSON and MemoryPack round-trip test coverage for the affected types.
- Added .editorconfig and normalized formatting across the touched files.
Migration Note
If you relied on BoundingBox’s old (min, max, version) constructor or serialized Version field, update to the new state-based contract.
FixedMathSharp v2.0.0
Breaking changes
- Dropped .NET Framework 4.8 support.
- Added/standardized support on netstandard2.1 (with net8 retained).
- Serialization stack changed from MessagePack to MemoryPack.
Updated tooling/runtime settings
- C# language version bumped to 11.0.
- Test project modernized:
- moved to net8
- updated test SDK/packages (including xUnit v3-related packages and newer test tooling).
Internal/maintenance
- Added basic AGENTS.md.
- Minor hash code implementation cleanup in core numeric structs (no API expansion, but behavior may differ for hash-based scenarios).
What's Changed
Full Changelog: v1.3.4...2.0.0
FixedMathSharp v1.3.4
- BugFix
- refactored
BoundingBoxto use a canonical min/max representation internally- removes dual-state risk of tracking scope and size separately
- refactored
FixedMathSharp v1.3.3
- New Features
- Added new
DeterministicRandomstruct.- Switched to using xoroshiro128++ with splitmix64 seeding to ensure no allocations, no time/GUID.
- Added new
- Notice
- Marked
ThreadLocalRandomobsoleteDeterministicRandomgives explicit, reproducible streams keyed to your world/feature, independent of threading.
- Marked