ProDeo
Would you like to react to this message? Create an account in a few clicks or log in to continue.
ProDeo

Computer Chess
 
HomeHome  CalendarCalendar  Latest imagesLatest images  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log in  

 

 Sacrifice Games Search Tool released

Go down 
3 posters
AuthorMessage
pohl4711

pohl4711


Posts : 160
Join date : 2022-03-01
Location : Berlin

Sacrifice Games Search Tool released Empty
PostSubject: Sacrifice Games Search Tool released   Sacrifice Games Search Tool released EmptyFri Mar 11, 2022 2:59 pm

I proudly release my Sacrifice Games Search Turbo Tool, which is a huge leap forward, compared to my Agressive Games Search Tools.

The new tool can search for sacrifices from 1 pawn sacs up to 5+ pawnunits (rook-sacs for example(!!!)). And it can additionally build a statistics.txt file about all found sacs in pgn-file. And it finds a lot of (uncommon) piece-patterns of sacs more, than the AGS-tools do. Hint: If you still want to use the AGS-tools, re-download them: pgn-extract had a severe promotion-bug, which now seems fixed in the latest update-version, which I included in the AGS-downloads...

Download the Sacrifice Games Search Turbo Tool directly here:
https://www.sp-cc.de/files/sacrifice_games_search_turbo_tool_v2.0.7z

Dio and balbichi027 like this post

Back to top Go down
https://www.sp-cc.de
pohl4711

pohl4711


Posts : 160
Join date : 2022-03-01
Location : Berlin

Sacrifice Games Search Tool released Empty
PostSubject: Re: Sacrifice Games Search Tool released   Sacrifice Games Search Tool released EmptyFri Mar 11, 2022 3:26 pm

IMHO, this tool can be very useful especially for engine-developers, if they want to make their engine play more spectacular chess. Because the SGS-tool statistics can measure this really precise...

