-
-
Notifications
You must be signed in to change notification settings - Fork 0
Testing and Benchmarking
DESKTOP-5KM6RA3\david edited this page Apr 25, 2026
·
2 revisions
This page explains how GridForge validates behavior and performance today.
The short version is:
- use the xUnit suite to protect correctness
- use the benchmark project when changing performance-sensitive or allocation-sensitive code
- treat
GridWorldboundaries as part of the validation story
| Track | Project | Best for |
|---|---|---|
| Tests | tests/GridForge.Tests |
Behavioral correctness, regressions, edge cases, and event semantics |
| Benchmarks | tests/GridForge.Benchmarks |
Allocation trends, warm-vs-cold pool effects, and throughput-sensitive changes |
The test suite uses xUnit v3 and a shared collection fixture:
-
GridForgeFixturesetsGridForgeLogger.MinimumLeveltoError -
GridForgeFixtureno longer creates the active runtime world by default -
[Collection("GridForgeCollection")]is still used where tests intentionally interact with shared compatibility state
New tests should prefer explicit GridWorld creation. The test project includes helpers such as GridWorldTestFactory to keep that setup small and consistent.
The test folders mirror the main subsystem boundaries:
-
tests/GridForge.Tests/Gridscovers world behavior, manager behavior, voxel/grid state, scan cells, and neighbor logic -
tests/GridForge.Tests/Blockerscovers blocker application, stacking, removal, and reapply behavior -
tests/GridForge.Tests/Utilitycovers tracing and logging -
tests/GridForge.Tests/Spatialcovers index and provider semantics
Phase 4 also added explicit isolation coverage for:
- multiple worlds loaded simultaneously with overlapping local coordinates
- stale identity rejection after world teardown
- blockers, occupants, tracing, and scans staying inside their owning world
dotnet restore GridForge.slnx
dotnet build GridForge.slnx --configuration Debug
dotnet test GridForge.slnx --configuration Debug --no-builddotnet test tests/GridForge.Tests/GridForge.Tests.csproj --configuration Debug --collect:"XPlat Code Coverage"Good GridForge tests usually:
- create their own
GridWorld - use deterministic positions and explicit expectations
- assert exact snapped values instead of fuzzy tolerances
- dispose or reset the world when the scenario finishes
dotnet run --project tests/GridForge.Benchmarks/GridForge.Benchmarks.csproj -c Release -f net8.0 -- list
dotnet run --project tests/GridForge.Benchmarks/GridForge.Benchmarks.csproj -c Release -f net8.0 -- allBenchmarkEnvironment:
- suppresses logging by setting
GridForgeLogger.MinimumLeveltoNone - creates or resets an explicit
GridWorldbetween iterations - optionally clears GridForge and shared SwiftCollections pools
- configures the world with the benchmark's requested voxel and spatial-hash settings