asmfish_macOS_11082017

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

asmfish_macOS_11082017

Post by MikeB »

The latest asmfish for the macOS built with the new assembler of choice of the asmfish team -> fasmg . This current version is much more stable than previous versions - actually runs under xBoard 😎

https://www.dropbox.com/s/q00vkbhkmvgk7 ... 7.zip?dl=1

about 20% faster - on a high-end Mac Pro from 2010 - you might see nearly 4,000,000 to 5,000,000 nps difference :
Image

for those that want to try compiling :

fasmg assembler can be downloaded here ( exe is under the macOS ) folder:
https://flatassembler.net/fasmg.zip

the last asmfish can be obtained here:

https://github.com/lantonov/asmFish

open terminal.app, go to the asmfish directory and copy and paste this:

Code: Select all

./fasmg "x86/fish.asm" "asmfish" -e 100 -i "VERSION_OS='X'" -i "VERSION_POST = 'popcnt'"
not sure if there is a 'bmi2' option or not but you can try it and see if works..
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

bmi2 version doe download

Post by MikeB »

User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: asmfish_macOS_11082017

Post by MikeB »

bmi2 works:

2015 iMac with i7

Code: Select all

asmFishX_2017-11-09_bmi2
uci
id name asmFishX_2017-11-09_bmi2
id author TypingALot
option name Hash type spin default 16 min 1 max 65536
option name LargePages type check default false
option name Threads type spin default 1 min 1 max 256
option name NodeAffinity type string default all
option name Priority type combo default none var none var normal var low var idle
option name LogFile type string default <empty>
option name TTFile type string default <empty>
option name TTSave type button
option name TTLoad type button
option name Clear Hash type button
option name Ponder type check default false
option name UCI_Chess960 type check default false
option name MultiPV type spin default 1 min 1 max 224
option name Contempt type spin default 0 min -100 max 100
option name MoveOverhead type spin default 50 min 0 max 5000
option name SyzygyProbeDepth type spin default 1 min 1 max 100
option name SyzygyProbeLimit type spin default 6 min 0 max 6
option name Syzygy50MoveRule type check default true
option name SyzygyPath type string default <empty>
option name OwnBook type check default false
option name BookFile type string default <empty>
option name BestBookMove type check default false
option name BookDepth type spin default 100 min -10 max 100
uciok

