Near-random movers

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Robert Pope
Posts: 507
Joined: Sat Mar 25, 2006 7:27 pm

Re: Near-random movers

Post by Robert Pope » Thu Feb 15, 2018 8:54 pm

Volker Annuss wrote:
Robert Pope wrote:I also made a normal searcher that returned a random number instead of the regular eval. That version scored 600 elo better than a RandomMater. Is that to be expected?
Does your version find deep mates? It is known, that a random eval helps the search to find positions with high mobility.
Yes, I guess it would. Any position with no legal moves gets scored as a draw or mate.

tpoppins
Posts: 919
Joined: Tue Nov 24, 2015 8:11 pm
Location: upstate

Re: Near-random movers

Post by tpoppins » Sat Apr 27, 2019 1:30 pm

RuyRandom x64 SSE3 Windoze build:

RuyRandom-tp.zip (Mediafire)
RuyRandom-tp.zip (Filedropper)

The original source was linked to earlier in this thread.
Tirsa Poppins
CCRL

tpoppins
Posts: 919
Joined: Tue Nov 24, 2015 8:11 pm
Location: upstate

Re: Near-random movers

Post by tpoppins » Sat Apr 27, 2019 1:55 pm

A summary of this and a couple of related threads.

Random movers
Near-random movers
Related threads:
Absolute ELO scale
"random mover" chess programs
Tirsa Poppins
CCRL

User avatar
hgm
Posts: 23605
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Near-random movers

Post by hgm » Sat Apr 27, 2019 5:40 pm

Note that NEG isn't much like a random mover (although it does randomize its moves a little, but there are 2400 Elo engines that do that too). It is a non-searching engine, which just plays by SEE (counting moving away the target of the worst SEE against it as additional gain), and in quiet position just by piece-square table, with a bonus for moves that check. It should totally crush real random movers, especially since I patched it to avoid stalemating the opponent by leaving him at least one minor if you are already very much ahead.

The most obvious weakness of this algorithm is that it doesn't know that capturing the attacker also solves a threat. So if the opponent delivers an unsafe check, it will move away its King rather than just take the checker. It is still on my to-do list to let it recognize that too (even if it would just be for capture of the lowest-valued attacker, as in most cases there is only one attacker anyway).

konsolas
Posts: 182
Joined: Sun Jun 12, 2016 3:44 pm
Location: London
Full name: Vincent
Contact:

Re: Near-random movers

Post by konsolas » Sat Apr 27, 2019 6:43 pm

This joke paper might actually be useful for you. The source code has a load of different random and near-random strategies implemented.

http://tom7.org/chess/weak.pdf

tpoppins
Posts: 919
Joined: Tue Nov 24, 2015 8:11 pm
Location: upstate

Re: Near-random movers

Post by tpoppins » Sat Apr 27, 2019 11:16 pm

hgm wrote:
Sat Apr 27, 2019 5:40 pm
Note that NEG isn't much like a random mover (although it does randomize its moves a little, but there are 2400 Elo engines that do that too). It is a non-searching engine, which just plays by SEE (counting moving away the target of the worst SEE against it as additional gain), and in quiet position just by piece-square table, with a bonus for moves that check. It should totally crush real random movers, especially since I patched it to avoid stalemating the opponent by leaving him at least one minor if you are already very much ahead.
Thank you for the info, HGM. It's not clear to me yet if you mean NEG in general or its latest version. Possibly v0.3d we have on our blitz list was more of a near-random mover than later versions? Or perhaps it is just underrated and needs more games to get the rating it deserves. I'll work on that.

By the way, is v1.2 the latest? I had to ask because your download page, for instance, links to Fairy-Max v4.8J but I have v5.03b you announced here a while ago (is that the latest Fairy-Max?).
Tirsa Poppins
CCRL

User avatar
Roland Chastain
Posts: 201
Joined: Sat Jun 08, 2013 8:07 am
Location: France
Full name: Roland Chastain
Contact:

Re: Near-random movers

Post by Roland Chastain » Sun Apr 28, 2019 12:38 pm

@tpoppins

Maybe you could add Iota to your list. It plays the first legal move that it finds. I would call it a random mover.

To give you an idea, here is the result of a little tournament I have made with Iota, both available versions of NEG, Alouette and other engines.

Code: Select all

