flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > Put on your optimization hats, its time to beat the compiler

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
eisbaer



Joined: 25 Nov 2012
Posts: 8
eisbaer 26 Jul 2016, 10:21
@tthsqe: sounds interesting
can you please provide a download-link to a windows binary
Post 26 Jul 2016, 10:21
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 26 Jul 2016, 10:27
Post 26 Jul 2016, 10:27
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 767
tthsqe 26 Jul 2016, 15:50
Thanks JohnFound and Haha. I will add the sys_exit_group and some acknowledgments to the linux routines.
Post 26 Jul 2016, 15:50
View user's profile Send private message Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 767
tthsqe 28 Jul 2016, 19:51
redsock, it is now a windows/linux project and I have done some profiling of the code.
Code:
call counts from PROFILE=1 and bench:
Move_GivesCheck:      61810252
See:                  23095277
MainHash_Probe:       22442229
Move_IsLegal:         22000335
Move_Do:              20584032
MainHash_Save:        19144164
QSearch_NONPV_FALSE:  10784787
Search_NONPV:         9520774
Move_IsPseudoLegal:   4339120
QSearch_NONPV_TRUE:   2062216
Move_DoNull:          1078284
Search_PV:            75496
QSearch_PV_FALSE:     26089
QSearch_PV_TRUE:      5226
Search_ROOT:          1714    

It also needs a better malloc/free. malloc/free are only used when the syzygypath is set can't be called more than a couple hundred times through out the lifetime of the process. Hence it would be nice to have a simple and space efficient malloc/free since speed is not critical here. The current implementation wastes space on small sizes.
Code:
; todo: malloc and free need a little work after profiling to see what sizes are common
;  for now, we just call _VirtualAlloc on size+16 and store the size in the first qword
;     of the returned page(s).

malloc:         add   rcx, 16
               push   rcx
               call   _VirtualAlloc
                pop   rcx
                mov   qword[rax], rcx
                add   rax, 16
                ret

free:           sub   rcx, 16
                 js   @f
                mov   rdx, qword[rcx]
                jmp   _VirtualFree
        @@:     ret    
Post 28 Jul 2016, 19:51
View user's profile Send private message Reply with quote
redsock



Joined: 09 Oct 2009
Posts: 434
Location: Australia
redsock 02 Aug 2016, 18:49
Heya,

My version-of-choice malloc/free are located in my library of course, but also as HTML at https://2ton.com.au/library_as_html/heap.inc.html. Specifically, the heap$alloc and heap$free routines (as well as the mandatory heap$init that runs once at program startup).

One-size fits all (as indicated in my comments in the library) has never really suited me, ptmalloc/malloc/etc do indeed cater for general purpose allocation, but most of the production code I have ever written or worked on has very specific needs and bin-based allocation is a better choice. YMMV. Smile
Post 02 Aug 2016, 18:49
View user's profile Send private message Reply with quote
lantonov



Joined: 08 Jan 2017
Posts: 2
lantonov 08 Jan 2017, 18:25
tthsqe left this project in the beginning of November last year and deleted everything in his GitHub account. I had saved the last copy of his files on my HD and decided to continue with the updates.
The new GitHub of asmFish is https://github.com/lantonov/asmFish
Presently, asmFish continues to be the strongest chess entity in the world (said without any exaggeration).
It would be great if this nice project receives help from true assembly programmers. I am not a programmer and it is hard for me to keep up with the Stockfish updates. Sad


Last edited by lantonov on 09 Jan 2017, 08:11; edited 1 time in total
Post 08 Jan 2017, 18:25
View user's profile Send private message Reply with quote
lantonov



Joined: 08 Jan 2017
Posts: 2
lantonov 09 Jan 2017, 07:56
If you allow me, I can propose an idea which may be trivial to a person with an assembly programming background.
In this forum, I saw an assembly neural network program Neural64:
https://board.flatassembler.net/topic.php?t=6020
which seems to be versatile enough. In spite of its name, it can work also on 32-bit CPU, albeit more slowly.
Coupling Neural64 (or some other, more recent, AI software) with asmFish would create a chess monster who learns and becomes stronger the more it plays. At present, the main stumbling block in computer chess development is the tuning of parameters for evaluation functions. Automating this process will cause a revolution in CC.
Post 09 Jan 2017, 07:56
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.