Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asmFishW_2018-05-26_base.exe can't go depth up to 4 #173

Closed
double-beep opened this issue May 28, 2018 · 3 comments
Closed

asmFishW_2018-05-26_base.exe can't go depth up to 4 #173

double-beep opened this issue May 28, 2018 · 3 comments
Assignees
Labels

Comments

@double-beep
Copy link
Contributor

double-beep commented May 28, 2018

Hello @tthsqe12 @lantonov and @CounterPly,
asmFishW_2018-05-26_base.exe (committed by @CounterPly b019590) cannot go depth up to 4
See the following examples:

asmFishW_2018-05-27_base
setoption name Hash value 1024
setoption name Threads value 1
go ponder
info string hash set to 1024 MB no large pages
info depth 1 seldepth 1 multipv 1 time 1 nps 22000 score cp 136 nodes 22 tbhits 0 pv d2d4
info depth 2 seldepth 2 multipv 1 time 1 nps 46000 score cp 136 nodes 46 tbhits 0 pv d2d4 d7d6
info depth 3 seldepth 3 multipv 1 time 1 nps 72000 score cp 136 nodes 72 tbhits 0 pv d2d4 d7d6 e2e4
info depth 4 seldepth 4 multipv 1 time 2 nps 86000 score cp 129 nodes 172 tbhits 0 pv d2d4 e7e6 e2e4 d7d6
bestmove d2d4 ponder e7e6`

and then asmfish crashes.

asmFishW_2018-05-27_base
bench 1024 1 13
***bench hash 1024 threads 1 depth 13
info string hash set to 1024 MB no large pages`

and asmfish crashes again.


BUT:


