TorchWright Doom — E1M1
This is a stock Hugging Face Phi3ForCausalLM that renders DOOM through
ordinary autoregressive inference. The model and the data-only fast tokenizer
load through the ordinary Transformers text-generation pipeline without
remote code.
The bundled examples/e1m1_prompt.txt is the executable prompt. Run
infer.py (at the bundle root) to produce canonical emitted row ids and raw
tokenizer text. tools/pretty_text.py formats that text for reading, while
tools/txt_to_png.py independently decodes its cursor/pixel protocol into a
PNG — every cursor move and pixel in that protocol is a model-emitted token.
The protocol is specified in PROTOCOL.md in the source repo. Neither
post-processing tool participates in inference or performs geometry,
visibility, lighting, texture selection, or sorting.
Ordinary Transformers pipeline inference works directly, with no custom or remote model code:
from pathlib import Path
from huggingface_hub import hf_hub_download
from transformers import pipeline
repo = "physicsrob/torchwright-doom-e1m1"
prompt = Path(hf_hub_download(repo, "examples/e1m1_prompt.txt")).read_text()
generate = pipeline("text-generation", model=repo, device_map="auto")
generated_text = generate(prompt, return_full_text=False)[0]["generated_text"]
The saved generation defaults are greedy and cover the complete frame. Use
the shipped infer.py when canonical integer row IDs, progress reporting, and
the exact terminal-token-preserving raw text are required.
Published checkpoints: 320×200 and 80×50. The compiler-facing source is torchwright_doom.
This bundle: screen 320×200, map E1M1, dense fp32 sharded safetensors, eager attention (the validated implementation), greedy decode, generation bound 61440 new tokens.
What running it takes: the fp32 weight shards total
79.97 GiB (85.87 GB), needing a B200-class GPU
or multi-GPU device_map. The flagship pipeline render peaked at 151.00 GiB
reserved; greedy decode took 39.7 minutes on one B200 for its 53,747-token rollout
from a 3,614-token prompt, scoring 99.9% within-option color against the
reference renderer.
Canonical numbers and their provenance: FACTS.md in the source repo
(github.com/physicsrob/torchwright_doom).