nkarve / surge

A fast bitboard-based chess move generator in C++
MIT License
63 stars 15 forks source link

compiling surge #7

Closed gothub-273 closed 3 years ago

gothub-273 commented 3 years ago

Hi nkarve,

I am completely new to github, so please excuse this probable unusual contact (could not find your email address). Your "surge" seems to be what I am looking for: a C++ move generator for chess (btw I had a look at stockfish, but it seemed too complicated for me).

Unfortunately comiling your sources with gcc on Linux yields some warnings and errors. E.g. at line 412 in position.h lacks the semicolon (Bitboard capture_mask).

Would you be interested in hearing about my findings? Possibly to incorporate it into your code?

Best regards

gothub-273 gothub@t-online.de

nkarve commented 3 years ago

Absolutely, I'll create a hotifx branch - you can tell me about the errors in this thread

gothub-273 commented 3 years ago

Fine, thank you. I didn't work neither with git nor with github up to now. So I am sorry in advance for potential "disasters" ;-)

On Wed, Dec 02, 2020 at 03:33:14AM +0000, Nihar Karve wrote:

Absolutely, I'll create a hotifx branch - you can tell me about the errors in this thread

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/nkarve/surge/issues/7#issuecomment-736967417

nkarve commented 3 years ago

Aside from the missing semicolon here: https://github.com/nkarve/surge/blob/c4ea4e2655cc938632011672ddc880fefe7d02a6/src/position.h#L410-L412

are there any other issues?

gothub-273 commented 3 years ago

I'm trying to cope with git. Cloning your new branch with "git clone https://github.com/nkarve/surge/tree/hotfix-1" does not yet work for me :(

As an alternative I could write my changes and comments into the files and send it to you via email. Not very nice though ...

On Wed, Dec 02, 2020 at 01:41:36AM -0800, Nihar Karve wrote:

Aside from the missing semicolon here: https://github.com/nkarve/surge/blob/c4ea4e2655cc938632011672ddc880fefe7d02a6/src/position.h#L410-L412

are there any other issues?

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/nkarve/surge/issues/7#issuecomment-737113852

nkarve commented 3 years ago

Have you tried git clone https://github.com/nkarve/surge.git?

gothub-273 commented 3 years ago

That worked, thank you. But I do not understand the meaning of the two branches "master" and "hotfixes-1":

I made some minor changes to types.h and types.cpp and (after "git commit") tried to "push" my changes to "hotfixes-1":

git push origin hotfix-1

That did not work. Or should i try "git push origin master"?

On Wed, Dec 02, 2020 at 01:17:04PM +0000, Nihar Karve wrote:

Have you tried git clone https://github.com/nkarve/surge.git?

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/nkarve/surge/issues/7#issuecomment-737224007

nkarve commented 3 years ago

Take a look at this stackoverflow question. Feel free to make a pull request if you wish to :)

gothub-273 commented 3 years ago

Thank you. I've read a lot. But git is trickier than I thought before.

I managed to clone the hotfix-1 branch by "git clone --branch hotfix-1 --single-branch https://github.com/nkarve/surge.git".

But "git push" does not work. It might be a permission issue:

remote: Permission to nkarve/surge.git denied to gothub-273. fatal: unable to access 'https://github.com/nkarve/surge.git/': The requested URL returned error: 403

May be you first must invite me as a collaborator?

https://docs.github.com/en/free-pro-team@latest/github/setting-up-and-managing-your-github-user-account/permission-levels-for-a-user-account-repository

On Wed, Dec 02, 2020 at 04:02:29PM +0000, Nihar Karve wrote:

Take a look at this stackoverflow question

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/nkarve/surge/issues/7#issuecomment-737325444

nkarve commented 3 years ago

So instead of git push, I would recommend doing a "pull request", as you can see here. However, you're right: git push requires higher permissions.

gothub-273 commented 3 years ago

"pull request" sounds good. First I had to "fork" your hotfix-1 branch. Then tried out some changes and initiated a "pull request". Hopefully you can access to it.