bench
*** bench hash 16 threads 1 depth 13 ***
1&#58;      nodes&#58; 267656           2731 knps       98 ms
2&#58;      nodes&#58; 224683           2844 knps       79 ms
3&#58;      nodes&#58; 149158           4387 knps       34 ms
4&#58;      nodes&#58; 206633           2951 knps       70 ms
5&#58;      nodes&#58; 75742            2913 knps       26 ms
6&#58;      nodes&#58; 80301            2590 knps       31 ms
7&#58;      nodes&#58; 214891           2686 knps       80 ms
8&#58;      nodes&#58; 524367           2819 knps       186 ms
9&#58;      nodes&#58; 230233           2558 knps       90 ms
10&#58;     nodes&#58; 114203           2928 knps       39 ms
11&#58;     nodes&#58; 285818           2574 knps       111 ms
12&#58;     nodes&#58; 148333           2557 knps       58 ms
13&#58;     nodes&#58; 130211           2770 knps       47 ms
14&#58;     nodes&#58; 126993           2645 knps       48 ms
15&#58;     nodes&#58; 131824           2996 knps       44 ms
16&#58;     nodes&#58; 76418            3322 knps       23 ms
17&#58;     nodes&#58; 57172            3573 knps       16 ms
18&#58;     nodes&#58; 9620             4810 knps       2 ms
19&#58;     nodes&#58; 64440            4602 knps       14 ms
20&#58;     nodes&#58; 226888           4280 knps       53 ms
21&#58;     nodes&#58; 46183            5131 knps       9 ms
22&#58;     nodes&#58; 20878            5219 knps       4 ms
23&#58;     nodes&#58; 87970            6283 knps       14 ms
24&#58;     nodes&#58; 45130            3760 knps       12 ms
25&#58;     nodes&#58; 8928             4464 knps       2 ms
26&#58;     nodes&#58; 54608            3900 knps       14 ms
27&#58;     nodes&#58; 225844           3528 knps       64 ms
28&#58;     nodes&#58; 387735           3342 knps       116 ms
29&#58;     nodes&#58; 46670            3333 knps       14 ms
30&#58;     nodes&#58; 20481            5120 knps       4 ms
31&#58;     nodes&#58; 73847            5680 knps       13 ms
32&#58;     nodes&#58; 48113            4811 knps       10 ms
33&#58;     nodes&#58; 29951            5990 knps       5 ms
34&#58;     nodes&#58; 103343           4921 knps       21 ms
35&#58;     nodes&#58; 177257           4545 knps       39 ms
36&#58;     nodes&#58; 112174           6231 knps       18 ms
37&#58;     nodes&#58; 508109           4130 knps       123 ms
38&#58;     nodes&#58; 5373             2686 knps       2 ms
39&#58;     nodes&#58; 16489            3297 knps       5 ms
40&#58;     nodes&#58; 0                0 knps          0 ms
41&#58;     nodes&#58; 0                0 knps          0 ms
42&#58;     nodes&#58; 117582           2449 knps       48 ms
===========================
Total time &#40;ms&#41; &#58; 1686
Nodes searched  &#58; 5482249
Nodes/second    &#58; 3251630
bench 16 4 13
*** bench hash 16 threads 4 depth 13 ***
info string node -1 has threads 0 1 2 3
1&#58;      nodes&#58; 577345           10128 knps      57 ms
2&#58;      nodes&#58; 413312           10876 knps      38 ms
3&#58;      nodes&#58; 175442           15949 knps      11 ms
4&#58;      nodes&#58; 248941           10823 knps      23 ms
5&#58;      nodes&#58; 306664           10574 knps      29 ms
6&#58;      nodes&#58; 213777           10179 knps      21 ms
7&#58;      nodes&#58; 326699           10209 knps      32 ms
8&#58;      nodes&#58; 687877           11094 knps      62 ms
9&#58;      nodes&#58; 293959           10136 knps      29 ms
10&#58;     nodes&#58; 179985           10587 knps      17 ms
11&#58;     nodes&#58; 441207           10260 knps      43 ms
12&#58;     nodes&#58; 402161           10311 knps      39 ms
13&#58;     nodes&#58; 346209           11168 knps      31 ms
14&#58;     nodes&#58; 505971           9921 knps       51 ms
15&#58;     nodes&#58; 220464           12248 knps      18 ms
16&#58;     nodes&#58; 266423           13321 knps      20 ms
17&#58;     nodes&#58; 128764           14307 knps      9 ms
18&#58;     nodes&#58; 28097            28097 knps      1 ms
19&#58;     nodes&#58; 90970            18194 knps      5 ms
20&#58;     nodes&#58; 1055810          17029 knps      62 ms
21&#58;     nodes&#58; 61629            15407 knps      4 ms
22&#58;     nodes&#58; 50842            25421 knps      2 ms
23&#58;     nodes&#58; 241921           24192 knps      10 ms
24&#58;     nodes&#58; 142457           17807 knps      8 ms
25&#58;     nodes&#58; 32033            10677 knps      3 ms
26&#58;     nodes&#58; 66390            16597 knps      4 ms
27&#58;     nodes&#58; 611511           13897 knps      44 ms
28&#58;     nodes&#58; 356118           13189 knps      27 ms
29&#58;     nodes&#58; 118108           13123 knps      9 ms
30&#58;     nodes&#58; 72699            14539 knps      5 ms
31&#58;     nodes&#58; 83026            20756 knps      4 ms
32&#58;     nodes&#58; 127464           18209 knps      7 ms
33&#58;     nodes&#58; 52823            26411 knps      2 ms
34&#58;     nodes&#58; 102873           20574 knps      5 ms
35&#58;     nodes&#58; 180656           18065 knps      10 ms
36&#58;     nodes&#58; 137304           19614 knps      7 ms
37&#58;     nodes&#58; 307893           16204 knps      19 ms
38&#58;     nodes&#58; 11921            11921 knps      1 ms
39&#58;     nodes&#58; 44766            11191 knps      4 ms
40&#58;     nodes&#58; 0                0 knps          0 ms
41&#58;     nodes&#58; 0                0 knps          0 ms
42&#58;     nodes&#58; 220422           9184 knps       24 ms
===========================
Total time &#40;ms&#41; &#58; 797
Nodes searched  &#58; 9932933
Nodes/second    &#58; 12462902
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: asmfish_macOS_11082017

