kriegspiel jason wolfe. shall i fire on them now, sir? not yet kif; in the game of chess, you can...

58
Kriegspiel Kriegspiel Jason Wolfe Jason Wolfe

Upload: jacob-clark

Post on 28-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

KriegspielKriegspiel

Jason WolfeJason Wolfe

Page 2: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Shall I fire on them now, sir?

Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Page 3: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

OutlineOutline

IntroductionIntroduction Rules of KriegspielRules of Kriegspiel Our ProblemOur Problem Sample Kriegspiel Mating ProblemSample Kriegspiel Mating Problem

Data Structures and AlgorithmsData Structures and Algorithms Exact Belief StateExact Belief State Exact Mating AlgorithmExact Mating Algorithm Efficient Belief State ImplementationsEfficient Belief State Implementations

Page 4: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Rules of KriegspielRules of Kriegspiel

Same initial board, movement and mating Same initial board, movement and mating rules as ordinary chessrules as ordinary chess

Difference: we can’t see our opponent’s Difference: we can’t see our opponent’s pieces, and we only know the pieces, and we only know the consequences (capture, check) of our consequences (capture, check) of our opponent’s movesopponent’s moves Playing Kriegspiel requires three chess Playing Kriegspiel requires three chess

boards and a referee (or online play)boards and a referee (or online play)

Page 5: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

More RulesMore Rules

Since players have limited knowledge of their opponents’ Since players have limited knowledge of their opponents’ pieces, they don’t know in advance which chess moves pieces, they don’t know in advance which chess moves will be legalwill be legal

Possibly-legal moves can be illegal iff they are obstructed by one Possibly-legal moves can be illegal iff they are obstructed by one of the opponent’s pieces, or leave the player in checkof the opponent’s pieces, or leave the player in check

On his turn, a player keeps attempting possibly-legal moves until On his turn, a player keeps attempting possibly-legal moves until one is accepted as legal; this becomes his actual move for the one is accepted as legal; this becomes his actual move for the turnturn

Thus, a “turn plan” in Kriegspiel is a (truncated) permutation of Thus, a “turn plan” in Kriegspiel is a (truncated) permutation of the possibly-legal movesthe possibly-legal moves

Stalemate rules (position 3-peat and 50-moves) Stalemate rules (position 3-peat and 50-moves) suspended because position includes knowledge about suspended because position includes knowledge about opponent’s piecesopponent’s pieces

Page 6: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

More RulesMore Rules

The referee is the only source of information about the The referee is the only source of information about the opponent’s pieces.opponent’s pieces.For each attempted move, he announces “Yes”, “No”, or For each attempted move, he announces “Yes”, “No”, or “Impossible”“Impossible”For captures, he announces the square at which capture For captures, he announces the square at which capture occurred (but does not disclose the identity of either occurred (but does not disclose the identity of either piece)piece)For checks, he announces check and the direction of For checks, he announces check and the direction of check (row, column, long diagonal, short diagonal, or check (row, column, long diagonal, short diagonal, or knight)knight)Checkmates and stalemates are announced, and the full Checkmates and stalemates are announced, and the full board position is revealed to both playersboard position is revealed to both players

Page 7: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Basic StrategyBasic Strategy

While the general objective is the same as While the general objective is the same as chess (capture the opponent’s pieces and chess (capture the opponent’s pieces and corner his king), uncertainty introduces corner his king), uncertainty introduces several subsidiary objectivesseveral subsidiary objectives Gathering information about the opponent’s Gathering information about the opponent’s

piecespieces Hiding one’s own pieces from the opponentHiding one’s own pieces from the opponent

Page 8: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

More Basic StrategyMore Basic Strategy

The effects of these factors can be seen even in The effects of these factors can be seen even in the first few moves of a real Kriegspiel gamethe first few moves of a real Kriegspiel game Less typical openings may be desirable, because they Less typical openings may be desirable, because they

may not be anticipatedmay not be anticipated Power pieces should always be protected if possiblePower pieces should always be protected if possible In general, all possible pawn captures should be In general, all possible pawn captures should be

attempted before trying other movesattempted before trying other movesThus, we should be careful playing power pieces around Thus, we should be careful playing power pieces around probable locations of opponent’s pawnsprobable locations of opponent’s pawnsMany variants include an ‘Any’ rule to speed up gameplayMany variants include an ‘Any’ rule to speed up gameplay

