Mergener / lunachess

A UCI chess engine.
MIT License
8 stars 0 forks source link

Luna using one core full cpu time, while opponent is thinking (in ponder off games) #3

Closed rwbc closed 1 year ago

rwbc commented 1 year ago

Hi Thomas,

In my first test games I noticed that Luna always uses a full core, even in ponder off games, while the opponent is thinking. I don't think it is really calculating, but may be you are polling for infos a way too much or something similar?

This is not desired for testing, because rating test people etc. often now play concurrent games and it is assumed that in ponder off games usually only one cpu per game is used. Also it might seem unfair to give one program 100% of a cpu, while the other only gets 50%.

If this will be fixed I would add Luna to the XB/UCI chronology and offer a WIN compilation in case you agree and don't compile one yourself. :)

Guenther

Mergener commented 1 year ago

Hello Guenther,

I have been recently working in automated tests for Luna (lunatest, already in dev branch), but I'm planning on reviewing your case later today. I'm still not sure what exactly causes the high CPU consumption, however I do imagine that the way I'm multithreading the UCI module is probably not ideal.

About the XB/UCI chronology, I'd be really glad if you did so! :) I'm probably releasing a new build for Luna soon, but feel free to compile one yourself.

Once again, thank you for your contribution!

Thomas

Mergener commented 1 year ago

Hello Guenther,

The problem occurred in a worker thread that polled for 'go' requests.

The issue was fixed in commit 384a7e7a1571de15385d266c6d9e29b9a55235df and pushed to the main branch.

rwbc commented 1 year ago

Hi again Thomas,

I can confirm that the issue is fixed in my WIN compilation. :) Regrettably I found a third one now in the first 60 test games.