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

Use arrays #2785

Closed
wants to merge 3 commits into from
Closed

Use arrays #2785

wants to merge 3 commits into from

Conversation

Rocky640
Copy link

@Rocky640 Rocky640 commented Jul 1, 2020

Non functional change, use array for safe checks, outposts and king protectors
in evaluate.cpp

Tested for non regression on the safe checks
https://tests.stockfishchess.org/tests/view/5ef8b75c020eec13834a9596
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 22256 W: 4283 L: 4143 D: 13830
Ptnml(0-2): 291, 2439, 5588, 2459, 351

Tested for non regression on the safe checks, outposts and king protectors
https://tests.stockfishchess.org/tests/view/5ef8e543020eec13834a95e7
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 28400 W: 5382 L: 5253 D: 17765
Ptnml(0-2): 394, 3078, 7119, 3223, 386

updated with latest master
bench: 4523573

bench: 4523573
@vondele vondele added the to be merged Will be merged shortly label Jul 1, 2020
snicolet referenced this pull request in pb00068/Stockfish Jul 1, 2020
@snicolet
Copy link
Member

snicolet commented Jul 1, 2020

Two small remarks:

• SafeCheck could use {} for the padding zeros at the beginning of the array:

constexpr int SafeCheck[][2] = {
      {}, {}, {792, 1283}, {645, 967}, {1084, 1897}, {772, 1119}
  };

• Reading the comments in the checking part of king danger analysis, I noticed that the comments are bad. They use "we" in the same sentence with two different meanings (one of them wrong), and anyway "we" is confusing because of the template parameter "Us". Better to remove all occurence of "we", as follows:

// Enemy queen safe checks: count them only if the checks are from squares from
// which opponent cannot give a rook check, because rook checks are more valuable.
// Enemy bishops checks: count them only if they are from squares from which
// opponent cannot give a queen check, because queen checks are more valuable.

Improved some comments as suggested by Stéphane,
and compact code to highlight similar structure.
bench: 4523573
bench: 4523573
@FauziAkram
Copy link
Contributor

Can't wait for it t get merged, so I can start to test some tuning

@vondele
Copy link
Member

vondele commented Jul 2, 2020

@FauziAkram I want to merge this together with the first functional change, so that not all devs have to update their branches for a non-functional change. However, if you want to tune this you can easily get this in your own branch, just do something like:

git checkout -b Rocky640-ArrayStyle4 master
git pull git://github.com/Rocky640/Stockfish.git ArrayStyle4

and you'll be having a new branch with the name Rocky640-ArrayStyle4 on which you can work.

@vondele vondele closed this in 268c00b Jul 3, 2020
@vondele
Copy link
Member

vondele commented Jul 3, 2020

Thanks!

noobpwnftw pushed a commit to noobpwnftw/Stockfish that referenced this pull request Aug 15, 2020
for safe checks, outposts and king protectors in evaluate.cpp

Tested for non regression on the safe checks
https://tests.stockfishchess.org/tests/view/5ef8b75c020eec13834a9596
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 22256 W: 4283 L: 4143 D: 13830
Ptnml(0-2): 291, 2439, 5588, 2459, 351

Tested for non regression on the safe checks, outposts and king protectors
https://tests.stockfishchess.org/tests/view/5ef8e543020eec13834a95e7
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 28400 W: 5382 L: 5253 D: 17765
Ptnml(0-2): 394, 3078, 7119, 3223, 386

closes official-stockfish#2785

No functional change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to be merged Will be merged shortly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants