Joker 2.0 memory useage

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

Moderators: hgm, Rebel, chrisw

User avatar
Matthias Gemuh
Posts: 3245
Joined: Thu Mar 09, 2006 9:10 am

Joker 2.0 memory useage

Post by Matthias Gemuh »

How does one decrease the memory useage of the Joker engines from 128 MB to 32 MB ?

Pupsi and FireFly (amongst other) also eat heavily, even as UCI engines.

Thanks,
Matthias
My engine was quite strong till I added knowledge to it.
http://www.chess.hylogic.de
Tony Thomas

Re: Joker 2.0 memory useage

Post by Tony Thomas »

The last version I downloaded was 1106. I can just use 19, 20 or 21 on the commandline under arena to make it use 32, 64 or 128MB of Ram respectively.
User avatar
Matthias Gemuh
Posts: 3245
Joined: Thu Mar 09, 2006 9:10 am

Re: Joker 2.0 memory useage

Post by Matthias Gemuh »

Thanks, works fine now.
My engine was quite strong till I added knowledge to it.
http://www.chess.hylogic.de
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Joker 2.0 memory useage

Post by hgm »

You have a later Joker version than me? :shock:
:lol:

Sorry about the fact that documentation on Joker is still non-existent.
The only argument it accepts is to set the hash-table size. Any value works, as Joker simply uses 2^arg hash buckets of 64 bytes (containing 7 hash entries each). So 20 causes 1M buckets for 64MB hash (7M entries).

The latest Joker version on my downloads page is now 1.1.08, btw. There also is a version 1.1.11 on my website, but it is not linked to yet, so you would have to type the name in the address field yourself.

I am currently testing 1.1.12, as there is some doubt as about if the earlier Jokers do not cheat. It is conceivable that they purge the hash table in the opponent's time, because the printing of the move occurs before the purge loop. However, the fflush to force the printed data out into the pipe to the GUI occurs after the purge loop, so I guess it is OK, as I do believe output to a pipe is buffered. And I also remember that I had to suppress the purging to prevent Joker from forfeiting every game on time in blitz. This helped, and that would be hard to explain if the purging went on in the opponent's time.

Anyway, to make sure I eliminated the purging alltogether, using an aging mechanism to prevent accumulation of obsolete deep entries in 1.1.12. But I am not sure if that works correctly yet.
User avatar
Matthias Gemuh
Posts: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 74.Ke4 d2 75.Ke5 Ke7 76.Kf5 Kd8 77.Kf4 Kd7
78.Ke3 Ke8 79.Kxd2
0-1
{ Game Nr. 3711 : Neg03d wins against Pos by GUI TB adjudication
Finalposition 4k3/8/p7/8/1p6/8/3K4/8 b - -,
StartTime = 22:25:46 on 21.07.2007, GameLength = 79 moves, GameDuration = 00:01:16 }


Best,
Matthias.
My engine was quite strong till I added knowledge to it.
http://www.chess.hylogic.de
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Joker 2.0 memory useage

Post by hgm »

Yes, NEG typically strips Pos bare. This is actually a game where Pos last unusually long, and which NEG probably would not have won without adjudication. As NEG has no clue what checkmate is, it is unlikely to win KQK, and needs at least 2 or 3 queens to have a good chance on an accidental checkmate. (It had one in the Chess War Promo against Eden2, in 6 moves. :lol: )

Normally NEG has about half its material when Pos is reduced to a bare King, and due to a built-in preference for checking moves, this usually leads to a quick accidental mate. NEG scores ~95% against Pos. Here it was unlucky that its Queen stepped into her own shadow. Perhaps I should implement enemy X-rays in a future version. Another bug is that it needlessly refrains from pawn non-captures, because it does not count the non-capture itself as covering the square, and thus too hastily concludes that the square is more often defended than attacked (and thus unsafe). Even when the number of attackers and defenders is both zero! :shock: This is why it did not let Pos chase its pawn to promotion, but allowed it to be captured.