1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
[]
= "thrust-rl"
= "0.2.0"
= "2024"
= ["Robb Walters <agent-4@spheresemi.com>"]
= "MIT OR Apache-2.0"
= "High-performance reinforcement learning in Rust with the Burn tensor backend"
= "https://github.com/rjwalters/thrust"
= "https://rjwalters.github.io/thrust/"
= "https://docs.rs/thrust-rl"
# Keywords: <=5 entries, each <=20 chars, alphanumeric + '-'/'_'.
= ["reinforcement", "machine-learning", "rl", "ppo", "dqn"]
# Categories from the official crates.io list:
# https://crates.io/category_slugs
= ["science", "algorithms", "game-development", "simulation"]
= "README.md"
# Restrict the published tarball to the files actually needed to build the
# crate. This keeps the tarball small (well under the 10 MB crates.io
# limit) by excluding tracked model checkpoints, the web demo, the
# bucket-brigade submodule, training scripts, optimization result JSON,
# screenshots, and other non-library assets.
= [
# Trained model checkpoints (tens of MB) -- consumers build their own.
"*.pt",
"*.safetensors",
"*.onnx",
"models/**",
"cartpole_optimization_results.json",
"cartpole_model*.json",
# Web demo & legacy demo assets.
"web/**",
"web-old/**",
# Optional Bucket Brigade submodule (only built with the
# `env-bucket-brigade` feature; consumers can vendor it themselves).
"envs/**",
# Bucket Brigade example -- feature is disabled in v0.1.0 (see above).
"examples/games/bucket_brigade/**",
# Out-of-band tooling that is not needed to build the library.
"scripts/**",
"loom.sh",
"Makefile",
"rustfmt.toml",
"clippy.toml",
".loom/**",
".claude/**",
".github/**",
# Project planning docs that aren't consumed by `cargo doc`.
"WASM_ROADMAP.md",
"MULTI_AGENT_DESIGN.md",
"VERSIONS.md",
"package.json",
]
[]
= ["cdylib", "rlib"]
[]
# Burn 0.21 — pure-Rust tensor framework. After phase 5 of the migration
# (#82), Burn is the only tensor backend in the workspace; the old
# `tch`/libtorch path is gone. Mirrors the dependency stance used by sister
# project geode-fem (see ../geode-fem/Cargo.toml workspace block):
# `default-features = false` keeps the dep small; backends (ndarray, wgpu,
# cuda) are layered on as separate features. The default `training` feature
# only pulls in `ndarray` (CPU) + `autodiff`; opt-in features below add
# GPU backends.
= { = "0.21", = false, = ["std", "ndarray", "autodiff"], = true }
# Direct handle on the NdArray backend crate that `burn` already pulls in. The
# `burn` umbrella crate re-exports the BLAS backends (`accelerate`/`openblas`/
# ...) but does NOT re-export the pure-Rust `multi-threads` feature, which is the
# only threaded-matmul option that needs no system BLAS library. We declare the
# crate here (same version, off by default) purely so the `blas-threaded`
# feature can flip `burn-ndarray/multi-threads` on. Cargo unifies features
# across the two dependency paths, so this toggles threading on the *same*
# compiled `NdArray` backend the rest of the code already uses via
# `burn::backend::NdArray` — no source changes required.
= { = "0.21", = false, = true }
# Async runtime for vectorization (not available in WASM)
= { = "1", = ["full", "rt-multi-thread"], = true }
# Data parallelism (not available in WASM)
= { = "1.8", = true }
# Zero-copy operations
= { = "1.14", = ["derive"] }
# Serialization for checkpoints
= { = "1", = ["derive"] }
= "1.0"
# Metrics and logging (simplified for WASM)
= { = "0.1", = true }
= { = "0.3", = ["env-filter"], = true }
# Random number generation
= { = "0.9" }
= { = "0.2", = ["js"] }
# Multi-threading and channels (not available in WASM)
= { = "0.5", = true }
# Error handling
= "1.0"
= "1.0"
# Date/time utilities (optional for training metadata)
= { = "0.4", = true }
# Bucket Brigade environment (Slepian-Wolf MARL experiments). Default = no
# Python features; pure Rust core.
#
# NOTE for v0.1.0 release: `bucket-brigade-core` lives in the
# `envs/bucket-brigade/` git submodule and has not been published to
# crates.io. `cargo publish` refuses to publish any package with a
# path-only dependency (even an optional one). Consequently this dep is
# commented out below and the `env-bucket-brigade` feature is disabled
# for the published crate. To use the Bucket Brigade env locally, depend
# on `thrust-rl` from a git checkout that includes the submodule and
# uncomment this block plus the `env-bucket-brigade` feature definition.
# See `docs/RELEASING.md` for the full procedure and the follow-up plan
# for restoring this feature in v0.2.x.
# bucket-brigade-core = { path = "envs/bucket-brigade/bucket-brigade-core", default-features = false, optional = true }
# WASM support
= { = "0.2", = true }
= { = "0.3", = ["console"], = true }
= { = "0.3", = true }
= { = "0.1", = true }
[]
= ["training"]
# `training` enables the Burn-backed training stack: tensor ops, autodiff,
# the buffer surfaces, the PPO/DQN trainers, and the policy networks.
# Defaults to Burn's pure-Rust NdArray backend so a fresh checkout builds
# without any external system libraries. GPU backends are opt-in via
# additional feature flags below.
= ["dep:burn", "tokio", "rayon", "tracing", "tracing-subscriber", "crossbeam-channel", "chrono"]
# Threaded matmul for the CPU NdArray backend (OFF by default). Enables
# `burn-ndarray/multi-threads`, which turns on `matrixmultiply/threading` +
# `ndarray/rayon` — both PURE RUST (matrixmultiply pulls in `thread-tree` +
# `num_cpus`). No system BLAS library is required, so this links cleanly on a
# bare Ubuntu 24.04 node (no apt install) as well as macOS. Intended for the
# batched phases: the PPO update (src/multi_agent/joint.rs) and the average-
# policy supervised training (src/multi_agent/nfsp.rs), where matmuls are large
# enough to amortize thread dispatch.
#
# Compose with `training`, e.g. `--features "training,blas-threaded"`. Tune the
# worker count with RAYON_NUM_THREADS / matrixmultiply's pool sizing.
#
# REPRODUCIBILITY CAVEAT: threaded matmul changes the order of floating-point
# reductions, so bit-exact results may differ run-to-run and from the single-
# threaded path. CI and the default build stay on the deterministic pure-Rust
# single-threaded path; only enable this for throughput-oriented runs where
# bit-reproducibility is not required.
= ["dep:burn-ndarray", "burn-ndarray/multi-threads"]
# Burn wgpu backend — cross-platform GPU (Vulkan/Metal/DX12/WebGPU).
# Compose with `training`, e.g. `--features "training,wgpu"`.
= ["burn?/wgpu"]
# Burn CUDA backend — Linux/NVIDIA only. Compose with `training`.
= ["burn?/cuda"]
= ["wasm-bindgen", "web-sys", "js-sys", "console_error_panic_hook"] # Pure Rust for WASM
# Bucket Brigade env adapter for the Slepian-Wolf MARL experiments. Pulls
# in the bucket-brigade-core crate as a pure-Rust dep --- does *not*
# require the `training` feature on its own. Disabled for v0.1.0 because
# bucket-brigade-core is path-only (see comment in [dependencies]); the
# `bucket_brigade` module in src/ is `#[cfg(feature = "env-bucket-brigade")]`
# gated and will simply be omitted from the published crate. Re-enable
# locally by uncommenting both this line and the dependency above.
# env-bucket-brigade = ["bucket-brigade-core"]
[]
= "0.5"
= "3.8"
[[]]
= "trainer_throughput"
= false
= ["training"]
[]
= 3
= true
= 1
[]
= "release"
# Bandit examples — Burn-backed SimpleBandit PPO trainer (originally the
# phase-1 scout trainer; promoted to the canonical bandit example in
# phase 5 when the tch sibling was removed).
[[]]
= "train_simple_bandit"
= "examples/games/bandit/train_simple_bandit.rs"
= ["training"]
# Canonical CartPole trainers on the Burn stack. Resurrected from the
# pre-Burn deletion (PR #98) per issue #101. See each example's module
# doc for the algorithm + hyperparameters.
[[]]
= "train_cartpole_modern"
= "examples/games/cartpole/train_cartpole_modern.rs"
= ["training"]
[[]]
= "train_cartpole_dqn"
= "examples/games/cartpole/train_cartpole_dqn.rs"
= ["training"]
# DQN on GridWorld (issue #185, PR B of the more-environments epic #180).
# Seeded Double-DQN on the 4x4 FrozenLake-style GridWorld env (16-dim one-hot
# obs, 4 discrete actions). Emits an opt-in learning-curve CSV via CURVE_CSV,
# mirroring train_cartpole_dqn. Runnable counterpart of
# tests/test_dqn_grid_world.rs.
[[]]
= "train_dqn_grid_world"
= "examples/games/grid_world/train_dqn_grid_world.rs"
= ["training"]
# A2C CartPole trainer (issue #153, PR C of the A2C epic #150). Same
# EnvPool rollout + GAE pattern as train_cartpole_modern but with the
# single-update-per-rollout A2cTrainer. Emits an opt-in learning-curve
# CSV via CURVE_CSV for overlay comparison with the PPO example.
[[]]
= "train_cartpole_a2c"
= "examples/games/cartpole/train_cartpole_a2c.rs"
= ["training"]
# End-to-end Behavioral Cloning on CartPole (issue #169, epic #161): train an
# A2C expert, harvest greedy demos, clone a fresh policy with BcTrainer, and
# report cloned-vs-expert mean episode reward. Runnable counterpart of
# tests/test_bc_cartpole.rs. Closes ROADMAP Milestone 6 imitation learning.
[[]]
= "train_bc_cartpole"
= "examples/games/cartpole/train_bc_cartpole.rs"
= ["training"]
# Seeded SAC trainer on the continuous PendulumSwingUp env (issue #162,
# epic #159). Runnable counterpart of tests/test_sac_pendulum.rs; emits
# an opt-in negative-return learning curve via CURVE_CSV.
[[]]
= "train_sac"
= "examples/games/pendulum/train_sac.rs"
= ["training"]
# Seeded SAC trainer on the continuous MountainCarContinuous env (issue
# #168, epic #163). Deceptive-reward sibling of the Pendulum SAC example;
# runnable counterpart of tests/test_sac_mountain_car.rs. Emits an opt-in
# learning curve via CURVE_CSV. The actor action needs no rescaling: the
# env's force range is already [-1, 1].
[[]]
= "train_sac_mountain_car"
= "examples/games/mountain_car/train_sac_mountain_car.rs"
= ["training"]
# Multi-agent / self-play trainers resurrected from the pre-Burn
# deletion (PR #98) per issue #101.
[[]]
= "train_snake_multi_v2"
= "examples/games/snake/train_snake_multi_v2.rs"
= ["training"]
[[]]
= "train_pong_self_play"
= "examples/games/pong/train_pong_self_play.rs"
= ["training"]
# Pong policy evaluation + Burn→InferenceModel exporter. Used to
# generate `pong_self_play_model.json` from the `train_pong_self_play`
# binary record and to compare both Pong models head-to-head against
# the env's built-in rule-based opponent (issue #75 acceptance).
[[]]
= "eval_pong"
= "examples/games/pong/eval_pong.rs"
= ["training"]
# Bucket Brigade trainers (issue #115 / PR 4 of #117). Both gated
# behind `env-bucket-brigade` (which is itself feature-gated off in
# the published crate -- see the `[features]` block). The examples
# train PSRO with α-rank and NFSP on the workshop-paper no-convergence
# cells; per-cell selection via `CELL=beta01|beta05|beta09`.
[[]]
= "train_psro"
= "examples/games/bucket_brigade/train_psro.rs"
= ["training", "env-bucket-brigade"]
[[]]
= "train_nfsp"
= "examples/games/bucket_brigade/train_nfsp.rs"
= ["training", "env-bucket-brigade"]
# Standalone single-best-response A/B probe (issue #241): freeze N-1
# opponents, train ONE PPO best-response on one cell, log per-iteration
# val-loss / explained-variance / entropy / mean-return.
[[]]
= "train_br_probe"
= "examples/games/bucket_brigade/train_br_probe.rs"
= ["training", "env-bucket-brigade"]
# Best-response improvability oracle (issue #259): score scripted policies
# (uniform, specialist, firefighter family + random search) for the single BR
# agent vs N-1 frozen uniform opponents; report best achievable per-step team
# return vs the uniform baseline. The non-PPO "improvability gate" (AC#1).
[[]]
= "br_oracle"
= "examples/games/bucket_brigade/br_oracle.rs"
= ["training", "env-bucket-brigade"]
[]
= { = "warn", = ['cfg(feature, values("env-bucket-brigade"))'] }