https://github.com/sensuikan1973/pedax
Reversi Board desktop app, which has the strongest reversi engine edax.
https://github.com/sensuikan1973/pedax
dart-ffi docusaurus edax fastlane ffi flutter flutter-desktop isolate linux macos othello reversi windows
Last synced: about 2 months ago
JSON representation
Reversi Board desktop app, which has the strongest reversi engine edax.
- Host: GitHub
- URL: https://github.com/sensuikan1973/pedax
- Owner: sensuikan1973
- License: gpl-3.0
- Created: 2021-01-26T14:14:32.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2026-04-18T12:57:02.000Z (about 2 months ago)
- Last Synced: 2026-04-18T14:39:10.165Z (about 2 months ago)
- Topics: dart-ffi, docusaurus, edax, fastlane, ffi, flutter, flutter-desktop, isolate, linux, macos, othello, reversi, windows
- Language: Dart
- Homepage: https://sensuikan1973.github.io/pedax/
- Size: 35.7 MB
- Stars: 32
- Watchers: 0
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
pedax
pedax is Reversi Board GUI with edax, which is the strongest reversi engine.
pedax has 4 features.
-
Mac/Windows/Linux are supported. You can install from Mac App Store or Microsoft Store.
-
Seamlessly, you can see evaluation value, e.g. +4, -10.
-
Customizable important options, e.g. book file path, search level, advanced indicator.
-
2 languages (English, Japanese) are supported.
## Development
[](https://github.com/sensuikan1973/pedax/actions/workflows/flutter_ci.yaml)
[](https://codecov.io/gh/sensuikan1973/pedax)
[](https://github.com/sensuikan1973/pedax/actions/workflows/flutter_build.yaml)
[](https://github.com/sensuikan1973/pedax/actions/workflows/deploy_macos.yaml)
[](https://github.com/sensuikan1973/pedax/actions/workflows/deploy_website.yaml)
### Architecture
The technical point of pedax is as follows.
- pedax needs to call _Expensive_ _Native(C)_ logic such as computing evaluation value.
- _Native(C)_ logic needs allocated huge data on memory. It's desirable to daemonize _Native(C)_ process.
So, I use some [isolates](https://dart.dev/language/isolates) with ffi([libedax4dart](https://github.com/sensuikan1973/libedax4dart)) to achieve _seamless non-blocking_ UI.
```mermaid
%% https://mermaid-js.github.io/mermaid/#/sequenceDiagram
sequenceDiagram
actor User
participant MainIsolate as Main Isolate
participant EdaxServer as Edax Server
participant EphemeralWorker as Ephemeral Worker
participant EdaxProcess as Edax Process [C]
link EdaxServer: source @ https://github.com/sensuikan1973/pedax/tree/main/lib/engine
link EdaxServer: caller @ https://github.com/sensuikan1973/pedax/blob/main/lib/models/board_notifier.dart
link EphemeralWorker: source @ https://github.com/sensuikan1973/pedax/tree/main/lib/engine
link EdaxProcess: binding source (Dart) @ https://github.com/sensuikan1973/libedax4dart
link EdaxProcess: origin source(C) @ https://github.com/sensuikan1973/edax-reversi/tree/libedax_sensuikan1973
User ->> MainIsolate: launch pedax
MainIsolate ->> EdaxServer: spawn and notify my SendPort
EdaxServer ->> MainIsolate: notify my SendPort
and start listening
EdaxServer ->> EdaxProcess: initialize via ffi
User ->> MainIsolate: action (e.g. tap)
MainIsolate ->> EdaxServer: request EdaxCommand
via SendPort
alt light EdaxCommand
EdaxServer ->> EdaxProcess: stop EdaxCommand being executed via ffi
EdaxServer ->> EdaxProcess: execute requested EdaxCommand via ffi
EdaxProcess ->> EdaxServer: return result
EdaxServer ->> MainIsolate: notify result via SenPort
MainIsolate ->> MainIsolate: update UI
else heavy EdaxCommand
note right of EdaxServer: spawn another isolate not to block EdaxServer.
Then, EdaxServer can accept other requests.
EdaxServer ->>+ EphemeralWorker: spawn and notify Main Isolate SendPort
EphemeralWorker ->> EdaxProcess: stop EdaxCommand being executed via ffi
EphemeralWorker ->> EdaxProcess: execute requested EdaxCommand via ffi
note over EdaxProcess: heavy...
EdaxProcess ->> EphemeralWorker: return result
EphemeralWorker ->>- MainIsolate: notify result via SenPort
MainIsolate ->> MainIsolate: update UI
end
```
### Run
```sh
./scripts/setup_flutter.sh
flutter run --device-id macos --dart-define "SENTRY_DSN=xxx" # env is optional
```
### References
- [`important` issues](https://github.com/sensuikan1973/pedax/issues?q=label%3Aimportant+sort%3Acreated-desc)
- https://dart.dev/language/concurrency