Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sensuikan1973/pedax
Reversi Board with edax, which is the strongest reversi engine.
https://github.com/sensuikan1973/pedax
dart dart-ffi docusaurus edax fastlane ffi flutter flutter-desktop isolate linux macos othello reversi sentry windows
Last synced: 11 days ago
JSON representation
Reversi Board with edax, which is the strongest reversi engine.
- Host: GitHub
- URL: https://github.com/sensuikan1973/pedax
- Owner: sensuikan1973
- License: gpl-3.0
- Created: 2021-01-26T14:14:32.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-13T22:24:55.000Z (7 months ago)
- Last Synced: 2024-04-14T00:26:39.672Z (7 months ago)
- Topics: dart, dart-ffi, docusaurus, edax, fastlane, ffi, flutter, flutter-desktop, isolate, linux, macos, othello, reversi, sentry, windows
- Language: Dart
- Homepage: https://sensuikan1973.github.io/pedax/
- Size: 29.9 MB
- Stars: 23
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
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 program.
pedax has 4 features.
Mac/Windows/Linux are supported. You can install from Mac App Store or Microsoft Store.
Seamlessly, you can seeevaluation value
, e.g.+4
,-10
.
Customizable important options, e.g.book file path
,search level
,advanced indicator
.
2 languages (English, Japanese) are supported.
---
## Development
[![Flutter CI](https://github.com/sensuikan1973/pedax/actions/workflows/flutter_ci.yaml/badge.svg)](https://github.com/sensuikan1973/pedax/actions/workflows/flutter_ci.yaml)
[![codecov](https://codecov.io/gh/sensuikan1973/pedax/branch/main/graph/badge.svg?token=DoMWFhOPN3)](https://codecov.io/gh/sensuikan1973/pedax)
[![Flutter Build](https://github.com/sensuikan1973/pedax/actions/workflows/flutter_build.yaml/badge.svg)](https://github.com/sensuikan1973/pedax/actions/workflows/flutter_build.yaml)
[![Flutter Deployment MacOS](https://github.com/sensuikan1973/pedax/actions/workflows/deploy_macos.yaml/badge.svg)](https://github.com/sensuikan1973/pedax/actions/workflows/deploy_macos.yaml)
[![Deploy Website](https://github.com/sensuikan1973/pedax/actions/workflows/deploy_website.yaml/badge.svg)](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 have to use some [isolates](https://dart.dev/guides/language/concurrency) 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_sensuikan1973User ->> MainIsolate: launch pedax
MainIsolate ->> EdaxServer: spawn and notify my SendPort
EdaxServer ->> MainIsolate: notify my SendPort
and start listening
EdaxServer ->> EdaxProcess: initialize via ffiUser ->> MainIsolate: action (e.g. tap)
MainIsolate ->> EdaxServer: request EdaxCommand
via SendPortalt 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
```[`important` issues and PR](https://github.com/sensuikan1973/pedax/issues?q=label%3Aimportant+sort%3Acreated-asc)
### Run
```sh
./scripts/setup_flutter.sh
flutter run --device-id macos --dart-define "SENTRY_DSN=xxx" # env is optional
```