Skip to main content

env-GraDOOM-turbo-torch
🔥 Train Stronger Doom Policies, Faster 🔥

env-GraDOOM-turbo-torch is a Python library and integrated training system for expert reinforcement-learning researchers who want to train strong Doom deathmatch policies from fresh initialization on NVIDIA GPUs. A certified result counts only when the unchanged stochastic policy transfers to env-ViZDoom-turbo; certification ranks policy quality by systematic player-attributed kills, with reusable-run wall-clock time and raw simulated Doom tics breaking close ties.

Its batched simulation, rendering, rewards, resets, rollouts, policy inference, and learning remain in Torch on the GPU during steady-state training. Use GraDoomVecEnv with an operator-supplied Doom II or Freedoom IWAD and the pinned ViZDoom deathmatch scenario.

Install

env-GraDOOM-turbo-torch requires Python 3.11 or newer and uv.

uv add env-gradoom-turbo-torch

For source development:

git clone https://github.com/tsilva/env-GraDOOM-turbo-torch.git
cd env-GraDOOM-turbo-torch
uv sync --group dev

Use

import gymnasium as gym
import torch

num_envs = 128
device = torch.device("cuda")
env = gym.make_vec(
    "gradoom:GraDOOM-v0",
    game="VizdoomDeathmatch-v1",
    scenario="/path/to/vizdoom/scenarios/deathmatch.wad",
    rom_path="/path/to/doom2.wad",
    num_envs=num_envs,
    device=device,
    render_mode="rgb_array",
    compile_engine=True,
)

lanes = torch.arange(num_envs, device=device)
observations, signals = env.reset_device(
    torch.ones(num_envs, device=device, dtype=torch.bool),
    lanes + 1,
)
actions = lanes % env.single_action_space.n
transition = env.step_and_reset_device(actions, lanes + num_envs + 1)
raw_rgb_with_hud = env.render()  # 320x240 RGB24, no observation preprocessing
env.close()

The module-qualified ID imports the package and registers the factory. This ID is vector-only, requires an explicit game, and returns the native Torch-only GraDoomVecEnv; the class also remains available for direct use.

observations, rewards, episode flags, and signals remain Torch tensors on the selected device. Request the env-GraDOOM-turbo-torch-specific player_killcount game variable when policy quality must count only enemy deaths delivered by the player. ViZDoom-compatible killcount remains available and also includes countable monsters killed by infighting in this single-player scenario.

Commands

uv run pytest                                             # run the test suite
uv run ruff check .                                      # lint the repository
uv run python -m gradoom.inspect_scenario \
  --scenario /path/to/deathmatch.wad --iwad /path/to/doom2.wad  # inspect assets
uv run python play.py --scenario /path/to/deathmatch.wad \
  --iwad /path/to/doom2.wad                              # play with keyboard controls
uv run python tools/cuda_correctness_smoke.py --compile-engine   # check CUDA residency
uv run python train.py --iwad /path/to/doom2.wad \
  --scenario /path/to/deathmatch.wad                    # standalone 256x16 PPO
uv run python train.py --iwad /path/to/doom2.wad \
  --scenario /path/to/deathmatch.wad --wandb            # log to GradLab's W&B project
uv run python train.py --initialize-from /path/to/policy.pt \
  --iwad /path/to/doom2.wad --scenario /path/to/deathmatch.wad  # warm-start lane only
uv run python tools/convert_gradlab_checkpoint.py \
  --source /path/to/published/model.zip \
  --output /path/to/standalone-policy.pt                # no GradLab/SB3 imports
uv run python tools/evaluate_vizdoom_checkpoint.py \
  --checkpoint /path/to/policy.pt --iwad /path/to/doom2.wad \
  --scenario-config /path/to/deathmatch.cfg                      # zero-shot transfer gate

Notes

  • env-GraDOOM-turbo-torch is under active construction and is not yet parity-certified. No current release supports a public quality- or speed-leadership claim.
  • Certification ranks results in this order: zero-shot transfer eligibility, systematic player_kills, reusable-run wall-clock time among practically equivalent policies, then raw simulated Doom tics.
  • Certified results start from freshly initialized policy and optimizer state. Pretrained, adapted, fine-tuned, and warm-start runs are reported separately.
  • Final certification uses five predeclared cold-start seeds, reports every outcome without replacement, and requires at least four unchanged stochastic policies to transfer equivalently to env-ViZDoom-turbo.
  • The first certification candidate is single-player deathmatch-p1-v1: 17 actions, frame skip 2, and 84×84 grayscale CHW observations with four-frame stacking.
  • render() and render_lane() expose the unprocessed 320×240 RGB24 comparison view with the full Doom HUD; observation preprocessing remains separate from this diagnostic render path.
  • The initial certification hardware target is one NVIDIA RTX 4090 integrated with GradLab.
  • Pass asset paths directly or set GRADOOM_IWAD and GRADOOM_DEATHMATCH_WAD. WADs and other game data are not distributed with this repository.
  • Torch tensors are the only reset/step transition transport, including reset selectors and read-only state indices. Only diagnostic RGB arrays cross into NumPy.
  • Operator-run benchmarks require a controlled quiet window and matched reference evidence; see deathmatch parity.
  • The current internal RTX 4090 training optimization recipe and its three-seed evidence are recorded in training optimization. These results are experimental and do not supersede the parity-certification requirement.
  • See third-party notices for source and game-data policy.

Architecture

env-GraDOOM-turbo-torch architecture

License

The project's original source code is MIT-licensed. Bundled ZDoom BulletChip resources retain their separate GPL-3.0-only license; see the third-party notices for exact provenance and redistribution terms.

Metadata

Release files for env-gradoom-turbo-torch 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for env-gradoom-turbo-torch 0.2.2
File Size Uploaded
env_gradoom_turbo_torch-0.2.2.tar.gz 263.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for env-gradoom-turbo-torch 0.2.2
File Interpreter ABI Platform
env_gradoom_turbo_torch-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 457.9 kB

Release files / env_gradoom_turbo_torch-0.2.2.tar.gz

Download URL env_gradoom_turbo_torch-0.2.2.tar.gz
Size 263.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a99e2209255209243d3d88f5ad015daf0e50f6d19e7f4de1913c4fd0cba5bc23
BLAKE2b-256 checksum
How to use checksums
8202c9b81584aba3d7e52c921f7b9111298465a919e9c49d72387859a5e99124
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Release files / env_gradoom_turbo_torch-0.2.2-py3-none-any.whl

Download URL env_gradoom_turbo_torch-0.2.2-py3-none-any.whl
Size 194.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6eef0d9edebc340af8bfbd26769a03d2a41d53b08298e9ab762738efced516aa
BLAKE2b-256 checksum
How to use checksums
1f0208bd0e2fd0bc0acc240fa15b9659f9084448965733a1293b0855847c7f69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page