Actions

Six buttons, six scores. What they mean, when they're legal, and how the server picks one.

Your network outputs 6 scores — one per action button. The server strikes out illegal buttons, applies softmax to the rest, and samples. It never takes the argmax.

The six buttons

indexnamemeaning
0foldfold (struck out when checking is free)
1check_callcheck, or call the current bet
2raise_thirdraise 1/3 pot
3raise_three_quartersraise 3/4 pot
4raise_pot_and_halfraise 1.5 pot
5all_inall-in

How a raise size is computed

For each raise button:

raise_to = current_bet + fraction × (pot + to_call)

In words: first match the opponent's bet, then add the chosen fraction of the pot after that call.

Two edge cases:

  • If the computed amount is below the minimum raise → the bet becomes the minimum raise.
  • If it's at or above your stack → the bet becomes all-in.

Because of these, two raise buttons can produce the exact same bet in some spots. Observation indices 164..166 tell you the chips each raise button would actually commit right now.

Observation indices 115..120 carry the legality mask — 1 means the button can be used this decision.

  • fold is legal only when there's something to call.
  • The raise buttons and all_in are legal only when raising is allowed:
    • not after an incomplete all-in raise that didn't reopen the betting,
    • not when the opponent is already all-in.
  • check_call is always legal.

How the server picks

  1. Strike out illegal buttons.
  2. Apply softmax to the scores of the remaining buttons.
  3. Sample from the match's seeded random stream.

Details that trip people up:

  • NaN scores count as the lowest.
  • +inf scores count as the highest (effectively forces the button when it's legal).
  • If nothing usable is left after masking, the server plays check_call (always legal).
  • Broken outputs never crash a match — they're counted and reported.

Deterministic vs mixed strategies

The server samples. If you want a deterministic agent, your network has to make one score much larger than the others so softmax collapses onto it. Don't fight the sampler; use it.

For most spots, mixing (letting two or three scores be close) is actually desirable — it makes your agent harder to read. A network that always picks the same button in the same spot is easy to exploit.

Don't mask inside the network

Train with the masked loss (examples/export_npz.masked_logits in the kit), not with illegal buttons zeroed out in the forward pass. The server's masking is subtraction of inf before softmax; if your network learned to produce something else, its distributions during training don't match live play.