SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1809.04040 · 2018

Solving Imperfect-Information Games via Discounted Regret Minimization

arXiv · PDF · Open in the Atlas

Code that ran

8 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 8 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1809.04040.json · badge: /api/ran/1809.04040.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
samhippie/shallow-red community (classifier label)
classifier basis not recorded on the link
8 ran · 0 no recorded run
FunctionStatusWhere it lives
actionToTensor Ran
ran on a synthesized input
samhippie/shallow-red/old/modelInput.py
code served (permissive licence) · get_code("7a7606597b0113b0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (186,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Reset the idMap before defining ARGS to ensure clean state
idMap = {}

def enumId(type, id):
    if not type in idMap:
        idMap[type] = {'nextNum': 0}
    typeMap = idMap[type]
    if not id in typeMap:
        num = typeMap['nextNum']
        typeMap['nextNum'] += 1
        typeMap[id] = num
    return typeMap[id]

def numToOneHot(num, size):
    if type(num) == bool and num:
        num = 1
    elif type(num) == bool and (not num):
        num = 0
    xs = np.zeros(size)
    xs[num] = 1
    return xs

def actionToTensor(action):
    parts = [p.strip() for p in action.split(',')]
    if len(parts) == 1:
        parts.append('pass')
    actionTensor = np.zeros(0)
    partSize = 3 + 90
    for p in parts:
        if p == 'pass':
            partList = np.zeros(partSize)
        elif 'switch' in p:
            target = p.split(' ')[1]
            targetNum = enumId('switch-target', target)
            partList = np.concatenate([numToOneHot(0, 3), numToOneHot(targetNum, 90)])
        elif 'team' in p:
            team = p.split(' ')[1]
            teamNum = enumId('team', team)
            partList = np.concatenate([numToOneHot(1, 3), numToOneHot(teamNum, 90)])
        elif 'move' in p:
            data = p.split(' ')
            move = data[1]
            moveNum = enumId('move-move', move)
            if len(data) < 3:
                targetNum = 0
            else:
                target = data[2]
                targetNum = enumId('move-target', target)
            partList = np.concatenate([numToOneHot(2, 3), numToOneHot(moveNum, 4), numToOneHot(moveNum, 86)])
        actionTensor = np.concatenate([actionTensor, partList])
    return actionTensor

# Test with a simple action string
test_action = "switch pikachu"

ARGS = {
    "action": test_action
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (186,) — shape (186,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
checkTeamSet Ran
ran on a synthesized input
samhippie/shallow-red/moves.py
code served (permissive licence) · get_code("ae5e00e21ff84986")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

def checkTeamSet(set):
    counts = np.unique(set, return_counts=True)[1]
    return np.all(np.unique(set, return_counts=True)[1] == 1) and np.all(np.diff(set) >= 0)

# Construct valid arguments for checkTeamSet
# The function expects:
# - set: a numpy array that will be checked for:
#   1. All unique elements (no duplicates)
#   2. Elements in sorted/non-decreasing order

# Create a valid set: sorted array with all unique elements
valid_set = np.array([1, 2, 3, 5, 7])

ARGS = {
    "set": valid_set
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
combineTeamSets Ran
ran on a synthesized input
samhippie/shallow-red/moves.py
code served (permissive licence) · get_code("184988b03098fdd5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 2, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

def combineTeamSets(a, b):
    sets = []
    for setA in a:
        for setB in b:
            candidate = list(setA) + list(setB)
            if np.all(np.unique(candidate, return_counts=True)[1] == 1):
                sets.append(candidate)
    return sets

# Build valid arguments
# a and b should be iterables of iterables (lists of sets/lists)
# The function combines elements from a and b, checking for duplicates

a = [
    [1, 2, 3],
    [4, 5, 6]
]

b = [
    [7, 8],
    [9, 10]
]

ARGS = {
    "a": a,
    "b": b
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
enumId Ran
ran on a synthesized input
samhippie/shallow-red/old/modelInput.py
code served (permissive licence) · get_code("0fad39aae37cdc44")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Reset the global idMap for clean execution
idMap = {}

def enumId(type, id):
    if not type in idMap:
        idMap[type] = {'nextNum': 0}
    typeMap = idMap[type]
    if not id in typeMap:
        num = typeMap['nextNum']
        typeMap['nextNum'] += 1
        typeMap[id] = num
    return typeMap[id]

# Set up arguments
# The function takes two parameters: type and id
# type: a type/key to group identifiers
# id: an identifier to map to a number

ARGS = {
    'type': 'entity',
    'id': 'user_123'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
infosetToRepr Ran
ran on a synthesized input
samhippie/shallow-red/simpleModel.py
code served (permissive licence) · get_code("05bad44fc80be3da")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function infosetToRepr simply converts an infoset to a tuple
# It calls tuple() on the infoset, so infoset needs to be iterable
# The simplest valid argument is any iterable (list, tuple, set, etc.)

ARGS = {
    "infoset": [1, 2, 3, 4]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
makeTeams Ran
ran on a synthesized input
samhippie/shallow-red/moves.py
code served (permissive licence) · get_code("b7daeccde00646cf")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

ARGS = {
    'numMons': 5,
    'teamSize': 3,
    'numInFront': 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
myCollate Ran
ran on a synthesized input
samhippie/shallow-red/dataStorage.py
code served (permissive licence) · get_code("af8a0162a3d86fd9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.utils.data

torch.manual_seed(0)

# Construct a batch item
# Each item in batch is a tuple of (data, label, iter)
# data: a tensor of shape (sequence_length, feature_dim)
# label: a scalar tensor
# iter: a scalar tensor

batch_item_1 = (
    torch.randint(0, 10, (3, 4), dtype=torch.long),  # data: 3 timesteps, 4 features
    torch.tensor(0, dtype=torch.long),  # label
    torch.tensor(5, dtype=torch.long)   # iter
)

batch_item_2 = (
    torch.randint(0, 10, (2, 4), dtype=torch.long),  # data: 2 timesteps, 4 features
    torch.tensor(1, dtype=torch.long),  # label
    torch.tensor(7, dtype=torch.long)   # iter
)

# Create batch as a list of items
batch = [batch_item_1, batch_item_2]

ARGS = {
    "batch": batch
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
stateToTensor Ran
ran on a synthesized input
samhippie/shallow-red/old/modelInput.py
code served (permissive licence) · get_code("42d3e8c859d5479e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (3883,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Clear the global idMap before setting up args
idMap = {}

# Construct a valid state dict for stateToTensor
state = {
    'weather': {
        'rain': 5,
        'sun': 3,
    },
    'players': [
        {
            'zMoveUsed': True,
            'mons': {
                'mon1': {
                    'details': 'pikachu-1',
                    'status': 'burn',
                    'hp': 7,
                    'item': 'leftovers',
                },
                'mon2': {
                    'details': 'charizard-2',
                    'status': 'ok',
                    'hp': 10,
                    'item': 'charcoal',
                },
                'mon3': {
                    'details': 'blastoise-3',
                    'status': 'paralysis',
                    'hp': 5,
                    'item': 'assault-vest',
                },
                'mon4': {
                    'details': 'venusaur-4',
                    'status': 'ok',
                    'hp': 8,
                    'item': 'life-orb',
                },
                'mon5': {
                    'details': 'dragonite-5',
                    'status': 'freeze',
                    'hp': 9,
                    'item': 'air-balloon',
                },
                'mon6': {
                    'details': 'alakazam-6',
                    'status': 'ok',
                    'hp': 6,
                    'item': 'choice-specs',
                },
            },
            'active': {
                'mon1': {
                    'newlySwitched': False,
                    'ability': 'static',
                    'addedType': 'electric',
                    'moves': [1, 2, 0],
                    'boosts': [0, 1, 2, 0, 1, 2],
                    'volatiles': {
                        'curse': 2,
                        'leechseed': 1,
                    },
                },
            },
            'sideConditions': {
                'reflect': 5,
                'stealth-rock': 0,
            },
        },
        {
            'zMoveUsed': False,
            'mons': {
                'mon7': {
                    'details': 'gyarados-7',
                    'status': 'ok',
                    'hp': 10,
                    'item': 'assault-vest',
                },
                'mon8': {
                    'details': 'machamp-8',
                    'status': 'poison',
                    'hp': 4,
                    'item': 'choice-band',
                },
                'mon9': {
                    'details': 'arcanine-9',
                    'status': 'ok',
                    'hp': 9,
                    'item': 'flame-orb',
                },
                'mon10': {
                    'details': 'lapras-10',
                    'status': 'ok',
                    'hp': 7,
                    'item': 'assault-vest',
                },
                'mon11': {
                    'details': 'golem-11',
                    'status': 'ok',
                    'hp': 8,
                    'item': 'weakness-policy',
                },
                'mon12': {
                    'details': 'articuno-12',
                    'status': 'ok',
                    'hp': 6,
                    'item': 'leftovers',
                },
            },
            'active': {
                'mon7': {
                    'newlySwitched': True,
                    'ability': 'intimidate',
                    'addedType': 'water',
                    'moves': [0, 1, 2],
                    'boosts': [1, 0, 1, 2, 0, 1],
                    'volatiles': {
                        'stealth-rock': 0,
                    },
                },
            },
            'sideConditions': {
                'spikes': 2,
            },
        },
    ],
}

ARGS = {
    'state': state,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (3883,) — shape (3883,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 8 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Counterfactual regret minimization (CFR) is a family of iterative algorithms that are the most popular and, in practice, fastest approach to approximately solving large imperfect-information games. In this paper we introduce novel CFR variants that 1) discount regrets from earlier iterations in various ways (in some cases differently for positive and negative regrets), 2) reweight iterations in various ways to obtain the output strategies, 3) use a non-standard regret minimizer and/or 4) leverage "optimistic regret matching". They lead to dramatically improved performance in many settings. For one, we introduce a variant that outperforms CFR+, the prior state-of-the-art algorithm, in every game tested, including large-scale realistic settings. CFR+ is a formidable benchmark: no other algorithm has been able to outperform it. Finally, we show that, unlike CFR+, many of the important new variants are compatible with modern imperfect-information-game pruning techniques and one is also compatible with sampling in the game tree.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("1809.04040")
get_code_for_paper("1809.04040")
have("1809.04040")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/1809.04040.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/1809.04040.svg)](https://syntology.ai/paper/1809.04040)

Connect an agent — have() is free.