Thinker output

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

CThinker
Posts: 388
Joined: Wed Mar 08, 2006 10:08 pm

Re: Thinker output

Post by CThinker »

hgm wrote:
Matthias Gemuh wrote:I respect your decision to not output any infos while Thinker is thinking during game play.
I don't see any reason to respect that decision at all. It is a silly decision, ad IMO a violation of WB potocol! I don't see how it would cost you any Elos to print depth and score, but even if it did, when the user says 'post' the engine should post. Just like when the user says 'easy', the engine should not ponder, even when not pondering makes it weaker...
This is not about saving Elo points.

It is "by design".

The search classes has no I/O capability at all. It is cleanly decoupled from any I/O. When to told to seach, it just searches. When it is done, it just returns. It is up to the shell to display any result. The shell also does not know how the search class does its thing. It just know that it will return eventually with a best move and a score.

The only search-time link between the two is that the shell passes the address of a "terminate" flag that the search must check once in a while in case the search needs to be interrupted.

The shell does not even have a concept of iteration depth. Only the search knows that (just because that is how it is implemented). If I decide to invent a new search that does not have iterative deepening, the shell would still work.

As for the Xboard, protocol, it is broken in this way, because it assumes a particular implementation. The same goes for any protocol item that knows about "hash", PV, and any other implementatio-specific materials in engines.

All other engines out there are monolithic. Thinker does not have to be.
User avatar
Matthias Gemuh
Posts: 3245
Joined: Thu Mar 09, 2006 9:10 am

Re: Thinker output

Post by Matthias Gemuh »

hgm wrote:
Matthias Gemuh wrote:I respect your decision to not output any infos while Thinker is thinking during game play.
I don't see any reason to respect that decision at all. It is a silly decision, ad IMO a violation of WB potocol! I don't see how it would cost you any Elos to print depth and score, but even if it did, when the user says 'post' the engine should post. Just like when the user says 'easy', the engine should not ponder, even when not pondering makes it weaker...

I would of course be insane to truely respect a decision that so heavily breaks the protocol.
I just thought that sweet words may lead to a fixing of the bug.
I even have an option in ChessGUI to exclude such engines from tournaments.

Matthias.
My engine was quite strong till I added knowledge to it.
http://www.chess.hylogic.de
CThinker
Posts: 388
Joined: Wed Mar 08, 2006 10:08 pm

Re: Thinker output

Post by CThinker »

Matthias Gemuh wrote:
hgm wrote:
Matthias Gemuh wrote:I respect your decision to not output any infos while Thinker is thinking during game play.
I don't see any reason to respect that decision at all. It is a silly decision, ad IMO a violation of WB potocol! I don't see how it would cost you any Elos to print depth and score, but even if it did, when the user says 'post' the engine should post. Just like when the user says 'easy', the engine should not ponder, even when not pondering makes it weaker...

I would of course be insane to truely respect a decision that so heavily breaks the protocol.
I just thought that sweet words may lead to a fixing of the bug.
I even have an option in ChessGUI to exclude such engines from tournaments.

Matthias.
I don't think there is 'breaking the protocol' here. Even the example that Harm gave - the "easy" command is implementation-specific. There are engines out there that don't know how to ponder. So, you send them and "hard"/"easy" command, and they just ignore them. In fact, you send them a hard + post command, expecting a PV display, but you won't get any when it is not their turn.

And, I don't work on the Thinker code anymore.

Cheers...
CThinker
Posts: 388
Joined: Wed Mar 08, 2006 10:08 pm

Re: Thinker output

Post by CThinker »

hgm wrote:
Matthias Gemuh wrote:I respect your decision to not output any infos while Thinker is thinking during game play.
I don't see any reason to respect that decision at all. It is a silly decision, ad IMO a violation of WB potocol! I don't see how it would cost you any Elos to print depth and score, but even if it did, when the user says 'post' the engine should post. Just like when the user says 'easy', the engine should not ponder, even when not pondering makes it weaker...
And btw, Harm, I'm surprised that you used the 'easy' command as an example:

Code: Select all

C:\Temp\umax>umax.exe
tellics say         micro-Max 1.6w
tellics say         by H.G. Muller
easy
Error (unknown command): easy
hard
Error (unknown command): hard
quit

C:\Temp\umax>
User avatar
Graham Banks
Posts: 41472
Joined: Sun Feb 26, 2006 10:52 am
Location: Auckland, NZ

Re: Thinker output

Post by Graham Banks »

CThinker wrote: And, I don't work on the Thinker code anymore.
Are you working on a new engine?
gbanksnz at gmail.com
User avatar
hgm
Posts: 27811
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Thinker output

Post by hgm »

CThinker wrote:And btw, Harm, I'm surprised that you used the 'easy' command as an example:

Code: Select all

