File size: 3,810 Bytes
899afb5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
{
  "version": "1.0.0",
  "description": "Reference inputs and expected outputs for validating implementations",
  "test_cases": {
    "card_encoding": [
      {
        "description": "First card (Club Jack)",
        "card": "CJ",
        "expected_index": 0
      },
      {
        "description": "Last card (Diamond 7)",
        "card": "D7",
        "expected_index": 31
      },
      {
        "description": "Spade Jack",
        "card": "SJ",
        "expected_index": 1
      },
      {
        "description": "Club Ace",
        "card": "CA",
        "expected_index": 4
      },
      {
        "description": "Heart 10",
        "card": "HT",
        "expected_index": 19
      }
    ],
    "game_type_encoding": [
      {
        "game_type": "DIAMONDS",
        "expected_index": 0
      },
      {
        "game_type": "GRAND",
        "expected_index": 4
      },
      {
        "game_type": "NULL",
        "expected_index": 5
      }
    ],
    "position_encoding": [
      {
        "position": "FOREHAND",
        "expected_index": 0
      },
      {
        "position": "MIDDLEHAND",
        "expected_index": 1
      },
      {
        "position": "REARHAND",
        "expected_index": 2
      }
    ],
    "bidding_transformer": [
      {
        "description": "Strong Grand hand - all 4 Jacks + Aces",
        "input": {
          "hand_cards": ["CJ", "SJ", "HJ", "DJ", "CA", "SA", "HA", "DA", "CT", "ST"],
          "position": "FOREHAND"
        },
        "expected": {
          "description": "Should have high win probability at Grand bid levels",
          "pickup_prob_at_bid_18_min": 0.9,
          "hand_prob_at_bid_18_min": 0.85
        }
      },
      {
        "description": "Weak hand - no Jacks, scattered low cards",
        "input": {
          "hand_cards": ["C7", "C8", "S7", "S8", "H7", "H8", "D7", "D8", "C9", "S9"],
          "position": "REARHAND"
        },
        "expected": {
          "description": "Should have low win probability at most bid levels",
          "pickup_prob_at_bid_18_max": 0.3,
          "hand_prob_at_bid_18_max": 0.2
        }
      }
    ],
    "game_eval_transformer": [
      {
        "description": "Strong Clubs hand after skat pickup",
        "input": {
          "hand_cards": ["CJ", "SJ", "CA", "CT", "CK", "CQ", "C9", "C8", "SA", "ST"],
          "skat_cards": ["C7", "D7"],
          "skat_len": 2,
          "game_type": "CLUBS",
          "position": "FOREHAND",
          "is_hand": 0,
          "bid": 0.068
        },
        "expected": {
          "description": "Should predict high win probability for Clubs",
          "win_prob_min": 0.8
        }
      }
    ],
    "card_play_transformer": [
      {
        "description": "Opening lead in Clubs game as declarer with strong trumps",
        "input": {
          "game_type": "CLUBS",
          "declarer": 0,
          "is_ouvert": 0,
          "hand": ["CJ", "SJ", "CA", "CT", "CK", "SA", "ST", "HA", "DA", "D7"],
          "hand_len": 10,
          "ouvert_hand": [],
          "ouvert_hand_len": 0,
          "history": [],
          "history_len": 0,
          "trick": [],
          "trick_len": 0,
          "legal_mask_cards": ["CJ", "SJ", "CA", "CT", "CK", "SA", "ST", "HA", "DA", "D7"]
        },
        "expected": {
          "description": "Should prefer leading a Jack to draw trumps",
          "top_cards": ["CJ", "SJ"],
          "top_prob_min": 0.3
        }
      }
    ]
  },
  "notes": {
    "bid_normalization": "Normalize bid values by dividing by 264 (max bid)",
    "card_indices": "Convert card names to indices using card_encoding.order",
    "legal_mask": "Create boolean array of size 32, True for cards in hand that are legal to play",
    "padding": "Use pad_index (32) for empty slots in variable-length sequences"
  }
}