-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ordered move generation from high value pieces to lower value ones, this increases the speed drammatically allowing the search to reach depth 6 in ~4 seconds on the initial position Change-type: minor Signed-off-by: Giovanni Garufi <[email protected]>
- Loading branch information
Showing
6 changed files
with
857 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,24 @@ | ||
# hask-chess | ||
|
||
## Notes | ||
|
||
Changing order of generated moves starting from king, queen and most valueble pieces instead of the other way around has the following huge speedup | ||
|
||
``` | ||
benchmarking initial position/depth: 5 White | ||
time 3.446 s (3.296 s .. 3.554 s) | ||
1.000 R² (1.000 R² .. 1.000 R²) | ||
mean 3.436 s (3.397 s .. 3.467 s) | ||
std dev 40.69 ms (17.53 ms .. 54.18 ms) | ||
variance introduced by outliers: 19% (moderately inflated) | ||
``` | ||
to | ||
|
||
``` | ||
benchmarking initial position/depth: 5 White | ||
time 470.2 ms (464.1 ms .. 475.9 ms) | ||
1.000 R² (1.000 R² .. 1.000 R²) | ||
mean 469.3 ms (466.8 ms .. 470.5 ms) | ||
std dev 2.301 ms (89.80 μs .. 2.860 ms) | ||
variance introduced by outliers: 19% (moderately inflated) | ||
``` |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Criterion.Main | ||
|
||
import Fen | ||
import Board | ||
import GameTree | ||
|
||
main = defaultMain [ | ||
bgroup "initial position" [ | ||
bench "depth: 2 White" $ whnf (negamax initialGameState White) 2 | ||
, bench "depth: 5 White" $ whnf (negamax initialGameState White) 5 | ||
, bench "depth: 6 White" $ whnf (negamax initialGameState White) 6 | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
cabal-version: 1.12 | ||
|
||
-- This file has been generated from package.yaml by hpack version 0.33.0. | ||
-- | ||
-- see: https://github.com/sol/hpack | ||
-- | ||
-- hash: 428cef491c676a221e29e7cb0aa5e5191422d48e704d833f35dbe1a4712f85d3 | ||
|
||
name: hen | ||
version: 0.1.0.0 | ||
description: Please see the README on GitHub at <https://github.com/githubuser/hask-chess#readme> | ||
homepage: https://github.com/nazrhom/hen#readme | ||
bug-reports: https://github.com/nazrhom/hen/issues | ||
author: Giovanni Garufi | ||
maintainer: [email protected] | ||
copyright: 2021 Giovanni Garufi | ||
license: BSD3 | ||
license-file: LICENSE | ||
build-type: Simple | ||
extra-source-files: | ||
README.md | ||
ChangeLog.md | ||
|
||
source-repository head | ||
type: git | ||
location: https://github.com/nazrhom/hen | ||
|
||
library | ||
exposed-modules: | ||
Board | ||
Evaluation | ||
Fen | ||
GameTree | ||
MoveGen | ||
Uci | ||
other-modules: | ||
Paths_hen | ||
hs-source-dirs: | ||
src | ||
build-depends: | ||
base >=4.7 && <5 | ||
, containers | ||
, mtl | ||
, parsec | ||
, vector | ||
default-language: Haskell2010 | ||
|
||
executable hen-exe | ||
main-is: Main.hs | ||
other-modules: | ||
Paths_hen | ||
hs-source-dirs: | ||
app | ||
ghc-options: -threaded -rtsopts -with-rtsopts=-N | ||
build-depends: | ||
base >=4.7 && <5 | ||
, containers | ||
, hen | ||
, mtl | ||
, parsec | ||
, vector | ||
default-language: Haskell2010 | ||
|
||
test-suite hen-test | ||
type: exitcode-stdio-1.0 | ||
main-is: Spec.hs | ||
other-modules: | ||
Paths_hen | ||
hs-source-dirs: | ||
test | ||
ghc-options: -threaded -rtsopts -with-rtsopts=-N | ||
build-depends: | ||
HUnit | ||
, base >=4.7 && <5 | ||
, containers | ||
, hen | ||
, mtl | ||
, parsec | ||
, vector | ||
default-language: Haskell2010 | ||
|
||
benchmark hen-bench | ||
type: exitcode-stdio-1.0 | ||
main-is: Spec.hs | ||
other-modules: | ||
Paths_hen | ||
hs-source-dirs: | ||
bench | ||
ghc-options: -threaded -rtsopts -with-rtsopts=-N | ||
build-depends: | ||
base >=4.7 && <5 | ||
, containers | ||
, criterion | ||
, hen | ||
, mtl | ||
, parsec | ||
, vector | ||
default-language: Haskell2010 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters