Chris we are talking about 2 different thingsdeeds wrote: Thu Jun 29, 2023 12:28 pmWrong !ocf stalker wrote: All version 2 experience files are based on SugaR's signature including Eman.
Old Signature V1
Code: Select all
////////////////////////////////////////////////////////////////
// V1
////////////////////////////////////////////////////////////////
namespace V1
{
const char* ExperienceSignature = "SugaR";
const int ExperienceVersion = 1;
class ExperienceReader : public Experience::ExperienceReader
{
private:
ExpEntry entry;
public:
explicit ExperienceReader() : entry((Key)0, MOVE_NONE, (Value)0, (Depth)0) {}
public:
virtual int get_version()
{
return ExperienceVersion;
}
virtual bool check_signature(ifstream& input, size_t inputLength)
{
return check_signature_set_count(input, inputLength, ExperienceSignature, sizeof(ExpEntry));
}
virtual bool read(ifstream& input, Current::ExpEntry* exp)
{
assert(match && input.is_open());
if (!input.read((char*)&entry, sizeof(ExpEntry)))
return false;
exp->key = entry.key;
exp->move = (Move)entry.move;
exp->value = (Value)entry.value;
exp->depth = (Depth)entry.depth;
exp->count = 1;
return true;
}
};
}
Current Signature V2
Code: Select all
////////////////////////////////////////////////////////////////
// V2
////////////////////////////////////////////////////////////////
namespace V2
{
const string ExperienceSignature = "SugaR Experience version 2";
const int ExperienceVersion = 2;
class ExperienceReader : public Experience::ExperienceReader
{
public:
explicit ExperienceReader() {}
public:
virtual int get_version()
{
return ExperienceVersion;
}
virtual bool check_signature(ifstream& input, size_t inputLength)
{
return check_signature_set_count(input, inputLength, ExperienceSignature, sizeof(ExpEntry));
}
virtual bool read(ifstream& input, Current::ExpEntry* exp)
{
assert(match && input.is_open());
if (!input.read((char*)exp, sizeof(ExpEntry)))
return false;
return true;
}
};
}
in C++ code the signature has the purpose of making read/write compatibility between the different engines that use the same Learning code
-Eman
-SugaR
-HypnoS
-StockfishMZ
-Aurora
including all clones in circulation using code written by Khalid