Skip to content

Commit 4b1432e

Browse files
committed
changed figures and improved abstract and introduction
1 parent 6f18dbf commit 4b1432e

File tree

8 files changed

+92
-117
lines changed

8 files changed

+92
-117
lines changed

docs/AlphaDeepChess/Capitulos/AnalysisOfImprovements.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ \chapter{Analysis and evaluation}\label{cap:analysis}
33
This chapter presents an analysis of the performance of the chess engine through profiling, identifying its most computationally intensive components. We then describe the testing framework used to evaluate the effectiveness of the optimization techniques introduced in~\cref{cap:ImprovementTechniques}. These evaluations are based on 100-game matches between different versions of the engine and a baseline implementation. Finally, we compare the performance of \textit{AlphaDeepChess} against \textit{Stockfish} and examine its position within the Elo rating distribution on \textit{Lichess.org}.
44

55
\section{Profiling}
6-
In order to analyze the performance of our chess engine and identify potential bottlenecks where the code consume the most execution time, we used the \texttt{perf} tool available on Linux systems. \texttt{perf} provides robust profiling capabilities by recording CPU events, sampling function execution, and collecting stack traces ~\cite{PerfLinux}.
6+
In order to analyze the performance of our chess engine and identify potential bottlenecks where the code consume the most execution time, we used the \texttt{perf} tool available on Linux systems. \texttt{perf} provides robust profiling capabilities by recording CPU events, sampling function execution, and collecting stack traces~\cite{PerfLinux}.
77

88
\vspace{1em}
99

docs/AlphaDeepChess/Capitulos/ContribucionesPersonales.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ \section*{Juan Girón Herranz}
1212

1313
\item Involved in the implementation of the board data structure, with emphasis on the game state bit field design.
1414

15-
\item Design and Developed the move data structure, which was also optimized as a bit field to reduce space consumption.
15+
\item Design and developed the move data structure, which was also optimized as a bit field to reduce space consumption.
1616

1717
\item Designed and implemented the auxiliary data structures for rows, columns, diagonals, and directions. These structures played a key role in simplifying and optimizing bitboard masking operations, enabling more efficient move generation and attack pattern calculations.
1818

@@ -32,7 +32,7 @@ \section*{Juan Girón Herranz}
3232

3333
\item Conducted multiple 100-game matches using CuteChess between engine versions to measure the impact of each optimization.
3434

35-
\item Created of hundreds of unit tests, which have been a fundamental part of finding bugs and ensuring code quality. This includes Perft testing of the move generator, a standard technique that counts all possible legal positions up to a certain depth to ensure the correctness of move generation in the chess engine.
35+
\item Created hundreds of unit tests, which have been a fundamental part of finding bugs and ensuring code quality. This includes Perft testing of the move generator, a standard technique that counts all possible legal positions up to a certain depth to ensure the correctness of move generation in the chess engine.
3636

3737
\item Contributed to the development of a helper GUI in Python to facilitate interactive testing of the engine, with support for the UCI protocol.
3838

docs/AlphaDeepChess/Capitulos/DescripcionTrabajo.tex

Lines changed: 35 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ \section{Chessboard representation: bitboards}
3434
\vspace{1em}
3535

3636
\begin{figure}[H]
37-
3837
\begin{minipage}[c]{0.35\textwidth}
3938
\newchessgame
4039
\chessboard[
@@ -140,7 +139,9 @@ \subsection*{Horizon effect problem, quiescence search}\label{sec:horizon-effect
140139
What happens if, upon reaching maximum depth, we evaluate the position in the middle of a piece exchange? For example, the~\cref{fig:horizonEffectExample} illustrates a position where if the search is stopped when the queen captures the pawn, it will seem like we have won a pawn, but on the next move, another pawn captures the queen, and now we lose a queen. This is known as the horizon effect~\cite{HorizonEffect}.
141140

142141
\begin{figure}
143-
\begin{minipage}{0.4\textwidth}
142+
\centering
143+
\begin{minipage}{0.45\textwidth}
144+
\centering
144145
\newchessgame
145146
\chessboard[
146147
showmover=false,
@@ -151,7 +152,8 @@ \subsection*{Horizon effect problem, quiescence search}\label{sec:horizon-effect
151152
]
152153
\end{minipage}
153154
\hfill
154-
\begin{minipage}{0.4\textwidth}
155+
\begin{minipage}{0.45\textwidth}
156+
\centering
155157
\newchessgame
156158
\chessboard[
157159
showmover=false,
@@ -430,17 +432,13 @@ \subsection*{Precomputed attacks}
430432

431433
\begin{figure}
432434
\centering
433-
\begin{minipage}{0.6\textwidth}
434-
\centering
435-
\newchessgame
436-
\chessboard[
437-
showmover=false,
438-
setfen=8/8/8/8/3B4/8/8/8 w - - 0 1,
439-
markstyle=border,
440-
color=blue, markfields={a1,b2,c3,e5,f6,g7,h8,g1,f2,e3,c5,b6,a7}
441-
]
442-
\end{minipage}
443-
435+
\newchessgame
436+
\chessboard[
437+
showmover=false,
438+
setfen=8/8/8/8/3B4/8/8/8 w - - 0 1,
439+
markstyle=border,
440+
color=blue, markfields={a1,b2,c3,e5,f6,g7,h8,g1,f2,e3,c5,b6,a7}
441+
]
444442
\caption{Precomputed attack for the bishop on the d4 square.}\label{fig:precomputedAttackBishop}
445443
\end{figure}
446444

@@ -480,18 +478,14 @@ \subsection*{Bitboard of danger squares}
480478

481479
\begin{figure}
482480
\centering
483-
\begin{minipage}{0.6\textwidth}
484-
\centering
485-
\newchessgame
486-
\chessboard[
487-
showmover=true,
488-
setfen=8/8/3r2p1/8/3P4/8/8/8 w - - 0 1,
489-
markstyle=border,
490-
color=blue, markfields={d7,d8,d5,c6,b6,a6,e6,f6},
491-
color=red, markfields={d4,g6}
492-
]
493-
\end{minipage}
494-
481+
\newchessgame
482+
\chessboard[
483+
showmover=true,
484+
setfen=8/8/3r2p1/8/3P4/8/8/8 w - - 0 1,
485+
markstyle=border,
486+
color=blue, markfields={d7,d8,d5,c6,b6,a6,e6,f6},
487+
color=red, markfields={d4,g6}
488+
]
495489
\caption{Example of blocking pieces.}\label{fig:blockerExample}
496490

497491
\end{figure}
@@ -506,15 +500,11 @@ \subsection*{Bitboard of pinned pieces}
506500

507501
\begin{figure}
508502
\centering
509-
\begin{minipage}{0.6\textwidth}
510-
\centering
511-
\newchessgame
512-
\chessboard[
513-
showmover=true,
514-
setfen=3r4/8/8/8/3N4/8/3K4/8 w - - 0 11
515-
]
516-
\end{minipage}
517-
503+
\newchessgame
504+
\chessboard[
505+
showmover=true,
506+
setfen=3r4/8/8/8/3N4/8/3K4/8 w - - 0 11
507+
]
518508
\caption{Pinned piece.}\label{fig:pinnedPiece}
519509
\end{figure}
520510

@@ -529,7 +519,6 @@ \subsection*{Capture and push mask}
529519
\noindent The final bitboards required for handling checks are the \textit{capture mask} and the \textit{push mask}. The capture mask identifies the squares occupied by the checking pieces, while the push mask includes the squares in between the king and the checking piece along the line of attack.
530520

531521
\begin{center}
532-
\begin{minipage}{0.6\textwidth}
533522
\centering
534523
\newchessgame
535524
\chessboard[
@@ -539,7 +528,6 @@ \subsection*{Capture and push mask}
539528
color=blue, markfields={d5,e5,f5,g5},
540529
color=red, markfields={h5}
541530
]
542-
\end{minipage}
543531
\end{center}
544532

545533
\noindent The capture mask is shown in red, and the push mask is shown in blue.
@@ -654,20 +642,16 @@ \subsection*{Killer moves}
654642

655643
\begin{figure}
656644
\centering
657-
\begin{minipage}{0.6\textwidth}
658-
\centering
659-
\newchessgame
660-
\chessboard[
661-
showmover=false,
662-
setfen=1r3k2/ppp2ppp/1n1bp3/q2p2N1/3P4/2P1P3/PP3PPP/2BQ2KR w K - 0 3,
663-
pgfstyle=straightmove, color=blue,
664-
markmoves={d1-h5},
665-
arrow=to,
666-
markstyle=circle,
667-
color=red, markfields={f7}
668-
]
669-
\end{minipage}
670-
645+
\newchessgame
646+
\chessboard[
647+
showmover=false,
648+
setfen=1r3k2/ppp2ppp/1n1bp3/q2p2N1/3P4/2P1P3/PP3PPP/2BQ2KR w K - 0 3,
649+
pgfstyle=straightmove, color=blue,
650+
markmoves={d1-h5},
651+
arrow=to,
652+
markstyle=circle,
653+
color=red, markfields={f7}
654+
]
671655
\caption{Killer move example.}\label{fig:killer_move_example}
672656
\end{figure}
673657

docs/AlphaDeepChess/Capitulos/ImprovementTechniques.tex

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,14 @@ \section{Transposition table}\label{sec:tt}
1616

1717
\begin{figure}
1818
\centering
19-
\begin{minipage}{0.6\textwidth}
20-
\centering
21-
\newchessgame
22-
\chessboard[
23-
showmover=false,
24-
setfen=8/2k5/3p4/p2P1p2/P2P1P2/8/8/2K5 w - - 0 1,
25-
pgfstyle=straightmove, color=blue,
26-
markmoves={c1-e3,e3-g3,c1-g1,g1-g3},
27-
arrow=to
28-
]
29-
\end{minipage}
19+
\newchessgame
20+
\chessboard[
21+
showmover=false,
22+
setfen=8/2k5/3p4/p2P1p2/P2P1P2/8/8/2K5 w - - 0 1,
23+
pgfstyle=straightmove, color=blue,
24+
markmoves={c1-e3,e3-g3,c1-g1,g1-g3},
25+
arrow=to
26+
]
3027
\caption{Lasker-Reichhelm Position, transposition example}\label{fig:transposition_example}
3128
\end{figure}
3229

@@ -173,17 +170,14 @@ \subsection*{Magic bitboards}
173170

174171
\begin{figure}
175172
\centering
176-
\begin{minipage}{0.6\textwidth}
177-
\centering
178-
\newchessgame
179-
\chessboard[
180-
showmover=false,
181-
setfen=n1bk3r/3p4/1p1p2p1/8/3R1p2/8/3p4/7n w - - 0 1,
182-
markstyle=border,
183-
color=red, markfields={d6,f4,d2},
184-
color=green, markfields={c4,b4,a4,e4,d5,d3}
185-
]
186-
\end{minipage}
173+
\newchessgame
174+
\chessboard[
175+
showmover=false,
176+
setfen=n1bk3r/3p4/1p1p2p1/8/3R1p2/8/3p4/7n w - - 0 1,
177+
markstyle=border,
178+
color=red, markfields={d6,f4,d2},
179+
color=green, markfields={c4,b4,a4,e4,d5,d3}
180+
]
187181
\caption{Chess position with white rook legal moves in green and blockers in red.}\label{fig:magics_position}
188182
\end{figure}
189183

@@ -413,7 +407,6 @@ \subsection*{King safety penalty}
413407

414408
\par In the following image, the black king is under threat from multiple pieces: the queen attacks two squares (8 points), the rook attacks three squares (9 points), a knight attacks one square (2 points), and a pawn attacks one square (1 point). This results in a total threat score of 20, which corresponds to a penalty of 68 points according to the safety table.
415409

416-
417410
\begin{center}
418411
\newchessgame
419412
\chessboard[

0 commit comments

Comments
 (0)