Rank Name                          Elo     +/-   Games   Score   Draws
   1 Little Wing 0.2               488     498      44   94.3%    6.8%
   2 Irina 0.15                    425     252      44   92.0%    6.8%
   3 Moustique 0.2                  64      87      44   59.1%   31.8%
   4 Cassandre 0.21                 48      84      44   56.8%   36.4%
   5 Alouette 0.0.4                  0      86      44   50.0%   31.8%
   6 Belofte 0.9.0                 -16      98      44   47.7%   13.6%
   7 Alouette 0.0.5                -16      83      44   47.7%   36.4%
   8 EasyPeasy 1.0                 -80      91      44   38.6%   27.3%
   9 NEG 0.3                      -106      87      44   35.2%   34.1%
  10 NEG 1.2                      -115      97      44   34.1%   22.7%
  11 Ram 2.0                      -180      91      44   26.1%   34.1%
  12 Iota 0.3                     -261      87      44   18.2%   36.4%
Finished match
As you have yourself said in another discussion, it isn't easy to find engines weak but working correctly. From that point of view, I believe that Alouette is an interesting engine. :)

tpoppins
Posts: 919
Joined: Tue Nov 24, 2015 8:11 pm
Location: upstate

Re: Near-random movers

Post by tpoppins » Sun Apr 28, 2019 7:11 pm

Thank you for the pointer, Roland. I had v1.0 already but wasn't aware that v0.3 was so suitably weak. If anyone else is interested, here's a Win64 build:

iota 0.3 x64: iota-03-tp.zip

It's not a random mover; e.g. in startpos it always plays 1.Na3. In self-play from startpos it invariably produces a threefold-repetition draw in 14 moves, exactly the same moves every time. That somewhat limits its utility, still I hope I can find some use for it in the 400-1000 Elo range.

Alouette is more sophisticated and thus interests me a lot more indeed. I have serious problems with it at the moment, though; will post about it in your release thread in the General forum.

As for random movers, it would be interesting to expand the list, but from the practical POV Sapeli should do quite nicely as the bottom-most anchor of our blitz list, at least until (and if) we decide to test Andworst. :)
Tirsa Poppins
CCRL

User avatar
hgm
Posts: 23605
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Near-random movers

Post by hgm » Mon Apr 29, 2019 7:27 am

tpoppins wrote:
Sat Apr 27, 2019 11:16 pm
Thank you for the info, HGM. It's not clear to me yet if you mean NEG in general or its latest version. Possibly v0.3d we have on our blitz list was more of a near-random mover than later versions? Or perhaps it is just underrated and needs more games to get the rating it deserves. I'll work on that.
It applies to NEG in general; it has always an engine that selected what it thought would be the best good capture, although the details of how it determined that varied a bit between versions (e.g. a full static exchange evaluation, or just counting number of attackers and protectors).

I don't expect that your rating for NEG in particular is wrong; more games probably would not help. It is just that all ratings in that region are totally off, as the Elo model tends to break down there. Conventional engines (i.e. alpha-beta searchers) are often that weak because they are buggy, and sometimes they are lucky that the bug doesn't manifest itself during the game, and then they can play quite strong games. So they sometimes beat rather strong opponents (especially if the opponent is also buggy, but just blunders more rarely), which the rating-extraction software considers impossible if it doesn't assign them ratings that are much closer than they should be. In a sense most engines in that Elo range play more against their own bugs than against the opponent, making it very hard to determine their relative strength by playing them against each other.

Also, the gap between non-searching engines (including random movers) and alpha-beta searchers is enormous, perhaps as much as 5000 Elo, and there is nothing in that gap that could be used to really measure it. The non-searching engines only score points against alpha-beta searchers because the latter are beaten by their own bugs, and then hand out the points for free no matter what the opponent is.
By the way, is v1.2 the latest? I had to ask because your download page, for instance, links to Fairy-Max v4.8J but I have v5.03b you announced here a while ago (is that the latest Fairy-Max?).
Yes, I think so. That download page is really old, my whole website there is old and in general not maintained. (But it is the only place to find NEG.) The latest Fairy-Max in my source repository says 5.0b, but I see that the version I use privately says 5.0b6, but I don't recall that I really changed anything. Perhaps I added the 6 suffix just to indicate the difference between the various commits in my source repository that were done after the last official release. Currently these are all either fixes for problems on other platforms (C compiler or OS), or extensions of its capabilities for variants that no currently implemented variant uses (such as 'iron pieces', or more freedom in choosing a name for a variant).

abulmo2
Posts: 186
Joined: Fri Dec 16, 2016 10:04 am
Contact:

Re: Near-random movers

Post by abulmo2 » Mon Apr 29, 2019 11:32 am

Once I counted when and how games terminate in case of
- a random mover:
Image
- a mate-in-1 mover:
Image
Richard Delorme

Post Reply