Special care needs to be taken to protect against Special care needs to be taken to protect against short mates such as Fool’s mate. short mates such as Fool’s mate.

Page 9: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Specifics of Our ProblemSpecifics of Our Problem

Specifically, we will be given a move history for Specifically, we will be given a move history for whichwhich White has 5 pieces on the boardWhite has 5 pieces on the board Black has 2 pieces on the boardBlack has 2 pieces on the board It is White’s turn to move, and given the move history It is White’s turn to move, and given the move history

a certain checkmate exists within 2.5 movesa certain checkmate exists within 2.5 moves

Our problem is to discover a conditional move Our problem is to discover a conditional move plan that is certain checkmateplan that is certain checkmate This talk is focused on the goal of locating certain This talk is focused on the goal of locating certain

checkmate. This approach differs significantly from checkmate. This approach differs significantly from that for locating probable checkmates.that for locating probable checkmates.

Page 10: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

More SpecificsMore Specifics

Our problem is not as complicated as ordinary Our problem is not as complicated as ordinary KriegspielKriegspiel We are concerned with certain checkmates, which We are concerned with certain checkmates, which

guarantee checkmate regardless of how our opponent guarantee checkmate regardless of how our opponent playsplays

Because we don’t need to take probability into Because we don’t need to take probability into account, we don’t need to consider our opponent’s account, we don’t need to consider our opponent’s strategystrategy

This means that (at least for fixed-depth mates) we This means that (at least for fixed-depth mates) we can assume that the opponent can see our pieces can assume that the opponent can see our pieces (but not visa-versa)(but not visa-versa)

Page 11: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Two ProblemsTwo Problems

1.1. Discover (approximate) the current belief Discover (approximate) the current belief state given the move historystate given the move history

2.2. Search the game tree for certain Search the game tree for certain checkmate, given the belief state checkmate, given the belief state calculated in (1)calculated in (1)

Page 12: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Example Kriegspiel CheckmateExample Kriegspiel Checkmate

White to move and mate within 1.5 moves. Given the move history to this point, Black’s pieces are known to be in one of the above three possible positions.

Page 13: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

White’s Move

Checkmate No

Try Qb8

Page 14: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Yes Knight Check

White’s Move

Try Ne7

Checkmate

Page 15: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Black’s Move Black’s Move

YesYes

Opponent’s move(s)

Page 16: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

White’s MoveWhite’s Move

CheckmateCheckmate

Mate with Qh2 Mate with Qf8

Page 17: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Opponent’s move(s)

Initial Belief State

Check-mate

No

Try Qb8

Knight Check

Try NeE7Yes

YesYes

Mate with Qh2 Mate with Qf8 Check-mate

Checkmate

Page 18: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Basic Kriegspiel MatesBasic Kriegspiel Mates

In ordinary chess, a king and rook or greater can In ordinary chess, a king and rook or greater can always checkmate a lone king.always checkmate a lone king.

Interestingly, the same elementary mates are Interestingly, the same elementary mates are possible in Kriegspielpossible in Kriegspiel

Two elementary mates require randomizationTwo elementary mates require randomization King, bishop, and knight vs. king has a certain mate, King, bishop, and knight vs. king has a certain mate,

but requires a possibly infinite number of movesbut requires a possibly infinite number of moves King and two bishops vs king has an epsilon-mateKing and two bishops vs king has an epsilon-mate

Page 19: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces
Page 20: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Kriegspiel Data Structures Kriegspiel Data Structures and Algorithmsand Algorithms

Page 21: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Belief StatesBelief States

The primary difference between Kriegspiel The primary difference between Kriegspiel and chess is that in Kriegspiel, players and chess is that in Kriegspiel, players must maintain a belief state of possible must maintain a belief state of possible positions the opponent could be inpositions the opponent could be in

The simplest belief state representation is The simplest belief state representation is a list of possible board positionsa list of possible board positions In a real Kriegspiel game, a belief state is a In a real Kriegspiel game, a belief state is a

possibility distribution rather than a listpossibility distribution rather than a list

Page 22: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Exact Belief StateExact Belief State

Operations on an exact belief state are simpleOperations on an exact belief state are simple The initial state is simply the initial board positionThe initial state is simply the initial board position When a player makes a move, he prunes positions from the When a player makes a move, he prunes positions from the