Post by MikeB »

ps don't forget to do this on the command line to enable the exe's on your mac:

Code: Select all

chmod 755 fasmg 

chmod 755 asmfish
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: asmfish_macOS_11082017

Post by MikeB »

let's see what kind of difference we see in the real world - 5 minute chess with 5 second increment - using the magic 63 opening positions ( hand selected positions from Kai's epd opening file)


I have modify the script (csh) lately to "automate" some of the variables,

Bob's match file takes the time parameter sin centiseconds so I set the base in seconds the script converts it to centiseconds and also automatically uses the base to calculate the increment - I use 1/60 of of the base as the default for the increment:

Code: Select all

set base =  300 ## in seconds
echo "base $base seconds"
@ time = $base * 100
set inc  =  `echo "scale=2; ($time * 100 / 100&#41; / 60" |bc -lq`
set increment = `echo "scale=2; ($inc * 100 / 100&#41; / 100" |bc -lq`
assign the engines (no change in script), uci engines are called by polyglot, hence the ini file:

Code: Select all

set eng1 = asmfish.ini
set eng2 = SF-McBrain-v31a.ini
set eng3 = komodo-11.2.ini
set eng4 = stockfish.ini
at some point , I may automate this piece, but I haven't so far:

Code: Select all

set opponents1= ( $eng1 $eng2 $eng3 $eng4 )
set opponents2= ( $eng4 $eng3 $eng2 $eng1 )
this code counts the players:

Code: Select all

set players1 = $#opponents1
set players2 = $#opponents2
pick the file and number of positions:

Code: Select all

set file = magic63.epd
@ positions = 63
the script here hasn't changed:

Code: Select all

set time_odds = 1
set games_per_position = 1
set positions_per_match = 1
@ rounds  = $positions * 2

echo "using $positions positions from EPD file"
@ gamesPlanned =  ( $players1  )  * ( $players2 - 1 )   * $positions * $games_per_position
echo $gamesPlanned "Games Planned"
sleep 2
@ counterStart = ( $gamesPlanned  / ( $positions * $games_per_position ) )  * 5  + 12
@ counterIncrement = ( $counterStart - 12 )
cd run
set logid1 = 101
set logid2 = 50101
set logid3 = 10001
set logid4 = 5000101
rm -f commands

@ position = 0 #you can change this to start @ different position in the file

set counter = 0
set gamesStarted = 0
@ gamesPlanned = $gamesPlanned

this is the match driver here - the script creates commands that will then be called sequentially - two programs are called , "match" which keeps the games going and "geteloRR1" - which calls a modified version of Bayeselo and updates the results at regular intervals - "jot" is a very nifty tool and some have called it "seq" on steroids. This is also where the copying to dropbox occurs:

Code: Select all

loop&#58;
@ position = $position + 1 # start at the  1st position ,
	foreach player1 (`jot $players1`)
		foreach player2 (`jot $players2`)

		if ($opponents1&#91;$player1&#93; == $opponents2&#91;$player2&#93; )  goto skip  #  do not want engines to play themselves
			echo "./match "match$position.$player1" $file $position $games_per_position $positions_per_match $time $inc  $opponents1&#91;$player1&#93; localhost $logid1 $opponents2&#91;$player2&#93; localhost $logid2 $time_odds" >> commands
			@ logid1 = $logid1 + $games_per_position * $positions_per_match
			@ logid2 = $logid2 + $games_per_position * $positions_per_match
			@ pairings = ( $pairings + $games_per_position )
			echo "$pairings"
			@ completed = ( $pairings - 11 )

		@ gamesStarted = $pairings - $counter
		if (( $gamesStarted + 1 ) < $counterStart ) goto skip2
			echo "echo " "" >> commands
			echo "echo "$completed of $gamesPlanned games completed..."" >> commands
			echo "echo "time control&#58; $base+$increment seconds"" >> commands

			echo "./geteloRR1" >> commands
			echo "echo " ">>~/Dropbox/Shared\ Folder/elota.txt" >> commands
			echo "echo "$completed of $gamesPlanned games completed...">>~/Dropbox/Shared\ Folder/elota.txt" >> commands
			echo "echo "time control&#58; $base+$increment seconds ">>~/Dropbox/Shared\ Folder/elota.txt" >> commands
			echo "./geteloRR2>>~/Dropbox/Shared\ Folder/elota.txt" >> commands
			echo "cp pgn /Users/michaelbyrne/Dropbox/Shared\ Folder/all.pgn" >> commands
			@ counter = $counter + $counterIncrement
		skip2&#58;
		skip&#58;
		end
	end  # round is completed with both colors scripted
#     echo "rm game.* log.*" >>commands
if ($pairings < $gamesPlanned ) goto loop
there also some wrap-up script once the match is over - that's for another day..

Ina addition there is a another script that is called "watcher" - which simply calls bayeselo periodically , reads the pgn files and summarize the results and copies the results to dropbox so I can easily follow remotely.:

Code: Select all

Date&#58; 11/08/17 &#58; 23&#58;40&#58;01
ResultSet-EloRating>00&#58;00&#58;00,00
ResultSet-EloRating>Rank Name                      Rating   &#916;     +    -     #     &#931;    &#931;%     W    L    D   W%    =%   OppR 
---------------------------------------------------------------------------------------------------------
   1 asmFishX_2017-11-08_popc   3117   0.0   90   90    16    8.5  53.1    3    2   11  18.8  68.8  3095 
   2 Stockfish 241017 64 POPC   3114   3.4   90   90    16    8.5  53.1    3    2   11  18.8  68.8  3096 
   3 SF-McBrain v3.1a 64 POPC   3102  11.9   86   86    18    9.0  50.0    3    3   12  16.7  66.7  3099 
   4 Komodo 11.2.2 64-bit       3067  34.4   96   96    16    7.0  43.8    4    6    6  25.0  37.5  3110 
---------------------------------------------------------------------------------------------------------
  &#931; = total score, 1 point for win, 1/2 point for draw
 
 
Date&#58; 11/08/17 &#58; 23&#58;50&#58;01
ResultSet-EloRating>00&#58;00&#58;00,00
ResultSet-EloRating>Rank Name                      Rating   &#916;     +    -     #     &#931;    &#931;%     W    L    D   W%    =%   OppR 
---------------------------------------------------------------------------------------------------------
   1 asmFishX_2017-11-08_popc   3123   0.0   74   74    21   11.5  54.8    4    2   15  19.0  71.4  3092 
   2 SF-McBrain v3.1a 64 POPC   3103  19.9   73   73    22   11.0  50.0    3    3   16  13.6  72.7  3100 
   3 Stockfish 241017 64 POPC   3100   3.3   79   79    19    9.5  50.0    3    3   13  15.8  68.4  3100 
   4 Komodo 11.2.2 64-bit       3074  26.2   80   80    20    9.0  45.0    4    6   10  20.0  50.0  3109 
---------------------------------------------------------------------------------------------------------
  &#931; = total score, 1 point for win, 1/2 point for draw

 
Date&#58; 11/09/17 &#58; 00&#58;00&#58;01
ResultSet-EloRating>00&#58;00&#58;00,00
ResultSet-EloRating>Rank Name                      Rating   &#916;     +    -     #     &#931;    &#931;%     W    L    D   W%    =%   OppR 
---------------------------------------------------------------------------------------------------------
   1 asmFishX_2017-11-08_popc   3122   0.0   73   73    22   12.0  54.5    4    2   16  18.2  72.7  3093 
   2 Stockfish 241017 64 POPC   3112   9.9   74   74    22   11.5  52.3    4    3   15  18.2  68.2  3097 
   3 SF-McBrain v3.1a 64 POPC   3112   0.5   71   71    24   12.5  52.1    4    3   17  16.7  70.8  3096 
   4 Komodo 11.2.2 64-bit       3053  58.4   76   76    22    9.0  40.9    4    8   10  18.2  45.5  3115 
---------------------------------------------------------------------------------------------------------
  &#931; = total score, 1 point for win, 1/2 point for draw
this watcher will update the results every 10 minutes and you can follow here if you wish:
https://www.dropbox.com/s/y07af1ysloh01 ... 1.txt?dl=1
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: asmfish_macOS_11082017

Post by MikeB »

regarding calling bayeselo from a script - this uses bash and my script looks like this:

Code: Select all

#!/bin/bash

dat=`date +"%D"`
nowt=`date +"%T"`
echo "Date&#58; $dat &#58; $nowt"
num=($&#40;seq 1 4&#41;)  #number of engines , based on the match program, each pgn file denotes the engine playing black 
for i in "$&#123;num&#91;@&#93;&#125;"
	do
		cat match*.$i >pgn.$i
	done

rm pgn
for i in "$&#123;num&#91;@&#93;&#125;"
do
cat pgn.$i >>pgn
done
cp pgn  games.pgn
### egrep and sed are great tools to control the input and output so that you get exactly what you want
bayeselo <<eof | egrep -i "\-|And|SF|gf|Cra|nat|ceebo|cor|Sweet|Mat|EXc|Ari|Sun|Gir|Houd|Brain|cf|Ether|Sting|Glaurung|Bla|Hawk|Mik|k|fruit|toga|Igor|Ippo|Ivan|robb|crit|chen|vajo|Gull|prot|fire|rank|deep|stock|texe|senp|hakk|aras|komo|craf|Sugar|shre|Hiar" |sed -e 's/ResultSet-EloRating>ResultSet-EloRating>//g'|sed -e '1,3d;$d' |sed -e 's/ResultSet-EloRating>ResultSet-EloRating>//g'|sed -e '1,3d;$d' |sed -e 's/ResultSet>ResultSet>ResultSet-EloRating>3100//g' |sed -e 's/ResultSet-EloRating>//g'
readpgn pgn
elo
offset 3100
confidence 0.95
mm 0 1
ratings
x
eof
maxdeg
Posts: 229
Joined: Thu Mar 10, 2016 6:17 pm
Location: Canada

Re: bmi2 version doe download

Post by maxdeg »

MikeB wrote:untested - but it compiled:

https://www.dropbox.com/s/n2df6lpumbn40 ... 2.zip?dl=1
Thanks Mike .. :D
User avatar
AdminX
Posts: 6339
Joined: Mon Mar 13, 2006 2:34 pm
Location: Acworth, GA

Re: asmfish_macOS_11082017

Post by AdminX »

Thanks for the head up Mike!
"Good decisions come from experience, and experience comes from bad decisions."
__________________________________________________________________
Ted Summers
User avatar
Dariusz
Posts: 364
Joined: Sat Jun 13, 2015 10:08 am
Location: Poland
Full name: Dariusz Domagała

Re: asmfish_macOS_11082017

Post by Dariusz »

Big thx :-))
Regards, Darius
https://chessengeria.eu
User avatar
lantonov
Posts: 216
Joined: Sun Apr 13, 2014 5:19 pm

Re: asmfish_macOS_11082017

Post by lantonov »

The latest MacOS executables are here:
https://github.com/lantonov/asmFish/tre ... bles/macOS
One can make specific executables on Windows through the make.bat file as well as through the makefile in the main repo.