-
-
Notifications
You must be signed in to change notification settings - Fork 17
develop to main #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
develop to main #44
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
17cea2f
update: drop support for net48 in favor of netstandard2.1
mrdav30 cdceb0a
update: drop MessagePack support in favor of MemoryPack
mrdav30 638e983
task: update README
mrdav30 794ce1b
refactor: git actions wo net48
mrdav30 a6aa580
fix: action runner
mrdav30 600e379
Fix TFMs, exception args, stray semicolons, XML doc, and AGENTS.md fr…
Copilot 329a113
update: drop ThreadLocalRandom support
mrdav30 4bceb92
Merge branch 'develop' of https://github.com/mrdav30/FixedMathSharp i…
mrdav30 9bcb1c6
Fix review feedback: MemoryPack test names, BoundingBox.Union version…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # FixedMathSharp agent instructions | ||
|
|
||
| ## Project intent and architecture | ||
| - 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`). | ||
| - Most API surface lives in value-type numerics (`Fixed64`, `Vector2d`, `Vector3d`, `FixedQuaternion`, `Fixed3x3`, `Fixed4x4`) plus bounds types (`BoundingBox`, `BoundingSphere`, `BoundingArea`) implementing `IBound`. | ||
| - Keep operations deterministic and allocation-light; many methods use `m_rawValue` and `[MethodImpl(MethodImplOptions.AggressiveInlining)]` for hot paths. | ||
| - `FixedMath` and `FixedTrigonometry` are the shared algorithm backbones; extension classes in `src/FixedMathSharp/Numerics/Extensions/` are thin forwarding wrappers, not alternate implementations. | ||
|
|
||
| ## Build and test workflows | ||
| - Solution: `FixedMathSharp.sln` with library project and test project. | ||
| - 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 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 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 | ||
| - Tests are xUnit (`tests/FixedMathSharp.Tests`). Keep one feature area per test file (e.g., `Vector3d.Tests.cs`, `Bounds/BoundingBox.Tests.cs`). | ||
| - Use helper assertions from `tests/FixedMathSharp.Tests/Support/FixedMathTestHelper.cs` for tolerance/range checks rather than ad-hoc epsilon logic. | ||
| - For deterministic RNG changes, validate same-seed reproducibility and bounds/argument exceptions like in `DeterministicRandom.Tests.cs`. | ||
|
|
||
| ## Agent editing guidance | ||
| - Keep public API shape stable unless the task explicitly requests API changes. | ||
| - Match existing style (regions, XML docs, explicit namespaces, no implicit usings). | ||
| - Make focused edits in the relevant numeric/bounds module and update corresponding tests in the parallel test file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.