The 15th Game Programming Workshop 2010 Magic Bitboard Magic Bitboard Bitboard Magic Bitboard Bitboard Magic Bitboard Magic Bitboard Magic Bitbo

Similar documents
Q [4] 2. [3] [5] ϵ- Q Q CO CO [4] Q Q [1] i = X ln n i + C (1) n i i n n i i i n i = n X i i C exploration exploitation [4] Q Q Q ϵ 1 ϵ 3. [3] [5] [4]

2 122

& Vol.5 No (Oct. 2015) TV 1,2,a) , Augmented TV TV AR Augmented Reality 3DCG TV Estimation of TV Screen Position and Ro

,,,,., C Java,,.,,.,., ,,.,, i

1 Fig. 1 Extraction of motion,.,,, 4,,, 3., 1, 2. 2.,. CHLAC,. 2.1,. (256 ).,., CHLAC. CHLAC, HLAC. 2.3 (HLAC ) r,.,. HLAC. N. 2 HLAC Fig. 2

The 18th Game Programming Workshop ,a) 1,b) 1,c) 2,d) 1,e) 1,f) Adapting One-Player Mahjong Players to Four-Player Mahjong

2 ( ) i

floodgate 15 Nine- DayFever XeonE c(NDF) gpsfish XeonX c 11 * [6]

IPSJ SIG Technical Report Vol.2011-EC-19 No /3/ ,.,., Peg-Scope Viewer,,.,,,,. Utilization of Watching Logs for Support of Multi-

1 Web [2] Web [3] [4] [5], [6] [7] [8] S.W. [9] 3. MeetingShelf Web MeetingShelf MeetingShelf (1) (2) (3) (4) (5) Web MeetingShelf

百人一首かるた選手の競技時の脳の情報処理に関する研究

企業内システムにおけるA j a x 技術の利用

Table 1. Assumed performance of a water electrol ysis plant. Fig. 1. Structure of a proposed power generation system utilizing waste heat from factori

Vol. 42 No. SIG 8(TOD 10) July HTML 100 Development of Authoring and Delivery System for Synchronized Contents and Experiment on High Spe

DEIM Forum 2009 B4-6, Str

EQUIVALENT TRANSFORMATION TECHNIQUE FOR ISLANDING DETECTION METHODS OF SYNCHRONOUS GENERATOR -REACTIVE POWER PERTURBATION METHODS USING AVR OR SVC- Ju


An Introduction to OSL

Fig. 3 Flow diagram of image processing. Black rectangle in the photo indicates the processing area (128 x 32 pixels).

08-特集04.indd

学位研究17号

IPSJ SIG Technical Report Vol.2016-CE-137 No /12/ e β /α α β β / α A judgment method of difficulty of task for a learner using simple

THE INSTITUTE OF ELECTRONICS, INFORMATION AND COMMUNICATION ENGINEERS TECHNICAL REPORT OF IEICE.

The Journal of the Japan Academy of Nursing Administration and Policies Vol 7, No 2, pp 19 _ 30, 2004 Survey on Counseling Services Performed by Nursi

Core Ethics Vol. J O J O J O J O J O J O J O P C L P C L J O J O J O J O

06_学術.indd


DPA,, ShareLog 3) 4) 2.2 Strino Strino STRain-based user Interface with tacticle of elastic Natural ObjectsStrino 1 Strino ) PC Log-Log (2007 6)

大学における原価計算教育の現状と課題

17 Proposal of an Algorithm of Image Extraction and Research on Improvement of a Man-machine Interface of Food Intake Measuring System

29 jjencode JavaScript

IPSJ SIG Technical Report Vol.2012-CG-148 No /8/29 3DCG 1,a) On rigid body animation taking into account the 3D computer graphics came


AtCoder Regular Contest 073 Editorial Kohei Morita(yosupo) A: Shiritori if python3 a, b, c = input().split() if a[len(a)-1] == b[0] and b[len(

12) NP 2 MCI MCI 1 START Simple Triage And Rapid Treatment 3) START MCI c 2010 Information Processing Society of Japan

soturon.dvi

_Y05…X…`…‘…“†[…h…•

e-learning e e e e e-learning 2 Web e-leaning e 4 GP 4 e-learning e-learning e-learning e LMS LMS Internet Navigware

:- Ofer Feldman,Feldman : -

( )

昭和恐慌期における長野県下農業・農村と産業組合の展開過程

Journal of Geography 116 (6) Configuration of Rapid Digital Mapping System Using Tablet PC and its Application to Obtaining Ground Truth

本体/05‐進悦子

Bulletin of JSSAC(2014) Vol. 20, No. 2, pp (Received 2013/11/27 Revised 2014/3/27 Accepted 2014/5/26) It is known that some of number puzzles ca

<332D985F95B62D8FAC93638BA795DB90E690B62E706466>


58 10

,.,.,,.,. X Y..,,., [1].,,,.,,.. HCI,,,,,,, i

【HP用】26.12月号indd.indd

26.2月号indd.indd

untitled

26.1月号indd.indd

3_23.dvi

Web-ATMによる店舗向けトータルATMサービス

KII, Masanobu Vol.7 No Spring

15 NODA MAP 一 はじめに 1 NODA MAP

第62巻 第1号 平成24年4月/石こうを用いた木材ペレット

16_.....E...._.I.v2006

Core Ethics Vol. : - : : : -

特-3.indd

雇用不安時代における女性の高学歴化と結婚タイミング-JGSSデータによる検証-

COM COM 4) 5) COM COM 3 4) 5) COM COM 6) 7) 10) COM Bonanza 6) Bonanza Hearts COM 7) 10) Hearts 3 2,000 4,000

,,.,,.,..,.,,,.,, Aldous,.,,.,,.,,, NPO,,.,,,,,,.,,,,.,,,,..,,,,.,

1 3DCG [2] 3DCG CG 3DCG [3] 3DCG 3 3 API 2 3DCG 3 (1) Saito [4] (a) 1920x1080 (b) 1280x720 (c) 640x360 (d) 320x G-Buffer Decaudin[5] G-Buffer D

生研ニュースNo.132

1 Table 1: Identification by color of voxel Voxel Mode of expression Nothing Other 1 Orange 2 Blue 3 Yellow 4 SSL Humanoid SSL-Vision 3 3 [, 21] 8 325

39-3/2.論説:藤井・戸前・山本・井上

Core Ethics Vol. a

Sport and the Media: The Close Relationship between Sport and Broadcasting SUDO, Haruo1) Abstract This report tries to demonstrate the relationship be


04-“²†XŒØ‘�“_-6.01

Microsoft Word - toyoshima-deim2011.doc

IPSJ SIG Technical Report Vol.2014-EIP-63 No /2/21 1,a) Wi-Fi Probe Request MAC MAC Probe Request MAC A dynamic ads control based on tra

News_Letter_No35(Ver.2).p65

G

IPSJ SIG Technical Report Vol.2009-HCI-134 No /7/17 1. RDB Wiki Wiki RDB SQL Wiki Wiki RDB Wiki RDB Wiki A Wiki System Enhanced by Visibl

Vol. 42 No MUC-6 6) 90% 2) MUC-6 MET-1 7),8) 7 90% 1 MUC IREX-NE 9) 10),11) 1) MUCMET 12) IREX-NE 13) ARPA 1987 MUC 1992 TREC IREX-N

社会技術論文集

A Study on Throw Simulation for Baseball Pitching Machine with Rollers and Its Optimization Shinobu SAKAI*5, Yuichiro KITAGAWA, Ryo KANAI and Juhachi

Introduction ur company has just started service to cut out sugar chains from protein and supply them to users by utilizing the handling technology of

Page 1 of 6 B (The World of Mathematics) November 20, 2006 Final Exam 2006 Division: ID#: Name: 1. p, q, r (Let p, q, r are propositions. ) (10pts) (a

:


258 5) GPS 1 GPS 6) GPS DP 7) 8) 10) GPS GPS ) GPS Global Positioning System

97-00


4) 5) ) ( 1 ) ( 2 ) ( 3 ) ( 4 ) ( 5 ) ( 6 ) )8) ( 1 ) ( 2 ) ( 3 ) ( 200 9) ( 10) 1 2 (

Kyushu Communication Studies 第2号

Vol. 23 No. 4 Oct Kitchen of the Future 1 Kitchen of the Future 1 1 Kitchen of the Future LCD [7], [8] (Kitchen of the Future ) WWW [7], [3

Vol. 45 No Web ) 3) ),5) 1 Fig. 1 The Official Gazette. WTO A

FUJII, M. and KOSAKA, M. 2. J J [7] Fig. 1 J Fig. 2: Motivation and Skill improvement Model of J Orchestra Fig. 1: Motivating factors for a


( ) fnirs ( ) An analysis of the brain activity during playing video games: comparing master with not master Shingo Hattahara, 1 Nobuto Fuji

Web Web Web Web Web, i

1 7.35% 74.0% linefeed point c 200 Information Processing Society of Japan

Virtual Window System Virtual Window System Virtual Window System Virtual Window System Virtual Window System Virtual Window System Social Networking

fiš„v8.dvi

屋内ロケーション管理技術

ActionScript Flash Player 8 ActionScript3.0 ActionScript Flash Video ActionScript.swf swf FlashPlayer AVM(Actionscript Virtual Machine) Windows

人文学部研究年報12号.indb

Transcription:

Magic Bitboard Magic Bitboard Bitboard Magic Bitboard Bitboard Magic Bitboard 64 81 Magic Bitboard Magic Bitboard Bonanza Proposal and Implementation of Magic Bitboards in Shogi Issei Yamamoto, Shogo Takeuchi, Tomoyuki Kaneko and Tetsuro Tanaka In this paper, we present a technique to apply magic bitboards into Shogi. A bitboard is a bitset representation of a position suitable for ecient game-tree searches in two-player games such as chess. They have widely been used in popular strong programs in chess and Shogi. Magic bitboards are recent improvements that can eciently calculate attacks with simpler data than those needed to be maintained in previous bitboard techniques. While magic bitboards in chess depend on the fact that a chess board can be represented in one 64-bit integer, a board of Shogi has 81 squares. Thus, we rst developed a technique to calculate attacks of a board represented in multiple integers. Then, we show the eectiveness of our techniques by experiments using the state-of-the-art Shogi program, Bonanza. 1. Bitboard Bitboard 1 1 Bitboard Rotated Bitboard Department of General Systems Studies, Graduate School of Arts and Sciences, The University of Tokyo {issei,takeuchi,kaneko}@graco.c.u-tokyo.ac.jp Information Technology Center, The University of Tokyo ktanaka@ecc.u-tokyo.ac.jp Magic Bitboard Magic Bitboard 8Ö8 64 9Ö9 81 Magic Bitboard Magic Bitboard Bonanza Rotated Bitboard 2. Bitboard 8Ö8 64 64 Bitboard 9Ö9 81 81 Bonanza 1 32 3 Bitboard Knight http://www.geocities.jp/bonanza_shogi/ 1-42 -

Occupied Bitboard 8 2 Occupied Bitboard 10 7 8 2 2 7 1 9 1 Bonanza Bitboard Rook Bitboard 3 2 Bitboard Bitboard Occupied Bitboard 3 3. Bitboard 3.1 Bitboard Bitboard Fruit YSS GPS 2 Bitboard 1 1 Bitboard Bitboard 2 Occupied Bitboard http://www.fruitchess.com/ http://www32.ocn.ne.jp/~yss/index_j.html http://gps.tanaka.ecc.u-tokyo.ac.jp/gpsshogi/ 2-43 -

3.2 Rotated Bitboard 2 Bitboard Rotated Bitboard 1),2) 90 ±45 Occupied Bitboard 4 Occupied Bitboard 90 Occupied Bitboard 5 Magic Bitboard Rotated Bitboard 2 2 Rotated BitBoard Magic Bitboard Rotated Magic Occupied Bitboard 4 1 4. Magic Bitboard 4 90 Occupied Bitboard 3.3 Magic Bitboard Magic Bitboard 90 ±45 Occupied Bitboard Magic Bitboard 3 Rotated Bitboard 5 Rook Rook 12 0 Occupied Bitboard Rook (64-12) Magic Bitboard 1 StockFish 2 Glaurung 3 Magic Bitboard Occupied Bitboard Rotated BitBoard 1 http://chessprogramming.wikispaces.com/magic+bitboards 2 http://www.stockshchess.com/ 3 http://www.glaurungchess.com/ 4.1 Magic Bitboard Bitboard Algorithm 1 1 bb[0] bb[1] 64 q 4 6 6 q Bonanza Bitboard 4 C union 3-44 -

0 Occupied Bitboard q bb[2] q bb[2] XOR 5 7 Algorithm 1 ( 1 ) Bitboard bb[0] bb[1] q b[2] 64 ( 2 ) 0 Occupied Bitboard ( 3 ) 64 ( 4 ) 2 XOR ( 5 ) 6 1,000,000 3 3 Core i7 950 windows Algorithm 2 ( 1 ) ( 2 ) ( 3 ) 64 ( 3 ) ( 4 ) 2 3 3 7 Magic Bitboard 1 5 5 1 >1,000,000 >1,000,000 >1,000,000 2 189,704 116,971 60,249 3 11,288 15,961 7,898 4 16,164 41,504 356,239 5 867,446 552,592 872,409 6 >1,000,000 >1,000,000 >1,000,000 4.2 Algorithm 2 Algorithm 2 3 1 5 5 3 1 5. Bonanza Magic Bitboard Rotated BitBoard Bonanza Bonanza 4 Bitboard Bonanza Original Magic Bitboard Magic Bitboard Bonanza Simple 3 Tord Romstad Bonanza Feliz 0.0 4-45 -

4 Bonanza Bitboard (24 ) Bitboard Bitboard (Occupiued Bitboard) Bitboard (Occupiued Bitboard) 90 Bitboard (Occupiued Bitboard) 45 Bitboard (Occupiued Bitboard) 45 Bitboard (Occupiued Bitboard) Bitboard Bitboard Bitboard Bitboard Bitboard Bitboard 3) 216 15 9 6 15 Original Simple FileM FileR NPS 92,769 86,146 87,543 90,240 Time 148.00 159.33 157.00 152.00 100.00% 92.89% 94.27% 97.37% Magic Bitboard FileM Magic Bitboard FileR Rotated Bitboard 5 Occupied Bitboard Occupied Bitboard Xor- File SetClearFile XorDiag1 2 SetClearDiag1 2, Ö AttackRook AttackBishop AttackFile AttackRank AttackDiag1 2 BishopAttack0 1 2 R Rotated Bitboard M Magic Bitboard MM Magic Bitboard 5 Original Simple FileM FileR Occupied Bitboard 4 1 1 2 XorFile Ö Ö SetClearFile Ö Ö XorDaig1,2 Ö Ö Ö SetClearDiag1,2 Ö Ö Ö AttackRook R M M M AttackBishop R M M M AttackFile R MM M R AttackRank R R R R AttackDiag1,2 R MM MM MM BishiopAttack0,1,2 R M M M 6 7 NPS 1 Time Original NPS Core i7 950 Windows 7 MSC 32 7 9 Original Simple FileM FileR NPS 128,159 112,130 118,957 123,762 Time 362.22 414.00 390.24 375.09 100.00% 87.49% 92.81% 96.56% Original FileR FileM Simple FileR 90 Rotated BitBoard Simple Simple Original FileM Simple 6 Magic Bitboard Original Bonanza Rotated Bitboard 8 Bonanza b_gen_checks() Attack- Diag1() AttackDiag2() Attack- Diag1 2 Magic Bitboard Magic Bitboard 2 Magic Bitboard AttackDiag1() AttackDiag2() AttackBishop() Magic Bitboard Visual Studio 2010 /DNDEBUG 5-46 -

unsigned int * b_gen_checks( tree_t * restrict ptree, unsigned int * restrict pmove ) { /* */ bb_diag1_chk = AttackDiag1( sq_wk ); bb_diag2_chk = AttackDiag2( sq_wk ); 8 Bonanza genchk.c b_gen_checks() Magic Bitboard Bonanza Original FileR Magic Bitboard Magic Bitboard Occupied Bitboard Bitboard Bitboard 6 7 10 10 5 4 5 6 9 64 Bitboard 6. Magic Bitboard 4 Magic Bitboard Rotated Bitboard Rotated Bitboard FileR Rotated Bitboard Bitboard 2 Bitboard 1 9 10 5 Bonanza Bitboard Bitboard 1 11 1 11 Bitboard Bitboard Bonanza Bitboard Bitboard Bitboard 9 Bitboard 7. Rotated Bitboard Magic Bitboard Bitboard 6-47 -

11 81 Magic Bitboard Magic Bitboard Bonanza Rotated Bitboard Bonanza Magic Bitboard Bonanza Magic Bitboard Bonanza Bitboard Magic Bitboard Magic Bitboard Rotated Bitboard http://www. graco.c.u-tokyo.ac.jp/~issei/magicnumber.txt 1) Hyatt, R. M.(1999).Rotated Bitmaps, a New Twist on an Old Idea. ICCA Journal, Vol. 22, No. 4, pp. 213222. 2) R. Grimbergen.(2007). Using Bitboards for Move Generation in Shogi.ICGA Journal Vol. 30, No. 1, pp. 25-34. 3) (2002)... 7-48 -