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

Newest update crashes on Android #198

Open
SwiftSnips opened this issue Jun 27, 2021 · 19 comments
Open

Newest update crashes on Android #198

SwiftSnips opened this issue Jun 27, 2021 · 19 comments

Comments

@SwiftSnips
Copy link

SwiftSnips commented Jun 27, 2021

Mr. Syzygy1, the newest update of Cfish crashes on Android during certain moments in games. In the past few weeks I have spent time updating the Cfish source also, for myself, only for this crash to happen to me too. Its only on Android, not PC, but I spent a lot of time narrowing down the problem -- and it has something to do with the patch "Remove Coordination between Searching Threads". Its usually mid-to-end game this crash occurs. I thought this could be something you can check out. Ive found you can remove parts of this patch, but not all or the crash occurs.
(The crash usually involves moving the friendly Queen)

@AlexB123
Copy link

I didn't had a much time but i did 3 different tests, with short time controls (no increments), and single and multi core usage, didn't had a single crash, time forfeit or engine flag. I can ensure you that the engine is working flawlessly. :)

@SwiftSnips
Copy link
Author

Try playing a game manually with Droidfish and see if it makes it through a whole one.

@syzygy1
Copy link
Owner

syzygy1 commented Jun 28, 2021

The "Remove Coordination" patch is unlikely to be the cause of any crashes.

If it has to do with queen moves (which also seems unlikely), it should happen in single-threaded mode. In that case it should be possible to find a position on which Cfish crashes reliably. If you can find such a position, that would be very helpful.

@SwiftSnips
Copy link
Author

Ok, Im sure I can. Ill get back with you as soon as I do.

@SwiftSnips
Copy link
Author

SwiftSnips commented Jun 28, 2021

It 1st crashed in this game at 3r1r2/1pk1b1p1/nq2p1n1/2ppPb2/Q4P1p/1NP1BN1P/1R2B1P1/5R1K w - - 5 27

So I backed it up a move to 1k1r1r2/1p2b1p1/nq2p1n1/2ppPb2/Q4P1p/1NP1BN1P/R3B1P1/5R1K w - - 3 26 ... And it crashed again.

Start at move 26 above and it goes 26. Rb2 Kc7 27. (Q wants to move to A1 and it crashes)

(this was on DroidFish)

@AlexB123
Copy link

@SwiftSnips
I set up your FEN position in Droidfish and as you can see on pictures, i was playing against the Cfish. I was making moves then taking them back, as you can see engine is working perfectly.
Screenshot_20210628-230913
Screenshot_20210628-231104
Screenshot_20210628-231225
Also i've played a game against the engine from the beginning, where Queen did several moves, here is pgn
cf test.zip
I'm 100% sure that engine is working without any problems. The question is, did you compiled the engine from the original source code, or your code which you updated by yourself?
Here is armv8 engine without embedded network, try it and you'll see that nothing is wrong with it..
Cfish_280621.zip

@SwiftSnips
Copy link
Author

2N4r/5p1p/3pk1pb/4p1B1/6P1/1P6/3N3q/R4KR1 w - - 2 29
.. Is another it crashed on.

  1. Kf1 Bh6
  2. (Ne4 but it crashed before making this move)
    This was a game I was in analysis mode the entire time on. The 1st position I posted in the previous message was a game I was playing against Chess.com app Level 25.

If you need the entire game of either let me know.

@SwiftSnips
Copy link
Author

@SwiftSnips
I set up your FEN position in Droidfish and as you can see on pictures, i was playing against the Cfish. I was making moves then taking them back, as you can see engine is working perfectly.
Screenshot_20210628-230913
Screenshot_20210628-231104
Screenshot_20210628-231225
Also i've played a game against the engine from the beginning, where Queen did several moves, here is pgn
cf test.zip
I'm 100% sure that engine is working without any problems. The question is, did you compiled the engine from the original source code, or your code which you updated by yourself?
Here is armv8 engine without embedded network, try it and you'll see that nothing is wrong with it..
Cfish_280621.zip

I was using 6(of 8) threads and let it sit for 10-15 seconds. Just so ya know the conditions.

@SwiftSnips
Copy link
Author

@AlexB123

