Search found 2916 matches

by lucasart
Sun Jan 13, 2019 9:49 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Writing bugs
Replies: 66
Views: 4416

Re: Writing bugs

State is fine but it should be encapsulated in an object. Like so: rg=random_generator(seed) r=rg.rand() The state maintained by the rg object could be much more complicated than a single number (this would likely be the case for a cryptographically secure random generator). The rg object completel...
by lucasart
Sun Jan 13, 2019 12:37 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Writing bugs
Replies: 66
Views: 4416

Re: Writing bugs

Coming back to the thread-safety problem, I think the real design mistake of C was to define rand(). Instead, a better way, is to make it re-entrant: rand(&seed). That way the ownership of the seed is pushed to the caller, and if the caller wants to make seed thread local, or chooses to use a global...
by lucasart
Mon Jan 07, 2019 12:20 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Simplest way to implement quick and dirty lazy smp
Replies: 14
Views: 1365

Re: Simplest way to implement quick and dirty lazy smp

I fail to see how this is easier. Honestly, managing subprocesses, and communications via pipes, is a lot more complicated in my experience (especially on POSIX systems, with the fork logic being quite mind bending). And it's hideous, from a design/coding standpoint. Simply start threads in an id_l...
by lucasart
Sun Jan 06, 2019 12:44 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: Simplest way to implement quick and dirty lazy smp
Replies: 14
Views: 1365

Re: Simplest way to implement quick and dirty lazy smp

Ok, so just say you haven't got a clue about lazy smp, and are looking for a very quick and dirty way to add to a non-smp program.. which is written in C. What's the easiest and simplest way to implement? Where's the best start point? Well, if your code is not thread-safe and you REALLY want the QU...
by lucasart
Fri Dec 21, 2018 4:31 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: UCI pondering done right
Replies: 52
Views: 2378

Re: UCI pondering done right

So, what have we learnt after 5 pages of this thread?
* UCI pondering is not perfect, but close enough, and there are no shortcuts without shortcomings.
* UCI is easily better than the pile of manure called CECP
* Arguing with HGM is not a good use of one's time
by lucasart
Mon Dec 17, 2018 4:47 am
Forum: Computer Chess Club: General Topics
Topic: Winter 0.3 Release Overview and Select Games
Replies: 5
Views: 378

Re: Winter 0.3 Release Overview and Select Games

Due to time constraints, I took a look at how Stockfish implemented its threadpool. My implementation was inspired by it and ended up being very similar. You don't need a thread pool. Stockfish over engineered in this area. Simply create/join searching threads, as done in Demolito, or Ethereal, for...
by lucasart
Sun Dec 16, 2018 6:36 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: UCI pondering done right
Replies: 52
Views: 2378

Re: UCI pondering done right

I find that making pondering rely on the behavior of hash table on a new search of a different position is even more horrible. What do you mean by "the behavior of hash table on a new search" ? There is only 1 possible behavior, which is to do nothing. Unless, of course, you are debugging your engi...
by lucasart
Sun Dec 16, 2018 1:28 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: UCI pondering done right
Replies: 52
Views: 2378

Re: UCI pondering done right

I find that making pondering rely on the behavior of hash table on a new search of a different position is even more horrible. What do you mean by "the behavior of hash table on a new search" ? There is only 1 possible behavior, which is to do nothing. Unless, of course, you are debugging your engi...
by lucasart
Sun Dec 16, 2018 12:06 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: UCI pondering done right
Replies: 52
Views: 2378

UCI pondering done right

I find the UCI pondering spec truly horrible. It violate both UCI key principles, to the point that it feels like a piece of Winboard grafted on UCI: (1) statelessness. (2) simplicity for engine developers. Instead, I propose a better way to handle pondering, without any change to the protocol. The ...
by lucasart
Sat Dec 08, 2018 4:50 am
Forum: Computer Chess Club: General Topics
Topic: 90 threads now on CCC 3
Replies: 20
Views: 1582

Re: 90 threads now on CCC 3

The TCEC contest has 44 threads (about half of CCC 3). So why not use 44 threads per engine and have pondering turned on? The extra 2 threads will make the server more responsive and avoid competition when the machine needs to do some internal upkeep. That way, you get double the quality with the g...