Bascule.RL
0.1.0-alpha
dotnet add package Bascule.RL --version 0.1.0-alpha
NuGet\Install-Package Bascule.RL -Version 0.1.0-alpha
<PackageReference Include="Bascule.RL" Version="0.1.0-alpha" />
<PackageVersion Include="Bascule.RL" Version="0.1.0-alpha" />
<PackageReference Include="Bascule.RL" />
paket add Bascule.RL --version 0.1.0-alpha
#r "nuget: Bascule.RL, 0.1.0-alpha"
#:package Bascule.RL@0.1.0-alpha
#addin nuget:?package=Bascule.RL&version=0.1.0-alpha&prerelease
#tool nuget:?package=Bascule.RL&version=0.1.0-alpha&prerelease
Bascule.RL
The Godot-free reinforcement-learning core behind Bascule — batched PPO for .NET, built on the Tensotron tensor + autograd engine. No Python, no socket bridge, no native runtime.
What it is
Bascule.RL is the reusable RL layer that Bascule's Godot addon adapts to game nodes — but it knows
nothing about Godot, so you can drive it from a console sim, a test, or another engine. It provides:
- Batched, not threaded, PPO — gather
Nenvironments' observations into one[N, obs]batch, run one policy forward pass per step (a single GEMM on GPU / one row-parallel SIMD matmul on CPU), scatter actions back. One matmul, notN. - Multi-channel
ControlSpec— mixed continuous + discrete action channels described by data, so a gun, a car, and a joint are all "just controls" to the optimizer. - Two trainer shapes —
Ppoowns its own rollout loop over anIEnvironmentfactory (console / headless);BatchedPpoTraineris host-driven (Tick), for a game loop that owns the clock. - Stability built in — GAE, clipped surrogate, KL early-stop, and reactive LR backoff.
- Model save/load — byte-exact serializer round-trip for shipping trained policies.
Quick shape
using Bascule.RL;
// 1. Describe what the agent can do — one channel per action, each normalized to [-1, 1].
var controls = new ControlSpec(new[] { new ControlChannel("thrust", -1f, 1f) });
// 2. Implement IEnvironment for your sim (ObservationSize, Controls, Reset, GetState, Step).
// Then train:
var net = new ActorCritic(stateSize: 4, controls, hidden: 64);
var ppo = new Ppo(net, () => new MyEnv(), new Random(0)) { NumEnvs = 16, Horizon = 256 };
ppo.Train(iterations: 200, (iter, meanReturn) => Console.WriteLine($"{iter}: {meanReturn:F1}"));
For a game loop that owns the clock, use BatchedPpoTrainer and call Tick(observations, rewards, dones, actions) once per physics tick for all agents at once.
Status
0.1.0-alpha. Continuous / discrete / mixed action heads. Depends on Tensotron (float32-only;
CUDA when a GPU is present, otherwise a hand-written SIMD CPU backend — the fast path for shipped,
CPU-only inference).
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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 was computed. 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. |
-
net8.0
- Tensotron (>= 0.1.0-alpha)
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.0-alpha | 90 | 7/1/2026 |