On Thu, Dec 03, 2020 at 02:06:39AM -0800, Nihar Karve wrote:

So instead of git push, I would recommend doing a "pull request", as you can see here. However, you're right: git push requires higher permissions.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/nkarve/surge/issues/7#issuecomment-737821085

gothub-273 commented 3 years ago

I compiled a version containing some changes:

My changes are marked with "//gk".

Alas, the output of my program does not conform to your program output:


 A   B   C   D   E   F   G   H

+---+---+---+---+---+---+---+---+ 8 | r | n | b | q | k | b | n | r | 8 +---+---+---+---+---+---+---+---+ 7 | p | p | p | p | p | p | p | p | 7 +---+---+---+---+---+---+---+---+ 6 | . | . | . | . | . | . | . | . | 6 +---+---+---+---+---+---+---+---+ 5 | . | . | . | . | . | . | . | . | 5 +---+---+---+---+---+---+---+---+ 4 | . | . | . | . | . | . | . | . | 4 +---+---+---+---+---+---+---+---+ 3 | . | . | . | . | . | . | . | . | 3 +---+---+---+---+---+---+---+---+ 2 | P | P | P | P | . | P | P | P | 2 +---+---+---+---+---+---+---+---+ 1 | R | N | B | Q | K | B | N | R | 1 +---+---+---+---+---+---+---+---+ A B C D E F G H

FEN: rnbqkbnr/pppppppp/8/8/8/8/PPPP1PPP/RNBQKBNR w KQkq - Hash: 0x490a6e636f8a2403 Nodes: 290602016 NPS: 97754953 Time difference = 2972760 [microseconds]

I pulled my changed files on github to your hotfix-1 branch. It would be nice if you could compile them for testing.

If you reproduce your previous correct result instead of my incorrect one there might exist a portability issue between the different compilers.

On Thu, Dec 03, 2020 at 07:21:41AM -0800, Nihar Karve wrote:

Closed #7.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/nkarve/surge/issues/7#event-4068081522

gothub-273 commented 3 years ago

Got it. A simple typo in test_perft(). Now it workes awesome :)

On Fri, Dec 04, 2020 at 07:34:56PM +0100, gothub@t-online.de wrote:

I compiled a version containing some changes:

  • removed gcc warnings
  • "extern inline" and "extern constexpr" should be moved from the source to the include files (as far as I can understand)
  • In the main routine of chess_engine.cpp I added a "test_perft();"

My changes are marked with "//gk".

Alas, the output of my program does not conform to your program output:


 A   B   C   D   E   F   G   H

+---+---+---+---+---+---+---+---+ 8 | r | n | b | q | k | b | n | r | 8 +---+---+---+---+---+---+---+---+ 7 | p | p | p | p | p | p | p | p | 7 +---+---+---+---+---+---+---+---+ 6 | . | . | . | . | . | . | . | . | 6 +---+---+---+---+---+---+---+---+ 5 | . | . | . | . | . | . | . | . | 5 +---+---+---+---+---+---+---+---+ 4 | . | . | . | . | . | . | . | . | 4 +---+---+---+---+---+---+---+---+ 3 | . | . | . | . | . | . | . | . | 3 +---+---+---+---+---+---+---+---+ 2 | P | P | P | P | . | P | P | P | 2 +---+---+---+---+---+---+---+---+ 1 | R | N | B | Q | K | B | N | R | 1 +---+---+---+---+---+---+---+---+ A B C D E F G H

FEN: rnbqkbnr/pppppppp/8/8/8/8/PPPP1PPP/RNBQKBNR w KQkq - Hash: 0x490a6e636f8a2403 Nodes: 290602016 NPS: 97754953 Time difference = 2972760 [microseconds]

I pulled my changed files on github to your hotfix-1 branch. It would be nice if you could compile them for testing.

If you reproduce your previous correct result instead of my incorrect one there might exist a portability issue between the different compilers.

On Thu, Dec 03, 2020 at 07:21:41AM -0800, Nihar Karve wrote:

Closed #7.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/nkarve/surge/issues/7#event-4068081522