Oh, thank you. I think leela2200 won the mini match 3-2 though

Moderator: Ras
Oh, thank you. I think leela2200 won the mini match 3-2 though
It appears that white won every game.
I tried some hash settings under Cute Chess.amanjpro wrote: ↑Sun Mar 14, 2021 8:39 pm As for the memory allocation, I am not seeing it on Mac, Linux and also Windows (on VritualBox though). Here is a Windows screenshot:
https://drive.google.com/file/d/1J2_6GG ... sp=sharing
I set hash to 32 (MB), and the allocation is around 45 (for the entire program)
I can confirm that behaviour under Win7-64 from cmd w/o any GUI.Gabor Szots wrote: ↑Mon Mar 15, 2021 8:53 amI tried some hash settings under Cute Chess.amanjpro wrote: ↑Sun Mar 14, 2021 8:39 pm As for the memory allocation, I am not seeing it on Mac, Linux and also Windows (on VritualBox though). Here is a Windows screenshot:
https://drive.google.com/file/d/1J2_6GG ... sp=sharing
I set hash to 32 (MB), and the allocation is around 45 (for the entire program)
When set to 16 MB, the allocated memory is 65.
When set to 32 MB, the allocated memory is 129 MB.
64 --> 286
128 --> more than 600 but then gradually decreases down to about 400.
256 --> about 1400, then gradually decreases down to about 800.
So it seems that for lower values the allocated memory increase is about 4 times the hash size increase. For greater values the allocated memory changes with time (it went down a bit with each move I made).
Code: Select all
uci
id name Zahak
id author Amanj
option name Ponder type check default false
option name Hash type spin default 10 min 1 max 8000
option name Book type check default false
uciok
ucinewgame
isready
readyok
setoption name Hash value 320
position startpos
go infinite
...
Maybe it uses a vector without giving it a capacity or specific number of elements to start with. In Rust, if you create a vector and then push elements into it, the vector needs to resize if it's not big enough. It'll then resize to about 1.5x its current size. For example:Gabor Szots wrote: ↑Mon Mar 15, 2021 8:53 amI tried some hash settings under Cute Chess.amanjpro wrote: ↑Sun Mar 14, 2021 8:39 pm As for the memory allocation, I am not seeing it on Mac, Linux and also Windows (on VritualBox though). Here is a Windows screenshot:
https://drive.google.com/file/d/1J2_6GG ... sp=sharing
I set hash to 32 (MB), and the allocation is around 45 (for the entire program)
When set to 16 MB, the allocated memory is 65.
When set to 32 MB, the allocated memory is 129 MB.
64 --> 286
128 --> more than 600 but then gradually decreases down to about 400.
256 --> about 1400, then gradually decreases down to about 800.
So it seems that for lower values the allocated memory increase is about 4 times the hash size increase. For greater values the allocated memory changes with time (it went down a bit with each move I made).
That is the thing, I already initialize it with a fixed size:mvanthoor wrote: ↑Mon Mar 15, 2021 10:11 amMaybe it uses a vector without giving it a capacity or specific number of elements to start with. In Rust, if you create a vector and then push elements into it, the vector needs to resize if it's not big enough. It'll then resize to about 1.5x its current size. For example:Gabor Szots wrote: ↑Mon Mar 15, 2021 8:53 amI tried some hash settings under Cute Chess.amanjpro wrote: ↑Sun Mar 14, 2021 8:39 pm As for the memory allocation, I am not seeing it on Mac, Linux and also Windows (on VritualBox though). Here is a Windows screenshot:
https://drive.google.com/file/d/1J2_6GG ... sp=sharing
I set hash to 32 (MB), and the allocation is around 45 (for the entire program)
When set to 16 MB, the allocated memory is 65.
When set to 32 MB, the allocated memory is 129 MB.
64 --> 286
128 --> more than 600 but then gradually decreases down to about 400.
256 --> about 1400, then gradually decreases down to about 800.
So it seems that for lower values the allocated memory increase is about 4 times the hash size increase. For greater values the allocated memory changes with time (it went down a bit with each move I made).
You could initialize a vector with a capacity of say, 8 elements and make sure you don't ever put more than 256 elements in it. Then the vector will stay at 8 elements all the time. You could also initialize it without a capacity and leave it empty. After that, when you put elements in it, it will go something like this in many programming languages:
0 -> empty
1 -> reserved memory for 2 elements.
2 -> 2
3 -> 4
4 -> 4
5 -> 6
6 - > 8
7 -> 8
8 -> 8
9 -> 16
10 -> 16
...
Maybe that's what you're seeing.
Ideally you would allocate objects on the stack, but that’s not possible with the TT. In Julia, which is also a GC language (non-compacting to boot), I’ve had to use an arena memory allocation approach for the AB/TT and the MCTS node tree. Otherwise it slows down appreciably over the course of a game.amanjpro wrote: ↑Mon Mar 15, 2021 10:54 am I am using a garbage collected language, I cannot really control when memory is freed when searching. So, the increase during search is probably normal. But why does it stay high even after search, I might have some memory leak, need to check, which is not exactly an easy task![]()