KYLChiu / sporkfish

Chess engine in Python
MIT License
5 stars 0 forks source link

[Design] Redesign for stats #99

Closed KYLChiu closed 4 months ago

KYLChiu commented 7 months ago
          I'll clean these up - mainly the design is so convoluted because I need them for SMP.

_Originally posted by @KYLChiu in https://github.com/KYLChiu/sporkfish/pull/97#discussion_r1473485325_

Current situation:

Requirements or points of discussion:

ccjeremylo commented 6 months ago
          I'll clean these up - mainly the design is so convoluted because I need them for SMP.

_Originally posted by @KYLChiu in #97 (comment)_

Current situation:

  • Stats are not propagated to engine/tests, making it difficult to do any analysis.
  • Stats are not well designed, it only contains nodes visited and no other information. Moreover it's convoluted - we have to pass in a dictionary and mutate it due to lazy SMP - we can't spawn a process agnostic object from within the class.

Requirements or points of discussion:

  • Add visited type of nodes, ie differentiate between quiescence and negamax nodes, plus node properties like cutoff or returned by transposition table.
  • Make this retrievable from engine and/or tests, which can form the basis of branching factor analysis in future.
  • Let's have the Statistics class stats data structure(s) for now? Lazy SMP issue for later.

sorry, what is SMP? @KYLChiu

KYLChiu commented 6 months ago

Lazy Symmetric Multiprocessing

ccjeremylo commented 6 months ago

Discussed offline:

General comments - the statistics class would become very specific to negamax after our change, for now we just keep it as a negamax specific statistics class

Tests: