ELO calculations can be confusing

Discussion of chess software programming and technical issues.

Moderator: Ras

OliverBr
Posts: 865
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Re: ELO calculations can be confusing

Post by OliverBr »

AndrewGrant wrote: Wed Sep 02, 2020 10:17 pm
OliverBr wrote: Wed Sep 02, 2020 9:45 pm Of course, it's not that difficult too see:

Code: Select all

void regPromotions(int f, int c, u64 bt, int* mlist, int* mn, int cap, int queen) {
	while (bt) {
		int t = pullLsb(&bt);
		Move m = f | _ONMV(c) | _PIECE(PAWN) | _TO(t) | (cap ? _CAP(identPiece(t)) : 0);
		if (queen) mlist[(*mn)++] = m | _PROM(QUEEN);
		mlist[(*mn)++] = m | _PROM(KNIGHT);
		mlist[(*mn)++] = m | _PROM(ROOK);
		mlist[(*mn)++] = m | _PROM(BISHOP);
	}
}
Its actually quite hard to see. I'de really suggest you standardize your code before your repo gets any bigger. Otherwise you'll be posting about strange bugfixes for the next half a decade.
Hi Andrew,
some questions:

"Its actually quite hard to see." - It's really hard to see that Knights are ordered before Rook and Bishops?

"Standardize my code" - Can you please elaborate? What is non-standard in this code?

"Gets any bigger" - Do you mean the size of my source? The code didn't grow since version 3. No, even vice versa, it's getting smaller. This is one of the most important features.

"Otherwise you'll be posting about strange bugfixes for the next half a decade." - There is some discontent in this statement. What exactly am I doing to cause this? I do apologize for it.
OliThink GitHub: https://github.com/olithink
Nice arcticle about OlIThink: https://www.chessengeria.eu/post/olithink-oldie-goldie
Chess Engine OliThink Homepage: http://brausch.org/home/chess
OliverBr
Posts: 865
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Re: ELO calculations can be confusing

Post by OliverBr »

@Andrew,
I have just a view at your code and I must say: Very nice, Standard C (not ++) and well documented.
My compliment!
OliThink GitHub: https://github.com/olithink
Nice arcticle about OlIThink: https://www.chessengeria.eu/post/olithink-oldie-goldie
Chess Engine OliThink Homepage: http://brausch.org/home/chess
OliverBr
Posts: 865
Joined: Tue Dec 18, 2007 9:38 pm
Location: Munich, Germany
Full name: Dr. Oliver Brausch

Re: ELO calculations can be confusing

Post by OliverBr »

OliverBr wrote: Wed Sep 02, 2020 9:45 pm And of course it is a bug and can yield to a crash when other side under-promotes a pinned pawn.
Btw, pinned pawns cannot promote without capture, so I could remove a line of code.
And it did happen, most Amazing!
Underpromotion to bishop of a pinned pawn by Fritz in game number 8511, because promotion to Root and Queen is stalemate.
How often does this happen? To bishop?

[pgn]
[Event "?"]
[Site "?"]
[Date "2020.09.03"]
[Round "4256"]
[White "Fruit 2.1"]
[Black "OliThink 5.7.0"]
[Result "1-0"]

1. c3 e5 2. c4 Nc6 3. Qc2 Nf6 4. Nf3 e4 5. Ng5 d5 6. cxd5 Qxd5 7. h4 Nb4 8. Qd1
Qf5 9. d3 Bc5 10. Be3 exd3 11. exd3 Bxe3 12. fxe3 Ng4 13. Qd2 Qc5 14. Nc3 Qxe3+
15. Qxe3+ Nxe3 16. Kd2 f6 17. Nf3 Nxf1+ 18. Rhxf1 O-O 19. a3 Nc6 20. Nb5 Bf5
21. Nfd4 Nxd4 22. Nxd4 Bg4 23. Rae1 Rfe8 24. Nb5 Rxe1 25. Rxe1 c6 26. Nd6 b6
27. Rc1 c5 28. b4 cxb4 29. axb4 Rd8 30. Ne4 Be6 31. Rc7 Bd5 32. Ng3 g6 33. Ne2
Bxg2 34. Rxa7 Be4 35. d4 f5 36. Rc7 Bg2 37. Kc3 b5 38. Nf4 Bf3 39. Ne6 Re8
40. Ng5 Bd5 41. Nxh7 Re3+ 42. Kd2 Re6 43. Ng5 Rd6 44. Ke3 Rd8 45. Rc5 Kg7
46. Rxb5 Kh6 47. Nh3 Bc4 48. Rc5 Re8+ 49. Kf2 Re2+ 50. Kf3 Rc2 51. Nf4 g5
52. hxg5+ Kxg5 53. Nh3+ Kf6 54. Kf4 Bd3 55. Ke3 Bc4 56. Nf4 Bb3 57. Rxc2 Bxc2
58. b5 Ke7 59. d5 Kd6 60. b6 Bb3 61. Kd4 Ba2 62. Kc3 Kd7 63. Kb4 Kc8 64. Kb5 Kb7
65. d6 Bf7 66. d7 Be8 67. dxe8=B 1-0
[/pgn]

I thought it needed much more games. In 5.7.1 the bug is fixed, it won't crush.

BTW, +5 ELO because of changes in time management:

Code: Select all

   # PLAYER            :  RATING  ERROR  POINTS  PLAYED   (%)     W     D     L  D(%)  CFS(%)
   1 Fruit 2.1         :      53      9  3241.5    5678  57.1  2694  1095  1889  19.3     100
   2 OliThink 5.7.1    :       5      9  2669.0    5676  47.0  1819  1700  2157  30.0      88
   3 OliThink 5.7.0    :       0   ----  2606.5    5680  45.9  1760  1693  2227  29.8     ---

White advantage = 29.49 +/- 3.22
Draw rate (equal opponents) = 26.72 % +/- 0.46
OliThink GitHub: https://github.com/olithink
Nice arcticle about OlIThink: https://www.chessengeria.eu/post/olithink-oldie-goldie
Chess Engine OliThink Homepage: http://brausch.org/home/chess