Comments (5)
Your fen isn't a valid FEN. position fen 3qk1nb/1p3p2/p1r1p1p1/3p4/3P4/2N1BP2/PPPQ1P2/R3K3 w Qk - 0 15
Black cannot castle king side. There's a bishop in the corner not a rook.
from stockfish.
Thank you, this is a good pointer!
Why is Stockfish then accepting the following fen:
position fen 2rqk1nb/1p3p2/p1B1p1p1/3p4/3P4/2N1BP2/PPPQ1P2/R3K3 b Qk - 0 14
from stockfish.
Probably because the king is in check and chess rules say we cant castle, so we dont try to generate the move and after the king moves we clear all castling squares for the king.
from stockfish.
How the engine reacts to illegal fens should be considered undefined behaviour, you can't rely on the engine consistently saving itself from a crash.
If you want fen validation your best bet currently it to validate the fen before passing it to sf.
from stockfish.
Ok, thank you very much for the super fast response! I fully agree, the error is with the generation of the fens that I am using (not your problem).
For future reference below all the previous fens from that game that I am using were also faulty but did not result in an error. But again, not your issue as PGG106 is pointing out (but maybe interesting for someone else at some point).
rnbqk1nr/ppp1ppb1/6p1/3p4/8/2N5/PPPPPPP1/R1BQKBNR w KQkq - 0 5 -- here still okay
rnbqk1nR/ppp1ppb1/6p1/3p4/8/2N5/PPPPPPP1/R1BQKBN1 b Qkq - 0 5 -- here the rook gets taken but castling rights are preserved for black
rnbqk1nb/ppp1pp2/6p1/3p4/8/2N5/PPPPPPP1/R1BQKBN1 w Qkq - 0 6
rnbqk1nb/ppp1pp2/6p1/3p4/8/2N1P3/PPPP1PP1/R1BQKBN1 b Qkq - 0 6
rnbqk1nb/pp2pp2/6p1/2pp4/8/2N1P3/PPPP1PP1/R1BQKBN1 w Qkq c6 0 7
rnbqk1nb/pp2pp2/6p1/2pp4/8/2N1PN2/PPPP1PP1/R1BQKB2 b Qkq - 1 7
r1bqk1nb/pp2pp2/2n3p1/2pp4/8/2N1PN2/PPPP1PP1/R1BQKB2 w Qkq - 2 8
r1bqk1nb/pp2pp2/2n3p1/2pp4/3P4/2N1PN2/PPP2PP1/R1BQKB2 b Qkq d3 0 8
r2qk1nb/pp2pp2/2n3p1/2pp4/3P2b1/2N1PN2/PPP2PP1/R1BQKB2 w Qkq - 1 9
r2qk1nb/pp2pp2/2n3p1/1Bpp4/3P2b1/2N1PN2/PPP2PP1/R1BQK3 b Qkq - 2 9
r2qk1nb/pp2pp2/2n3p1/1B1p4/3p2b1/2N1PN2/PPP2PP1/R1BQK3 w Qkq - 0 10
r2qk1nb/pp2pp2/2n3p1/1B1p4/3P2b1/2N2N2/PPP2PP1/R1BQK3 b Qkq - 0 10
2rqk1nb/pp2pp2/2n3p1/1B1p4/3P2b1/2N2N2/PPP2PP1/R1BQK3 w Qk - 1 11
2rqk1nb/pp2pp2/2n3p1/1B1p4/3P2b1/2N1BN2/PPP2PP1/R2QK3 b Qk - 2 11
2rqk1nb/pp3p2/2n1p1p1/1B1p4/3P2b1/2N1BN2/PPP2PP1/R2QK3 w Qk - 0 12
2rqk1nb/pp3p2/2n1p1p1/1B1p4/3P2b1/2N1BN2/PPPQ1PP1/R3K3 b Qk - 1 12
2rqk1nb/pp3p2/2n1p1p1/1B1p4/3P4/2N1Bb2/PPPQ1PP1/R3K3 w Qk - 0 13
2rqk1nb/pp3p2/2n1p1p1/1B1p4/3P4/2N1BP2/PPPQ1P2/R3K3 b Qk - 0 13
2rqk1nb/1p3p2/p1n1p1p1/1B1p4/3P4/2N1BP2/PPPQ1P2/R3K3 w Qk - 0 14
2rqk1nb/1p3p2/p1B1p1p1/3p4/3P4/2N1BP2/PPPQ1P2/R3K3 b Qk - 0 14
3qk1nb/1p3p2/p1r1p1p1/3p4/3P4/2N1BP2/PPPQ1P2/R3K3 w Qk - 0 15 -- here stockfish 15.1 crashes
Feel free to mark the issue as closed
from stockfish.
Related Issues (20)
- The windows VNNI binary does not work. HOT 10
- Stockfish > 16 ignores setoption after go HOT 18
- False evaluations for positions with multiple knights HOT 2
- Issue with the benchmark HOT 8
- Again about the benchmark HOT 28
- wrong mated in scores HOT 1
- Stockfish needlessly hangs the queen HOT 14
- Winning evaluation with tablebases in cursed win HOT 19
- issue when running the .exe of version 16.1 on Windows. HOT 1
- expect not properly spawning Stockfish in github actions.
- eval command breaks after AccumulatorRefreshTable merged
- Faulty analysis - too big change of position value HOT 2
- Disappointed with the project HOT 1
- test
- Suboptimal speed on multi-socket / numa systems HOT 6
- Castling doesn't work in non-standard positions (Stockfish macOS application) HOT 2
- Incorrect concurrency on multi-CPU systems HOT 20
- Stockfish bug in version: May 30 14:34:24 2024 +0200 Timestamp: 1717072464 HOT 3
- Abrok Windows buildbot has broken since a169c78b6d3b082068deb49a39aaa1fd75464c7f HOT 3
- Compiling StockFish using arm-none-eabi-gcc and arm-none-eabi-g++ compilers? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stockfish.