ShashChess 16 on Mac M1

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

criko
Posts: 138
Joined: Wed Feb 28, 2018 2:50 pm

ShashChess 16 on Mac M1

Post by criko »

Hi all,

ShashChess 16 does not produce al learning file (Persisted learning = Standard) on Mac M1.

The file is produced during running eng matches, but after the match it is deleted.

There must be something wrong in tt.cpp.

Code: Select all

void writeLearningFile()
{
    /*
      To avoid any problems when saving to experience file, we will actually do the following:
      1) Save new experience to "experience_new.bin"
      2) Remove "experience.bin"
      3) Rename "experience_new.bin" to "experience.bin"

      This approach is failproof so that the old file is only removed when the new file is sufccessfully saved!
      If, for whatever odd reason, the engine is able to execute step (1) and (2) and fails to execute step (3)
      i.e., we end up with experience0.bin then it is not a problem since the file will be loaded anyway the next
      time the engine starts!
    */
    if (!globalLearningHT.empty())
    {
        std::ofstream outputFile(Utility::map_path("experience_new.bin"), std::ofstream::trunc | std::ofstream::binary);
        for (auto& it : globalLearningHT)
        {
            LearningFileEntry currentFileExpEntry;
            NodeInfo currentNodeInfo = it.second;
            int siblingMoveInfoSize = currentNodeInfo.siblingMoveInfo.size();
            for (int k = 0; k < siblingMoveInfoSize; k++)
            {
                MoveInfo currentLatestMoveInfo = currentNodeInfo.siblingMoveInfo[k];
                currentFileExpEntry.depth = currentLatestMoveInfo.depth;
                currentFileExpEntry.hashKey = it.first;
                currentFileExpEntry.move = currentLatestMoveInfo.move;
                currentFileExpEntry.score = currentLatestMoveInfo.score;
                currentFileExpEntry.performance = currentLatestMoveInfo.performance;
                outputFile.write((char*)&currentFileExpEntry, sizeof(currentFileExpEntry));
            }
        }
        outputFile.close();

        remove(Utility::map_path("experience.bin").c_str());
        rename(Utility::map_path("experience_new.bin").c_str(), Utility::map_path("experience.bin").c_str());
    }
}
Dann Corbit
Posts: 12538
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: ShashChess 16 on Mac M1

Post by Dann Corbit »

That is tragic, because it makes pure gold on Windows.
After I run a long analysis, the experience.bin file gives shashchess 16 and ENORMOUS advantage at traditional time controls.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
criko
Posts: 138
Joined: Wed Feb 28, 2018 2:50 pm

Re: ShashChess 16 on Mac M1

Post by criko »

Dann Corbit wrote: Fri Apr 16, 2021 8:27 am That is tragic, because it makes pure gold on Windows.
After I run a long analysis, the experience.bin file gives shashchess 16 and ENORMOUS advantage at traditional time controls.
What a pitty that the author can't answer himself :-/
Dann Corbit
Posts: 12538
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: ShashChess 16 on Mac M1

Post by Dann Corbit »

What UCI parameter settings are you using?
You must have read only turned off for the learning or it will not write.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
Dann Corbit
Posts: 12538
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: ShashChess 16 on Mac M1

Post by Dann Corbit »

I also think you should be able to use the experience file I created. You should give it a try.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
criko
Posts: 138
Joined: Wed Feb 28, 2018 2:50 pm

Re: ShashChess 16 on Mac M1

Post by criko »

Dann Corbit wrote: Sat Apr 17, 2021 11:04 pm What UCI parameter settings are you using?
You must have read only turned off for the learning or it will not write.
Persisted learning=Standard and read only off!