belief state that are inconsistent with the referee’s responsebelief state that are inconsistent with the referee’s response For the opponent’s move, the belief state expands to the union For the opponent’s move, the belief state expands to the union

of the successors of its component states, and is then pruned of the successors of its component states, and is then pruned based on the referee’s responsebased on the referee’s response

When an exact belief state is split based on possible When an exact belief state is split based on possible referee responses, the sum of the cardinality of the referee responses, the sum of the cardinality of the component belief states equals the cardinality of the component belief states equals the cardinality of the original state (perfect information)original state (perfect information)However, this representation is intractable since a real However, this representation is intractable since a real belief state could easily contain more than 10belief state could easily contain more than 101010 possible possible positionspositions

Page 23: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Exact Mating AlgorithmExact Mating Algorithm

The exact belief state precisely captures The exact belief state precisely captures what positions the opponent could be in, what positions the opponent could be in, given some move historygiven some move history

The other part of the problem is mating The other part of the problem is mating search, given such a belief statesearch, given such a belief state As we will see, this problem also has a As we will see, this problem also has a

relatively simple exact solutionrelatively simple exact solution

Page 24: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Exact Mating Algorithm (cont.)Exact Mating Algorithm (cont.)

The Kriegspiel exact mating algorithmThe Kriegspiel exact mating algorithm

1.1. Branch (OR) over possible turn plans, looking for a certain Branch (OR) over possible turn plans, looking for a certain checkmatecheckmate

2.2. Branch (AND) over possible referee responses, fragmenting the Branch (AND) over possible referee responses, fragmenting the belief statebelief state

3.3. If a sub-belief state contains stalemate, it is a loss. If it contains If a sub-belief state contains stalemate, it is a loss. If it contains only checkmated positions, it is a win. Otherwise, if we are not yet only checkmated positions, it is a win. Otherwise, if we are not yet at the maximum search depth, prune terminal positions from the at the maximum search depth, prune terminal positions from the belief state and continue searchbelief state and continue search

4.4. Set the belief state to the union of its successor positions Set the belief state to the union of its successor positions (simulating the opponent’s move)(simulating the opponent’s move)

5.5. Branch (AND) over possible referee responses, fragmenting the Branch (AND) over possible referee responses, fragmenting the now-expanded belief statenow-expanded belief state

6.6. If a sub-belief state contains checkmate or stalemate, it is a loss. If a sub-belief state contains checkmate or stalemate, it is a loss. Otherwise, go to step 1Otherwise, go to step 1

Page 25: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Game Game TreeTree

Opponent’s move(s)

Initial Belief State

Check-mate

No

Try Qb8

Knight Check

Try Ne7Yes

YesYes

Mate with Qh2 Mate with Qf8 Check-mate

Checkmate

Page 26: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Exact Mating Algorithm (cont.)Exact Mating Algorithm (cont.)

This search has three major branch pointsThis search has three major branch points Choosing a “turn plan”, a truncated permutation of the Choosing a “turn plan”, a truncated permutation of the

possibly-legal moves possibly-legal moves The referee’s response to the legal moveThe referee’s response to the legal move The referee’s response to the opponent’s moveThe referee’s response to the opponent’s move

Since we may choose our turn plan but not the Since we may choose our turn plan but not the referee’s responses, the first branch is an OR-referee’s responses, the first branch is an OR-search and the other two are AND-searches.search and the other two are AND-searches.We do not have to explicitly branch based on the We do not have to explicitly branch based on the opponent’s move, since this branching occurs opponent’s move, since this branching occurs within the belief statewithin the belief state

Page 27: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

An Initial ProblemAn Initial Problem

With 5 pieces at an average of 10 possible With 5 pieces at an average of 10 possible moves each, the first branching factor moves each, the first branching factor could be on the order of 10could be on the order of 103030 possible turn possible turn plans to checkplans to check If we know a move is illegal, it prunes our If we know a move is illegal, it prunes our

belief state; therefore, it seems that we must belief state; therefore, it seems that we must check all permutationscheck all permutations

Page 28: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

The SolutionThe Solution

We are not just looking for the turn plan We are not just looking for the turn plan with maximum utilitywith maximum utility any turn plan with utility less than 1 is any turn plan with utility less than 1 is

unacceptableunacceptable

