1.g4 opening is losing?

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

Moderators: hgm, Rebel, chrisw

User avatar
Ovyron
Posts: 4556
Joined: Tue Jul 03, 2007 4:30 am

Re: 1.g4 opening is losing?

Post by Ovyron »

Nope, if the engine reports a mate in N it hasn't pruned any black move, it has checked them all. You can tell the difference between pruned scores and mate scores when the engine shows some +140.00 scores at one depth and some +M56 in the next, the mate score signals the exhaustion of black's defenses (all have been checked.)
Last edited by Ovyron on Tue Feb 11, 2020 8:01 pm, edited 1 time in total.
jp
Posts: 1470
Joined: Mon Apr 23, 2018 7:54 am

Re: 1.g4 opening is losing?

Post by jp »

If that's the case, can you show me where in the source code of SF (or any other open-source engine) it switches to going through a whole mate tree?
User avatar
Ovyron
Posts: 4556
Joined: Tue Jul 03, 2007 4:30 am

Re: 1.g4 opening is losing?

Post by Ovyron »

Must be here:

Code: Select all

        if (nullValue >= beta)
        {
            // Do not return unproven mate scores
            if (nullValue >= VALUE_MATE_IN_MAX_PLY)
                nullValue = beta;

            if (thisThread->nmpMinPly || (abs(beta) < VALUE_KNOWN_WIN && depth < 13))
                return nullValue;

            assert(!thisThread->nmpMinPly); // Recursive verification is not allowed

            // Do verification search at high depths, with null move pruning disabled
            // for us, until ply exceeds nmpMinPly.
            thisThread->nmpMinPly = ss->ply + 3 * (depth-R) / 4;
            thisThread->nmpColor = us;

            Value v = search<NonPV>(pos, ss, beta-1, beta, depth-R, false);

            thisThread->nmpMinPly = 0;

            if (v >= beta)
                return nullValue;
        }
    }
The engine will only show a mate score if it has been "proven".
Zenmastur
Posts: 919
Joined: Sat May 31, 2014 8:28 am

Re: 1.g4 opening is losing?

Post by Zenmastur »

Ovyron wrote: Tue Feb 11, 2020 5:42 pm Your draw would just look more and more impressive over time! In my game against Harvey I was seeing -2.80 positions that white could draw, if I thought you were already lost I'd be playing my moves instantly, but if there's someone aware about your drawing chances, it's me. I WAS ON YOUR SHOES!

Anyway, solving Zenmastur's game is taking longer than expected, what is this?

[d]8/r2k2p1/8/bR6/2R2B2/3P4/PP6/2K5 b - -

"Harem Girl"

