|
8 | 8 |
|
9 | 9 | ## Build and test workflows |
10 | 10 | - Solution: `FixedMathSharp.sln` with library project and test project. |
11 | | -- Target frameworks are multi-targeted in both projects: `net48;net8`. |
| 11 | +- Target frameworks are configured in the respective `.csproj` files; `net8.0` is the primary TFM. |
12 | 12 | - Typical local workflow: |
13 | 13 | - `dotnet restore` |
14 | 14 | - `dotnet build --configuration Debug --no-restore` |
15 | 15 | - `dotnet test --configuration Debug` |
16 | 16 | - CI detail from `.github/workflows/dotnet.yml`: |
17 | | - - Linux runs `net48` tests via Mono + `xunit.console.exe` and `net8` via `dotnet test -f net8`. |
18 | | - - Windows runs `dotnet test` for both TFMs. |
| 17 | + - Linux and Windows both run `dotnet test` against the supported TFMs (with `net8.0` as the primary test target). |
| 18 | + - Refer to the workflow file for the exact matrix of OS/TFM combinations. |
19 | 19 | - Packaging/versioning comes from `src/FixedMathSharp/FixedMathSharp.csproj`: GitVersion variables are consumed when present, otherwise version falls back to `0.0.0`. |
20 | 20 |
|
21 | 21 | ## Code conventions specific to this repo |
22 | 22 | - Prefer `Fixed64` constants (`Fixed64.Zero`, `Fixed64.One`, `FixedMath.PI`) over primitive literals in math-heavy code. |
23 | 23 | - Preserve saturating/guarded semantics in operators and math helpers (for example `Fixed64` add/sub overflow behavior). |
24 | 24 | - When touching bounds logic, maintain cross-type dispatch shape in `Intersects(IBound)` and shared clamping projection via `IBoundExtensions.ProjectPointWithinBounds`. |
25 | | -- Serialization compatibility is intentional: |
26 | | - - MessagePack attributes on serializable structs (`[MessagePackObject]`, `[Key]`) across TFMs. |
27 | | - - Conditional serializers in tests (`BinaryFormatter` for `NET48`, `System.Text.Json` for `NET8`). |
| 25 | +- Serialization compatibility is intentional and now uses MemoryPack: |
| 26 | + - MemoryPack attributes on serializable structs (for example `[MemoryPackable]`, `[MemoryPackInclude]`) are the source of truth for serialized layouts. |
| 27 | + - Tests use MemoryPack-based roundtrips (and `System.Text.Json` where appropriate) instead of legacy `MessagePack`/`BinaryFormatter` serializers. |
28 | 28 | - `ThreadLocalRandom` is marked `[Obsolete]`; new deterministic RNG work should prefer `DeterministicRandom` and `DeterministicRandom.FromWorldFeature(...)` in `src/FixedMathSharp/Utility/DeterministicRandom.cs`. |
29 | 29 |
|
30 | 30 | ## Testing patterns to mirror |
|
0 commit comments