Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

Awesome Lists containing this project

README

        


pedax_logo
pedax

screenshot_macos






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 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

[![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_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
```

[`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
```