Search found 17161 matches

by hgm
Tue Sep 18, 2018 5:22 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Minimalism in chess programming
Replies: 11
Views: 524

Re: Minimalism in chess programming

Move ordering is very important for the efficiency of an alpha-beta search. Conventional ordering is: (1) Hash move, (2) Null move, (3) captures (in MVV-LVA order), (4) killers (5) non-captures (possibly ordered through the history heuristic). If you don't keep a move list, (i.e. search moves as soo...
by hgm
Tue Sep 18, 2018 12:29 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Minimalism in chess programming
Replies: 11
Views: 524

Re: Minimalism in chess programming

My interest in small code size stems from my Chess programming in the late seventies, when I had only 2KB of RAM available for program + data. And I was wondering wheter one could reach a similar density for the information on the essence of Chess in source code. I used character count as a metric r...
by hgm
Sun Sep 16, 2018 9:49 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Monte Carlo or Minimax?
Replies: 16
Views: 1114

Re: Monte Carlo or Minimax?

Oh, I get it now. But before posting I did a search here for Monte Carlo. I was expecting to see a lot of discussions around the subject and many possible attempts to try MC instead of AB in current engines. Instead, I got very few results. That's why I asked how come everyone is so fond of minimax...
by hgm
Sun Sep 16, 2018 9:40 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Newbie's question about printing the PV
Replies: 12
Views: 462

Re: Newbie's question about printing the PV

Oops, my bad! :oops: I should have written *pvPtr++ = 0; for initializing the empty PV. This line writes the 0 'sentinel' that indicates the end of each PV that Sven is talking about (assuming 0 is not the code for any posisble move). At this point in the code pvPtr and pvStart are equal, but it is ...
by hgm
Fri Sep 14, 2018 5:50 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Monte Carlo or Minimax?
Replies: 16
Views: 1114

Re: Monte Carlo or Minimax?

Special hardware that condensed that enormous amount of training in 9 hours, according to Wikipedia. Even when playing (rather than training), AlphaZero was using 4 TPUs, which equates to a computing power far greater than the best that consumers can buy (in the form of advanced graphics cards) and...
by hgm
Fri Sep 14, 2018 5:23 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Minimalist UCI chess engine written by self learner from scratch
Replies: 18
Views: 696

Re: Minimalist UCI chess engine written by self learner from scratch

It depends on how you score the position. If you return (at least) the static evaluation even when in check, this is only slightly wrong. In effect you then make the assumption that one of the non-captures in general will be able to solve the problem (i.e. evade the check). This is the common case, ...
by hgm
Tue Sep 11, 2018 6:25 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Newbie's question about printing the PV
Replies: 12
Views: 462

Re: Newbie's question about printing the PV

Beware, though: if you have multiple places from which the routine can return, you have to make sure that it will always leave pvPtr as it found it. Usually there is other stuff to restore (like popping the move stack), and I put all that at the end of the routine, and then use a goto to that block ...
by hgm
Tue Sep 11, 2018 3:22 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Monte Carlo or Minimax?
Replies: 16
Views: 1114

Re: Monte Carlo or Minimax?

Thank you. But still, I'm wondering why, if both methods have potential, almost everyone is using Minimax... Up to a year ago MCTS was considered totally unsuitable for a highly tactical game like Chess, and no engine existed based on it that wasn't at least 1500 Elo weaker than a top engine based ...
by hgm
Tue Sep 11, 2018 3:13 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Newbie's question about printing the PV
Replies: 12
Views: 462

Re: Newbie's question about printing the PV

I usually do it like this: Move pvStack[10000]; Move *pvPtr = pvStack; int Search() { Move *pvStart = pvPtr; // start of own PV *pvStart = 0; // initialize empty PV at the top of the PV stack // where you increase alpha because of a better move: pvPtr = pvStart + 1; while((*pvStart++ = *pvPtr++)) ; ...
by hgm
Tue Sep 11, 2018 2:56 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Minimalist UCI chess engine written by self learner from scratch
Replies: 18
Views: 696

Re: Minimalist UCI chess engine written by self learner from scratch

If you increase the score in QS to the static eval, you should check immediately if that score is now >= beta. Now you only do the test after moves are generated, and one move is searched, which would all be wasted affort in that case. A lot of wasted effort, because that move will lead to a new nod...