Difference between revisions of "CookieCat"

From Chessprogramming wiki
Jump to: navigation, search
(Created page with "'''Home * Engines * CookieCat''' '''CookieCat''', an educational open source chess program by Steven Edwards designed for peda...")
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
'''[[Main Page|Home]] * [[Engines]] * CookieCat'''
 
'''[[Main Page|Home]] * [[Engines]] * CookieCat'''
  
'''CookieCat''',
+
[[FILE:Spookycat.jpg|border|right|thumb|link=http://4.bp.blogspot.com/-e-zuCaeA7No/T5bmrS8kvtI/AAAAAAAAFic/n0gPYVR82PU/s1600/smokey19350407+Smokey+Stover+First+Spooky+Bill+Holman.jpg| Spooky <ref>Image from [http://4.bp.blogspot.com/-e-zuCaeA7No/T5bmrS8kvtI/AAAAAAAAFic/n0gPYVR82PU/s1600/smokey19350407+Smokey+Stover+First+Spooky+Bill+Holman.jpg The first Spooky and the fifth Smokey] (April 7, 1935) from [http://screwballcomics.blogspot.de/2012/04/how-smokey-stover-got-started-first.html The Birth of Smokey Stover - First Puffs (1935)], [https://en.wikipedia.org/wiki/Bill_Holman_(cartoonist) Bill Holman] [[:Category:Comics|Comics]], Copyright, 1935, by [https://en.wikipedia.org/wiki/Chicago_Tribune Chicago Tribune], [https://en.wikipedia.org/wiki/Tribune_Media_Services New York News Syndicate Inc.], supplied by [https://www.blogger.com/profile/12144756085960502977 Carl Linich], posted by [https://plus.google.com/+PaulTumey Paul Tumey], April 24, 2012</ref> ]]
 +
 
 +
'''CookieCat''',<br/>
 
an educational [[:Category:Open Source|open source chess program]] by [[Steven Edwards]] designed for pedagogical purposes, written in [[Pascal#FreePascal|Free Pascal]] <ref>[http://wiki.freepascal.org/Main_Page Free Pascal wiki]</ref>. CookieCat evolved from the earlier '''Bozochess''' project <ref>[http://www.talkchess.com/forum/viewtopic.php?t=40643&start=24 Release date target] by [[Steven Edwards]], [[CCC]], October 16, 2011</ref> announced in October 2011 <ref>[http://www.talkchess.com/forum/viewtopic.php?t=40643 Announcement: The Bozochess Project] by [[Steven Edwards]], [[CCC]], October 05, 2011</ref>, renamed in December 2011 <ref>[http://www.talkchess.com/forum/viewtopic.php?t=41430&start=4 The name change] by [[Steven Edwards]], [[CCC]], December 16, 2011</ref>, and first released in January 2012 <ref>[http://www.talkchess.com/forum/viewtopic.php?t=42169 CookieCat source via the net] by [[Steven Edwards]], [[CCC]], January 26, 2012</ref> under the [https://en.wikipedia.org/wiki/Permissive_software_licence permissive] [https://en.wikipedia.org/wiki/BSD_licenses BSD License]. However, Steven's wish that his CookieCat should be easily searchable on the net without too many false positives didn't fulfill when [https://en.wikipedia.org/wiki/Steven_Universe Steven Universe] came up with a fictional character <ref>[http://steven-universe.wikia.com/wiki/Cookie_Cat_(character) Cookie Cat (character) | Steven Universe Wiki]</ref> and ice cream <ref>[http://steven-universe.wikia.com/wiki/Cookie_Cat Cookie Cat | Steven Universe Wiki ]</ref> in 2013.  
 
an educational [[:Category:Open Source|open source chess program]] by [[Steven Edwards]] designed for pedagogical purposes, written in [[Pascal#FreePascal|Free Pascal]] <ref>[http://wiki.freepascal.org/Main_Page Free Pascal wiki]</ref>. CookieCat evolved from the earlier '''Bozochess''' project <ref>[http://www.talkchess.com/forum/viewtopic.php?t=40643&start=24 Release date target] by [[Steven Edwards]], [[CCC]], October 16, 2011</ref> announced in October 2011 <ref>[http://www.talkchess.com/forum/viewtopic.php?t=40643 Announcement: The Bozochess Project] by [[Steven Edwards]], [[CCC]], October 05, 2011</ref>, renamed in December 2011 <ref>[http://www.talkchess.com/forum/viewtopic.php?t=41430&start=4 The name change] by [[Steven Edwards]], [[CCC]], December 16, 2011</ref>, and first released in January 2012 <ref>[http://www.talkchess.com/forum/viewtopic.php?t=42169 CookieCat source via the net] by [[Steven Edwards]], [[CCC]], January 26, 2012</ref> under the [https://en.wikipedia.org/wiki/Permissive_software_licence permissive] [https://en.wikipedia.org/wiki/BSD_licenses BSD License]. However, Steven's wish that his CookieCat should be easily searchable on the net without too many false positives didn't fulfill when [https://en.wikipedia.org/wiki/Steven_Universe Steven Universe] came up with a fictional character <ref>[http://steven-universe.wikia.com/wiki/Cookie_Cat_(character) Cookie Cat (character) | Steven Universe Wiki]</ref> and ice cream <ref>[http://steven-universe.wikia.com/wiki/Cookie_Cat Cookie Cat | Steven Universe Wiki ]</ref> in 2013.  
  
Line 119: Line 121:
 
* [[Bobcat]]
 
* [[Bobcat]]
 
* [[Chess 0.5]]
 
* [[Chess 0.5]]
* [[Various Classifications#Comics|Comics]]
 
* [[Various Classifications#Mammal|Mammal]]
 
 
* [[Murka]]
 
* [[Murka]]
 
* [[Myopic]]
 
* [[Myopic]]
Line 154: Line 154:
 
* [https://en.wikipedia.org/wiki/Smokey_Stover Smokey Stover from Wikipedia]
 
* [https://en.wikipedia.org/wiki/Smokey_Stover Smokey Stover from Wikipedia]
 
* [https://en.wikipedia.org/wiki/Spooky Spooky from Wikipedia]
 
* [https://en.wikipedia.org/wiki/Spooky Spooky from Wikipedia]
 +
* [[:Category:Dave Pike|The Dave Pike Set]] - Spooky, [https://www.discogs.com/de/The-Dave-Pike-Set-Got-The-Feelin/release/1789749 Got the Feelin'] (1968), [https://en.wikipedia.org/wiki/YouTube YouTube] Video
 +
: lineup: [[:Category:Dave Pike|Dave Pike]], [[:Category:Ruud Jacobs|Ruud Jacobs]], [https://nl.wikipedia.org/wiki/Louis_Debij Louis Debij], [https://www.discogs.com/de/artist/287923-Joop-Scholten Joop Scholten], [https://nl.wikipedia.org/wiki/Rob_Franken Rob Franken]
 +
: {{#evu:https://www.youtube.com/watch?v=mELUGhDRGQo|alignment=left|valignment=top}}
  
 
=References=
 
=References=
Line 160: Line 163:
 
[[Category:Open Source]]
 
[[Category:Open Source]]
 
[[Category:Pascal]]
 
[[Category:Pascal]]
 +
[[Category:Mac]]
 +
[[Category:Comics]]
 +
[[Category:Mammal]]
 +
[[Category:Dave Pike]]
 +
[[Category:Ruud Jacobs]]

Revision as of 22:11, 28 June 2020

Home * Engines * CookieCat

Spooky [1]

CookieCat,
an educational open source chess program by Steven Edwards designed for pedagogical purposes, written in Free Pascal [2]. CookieCat evolved from the earlier Bozochess project [3] announced in October 2011 [4], renamed in December 2011 [5], and first released in January 2012 [6] under the permissive BSD License. However, Steven's wish that his CookieCat should be easily searchable on the net without too many false positives didn't fulfill when Steven Universe came up with a fictional character [7] and ice cream [8] in 2013.

Description

CookieCat utilizes bitboards as basic data structure to represent the board. Inside CookieCat's source code [9], there are three groups of routines named after some of Steven's feline companions. There are the Lucky positional evaluator routines, the Smokey mate finder routines, and the Spooky general search routines. The names were chosen not so much to be cute, but rather to make it easier for others to identify the program's functional organization [10]. CookieCat features five hash-tables, beside the main transposition table, an endgame tablebase cache, a pawn hash table, evaluation hash table, and a dedicated perft hash table, and can further probe an opening book [11] and Edwards' tablebases.

Bitboard Infrastructure

Bitboards are defined as union (variable structure) of four 16-bit words and one 64 bit value:

    bbtype =
      record
        case Boolean of
          False: (wvec: array [bbwtype] of bbwspantype); { Array of bitboard words }
          True:  (bv64: ui64type)                        { Unsigned 64 bit value }
      end;

Population count and BitScan rely on 16-bit lookups:

  function BbCount(var bb: bbtype): cctype; inline;
    var
      myresult: cctype;
      bbw: bbwtype;
  begin
    with bb do
      begin
        myresult := 0;
        for bbw := bbwmin to bbwmax do
          myresult := myresult + bitcountvec[wvec[bbw]]
      end;
    BbCount := myresult
  end; { BbCount }

  function BbFirstSq(var bb: bbtype): sqxtype; inline;
    var
      myresult: sqxtype;
      bbwindex: Integer;
      wordfirstbit: Integer;
  begin
    with bb do
      begin
        myresult := sqnil;
        bbwindex := 0;
        while (myresult = sqnil) and (bbwindex < bbwlen) do
          begin
            wordfirstbit := bitfirstvec[wvec[bbwindex]];
            if wordfirstbit >= 0 then
              myresult := sqxtype(wordfirstbit + (bbwindex * bbwbitlen))
            else
              Inc(bbwindex)
          end
      end;
    BbFirstSq := myresult
  end; { BbFirstSq }

Spooky

CookieCat's search dubbed Spooky is implemented as iterative search using a finite-state machine as nested procedure inside SpookyFindMove, which structure is outlined in following snippet:

  { ***** Spooky search routines ***** }
  procedure SpookyFindMove(var ssc: ssctype);
    procedure SpookyPrepareRoot;
    procedure SpookyIterationSequence;
      procedure SpookyIterate;
        procedure SpookySearch;
          procedure SpookyLimitTestNode;
          procedure SpookyMovePick;
            procedure SpookyOrderMoves;
            procedure SpookyPickThis(index: Integer);
          procedure SpookyMinimax;
        begin  { SpookySearch }
          with ssc do
            while pirvec[ply].nss <> nssexit do
              case pirvec[ply].nss of
                nssplystart:    { Search state: Initialize processing at this node }
                nssfirdrawtest: { Search state: Draw tests for fiftymoves/insufficient/repetition }
                nsstbprobe:     { Search state: Probe the tablebases }
                nssstandtest:   { Search state: Gainer (QSearch ed.) search stand-pat evaluation and test }
                nssgenerate:    { Search state: Move generation }
                nssmovepick:    { Search state: Move pick }
                nssexecute:     { Search state: Execute the move and advance one ply }
                nssretract:     { Search state: Retreat one ply and retract the move }
                nsspostscan:    { Search state: Post move scan operations }
                nssplyfinish:   { Search state: Final processing for this node }
        end;  { SpookySearch }
      end; { SpookyIterate }
    end; { SpookyIterationSequence }
  end; { SpookyFindMove }

Smokey

Smokey is CookieCat's iterative mate finder with nested procedures outlined below:

  { ***** Smokey mate finder routines ***** }
  procedure SmokeyFindMate(var ssc: ssctype; fmvc: Integer);
    procedure SmokeySearch;
      procedure SmokeyApplyKillerBonus;
    begin
      with ssc do
        while pirvec[ply].nss <> nssexit do
          case pirvec[ply].nss of
            nssplystart:
            nsstermtest:
            nssgenerate:
            nssmovepick:
            nssexecute:
            nssretract:
            nsspostscan:
    end; { SmokeySearch }
 end; { SmokeyFindMate }

Lucky

Lucky, CookieCat's evaluation function with evaluation hash table and pawn hash table considers material, pawn structure with focus on passed pawns [12], and piece mobility.

Download

[13]

See also

Forum Posts

2011

Release date target by Steven Edwards, CCC, October 16, 2011
The name change by Steven Edwards, CCC, December 16, 2011

2012 ...

External Links

lineup: Dave Pike, Ruud Jacobs, Louis Debij, Joop Scholten, Rob Franken

References

Up one level