40/51 1:35 +132.73 42...Bc7 43.Rxc7+ Rxc7+ 44.Bxc7 Kxc7 45.Rg5 g6 46.Rxg6 Kb7 47.Rb6+ Kc7 48.b4 Kc8 (457.543.715) 4773 TB:1.873.762
41/53 1:38 +M63-- 42...Bc7 43.Rxc7+ (472.924.365) 4782 TB:1.928.314
41/53 1:41 +M54-- 42...Bc7 43.Rxc7+ (489.234.969) 4822 TB:1.953.261
41/53 1:52 +M40-- 42...Bc7 43.Rxc7+ (560.258.410) 4987 TB:3.856.879
41/53 2:07 +M25 42...Bd8 43.Rd5+ Ke8 44.Re4+ Kf7 45.Rxd8 Rb7 46.Kb1 (664.963.639) 5228 TB:5.283.860
41/53 2:07 +M25 42...Bd8 43.Rd5+ Ke8 44.Re4+ Kf7 45.Rxd8 Rb7 46.Kb1 (664.963.835) 5228 TB:5.283.860
42/59 2:28 +M34++ 42...Ke6 (801.910.850) 5391 TB:7.141.423
42/59 2:36 +M43++ 42...Ke6 (846.313.567) 5407 TB:7.397.678
42/59 2:47 +M26 42...Ke6 43.Rc6+ Kd7 44.Rc4 (905.209.767) 5410 TB:7.666.246
42/59 2:47 +M26 42...Ke6 43.Rc6+ Kd7 44.Rc4 (905.209.856) 5410 TB:7.666.246
43/41 2:54 +M35++ 42...Ra6 (947.795.506) 5418 TB:7.939.881
43/41 2:56 +M44++ 42...Ra6 (953.178.106) 5415 TB:8.006.254
43/41 2:56 +M57++ 42...Ra6 (955.691.123) 5414 TB:8.015.887
43/41 2:57 +132.69++ 42...Ra6 (960.656.167) 5413 TB:8.036.922
43/41 3:00 +132.47++ 42...Ra6 (977.615.913) 5412 TB:8.128.563
43/43 3:20 +132.17++ 42...Ra6 (1.078.234.118) 5382 TB:8.998.189
43/65 4:45 +131.79++ 42...Ke6 (1.519.225.024) 5328 TB:11.701.221
43/65 4:47 +130.97++ 42...Ke6 (1.532.196.502) 5322 TB:11.776.257
43/65 4:48 +129.50++ 42...Ke6 (1.533.220.598) 5322 TB:11.786.916
43/65 4:48 +128.66++ 42...Ke6 (1.533.708.362) 5322 TB:11.792.445
43/65 4:48 +74.02++ 42...Ke6 (1.534.031.865) 5321 TB:11.796.172
43/65 4:48 +70.58++ 42...Ke6 (1.534.549.880) 5321 TB:11.798.438
43/65 4:48 +68.85++ 42...Ke6 (1.535.218.422) 5321 TB:11.801.587
43/65 4:48 +66.66++ 42...Ke6 (1.536.943.596) 5320 TB:11.809.486
43/65 4:49 +63.98++ 42...Ke6 (1.538.815.754) 5319 TB:11.820.229
43/65 4:50 +60.62++ 42...Ke6 (1.542.428.498) 5317 TB:11.836.654
43/65 4:50 +56.39++ 42...Ke6 (1.544.255.091) 5316 TB:11.844.292
43/65 4:51 +51.08++ 42...Ke6 (1.547.109.158) 5316 TB:11.863.363
43/65 4:51 +43.60++ 42...Ke6 (1.549.194.193) 5315 TB:11.882.361
43/65 4:52 +34.43++ 42...Ke6 (1.553.371.505) 5313 TB:11.905.751
43/65 4:52 +24.00++ 42...Ke6 (1.554.920.967) 5313 TB:11.909.412
43/65 5:04 +10.93++ 42...Ke6 (1.613.237.024) 5291 TB:12.100.778
43/65 5:35 +10.93 42...Ke6 (1.752.766.644) 5221 TB:13.160.069

Finds the mate in 26, I let it run more to see if it finds a faster mate, instead it now thinks white advantage falls down to +10 pawns?? :shock: I've never seen anything like this before...
I can't believe you've never seen this happen before. This used to piss me off to no end. I dealt with it day in and day out. And it really sucked when you would lose hours and hours of work. On very hard problems this would happen over and over again. Then I added RAM to my system and the problem became MUCH less sever. But, I had maxed my system out and the problem came back on yet harder problems. I eventually upgraded my machine and MAXED the ram in it. I rarely saw this happen after that. I've upgrade again recently and have put even more RAM in my system. I've done some very long mates and haven't seen it happen yet. I'm sure it will, its just a matter of time.

In any case, you need more TT. OR hard positions will always escape your grasp. Of course, you won't notice it in "regular" positions because there is no good way to tell this is happening. :D :D :D

I don't know how often you look deeply into positions, but if it's very often you should upgrade your hardware. You won't regret it.

I thought about giving you this position:

[d]2b2knQ/r1q2rpR/p1N1p2B/1B1p1p2/6P1/2b5/PPP5/2K3R1 w - - 0 30

But I figured it would be way too hard to convince you to try to solve it. Neither of these are particularly "hard" positions. Straight forward analysis will get you there, hardware permitting.

Regards,

