Answers.Body: <p>Your concept of &quot;Thermopylae&quot; is just what chess player call a &quot;forced move&quot;. The problem is, smost forced moves are trivial (for example, recaptures or moving out of check), while others can be hard to find. The number of alternatives does not always determine the difficulty of a position.</p>
  <p>Engines are not designed to estimate how hard to find a move is for a human. You could certainly try to tweak the evaluation function so that lines containing lots of forced moves get a bonus, but this doesn't mean the new engine will be harder to play against. Rather, it'd be an engine that likes playing some sort of &quot;hope chess&quot;.</p>
  <p>As Federico Poloni suggests on his comment, every puzzle collection is a collection of &quot;Thermopylae&quot;, so sites like Lichess that generate puzzle based on games played by their users are certainly doing a scan of this sort.</p>
  <p>Still, the vast majority of those puzzles are terribly easy, so it looks like this method wouldn't be particularly useful for opening preparation, specially if we take into account that current opening theory will hardly ever end right before a hard-to-find forced move. After all, who would have a line on his repertoire that requires him to find an outstanding move on the spot or else get a lost position?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-16T21:57:12.830Z
Answers.Text: "Still, the vast majority of those puzzles are terribly easy" - not at all. There are puzzles on these sites that can stump some of the best tactical players in the world (e.g. Nakamura, on Chess.com) for near-on hours, even though they know it's a puzzle. Pose a series of those, midgame, and you'll almost surely win. It's a highly non-trivial question, though where I agree with you is that creating forcing positions and positions which are forcing & difficult are not the same.
Answers.UserDisplayName: Mobeus Zoom
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-16T22:23:04.990Z
Answers.Text: See also: "(I understand this will include a number of trivial recaptures... but I'll go with that.)". Not the answer I am looking for.
Answers.UserDisplayName: Peter Fischer
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-17T11:38:37.783Z
Answers.Text: @MobeusZoom That's why I said "the vast majority" and not "every single one". If you pick a lichess puzzle at random, there is a very little chance of it being one of those that makes Nakamura struggle. The reason why you can get a collection of hard puzzles is that there are thousands of humans playing the puzzles over and over again to determine their difficulty. That does not apply to this question.
Answers.UserDisplayName: David
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-17T11:39:16.837Z
Answers.Text: @PeterFischer If you don't mind having a 99.9%+ of trivial moves, then yes. That way exists.
Answers.UserDisplayName: David
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-16T08:27:50.407Z
Answers.LastActivityDate: 2022-06-16T08:36:11.870Z
Answers.LastEditDate: 2022-06-16T08:36:11.870Z
Answers.UserDisplayName: David
Body: <h1>Motivation</h1>
  <p><em>“You must take your opponent into a deep dark forest where 2+2=5, and the path leading out is only wide enough for one.&quot;</em> – Michail Tal</p>
  <p>I am looking for ways to systematically find lines where one player is forced to find series of precise moves.</p>
  <h1>Background</h1>
  <p>The battle of Thermopylae was fought in 480 BC between the Achaemenid Persian Empire under Xerxes I. and an alliance of Greek city-states led by Sparta under Leonidas I.</p>
  <p>During two full days of battle, the small force led by Leonidas blocked <strong>the only road</strong> by which the massive Persian army could traverse the <strong>narrow pass</strong>.</p>
  <p>The performance of the Greek defenders is well known as an example of the advantages of <strong>training, equipment, and use of terrain</strong> as force multipliers.</p>
  <h1>Glossar</h1>
  <p>In chess, I consider a 'thermopylae' to be an only-move that must be found by ones opponent in order to not blunder away their game. Similar to the historic example, it is <strong>a narrow pass</strong>, an <strong>only road</strong>, and when studied and prepared at home, it gives rise to a possible advantage through <strong>training, equipment, and use of terrain</strong>. (You get the point...)</p>
  <h1>Example 1</h1>
  <p>Consider the <strong>equal</strong> position given below where Qd1 is a thermopylae from blacks view since both Qd2 and Qd3 (and every other move of course) lead to a significant advantage for black.</p>
  <pre><code>[fen &quot;rqr3k1/3n1ppp/bp2pb2/1N1p4/PP1Q1P2/2P1BR2/4B1PP/R5K1 w - - 0 1&quot;]
  </code></pre>
  <h1>Example 2</h1>
  <p>In the <strong>equal</strong> position below, white needs to find Be4 to not blunder away the game. If this is found, the game 'widens' after Ke6, but remains 'narrow' after Nb4, asking again for precise moves from white.</p>
  <pre><code>[fen &quot;r4r2/5k2/3p4/2pn4/2R5/p7/2B2PPP/1R4K1 w - - 0 35&quot;]
  </code></pre>
  <h1>Question</h1>
  <p>Is there a way to (have engines) systematically go through tabiae (the ends of opening lines) and extract lines that lead to such thermopylaes, possibly a multitude of these down a certain line? (I understand this will include a number of trivial recaptures and forced moves, but I'll go with that.)</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-11T19:08:19.880Z
Comments.Text: I'd appreciate an explanation to why the down-vote - it could help me improve later questions in general, and this one in particular.
Comments.UserDisplayName: Peter Fischer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-11T19:42:51.347Z
Comments.Text: What's the quote? A decreasing amount of moves is a sign of a deteriorating position. If your opponent doesn't have good moves left, then they only have bad moves. In the opening, this doesn't happen because both players have a variety of options.
Comments.UserDisplayName: DdogBoss
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-11T20:40:06.927Z
Comments.Text: @RewanDemontay Oh, I was pointing out a quote by someone else. Maybe it was Nimzowitsch or Lasker.
Comments.UserDisplayName: DdogBoss
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-11T23:53:37.713Z
Comments.Text: I downvote also because your example, in comparison with what Tal was talking about, is trivial and makes it quite clear, I regret to say, that you have little idea how chess is played at a level higher than elementary. You seem to believe that you have discovered a new strategic concept but you have not, and your attempt to dress it in  intellectual flummery is distasteful. i am being plainspoken only because you did ask for clarification..
Comments.UserDisplayName: Philip Roe
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-12T06:44:24.600Z
Comments.Text: I am directing this question to people with an outspokenly good understanding of programming, not chess itself. The Tal quote is accurate, think about it a tad more! 'Wide' for a multitude of ways how to handle a position and 'narrow' for only-moves may be unfamiliar terms, yet fully on point; am sorry if this doesn't come across. - Question remains: how to give counts for the number of equalish continuations and so how to extract those tabiae that feature many, even consecutive 'narrow' paths.
Comments.UserDisplayName: Peter Fischer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-12T06:52:27.483Z
Comments.Text: Also, DdogBosses comment seems pretty newbish; there is much more flesh to this bone than simply: shows detoriating position. That's plain wrong, and the part 'if no good move for opponent, then only bad moves' is trivial to the point I didn't even consider a reply, figuring people would be smarter than that. - I admit the example can be improved, and fine, going to reword if reall necessary, but for now claim that people with a more than 'elementary' understanding of chess will come to my rescue.
Comments.UserDisplayName: Peter Fischer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-12T07:01:34.520Z
Comments.Text: If this makes things clearer, think about it as another number next to a move, similar to the current eval or the time spent on the move, s.a. "Qd1, 0.00 eval, 0:45 move time, 0 alternatives that aren't blunders". I am looking for strings where one side (lets call him Tal...) can lead the game into and down a line that features many such '0 alternative moves that don't blunder away the game'.
Comments.UserDisplayName: Peter Fischer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-12T07:32:29.210Z
Comments.Text: Made an edit to the question, added another, much less trivial example, and cut the expectation part to open the question to a wider public.
Comments.UserDisplayName: Peter Fischer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-12T22:40:56.677Z
Comments.Text: You can of course simply solve this with a specific search that looks for this, e.g. it would be trivial to write a search that compares the top move in each PV position with the second best move, then you'd only need some way to put that into objective values.
  
  However, I do want to point out a fun different approach: randomness in the evaluations. If you add a random term even just to the final leaf evaluations of a search tree, you inherently incentivize each player to minimize the number of good options for their opponent because that reduces their number of chances for a good dice roll.
Comments.UserDisplayName: koedem
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-13T15:11:53.857Z
Comments.Text: Doesn't basically any tactics quiz provide an answer to this question?
Comments.UserDisplayName: Federico Poloni
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-14T12:53:27.277Z
Comments.Text: On `go through tabiae (the ends of opening lines) and extract lines that lead to such thermopylaes` so you have an opening line of say 10 plies, you want to find a continuation line such that your opponent will be brought to a series of positions where there is only one playable move (critical position). And in doing so you are willing to give up a pawn or two worth of evaluation or even a whole piece just to bring your opponent into a series of thermopylae states. If the opponent happens to find all the best moves, you will lose the game - the payment.
Comments.UserDisplayName: ferdy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-14T17:00:10.610Z
Comments.Text: You missed the point of there need being equal-ish positions to start from and end up in; see definition. Consider this a preparation issue. No mentioning of giving up material, but may be part of it as long as it remains equalish; no payment, sorry. Apart from that, you got it though, and thanks for the term *critical*. Will throw on my googling and possibly rephrase.
Comments.UserDisplayName: Peter Fischer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-15T11:24:25.990Z
Comments.Text: We are talking about opening lines, that means this line is equal or close to equal, it is difficult to create critical positions from near to equal positions in fact your opponent can also try to bring you to thermopylaes state. The only way to do this is to give up or sacrifice material or position and in return you will get an initiative to bring/test your opponent into critical positions.
Comments.UserDisplayName: ferdy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-15T15:11:29.270Z
Comments.Text: Removed obv. misleading opening tag. Starting *from* tabiae, we are not talking about opening lines. - Opponent bringing us to thermopylae state is fine, since we are preparing lines found this way. - No, we are not necessarily talking about trading material for initiative; the topic is broader, see ex. 2, which is even far away from its tabia. See also my last reply. Anyway, I'm looking for a way to have a software spit out lines that feature narrow paths for one side when we steer into them.
Comments.UserDisplayName: Peter Fischer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-15T15:30:07.087Z
Comments.Text: If it helps, the standard chess jargon for what you're calling a Thermopylae is "only move".  The pgn representation for an only move is a hollow box □
Comments.UserDisplayName: Andrew
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-15T16:03:18.920Z
Comments.Text: Thanks! The box helped to stumble upon NAG, where apparently NAG 8 stands for "singular move (no reasonable alternatives)". On that base could find a piece of stockfish code that I'll have to test. Ty @Andrew
Comments.UserDisplayName: Peter Fischer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-16T22:05:17.240Z
Comments.Text: @PeterFischer Doesn't koedem's answer satisfy you? Just compare the top move eval to the 2nd best move's eval and set a threshold for what constitutes a 'blunder'.
Comments.UserDisplayName: Mobeus Zoom
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-16T22:35:24.530Z
Comments.Text: No it doesn't, and it's a mere comment. If "trivial to write a search...", and " just compare", then please provide; maybe I shouldn't have removed the expectation that I ask to be provided with a step-by-step tutorial of such a search. Also, the dice rolling part is a mistery. Sorry, no kudos. Can you @MobeusZoom provide for a threshold of 2nd best move being more than say 0.75 worse than the thermophylae?
Comments.UserDisplayName: Peter Fischer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-17T20:23:44.597Z
Comments.Text: If an algorithm doesn't satisfy you and you need code, then ask on StackOverflow.
Comments.UserDisplayName: Mobeus Zoom
Tags: <engines><endgame><tactics><middlegame>
Title: How to find 'Thermopylaes' with engines?
ThreadText: # How to find 'Thermopylaes' with engines?
  
  (Asked by: username_0 on 2022-06-11)
  
  Motivation
  “You must take your opponent into a deep dark forest where 2+2=5, and the path leading out is only wide enough for one." – Michail Tal
  I am looking for ways to systematically find lines where one player is forced to find series of precise moves.
  Background
  The battle of Thermopylae was fought in 480 BC between the Achaemenid Persian Empire under Xerxes I. and an alliance of Greek city-states led by Sparta under Leonidas I.
  During two full days of battle, the small force led by Leonidas blocked the only road by which the massive Persian army could traverse the narrow pass.
  The performance of the Greek defenders is well known as an example of the advantages of training, equipment, and use of terrain as force multipliers.
  Glossar
  In chess, I consider a 'thermopylae' to be an only-move that must be found by ones opponent in order to not blunder away their game. Similar to the historic example, it is a narrow pass, an only road, and when studied and prepared at home, it gives rise to a possible advantage through training, equipment, and use of terrain. (You get the point...)
  Example 1
  Consider the equal position given below where Qd1 is a thermopylae from blacks view since both Qd2 and Qd3 (and every other move of course) lead to a significant advantage for black.
  [fen "rqr3k1/3n1ppp/bp2pb2/1N1p4/PP1Q1P2/2P1BR2/4B1PP/R5K1 w - - 0 1"]
  
  Example 2
  In the equal position below, white needs to find Be4 to not blunder away the game. If this is found, the game 'widens' after Ke6, but remains 'narrow' after Nb4, asking again for precise moves from white.
  [fen "r4r2/5k2/3p4/2pn4/2R5/p7/2B2PPP/1R4K1 w - - 0 35"]
  
  Question
  Is there a way to (have engines) systematically go through tabiae (the ends of opening lines) and extract lines that lead to such thermopylaes, possibly a multitude of these down a certain line? (I understand this will include a number of trivial recaptures and forced moves, but I'll go with that.)
  
  **Tags:** engines, endgame, tactics, middlegame
  
  > **Comments:**
  > **username_0**: I'd appreciate an explanation to why the down-vote - it could help me improve later questions in general, and this one in particular.  
  > **username_1**: What's the quote? A decreasing amount of moves is a sign of a deteriorating position. If your opponent doesn't have good moves left, then they only have bad moves. In the opening, this doesn't happen because both players have a variety of options.  
  > **username_1**: @RewanDemontay Oh, I was pointing out a quote by someone else. Maybe it was Nimzowitsch or Lasker.  
  > **username_2**: I downvote also because your example, in comparison with what Tal was talking about, is trivial and makes it quite clear, I regret to say, that you have little idea how chess is played at a level higher than elementary. You seem to believe that you have discovered a new strategic concept but you have not, and your attempt to dress it in  intellectual flummery is distasteful. i am being plainspoken only because you did ask for clarification..  
  > **username_0**: I am directing this question to people with an outspokenly good understanding of programming, not chess itself. The Tal quote is accurate, think about it a tad more! 'Wide' for a multitude of ways how to handle a position and 'narrow' for only-moves may be unfamiliar terms, yet fully on point; am sorry if this doesn't come across. - Question remains: how to give counts for the number of equalish continuations and so how to extract those tabiae that feature many, even consecutive 'narrow' paths.  
  > **username_0**: Also, username_1es comment seems pretty newbish; there is much more flesh to this bone than simply: shows detoriating position. That's plain wrong, and the part 'if no good move for opponent, then only bad moves' is trivial to the point I didn't even consider a reply, figuring people would be smarter than that. - I admit the example can be improved, and fine, going to reword if reall necessary, but for now claim that people with a more than 'elementary' understanding of chess will come to my rescue.  
  > **username_0**: If this makes things clearer, think about it as another number next to a move, similar to the current eval or the time spent on the move, s.a. "Qd1, 0.00 eval, 0:45 move time, 0 alternatives that aren't blunders". I am looking for strings where one side (lets call him Tal...) can lead the game into and down a line that features many such '0 alternative moves that don't blunder away the game'.  
  > **username_0**: Made an edit to the question, added another, much less trivial example, and cut the expectation part to open the question to a wider public.  
  > **username_3**: You can of course simply solve this with a specific search that looks for this, e.g. it would be trivial to write a search that compares the top move in each PV position with the second best move, then you'd only need some way to put that into objective values.  However, I do want to point out a fun different approach: randomness in the evaluations. If you add a random term even just to the final leaf evaluations of a search tree, you inherently incentivize each player to minimize the number of good options for their opponent because that reduces their number of chances for a good dice roll.  
  > **username_4**: Doesn't basically any tactics quiz provide an answer to this question?  
  > **username_5**: On `go through tabiae (the ends of opening lines) and extract lines that lead to such thermopylaes` so you have an opening line of say 10 plies, you want to find a continuation line such that your opponent will be brought to a series of positions where there is only one playable move (critical position). And in doing so you are willing to give up a pawn or two worth of evaluation or even a whole piece just to bring your opponent into a series of thermopylae states. If the opponent happens to find all the best moves, you will lose the game - the payment.  
  > **username_0**: You missed the point of there need being equal-ish positions to start from and end up in; see definition. Consider this a preparation issue. No mentioning of giving up material, but may be part of it as long as it remains equalish; no payment, sorry. Apart from that, you got it though, and thanks for the term *critical*. Will throw on my googling and possibly rephrase.  
  > **username_5**: We are talking about opening lines, that means this line is equal or close to equal, it is difficult to create critical positions from near to equal positions in fact your opponent can also try to bring you to thermopylaes state. The only way to do this is to give up or sacrifice material or position and in return you will get an initiative to bring/test your opponent into critical positions.  
  > **username_0**: Removed obv. misleading opening tag. Starting *from* tabiae, we are not talking about opening lines. - Opponent bringing us to thermopylae state is fine, since we are preparing lines found this way. - No, we are not necessarily talking about trading material for initiative; the topic is broader, see ex. 2, which is even far away from its tabia. See also my last reply. Anyway, I'm looking for a way to have a software spit out lines that feature narrow paths for one side when we steer into them.  
  > **username_6**: If it helps, the standard chess jargon for what you're calling a Thermopylae is "only move".  The pgn representation for an only move is a hollow box □  
  > **username_0**: Thanks! The box helped to stumble upon NAG, where apparently NAG 8 stands for "singular move (no reasonable alternatives)". On that base could find a piece of stockfish code that I'll have to test. Ty @username_6  
  > **username_7**: @PeterFischer Doesn't username_3's answer satisfy you? Just compare the top move eval to the 2nd best move's eval and set a threshold for what constitutes a 'blunder'.  
  > **username_0**: No it doesn't, and it's a mere comment. If "trivial to write a search...", and " just compare", then please provide; maybe I shouldn't have removed the expectation that I ask to be provided with a step-by-step tutorial of such a search. Also, the dice rolling part is a mistery. Sorry, no kudos. Can you @MobeusZoom provide for a threshold of 2nd best move being more than say 0.75 worse than the thermophylae?  
  > **username_7**: If an algorithm doesn't satisfy you and you need code, then ask on StackOverflow.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_8 on 2022-06-16. Score: 1
  
  Your concept of "Thermopylae" is just what chess player call a "forced move". The problem is, smost forced moves are trivial (for example, recaptures or moving out of check), while others can be hard to find. The number of alternatives does not always determine the difficulty of a position.
  
  Engines are not designed to estimate how hard to find a move is for a human. You could certainly try to tweak the evaluation function so that lines containing lots of forced moves get a bonus, but this doesn't mean the new engine will be harder to play against. Rather, it'd be an engine that likes playing some sort of "hope chess".
  
  As username_4 suggests on his comment, every puzzle collection is a collection of "Thermopylae", so sites like Lichess that generate puzzle based on games played by their users are certainly doing a scan of this sort.
  
  Still, the vast majority of those puzzles are terribly easy, so it looks like this method wouldn't be particularly useful for opening preparation, specially if we take into account that current opening theory will hardly ever end right before a hard-to-find forced move. After all, who would have a line on his repertoire that requires him to find an outstanding move on the spot or else get a lost position?
  
  > **Comments:**
  > **username_7**: "Still, the vast majority of those puzzles are terribly easy" - not at all. There are puzzles on these sites that can stump some of the best tactical players in the world (e.g. Nakamura, on Chess.com) for near-on hours, even though they know it's a puzzle. Pose a series of those, midgame, and you'll almost surely win. It's a highly non-trivial question, though where I agree with you is that creating forcing positions and positions which are forcing & difficult are not the same.  
  > **username_0**: See also: "(I understand this will include a number of trivial recaptures... but I'll go with that.)". Not the answer I am looking for.  
  > **username_8**: @MobeusZoom That's why I said "the vast majority" and not "every single one". If you pick a lichess puzzle at random, there is a very little chance of it being one of those that makes Nakamura struggle. The reason why you can get a collection of hard puzzles is that there are thousands of humans playing the puzzles over and over again to determine their difficulty. That does not apply to this question.  
  > **username_8**: @PeterFischer If you don't mind having a 99.9%+ of trivial moves, then yes. That way exists.  
  
  ---
  
  