I did try doing that, but it lead to distorted scores, and terrible moves.alvinypeng wrote: ↑Sun Feb 26, 2023 11:25 pmUsing tapered piece square tables can improve your engine positionally. Also, you can speed up your engine by incrementally updating your piece square table scores every time you make a move rather than computing them from scratch every time you call your evaluate function.Enderjed wrote: ↑Sun Feb 26, 2023 7:54 pm So far on my PC, the fastest I've been able to get 3.2 (and 3.2 "Archer") is 16 Kn/s, and generally takes less time than 30 seconds for it's first move.
It does search at far greater depths and faster when there are less pieces on the board (so far the current record is a depth of 12) [In testing, this has given Valiant a stronger endgame, giving it a unique skill curve over game time due to it's depth being tied to piece count.]
{Versions older than 3.2 and 3.2 archer run much slower due to their time management code being quite lenient}
The reasoning on why the engine is so slow is because:
1. It's compiled for python 3.x, which runs at the speed of an actual python
2. I would compile it in PyPy 3 to make it go [drastically] faster, but I have yet to learn on how to get it to successfully compile in PyPy3
3. Iterative deepening is what consumes the most time, but without it, the engine would be drastically lower in elo
Although I must say that I do thank you (and alvinypeng) for downloading my engine and giving it a shot.
Is there anything about it (strategically and/or positionally) that could use improvement?
Engine Release: Valiant
Moderator: Ras
-
- Posts: 39
- Joined: Tue Sep 27, 2022 7:13 pm
- Location: United Kingdom, East Midlands
- Full name: Jedidiah F. Sessions
Re: Engine Release: Valiant
-
- Posts: 243
- Joined: Tue Jan 31, 2023 4:34 pm
- Full name: Adam Kulju
Re: Engine Release: Valiant
Distorted scores? Are you sure there wasn't a bug in your code? A ((middlegamescore*phase) + (endgamescore*(maxphase-phase))/maxphase should not be very hard to implement and it gave a couple hundred elo for me.Enderjed wrote: ↑Sun Feb 26, 2023 11:32 pmI did try doing that, but it lead to distorted scores, and terrible moves.alvinypeng wrote: ↑Sun Feb 26, 2023 11:25 pmUsing tapered piece square tables can improve your engine positionally. Also, you can speed up your engine by incrementally updating your piece square table scores every time you make a move rather than computing them from scratch every time you call your evaluate function.Enderjed wrote: ↑Sun Feb 26, 2023 7:54 pm So far on my PC, the fastest I've been able to get 3.2 (and 3.2 "Archer") is 16 Kn/s, and generally takes less time than 30 seconds for it's first move.
It does search at far greater depths and faster when there are less pieces on the board (so far the current record is a depth of 12) [In testing, this has given Valiant a stronger endgame, giving it a unique skill curve over game time due to it's depth being tied to piece count.]
{Versions older than 3.2 and 3.2 archer run much slower due to their time management code being quite lenient}
The reasoning on why the engine is so slow is because:
1. It's compiled for python 3.x, which runs at the speed of an actual python
2. I would compile it in PyPy 3 to make it go [drastically] faster, but I have yet to learn on how to get it to successfully compile in PyPy3
3. Iterative deepening is what consumes the most time, but without it, the engine would be drastically lower in elo
Although I must say that I do thank you (and alvinypeng) for downloading my engine and giving it a shot.
Is there anything about it (strategically and/or positionally) that could use improvement?
go and star https://github.com/Adam-Kulju/Patricia!
-
- Posts: 39
- Joined: Tue Sep 27, 2022 7:13 pm
- Location: United Kingdom, East Midlands
- Full name: Jedidiah F. Sessions
Re: Engine Release: Valiant
It certainly could have been buggy or straight up logically incorrect code, as I am quite the poor programmer.
-
- Posts: 39
- Joined: Tue Sep 27, 2022 7:13 pm
- Location: United Kingdom, East Midlands
- Full name: Jedidiah F. Sessions
Re: Engine Release: Valiant
Due to a workload increase, updates to Valiant will be far less constant.
Although do feel free to enter the engine into tournaments, and/or suggest improvements.
Although do feel free to enter the engine into tournaments, and/or suggest improvements.
-
- Posts: 243
- Joined: Tue Jan 31, 2023 4:34 pm
- Full name: Adam Kulju
Re: Engine Release: Valiant
I got around to fully testing it and I am pretty sure something is wrong with your piece square tables. It keeps running its king up (and getting immediately crushed).
I looked at the eval code to 3.1 (I don't know if these mistakes are also in 3.2, but by its play it seems to be) and found:
1. [rather minor] your queen pst needs to be flipped like all of your other tables
2. [very major!] you are using the king pst for the endgame at all times, including the middlegame! Your search is not very deep, so what kept happening over and over again was Valiant kept running the king towards the center to improve its static evaluation score, and was unable to see that it lost tactically.
An example game which shows it:
Fixing that should definitely boost your engine's rating by a few hundred ELO points
I looked at the eval code to 3.1 (I don't know if these mistakes are also in 3.2, but by its play it seems to be) and found:
1. [rather minor] your queen pst needs to be flipped like all of your other tables
2. [very major!] you are using the king pst for the endgame at all times, including the middlegame! Your search is not very deep, so what kept happening over and over again was Valiant kept running the king towards the center to improve its static evaluation score, and was unable to see that it lost tactically.
An example game which shows it:
Fixing that should definitely boost your engine's rating by a few hundred ELO points

go and star https://github.com/Adam-Kulju/Patricia!
-
- Posts: 39
- Joined: Tue Sep 27, 2022 7:13 pm
- Location: United Kingdom, East Midlands
- Full name: Jedidiah F. Sessions
Re: Engine Release: Valiant
If all the piece square tables are backwards, then that ironically means that the archer variant is more tactically correct than standard Valiant, even though Valiant "Archer" has a much lower winrate overallWhiskers wrote: ↑Mon Mar 06, 2023 6:16 am I got around to fully testing it and I am pretty sure something is wrong with your piece square tables. It keeps running its king up (and getting immediately crushed).
I looked at the eval code to 3.1 (I don't know if these mistakes are also in 3.2, but by its play it seems to be) and found:
1. [rather minor] your queen pst needs to be flipped like all of your other tables
2. [very major!] you are using the king pst for the endgame at all times, including the middlegame! Your search is not very deep, so what kept happening over and over again was Valiant kept running the king towards the centre to improve its static evaluation score, and was unable to see that it lost tactically.
Fixing that should definitely boost your engine's rating by a few hundred ELO points![]()
I have also done some further observations, and to attempt to counter this suicidal royal charge, for the next version I have added tapered piece square tables (albeit, there is no interpolation between the tapering, so in the future I might try to add various types of interpolation).
This has allowed it to play black more successfully, at the cost of losing to 3.2 Standard when playing as white.
In general, it has now been able to beat mildly stronger engines, such as LittleleLouch, Ax 0.8 and BBC 1.4 (with Stockfish NNUE)
Although it does still lose to some strategies, so I would predict it's Elo to be within a blunt range of 1200-2000
-
- Posts: 243
- Joined: Tue Jan 31, 2023 4:34 pm
- Full name: Adam Kulju
Re: Engine Release: Valiant
Have you made sure that all your piece square table lookups are operating properly? For example, if you have a white king on e1, and a black king on e8, does your engine add the correct value for both squares? (can be easily verified with a print statement or two)Enderjed wrote: ↑Mon Mar 06, 2023 4:43 pmIf all the piece square tables are backwards, then that ironically means that the archer variant is more tactically correct than standard Valiant, even though Valiant "Archer" has a much lower winrate overallWhiskers wrote: ↑Mon Mar 06, 2023 6:16 am I got around to fully testing it and I am pretty sure something is wrong with your piece square tables. It keeps running its king up (and getting immediately crushed).
I looked at the eval code to 3.1 (I don't know if these mistakes are also in 3.2, but by its play it seems to be) and found:
1. [rather minor] your queen pst needs to be flipped like all of your other tables
2. [very major!] you are using the king pst for the endgame at all times, including the middlegame! Your search is not very deep, so what kept happening over and over again was Valiant kept running the king towards the centre to improve its static evaluation score, and was unable to see that it lost tactically.
Fixing that should definitely boost your engine's rating by a few hundred ELO points![]()
I have also done some further observations, and to attempt to counter this suicidal royal charge, for the next version I have added tapered piece square tables (albeit, there is no interpolation between the tapering, so in the future I might try to add various types of interpolation).
This has allowed it to play black more successfully, at the cost of losing to 3.2 Standard when playing as white.
In general, it has now been able to beat mildly stronger engines, such as LittleleLouch, Ax 0.8 and BBC 1.4 (with Stockfish NNUE)
Although it does still lose to some strategies, so I would predict it's Elo to be within a blunt range of 1200-2000
Also, an easy way to stop the king from rushing into the middle would be to use this PST from the Simplified evaluation function during the middlegame and only switch to the other one once the amount of material on the board drops below a certain point.
-30,-40,-40,-50,-50,-40,-40,-30,
-30,-40,-40,-50,-50,-40,-40,-30,
-30,-40,-40,-50,-50,-40,-40,-30,
-30,-40,-40,-50,-50,-40,-40,-30,
-20,-30,-30,-40,-40,-30,-30,-20,
-10,-20,-20,-20,-20,-20,-20,-10,
20, 20, 0, 0, 0, 0, 20, 20,
20, 30, 10, 0, 0, 10, 30, 20
go and star https://github.com/Adam-Kulju/Patricia!
-
- Posts: 39
- Joined: Tue Sep 27, 2022 7:13 pm
- Location: United Kingdom, East Midlands
- Full name: Jedidiah F. Sessions
Re: Engine Release: Valiant
Valiant Mk4 does have the same king PST for it's earlygame evaluation. Although it does change to midgame and endgame when turns progress, not when material falls.Whiskers wrote: ↑Mon Mar 06, 2023 6:04 pmHave you made sure that all your piece square table lookups are operating properly? For example, if you have a white king on e1, and a black king on e8, does your engine add the correct value for both squares? (can be easily verified with a print statement or two)Enderjed wrote: ↑Mon Mar 06, 2023 4:43 pmIf all the piece square tables are backwards, then that ironically means that the archer variant is more tactically correct than standard Valiant, even though Valiant "Archer" has a much lower winrate overallWhiskers wrote: ↑Mon Mar 06, 2023 6:16 am I got around to fully testing it and I am pretty sure something is wrong with your piece square tables. It keeps running its king up (and getting immediately crushed).
I looked at the eval code to 3.1 (I don't know if these mistakes are also in 3.2, but by its play it seems to be) and found:
1. [rather minor] your queen pst needs to be flipped like all of your other tables
2. [very major!] you are using the king pst for the endgame at all times, including the middlegame! Your search is not very deep, so what kept happening over and over again was Valiant kept running the king towards the centre to improve its static evaluation score, and was unable to see that it lost tactically.
Fixing that should definitely boost your engine's rating by a few hundred ELO points![]()
I have also done some further observations, and to attempt to counter this suicidal royal charge, for the next version I have added tapered piece square tables (albeit, there is no interpolation between the tapering, so in the future I might try to add various types of interpolation).
This has allowed it to play black more successfully, at the cost of losing to 3.2 Standard when playing as white.
In general, it has now been able to beat mildly stronger engines, such as LittleleLouch, Ax 0.8 and BBC 1.4 (with Stockfish NNUE)
Although it does still lose to some strategies, so I would predict it's Elo to be within a blunt range of 1200-2000
Also, an easy way to stop the king from rushing into the middle would be to use this PST from the Simplified evaluation function during the middlegame and only switch to the other one once the amount of material on the board drops below a certain point.
-30,-40,-40,-50,-50,-40,-40,-30,
-30,-40,-40,-50,-50,-40,-40,-30,
-30,-40,-40,-50,-50,-40,-40,-30,
-30,-40,-40,-50,-50,-40,-40,-30,
-20,-30,-30,-40,-40,-30,-30,-20,
-10,-20,-20,-20,-20,-20,-20,-10,
20, 20, 0, 0, 0, 0, 20, 20,
20, 30, 10, 0, 0, 10, 30, 20
-
- Posts: 39
- Joined: Tue Sep 27, 2022 7:13 pm
- Location: United Kingdom, East Midlands
- Full name: Jedidiah F. Sessions
Re: Engine Release: Valiant
MK V has finally been released. (along with source)
In terms of changes, the piece evaluation has been renovated, giving the engine a more discernible understanding of the start, mid, and endgame. This is alongside some cosmetic and auditory improvements.
It's strong enough to beat me now in a reasonable timeframe.
Within testing, it's win rate has become far more reliable. So I'd assume it's rating to be closer to 1600-2000.
In terms of changes, the piece evaluation has been renovated, giving the engine a more discernible understanding of the start, mid, and endgame. This is alongside some cosmetic and auditory improvements.
It's strong enough to beat me now in a reasonable timeframe.
Within testing, it's win rate has become far more reliable. So I'd assume it's rating to be closer to 1600-2000.
-
- Posts: 243
- Joined: Tue Jan 31, 2023 4:34 pm
- Full name: Adam Kulju
Re: Engine Release: Valiant
What's Valiant's strongest time control? It kind of struggled when I put it in a 30 seconds + 0.5 sec increment match
Code: Select all
Result:
--------------------------------------------------------------------------
# name games wins draws losses score elo + -
1. Celestial 100 98 1 1 98.5 304 105 66
2. VALIANT MK V 100 1 1 98 1.5 -304 66 105
Cross table:
--------------------------------------------------------------------------
# name score games 1 2
1. Celestial 98.5 100 x 111111111111111111111111111111111111111111111111111111=111111111101111111111111111111111111111111111
2. VALIANT MK V 1.5 100 000000000000000000000000000000000000000000000000000000=000000000010000000000000000000000000000000000 x
Tech:
--------------------------------------------------------------------------
Tech (average nodes, depths, time/m per move, others per game), counted for computing moves only, ignored moves with zero nodes:
# name nodes/m NPS depth/m time/m moves time #fails
1. Celestial 471K 501814 5.9 0.9 30.7 28.8 1
2. VALIANT MK V 2K 1322 3.2 1.2 30.2 36.4 1
all --- 232K 222385 4.5 1.1 30.5 32.6 2
go and star https://github.com/Adam-Kulju/Patricia!