# Dev story: an on-device Janggi (Korean chess) AI in Flutter, and the isolate bug that made it weak

**URL:** https://daynhauhoc.com/t/dev-story-an-on-device-janggi-korean-chess-ai-in-flutter-and-the-isolate-bug-that-made-it-weak/137351
**Category:** dev chat
**Created:** [November 24, 2026, 2:41am UTC](https://daynhauhoc.com/t/dev-story-an-on-device-janggi-korean-chess-ai-in-flutter-and-the-isolate-bug-that-made-it-weak/137351 "2026-11-24T02:41:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dksequence](https://daynhauhoc.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@dksequence](https://daynhauhoc.com/u/dksequence)
#### Post date: [November 24, 2026, 2:41am UTC](https://daynhauhoc.com/t/dev-story-an-on-device-janggi-korean-chess-ai-in-flutter-and-the-isolate-bug-that-made-it-weak/137351/1 "2026-11-24T02:41:09Z")

</div>

Hi all, I’m a solo developer from South Korea (DKSEQUENCE). Sorry for writing in English — I’d like to share a small project and one bug I learned from.

**Janggi Master** is an Android game of Janggi (Korean chess) played against an AI that runs entirely on the device: 10 “dojos” to clear in sequence, quick play at levels 1–10, a tutorial for the 7 piece types, plus hint / undo / a peek at the opponent’s likely move.

The AI search runs in a separate Dart isolate so the UI stays smooth. A player reported that the strongest level was losing to beginners. The cause: the Zobrist hashing table was initialized on the main isolate only. Inside the search isolate it was never filled, so every position hashed to 0, the transposition table collapsed, and deep levels effectively stopped searching. The fix was to initialize the table when a board is created in the isolate, and to add tests that run the engine through the isolate path rather than only on the main thread.

Lesson for me: anything static/global in Dart is not shared with isolates — test the real execution path.

The app shows ads (removable with a purchase). Google Play: [https://play.google.com/store/apps/details?id=com.dksequence.janggimaster](https://play.google.com/store/apps/details?id=com.dksequence.janggimaster)