Heres the entire game.

  1. e4 c6 2. d4 d5 3. e5 Bf5 4. Nf3 e6 5. Be2 Nd7 6. O-O Ne7 7. c3 Ng6 8. Ne1 f6 9. f4 Qb6 10. a4 a5 11. Kh1 O-O-O 12. b4 Be7 13. Nd2 fxe5 14. bxa5 Qxa5 15. Nb3 Qa7 16. dxe5 c5 17. a5 Nb8 18. Be3 Na6 19. Nd2 h5 20. Nef3 Kb8 21. Qa4 Nc7 22. a6 Nxa6 23. Nb3 h4 24. h3 Rhf8 25. Ra2 Qb6 26. Rb2 Kc7 *

@SwiftSnips
Copy link
Author

@SwiftSnips
I set up your FEN position in Droidfish and as you can see on pictures, i was playing against the Cfish. I was making moves then taking them back, as you can see engine is working perfectly.
Screenshot_20210628-230913
Screenshot_20210628-231104
Screenshot_20210628-231225
Also i've played a game against the engine from the beginning, where Queen did several moves, here is pgn
cf test.zip
I'm 100% sure that engine is working without any problems. The question is, did you compiled the engine from the original source code, or your code which you updated by yourself?
Here is armv8 engine without embedded network, try it and you'll see that nothing is wrong with it..
Cfish_280621.zip

Oddly enough the one you posted isnt crashing.

@AlexB123
Copy link

Oddly enough the one you posted isnt crashing.

It is compiled with Clang (as usual), not GCC that you use. ;-)

P.s. i think this issue can be closed.
Regards.
Alex.

@JavaMast
Copy link

@SwiftSnips make sure you use original SRCs.
Probably you change something in your SRCs.

@syzygy1
Copy link
Owner

syzygy1 commented Jun 29, 2021

Game-play crashes with filled hash tables and multiple threads aren't reproducible.

A reproducible crash needs a position searched with an empty TT table (of a known size) and 1 thread.

@syzygy1
Copy link
Owner

syzygy1 commented Jun 29, 2021

And of course anything special about how the binary was produced has to be mentioned.

@SwiftSnips
Copy link
Author

SwiftSnips commented Jul 2, 2021

Oddly enough the one you posted isnt crashing.

It is compiled with Clang (as usual), not GCC that you use. ;-)

P.s. i think this issue can be closed.
Regards.
Alex.

I have been using clang to compile my engines for the past few weeks also. Incredibly they are all faster than gcc builds now.

An example of my command line would be "make build -j ARCH=armv8 COMP=clang COMPCXX=aarch64-linux-android-clang++ lto=yes native=no popcnt=yes sparse=yes"

@SwiftSnips SwiftSnips reopened this Jul 2, 2021
@SwiftSnips
Copy link
Author

SwiftSnips commented Jul 2, 2021

Game-play crashes with filled hash tables and multiple threads aren't reproducible.

A reproducible crash needs a position searched with an empty TT table (of a known size) and 1 thread.

I can input that FEN I pasted above, put my Cfish on 6threads, and begin to crash time and time again. It doesnt take a full hash to do it. I'll grab a few screenshots later this afternoon.

Something I did do I forgot to mention, was use a makefile from an older Cfish. Because I kept getting a linker error with the makefile it came with and at the time was having trouble figuring out why. The older Cfish that older makefile came with, works just fine.

@SwiftSnips
Copy link
Author

0

@SwiftSnips make sure you use original SRCs.
Probably you change something in your SRCs.

I have many, many SRCs I have changed. But for this build I downloaded a fresh Cfish, and never opened any file outside of just the Makefile.

@SwiftSnips
Copy link
Author

SwiftSnips commented Jul 4, 2021

Sorry it took so long to get screenshots up, I had to find the time to replay the PGN I posted above... and I hit the jackpot on the 1st try. I got a screenshot to show the engine crashing while considering the move Qa1 again. And Ive got my Cfish options in another screenshot...

image
image

@SwiftSnips
Copy link
Author

SwiftSnips commented Jul 4, 2021

I just reopened DroidFish to this very same position after probably 45 mins to an hour of being off the app, and the engine crashed within 10 seconds of analyzing it.

Just for the record, I have tried it on 1 thread, and just analyze til the hash table fills up... hasnt crashed the 2 times I tried it at this same position.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants