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

CCC Custom Build Script Warnings #58

Open
AndyGrant opened this issue Apr 30, 2024 · 3 comments
Open

CCC Custom Build Script Warnings #58

AndyGrant opened this issue Apr 30, 2024 · 3 comments

Comments

@AndyGrant
Copy link

Hey Jon. I figured I would share this with you, as I notice it every time I build Arasan for Chess.com.

scoring.cpp: In member function 'void Scoring::calcPawnData(const Board&, ColorType, Scoring::PawnHashEntry::PawnData&)':
scoring.cpp:1355:10: warning: 'void* memset(void*, int, size_t)' clearing an object of non-trivial type 'struct Scoring::PawnHashEntry::PawnData'; use assignment or value-initialization instead [-Wclass-memaccess]
 1355 |    memset(&entr, '\0', sizeof(PawnHashEntry::PawnData));
      |    ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from scoring.cpp:3:
scoring.h:110:15: note: 'struct Scoring::PawnHashEntry::PawnData' declared here
  110 |        struct PawnData {
      |               ^~~~~~~~

This would also be the time to tell you that my build scripts for Arasan can be found here: https://github.com/ChessCom/ccc-configs/blob/master/dockers/arasan.Dockerfile . I recently was able to open-source all of the build scripts at CCC. I've done my best with all engines over the last year+ to make sure I'm building as optimally as I can. If there is anything better to do, or changes to make, please feel free to let me know, either in that repo, via my email ([email protected]), or Discord (agethereal)

Note: The CCC machine is a 2xEPYC 7H12, a zen2 CPU, so its BMI2 support is present, but not good for PEXT/PDEP. I'm happy to run any dockerfile you can provide, if you want a specific version of a compiler for example.

@jdart1
Copy link
Owner

jdart1 commented May 1, 2024

I have not been worrying about this warning, because the code works, even though it may be improper to initialize a complex structure this way. In any case, my intent is to remove the HCE except for endgame code.

@jdart1
Copy link
Owner

jdart1 commented May 1, 2024

Build script looks ok but it is recommended to use Clang as the compiler (the Clang optimizer does a much better job on the NNUE vector code). Can specify by adding CC=clang to the make command line (need then also to ensure clang is available).

@AndyGrant
Copy link
Author

AndyGrant commented May 1, 2024

I believe that entr = {} is considered the C++ ism for clearing it. But as you said, this is not important at all :)

I performed a "go movetime 30000" after setting uci/ucinewgame/position with the g++ compile. I got 429129 nodes per second. With clang++, I got 582866 nps. Quite a gain. I've updated Arasan for the currently running events.

I had a similar experience with gcc vs clang for Ethereal. In time, as I improved the NNUE code, I saw very minor gains with clang, but big gains with gcc. The same exists for Torch, actually.

Please feel free to close this issue, if you don't have any more suggestions for build script changes.
ChessCom/ccc-configs@5ac14f6

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

2 participants