If a “turn plan” contains a move which, if If a “turn plan” contains a move which, if accepted, is not certain checkmate, it will accepted, is not certain checkmate, it will not have utility 1not have utility 1

Page 29: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

The Solution (cont.)The Solution (cont.)

This suggests the following simple algorithm for This suggests the following simple algorithm for choosing a turn plan, which has a branching choosing a turn plan, which has a branching factor of only mfactor of only m22 rather than m! : rather than m! : Start with an empty move plan and some belief state Start with an empty move plan and some belief state

BSBS Loop until BS does not change (failure) or is empty Loop until BS does not change (failure) or is empty

(success)(success)Loop through possible movesLoop through possible moves

If the move is certain checkmate if accepted, add it to the move If the move is certain checkmate if accepted, add it to the move plan and prune its acceptance set from BSplan and prune its acceptance set from BS

Page 30: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Branching FactorsBranching Factors

1.1. Optimistically, with 50 possible moves Optimistically, with 50 possible moves this branching factor might be as small this branching factor might be as small as 100as 100

2.2. There are 2-10 possible referee There are 2-10 possible referee responses for our moveresponses for our move

3.3. There are 1-200 possible responses for There are 1-200 possible responses for our opponent’s moveour opponent’s move

Page 31: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Heuristic improvementsHeuristic improvements

The first stage can be improved by The first stage can be improved by heuristic move orderingheuristic move ordering Sizes of move’s acceptance setsSizes of move’s acceptance sets Heuristic likelihood move will cause mateHeuristic likelihood move will cause mate

The second and third (AND) searches can The second and third (AND) searches can be improved with heuristic state orderingbe improved with heuristic state ordering Larger belief states are less likely to be Larger belief states are less likely to be

certain checkmatecertain checkmate

Page 32: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Current StatusCurrent Status

My current Kriegspiel code, which utilizes My current Kriegspiel code, which utilizes the tools described so far, can solve the the tools described so far, can solve the “example mate” in under a minute“example mate” in under a minute

Page 33: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Another ImprovementAnother Improvement

If a belief state admits a state that is not If a belief state admits a state that is not checkmate in ordinary chess within the checkmate in ordinary chess within the necessary depth, it does not admit certain necessary depth, it does not admit certain Kriegspiel checkmateKriegspiel checkmateThus, a good tactic might be to sample a Thus, a good tactic might be to sample a few positions (heuristically) before running few positions (heuristically) before running the tree search on the full belief statethe tree search on the full belief state mating search in ordinary chess has mating search in ordinary chess has

significantly lower branching factors and significantly lower branching factors and amount of work per operationamount of work per operation

Page 34: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Efficient Belief StatesEfficient Belief States

With the exception of further heuristic With the exception of further heuristic improvement and sampling techniques, improvement and sampling techniques, the mating algorithm is essentially finishedthe mating algorithm is essentially finishedThe simple belief state representation, on The simple belief state representation, on the other hand, is not tractable for real the other hand, is not tractable for real Kriegspiel problemsKriegspiel problemsThus, what we need to do now is develop Thus, what we need to do now is develop a compact, accurate, and fast belief state a compact, accurate, and fast belief state implementation implementation

Page 35: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Belief State MethodsBelief State Methods

For mating search, the belief state needs to For mating search, the belief state needs to support the following four basic methods:support the following four basic methods: Make a specific move for player, and fragment the Make a specific move for player, and fragment the

belief state based on the referee’s possible responsesbelief state based on the referee’s possible responses Make all possible moves for opponent, and fragment Make all possible moves for opponent, and fragment

the belief state based on the referee’s possible the belief state based on the referee’s possible responsesresponses

Test whether a belief state with player-to-move Test whether a belief state with player-to-move contains any checkmate or stalemate positionscontains any checkmate or stalemate positions

Test whether a belief state with opponent-to-move Test whether a belief state with opponent-to-move contains any stalemate positions or all checkmate contains any stalemate positions or all checkmate positions; if neither, prune checkmate positionspositions; if neither, prune checkmate positions

Page 36: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Unary MarginalsUnary Marginals

