Reinforcement Learning & Distributed Game AI
Connecting CT 105...

BoredGamer Arena

A 24/7 multiplayer board game lounge and AI benchmark arena hosted on a Proxmox homelab LXC container. Powered by high-throughput zero-copy Rust simulation engines, ONNX CPU inference, and Information Set Monte Carlo Tree Search (IS-MCTS), delivering sub-2ms neural decision-making with zero dedicated GPUs.

Proxmox CT 105 Rust + PyO3 ONNX Runtime CPU Zero-GPU Inference IS-MCTS Search FastAPI WebSockets

Homelab Deployment Spec

Hosting Node Proxmox LXC CT 105
LXC Footprint 2 vCPU • 2048 MB RAM
Inference Engine ONNX Runtime (CPU)
Decision Latency < 1.8 ms / evaluation
RAM Optimization Saved 1.5 GB (Zero PyTorch)
Live Infrastructure Telemetry
Proxy: CT 104 → CT 105:8400 • 15s Auto-Poll
Arena Status Ping...
Connecting
Querying /api/arena/status
Kingdomino Bots ONNX
12
Models: Heuristics → Deep Value Net
Pinochle AI Bots IS-MCTS
5
Imperfect Information Determinization
Active Tables Live
0
0 Playing / 0 Waiting
Players & Spectators Active
0
Connected via WebSockets
Core Engineering

Zero-GPU Distributed Game AI Architecture

Running low-latency AI models across dozens of concurrent browser tables on modest homelab hardware requires extreme optimization at every layer: zero-copy native simulation, compact bitboards, and elimination of heavyweight Python ML dependencies.

System Dataflow & Tunnel Topology

🌐
Client Browser
React + Vite SPA
Multiplayer WebSockets & Canvas board rendering
WSS / 443
🛡️
Cloudflare Edge
CT 104 Tunnel
Zero open router ports; secure TLS termination
LAN :8400
⚡
FastAPI Lobby
CT 105:8400
Room coordination, game matchmaking & async I/O
PyO3 FFI
🦀
Rust Sim Engine
kingdomino_py & pinochle_py
Bitboards, 20k rollouts/s, zero GIL overhead
< 2ms CPU
🧠
ONNX Runtime
CPU Quantized Graph
No PyTorch in RAM; 17 models evaluated locally
01 // High-Throughput Sim

Zero-Copy Rust + PyO3 Engines

Card and tile game trees require thousands of rollouts per move. Pure Python implementations crawl at ~200 rollouts/sec due to object allocation overhead and the GIL.

By implementing core rules in Rust (kingdomino_py and pinochle_py) using compact 64-bit integer bitboards and memory-mapped state structs, the engine achieves 25,000+ rollouts per second per CPU core, callable directly from Python without JSON or buffer serialization.

// Rust bitboard tile placement validation
#[inline(always)]
pub fn is_legal_placement(board: &Board5x5, tile: Domino, x: i8, y: i8) -> bool {
    let mask = tile.occupancy_mask(x, y);
    (board.occupied & mask) == 0 && board.has_matching_adjacency(tile, x, y)
}
02 // Memory-Lean Production

Self-Play RL & Zero-PyTorch ONNX Export

Models are trained offline via AlphaZero-style self-play using PyTorch and reinforcement learning. However, loading PyTorch into production web servers consumes ~1.8 GB RAM per worker process.

Trained checkpoints are converted to graph-optimized, FP32/INT8 quantized ONNX formats. In production on CT 105, the runtime operates with torch_imported: false, cutting container memory consumption from 1.9 GB down to 240 MB while executing batch inference in under 1.8 milliseconds on standard CPU cores.

# Production inference without PyTorch in memory
session = ort.InferenceSession(
    "models/kingdomino_policy_v4.onnx",
    providers=["CPUExecutionProvider"]
)
probs = session.run(["policy_head"], {"board_input": flat_tensor})[0]
03 // Imperfect Information

Partnership Pinochle IS-MCTS

Unlike chess or Kingdomino, Partnership Pinochle features hidden opponent cards, asymmetric partner hands, and nuanced trump bidding tactics. Standard minimax searches fail completely.

The AI deploys Information Set Monte Carlo Tree Search (IS-MCTS). During each decision, it samples dozens of determinizations—hypothetical card distributions strictly consistent with previous void reveals, pass phases, and bid thresholds—and executes neural rollout evaluations across information sets.

# Determinization sampling over hidden cards
possible_hands = constraint_solver.sample_hands(
    revealed_voids=table.revealed_voids,
    bidding_history=table.auction_bids,
    hand_size=player.unplayed_count
)
root_node.simulate_determinizations(possible_hands, budget=400)
Model Catalog

AI Bot Roster & Model Tiers

Visitors can play against calibrated tiers from baseline greedy heuristics up to deep self-play neural networks.

12 Bots Available

Kingdomino Neural Series

2 to 4 player territory expansion. Bots optimize domino drafting, kingdom crown multipliers, and defensive denial tactics.

Tier / Bot Name Core Strategy Glicko-2 / Search
Jester (Random) Uniform random legal moves — chaos warm-up bot ~400 • Instant
Squire (Heuristic) Greedy territory + flexibility + safe denial heuristic ~1000 • Rust Heuristic
Knight (Rust MCTS) 400-simulation determinized PUCT search ~1390 • Rust MCTS
Baron (Neural) Siamese ResNet trained via league masked PPO (2P, 2–4P & 7×7 variants) ~1500 • < 2ms ONNX CPU
Grandmaster / Grandmaster Deep Baron policy + CRN world sampling, 2-ply counter-draft & exact endgame solver ~1640–1690 • 70–500ms
5 Bots Available

Partnership Pinochle AI

4-player 48-card trick-taking game. Partners cooperate across the table without table talk, navigating meld declaration and trick-taking voids.

Tier / Bot Name Core Strategy Search / Latency
Apprentice Casual beginner — cautious opener & forgiving trick play Rules • < 0.05ms
Card Sharp Club-level heuristic: counts Aces/10s, reads partner signals & tracks voids Void Tracker • < 0.25ms
Tactician Belief-consistent determinizations respecting public melds & suit voids IS-MCTS • < 1ms
Master (Neural) Partnership policy-value net trained on 250k teacher hands + league PPO ONNX CPU • < 2ms
Grandmaster (NN + Search) Neural policy + 32-world belief search & 4-trick exact endgame solver ONNX + Search • ~60–110ms
AI Engineering & Production Inference

Want custom reinforcement learning, simulation optimization, or low-latency CPU inference deployed on your infrastructure?

Whether you need high-throughput simulation engines, edge AI pipelines that eliminate GPU cloud bills, or resilient WebSocket architectures, I design and deploy production systems tailored to your workload.