Mater adapted for Free Pascal

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

Moderators: hgm, Rebel, chrisw

User avatar
F.Huber
Posts: 853
Joined: Thu Mar 09, 2006 4:50 pm
Location: Austria

Re: Mater GUI 0.2.1

Post by F.Huber »

Roland Chastain wrote: Thu Nov 18, 2021 10:36 pm Of course I am interested to implement your changes! But I couldn't download your file. When I clicked on the Download button I saw only ladies without clothes. :)
'ladies without clothes'? WOW, you're a lucky man! :mrgreen:
I only get my file from this link ... :(

Ok, I've sent you an email with the file attached ...

Regards,
Franz
User avatar
Roland Chastain
Posts: 657
Joined: Sat Jun 08, 2013 10:07 am
Location: France
Full name: Roland Chastain

Re: Mater GUI 0.2.1

Post by Roland Chastain »

F.Huber wrote: Fri Nov 19, 2021 12:20 am Ok, I've sent you an email with the file attached ...
Hello Franz. Thank you for the file. I made all the modifications that you suggested. I am very glad of the result. Thank you for the big step ahead that this project does with your help.

I haven't searched how to kill a process. Meanwhile Mater is called only if depth <= 6 or depth <= 12 and search mode = checks only.

Please take a look at the new version of the code (if you have time and desire). Not yet had time to make binaries.

https://gitlab.com/rchastain/mater

Regards.

Roland
Qui trop embrasse mal étreint.
User avatar
Roland Chastain
Posts: 657
Joined: Sat Jun 08, 2013 10:07 am
Location: France
Full name: Roland Chastain

Re: Mater adapted for Free Pascal

Post by Roland Chastain »

Hello!

Glad to announce a new revision of Mater. Two important corrections have been made (both related to en passant capture). Thanks to Franz Huber for reporting the bug (1) and for indicating a fix.

Uploaded Linux binaries. (Don't have a Windows system under the hand for now.)

releases/1.1.20211120

(1) Mater did not see this mate in one.

Regards.

Roland
Qui trop embrasse mal étreint.
User avatar
Roland Chastain
Posts: 657
Joined: Sat Jun 08, 2013 10:07 am
Location: France
Full name: Roland Chastain

Re: Mater adapted for Free Pascal

Post by Roland Chastain »

I have just made another modification, in order to have the possibility to stop Mater during the search by pressing on one of the following keys: s, S, a, A (like stop or abort). Tested successfully on Linux. Should work also under Windows.

Please tell me 1° if it works for you ; 2° if this is a satisfying solution.

We could also use for that purpose the Search button, by changing its caption to 'Stop' during the search, but it would imply to stop both engines. Or should I make two Search buttons, one for Mater and one for Chest, with the possibility to stop each one?

Attention! If you wish to test that experimental feature, you have to download the latest code from the GitLab repository.
Qui trop embrasse mal étreint.
User avatar
F.Huber
Posts: 853
Joined: Thu Mar 09, 2006 4:50 pm
Location: Austria

Re: Mater adapted for Free Pascal

Post by F.Huber »

Hi Roland,
Roland Chastain wrote: Sat Nov 20, 2021 9:52 am I have just made another modification, in order to have the possibility to stop Mater during the search by pressing on one of the following keys: s, S, a, A (like stop or abort). Tested successfully on Linux. Should work also under Windows.

Please tell me 1° if it works for you ; 2° if this is a satisfying solution.
yes, it works, but it's a quite brutal method with the Windows command 'taskkill'. ;)
I know from my ChestUCI sources, that in Windows you can close a process with 'TerminateProcess(...)' without having to use such an external
tool like 'taskkill', if the process has been started with 'CreateProcess(...)'.
We could also use for that purpose the Search button, by changing its caption to 'Stop' during the search, but it would imply to stop both engines. Or should I make two Search buttons, one for Mater and one for Chest, with the possibility to stop each one?
Yep, a [Search/Stop] button would certainly be better. But I don't understand, why "it would imply to stop both engines"?
You could just check which engine is still thinking, and only stop this engine - in most cases this will only be Mater, because WinChest is much faster.

BTW, in your line for the Mater command
LCommand := Format('%s -p "%s" -m %d%s 2', [
I see that you've already removed the '>Error.log', but I guess also the ' 2' at the end is superfluous.

Regards,
Franz
User avatar
F.Huber
Posts: 853
Joined: Thu Mar 09, 2006 4:50 pm
Location: Austria

Re: Mater adapted for Free Pascal

Post by F.Huber »

Hi Roland,

I just saw, that WinChest doesn't solve mates with the option 'Check only'.
After looking at my ChestUCI sources I discovered, that the option '-C N' is used in a different way than I've told you some days ago:
for 'Check only' it requires the option '-C 1' additionally to the number of moves (similar to mater), e.g. for a mate in 4 with
'Check only' the command has to look like: winchest.exe -b -Z 4 - C 1

Unfortunately I've misinterpreted this option '-C N' when starting the Winchest help with -?, it's already many years ago when I
programmed ChestUCI, so I didn't remember it correctly (and ChestUCI chooses this option automatically of course).
Sorry for the inconvenience, :(

BTW, another problem is, that pasting a FEN from the clipboard is more restrictive than loading it from a file.
In my file ChestUCI.epd the mate problems are stored with more infos then usual, for example:
8/8/8/2p1R3/1p3p2/1p1k1p2/1B5p/1K2Q3 w - - bm #2; Duals(2); 00:00;
If this string is loaded from my filen, then MaterGUI accepts it (it just removes everything after 'w - -'),
but when trying to paste the same string from the clipboard, it's not accepted as legal FEN.
Your function 'LFilter.IsFen' seems to be a bit too restrictive - IMO it should accept the same strings like for FEN or EPD files.
But if you don't want to change this, I could also do this myself in my own version.

Regards,
Franz
User avatar
Roland Chastain
Posts: 657
Joined: Sat Jun 08, 2013 10:07 am
Location: France
Full name: Roland Chastain

Re: Mater adapted for Free Pascal

Post by Roland Chastain »

Hi Franz.

Thank you for all these informations.
F.Huber wrote: Sat Nov 20, 2021 5:30 pm BTW, another problem is, that pasting a FEN from the clipboard is more restrictive than loading it from a file.
In my file ChestUCI.epd the mate problems are stored with more infos then usual, for example:
8/8/8/2p1R3/1p3p2/1p1k1p2/1B5p/1K2Q3 w - - bm #2; Duals(2); 00:00;
If this string is loaded from my filen, then MaterGUI accepts it (it just removes everything after 'w - -'),
but when trying to paste the same string from the clipboard, it's not accepted as legal FEN.
Your function 'LFilter.IsFen' seems to be a bit too restrictive - IMO it should accept the same strings like for FEN or EPD files.
Good point. I will change that. See you soon!

Regards.

Roland
Qui trop embrasse mal étreint.
User avatar
Roland Chastain
Posts: 657
Joined: Sat Jun 08, 2013 10:07 am
Location: France
Full name: Roland Chastain

Re: Mater adapted for Free Pascal

Post by Roland Chastain »

Fixed clipboard issue. Fixed Chest command (tested only on Linux).

Made two buttons, one for Mater, one for Chest. When you press the first button, both are pushed. Seems to work.
F.Huber wrote: Sat Nov 20, 2021 2:06 pm BTW, in your line for the Mater command
LCommand := Format('%s -p "%s" -m %d%s 2', [
I see that you've already removed the '>Error.log', but I guess also the ' 2' at the end is superfluous.
Thank you for pointing out that. Done.

Of course repository updated.

Regards.

Roland
Qui trop embrasse mal étreint.
User avatar
F.Huber
Posts: 853
Joined: Thu Mar 09, 2006 4:50 pm
Location: Austria

Re: Mater adapted for Free Pascal

Post by F.Huber »

Roland Chastain wrote: Sat Nov 20, 2021 8:46 pm Fixed clipboard issue. Fixed Chest command (tested only on Linux).
Made two buttons, one for Mater, one for Chest. When you press the first button, both are pushed. Seems to work.
Thanks, I'll test it.

But your previous change (introducing 'UniqueInstance') was a shock for me:
Lazarus had to download this package, then it rebuilt itself completely, and at the end
the IDE 'lazarus.exe' had changed its size from 22MB to almost 280MB! :(

I'll definitely remove this code again in my version, and I don't understand why this was necessary at all,
because when the Search button is disabled, then it's impossible to start several instances of Mater, isn't it?

Regards,
Franz
User avatar
F.Huber
Posts: 853
Joined: Thu Mar 09, 2006 4:50 pm
Location: Austria

Re: Mater adapted for Free Pascal

Post by F.Huber »

Hi Roland,

everything is working fine now! :)

I've only changed the 2 'Search' buttons to 'Start Mater' and 'Start Chest' (and the same with 'Stop Mater' and 'Stop Chest') -
that's more clear which button is for which solver.
And I've removed the automatic starting of Chest when clicking on 'Start Mater' - I didn't like this behaviour.

The only things I couldn't change were the language translations of these buttons, because I've never done this before -
I don't know how these *.mo files are created ( I guess there's any option in Lazarus?).
But that's no problem, because I usually prefer English programs although I'm from Austria. ;)

Regards,
Franz