Age | Commit message (Collapse) | Author |
|
This concerns both `BufferedSeekable` and `BufferedFile`.
|
|
|
|
|
|
The 50 and 75 move rules are no longer invoked if a pawn has advanced
in the last 50 or 75 moves respectively.
|
|
ChessEngine and the chess GUI will no longer crash on error while
reading UCI commands. ChessEngine will print a message to the standard
output, while the GUI will ignore unknown commands. Both will print
the error to the debug log if the UCI_DEBUG flag is enabled.
Trailing and preceding whitespace is now stripped from commands before
they are parsed. Commands which are just whitespace no longer produce
errors.
|
|
The BestMove command can now include an optional ponder token, with
the move that the engine would like to ponder on.
|
|
UCI info commands can now be received and parsed. All info types from
the UCI specification are supported.
The info command is not currently used by our engine or GUI, but the GUI
can now receive an info command from a 3rd party engine without
complaining.
|
|
|
|
This command is sent from the GUI to tell the engine that the next
position will be from a different game.
|
|
Not a single client of this API actually used the event mask feature to
listen for readability AND writability.
Let's simplify the API and have only one hook: on_activation.
|
|
|
|
Also, avoid creating temporary Strings for numbers, and stop appending
empty StringViews.
|
|
This saves us having to build and allocate a String, just to then use
one character of it.
|
|
- Rename to make it clear it's not just for promotion
- Understand 'p' for pawns
- Take a char parameter instead of StringView since it's always 1 char
|
|
Previously, the initial position would look like this:
rnbqkbnr//8/8/8/8//RNBQKBNR w KQkq - 0 1
Now, we correctly give pawns the P/p character in FEN output:
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
Also, we only ever have 1 or 0 characters for a piece, so let's return
`Optional<char>` instead of `StringView` from `char_for_piece()`.
|
|
|
|
|
|
This removes this slightly silly pattern:
`make<FooCommand>(FooCommand::from_string(s))`
Also, let's propagate OOM here, even if nobody reacts to it yet.
|
|
|
|
|
|
|
|
As usual, this removes many unused includes and moves used includes
further down the chain.
|
|
|
|
|
|
Having an alias function that only wraps another one is silly, and
keeping the more obvious name should flush out more uses of deprecated
strings.
No behavior change.
|
|
This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.
One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
|
|
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
|
|
Otherwise, we end up propagating those dependencies into targets that
link against that library, which creates unnecessary link-time
dependencies.
Also included are changes to readd now missing dependencies to tools
that actually need them.
|
|
Even though the toolchain implicitly links against -lc, it does not know
where it should get LibC from except for the sysroot. In the case of
Clang this causes it to pick up the LibC stub instead, which might be
slightly outdated and feature missing symbols.
This is currently not an issue that manifests because we pass through
the dependency on LibC and other libraries by accident, which causes
CMake to link against the LibC target (instead of just the library),
and thus points the linker at the build output directory.
Since we are looking to fix that in the upcoming commits, let's make
sure that everything will still be able to find the proper LibC first.
|
|
Monte-Carlo methods are known to intensively create nodes and in our
case each leaf of the tree stores a board. However, for this use case,
we don't need a full board object that also contains game information.
This patch adds a `clone_cleared()` method that return a clone without
game information and uses it when constructing the tree.
It allows the ChessEngine much more possibility before getting out of
memory.
|
|
This prevents us from needing a sv suffix, and potentially reduces the
need to run generic code for a single character (as contains,
starts_with, ends_with etc. for a char will be just a length and
equality check).
No functional changes.
|
|
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).
No functional changes.
|
|
It didn't feel right to add sv suffixes to 2-character strings, so I
added this convenience constructor.
|
|
|
|
|
|
Fixes #13268
|
|
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules
"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
|
|
This option is already enabled when building Lagom, so let's enable it
for the main build too. We will no longer be surprised by Lagom Clang
CI builds failing while everything compiles locally.
Furthermore, the stronger `-Wsuggest-override` warning is enabled in
this commit, which enforces the use of the `override` keyword in all
classes, not just those which already have some methods marked as
`override`. This works with both GCC and Clang.
|
|
|
|
Derivatives of Core::Object should be constructed through
ClassName::construct(), to avoid handling ref-counted objects with
refcount zero. Fixing the visibility means that misuses like this are
more difficult.
|
|
This is good practice, and fixes some IDE warnings.
|
|
The hash function should take the board by reference, not by value.
Also, the fact whether black can castle kingside or not was included
twice in the hash, unnecesarily.
|
|
One of the conditions for legal move is that the target square is not
occupied by a piece of the same color as the moving piece.
Instead of checking this for each piece separately at the end, we can
check this at the beginning and avoid more expensive checks.
|
|
before:
sizeof(Board)=344, sizeof(Move)=36, sizeof(Piece)=4, sizeof(Square)=8
after:
sizeof(Board)=108, sizeof(Move)=9, sizeof(Piece)=1, sizeof(Square)=2
|
|
This more than doubles the number of nodes that MCTS can search for a
given time limit, and greatly reduces memory usage.
|
|
In cases with ambiguous captures involving pawns (where multiple pieces
could have made the capture), we were exporting invalid syntax for
the move:
`1. e4 e5 2. Bb5 c6 3. Bxc6 ddxc6`
Move 3 should be `Bxc6 dxc6`, but we were duplicating the d on the pawn
move.
|
|
Make everything signed so that we don't have to deal with silly casting
issues thoughout the Chess code. I am unsure if this affects the chess
AI negatively, it seems just as "intelligent" before and after this
change :^)
|
|
|
|
SPDX License Identifiers are a more compact / standardized
way of representing file license information.
See: https://spdx.dev/resources/use/#identifiers
This was done with the `ambr` search and replace tool.
ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
|
|
Good-bye LogStream. Long live AK::Format!
|