Mortal-S42
Mortal-S42 releases the S42.8k checkpoint, a Mortal v4 policy for four-player Japanese riichi mahjong. It uses visible game information to select a legal action. It was selected from a local offline-training lineage after adaptation to high-rank Mahjong Soul games with Tenhou replay.
The inference model has 10,835,631 parameters: a 192-channel, 40-block residual network and a dueling DQN head. Input is a Mortal v4 observation of shape (1012, 34) and a 46-action legal mask. It is a custom PyTorch model. Use the included loader and libriichi encoder.
Files and use
- Inference guide: installation, mjai events, action mapping, and limits.
- Training notes and hyperparameters: data splits, learning rates, tuning results, and lessons.
- Training configuration and evaluation summaries: structured, sanitized records.
- Model identity: architecture, file hash, and source-checkpoint hash.
weights/s42-inference.pth: inference tensors and normalization buffers only.runtime/: the upstream Mortal encoder and model source required for inference.
Use CPython 3.12 and an installed Rust toolchain with a C/C++ linker. From this directory:
python -m pip install -r requirements.txt
python build_runtime.py
python inference.py --smoke --device cpu
CPU inference was checked with Python 3.12 and PyTorch 2.13. CUDA is supported by the loader but was not tested for this release package. The dependency range is a compatibility target, not a test matrix. The native encoder must be built for the local interpreter and platform.
Training provenance
The direct lineage is stable 380k โ H20k โ S42.8k. Phase H and Phase S start from parent network weights with fresh training state. Stage numbers count optimizer steps, not games.
| Stage | Training-set size | Data |
|---|---|---|
| Base | 1,105,845 games | Tenhou Houou hanchan, 2020โ2025 |
| Phase H | 362,460 games | 2018 and 2022โ2025 Tenhou |
| Phase S | 268,994 games | 134,497 high-rank Mahjong Soul games and 134,497 Tenhou replay games |
Phase S uses offline CQL with a next-rank auxiliary objective. No subsequent online RL checkpoint is included in this model. The stage counts overlap and must not be summed as unique games. H20 was selected before the full Phase H traversal ended; its dataset size does not prove that every game had been consumed. The archived training summary records a full traversal of the Phase S split; the checkpoint contains the last saved update at step 42,800, which can omit updates after the final save boundary. The raw datasets, game identifiers, and training state are not distributed here.
Evaluation
The following parent comparison uses reciprocal 1-versus-3 games, identical seed blocks, and four-seat rotation: 10,000 games per direction, 20,000 total per comparison. The paired 95% intervals use seed-block differences. Lower average rank is better. These games used the project's MahJax evaluation adapter, with AMP and the Mortal agari guard disabled. They did not use the Libriichi setup of the community benchmarks below. Simulator version and rule settings are recorded in evaluation.json.
| Comparison | Average-rank difference | 95% interval |
|---|---|---|
| S42.8k minus H20k | -0.0167 | [-0.0422, +0.0088] |
H20k is the direct parent of S42.8k, selected after 20,000 updates in Phase H. S42.8k passed the project's selection gate, but this comparison did not show a significant strength gain over H20k.
Against H20k, held-out DQN loss changed by approximately -0.45% on 2018 Tenhou, +0.01% on modern Tenhou, and -2.11% on Mahjong Soul. Offline loss is a diagnostic, not a direct measure of playing strength.
Community checkpoint comparisons
Two additional historical benchmarks each used 2,000 hanchans, with 1,000 seeds and two mirrored 2v2 games per seed. Each model contributed 4,000 seat results per comparison.
| Opponent checkpoint | S42 average rank | Opponent average rank | Opponent minus S42 | Reported 95% interval |
|---|---|---|---|---|
model_v4_20240308_best_min.pth |
2.48025 | 2.51975 | +0.0395 | [-0.0170, +0.0960] |
model_v4_20240308_mortal_min.pth |
2.48475 | 2.51525 | +0.0305 | [-0.0260, +0.0875] |
Both point estimates favor S42; both reported intervals include zero. The historical bootstrap resampled individual hanchans, not mirrored seed groups. These intervals must not be treated as seed-group clustered evidence of superiority. The supplied report records an earlier raw-log verification; raw logs were not supplied or reprocessed for this release. The opponent filenames and SHA-256 hashes identify the two community checkpoints tested.
See community benchmark details for checkpoint hashes, rank rates, protocol and evidence limits. These 2v2 results are kept separate from the 1v3 lineage evaluations. Community weights are not distributed.
Intended use and limitations
Use for local analysis, research, and controlled game simulations. The model was trained for four-player hanchan. Three-player rules and other rule variants are not validated. Q-values are relative action scores, not calibrated win probabilities. Correct event ordering, hidden-tile masking, and the upstream observation encoder are required. Training data emphasizes strong-player games; performance across ranks and platforms is not established.
License
The runtime source comes from Mortal, commit 0cff2b52982be5b1163aa9a62fb01f03ce91e0d2. The source is licensed under AGPL-3.0-or-later; see runtime/LICENSE and NOTICE.