deeds_chess_system

As in chess tournaments and matches...
Amos 4ever
Posts: 62
Joined: Sun Aug 10, 2014 9:42 pm
Real Name: Marco Zerbinati

Re: opening book vs experience file

Post by Amos 4ever »

deeds wrote: Thu Jun 29, 2023 12:28 pm
ocf stalker wrote: All version 2 experience files are based on SugaR's signature including Eman.
Wrong !

Chris we are talking about 2 different things
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;
            }
        };
    }
"V1 and V2" signatures are incompatible with each other in read/write
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
Amos 4ever
Posts: 62
Joined: Sun Aug 10, 2014 9:42 pm
Real Name: Marco Zerbinati

Re: opening book vs experience file

Post by Amos 4ever »

To explain myself better..
if you open any experience file

all at the beginning of the first line bear the wording:

Code: Select all

SugarR Experience version 2
SugarR Experience version 2= signature V2
this makes them compatible in reading and writing between the different engines
botunnet
Posts: 66
Joined: Sun Jun 25, 2023 3:30 pm
Real Name: botunnet
Location: Hrvatska Republika
Contact:

Re: opening book vs experience file

Post by botunnet »

deeds wrote: Thu Jun 29, 2023 12:28 pm Wrong !
Hey Chris, i know you don't read C/C++ :
Image
But these 2 codes did the same thing, get the same data, only the header of the exp file who changes from "SugaR" to "SugaR Experience version 2".
User avatar
deeds
Posts: 1482
Joined: Wed Oct 20, 2021 9:24 pm
Location: France
Contact:

Re: opening book vs experience file

Post by deeds »

Botunnet, please, maybe you didn't follow but, after this, no one will explain exp file formats to me.
Amos 4ever
Posts: 62
Joined: Sun Aug 10, 2014 9:42 pm
Real Name: Marco Zerbinati

Re: opening book vs experience file

Post by Amos 4ever »

------------
:!: Notice:

This post in this topic has been reviewed and edited because it violated the OpenChess Forum Rules. This is a gentle reminder not to continue flaming this thread or others in the Forum. Further recurrent violations of the OpenChess Forum Rules will not be tolerated.

Thanks,

Best regards, Moderation.
------------


I know what I am saying and writing.
Amos 4ever
Posts: 62
Joined: Sun Aug 10, 2014 9:42 pm
Real Name: Marco Zerbinati

Re: opening book vs experience file

Post by Amos 4ever »

------------
Notice:

This post in this topic has been reviewed and edited because it violated the OpenChess Forum Rules. This is a gentle reminder not to continue flaming this topic or others in the Forum. Further recurrent violations of the OpenChess Forum Rules will not be tolerated.

Thanks,

Best regards, Moderation.
------------

botunnet wrote: Thu Jun 29, 2023 1:52 pm
deeds wrote: Thu Jun 29, 2023 12:28 pm Wrong !
Hey Chris, i know you don't read C/C++ :
Image
But these 2 codes did the same thing, get the same data, only the header of the exp file who changes from "SugaR" to "SugaR Experience version 2".

The V1 version is mentioned because the engine handles error pointers if you try to handle the old format.
The logic of the code has changed in the V2 version, as well as features being present that were absent in the V1 version

Code: Select all

            //Check if file signature is matching
            auto check_signature = [&]() -> bool
            {
                if (signature.empty())
                    return true;

                //If inpout length is less than the signature length then it can't be a match!
                if (inputLength < signature.length())
                    return false;

                //Start from the beginning of the file
                input.seekg(ios::beg);

                //Allocate memory for signature
                char* sigBuffer = (char*)malloc(signature.length());
                if (!sigBuffer)
                {
                    sync_cout << "info string Failed to allocate " << signature.length() << " bytes for experience signature verification" << sync_endl;
                    return false;
                }

                if (!input.read(sigBuffer, signature.length()))
                {
                    free(sigBuffer);
                    sync_cout << "info string Failed to read " << signature.length() << " bytes for experience signature verification" << sync_endl;
                    return false;
                }

                bool signatureMatching = memcmp(sigBuffer, signature.c_str(), signature.length()) == 0;

                //Free memory
                free(sigBuffer);

                return signatureMatching;
            };
