SwiftCollections.FixedMathSharp.Lean 9.0.1

dotnet add package SwiftCollections.FixedMathSharp.Lean --version 9.0.1
                    
NuGet\Install-Package SwiftCollections.FixedMathSharp.Lean -Version 9.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SwiftCollections.FixedMathSharp.Lean" Version="9.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SwiftCollections.FixedMathSharp.Lean" Version="9.0.1" />
                    
Directory.Packages.props
<PackageReference Include="SwiftCollections.FixedMathSharp.Lean" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SwiftCollections.FixedMathSharp.Lean --version 9.0.1
                    
#r "nuget: SwiftCollections.FixedMathSharp.Lean, 9.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SwiftCollections.FixedMathSharp.Lean@9.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SwiftCollections.FixedMathSharp.Lean&version=9.0.1
                    
Install as a Cake Addin
#tool nuget:?package=SwiftCollections.FixedMathSharp.Lean&version=9.0.1
                    
Install as a Cake Tool

SwiftCollections

SwiftCollections icon

Build Coverage NuGet License API Discord

Specialized .NET collections for games, simulations, and tools where data layout and predictable performance matter.

Iterate packed agent data, keep generation-checked references to live objects, query a 2D or 3D world, and reuse storage between updates. SwiftCollections gives you control over allocation, identity, and iteration in an engine-agnostic library built for demanding runtime workloads.

Get started · Choose a collection · Explore the API

Why SwiftCollections?

  • Keep hot data close. Lists, hash tables, dense sets, sparse maps, and ticket-based containers offer storage choices for lookup and packed iteration.
  • Give identities a clear owner. Stable slots, generation-checked tickets, and externally keyed stores support registrations, agent records, and optional component data.
  • Find nearby objects. BVH, spatial hash, quadtree, and octree indexes cover 2D and 3D broad-phase queries with caller-owned result buffers.
  • Build deterministic worlds. Fixed-point spatial queries powered by FixedMathSharp complement the core System.Numerics backends.
  • Reuse storage deliberately. Collection pools and explicit clearing controls help manage allocations, retained references, and ownership boundaries.
  • Persist the rules with the data. State-backed JSON and MemoryPack serialization include comparer persistence for supported collection owners; Lean packages keep JSON support without the MemoryPack runtime.

Benchmarks and enforced 100% line, branch, and executable-method coverage support the implementation. Use the BCL collections for general-purpose code, and choose SwiftCollections when its storage or ownership model fits your workload.

Install

Start with the core package:

dotnet add package SwiftCollections

Choose the package family that fits your application:

Need Package
Core collections with MemoryPack SwiftCollections
Core collections without the MemoryPack runtime SwiftCollections.Lean
FixedMathSharp spatial queries with MemoryPack SwiftCollections.FixedMathSharp
FixedMathSharp spatial queries without the MemoryPack runtime SwiftCollections.FixedMathSharp.Lean

For deterministic fixed-point spatial queries, install the companion. NuGet brings in the matching SwiftCollections and FixedMathSharp packages:

dotnet add package SwiftCollections.FixedMathSharp

Use the matching .Lean packages as a pair. Lean keeps the collection APIs but removes the MemoryPack runtime; it is useful when your application owns its serialization stack or wants the smaller dependency surface.

A quick taste

SwiftTicketMap<T> gives you stable slots with generation-checked tickets. Removal invalidates the current ticket, and ordinary slot reuse advances its generation:

using System;
using SwiftCollections;

var actors = new SwiftTicketMap<string>();
SwiftTicket player = actors.Add("player");

if (actors.TryGet(player, out string actor))
{
    Console.WriteLine(actor);
}

actors.Remove(player);
bool stillRegistered = actors.TryGet(player, out _); // false

Explore packed updates and optional components in the collection guide. It shows how dense ticket maps and externally keyed stores fit those workloads, with examples and the ownership, storage, and lifetime contracts for each choice.

Learn more

The documentation site brings together working examples, collection tradeoffs, and the full API reference:

Explore Start here
Storage, identity, dense iteration, and clearing Collections guide
2D/3D indexing and deterministic fixed-point queries Spatial queries
Rentals, reuse, and change notifications Pools and observables
State, comparer persistence, and host diagnostics Serialization and diagnostics

For existing projects, see the migration guide. For benchmarks, coverage, and local development, see Contributing and the coverage report.

Using Unity? The maintained SwiftCollections-Unity packages add Unity-serializable adapters, Bounds conversions, GameObject pooling, and FixedMathSharp integration.

Compatibility

The libraries target netstandard2.1 and net10.0. CI validates Standard and Lean builds on Windows and Linux.

Questions and discussion are welcome in the Discord community. SwiftCollections is available under the MIT License. See Support, the Code of Conduct, and Security for help and reporting guidance.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on SwiftCollections.FixedMathSharp.Lean:

Package Downloads
GridForge.Lean

A high-performance, deterministic rectangular and hex-prism voxel grid system for spatial partitioning, simulation, and game development.

Gravitas.Lean

High-performance, engine-agnostic fixed-point physics for deterministic 2D, 3D, and mixed-dimension lockstep games and simulations.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
9.0.1 0 11/26/2026
9.0.0 50 11/24/2026
8.0.0 261 11/5/2026
7.1.0 250 8/26/2026
7.0.0 246 8/5/2026
6.0.0 204 7/1/2026
5.1.1 178 6/24/2026
5.1.0 180 6/22/2026
5.0.2 192 6/20/2026
5.0.1 270 6/16/2026
5.0.0 152 6/10/2026
4.1.1 145 5/30/2026
4.1.0 143 5/26/2026
4.0.5 144 5/19/2026
4.0.4 137 5/10/2026
4.0.3 148 5/7/2026
4.0.2 138 5/3/2026