Zenmastur

P.S.

I doubt there will be any draws to be had in 1.g4 games!
Only 2 defining forces have ever offered to die for you.....Jesus Christ and the American Soldier. One died for your soul, the other for your freedom.
User avatar
Ovyron
Posts: 4556
Joined: Tue Jul 03, 2007 4:30 am

Re: 1.g4 opening is losing?

Post by Ovyron »

Zenmastur wrote: Tue Feb 11, 2020 9:52 pm I can't believe you've never seen this happen before.
It's my second time solving a position to mate. This was my first time.

I find it a futile exercise because,who cares about mating the opponent in the least moves? What I care about is mating him with the least analysis time.

Compare these two scenarios:

1. Spend 1 minutes per position and mate the opponent in 40 moves. Yeah, I think I could do that from your root position.

2. Spend 12 hours solving the position to a mate and find some mate in 32.

What is that? 22.5 minutes per move? Why waste x22 the time for a faster mate when you could live with 8 moves more, save 11 hours 20 minutes and use the rest of the time for other games?

How long do you need to play a winning move on your machine, 1 second?

Do you see my point?

So I'd never spend my time doing something like this, except I'm doing it because you knew what kind of carrot would get me to try.
Uri Blass
Posts: 10268
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: 1.g4 opening is losing?

Post by Uri Blass »

Ovyron wrote: Tue Feb 11, 2020 7:54 pm
jp wrote: Tue Feb 11, 2020 7:47 pm
Ovyron wrote: Tue Feb 11, 2020 7:44 pm Yeah, the engine doesn't report mate unless it has exhausted the opponent defenses, and doesn't report that a mate is at least in N unless it has exhausted them and can at least guarantee a mate in N would happen.
Is that really how "all" engines are programmed?
It's how they're supposed to be programmed, if an engine shows a Mate in N when it doesn't exist or N is higher in reality, it's a bugged engine. These engines here aren't bugged, so a Mate in 25 can't be improved by black if it's reported.
It may be also a design decision and not a bug.

I would like to see engine A that is based on engine B when the static evaluation of engine A is simply based on games of B against itself when the depth is bigger when A search deeper.

The idea is to play fixed depth game with depth of n plies when you are at distance n plies from the root to calculate the static evaluation

I will give an example:

When A search to depth 1 in the opening position it simply gives B to play against itself at depth 1 after 1.a3 1.a4 2.b3 2.b4
and get evaluation for every move.

If 1.e4 is mate in 70 for white based on the game it gives 1.e4 score of mate in 70 for white.
if 1.d4 is a draw but the evaluation after searching the position after 1.d4 to depth 1 is 0.3 pawns for white you give 1.d4 evaluation of +0.3 for white

You of course choose the move that gives the best score.

when A search to depth 2.
It may decide after lines like 1.e4 e5 to play against itself to depth 2 and decide about the evaluation of 1.e4 e5 based on the result of the game.