For move generation and (especially) terminal For move generation and (especially) terminal testing, a positional representation of the belief testing, a positional representation of the belief state is necessarystate is necessaryHowever, the exact positional representation is However, the exact positional representation is intractably largeintractably largeA first compromise is to store only the “unary A first compromise is to store only the “unary marginals”, the sets of possible board positions marginals”, the sets of possible board positions (including off-the-board) that each of the (including off-the-board) that each of the opponent’s pieces could possibly occupyopponent’s pieces could possibly occupy This approximation allows for a sound, but not This approximation allows for a sound, but not

complete, algorithm for discovering certain checkmatecomplete, algorithm for discovering certain checkmate

Page 37: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Exact Belief StateExact Belief State

Exact Belief State

Page 38: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Unary Marginal Belief StateUnary Marginal Belief State

Page 39: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Example (cont.)Example (cont.)

The unary marginal approximation to the The unary marginal approximation to the exact belief state admits 11 positionsexact belief state admits 11 positions Of these, only the original 3 positions are Of these, only the original 3 positions are

ordinary-chess checkmates!ordinary-chess checkmates!

Even if Even if allall the “decoy” states the “decoy” states werewere ordinary-chess checkmates, there might ordinary-chess checkmates, there might be no Kriegspiel checkmate given this be no Kriegspiel checkmate given this belief statebelief state

Page 40: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Unary Marginal CharacteristicsUnary Marginal Characteristics

Storing the unary marginal belief state requires only 16 * Storing the unary marginal belief state requires only 16 * 65 = 1040 bits65 = 1040 bitsMove generation for us (White) is simple, because we Move generation for us (White) is simple, because we know the positions of our own pieces exactlyknow the positions of our own pieces exactlyMove generation for Black can also be done in constant Move generation for Black can also be done in constant timetime

But, the belief state will mix quickly. Pieces will only block others But, the belief state will mix quickly. Pieces will only block others if their positions are known certainlyif their positions are known certainly

In general, when we split the belief state based on the In general, when we split the belief state based on the referee’s response, the sum of the sizes of the referee’s response, the sum of the sizes of the component belief states will be larger than the size of the component belief states will be larger than the size of the original belief sate (imperfect information)original belief sate (imperfect information)

Page 41: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Information in KriegspielInformation in Kriegspiel

In Kriegspiel, the only way we can learn about In Kriegspiel, the only way we can learn about the opponent's pieces is through the referee’s the opponent's pieces is through the referee’s responses (bolstered by our knowledge of the responses (bolstered by our knowledge of the rules of the game and the locations of our own rules of the game and the locations of our own pieces)pieces)

Thus, before proceeding, we should analyze Thus, before proceeding, we should analyze exactly what kinds of information we get from the exactly what kinds of information we get from the referee, and see how the unary marginal belief referee, and see how the unary marginal belief state can handle these kinds of informationstate can handle these kinds of information

Page 42: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Information in KriegspielInformation in Kriegspiel

What kinds of information can we get from the What kinds of information can we get from the referee? Our opponent ...referee? Our opponent ... has/does not have some specific piece at some has/does not have some specific piece at some

specific locationspecific location has/had a (unspecified) piece at a specific locationhas/had a (unspecified) piece at a specific location has at least one (unspecified) piece at some range of has at least one (unspecified) piece at some range of

locationslocations has a piece attacking a specific space (sometimes has a piece attacking a specific space (sometimes

from a specific direction)from a specific direction) has no unblocked piece attacking a specific spacehas no unblocked piece attacking a specific space

Page 43: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Information in KriegspielInformation in Kriegspiel

Only the first of the five types of Only the first of the five types of information can be captured by unary information can be captured by unary marginalsmarginals

Thus, if possible we would like to amend Thus, if possible we would like to amend this representation to capture a higher this representation to capture a higher proportion of the informationproportion of the information

Page 44: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Amending the Belief StateAmending the Belief State

The unary marginals store 16 bits for each square (incl. The unary marginals store 16 bits for each square (incl. off-the-board)off-the-board)

Each bit stores whether a specific piece of Black’s could possibly Each bit stores whether a specific piece of Black’s could possibly be at this positionbe at this position

As a very simple refinement, simply store more bits per As a very simple refinement, simply store more bits per square to try to capture more informationsquare to try to capture more information

A single bit can store whether or not a square is certainly A single bit can store whether or not a square is certainly occupiedoccupied

Two more bits let us store whether a square is Two more bits let us store whether a square is certainly/possibly/impossibly attacked by an opponent’s piececertainly/possibly/impossibly attacked by an opponent’s piece