C:\Temp\umax>umax.exe
tellics say         micro-Max 1.6w
tellics say         by H.G. Muller
easy
Error (unknown command): easy
hard
Error (unknown command): hard
quit

C:\Temp\umax>
Well, that I am a lazy SOB does not imply others should be forgiven for acting the same way! :lol: :lol: :lol: Micro-Max cannot ponder at all, and I guess replying "unkown command" to "hard" is a good way to let the GUI know about it. (Not that any existing GUI does anything with that info...). But I agree that it is not logical to give the same to "easy". Note that uMax 1.6w has not been worked on from the time I first released it as a WB engine, which was at a time when I did not work on WB at all, and hardly knew the protocol. My current policy is to let my engines recognize all WB commands that are sent by default, even if only for the purpose to ignore them (like "computer", "ratings", "otim" etc.).

You have point about existing protocols being tailored for a specific implemetation of a chess engine (tree search with iterative deepening). But I am pretty sure Thinker does get its moves that way. So this in itself is no excuse for violating the protocol. In the end you get a PV somehow, don't you? It would already be a great improvement if you print that PV before printing the move (so it is not discarded as ponder output, and ends up in the PGN file).

For me looking at the depth/score and PV info is all the fun. Without it, computer Chess is quite meaningless. This was rubbed in again recently, when I converted some XQ engines from another protocol to WB, through an adapter. That other protocol does not give thinking output, so there is nothing I could do about that. But it is just no fun seeing thoe engines play, knowing not even if they thinnk they are winning or losing.
User avatar
Dr.Wael Deeb
Posts: 9773
Joined: Wed Mar 08, 2006 8:44 pm
Location: Amman,Jordan

Re: Thinker output

Post by Dr.Wael Deeb »

hgm wrote:
CThinker wrote:And btw, Harm, I'm surprised that you used the 'easy' command as an example:

Code: Select all

C:\Temp\umax>umax.exe
tellics say         micro-Max 1.6w
tellics say         by H.G. Muller
easy
Error (unknown command): easy
hard
Error (unknown command): hard
quit

C:\Temp\umax>
Well, that I am a lazy SOB does not imply others should be forgiven for acting the same way! :lol: :lol: :lol: Micro-Max cannot ponder at all, and I guess replying "unkown command" to "hard" is a good way to let the GUI know about it. (Not that any existing GUI does anything with that info...). But I agree that it is not logical to give the same to "easy". Note that uMax 1.6w has not been worked on from the time I first released it as a WB engine, which was at a time when I did not work on WB at all, and hardly knew the protocol. My current policy is to let my engines recognize all WB commands that are sent by default, even if only for the purpose to ignore them (like "computer", "ratings", "otim" etc.).

You have point about existing protocols being tailored for a specific implemetation of a chess engine (tree search with iterative deepening). But I am pretty sure Thinker does get its moves that way. So this in itself is no excuse for violating the protocol. In the end you get a PV somehow, don't you? It would already be a great improvement if you print that PV before printing the move (so it is not discarded as ponder output, and ends up in the PGN file).

For me looking at the depth/score and PV info is all the fun. Without it, computer Chess is quite meaningless. This was rubbed in again recently, when I converted some XQ engines from another protocol to WB, through an adapter. That other protocol does not give thinking output, so there is nothing I could do about that. But it is just no fun seeing thoe engines play, knowing not even if they thinnk they are winning or losing.
Hey Muller,
This is the first time I get the news that you are a SOB,and a lazy one by that :shock:


:P

:lol:
_No one can hit as hard as life.But it ain’t about how hard you can hit.It’s about how hard you can get hit and keep moving forward.How much you can take and keep moving forward….
User avatar
fern
Posts: 8755
Joined: Sun Feb 26, 2006 4:07 pm

Re: Thinker output

Post by fern »

Dear Lance, design your engine as you wish.
I am one of those weird guys that use engines to PLAY, yes, to PLAY, so I can live without the PV line and in fact it is an advantage to me not to be tempted to see how is that the engine will kill me.
Of course most of the pals here use the engines for analysis or whatever, so they feel outraged.
My only demand is this: keep working in Thinker Or create an even better engine.
that is what a sound and sane amateur should ask, I believe.

Fern
CThinker
Posts: 388
Joined: Wed Mar 08, 2006 10:08 pm

Re: Thinker output

Post by CThinker »

hgm wrote:
CThinker wrote:And btw, Harm, I'm surprised that you used the 'easy' command as an example:

Code: Select all

C:\Temp\umax>umax.exe
tellics say         micro-Max 1.6w
tellics say         by H.G. Muller
easy
Error (unknown command): easy
hard
Error (unknown command): hard
quit

