How xyloheat/baduk works
This is a dependency-free browser Go app for learning and playing. The main workflow is a player interacting with the UI, which uses the rules engine for moves and scoring; play can be hot-seat, lesson-based, or routed to a bot. Medium play uses a Monte Carlo worker, while stronger tiers use a lazy-loaded KataGo neural worker and model assets. The README documents additional UI capabilities including multilingual themes, keyboard controls, and mascot expressions. Neural-worker internals were not sampled, so its model and TensorFlow.js links reflect documented dependencies; deployment links reflect the documented Pages/R2 setup.
Main entry points: ui.js Game UI · neural-worker.js KataGo worker · worker.js Monte Carlo bot · engine.js Go rules engine
Components 13
Browser interface
- App page
index.html - Themes and layout
styles.css - Game UI
ui.js - Stone artwork
assets/mascot
Rules and learning
- Go rules engine
engine.js - Interactive lessons
lessons.js
Bot play
- Monte Carlo bot
worker.js - KataGo worker
neural-worker.js - TensorFlow.js WASM
tfjs
Neural model delivery
- Compact model
assets/models/kata-small-b6c96.bin.gz - Model streaming function
functions/models/[[path]].js - R2 model bucket
Other components
- Player
Connections 15
- Player → Game UI: plays through
- App page → Game UI: loads app code
- App page → Themes and layout: loads styles
- Game UI → Go rules engine: applies moves, scores
- Go rules engine → Game UI: returns game state
- Game UI → Interactive lessons: reads lesson content
- Game UI → Stone artwork: displays artwork
- Game UI → Monte Carlo bot: dispatches medium bot
- Monte Carlo bot → Go rules engine: uses rules
- Monte Carlo bot → Game UI: returns move
- Game UI → KataGo worker: dispatches neural bot
- KataGo worker → TensorFlow.js WASM: runs inference
- KataGo worker → Compact model: loads compact net
- KataGo worker → Model streaming function: fetches dan net
- Model streaming function → R2 model bucket: reads model object