{"id":16096236,"url":"https://github.com/thelortex/rust-mcts","last_synced_at":"2025-07-05T02:35:17.673Z","repository":{"id":146622357,"uuid":"246308072","full_name":"TheLortex/rust-mcts","owner":"TheLortex","description":"MCTS algorithms implemented in Rust","archived":false,"fork":false,"pushed_at":"2020-04-06T03:35:37.000Z","size":11699,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T13:11:14.116Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheLortex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-10T13:27:47.000Z","updated_at":"2022-08-28T13:00:35.000Z","dependencies_parsed_at":"2023-05-04T09:48:44.626Z","dependency_job_id":null,"html_url":"https://github.com/TheLortex/rust-mcts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TheLortex/rust-mcts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheLortex%2Frust-mcts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheLortex%2Frust-mcts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheLortex%2Frust-mcts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheLortex%2Frust-mcts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheLortex","download_url":"https://codeload.github.com/TheLortex/rust-mcts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheLortex%2Frust-mcts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263671818,"owners_count":23494044,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-09T17:12:19.231Z","updated_at":"2025-07-05T02:35:17.644Z","avatar_url":"https://github.com/TheLortex.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RGGPF: Rust General Game Playing Framework\n\nThis is a project for the IASD course on Monte-Carlo Search of M. Cazenave (https://www.lamsade.dauphine.fr/~cazenave/MonteCarloSearch.html). It introduces a general framework for game playing and agent policies for these games. Several games and policies have been implemented.\n\nAPI documentation is [available here](https://www.lortex.org/rust-mcts/ggpf/).\n\n## Setup\n\nThis project uses `rust` (nightly channel) and `python` with `tensorflow`. \n\n- Install `rustup` and launch `rustup default nightly` to enable the nightly compiler.\n- Install `tensorflow` to enable PUCT/AlphaZero/MuZero policies.\n- More generally, use `pip install -r requirements.txt` to install python dependencies (`tensorflow` is excluded from the list as either `tensorflow` or `tensorflow-gpu` works).\n\n## Usage\n\n*Cargo* is the Rust project manager.\nUse `cargo run --release --bin \u003cbinary\u003e` to execute binaries. Available binaries are:\n  -  `evaluate`: evaluate two policies on breakthrough\n  -  `ui`: interactive interface to inspect alphazero\n  -  `generate`: self-play game generators\n  -  `gym_server`: decoupled game executor for openai gym\n  -  `perf`: benchmarking tests\n\n### Configuration files\n\n`evaluate`, `generate` and `ui` all use a configuration file located in the `config/` path. It is selected\nby the `--config` option. \n\n### Training\n\nTo perform training, you need to launch both python and rust binaries:\n  - `python training.py --config breakthrough --method \u003calpha|mu\u003e` to execute the training loop and generate the network model.\n  - `cargo run --release --bin generate -- -c breakthrough -m \u003calpha|mu\u003e` to launch the self-play generator.\n\nThere shouldn't be any errors and the number of generated games should increase. \nDebugging information can be activated using `export RUST_DEBUG=info`. Models are saved in `data/\u003cname\u003e/model`. Tensorboard logs are saved in `data/\u003cname\u003e/logs` and training data is saved in `data/\u003cname\u003e/training_data`.\n\n### Testing\n\nTwo policies can be tested using `evaluate`: \n\n`cargo run --release --bin evaluate -- -c breakthrough --policy \u003cpolicy\u003e --against \u003cpolicy\u003e`\n\n### Visualizing\n\nTo launch the UI and visualize Alpha/Mu tree search live, use `ui`:\n\n`cargo run --release --bin ui -- -c breakthrough --method \u003calpha|mu\u003e`\n\n(to avoid tensorflow logs, use `export TF_CPP_MIN_LOG_LEVEL=2`)\n\n\n\n## Games\n\n### Multi-player\n- Breakthrough\n- Misère Breakthrough\n\n### Single-player\n- Hashcode 2020\n- Weak schur number\n- OpenAI Gym\n\n## Policies\n\n- Random\n- Flat UCB (Upper Confidence Bound)\n- UCT (Upper Confidence Tree)\n- RAVE (Rapid Action Value Estimation)\n- NMCS (Nested Monte Carlo Search)\n- NRPA (Nested Rollout Policy Adaptation)\n- PPA  (Playout Policy Adaptation)\n- PUCT (AlphaZero MCTS)\n- MUZ  (MuZero MCTS)\n\n## AlphaZero\n\nIt's possible to reproduce Deepmind's AlphaZero results on toy games.\n\n## MuZero\n\nI haven't been able to have satisfactory results on MuZero, even on toy games, but the implementation is here.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthelortex%2Frust-mcts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthelortex%2Frust-mcts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthelortex%2Frust-mcts/lists"}