Giter Site home page Giter Site logo

draw detection about demolito HOT 8 CLOSED

lucasart avatar lucasart commented on May 26, 2024
draw detection

from demolito.

Comments (8)

stockfishdeveloper avatar stockfishdeveloper commented on May 26, 2024

Ok, I'm going to work on recognizing insufficient material. I'll open a pull request when I'm done. By the way, a quick going-over of the search routine did not seem to have LMR. If you can verify this, I'll add it.

from demolito.

lucasart avatar lucasart commented on May 26, 2024

thanks.

PS: search has reductions already. have a closer look.

from demolito.

stockfishdeveloper avatar stockfishdeveloper commented on May 26, 2024

OK

from demolito.

stockfishdeveloper avatar stockfishdeveloper commented on May 26, 2024

Alright, I did a rough draft of detecting insufficient material. It gives a score of 3 cp with KBvK and KNvK.
The diff is here: stockfishdeveloper/Demolito@master...stockfishdeveloper:insufficient_material_detection
Note: According to FIDE rules, KNNK is automatically a draw.
I'll open a pull request if you think this is good enough to commit.

from demolito.

lucasart avatar lucasart commented on May 26, 2024

draw by chess rules should not be in the eval, but in the search. same as:

    if (ply > 0 && threadHistory[ThreadId].repetition(pos.rule50()))
        return DrawScore[us];

just need to extend it to include draw by insufficient material. best to make a wrapper function that handles all the cases: 3-rep, 50-move, insufficient material.

also, we should return the contempt score for draw by chess rules generally (3-rep, 50-move, insufficient material, stalemate). we don't want to special case or hardcode.

from demolito.

stockfishdeveloper avatar stockfishdeveloper commented on May 26, 2024

I tried putting the draw detection just after the 50-move rule detection--it didn't work.
I tried
if(pos.insufficient_material()) return some contempt factor;
But the output pvs were empty--because at every node it's getting a cutoff as it's insufficient material.

I'll work it out though.

BTW, I really appreciate your guidance--it's worth its weight in gold at this time in my career aspirations.

from demolito.

lucasart avatar lucasart commented on May 26, 2024

The root node cannot be game over by chess rules, including draw by chess rules. If that happens, the GUI is bogus. You can safely assume that it only happens at interior nodes, in which case, it may truncate the PV, but that's essentially correct. Anyway, there's a ply > 0 condition to prevent pruning at root, just in case (as it can happen for two-fold repetition).

from demolito.

stockfishdeveloper avatar stockfishdeveloper commented on May 26, 2024

OK. Makes sense

from demolito.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.