Skip to content

Commit df8d45c

Browse files
committed
refactor: cleanup serialization effort
+semver: minor
1 parent 5223461 commit df8d45c

27 files changed

Lines changed: 8840 additions & 8594 deletions

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
root = true
2+
[*]
3+
end_of_line = lf

AGENTS.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# FixedMathSharp agent instructions
22

33
## Project intent and architecture
4+
45
- This repository is a deterministic fixed-point math library centered on `Fixed64` (`src/FixedMathSharp/Numerics/Fixed64.cs`) with Q32.32 representation (`SHIFT_AMOUNT_I = 32` in `src/FixedMathSharp/Core/FixedMath.cs`).
56
- Most API surface lives in value-type numerics (`Fixed64`, `Vector2d`, `Vector3d`, `FixedQuaternion`, `Fixed3x3`, `Fixed4x4`) plus bounds types (`BoundingBox`, `BoundingSphere`, `BoundingArea`) implementing `IBound`.
67
- Keep operations deterministic and allocation-light; many methods use `m_rawValue` and `[MethodImpl(MethodImplOptions.AggressiveInlining)]` for hot paths.
78
- `FixedMath` and `FixedTrigonometry` are the shared algorithm backbones; extension classes in `src/FixedMathSharp/Numerics/Extensions/` are thin forwarding wrappers, not alternate implementations.
89

910
## Build and test workflows
11+
1012
- Solution: `FixedMathSharp.sln` with library project and test project.
1113
- Target frameworks are configured in the respective `.csproj` files; `net8.0` is the primary TFM.
1214
- Typical local workflow:
@@ -19,6 +21,7 @@
1921
- Packaging/versioning comes from `src/FixedMathSharp/FixedMathSharp.csproj`: GitVersion variables are consumed when present, otherwise version falls back to `0.0.0`.
2022

2123
## Code conventions specific to this repo
24+
2225
- Prefer `Fixed64` constants (`Fixed64.Zero`, `Fixed64.One`, `FixedMath.PI`) over primitive literals in math-heavy code.
2326
- Preserve saturating/guarded semantics in operators and math helpers (for example `Fixed64` add/sub overflow behavior).
2427
- When touching bounds logic, maintain cross-type dispatch shape in `Intersects(IBound)` and shared clamping projection via `IBoundExtensions.ProjectPointWithinBounds`.
@@ -28,11 +31,14 @@
2831
- `ThreadLocalRandom` is marked `[Obsolete]`; new deterministic RNG work should prefer `DeterministicRandom` and `DeterministicRandom.FromWorldFeature(...)` in `src/FixedMathSharp/Utility/DeterministicRandom.cs`.
2932

3033
## Testing patterns to mirror
34+
3135
- Tests are xUnit (`tests/FixedMathSharp.Tests`). Keep one feature area per test file (e.g., `Vector3d.Tests.cs`, `Bounds/BoundingBox.Tests.cs`).
3236
- Use helper assertions from `tests/FixedMathSharp.Tests/Support/FixedMathTestHelper.cs` for tolerance/range checks rather than ad-hoc epsilon logic.
3337
- For deterministic RNG changes, validate same-seed reproducibility and bounds/argument exceptions like in `DeterministicRandom.Tests.cs`.
3438

3539
## Agent editing guidance
40+
3641
- Keep public API shape stable unless the task explicitly requests API changes.
3742
- Match existing style (regions, XML docs, explicit namespaces, no implicit usings).
38-
- Make focused edits in the relevant numeric/bounds module and update corresponding tests in the parallel test file.
43+
- Make focused edits in the relevant numeric/bounds module and update corresponding tests in the parallel test file.
44+
- For serialization changes, ensure MemoryPack attributes are correctly applied and roundtrip tests are updated.

0 commit comments

Comments
 (0)