asmFishW_2018-05-27_base
setoption name Hash value 1024
setoption name Threads value 1
go depth 4
info string hash set to 1024 MB no large pages
info depth 1 seldepth 1 multipv 1 time 1 nps 22000 score cp 136 nodes 22 tbhits 0 pv d2d4
info depth 2 seldepth 2 multipv 1 time 1 nps 46000 score cp 136 nodes 46 tbhits 0 pv d2d4 d7d6
info depth 3 seldepth 3 multipv 1 time 1 nps 72000 score cp 136 nodes 72 tbhits 0 pv d2d4 d7d6 e2e4
info depth 4 seldepth 4 multipv 1 time 2 nps 86000 score cp 129 nodes 172 tbhits 0 pv d2d4 e7e6 e2e4 d7d6
bestmove d2d4 ponder e7e6`

without a crash

and also

asmFishW_2018-05-27_base
bench 1024 1 4
*** bench hash 1024 threads 1 depth 4 ***
info string hash set to 1024 MB no large pages
1:      nodes: 511              170 knps        3 ms
2:      nodes: 1128             376 knps        3 ms
3:      nodes: 284              5 knps          50 ms
4:      nodes: 509              509 knps        1 ms
5:      nodes: 202              101 knps        2 ms
6:      nodes: 231              231 knps        1 ms
7:      nodes: 290              290 knps        1 ms
8:      nodes: 898              449 knps        2 ms
9:      nodes: 397              397 knps        1 ms
10:     nodes: 665              332 knps        2 ms
11:     nodes: 625              625 knps        1 ms
12:     nodes: 743              371 knps        2 ms
13:     nodes: 211              211 knps        1 ms
14:     nodes: 526              263 knps        2 ms
15:     nodes: 213              213 knps        1 ms
16:     nodes: 313              313 knps        1 ms
17:     nodes: 225              225 knps        1 ms
18:     nodes: 127              127 knps        0 ms
19:     nodes: 1289             1289 knps       1 ms
20:     nodes: 661              661 knps        1 ms
21:     nodes: 185              185 knps        1 ms
22:     nodes: 211              211 knps        1 ms
23:     nodes: 492              492 knps        1 ms
24:     nodes: 253              253 knps        1 ms
25:     nodes: 227              227 knps        1 ms
26:     nodes: 558              558 knps        1 ms
27:     nodes: 746              373 knps        2 ms
28:     nodes: 648              216 knps        3 ms
29:     nodes: 229              229 knps        1 ms
30:     nodes: 108              108 knps        1 ms
31:     nodes: 417              417 knps        1 ms
32:     nodes: 734              367 knps        2 ms
33:     nodes: 425              425 knps        1 ms
34:     nodes: 281              281 knps        1 ms
35:     nodes: 136              136 knps        1 ms
36:     nodes: 442              442 knps        1 ms
37:     nodes: 202              202 knps        1 ms
38:     nodes: 385              385 knps        1 ms
39:     nodes: 817              408 knps        2 ms
40:     nodes: 0                0 knps          0 ms
41:     nodes: 0                0 knps          2 ms
42:     nodes: 319              319 knps        1 ms
===========================
Total time (ms) : 104
Nodes searched  : 17863
Nodes/second    : 171759

without a crash also...

I am beginner, thanks!

@CounterPly CounterPly self-assigned this May 28, 2018
@CounterPly
Copy link
Collaborator

Hi double-beep,

Thanks for reporting this issue. It may be due to one of the instructions I used not being compatible with your processor. I'll look into it.

@CounterPly
Copy link
Collaborator

I have replaced the instruction on line 228 of Think.asm from:

roundsd xmm0, xmm0, 0

to:

call Math_Round_d_d

which I have defined in Math.asm as:

Math_Round_d_d:

        push   rbx
         sub   rsp, 32
     _vmovsd   qword[rsp+8H], xmm0
       fwait
      fnstcw   word[rsp+1CH]     ; save precision
       fwait
      fnstcw   word[rsp+1EH]
         and   word[rsp+1EH], 0xF3FF     ; round nearest
          or   word[rsp+1EH], 0x0300     ; 80 bit precision
       fldcw   word[rsp+1EH]
         fld   qword[rsp+8H]
     frndint
        fstp   qword[rsp+8H]
       fldcw   word[rsp+1CH]     ; restore precision
     _vmovsd   xmm0, qword[rsp+8H]
        add    rsp, 32
        pop    rbx
        ret 

I am hoping this fixes the bug you encountered, while not adding too much overhead to this part of the code. Could you take another bench using the attached executable and tell me if it works properly for you?

asmFishW_2018-05-28_base.zip

@CounterPly CounterPly added the bug label May 29, 2018
CounterPly added a commit that referenced this issue May 29, 2018
official-stockfish/Stockfish@6d8f583

arm-port will be finished soon.

This commit also contains a (tentative) bugfix that should restore the full functionality of asmFish_base executables. Performance of other executables should be unaffected. Track this issue here: #173.
@double-beep
Copy link
Contributor Author

double-beep commented May 29, 2018

Hi @CounterPly,
The attachment works fine. go ponder and "bench * * *" works for me.
Bench gives:

*** bench hash 16 threads 1 depth 13 ***
1:      nodes: 288032           537 knps        536 ms
2:      nodes: 260102           1111 knps       234 ms
3:      nodes: 92447            1812 knps       51 ms
4:      nodes: 222766           1191 knps       187 ms
5:      nodes: 159587           1056 knps       151 ms
6:      nodes: 87601            962 knps        91 ms
7:      nodes: 273815           1010 knps       271 ms
8:      nodes: 337757           1141 knps       296 ms
9:      nodes: 179825           977 knps        184 ms
10:     nodes: 94324            1014 knps       93 ms
11:     nodes: 138632           990 knps        140 ms
12:     nodes: 308564           940 knps        328 ms
13:     nodes: 209427           974 knps        215 ms
14:     nodes: 165963           1011 knps       164 ms
15:     nodes: 134692           1020 knps       132 ms
16:     nodes: 81378            813 knps        100 ms
17:     nodes: 42452            1035 knps       41 ms
18:     nodes: 24671            1298 knps       19 ms
19:     nodes: 70607            1440 knps       49 ms
20:     nodes: 365041           653 knps        559 ms
21:     nodes: 95457            1015 knps       94 ms
22:     nodes: 49909            1721 knps       29 ms
23:     nodes: 137438           1416 knps       97 ms
24:     nodes: 61523            1183 knps       52 ms
25:     nodes: 11922            1192 knps       10 ms
26:     nodes: 40047            1112 knps       36 ms
27:     nodes: 350150           1316 knps       266 ms
28:     nodes: 348651           1089 knps       320 ms
29:     nodes: 71090            1247 knps       57 ms
30:     nodes: 33903            446 knps        76 ms
31:     nodes: 60731            920 knps        66 ms
32:     nodes: 64993            1710 knps       38 ms
33:     nodes: 53728            1989 knps       27 ms
34:     nodes: 116668           1405 knps       83 ms
35:     nodes: 128662           1299 knps       99 ms
36:     nodes: 147813           1154 knps       128 ms
37:     nodes: 383625           844 knps        454 ms
38:     nodes: 6614             734 knps        9 ms
39:     nodes: 72203            601 knps        120 ms
40:     nodes: 0                0 knps          1 ms
41:     nodes: 0                0 knps          1 ms
42:     nodes: 161834           685 knps        236 ms
===========================
Total time (ms) : 6140
Nodes searched  : 5934644
Nodes/second    : 966554

The latest commit (3dad3f2) works also fine for me. It gives bench:

*** bench hash 16 threads 1 depth 13 ***
1:      nodes: 278386           1058 knps       263 ms
2:      nodes: 277502           1165 knps       238 ms
3:      nodes: 149121           1818 knps       82 ms
4:      nodes: 134343           1232 knps       109 ms
5:      nodes: 115626           1051 knps       110 ms
6:      nodes: 113802           1016 knps       112 ms
7:      nodes: 281695           998 knps        282 ms
8:      nodes: 574084           1121 knps       512 ms
9:      nodes: 123510           996 knps        124 ms
10:     nodes: 169967           1103 knps       154 ms
11:     nodes: 276801           1021 knps       271 ms
12:     nodes: 253458           1005 knps       252 ms
13:     nodes: 97020            1141 knps       85 ms
14:     nodes: 159597           1043 knps       153 ms
15:     nodes: 167129           1315 knps       127 ms
16:     nodes: 65522            1337 knps       49 ms
17:     nodes: 76565            1629 knps       47 ms
18:     nodes: 28939            1808 knps       16 ms
19:     nodes: 79121            1648 knps       48 ms
20:     nodes: 403537           1695 knps       238 ms
21:     nodes: 84944            1975 knps       43 ms
22:     nodes: 30170            2742 knps       11 ms
23:     nodes: 170031           2537 knps       67 ms
24:     nodes: 67454            1568 knps       43 ms
25:     nodes: 15810            1317 knps       12 ms
26:     nodes: 45439            1514 knps       30 ms
27:     nodes: 280051           1333 knps       210 ms
28:     nodes: 170469           1217 knps       140 ms
29:     nodes: 62235            1244 knps       50 ms
30:     nodes: 22265            1712 knps       13 ms
31:     nodes: 71038            1973 knps       36 ms
32:     nodes: 56817            1959 knps       29 ms
33:     nodes: 47929            2083 knps       23 ms
34:     nodes: 70545            1640 knps       43 ms
35:     nodes: 107293           1650 knps       65 ms
36:     nodes: 95178            2163 knps       44 ms
37:     nodes: 568847           1508 knps       377 ms
38:     nodes: 6311             901 knps        7 ms
39:     nodes: 63522            1134 knps       56 ms
40:     nodes: 0                0 knps          0 ms
41:     nodes: 0                0 knps          1 ms
42:     nodes: 189174           945 knps        200 ms
===========================
Total time (ms) : 4772
Nodes searched  : 6051247
Nodes/second    : 1268073

Thanks a lot @CounterPly.
I will close the issue.

CounterPly added a commit to CounterPly/asmFish that referenced this issue Jun 1, 2018
official-stockfish/Stockfish@6d8f583

arm-port will be finished soon.

This commit also contains a (tentative) bugfix that should restore the full functionality of asmFish_base executables. Performance of other executables should be unaffected. Track this issue here: lantonov#173.
CounterPly added a commit to CounterPly/asmFish that referenced this issue Jun 28, 2018
official-stockfish/Stockfish@6d8f583

arm-port will be finished soon.

This commit also contains a (tentative) bugfix that should restore the full functionality of asmFish_base executables. Performance of other executables should be unaffected. Track this issue here: lantonov#173.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants