Giter VIP home page Giter VIP logo

dreid's People

Contributors

codefool avatar

Watchers

 avatar  avatar

dreid's Issues

DHT-1: Create iterators

DHT is a large unordered set container, but we need to convert it into a DQ so that it can be fed into CG for the next iteration. The purpose of DHT is so we can quickly identify duplicates, and the purpose of the DQ is to quickly process an unbounded queue. DHT checks for duplicates because its structure lends itself to a quick-ish check. DQ allows duplicates but in the CG processing this is avoided as all input to a DQ is first stored in a DHT. The output of CG is a DHT, BUT to make it as fresh input it must be converted into a DQ.

DR-20: Add adjacency list to resolve Zobrist collisions

Zobrist collisions appear to happen not too often, currently 186 for 27682048. When a collision happens - flag the primary position record with that hash that there is a conflict, and then write that conflicting position in an adjacency file. When searching if a given position exists, and the conflict count is not zero, then the adjacency list is also checked for possible collisions.

CG -11: Change name of constants.h

constants.h has morphed in a general header, and the name should reflect that. On that note, the chessgen project needs to be renamed to something more permanent.

CG-4: Move PosInfo functionality into Position class

This is to support Zobrist hashing. Rather than key off the entire packed position, use only the hash, which will double as the position id. As such, the key to the DHT will be only the hash, and the value will be the combined PackedPosition and PosInfo data together.

The PosInfo should remain as a separate entity until the worker logic is updated to use the hash/Position+PosInfo.

DHT-15: Add collision callback to DHT.

Seeing Zobrist collisions way too early in the generation process. Theory suggests that collisions shouldn't be seen until about 2^32 (4 billion) positions and we're not near that. Figure this out.

DR-19: Make distance number more reliable.

Right now the distance of a position is automatically assigned at ctor, but through copying this may result in inaccurate distance. Make this more reliable by removing the automatic assignment and replacing it with a deliberate assignment.

A tier is a set of positions that are of the same distance from the root position.

Also track tier statistics:

  • Total number of:
    • positions in the tier
    • moves generated by all positions in the tier
    • duplicate positions
    • Zobrist collisions
    • checkmates
    • stalemates
    • captures
  • Total number of
  • Timestamp of first occurrence of position at tier n
  • Timestamp of last occurrence of position at tier n

DR-27: Revert Zobrist hashing changes

Zobrist hashing cannot be used for our purposes. As Zobrist is a one-way hash and is subject to collisions, it cannot be used as a back reference to parent positions (as the actual position is needed to resolve collisions.)

Archive and remove the Zobrist logic and revert back to using a sequential counter as before.

DR-21:Try 128-bit hashes to see if it eliminates Zobrist collisions.

We are experiencing Zobrist collisions in tier 7. The way to fix this is to add a linked list to the dht buckets, but as the hash we use is a one-way hash, it requires lots of processing and additional code to identify the desired position in the list.

Before doing all this work, try using 128-bit hashes to see if the problem is "moved out" beyond our needs.

DR-31 Implement piece class structure

Rather than have a ubiquitous Piece object, create specialized objects for each piece type (subclass of Piece) and move piece-oriented logic into the specialized classes.

DHT-5: Allow custom hasher function in DiskHashTable ctor.

This is to support Zobrist hashing. Normally, the DHT logic generates an MD5 of the key to get the bucket number. Since the Zobrist hash is the key, it is already hashed. The custom hasher for this simply returns the MSB of the hash as a two-digit hex string.

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.