Queens vs Knights

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

Moderators: hgm, Rebel, chrisw

Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Need material for a speech

Post by Lyudmil Tsvetkov »

Evert wrote:
Lyudmil Tsvetkov wrote: so what happens when you have an UCI engine correctly showing score from white point of view only?
By correctly you mean buggy, right?
What do you think happens? The GUI will report the inverted score when the engine is playing black.
watching scores has meaning only for humans, and those are accustomed to the anchor of the white side, in this way it is immediately clear who has the advantage.
Speak for yourself. I never think "geez, white's position is really good here", I think "crap, I'm totally screwed".
Either way, that's up to how you configure the GUI.
not to mention the case, when one engine shows score from white point of view, and another one from stm point of view: a total chaos.
Yeah. So don't do that. Follow the protocol.
probably, it is time to revise that in UCI.
UCI has issues. This is not one of them (and in fact is one of the things it does right compared to CECP, which AFAIK doesn't define the point of view of the score).
but the engine does not crash, right?
so, it is quite doable.

take the human standard when commenting on a position: it is either white wins, or black wins, but never the side on move is winning, this simply does not make sense.

I guess engines should follow the human standard here.

for example, you will frequently encounter:

- white to play and win, or black to play and win
- or white wins, no matter whose turn it is

and never:

- the side on move/to play wins

so, humans are anchoring their perceptions to the colour of the player, rather than the specific turn.

for me, the human approach makes much more sense.(probably because of this I don't quite understand those repeated lines in engine codes, 'finally return the score from the point of view of the side to move')
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Need material for a speech

Post by Evert »

Lyudmil Tsvetkov wrote: I see half of the games you post end in a draw, so where is the knight side advantage?
They win the other half?
Actually, it's not half if you have more games.
in my opinion, any TC shorter than 1 min. + small increment is simply detrimental both to engine development, as well as general positional assessment. so, a bit longer TC would do fine.
Well, you can run your own at whatever other time control you like.
of course, we need at least 30-40 games, to have even very basic statistical relevance. in my sample, queens also started with couple of losses, but then scored more wins. will be waiting for your new(1000 games?) series. :)
It's 53 in total, with 14 draws and 39 wins for the Knights. That the Queens didn't score even a single win is perhaps surprising.
What I did not have a quick way to correct for (and I'm not going to do it manually) is repeated games. Since Stockfish depends on the GUI to provide it with diverse opening lines it doesn't randomise its starting moves, so many games could be repeated.
you picked up a good starting position.
of course, every single game could be drawn, provided the queens close the entire board. that is why I said pawns restrain knights more, because they are more in number.
Of course, it may be that there is no way to force that.
interesting what happens, if the el.value is set to 90 or 130?
Shouldn't matter much.
since when did SF integrate queen vs minors imbalance?

no info about it on the dev page.
Don't know. I thought the SF position was that you read their code to figure out what is in the engine, rather than describe it. Of course that saves a great deal of time if it changes rapidly.
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Queens vs Knights broadcast

Post by hgm »

Lyudmil Tsvetkov wrote:that is a big progress, man!
No surprise there. Stockfish did get a lot stronger Elo-wise since I last tried this a few years ago.
from 'Queeny wins 100%', meaning 100/100, here we already have 11/13, which is only about 80+%. :)
After I let it run overnight we are now at 27-4. The point is that when QueeNy loses by doing something obviously stupid, because its primitive evaluation does not warn against it (e.g. for lack of trapped-piece patterns), it doesn't tell us much about the position. It just tells us that QueeNy is pretty stupid, stupid enough to occasionally bungle a won position.
2Qs vs 4Ns should be won or close to won for queen side.
Yes, very. I said "a draw seems to be coming" because the ply counter was already at 89. But eventually Stockfish won that game. I suppose 50-move blackmail eventually forced it to sac Q for 2N.
maybe you adjudicate in some way detrimental to queens?
Of course I do not adjudicate. Games that are adjudicated are worthless, and tell you nothing.
but most importantly, as I told you, you can not compare apples and oranges.
why match an engine that knows about the imbalance and another one, that is clueless about it?
For one, it proves knowing about the imbalance is good. Your position is not only wrong (as always), but completely inconsistent. The knowledge by which QueeNy wins is that two extra Knights are better than an extra Queen, so that white has to strive for Q-cs-2N trades. If that kowledge is bad, it could not win by it, but should in fact lose 100% to an 800-Elo stronger opponent. If that knowledge is good (Q < 2N), it already tells in itself that the Kights have the advantage here.
please, grab Evert's revised SF version, or maybe Evert can grab Queeny, to do more meaningful comparison.
Post an executable somewhere, and I will download it. So far it wasn't up for grabs anywhere.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Need material for a speech

Post by Evert »

Lyudmil Tsvetkov wrote: but the engine does not crash, right?
so, it is quite doable.
Missing the point.
take the human standard when commenting on a position: it is either white wins, or black wins, but never the side on move is winning, this simply does not make sense.
Computers are not human.
I guess engines should follow the human standard here.
You guess wrongly. Why should they, if they are not human?
for example, you will frequently encounter:

- white to play and win, or black to play and win
- or white wins, no matter whose turn it is

and never:

- the side on move/to play wins
There are two pieces of information that need to be communicated: the side on move, and the goal. "White to play and win" is a better way to say "White to play. Side to move wins." for humans.
for me, the human approach makes much more sense.(probably because of this I don't quite understand those repeated lines in engine codes, 'finally return the score from the point of view of the side to move')
It's quite obvious that you don't understand. You might begin by educating yourself rather than elevating your lack of understanding why things are done a certain way to a new standard.
For this particular case, read up on "minimax" versus "negamax", two equivalent (in terms of output) algorithms, where one follows your "human-like" approach and one does not, and one is much simpler to implement and use.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Queens vs Knights broadcast

Post by Evert »

hgm wrote:
please, grab Evert's revised SF version, or maybe Evert can grab Queeny, to do more meaningful comparison.
Post an executable somewhere, and I will download it. So far it wasn't up for grabs anywhere.
I can probably do a Linux binary, if that helps? Or, you know what, the source is here: http://www.eglebbk.dds.nl/program/downl ... ish.tar.gz , so whoever feels like it can make optimised compiles for whatever platform they like. Full diff:

Code: Select all

diff -u Stockfish/src/Makefile Nightfish/src/Makefile
--- Stockfish/src/Makefile	2017-07-18 13&#58;21&#58;30.000000000 +0200
+++ Nightfish/src/Makefile	2017-07-18 22&#58;18&#58;17.000000000 +0200
@@ -28,7 +28,7 @@
 endif
 
 ### Executable name
-EXE = stockfish
+EXE = nightfish
 
 ### Installation dir definitions
 PREFIX = /usr/local
diff -u Stockfish/src/material.cpp Nightfish/src/material.cpp
--- Stockfish/src/material.cpp	2017-07-18 13&#58;21&#58;30.000000000 +0200
+++ Nightfish/src/material.cpp	2017-07-18 23&#58;05&#58;43.000000000 +0200
@@ -121,6 +121,10 @@
     if  &#40;pieceCount&#91;Us&#93;&#91;QUEEN&#93; == 1 && pieceCount&#91;Them&#93;&#91;QUEEN&#93; == 0&#41;
          bonus += QueenMinorsImbalance&#91;pieceCount&#91;Them&#93;&#91;KNIGHT&#93; + pieceCount&#91;Them&#93;&#91;BISHOP&#93;&#93;;
 
+    // Elephantiasis correction for Q vs N
+    if &#40;pieceCount&#91;Them&#93;&#91;KNIGHT&#93; > 2&#41;
+       bonus -= 16*112*&#40;pieceCount&#91;Them&#93;&#91;KNIGHT&#93; - 2&#41;*pieceCount&#91;Us&#93;&#91;QUEEN&#93;;
+
     return bonus;
   &#125;
 
diff -u Stockfish/src/misc.cpp Nightfish/src/misc.cpp
--- Stockfish/src/misc.cpp	2017-07-18 13&#58;21&#58;30.000000000 +0200
+++ Nightfish/src/misc.cpp	2017-07-18 13&#58;28&#58;03.000000000 +0200
@@ -122,7 +122,7 @@
   string month, day, year;
   stringstream ss, date&#40;__DATE__); // From compiler, format is "Sep 21 2008"
 
-  ss << "Stockfish " << Version << setfill&#40;'0');
+  ss << "Nightfish " << Version << setfill&#40;'0');
 
   if &#40;Version.empty&#40;))
   &#123;
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Need material for a speech

Post by hgm »

Lyudmil Tsvetkov wrote:I am watching raw engine output all the time, comparing evals.
Don't do that, then, or blame yourself for the consequences.
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Queens vs Knights broadcast

Post by hgm »

Evert wrote:I can probably do a Linux binary, if that helps? Or, you know what, the source is here: http://www.eglebbk.dds.nl/program/downl ... ish.tar.gz , so whoever feels like it can make optimised compiles for whatever platform they like.
A Linux binary won't help; my big machine only runs Windows.

Stckfish does not compile for me, neither on Windows or Linux.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Need material for a speech

Post by Lyudmil Tsvetkov »

Evert wrote:
Lyudmil Tsvetkov wrote: I see half of the games you post end in a draw, so where is the knight side advantage?
They win the other half?
Actually, it's not half if you have more games.
in my opinion, any TC shorter than 1 min. + small increment is simply detrimental both to engine development, as well as general positional assessment. so, a bit longer TC would do fine.
Well, you can run your own at whatever other time control you like.
of course, we need at least 30-40 games, to have even very basic statistical relevance. in my sample, queens also started with couple of losses, but then scored more wins. will be waiting for your new(1000 games?) series. :)
It's 53 in total, with 14 draws and 39 wins for the Knights. That the Queens didn't score even a single win is perhaps surprising.
What I did not have a quick way to correct for (and I'm not going to do it manually) is repeated games. Since Stockfish depends on the GUI to provide it with diverse opening lines it doesn't randomise its starting moves, so many games could be repeated.
you picked up a good starting position.
of course, every single game could be drawn, provided the queens close the entire board. that is why I said pawns restrain knights more, because they are more in number.
Of course, it may be that there is no way to force that.
interesting what happens, if the el.value is set to 90 or 130?
Shouldn't matter much.
since when did SF integrate queen vs minors imbalance?

no info about it on the dev page.
Don't know. I thought the SF position was that you read their code to figure out what is in the engine, rather than describe it. Of course that saves a great deal of time if it changes rapidly.
that makes 27% draws or so, which is by no way negligeable.

nothing like Harm's 100% win rate.

of course, the precise el.value matters very much.
otherwise, why would you set any specific value at all?

it matters very much if you value the 7/3 knights higher, lower, much higher or much lower than a single queen.

SF dev page is very useful for non-programmers, it contains important info, so I guess they should correct imprecise entries.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Queens vs Knights broadcast

Post by Evert »

hgm wrote:
Evert wrote:I can probably do a Linux binary, if that helps? Or, you know what, the source is here: http://www.eglebbk.dds.nl/program/downl ... ish.tar.gz , so whoever feels like it can make optimised compiles for whatever platform they like.
A Linux binary won't help; my big machine only runs Windows.

Stckfish does not compile for me, neither on Windows or Linux.
Well, I can't make Windows binaries for Stockfish any more than I can for SjaakII, so we're stuck there. But at least anyone with an interest can grab the source and compile it to provide binaries if they have the toolchain for it.
Not that there is much point, really. Nightfish beats regular Stockfish at this game, and it will beat QueeNy on account of being a better engine and having the relevant knowledge.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Need material for a speech

Post by Lyudmil Tsvetkov »

btw. one thing I learned about self-matches starting from a specific position is that:
- in most of the cases, maybe some 70%, the obtained result will objectively reflect the game situation
- in a range of cases however, it will not be a precise reflection, or will even distort or considerably/fully distort the picture

I am not very certain when objectivity is achieved, that will probably entirely depend on the specific position tested, maybe whether the engines understand/fail to understand how to play the position.

we don't have a fully reliable method to know which positions engines understand and play well and which not, but that might be one of them, as it is very unusual.

in any case, I am fully certain with perfect play the knight side can not win this position.