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
\subsection*{Move generator with magic bitboards and pext instruction}
172
172
173
-
\noindent In addition to the transposition table, we now accelerate the move generation process using \texttt{PEXT} instructions. We chose not to analyze the magic bitboards technique at this stage, as both approaches provide constant-time (\( O(1) \)) access to legal moves for sliding pieces, and would yield similar performance results.
173
+
\noindent In addition to the transposition table, we now accelerate the move generation process using PEXT instructions. We chose not to analyze the magic bitboards technique at this stage, as both approaches provide constant-time (\( O(1) \)) access to legal moves for sliding pieces, and would yield similar performance results.
\noindent\parbox{\textwidth}{The full implementation of the move generator can be found in \texttt{src\textbackslash{}move\_generator\textbackslash{}move\_generator\_basic.cpp}.}
412
+
\noindent The full implementation of the move generator can be found in\\\texttt{src\textbackslash{}move\_generator\textbackslash{}move\_generator\_basic.cpp}.
413
413
414
414
\vspace{1em}
415
415
@@ -643,4 +643,4 @@ \subsection*{Killer moves}
643
643
644
644
\vspace{1em}
645
645
646
-
\noindent If a quiet move being evaluated matches one of the killer moves stored at the current search depth, we increase its score by 70 points. The value 70 is chosen empirically to ensure that killer moves are prioritized above most quiet moves, but still allow the most valuable captures (according to the MVV-LVA heuristic) to take precedence when appropriate. This balance helps improve pruning efficiency without overlooking critical tactical opportunities.
646
+
\noindent If a quiet move being evaluated matches one of the killer moves stored at the current search depth, we increase its score by 70 points. This value is chosen to ensure that killer moves are prioritized above most quiet moves, but still allow the most valuable captures (according to the MVV-LVA heuristic) to take precedence when appropriate. This balance helps improve pruning efficiency without overlooking critical tactical opportunities.
\noindent Taking advantage of dynamic programming, we create a look-up table of chess positions and its evaluation. So if we encounter the same position again, the evaluation is already precalculated. However, we ask ourselves the following question: how much space does the look-up table take up if there are an astronomical amount of chess positions? What we can do is assign a hash to each position and make the table index the last bits of the hash. The larger the table, the less likely access collisions will be. We also want a hash that is fast to calculate and has collision-reducing properties.
36
-
~\cite{TranspositionTable}
35
+
\noindent Taking advantage of dynamic programming, we create a look-up table of chess positions and its evaluation. So if we encounter the same position again, the evaluation is already precalculated. However, we ask ourselves the following question: how much space does the look-up table take up if there are an astronomical amount of chess positions? What we can do is assign a hash to each position and make the table index the last bits of the hash. The larger the table, the less likely access collisions will be. We also want a hash that is fast to calculate and has collision-reducing properties~\cite{TranspositionTable}.
\noindent The \texttt{PEXT} (Parallel Bits Extract) is an instruction available on modern CPUs. They extracts bits from a source operand according to a mask and packs them into the lower bits of the destination operand~\cite{PextInstruction}. It is ideally suited for computing our table index.
306
+
\noindent The PEXT (Parallel Bits Extract) is an instruction available on modern CPUs. They extracts bits from a source operand according to a mask and packs them into the lower bits of the destination operand~\cite{PextInstruction}. It is ideally suited for computing our table index.
307
307
308
308
\vspace{1em}
309
309
310
-
\noindent\cref{fig:pext_instruction_example} illustrates how \texttt{PEXT} works: it selects specific bits from register \texttt{r2}, as specified by the mask in \texttt{r3}, and packs the result into the lower bits of the destination register \texttt{r1}.
310
+
\noindent\cref{fig:pext_instruction_example} illustrates how PEXT works: it selects specific bits from register \texttt{r2}, as specified by the mask in \texttt{r3}, and packs the result into the lower bits of the destination register \texttt{r1}.
\caption{Example of the \texttt{PEXT} instruction.}\label{fig:pext_instruction_example}
317
+
\caption{Example of the PEXT instruction.}\label{fig:pext_instruction_example}
318
318
\end{figure}
319
319
320
320
\noindent For our previous example (see~\cref{fig:magics_position}), we only need the full bitboard of blockers and the rook's attack pattern (excluding the borders to reduce space), as illustrated below.
0 commit comments