Here an example: Stockfish compared 2 versions: 220205 (latest version, which I tested for my SPCC-ratinglist (7000 games) before the new nnue-net architecture was implemented. And 7000 games (same opponents) of SF version 220210 (first version with new nnue-net architecture):

You can see a clear progress of the number of sacs played by the new net-architecture (!):

Here the statistics by my new SGS-tool:

Old net-architecture:
Source pgn-file: SF_220205.pgn
Number of games found in the source file: 7000
Max. allowed length of games, investigated: 100 moves
Number of 5+ pawnunits sacrifices: 6 (0.08%)
Number of 4 pawnunits sacrifices : 9 (0.12%)
Number of 3 pawnunits sacrifices : 25 (0.35%)
Number of 2 pawnunits sacrifices : 117 (1.67%)
Number of 1 pawnunit sacrifices : 303 (4.32%)
Number of all sacrifices : 460 (6.57%)


New net-architecture:
Source pgn-file: SF_220210.pgn
Number of games found in the source file: 7000
Max. allowed length of games, investigated: 100 moves
Number of 5+ pawnunits sacrifices: 9 (0.12%)
Number of 4 pawnunits sacrifices : 20 (0.28%)
Number of 3 pawnunits sacrifices : 51 (0.72%)
Number of 2 pawnunits sacrifices : 149 (2.12%)
Number of 1 pawnunit sacrifices : 374 (5.34%)
Number of all sacrifices : 603 (8.61%)

matejst likes this post

Back to top Go down
https://www.sp-cc.de
Chris Whittington




Posts : 1254
Join date : 2020-11-17
Location : France

Sacrifice Games Search Tool released Empty
PostSubject: Re: Sacrifice Games Search Tool released   Sacrifice Games Search Tool released EmptyFri Mar 11, 2022 6:06 pm

pohl4711 wrote:
IMHO, this tool can be very useful especially for engine-developers, if they want to make their engine play more spectacular chess. Because the SGS-tool statistics can measure this really precise...

Here an example: Stockfish compared 2 versions: 220205 (latest version, which I tested for my SPCC-ratinglist (7000 games) before the new nnue-net architecture was implemented. And 7000 games (same opponents) of SF version 220210 (first version with new nnue-net architecture):

You can see a clear progress of the number of sacs played by the new net-architecture (!):

Here the statistics by my new SGS-tool:

Old net-architecture:
Source pgn-file: SF_220205.pgn
Number of games found in the source file: 7000
Max. allowed length of games, investigated: 100 moves
Number of 5+ pawnunits sacrifices: 6 (0.08%)
Number of 4 pawnunits sacrifices : 9 (0.12%)
Number of 3 pawnunits sacrifices : 25 (0.35%)
Number of 2 pawnunits sacrifices : 117 (1.67%)
Number of 1 pawnunit sacrifices : 303 (4.32%)
Number of all sacrifices : 460 (6.57%)


New net-architecture:
Source pgn-file: SF_220210.pgn
Number of games found in the source file: 7000
Max. allowed length of games, investigated: 100 moves
Number of 5+ pawnunits sacrifices: 9 (0.12%)
Number of 4 pawnunits sacrifices : 20 (0.28%)
Number of 3 pawnunits sacrifices : 51 (0.72%)
Number of 2 pawnunits sacrifices : 149 (2.12%)
Number of 1 pawnunit sacrifices : 374 (5.34%)
Number of all sacrifices : 603 (8.61%)

I’m looking forward to using your “sacrifice finder”, particularly as a reference comparison point between engines.
I heard/read that tentative steps have been taken to grade many engines off the CCRL games list, but this ram into difficulties because there’s some correlation between general Elo strength and ability to generate games/positions where sacrifices can arise.
I guess one possibility is to limit the game search to similar strength engines? I guess you’ve thought of that already! Or to try and work it off a scatter plot with Elo on one axis, “sacrificability” on the other, and a labelled dot for each engine tested. Then you have quadrant categorisation, which might be telling. Probably you thought of this too!
Back to top Go down
pohl4711

pohl4711


Posts : 160
Join date : 2022-03-01
Location : Berlin

Sacrifice Games Search Tool released Empty
PostSubject: Re: Sacrifice Games Search Tool released   Sacrifice Games Search Tool released EmptyFri Mar 11, 2022 7:11 pm

Chris Whittington wrote:


I’m looking forward to using your “sacrifice finder”, particularly as a reference comparison point between engines.
I heard/read that tentative steps have been taken to grade many engines off the CCRL games list, but this ram into difficulties because there’s some correlation between general Elo strength and ability to generate games/positions where sacrifices can arise.
I guess one possibility is to limit the game search to similar strength engines? I guess you’ve thought of that already! Or to try and work it off a scatter plot with Elo on one axis, “sacrificability” on the other, and a labelled dot for each engine tested. Then you have quadrant categorisation, which might be telling. Probably you thought of this too!

For me, it is important, that my SGS-tool is working on all kind of games (Engines and human games) and does this very fast: The tool does not care about Players, Elos or anything like that. The core of the tool is quite simple:
Searching in all non-draw games in a given pgn-file for a material advantage (for 5 consecutive moves (or 7, if one pawn sac, only)) for the color, which finally looses the game...which means, the winning side had less material for some time in the game.
Thats all. The only really complex part of the tool are the piece-patterns, where the possible material advantages are coded (look into the bin folder). These patterns are used by pgn-extract to filter the pgn-file, which does it luckily very fast (a 10000 games pgn-file takes around 10 seconds and 20 seconds with a full search and statistics).
Any further search criterias (player names, Elo-limits) can (and should) be done outside the tool: Just use Chessbase, Scid or so for building a pgn-file with games, using all criterias, you want to have. Then save the file and put it into the SGS-tool...
Big files are no problem here. pgn-extract can handle some million games in a pgn-file - no problem. And because the SGS-tool runs so fast, even a huge pgn-file can be done in minutes or an hour or so...

But, of course, the tool is not just freeware, the code is open-source, because it is a batch-tool. The program-code of the tool can be openend and edited like a textfile. If anybody wants to do changes in there - just do it. pgn-extract offers a lot parameters for player-names, Elonumber, Tags and more... I added some REM-comments to the code and the code is pretty simple and easy to understand, I guess.

Here the online-helpfile of pgn-extract:
https://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/help.html

(I like to say: If you think, pgn-extract cant do it, you just did not find the solution to tell pgn-extract, to do it...)
Back to top Go down
https://www.sp-cc.de
pohl4711

pohl4711


Posts : 160
Join date : 2022-03-01
Location : Berlin

Sacrifice Games Search Tool released Empty
PostSubject: Re: Sacrifice Games Search Tool released   Sacrifice Games Search Tool released EmptyFri Mar 11, 2022 7:25 pm

For example, the code for doing a search for just on type of sacrifices (1 pawnunit or 2 pawnunits or 3 pawnunits etc. sacs) is so simple, that it fits on one screen (without deleting temporarly files...and some other cleanup):

REM *** filtering the white wins and black wins and put them in different files ***
pgn-extract --quiet -D -bl20 -bu%movelimit% -Tr1-0 ../%gamebase% --output whitewins.pgn > NUL
pgn-extract --quiet -D -bl20 -bu%movelimit% -Tr0-1 ../%gamebase% --output blackwins.pgn > NUL

@echo *** Searching for %whatwork%+ pawnunits sacrifices in the file containing white wins
@echo ******************************************************************************
if %whatwork% EQU 1 pgn-extract --quiet -y1_pawnsac_white whitewins.pgn --output results.pgn >NUL
if %whatwork% EQU 2 pgn-extract --quiet -y2_pawnsac_white whitewins.pgn --output results.pgn >NUL
if %whatwork% EQU 3 pgn-extract --quiet -y3_pawnsac_white whitewins.pgn --output results.pgn >NUL
if %whatwork% EQU 4 pgn-extract --quiet -y4_pawnsac_white whitewins.pgn --output results.pgn >NUL
if %whatwork% EQU 5 pgn-extract --quiet -y5_pawnsac_white whitewins.pgn --output results.pgn >NUL

@echo *** Searching for %whatwork%+ pawnunits sacrifices in the file containing black wins
@echo ******************************************************************************
if %whatwork% EQU 1 pgn-extract --quiet -y1_pawnsac_black blackwins.pgn --output blacksacs.pgn >NUL
if %whatwork% EQU 2 pgn-extract --quiet -y2_pawnsac_black blackwins.pgn --output blacksacs.pgn >NUL
if %whatwork% EQU 3 pgn-extract --quiet -y3_pawnsac_black blackwins.pgn --output blacksacs.pgn >NUL
if %whatwork% EQU 4 pgn-extract --quiet -y4_pawnsac_black blackwins.pgn --output blacksacs.pgn >NUL
if %whatwork% EQU 5 pgn-extract --quiet -y5_pawnsac_black blackwins.pgn --output blacksacs.pgn >NUL

REM *** Merge all found games in one single file ***
pgn-extract --quiet -aresults.pgn blacksacs.pgn >NUL

set /A gesamtzahl=0
REM *** Count the number of games in the gamebase...
for /f "tokens=2,* delims=PGN: " %%G in ('find /C "[White " results.pgn') do set /A gesamtanzahl=%%H

pgn-extract --quiet -o../games_with_sacrifices.pgn results.pgn >NUL



The complex part are the pawnsac files (1_pawnsac_white for example) in the bin-folder... I strongly recommend, not to change them!

Dio likes this post

Back to top Go down
https://www.sp-cc.de
Admin
Admin
Admin


Posts : 2608
Join date : 2020-11-17
Location : Netherlands

Sacrifice Games Search Tool released Empty
PostSubject: Re: Sacrifice Games Search Tool released   Sacrifice Games Search Tool released EmptyFri Mar 11, 2022 9:38 pm

Thanks for the new tool.

I wonder if it's possible to extract queen | rook | bishop / knight sacrifices.

For instance, Queen sacrifices
r1bqk2r/pppp1Npp/8/2bnP3/8/6K1/PB4PP/RN1Q3R b kq - bm 0-0;
rnb1k2r/pp1pp1bp/6p1/2pn2B1/8/2NB1N2/PqPQ2PP/1R2K2R w Kkq - bm Nxd5;
r1b2r2/pp1nqn2/2pp2kb/4Pp1p/2PP1p2/2N3BP/PPQ1B1P1/3RR1K1 w - - bm Qxf5+;

Need to find the corresponding PGN's but you get the drift.
Back to top Go down
http://rebel13.nl/
pohl4711

pohl4711


Posts : 160
Join date : 2022-03-01
Location : Berlin

Sacrifice Games Search Tool released Empty
PostSubject: Re: Sacrifice Games Search Tool released   Sacrifice Games Search Tool released EmptySat Mar 12, 2022 1:04 pm

Admin wrote:
Thanks for the new tool.

I wonder if it's possible to extract queen | rook | bishop / knight sacrifices.

For instance, Queen sacrifices
r1bqk2r/pppp1Npp/8/2bnP3/8/6K1/PB4PP/RN1Q3R b kq - bm 0-0;
rnb1k2r/pp1pp1bp/6p1/2pn2B1/8/2NB1N2/PqPQ2PP/1R2K2R w Kkq - bm Nxd5;
r1b2r2/pp1nqn2/2pp2kb/4Pp1p/2PP1p2/2N3BP/PPQ1B1P1/3RR1K1 w - - bm Qxf5+;

Need to find the corresponding PGN's but you get the drift.

The problem here is, that the tool works like this:
The SGS-tools searches for a material advantage for (at least) 5 consecutive moves for the color, which
finally looses a game (at least 7 consecutive moves, if 1 pawn-sacrifices are searched, only).

So, if you sac a queen, normally some other capture-moves follow up. And this means, the 5-move (10 plies) counter of pgn-extract is set back to 0 after each capture. When the position is quiter, pgn-extract can count up to 10 plies. Only then, a game is recognized as a sac-game...But therefore, a lot of different piece-patterns are necessary.
For example: Here the piece-patterns for white without queen and black with queen still on board and a high material advantage of 5+ pawnunits for black (out of the file 5_pawnsac_white (bin-folder)): (q=queen r=rook, p=pawn and l=Bishop or Knight)

10 r+l+p3+ q1>=r=l=p*
10 r+l+p3+ q1>=r=l>p*
10 r+l+p3+ q1>=r>l*p*
10 r+l+p3+ q1>=r=l1<=p>
10 r+l+p3+ q1>=r=l1<=p=
10 r+l+p3+ q1>=r=l1<=p1<=
10 r+l+p3+ q1>=r=l2<=p2>
10 r+l+p3+ q1>=r=l3<=p5>
10 r+l+p3+ q1>=r1<=l>p>
10 r+l+p3+ q1>=r1<=l>p=
10 r+l+p3+ q1>=r1<=l>p1<=
10 r+l+p3+ q1>=r1<=l>p2<=
10 r+l+p3+ q1>=r1<=l=p>
10 r+l+p3+ q1>=r1<=l1<=p4>
10 r+l+p3+ q1>=r1<=l2<=p7>
10 r+l+p3+ q1>=r2<=l=p6>
10 r+l+p3+ q1>=r2<=l1>=p3>
10 r+l+p3+ q1>=r2<=l2>=p>
10 r+l+p3+ q1>=r2<=l2>=p=
10 r+l+p3+ q1>=r2<=l3>p*


Here the explanation from pgn-extract help:
The -y and -z flags take a filename of material balances for which you wish to search in games. The --materialy and --materialz arguments offer command-line alternatives to using a file.

The basic structure of the file is one or more lines describing a material balance of the form

pieces1 pieces2
Pieces1 and pieces2 are lists of English piece letters for the material for the two sides that you wish to look for in a game.

The case of the letters is immaterial, there is no need to include Kings in the description, and the order of the pieces does not matter. Apart from Kings, if a piece letter is not listed for a side then that piece is not present within that side's material. With the -z and --materialz flags, a match will be tested for from both White and Black's point of view

Further notation may be added after any piece letter, typically to indicate something about the number of occurrences of that piece on one side. The following are valid for each piece:

* (zero or more of that piece).
+ (one or more of that piece).
d (exactly d occurrences of that piece, where d is a digit).
d+ (d or more occurrences of that piece).
d- (d or fewer occurrences of that piece).
= (the number of these pieces must be the same as the opponent's).
# (the number of these pieces must be different from the opponent's).
> (the number of these pieces more than the opponent has).
< (the number of these pieces less than the opponent has).
d> (the number of these pieces must be at least d more than the opponent's).
d< (the number of these pieces must be at least d less than the opponent's).
d>= (the number of these pieces must be exactly d more than the opponent's).
d<= (the number of these pieces must be exactly d less than the opponent's).
Back to top Go down
https://www.sp-cc.de
pohl4711

pohl4711


Posts : 160
Join date : 2022-03-01
Location : Berlin

Sacrifice Games Search Tool released Empty
PostSubject: Re: Sacrifice Games Search Tool released   Sacrifice Games Search Tool released EmptySat Mar 12, 2022 8:15 pm

I found a serious bug in the Sacrifice Games Search Tool (searching for 1 pawn sacs for black was complete broken)...

I fixed it - Please redownload the tool. I am very sorry. Additionally I lowered the piece-limits for all sacs, so sacs can be found later in a game, now.

https://www.sp-cc.de/files/sacrifice_games_search_turbo_tool_v2.0.7z
Back to top Go down
https://www.sp-cc.de
Admin
Admin
Admin


Posts : 2608
Join date : 2020-11-17
Location : Netherlands

Sacrifice Games Search Tool released Empty
PostSubject: Re: Sacrifice Games Search Tool released   Sacrifice Games Search Tool released EmptySat Mar 12, 2022 8:52 pm

Did the redownload.
Back to top Go down
http://rebel13.nl/
Sponsored content





Sacrifice Games Search Tool released Empty
PostSubject: Re: Sacrifice Games Search Tool released   Sacrifice Games Search Tool released Empty

Back to top Go down
 
Sacrifice Games Search Tool released
Back to top 
Page 1 of 1
 Similar topics
-
» New Sacrifice Game Search Comfort Tool is ready
» Short Games Analyzer Tool released
» Speculative Sacrifice Games
» SPCC: 750000 clicks and a new tool released
» The New Dragon 2 Released Today. Dragon 2 vs Stockfish 13 (1000 Games) (TC = 1m + 1s) (16 Threads)

Permissions in this forum:You cannot reply to topics in this forum
ProDeo :: Computer Chess-
Jump to: