Rook Bonuses

Code, algorithms, languages, construction...
User avatar
kingliveson
Posts: 1388
Joined: Thu Jun 10, 2010 1:22 am
Real Name: Franklin Titus
Location: 28°32'1"N 81°22'33"W

Rook Bonuses

Post by kingliveson » Tue Oct 04, 2011 5:04 pm

Should Rooks be encouraged to get on the 3rd rank preparing for attack on castled king?

6k1/5ppp/8/8/8/6R1/5PPP/6K1 w - - 0 1
PAWN : Knight >> Bishop >> Rook >>Queen

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: Rook Bonuses

Post by Jeremy Bernstein » Tue Oct 04, 2011 6:13 pm

kingliveson wrote:Should Rooks be encouraged to get on the 3rd rank preparing for attack on castled king?

6k1/5ppp/8/8/8/6R1/5PPP/6K1 w - - 0 1
That's so contingent on other factors, I have trouble seeing how a general rule would do anything but cause rooks to behave strangely in 90% of positions. 3rd rank rook, backed up against a wall of pawns, is not exactly a generally-accepted strategic principle -- in fact, it's a fairly horrible situation for a rook to be in, unless there's a concrete attack or tactic in the works.

But you never know...

My 2c.
jb

User avatar
Uly
Posts: 838
Joined: Thu Jun 10, 2010 5:33 am

Re: Rook Bonuses

Post by Uly » Tue Oct 04, 2011 9:17 pm

I think it would be easy to test, you have some square tables that are used when the opponent hasn't castled and others that kick in when he does, that have small bonuses for rooks on third rank without pawns in front of them.

Then, just play each engine version against each other, the cool thing is that since the improvements are exaggerated, you don't need as many games. If the Rook Bonuses version wins, that doesn't mean the change is better, but it means it's worth a closer look.

I think such a change would not work, though, for the following reasons:

- When having a rook in the third rank against a castled king is possible, the engines are going to find it by themselves, these bonuses are just going to overcompensate and make the engine think it has an advantage bigger that it really has.

- The engine is going to be disrupted by going for such position even when having the rook in the third rank does nothing, abandoning possible plans that would have been better but are scored worse.

- The engine is going to have problems having a realistic mainline, what happens is that the engine thinks the opponent is going to try to stop it from getting its rooks to the third rank, and if there are better moves that don't stop the rooks, and they are played, they're going to surprise the engine.

- The engine will have problems predicting the opponent's moves, this is the flip side of the above, the bonuses make the engine think that the opponent is going to put his rooks on the third rank, and will try to stop him. With bonuses, there's an obsession with stopping the opponent from getting those bonuses. When the engine makes moves that stop the opponent from putting his rooks on the third rank, he'll look funny at you since he wasn't planning on putting the rooks there, so you're not really stopping anything and just wasting tempo.

- When getting the rook to the third rank IS favorable, and the engine does find the best moves faster thanks to it, another problem follows: the engine is going to resist from getting the rooks out of the third file even if those are the best moves. Suppose the best move is to sacrifice the rook for a pawn or a bishop, and that the engine would normally do it, but now, with the bonuses, the engine wrongly thinks that the rook in the third rank is better, and will not play the sacrifice. On less several cases, if the best move is moving the rook to the 4th file, the engine will refuse to do it because the bonuses make the rook artificially look better on the third.

- On the flip side of above, in critical positions where the moves are close to each other, the engine may sacrifice material just to get the rook on the third rank, even though that material was necessary for a successful attack. And of course, if there are better positions for the rook somewhere else, and the rook is already there, the engine is going to wrongly move it back to the third rank, as the bonuses just attract the rook to there because the engine gets better evals for the wrong positions.

Anyway, that's just my theory, probably instead of applying bonuses to third rank rook against castled kings, you could do it like Rybka Dynamic, e.g. have code in there that when there's a rook against castled king, the engine spends more time analyzing those positions, in the hopes that if getting the rook is better, the engine will play into such positions, but if doing it isn't fruitful, the engine will just waste a bit of time extending those variations but will not disrupt the scores and will not run into the above potential problems.

User avatar
Chris Whittington
Posts: 437
Joined: Wed Jun 09, 2010 6:25 pm

Re: Rook Bonuses

Post by Chris Whittington » Tue Oct 04, 2011 9:24 pm

kingliveson wrote:Should Rooks be encouraged to get on the 3rd rank preparing for attack on castled king?

6k1/5ppp/8/8/8/6R1/5PPP/6K1 w - - 0 1

Rybka differs from Fruit in the rook open semi open file case, exactly on this situation. Hyatt's assertion of his cherry-picked snippet of allegedly identical semantics falls over, yet again, as per usual.

LATFC

User avatar
kingliveson
Posts: 1388
Joined: Thu Jun 10, 2010 1:22 am
Real Name: Franklin Titus
Location: 28°32'1"N 81°22'33"W

Re: Rook Bonuses

Post by kingliveson » Tue Oct 04, 2011 9:48 pm

Chris Whittington wrote:
kingliveson wrote:Should Rooks be encouraged to get on the 3rd rank preparing for attack on castled king?

6k1/5ppp/8/8/8/6R1/5PPP/6K1 w - - 0 1

Rybka differs from Fruit in the rook open semi open file case, exactly on this situation. Hyatt's assertion of his cherry-picked snippet of allegedly identical semantics falls over, yet again, as per usual.

LATFC

With all due respect, let's not troll this thread.
PAWN : Knight >> Bishop >> Rook >>Queen

User avatar
kingliveson
Posts: 1388
Joined: Thu Jun 10, 2010 1:22 am
Real Name: Franklin Titus
Location: 28°32'1"N 81°22'33"W

Re: Rook Bonuses

Post by kingliveson » Tue Oct 04, 2011 10:11 pm

@ Jeremy, Uly, the idea is especially when you have the right color Bishop, and or a queen, and half-open central files, you can launch a King-side attack. It is very complicated and might even be a bad idea as you guys tried to explain. I still think it could be worth exploring though.

2r1r1k1/p3nppp/1pq5/2p5/2P4P/1PQ3R1/PB3PP1/1R4K1 b - - 0 1
PAWN : Knight >> Bishop >> Rook >>Queen

User avatar
Uly
Posts: 838
Joined: Thu Jun 10, 2010 5:33 am

Re: Rook Bonuses

Post by Uly » Tue Oct 04, 2011 11:57 pm

The code would not be hurtful if the engine has an heuristic that only kicked in when many plans are equal and getting the rook to the third rank is a tie breaker. I wonder if someone can try something and report back results.

User avatar
kingliveson
Posts: 1388
Joined: Thu Jun 10, 2010 1:22 am
Real Name: Franklin Titus
Location: 28°32'1"N 81°22'33"W

Re: Rook Bonuses

Post by kingliveson » Wed Oct 05, 2011 3:43 am

Uly wrote:The code would not be hurtful if the engine has an heuristic that only kicked in when many plans are equal and getting the rook to the third rank is a tie breaker. I wonder if someone can try something and report back results.
I am already testing it using just the static table, though I haven't added conditions described. One idea is to weigh the attacking bishop slightly more once castling has occurred.
PAWN : Knight >> Bishop >> Rook >>Queen

User avatar
Uly
Posts: 838
Joined: Thu Jun 10, 2010 5:33 am

Re: Rook Bonuses

Post by Uly » Thu Oct 06, 2011 4:20 am

Nice, looking forward to the results.

Prima
Posts: 328
Joined: Tue Dec 14, 2010 6:12 am

Re: Rook Bonuses

Post by Prima » Thu Oct 06, 2011 5:02 am

kingliveson wrote:I am already testing it using just the static table, though I haven't added conditions described. One idea is to weigh the attacking bishop slightly more once castling has occurred.
Just out of curiosity, suppose we had a bishop with opposite colour [opposite squared colour bishop], would adding more weights to the opposite coloured bishop make noticeable difference, in any possible outcome?

Post Reply