Comments (21)
The new rand64 version scores exactly the same as the old one:
Score of TrueEtherRand vs EtherTrueRand_new: 793 - 793 - 8414 [0.500] 10000
Elo difference: 0.00 +/- 2.71
Finished match
from ethereal.
Well I'm flummoxed, I ran a simple C++ program that runs both our RNGs for a billion values and that gives a pretty even distribution for rand(), Andy's rand64() [seeded the same way he did] and C++11's random library. So that test clearly failed.
The only other thing I could think of is you didn't play enough games because it's logically impossible for random movers to be so far apart.
from ethereal.
Is is possible Teki was making illegal moves or losing on time? 10,000 games with that kind of confidence internal... I would be AMAZED if that was just statistical noise.
Some people encode Promotions as one move, some as four. If you encode as one then maybe that is the issue?
I'm not hell bent on finding the difference, but I am very confused.
from ethereal.
My last thought ... and this seems like It really cannot be true -- Do the probabilities change because you are generating psuedo legal moves instead of legal ones?
from ethereal.
No I have 4 separate moves for promotions and while I do generate pseudo-legal moves, I remove any encountered illegal move in case I'm unable to make the move and regenerate a random number so I don't think it should have an effect.
It is possible that Teki is losing on time or making illegal moves. Could you check the PGN @CMCanavessi ?
from ethereal.
Losing on time definitely not, because the games are played at TC=infinite. They are very fast anyways, as both engines are instant movers.
I checked the pgn for the word "illegal" and found nothing. Anyways, I have attached the pgn so you can check it if you want. If you have any problems extracting the pgn file, rename it to .7z (as it didn't let me attach 7z files, i just renamed it to .zip).
Mind you, this is the previous Ethereal Random version, the one with rand() and not rand64(), and 10.000 games. I can make a new match of 100.000 games with the new rand64 version vs teki again if needed, will take a couple of hours.
from ethereal.
Hmm... No illegal, no forfeit. This is really just weird. How about any other random movers?
from ethereal.
Well, it's not easy to find them. The POS engines can make random moves, but they need to be executed with --brain-mode random (or something like that), which I couldn't make it work in cutechess (using arg="--brain-mode random" does not seem to work).
Brutus RND is another one, but it crashes in my pc. Maybe it's related to my ryzen processor.
And Randscacs doesn't move instantly, so it takes longer to test it.
from ethereal.
Wait, I just realized that the zip I attached earlier was the one with Ethereal old vs Ethereal new. It seems I deleted the old pgn I did with Ethereal old vs Teki.
I have started a new match with Ethereal new vs Teki, 100.000 games. Should be done in a couple of hours.
From what I'm seeing, it's already starting to show the same behaviour.
from ethereal.
You can already see the trend, it's exactly the same as before
from ethereal.
from ethereal.
I stopped as it was exactly the same result as before, but got an idea that, as I was playing the matches without opening book, then maybe Ethereal had better opening knowledge (besides random) so I made a new test, using 8-move opening book and playing reverse games. The results are identical:
Score of Ethereal True Random rand64 vs Teki Random Mover: 1249 - 652 - 8099 [0.530] 10000
Elo difference: 20.77 +/- 2.95
Finished match
from ethereal.
from ethereal.
I have one idea but it's probably stupid. Lemme arrange teki's movegen to match the order of ethereal's I'll try that out and do some matches
from ethereal.
This is hilarious.
Changing the move ordering seemed to be the solution. Take a look at this:
I changed the move generation order from:
piece captures, pawn captures, quiet promotions, castling, piece quiets, pawn quiets
to:
quiet promotions, pawn captures, pawn quiets, piece captures, piece quiets, castling
and got:
Score of EtherTrueRand 9.21 vs Teki: 981 - 723 - 8296 [0.513] 10000
Elo difference: 8.97 +/- 2.80
Finished match
It seems the random number gods are at work with varying movelist size and random number generators. No doubt that different move ordering will further change the result.
from ethereal.
Since that seemed to have an affect. Can you do legal move generation instead, and then pick from that list. Instead of picking from the psuedoes until you get a legal.
I feel like that changes things.
from ethereal.
I agree now, it really might make a difference! But it seems very counter-intuitive to me still. I'll just try it
from ethereal.
Legal movegen Teki:
Score of EtherTrueRand 9.21 vs Teki: 882 - 794 - 8324 [0.504] 10000
Elo difference: 3.06 +/- 2.78
You're right, but it still baffles me how this makes a difference
from ethereal.
So here is my thought. Take a look at a pinned queen. This queen likely only has a few legal moves, but has a large list of illegal ones. So if our random number falls within the queen list, we will likely have to generate a new one. For some reason (im postulating) the RNG is less likely to produce another number which sits in the queens list, thus making it more likely to move a lower valued piece.
I would venture to guess that having a mobile queen in random games is what wins things. If the queen is out, you have many more capture possibilities. And for random games all we can really do is hope to take enough material to stumble upon a mate.
Right or wrong, still extremely un-intuitive. Thanks for taking the time to investigate here. I think I'll close this now.
@CMCanavessi If you want a version of Ethereal which matches they way Teki does things, I can do that for you.
from ethereal.
We can finally bury the beaten horse:
https://github.com/Mk-Chan/Teki/blob/master/src/utils.h#L54
Reseeding the RNG everytime with the same value every millisecond => same index picked from the movelist. After removing an illegal move, it just picks the next move (which is further along the movelist and definitely not random).
That reasonably explains the weird behaviour.
Found by @kz04px on ##chessprogramming irc.
from ethereal.
Well, it's not easy to find them. The POS engines can make random moves, but they need to be executed with --brain-mode random (or something like that), which I couldn't make it work in cutechess (using arg="--brain-mode random" does not seem to work).
Brutus RND is another one, but it crashes in my pc. Maybe it's related to my ryzen processor.
And Randscacs doesn't move instantly, so it takes longer to test it.
I have created another instant random mover engine: https://sx.rosada.cz/projects/sxrandom
Brutus RND crashes also on Intel CPU.
from ethereal.
Related Issues (20)
- Invite Ethereal to participate in a chess engine tournament
- Can you build a Korean chess engine? HOT 1
- PONDERLOCK is locked by a thread and unlocked by another thread which is undefined behavior HOT 2
- UCI_AnalyseMode HOT 1
- Error compiling Ethereal on MacOS HOT 2
- compiling error : "the clang compiler does not support '-march=native'" HOT 1
- strange and surprising chess mistake : Why ? HOT 1
- Evals not normalized to +1.00 = 50% win
- Normalized evaluation HOT 5
- Ethereal Commercial VS Ethereal Free HOT 2
- make error HOT 3
- tt_store comment confusion HOT 2
- Things to do if I had time
- pawn targets in genAllNoisyMoves HOT 4
- Sizeof(board.history)
- Please add ARMv9.2, SVE2, Dot Product and Neon support HOT 1
- queen contribution to attackedBy2 is wrong HOT 6
- nit -- line appears to be a no-op
- Bug in evaluateComplexity HOT 2
- Recommendation for CCC Engines
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ethereal.