properties of A:
1)A use the alpha beta algorithm maybe with some rules of pruning
2)A's static evaluation is not constant and A's static evaluation is probably better when A search deeper because the games of B against itself are also at bigger depth in these cases.
3)A usually see mate score in obviously winning positions.
4)A may also detect fortress positions assuming the depth is high enough to get practically a draw so even without knowledge about KBP vs K it can evaluate it correctly as a non mate score because in games it does not get a mate score(+4 pawns is not a winning score and usually in winning positions that it is easy to win you get a mate score.

I guess A is going to be weaker than B but I do not care and not everything is about playing strength.
A may give some unproved estimate how many moves you need to force mate when B does not do it.
User avatar
Ovyron
Posts: 4556
Joined: Tue Jul 03, 2007 4:30 am

Re: 1.g4 opening is losing?

Post by Ovyron »

Uri Blass wrote: Tue Feb 11, 2020 10:30 pm It may be also a design decision and not a bug.
So the engine would show that it has found a mate in 50 when in reality the mate could be in 60 with a better opponent's defense or maybe there's no mate at all? Looks like a bugged design decision to me...
Zenmastur
Posts: 919
Joined: Sat May 31, 2014 8:28 am

Re: 1.g4 opening is losing?

Post by Zenmastur »

Ovyron wrote: Tue Feb 11, 2020 10:26 pm
Zenmastur wrote: Tue Feb 11, 2020 9:52 pm I can't believe you've never seen this happen before.
It's my second time solving a position to mate. This was my first time.

I find it a futile exercise because,who cares about mating the opponent in the least moves? What I care about is mating him with the least analysis time.

Compare these two scenarios:

1. Spend 1 minutes per position and mate the opponent in 40 moves. Yeah, I think I could do that from your root position.

2. Spend 12 hours solving the position to a mate and find some mate in 32.

What is that? 22.5 minutes per move? Why waste x22 the time for a faster mate when you could live with 8 moves more, save 11 hours 20 minutes and use the rest of the time for other games?

How long do you need to play a winning move on your machine, 1 second?

Do you see my point?

So I'd never spend my time doing something like this, except I'm doing it because you knew what kind of carrot would get me to try.
I think you are looking at it wrong. This was just a test of your hardware. It's lacking.

You should be comparing these two scenarios:

1. Spend 1 minutes per position and lose a game it took months to play.

2. Spend 1 hour resolving the position to a better score and end up winning the game.

The problem is with "normal" positions you can't tell when your hardware is limiting your ability to prosecute the position on the board.

BECAUSE, there is no good way to tell.

BUT, now you know, if push comes to shove, your hardware WILL limit your performance.
Last edited by Zenmastur on Tue Feb 11, 2020 10:45 pm, edited 1 time in total.
Only 2 defining forces have ever offered to die for you.....Jesus Christ and the American Soldier. One died for your soul, the other for your freedom.
User avatar
Ovyron
Posts: 4556
Joined: Tue Jul 03, 2007 4:30 am

Re: 1.g4 opening is losing?

Post by Ovyron »

Zenmastur wrote: Tue Feb 11, 2020 10:40 pm You should be compare these two scenarios:

1. Spend 1 minutes per position and lose a game it took months to play.

2. Spend 1 hours resolving the position to a better score and end up winning the game.

The problem is with "normal" positions you can't tell when your hardware is limiting your ability to prosecute the position on the board.

BECAUSE, there is no good way to tell.
This has nothing to do with finding a mate in a won position, basically, I'm using a different analysis method for your test position, because on a real game the SLOWEST win suffices, if it's easy to find. With my hardware I can take 100 moves to win a position that is a mate in 30, but who cares if I still win it?

To prove that my hardware is lacking, we'd need to play a game, but I'd rather attack your 1.g4, so I'm still solving your test.
Zenmastur
Posts: 919
Joined: Sat May 31, 2014 8:28 am

Re: 1.g4 opening is losing?

Post by Zenmastur »

Ovyron wrote: Tue Feb 11, 2020 10:43 pm
Zenmastur wrote: Tue Feb 11, 2020 10:40 pm You should be compare these two scenarios:

1. Spend 1 minutes per position and lose a game it took months to play.

2. Spend 1 hours resolving the position to a better score and end up winning the game.

The problem is with "normal" positions you can't tell when your hardware is limiting your ability to prosecute the position on the board.

BECAUSE, there is no good way to tell.
This has nothing to do with finding a mate in a won position, basically, I'm using a different analysis method for your test position, because on a real game the SLOWEST win suffices, if it's easy to find. With my hardware I can take 100 moves to win a position that is a mate in 30, but who cares if I still win it?

To prove that my hardware is lacking, we'd need to play a game, but I'd rather attack your 1.g4, so I'm still solving your test.
I figured that would be the carrot that broke the camels back, but you can lead a horse to water...etc.

Beating me playing a 1.g4 game will prove nothing about you or your hardware. It's very much an exercise in futility. If you want a test play an open sicilian or something like that.
Only 2 defining forces have ever offered to die for you.....Jesus Christ and the American Soldier. One died for your soul, the other for your freedom.