You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/AlphaDeepChess/Capitulos/AnalysisOfImprovements.tex
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ \chapter{Analysis and evaluation}\label{cap:analysis}
3
3
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}.
4
4
5
5
\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}.
Copy file name to clipboardExpand all lines: docs/AlphaDeepChess/Capitulos/ContribucionesPersonales.tex
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ \section*{Juan Girón Herranz}
12
12
13
13
\item Involved in the implementation of the board data structure, with emphasis on the game state bit field design.
14
14
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.
16
16
17
17
\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.
18
18
@@ -32,7 +32,7 @@ \section*{Juan Girón Herranz}
32
32
33
33
\item Conducted multiple 100-game matches using CuteChess between engine versions to measure the impact of each optimization.
34
34
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.
36
36
37
37
\item Contributed to the development of a helper GUI in Python to facilitate interactive testing of the engine, with support for the UCI protocol.
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}.
\caption{Precomputed attack for the bishop on the d4 square.}\label{fig:precomputedAttackBishop}
445
443
\end{figure}
446
444
@@ -480,18 +478,14 @@ \subsection*{Bitboard of danger squares}
480
478
481
479
\begin{figure}
482
480
\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
+
]
495
489
\caption{Example of blocking pieces.}\label{fig:blockerExample}
496
490
497
491
\end{figure}
@@ -506,15 +500,11 @@ \subsection*{Bitboard of pinned pieces}
506
500
507
501
\begin{figure}
508
502
\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
+
]
518
508
\caption{Pinned piece.}\label{fig:pinnedPiece}
519
509
\end{figure}
520
510
@@ -529,7 +519,6 @@ \subsection*{Capture and push mask}
529
519
\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.
530
520
531
521
\begin{center}
532
-
\begin{minipage}{0.6\textwidth}
533
522
\centering
534
523
\newchessgame
535
524
\chessboard[
@@ -539,7 +528,6 @@ \subsection*{Capture and push mask}
539
528
color=blue, markfields={d5,e5,f5,g5},
540
529
color=red, markfields={h5}
541
530
]
542
-
\end{minipage}
543
531
\end{center}
544
532
545
533
\noindent The capture mask is shown in red, and the push mask is shown in blue.
@@ -654,20 +642,16 @@ \subsection*{Killer moves}
654
642
655
643
\begin{figure}
656
644
\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,
\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.
0 commit comments