From 0b706721400995a22a4ccf4ad9108e143330a443 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 04:29:06 +0000 Subject: [PATCH 1/2] Initial plan From a5a5ae2770d20b4b9d0e36d8ee01f2e085473683 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 04:33:05 +0000 Subject: [PATCH 2/2] fix: apply PR review feedback - TFMs, exception args, stray semicolons, XML doc, AGENTS.md Co-authored-by: mrdav30 <11547347+mrdav30@users.noreply.github.com> --- AGENTS.md | 12 ++++++------ src/FixedMathSharp/Bounds/BoundingArea.cs | 1 - src/FixedMathSharp/Bounds/BoundingBox.cs | 3 +-- src/FixedMathSharp/Bounds/BoundingSphere.cs | 1 - src/FixedMathSharp/FixedMathSharp.csproj | 6 +----- src/FixedMathSharp/Numerics/FixedQuaternion.cs | 4 ++-- .../FixedMathSharp.Tests/FixedMathSharp.Tests.csproj | 6 +----- 7 files changed, 11 insertions(+), 22 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 60ed110..4eae149 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,23 +8,23 @@ ## Build and test workflows - Solution: `FixedMathSharp.sln` with library project and test project. -- Target frameworks are multi-targeted in both projects: `net48;net8`. +- Target frameworks are configured in the respective `.csproj` files; `net8.0` is the primary TFM. - Typical local workflow: - `dotnet restore` - `dotnet build --configuration Debug --no-restore` - `dotnet test --configuration Debug` - CI detail from `.github/workflows/dotnet.yml`: - - Linux runs `net48` tests via Mono + `xunit.console.exe` and `net8` via `dotnet test -f net8`. - - Windows runs `dotnet test` for both TFMs. + - Linux and Windows both run `dotnet test` against the supported TFMs (with `net8.0` as the primary test target). + - Refer to the workflow file for the exact matrix of OS/TFM combinations. - Packaging/versioning comes from `src/FixedMathSharp/FixedMathSharp.csproj`: GitVersion variables are consumed when present, otherwise version falls back to `0.0.0`. ## Code conventions specific to this repo - Prefer `Fixed64` constants (`Fixed64.Zero`, `Fixed64.One`, `FixedMath.PI`) over primitive literals in math-heavy code. - Preserve saturating/guarded semantics in operators and math helpers (for example `Fixed64` add/sub overflow behavior). - When touching bounds logic, maintain cross-type dispatch shape in `Intersects(IBound)` and shared clamping projection via `IBoundExtensions.ProjectPointWithinBounds`. -- Serialization compatibility is intentional: - - MessagePack attributes on serializable structs (`[MessagePackObject]`, `[Key]`) across TFMs. - - Conditional serializers in tests (`BinaryFormatter` for `NET48`, `System.Text.Json` for `NET8`). +- Serialization compatibility is intentional and now uses MemoryPack: + - MemoryPack attributes on serializable structs (for example `[MemoryPackable]`, `[MemoryPackInclude]`) are the source of truth for serialized layouts. + - Tests use MemoryPack-based roundtrips (and `System.Text.Json` where appropriate) instead of legacy `MessagePack`/`BinaryFormatter` serializers. - `ThreadLocalRandom` is marked `[Obsolete]`; new deterministic RNG work should prefer `DeterministicRandom` and `DeterministicRandom.FromWorldFeature(...)` in `src/FixedMathSharp/Utility/DeterministicRandom.cs`. ## Testing patterns to mirror diff --git a/src/FixedMathSharp/Bounds/BoundingArea.cs b/src/FixedMathSharp/Bounds/BoundingArea.cs index b526ec3..e5bc39e 100644 --- a/src/FixedMathSharp/Bounds/BoundingArea.cs +++ b/src/FixedMathSharp/Bounds/BoundingArea.cs @@ -209,7 +209,6 @@ public bool Intersects(IBound other) default: return false; // Default case for unknown or unsupported types } - ; } /// diff --git a/src/FixedMathSharp/Bounds/BoundingBox.cs b/src/FixedMathSharp/Bounds/BoundingBox.cs index d93c666..b32b7ca 100644 --- a/src/FixedMathSharp/Bounds/BoundingBox.cs +++ b/src/FixedMathSharp/Bounds/BoundingBox.cs @@ -39,7 +39,7 @@ public partial struct BoundingBox : IBound, IEquatable public Vector3d Max { get; private set; } /// - /// + /// Serialization/compatibility version of this instance. /// [MemoryPackOrder(2)] public byte Version { get; private set; } @@ -238,7 +238,6 @@ public bool Intersects(IBound other) default: return false; // Default case for unknown or unsupported types } - ; } /// diff --git a/src/FixedMathSharp/Bounds/BoundingSphere.cs b/src/FixedMathSharp/Bounds/BoundingSphere.cs index df13653..42c2665 100644 --- a/src/FixedMathSharp/Bounds/BoundingSphere.cs +++ b/src/FixedMathSharp/Bounds/BoundingSphere.cs @@ -108,7 +108,6 @@ public bool Intersects(IBound other) default: return false; // Default case for unknown or unsupported types } - ; } /// diff --git a/src/FixedMathSharp/FixedMathSharp.csproj b/src/FixedMathSharp/FixedMathSharp.csproj index 56b864f..9da0600 100644 --- a/src/FixedMathSharp/FixedMathSharp.csproj +++ b/src/FixedMathSharp/FixedMathSharp.csproj @@ -3,7 +3,7 @@ 11.0 - netstandard2.1;net8 + netstandard2.1;net8.0 $(GitVersion_FullSemVer) @@ -68,10 +68,6 @@ - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - diff --git a/src/FixedMathSharp/Numerics/FixedQuaternion.cs b/src/FixedMathSharp/Numerics/FixedQuaternion.cs index 3618472..8700d9f 100644 --- a/src/FixedMathSharp/Numerics/FixedQuaternion.cs +++ b/src/FixedMathSharp/Numerics/FixedQuaternion.cs @@ -372,7 +372,7 @@ public static FixedQuaternion FromAxisAngle(Vector3d axis, Fixed64 angle) // Check if the angle is in a valid range (-pi, pi) if (angle < -FixedMath.PI || angle > FixedMath.PI) - throw new ArgumentOutOfRangeException($"Angle must be in the range ({-FixedMath.PI}, {FixedMath.PI}), but was {angle}"); + throw new ArgumentOutOfRangeException(nameof(angle), angle, $"Angle must be in the range ({-FixedMath.PI}, {FixedMath.PI}), but was {angle}"); Fixed64 halfAngle = angle / Fixed64.Two; // Half-angle formula Fixed64 sinHalfAngle = FixedMath.Sin(halfAngle); @@ -412,7 +412,7 @@ public static FixedQuaternion FromEulerAngles(Fixed64 pitch, Fixed64 yaw, Fixed6 yaw < -FixedMath.PI || yaw > FixedMath.PI || roll < -FixedMath.PI || roll > FixedMath.PI) { - throw new ArgumentOutOfRangeException($"Euler angles must be in the range ({-FixedMath.PI}, {FixedMath.PI}), but were ({pitch}, {yaw}, {roll})"); + throw new ArgumentOutOfRangeException(nameof(pitch), $"Euler angles must be in the range ({-FixedMath.PI}, {FixedMath.PI}), but were ({pitch}, {yaw}, {roll})"); } Fixed64 c1 = FixedMath.Cos(yaw / Fixed64.Two); diff --git a/tests/FixedMathSharp.Tests/FixedMathSharp.Tests.csproj b/tests/FixedMathSharp.Tests/FixedMathSharp.Tests.csproj index 02b9ccc..eb32999 100644 --- a/tests/FixedMathSharp.Tests/FixedMathSharp.Tests.csproj +++ b/tests/FixedMathSharp.Tests/FixedMathSharp.Tests.csproj @@ -1,7 +1,7 @@  11.0 - net8 + net8.0 disable enable false @@ -16,10 +16,6 @@ all - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - runtime; build; native; contentfiles; analyzers; buildtransitive