[package]
edition = "2024"
name = "thrust-rl"
version = "0.4.0"
authors = ["Robb Walters <agent-4@spheresemi.com>"]
build = false
exclude = [
"*.pt",
"*.safetensors",
"*.onnx",
"models/**",
"web/**",
"envs/**",
"examples/games/bucket_brigade/**",
"scripts/**",
"loom.sh",
"Makefile",
"rustfmt.toml",
"clippy.toml",
".loom/**",
".claude/**",
".github/**",
"docs/WASM_ROADMAP.md",
"docs/MULTI_AGENT_DESIGN.md",
"docs/archive/**",
"package.json",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "High-performance reinforcement learning in Rust with the Burn tensor backend"
homepage = "https://rjwalters.github.io/thrust/"
documentation = "https://docs.rs/thrust-rl"
readme = "README.md"
keywords = [
"reinforcement",
"machine-learning",
"rl",
"ppo",
"dqn",
]
categories = [
"science",
"algorithms",
"game-development",
"simulation",
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/rjwalters/thrust"
[features]
blas-threaded = [
"dep:burn-ndarray",
"burn-ndarray/multi-threads",
]
collective = ["burn?/collective"]
cuda = ["burn?/cuda"]
default = ["training"]
env-atari = []
training = [
"dep:burn",
"tokio",
"rayon",
"tracing",
"tracing-subscriber",
"crossbeam-channel",
"chrono",
]
training-fp16 = ["burn?/wgpu"]
wasm = [
"wasm-bindgen",
"web-sys",
"js-sys",
"console_error_panic_hook",
]
wgpu = ["burn?/wgpu"]
[lib]
name = "thrust_rl"
crate-type = [
"cdylib",
"rlib",
]
path = "src/lib.rs"
[[example]]
name = "eval_pong"
path = "examples/games/pong/eval_pong.rs"
required-features = ["training"]
[[example]]
name = "recurrent_ppo_burst_flickering_cartpole"
path = "examples/games/cartpole/recurrent_ppo_burst_flickering_cartpole.rs"
required-features = ["training"]
[[example]]
name = "recurrent_ppo_flickering_cartpole"
path = "examples/games/cartpole/recurrent_ppo_flickering_cartpole.rs"
required-features = ["training"]
[[example]]
name = "recurrent_ppo_masked_cartpole"
path = "examples/games/cartpole/recurrent_ppo_masked_cartpole.rs"
required-features = ["training"]
[[example]]
name = "recurrent_ppo_t_maze"
path = "examples/games/t_maze/recurrent_ppo_t_maze.rs"
required-features = ["training"]
[[example]]
name = "signaling_protocol"
path = "examples/games/signaling/signaling_protocol.rs"
required-features = ["training"]
[[example]]
name = "train_bc_cartpole"
path = "examples/games/cartpole/train_bc_cartpole.rs"
required-features = ["training"]
[[example]]
name = "train_cartpole_a2c"
path = "examples/games/cartpole/train_cartpole_a2c.rs"
required-features = ["training"]
[[example]]
name = "train_cartpole_async"
path = "examples/games/cartpole/train_cartpole_async.rs"
required-features = ["training"]
[[example]]
name = "train_cartpole_dqn"
path = "examples/games/cartpole/train_cartpole_dqn.rs"
required-features = ["training"]
[[example]]
name = "train_cartpole_modern"
path = "examples/games/cartpole/train_cartpole_modern.rs"
required-features = ["training"]
[[example]]
name = "train_dqn_grid_world"
path = "examples/games/grid_world/train_dqn_grid_world.rs"
required-features = ["training"]
[[example]]
name = "train_pong_dqn"
path = "examples/games/atari/train_pong_dqn.rs"
required-features = [
"training",
"env-atari",
]
[[example]]
name = "train_pong_dqn_fp16"
path = "examples/games/atari/train_pong_dqn_fp16.rs"
required-features = [
"training",
"env-atari",
]
[[example]]
name = "train_pong_self_play"
path = "examples/games/pong/train_pong_self_play.rs"
required-features = ["training"]
[[example]]
name = "train_sac"
path = "examples/games/pendulum/train_sac.rs"
required-features = ["training"]
[[example]]
name = "train_sac_mountain_car"
path = "examples/games/mountain_car/train_sac_mountain_car.rs"
required-features = ["training"]
[[example]]
name = "train_simple_bandit"
path = "examples/games/bandit/train_simple_bandit.rs"
required-features = ["training"]
[[example]]
name = "train_snake_multi_v2"
path = "examples/games/snake/train_snake_multi_v2.rs"
required-features = ["training"]
[[test]]
name = "test_a2c_cartpole"
path = "tests/test_a2c_cartpole.rs"
[[test]]
name = "test_atari_env"
path = "tests/test_atari_env.rs"
[[test]]
name = "test_atari_preprocess"
path = "tests/test_atari_preprocess.rs"
[[test]]
name = "test_bc_cartpole"
path = "tests/test_bc_cartpole.rs"
[[test]]
name = "test_bucket_brigade_baselines"
path = "tests/test_bucket_brigade_baselines.rs"
[[test]]
name = "test_bucket_brigade_critic_fittability"
path = "tests/test_bucket_brigade_critic_fittability.rs"
[[test]]
name = "test_bucket_brigade_env"
path = "tests/test_bucket_brigade_env.rs"
[[test]]
name = "test_bucket_brigade_oracle_coalition"
path = "tests/test_bucket_brigade_oracle_coalition.rs"
[[test]]
name = "test_cartpole_async"
path = "tests/test_cartpole_async.rs"
[[test]]
name = "test_dqn_grid_world"
path = "tests/test_dqn_grid_world.rs"
[[test]]
name = "test_env_state"
path = "tests/test_env_state.rs"
[[test]]
name = "test_nfsp_bucket_brigade"
path = "tests/test_nfsp_bucket_brigade.rs"
[[test]]
name = "test_nfsp_matching_pennies"
path = "tests/test_nfsp_matching_pennies.rs"
[[test]]
name = "test_nfsp_multi_discrete_smoke"
path = "tests/test_nfsp_multi_discrete_smoke.rs"
[[test]]
name = "test_nfsp_n_player_matching_pennies"
path = "tests/test_nfsp_n_player_matching_pennies.rs"
[[test]]
name = "test_pong_self_play_env"
path = "tests/test_pong_self_play_env.rs"
[[test]]
name = "test_psro_bucket_brigade"
path = "tests/test_psro_bucket_brigade.rs"
[[test]]
name = "test_psro_matching_pennies"
path = "tests/test_psro_matching_pennies.rs"
[[test]]
name = "test_psro_n_player_matching_pennies"
path = "tests/test_psro_n_player_matching_pennies.rs"
[[test]]
name = "test_sac_mountain_car"
path = "tests/test_sac_mountain_car.rs"
[[test]]
name = "test_sac_pendulum"
path = "tests/test_sac_pendulum.rs"
[[test]]
name = "test_seeded_reproducibility"
path = "tests/test_seeded_reproducibility.rs"
[[bench]]
name = "trainer_throughput"
path = "benches/trainer_throughput.rs"
harness = false
required-features = ["training"]
[dependencies.anyhow]
version = "1.0"
[dependencies.burn]
version = "0.21"
features = [
"std",
"ndarray",
"autodiff",
]
optional = true
default-features = false
[dependencies.burn-ndarray]
version = "0.21"
optional = true
default-features = false
[dependencies.bytemuck]
version = "1.14"
features = ["derive"]
[dependencies.chrono]
version = "0.4"
optional = true
[dependencies.console_error_panic_hook]
version = "0.1"
optional = true
[dependencies.crossbeam-channel]
version = "0.5"
optional = true
[dependencies.js-sys]
version = "0.3"
optional = true
[dependencies.rand]
version = "0.9"
features = ["small_rng"]
[dependencies.rayon]
version = "1.8"
optional = true
[dependencies.serde]
version = "1"
features = ["derive"]
[dependencies.serde_json]
version = "1.0"
[dependencies.thiserror]
version = "1.0"
[dependencies.tokio]
version = "1"
features = [
"full",
"rt-multi-thread",
]
optional = true
[dependencies.tracing]
version = "0.1"
optional = true
[dependencies.tracing-subscriber]
version = "0.3"
features = ["env-filter"]
optional = true
[dependencies.wasm-bindgen]
version = "0.2"
optional = true
[dependencies.web-sys]
version = "0.3"
features = ["console"]
optional = true
[dev-dependencies.criterion]
version = "0.5"
[dev-dependencies.tempfile]
version = "3.8"
[target.'cfg(target_arch = "wasm32")'.dependencies.getrandom]
version = "0.3"
features = ["wasm_js"]
[lints.rust.unexpected_cfgs]
level = "warn"
priority = 0
check-cfg = ['cfg(feature, values("env-bucket-brigade"))']
[profile.bench]
inherits = "release"
[profile.release]
opt-level = 3
lto = true
codegen-units = 1