Six more bits let us store whether a square is certainly occupied Six more bits let us store whether a square is certainly occupied by an opponent’s piece that attacks in a certain direction by an opponent’s piece that attacks in a certain direction (row/column or diagonal), or by a specific type of piece (knight, (row/column or diagonal), or by a specific type of piece (knight, pawn, bishop, or rook)pawn, bishop, or rook)

Page 45: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Amended Belief StateAmended Belief State

With the additions from the previous slide, With the additions from the previous slide, the belief state can capture all butthe belief state can capture all but has at least one (unspecified) piece at some has at least one (unspecified) piece at some

range of locationsrange of locations

While the extra information will be useful in While the extra information will be useful in immediate reasoning, it is fairly transientimmediate reasoning, it is fairly transient

Page 46: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Another RefinementAnother Refinement

The unary marginals store, for each piece, what squares The unary marginals store, for each piece, what squares it could possibly occupyit could possibly occupyThis concept can be extended to the “binary marginals” This concept can be extended to the “binary marginals” by storing, for each pair of pieces, what pairs of squares by storing, for each pair of pieces, what pairs of squares they could possibly occupythey could possibly occupyAmong other things, this allows us to capture when Among other things, this allows us to capture when Black’s pieces block one-anotherBlack’s pieces block one-anotherHowever, this representation requires (65*16)However, this representation requires (65*16)22 bits to bits to store, and still ignores many basic constraintsstore, and still ignores many basic constraintsThis can be extended up to 16-ary marginals, which are This can be extended up to 16-ary marginals, which are identical to the exact belief state.identical to the exact belief state.

Page 47: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Some ProblemsSome Problems

Although they seem like a reasonable approach, Although they seem like a reasonable approach, the “n-ary marginal belief states” are far from the “n-ary marginal belief states” are far from perfect: They admit …perfect: They admit … Illegal board positionsIllegal board positions Inconsistent positions (multiple pieces per square)Inconsistent positions (multiple pieces per square) Positions where the opponent has the incorrect Positions where the opponent has the incorrect

number of piecesnumber of pieces Positions where the opponent has made no moves at Positions where the opponent has made no moves at

all, or all possible moves simultaneouslyall, or all possible moves simultaneously

Page 48: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Implementation of Unary MarginalsImplementation of Unary Marginals

Currently, I am in the process of Currently, I am in the process of implementing the unary marginal belief implementing the unary marginal belief statestate Move generation and pruning based on the Move generation and pruning based on the

referee’s response can be accomplished fairly referee’s response can be accomplished fairly simply (with limited accuracy)simply (with limited accuracy)

We only need to look at the possible locations of We only need to look at the possible locations of one or two pieces at a timeone or two pieces at a time

Unfortunately, this does not seem to be true Unfortunately, this does not seem to be true of terminal testof terminal test

Page 49: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Terminal Test IssuesTerminal Test Issues

We are searching for certain checkmateWe are searching for certain checkmate

Thus, if the belief state at any point contains a Thus, if the belief state at any point contains a stalemate position, we failstalemate position, we fail

However, detecting stalemate from unary However, detecting stalemate from unary marginals is difficultmarginals is difficult Stalemate typically depends on the locations of all the Stalemate typically depends on the locations of all the

pieces on the boardpieces on the board No algorithm (that I can think of) can exactly detect No algorithm (that I can think of) can exactly detect

stalemate positions in a marginal belief state, without stalemate positions in a marginal belief state, without fully enumerating at least some of its positionsfully enumerating at least some of its positions

Page 50: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Proposed ImplementationProposed Implementation

The best implementation I can come up The best implementation I can come up with for terminal test is a depth first search with for terminal test is a depth first search on possible positions admitted by the on possible positions admitted by the belief statebelief state

With some intelligent pruning and ordering With some intelligent pruning and ordering techniques, this will hopefully be tractable techniques, this will hopefully be tractable for belief states of moderate size.for belief states of moderate size.

Page 51: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Illustrating the ApproachIllustrating the Approach

Implementing the terminal test method Implementing the terminal test method requires four sub-algorithmsrequires four sub-algorithmsI will illustrate the approach using the I will illustrate the approach using the problem of discovering stalemate with problem of discovering stalemate with Black to moveBlack to moveThis approach has two steps:This approach has two steps: Fix the board so that Black cannot be in checkFix the board so that Black cannot be in check Search for mate (a position with no legal Search for mate (a position with no legal

moves) within this board positionmoves) within this board position