C:\Temp\umax>
Well, that I am a lazy SOB does not imply others should be forgiven for acting the same way! :lol: :lol: :lol: Micro-Max cannot ponder at all, and I guess replying "unkown command" to "hard" is a good way to let the GUI know about it. (Not that any existing GUI does anything with that info...). But I agree that it is not logical to give the same to "easy". Note that uMax 1.6w has not been worked on from the time I first released it as a WB engine, which was at a time when I did not work on WB at all, and hardly knew the protocol. My current policy is to let my engines recognize all WB commands that are sent by default, even if only for the purpose to ignore them (like "computer", "ratings", "otim" etc.).

You have point about existing protocols being tailored for a specific implemetation of a chess engine (tree search with iterative deepening). But I am pretty sure Thinker does get its moves that way. So this in itself is no excuse for violating the protocol. In the end you get a PV somehow, don't you? It would already be a great improvement if you print that PV before printing the move (so it is not discarded as ponder output, and ends up in the PGN file).

For me looking at the depth/score and PV info is all the fun. Without it, computer Chess is quite meaningless. This was rubbed in again recently, when I converted some XQ engines from another protocol to WB, through an adapter. That other protocol does not give thinking output, so there is nothing I could do about that. But it is just no fun seeing thoe engines play, knowing not even if they thinnk they are winning or losing.
hgm wrote:
CThinker wrote:And btw, Harm, I'm surprised that you used the 'easy' command as an example:

Code: Select all

C:\Temp\umax>umax.exe
tellics say         micro-Max 1.6w
tellics say         by H.G. Muller
easy
Error (unknown command): easy
hard
Error (unknown command): hard
quit

C:\Temp\umax>
Well, that I am a lazy SOB does not imply others should be forgiven for acting the same way! :lol: :lol: :lol: Micro-Max cannot ponder at all, and I guess replying "unkown command" to "hard" is a good way to let the GUI know about it. (Not that any existing GUI does anything with that info...). But I agree that it is not logical to give the same to "easy". Note that uMax 1.6w has not been worked on from the time I first released it as a WB engine, which was at a time when I did not work on WB at all, and hardly knew the protocol. My current policy is to let my engines recognize all WB commands that are sent by default, even if only for the purpose to ignore them (like "computer", "ratings", "otim" etc.).

You have point about existing protocols being tailored for a specific implemetation of a chess engine (tree search with iterative deepening). But I am pretty sure Thinker does get its moves that way. So this in itself is no excuse for violating the protocol. In the end you get a PV somehow, don't you? It would already be a great improvement if you print that PV before printing the move (so it is not discarded as ponder output, and ends up in the PGN file).

For me looking at the depth/score and PV info is all the fun. Without it, computer Chess is quite meaningless. This was rubbed in again recently, when I converted some XQ engines from another protocol to WB, through an adapter. That other protocol does not give thinking output, so there is nothing I could do about that. But it is just no fun seeing thoe engines play, knowing not even if they thinnk they are winning or losing.
I think you have made a clear example there Harm - your engine does not ponder. That means it cannot support a set of xboard commands.

Micromax also does not support the 'move now' ("?") command. I use micromax to play, and I would rather have the 'move now' command than the PV display. It is very common for me to get bored, and I just need the engine to make the move.

But I understand all these, because I have the same set of limitations with Thinker.

As for PV, Thinker does not have one. It does not collect PV arrays. Again, just like MicroMax. Thinker is actually patterned after the Amy engine. The PV display that you get from Thinker is nothing more than a walk of the hash table (just like... Amy).

The ways that other engines collect PV arrays look very hacky to me. They either allocate a square array, but use only half of it, or, allocates PV arrays on the stack on each call to a search function. Neither is acceptable to me. So, until I device a really clean solution, I am not inclined on polluting the Thinker code.

The current code is really clean, very compartmentalized, and only contains the necessary code to find a good-enough root move and relay that to the user.

I could chose to make a giant monolithic engine (just like the others out there) and support the fancy protocol items, or, I can chose to make a small, cleanly structured engine that I can easily understand. I chose the latter. But that's just me.

Remember, when Thinker fist came out, the book engine (BookThinker) is separate from the search engine. BookThinker was actually the first of its kind at that time. Later, there was a huge struggle on whether the book code should go with the search code, because really, they do two very disjoint operations (file operations vs in-memory tree search). Many programmers here probably don't struggle with such design and architecture decisions, but I do.

We eventually found a clean way of having both to co-exist in the same architecture ("strategy" pattern, from 'design patterns'). I value that elegance of design and implementation. But again, that's just me.
CThinker
Posts: 388
Joined: Wed Mar 08, 2006 10:08 pm

Re: Thinker output

Post by CThinker »

Graham Banks wrote:
CThinker wrote: And, I don't work on the Thinker code anymore.
Are you working on a new engine?
No, not really. Kerwin does all the Thinker development now. He does a much better, elegant and cleaner job anyway.

I'm "trying" to port the current code to the DS platform. That is progressing slow.