User avatar
deeds
Posts: 1482
Joined: Wed Oct 20, 2021 9:24 pm
Location: France
Contact:

Re: opening book vs experience file

Post by deeds »

beliefs, trajectories, visions...

On the one hand we have a non-programmer who is forced to learn the language used in the source codes of real programmers.
For his trouble, he changes a few lines, adds himself as an author, renames the engine, registers on online servers, etc.

On the other hand, we have a programmer who has chosen the language he likes.
For his happiness, he can code all the apps he wants, without asking himself the question of mentioning an author or not, without registering on online servers, without social pressure of reputation, he can ignore all the others languages, ignore all other source codes, etc.

Today we once again measure the concern of non-programmers and the independence of programmers.

DeeDs
Sedat Canbaz
Posts: 2289
Joined: Wed Jun 21, 2023 6:29 am

Re: opening book vs experience file

Post by Sedat Canbaz »

------------
Notice:

This post in this topic has been reviewed and edited because it violated the OpenChess Forum Rules. This is a gentle reminder not to continue flaming this topic or others in the Forum. Further recurrent violations of the OpenChess Forum Rules will not be tolerated.

Thanks,

Best regards, Moderation.
------------


Amos 4ever wrote: Thu Jun 29, 2023 10:20 am
Hi Sedat,
just a clarification about me..
All version 2 experience files are based on SugaR's signature including Eman.
Best regards
Hello Marco,

Thanks for the info..

Frankly, and as you may know:
I am not a exp programmer, so no much idea about the based percentages...
I mean how much data contains from Eman, and how much from StockfishMZ
But anyhow, I expect that Deeds can clear all these number percentages...

Greetings
botunnet
Posts: 66
Joined: Sun Jun 25, 2023 3:30 pm
Real Name: botunnet
Location: Hrvatska Republika
Contact:

Re: opening book vs experience file

Post by botunnet »

------------
Notice:

This post in this topic has been reviewed and edited because it violated the OpenChess Forum Rules. This is a gentle reminder not to continue flaming this topic or others in the Forum. Further recurrent violations of the OpenChess Forum Rules will not be tolerated.

Thanks,

Best regards, Moderation.
------------



Image

...

Sedat Canbaz wrote: Thu Jun 29, 2023 7:05 am ...I realized to re-name it because the target was that StockfishMZ eng to use it as default...
...So I see that here there is nothing wrong with that!...
Image

...

Sedat Canbaz wrote: Thu Jun 29, 2023 10:36 pm ...I am not a exp programmer, so no much idea about the based percentages...
Image
SFMZ was polluted for at least 99.5% (=100 * (326-1.5) / 326)

...
User avatar
deeds
Posts: 1482
Joined: Wed Oct 20, 2021 9:24 pm
Location: France
Contact:

Re: opening book vs experience file

Post by deeds »

------------
:!: Notice:

This post in this topic has been reviewed and edited because it violated the OpenChess Forum Rules. This is a gentle reminder not to continue flaming this topic or others in the Forum. Further recurrent violations of the OpenChess Forum Rules will not be tolerated.

Thanks,

Best regards, Moderation.
------------

Sedat Canbaz wrote: Thu Jun 29, 2023 10:36 pm
This has already been established by people :
https://outskirts.altervista.org/forum/ ... ost#p52522
https://outskirts.altervista.org/forum/ ... ost#p52758
https://outskirts.altervista.org/forum/ ... ost#p52759

As it has already been established by people that your tests were unfair, for example :
https://outskirts.altervista.org/forum/ ... ost#p53441

On my website, people can see what openings list are covered or not by the available experience files.


DeeDs
Post Reply