Page 52: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Step 1Step 1

For each square the Black king could be For each square the Black king could be placed placed notnot in check, AND in check, ANDFor each pair of squares that the Black For each pair of squares that the Black king could be placed in check and another king could be placed in check and another Black piece could be placed to block this Black piece could be placed to block this check,check, Fix these pieces at the chosen locationsFix these pieces at the chosen locations Do a depth first search on this modified belief Do a depth first search on this modified belief

state for positions with no legal moves. If state for positions with no legal moves. If such a position is found, return true.such a position is found, return true.

Page 53: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Step 2Step 2

In the depth first search for positions with no In the depth first search for positions with no legal moves, we fix the position of one piece at legal moves, we fix the position of one piece at each brancheach branch

For a position to be stalemate, all of Black’s For a position to be stalemate, all of Black’s possible moves must either bepossible moves must either be

Blocked by other Black piecesBlocked by other Black pieces

Blocked by one of White’s pieces (Black’s pawns only)Blocked by one of White’s pieces (Black’s pawns only)

King moves that place Black’s King in checkKing moves that place Black’s King in check

Other moves that uncover check against Black’s KingOther moves that uncover check against Black’s King

Page 54: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

PruningPruning

Consider some partial placement of Black's Consider some partial placement of Black's pieces that contains legal moves for Black. pieces that contains legal moves for Black. Since White's positions are already known, the only Since White's positions are already known, the only

way we can produce a stalemate is by placing more way we can produce a stalemate is by placing more of Black's pieces where they block the currently of Black's pieces where they block the currently possible moves by Black (and fail to create more possible moves by Black (and fail to create more possible moves). possible moves).

Thus, for any partial placement of Black's pieces, we Thus, for any partial placement of Black's pieces, we can count the minimum number of other Black pieces can count the minimum number of other Black pieces that must be placed to make this a stalemate; call this that must be placed to make this a stalemate; call this number P (as a first approximation, we can pretend number P (as a first approximation, we can pretend that placing a piece will not create any new legal that placing a piece will not create any new legal moves). moves).

Page 55: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

PruningPruning

Then, the pruning itself is actually very simple: If Then, the pruning itself is actually very simple: If Black has fewer pieces left to be placed on the Black has fewer pieces left to be placed on the board than P, prune away this branch. One can board than P, prune away this branch. One can imagine that this will be very common, especially imagine that this will be very common, especially if high-mobility pieces like the knight are placed if high-mobility pieces like the knight are placed first. first.

This pruning also suggests a simple position This pruning also suggests a simple position ordering; try positions that have the lowest P ordering; try positions that have the lowest P first, because these are closest to mate.first, because these are closest to mate.

Page 56: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

EvaluationEvaluation

The other three terminal test sub-methods differ The other three terminal test sub-methods differ significantly, but follow the same general approachsignificantly, but follow the same general approachThis approach allows for re-incorporating the lost This approach allows for re-incorporating the lost constraints discussed earlier, efficiently pruning:constraints discussed earlier, efficiently pruning:

Inconsistent positions (multiple pieces per square)Inconsistent positions (multiple pieces per square) Positions where the opponent has the incorrect number of Positions where the opponent has the incorrect number of

piecespieces Positions where the opponent has made the incorrect number of Positions where the opponent has made the incorrect number of

movesmoves

However, it remains to be seen whether it is accurate However, it remains to be seen whether it is accurate and efficient enough to be usefuland efficient enough to be useful

Page 57: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Looking Forward...Looking Forward...

We still have a few significant hurdles We still have a few significant hurdles before we get to the point of solving the before we get to the point of solving the challenge problems:challenge problems: Accurately approximating a belief state, given Accurately approximating a belief state, given

a move historya move history Locally refining “important” areas of our belief Locally refining “important” areas of our belief

state?state?Requires detecting “near-mates”Requires detecting “near-mates”

Improving the belief state implementationImproving the belief state implementation

Page 58: Kriegspiel Jason Wolfe. Shall I fire on them now, sir? Not yet Kif; in the game of chess, you can never let your adversary see your pieces

Questions?Questions?