Repository Layout and Build
This page is the operational map of the repo: where things live, how the solution is put together, and what the build actually does.
If you are onboarding as a contributor, this is the page that turns "I know what GridForge is" into "I know where to work and which command to run."
Install the SDK selected by global.json and the runtimes targeted by the test
and benchmark projects before running repository commands.
Solution Shape
The solution contains three projects:
| Project | Path | Purpose |
|---|---|---|
GridForge |
src/GridForge/GridForge.csproj |
Main deterministic voxel-grid library |
GridForge.Tests |
tests/GridForge.Tests/GridForge.Tests.csproj |
xUnit validation suite |
GridForge.Benchmarks |
tests/GridForge.Benchmarks/GridForge.Benchmarks.csproj |
BenchmarkDotNet performance and allocation benchmarks |
The root solution file is GridForge.slnx.
Repository Layout
| Path | What it contains |
|---|---|
src/GridForge |
Library source, package metadata, XML docs generation, and NuGet packaging configuration |
src/GridForge/Configuration |
Grid creation inputs and snapped bounds identity |
src/GridForge/Grids |
Core grid model, managers, node types, storage, topology, and pooling |
src/GridForge/Grids/Storage |
Dense and sparse physical voxel storage |
src/GridForge/Grids/Topology |
Per-grid topology metrics, snapping, dimensions, and world/index projection |
src/GridForge/Spatial |
Shared indices, occupants, partitions, directions, and awareness types |
src/GridForge/Blockers |
Bounds-based obstacle application built on tracer coverage |
src/GridForge/Diagnostics |
Engine-agnostic diagnostic descriptors, geometry, and dirty sessions |
src/GridForge/Support |
Cross-cutting support types and pooled query results |
src/GridForge/Utility |
Tracing and logging support |
tests/GridForge.Tests |
Unit tests organized by subsystem |
tests/GridForge.Benchmarks |
Focused perf and allocation scenarios |
.github/workflows |
CI automation |
.assets/scripts |
Release-oriented PowerShell helpers |
docs/api/guides |
Conceptual guides published alongside the API reference |
docs/api |
DocFX landing page, navigation, and API build configuration |
The solution also exposes a small set of root-level "solution items" such as
.editorconfig, README.md, AGENTS.md, and LICENSE. Coverage settings live
at tests/GridForge.Tests/coverlet.runsettings.
Main Library Build Facts
The library project in src/GridForge/GridForge.csproj establishes a few
important build behaviors:
- language version defaults to C# 14, with C# 11 for
netstandard2.1 - target frameworks are
netstandard2.1andnet10.0 ImplicitUsingsis disabledNullableis enabled in the library project- XML documentation files are generated
- deterministic and CI build flags are enabled
GeneratePackageOnBuildis enabled- the supported configurations are
Debug,Release, andReleaseLean
That last item is easy to miss: building the library also produces NuGet artifacts.
Package And Dependency Notes
The standard package depends on:
FixedMathSharpSwiftCollectionsSwiftCollections.FixedMathSharpMemoryPackChronicler.Diagnostics
The lean package is built by ReleaseLean or DisableMemoryPack=true and uses:
FixedMathSharp.LeanSwiftCollections.LeanSwiftCollections.FixedMathSharp.LeanChronicler.MemoryPackShimfor annotation compatibility without theMemoryPackruntime dependencyChronicler.Diagnosticsfor the same logging and guard surface- the
GRIDFORGE_DISABLE_MEMORYPACKcompilation symbol
Both package variants also reference System.Text.Json for the netstandard2.1
target only and expose the same core voxel-grid API.
The v10 dependency baseline is FixedMathSharp 8.0.0, SwiftCollections and its
FixedMathSharp integration 8.0.0, and Chronicler diagnostics/shim 1.0.0.
The source-mode FixedMathSharp package exclusions in the library, tests, and
benchmarks use the same 8.0.0 version; compilation and runtime assets come from
the sibling projects in that mode.
Packaging also includes the root README.md, LICENSE, NOTICE, COPYRIGHT,
and icon.png.
Versioning Behavior
The project is wired to consume GitVersion environment variables when they are available.
In practice that means:
- CI can stamp semantic version, assembly version, and informational version automatically
- local builds still work without GitVersion and fall back to version
0.0.0
That fallback is intentional and keeps local iteration simple.
What dotnet build Produces
When you build src/GridForge/GridForge.csproj, expect:
- compiled library outputs under
src/GridForge/bin/<Configuration>/<TargetFramework>/ - XML documentation alongside the assembly
.nupkgand.snupkgpackage artifacts because package generation is enabled on build
If you are only expecting a DLL and a testable build, this packaging behavior can look surprising the first time you notice it.
Validation Project Facts
GridForge.Tests
The test project:
- targets
net10.0 - is marked as a test project and not packable
- references the main library project directly
- supports
Debug,Release, andReleaseLean - uses xUnit v3 plus the Visual Studio runner and console runner
- includes
coverlet.collector - points to
coverlet.runsettings
The runsettings exclude generated MemoryPack files from coverage collection so the report measures maintained source.
GridForge.Benchmarks
The benchmark project:
- targets
net10.0 - is an executable
- references the main library project directly
- supports
Debug,Release, andReleaseLean - uses BenchmarkDotNet
- is optimized for benchmark runs
This project is where allocation-sensitive or throughput-sensitive changes should be checked.
Common Build Commands
The usual local flow is:
dotnet restore GridForge.slnx
dotnet build GridForge.slnx --configuration Debug
dotnet test GridForge.slnx --configuration Debug --no-build
When iterating across sibling LSF repositories, set
$env:UseLocalLsfStack = 'true' and pass
-p:DisableTransitiveProjectReferences=true on restore, build and test
commands. The global property preserves explicit dependency identities in
sibling projects. Library, test and benchmark projects then use sibling
FixedMathSharp, SwiftCollections and Chronicler projects, plus the local
Chronicler.MemoryPackShim in Lean builds. Without that switch, normal package
references and versions remain authoritative.
When you specifically want release-like library artifacts:
dotnet build src/GridForge/GridForge.csproj --configuration Release
Because packaging is enabled on build, this also emits the package artifacts.
API Documentation And GitHub Pages
The Release build produces the assembly and XML documentation consumed by DocFX. Build the local documentation site with:
dotnet build src/GridForge/GridForge.csproj --configuration Release
dotnet tool restore
dotnet tool run docfx docs/api/docfx.json --warningsAsErrors
The authored site surface lives under docs/api:
index.mdis the user-facing landing pageguidesowns conceptual Markdown published beside the API referenceoverridesadds namespace-level orientation and Unity adapter linkstemplates/gridforgesupplies the blue/cyan theme and GitHub header icon.assets/icon_128x128.pngis copied as the site logo and faviconobjcontains generated metadata and HTML and should not be edited
The generated site is written to docs/api/obj/_site. On successful pushes to
main, .github/workflows/coverage.yml validates the landing page, API roots,
theme, icon, and repository links before publishing the site to GitHub Pages.
The coverage report is placed beneath /coverage.
CI Expectations
The CI workflow lives in .github/workflows/build-and-test.yml.
At a high level it:
- runs on
ubuntu-latestandwindows-latest - triggers on pushes except
dependabot/**,gh-pages, and version tags likev* - triggers on pull requests targeting
mainordevelop - installs .NET 10
- installs and executes GitVersion
- restores dependencies
- builds the solution in both
ReleaseandReleaseLean - runs the test suite in both
ReleaseandReleaseLean
This is a useful sanity check when deciding whether a change is likely to be cross-platform safe.
Release Helper Script
.assets/scripts/set-version-and-build.ps1 is the repo helper for version-aware
release builds.
Its flow is:
- locate the solution root
- ensure GitVersion environment variables are present
- build both
ReleaseandReleaseLean - walk each release target-framework output folder
- zip each framework output into a versioned archive under
artifacts/releases
That makes it the practical handoff script for release packaging, not just a
convenience wrapper around dotnet build.
Build And Repo Pitfalls
- Forgetting that the library builds for two target frameworks
- Forgetting that build also creates NuGet packages
- Assuming CI only validates on one operating system
- Editing files under
bin,obj, orTestResultsinstead of the source that produces them - Treating the benchmark project as optional when changing pooling, tracing, storage, topology, or registration behavior
Read This Next
- Testing and Benchmarking for the validation workflow
- Determinism, Snapping, and Pooling for the invariants that build and tests are protecting
- Home for the broader architecture map and page roadmap