OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 4:08 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Ideas to compute packed positions in a chess game
PostPosted: Thu Sep 22, 2022 4:09 pm 
Offline
Member
Member

Joined: Fri Feb 11, 2022 4:55 am
Posts: 435
Location: behind the keyboard
I see that every chess engine relies on move generation and evaluation speed which is almost the same between every engine. So any engine can only lookup a max of 4-6 depth without eliminating any moves.

I don't find any effective usage of SIMD in chess engines.

I guess so if you use AVX, how can we compute multiple positions. This may let us break the max of depth 6 to depth 8 or more (without eliminating moves).

Can we solve this ?
If we get a solution, it may be an evolution to the chess engines since it will search faster, eliminate less moves maybe and go deeper.

It is like using the "vpaddb" instruction to compute 32 moves at once !


Top
 Profile  
 
 Post subject: Re: Ideas to compute packed positions in a chess game
PostPosted: Thu Sep 22, 2022 4:38 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
I can't say I'm familiar with chess programming, but you haven't looked very hard if you haven't found anyone using SIMD for chess.


Top
 Profile  
 
 Post subject: Re: Ideas to compute packed positions in a chess game
PostPosted: Fri Sep 23, 2022 5:57 am 
Offline
Member
Member

Joined: Fri Feb 11, 2022 4:55 am
Posts: 435
Location: behind the keyboard
Everyone uses SIMD in chess but they only use them to compute scalar moves faster, make permutes. Not packed ones.
I want to find how to compute packed moves, which means calculating multiple moves in parallel.
I need some way to use bit manipulation in an SIMD register.

I have already looked into that page,


Top
 Profile  
 
 Post subject: Re: Ideas to compute packed positions in a chess game
PostPosted: Fri Sep 23, 2022 10:51 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
devc1 wrote:
I need some way to use bit manipulation in an SIMD register.

It sounds like you're looking for SWAR.


Top
 Profile  
 
 Post subject: Re: Ideas to compute packed positions in a chess game
PostPosted: Fri Sep 23, 2022 1:05 pm 
Offline
Member
Member

Joined: Fri Feb 11, 2022 4:55 am
Posts: 435
Location: behind the keyboard
Is this an instruction set or a library of functions ?


Top
 Profile  
 
 Post subject: Re: Ideas to compute packed positions in a chess game
PostPosted: Fri Sep 23, 2022 1:25 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
It's a set of techniques for operating on multiple elements within a single register, usually in ways the instruction set wasn't intentionally designed for.

For example, if AVX doesn't have an instruction for the operation you're looking for, you might look up some SWAR techniques to figure out how you can combine several instructions to get the operation you want.


Top
 Profile  
 
 Post subject: Re: Ideas to compute packed positions in a chess game
PostPosted: Fri Sep 23, 2022 1:47 pm 
Offline
Member
Member

Joined: Fri Feb 11, 2022 4:55 am
Posts: 435
Location: behind the keyboard
Nice, it is still not called SIMD haha : )
Thanks anyway.


Top
 Profile  
 
 Post subject: Re: Ideas to compute packed positions in a chess game
PostPosted: Mon Sep 26, 2022 12:29 pm 
Offline
User avatar

Joined: Mon May 02, 2022 2:03 pm
Posts: 12
https://www.chessprogramming.org
As pointed by others usually have resources for what you are looking for. But I am lazy to dig deep enough to read engine source code see if they force use of SIMD instructions underneath.
I must point out that :
https://github.com/lantonov/asmFish is written in ASM, you may be change the logic to use the instructions you want by changing few functions here and there. But then I have not went far ahead reading its code.

_________________
~Voldemort~


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 24 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group