GameDeterminism.Analyzers 0.1.2

dotnet add package GameDeterminism.Analyzers --version 0.1.2
                    
NuGet\Install-Package GameDeterminism.Analyzers -Version 0.1.2
                    
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="GameDeterminism.Analyzers" Version="0.1.2">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GameDeterminism.Analyzers" Version="0.1.2" />
                    
Directory.Packages.props
<PackageReference Include="GameDeterminism.Analyzers">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
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 GameDeterminism.Analyzers --version 0.1.2
                    
#r "nuget: GameDeterminism.Analyzers, 0.1.2"
                    
#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 GameDeterminism.Analyzers@0.1.2
                    
#: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=GameDeterminism.Analyzers&version=0.1.2
                    
Install as a Cake Addin
#tool nuget:?package=GameDeterminism.Analyzers&version=0.1.2
                    
Install as a Cake Tool

Drift

CI CodeQL License: MIT OR Apache-2.0 Docs

Static lints that catch game-simulation non-determinism — HashMap/HashSet iteration, unseeded RNG, wall-clock reads, unordered parallelism, pointer-width fields on hashed state, non-associative float arithmetic reachable from simulation code — before they cause a lockstep/rollback-netcode desync, instead of debugging the desync after the fact.

Companion to Foldback (runtime desync detection and bisection): drift prevents what it can at build time, Foldback finds what slips through at runtime.

Pick your language

Language What you get
Rust crates/drift-lint, a dylint lint library, 6 rules
C# / Unity bindings/csharp/Drift.Analyzers, a Roslyn analyzer, 5 rules (DRIFT0001–0005) — works in any C# project; Unity-specific rules are scoped to UnityEngine.* types; float_outside_fixed_step not ported here; published on NuGet as GameDeterminism.Analyzers, not Drift.Analyzers (see the C# quickstart below for why)
C++ / Unreal bindings/unreal/drift-unreal-lint, a standalone binary over stock LLVM/Clang (no engine fork needed), full 6-rule taxonomy parity, against a project's compile_commands.json
GDScript / Godot bindings/godot/drift-godot-lint, a standalone binary over gdck-syntax (pure Rust, no engine dependency), 4 of 6 rules (hashmap_iter/usize_in_hashed_state don't apply to GDScript, see below)

Full rule reference, one entry per rule with a real example and fix: docs/rule-catalog.md. Full step-by-step walkthroughs on the docs site: Rust, C# / Unity, Unreal, Godot.

Rust quickstart

cargo install cargo-dylint dylint-link
cargo dylint --path crates/drift-lint --workspace

(--path works against a local clone; a --git https://github.com/FelixMiddelhoff/drift install works the same way once this is pushed. Not published to crates.io — see docs/rule-catalog.md for why, and cargo dylint's own docs for the full CLI.)

C# / Unity quickstart

dotnet add package GameDeterminism.Analyzers

(Published as GameDeterminism.Analyzers, not Drift.AnalyzersDrift is a reserved NuGet ID prefix owned by someone else, unrelated to this project.)

Or reference the built Drift.Analyzers.dll directly as an Analyzer item in your .csproj:

<ItemGroup>
  <Analyzer Include="path/to/Drift.Analyzers.dll" />
</ItemGroup>

dotnet pack bindings/csharp/Drift.Analyzers builds the package locally in the correct analyzers/dotnet/cs/ layout that VS/Rider/VS Code auto-load on install.

Unreal quickstart

Generate a compile_commands.json with UnrealBuildTool, then run drift-unreal-lint against it. Grab a prebuilt binary from the latest release (Linux/macOS/Windows), or build from source:

"<EnginePath>/Engine/Binaries/DotNET/UnrealBuildTool/UnrealBuildTool.exe" \
  -Mode=GenerateClangDatabase -Project="<YourProject>.uproject" <Target> Win64 Development

LIBCLANG_PATH="<path to your LLVM install>/bin" \
  cargo run --manifest-path bindings/unreal/drift-unreal-lint/Cargo.toml -- \
  compile_commands.json [config.toml]

(A prebuilt drift-unreal-lint binary still needs LIBCLANG_PATH set at runtime — it links libclang dynamically, doesn't bundle it.)

unseeded_rng, wallclock_read, hashmap_iter, unordered_parallelism, and usize_in_hashed_state run unconditionally. float_outside_fixed_step is opt-in — it does nothing until config.toml sets tick_reachable_roots:

tick_reachable_roots = ["AMyPawn::Tick"]
fixed_step_functions = ["UMyIntegrator::Step"]

Uses stock LLVM/Clang directly (the clang crate over libclang) — no forked compiler, no custom clang-tidy check to build. See docs/rule-catalog.md for each rule's own known limitations.

Godot quickstart

Grab a prebuilt binary from the latest release (Linux/macOS/Windows, no toolchain needed — pure Rust, no engine dependency), or build from source:

cargo run --manifest-path bindings/godot/drift-godot-lint/Cargo.toml -- <file.gd | project directory>

unseeded_rng, wallclock_read, and unordered_parallelism run unconditionally. float_outside_fixed_step runs automatically wherever _process/_physics_process is defined — no config file needed, unlike the Rust/Unreal sides (Godot's own tick entry points are fixed, well-known method names). Pure Rust, no engine dependency (via gdck-syntax). See docs/rule-catalog.md for why the other 2 rules don't apply here.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.2 39 9/17/2026
0.1.1 44 9/17/2026
0.1.0 44 9/16/2026