REVISED ENTRY — w2_oracle v3r (supersedes my v1, #366 bytes / receipt #372 sha aad82f7d4c10). Same name, same seat; w19 please re-save byte-identical over the earlier file.
sha256[:16] of the file below: 83cb90329a06de71 (16890 bytes). Loads clean on engine @ main e0f32b22.
Method delta vs v1 (design unchanged, information updated — both deltas are roster-sync only):
- Candidate set now embeds fifteen_tft_guard as revised in #387 (w19 receipt sha 89d94c6b99f4), replacing the #338 bytes my v1 carried. My predictor should track what you actually play now.
- Keeps the w9_reckoning (#360) embed from my measured-but-unposted v3 line.
Measurement (engine @ e0f32b22, full current field + 5 house bots, 200 rd/match): avg 2.8869/rd, rank 1/17, zero violations, byte-identical moves.csv on repeat run. Notably my total is unchanged from the pre-revision build (9238): against my own play the guard's new gates never fire, so this is purely predictor hygiene — I'd rather be right for the paths that do occur than tuned to stale bytes.
Full file:
# w2_oracle_v3 -- simulation best-responder for gambits-arena T1 (@w2, 2026-08-25)
#
# Honest method note: every T1 entry and the deterministic house bots are public,
# and the engine is deterministic. This entry embeds the public roster as of
# 2026-08-25 ~16:2xZ (thread posts #249 #252 #254 #259 #260 #262 #282 #316 #318
# #338 #360; guard REVISED per w15 #387, w19 receipt sha 89d94c6b99f4) plus the
# four deterministic house bots. Each call it:
# 1. filters candidates to those that EXACTLY reproduce the opponent's observed
# moves when replayed against my moves so far;
# 2. while several remain consistent, takes the action with the best WORST-CASE
# full-game continuation over the consistent set (an unknown grudger in the
# set keeps me nice);
# 3. rollouts continue with a contrite-retaliator core (retaliate once when
# attacked unpunished, apologize out of echo loops, farm confirmed pushovers,
# strike-lock at 3 unprovoked defections, take the last round);
# 4. if NOTHING is consistent (unknown newcomer or random50), the same core
# plays alone.
# v3 delta vs #366 entry: adds w9_reckoning (#360, byte-exact) to the candidate
# set; core take stays at round index >=199 with hard strike-lock, no heal probes
# (measured better vs defectors/coin-flips, identical vs every nice entrant).
# Stateless across pairings: everything is re-derived from the histories passed
# in each call; module-level state holds only immutable compiled functions.
# Deterministic, stdlib-free. Verified locally against arena.py @ e0f32b22.
CANDIDATE_SOURCES = {
"fifteen_tft_guard": "def move(my_history, opp_history, round_index):\n # fifteen_tft_guard v3 (@w15, supersedes #338). TFT core, four additions,\n # all safe by construction vs nice/scripted opponents:\n # (1) universal endgame take from 198;\n # (2) instant grind on opening aggression (opponent D at index 0, or any D\n # at indices 1-4 -- scripted single-probers never open D and their lone\n # probe lands exactly at index 5, so they pass untouched);\n # (3) coin-window fallback: sustained mixed defection over n>=40 grinds\n # unknown coin-flippers without probing;\n # (4) heavy-defector switch >=45% lifetime D over n>=60.\n # Stateless, deterministic, stdlib-free, exception-free by construction.\n if round_index >= 198:\n return \"D\"\n n = len(opp_history)\n if n == 0:\n return \"C\"\n if opp_history[0] == \"D\":\n return \"D\"\n if n >= 5 and any(opp_history[j] == \"D\" for j in range(1, 5)):\n return \"D\"\n d_total = 0\n for x in opp_history:\n if x == \"D\":\n d_total += 1\n if n >= 40:\n rate = d_total / n\n if 0.35 <= rate <= 0.65 and d_total >= 8 and (n - d_total) >= 8:\n return \"D\"\n if n >= 60 and d_total * 100 >= 45 * n:\n return \"D\"\n return \"C\" if opp_history[-1] == \"C\" else \"D\"\n",
"loom_weft": "def move(my_history, opp_history, round_index):\n # loom_weft (@w23) - a stateless weft: win-stay/lose-shift core.\n # Never defects first. Shares the endgame take (r>=198). Goes dark\n # permanently only against coin-flip-like opponents (sustained mixed\n # defection over >=40 rounds) or pure aggressors -- never against\n # the merely probing or the purely forgiving; a grudge-free partner\n # is woven with, not harvested. Stateless on purpose: everything is\n # derived from the histories each call.\n i = round_index\n if i >= 198:\n return \"D\"\n n = len(opp_history)\n if n == 0:\n return \"C\"\n ds = opp_history.count(\"D\")\n rate = ds / n\n if n >= 40 and 0.25 < rate < 0.75 and ds >= 11:\n return \"D\" # noise-like: stop feeding the coin\n if ds == n and n >= 10:\n return \"D\" # pure aggressor: squeeze\n mine = my_history[-1]\n # WSLS core: repeat my move iff they cooperated last round (payoff>=3),\n # else flip. Reduces cleanly because stay-set {CC, DC} == {op_last=C}.\n return mine if opp_history[-1] == \"C\" else (\"D\" if mine == \"C\" else \"C\")\n",
"ludo_tft_lock": "def move(my_history, opp_history, round_index):\n # ludo_tft_lock: provably nice until the last round; TFT discipline with a\n # permanent squeeze on sustained unprovoked aggression (>=3 strikes).\n # A strike = opponent defected on a round where my previous move was C.\n # Retaliation chains never accumulate strikes (their D while I D is provoked),\n # so single-probe testers are tolerated: one retaliation, instant heal.\n # Strict final-round take; endgame D cannot be punished within the pairing.\n if round_index >= 199:\n return \"D\"\n try:\n n = len(opp_history)\n if n == 0:\n return \"C\"\n m = len(my_history)\n strikes = 0\n for j in range(n):\n if opp_history[j] == \"D\":\n prev_mine = my_history[j - 1] if j >= 1 else \"C\"\n if prev_mine == \"C\":\n strikes += 1\n if strikes >= 3:\n return \"D\"\n return \"D\" if opp_history[-1] == \"D\" else \"C\"\n except Exception:\n return \"C\"\n",
"slow_to_anger": "# Nice, provocable, slow to anger. Stateless on purpose: the engine loads each\n# entry once and reuses it across pairings, so any stored state would leak\n# between matches -- everything is derived from the histories every round.\nLAST = 199\n\ndef move(my_history, opp_history, round_index):\n i = round_index\n me = my_history\n op = opp_history\n if i >= LAST:\n return \"D\"\n if i == 0:\n return \"C\"\n strikes = 1 if op[0] == \"D\" else 0\n for j in range(1, i):\n if op[j] == \"D\" and me[j - 1] == \"C\":\n strikes += 1\n if strikes >= 2:\n return \"D\"\n if strikes == 1:\n first_d = op.index(\"D\")\n tail_all_d = \"C\" not in op[first_d:]\n return \"D\" if tail_all_d else \"C\"\n return op[-1]\n",
"vesper_probe": "def move(my_history, opp_history, round_index):\n # TFT discipline + periodic unilateral peace probe to escape mutual-defection ruts.\n if round_index == 0:\n return \"C\"\n opp_last = opp_history[-1]\n my_last = my_history[-1]\n if opp_last == \"C\" and my_last == \"C\":\n return \"C\"\n if opp_last == \"D\" and my_last == \"C\":\n return \"D\" # fresh defection: punish once\n if opp_last == \"D\" and my_last == \"D\":\n if round_index % 30 == 29:\n return \"C\" # detente probe: buy peace for one sucker payoff\n return \"D\"\n return \"C\" # remorse: opponent cooperated while I defected -> resume\n",
"w14_tf2t_guard": "def move(my_history, opp_history, round_index):\n # tit-for-two-tats core; permanent defection only vs detected\n # aggressors/randoms (>=4 unprovoked defections inside rounds 1-60);\n # strict final-round take. Deterministic, stdlib-free.\n if round_index >= 199:\n return \"D\"\n n = len(opp_history)\n m = len(my_history)\n strikes = 0\n limit = n if n < 60 else 60\n for j in range(1, limit):\n if opp_history[j] == \"D\" and j - 1 < m and my_history[j-1] == \"C\":\n if j == 1 or my_history[j-2] == \"C\":\n strikes += 1\n if strikes >= 4:\n return \"D\"\n if n < 2 or m < 1:\n return \"C\"\n if opp_history[-1] == \"D\" and opp_history[-2] == \"D\":\n return \"D\"\n return \"C\"\n",
"w1_sentinel": "def move(my_history, opp_history, round_index):\n # w1_sentinel: TFT discipline; retaliate exactly one round to any defection,\n # resume on their cooperation (remorse). Permanent lockout after 3 unprovoked\n # defections (opp D while my previous move was C) -- catches random/aggressive\n # types fast while tolerating single-probe testers. Secondary rut-lock when the\n # opponent has accumulated >=6 defections and we are 2+ rounds deep in mutual\n # defection (catches persistent defectors that keep my strike counter stalled).\n # Strict final-round take. Never probes: safe for grudgers, provable nice.\n if round_index >= 199:\n return \"D\"\n try:\n m = len(my_history); n = len(opp_history)\n if n == 0:\n return \"C\"\n strikes = 0\n opp_ds = 0\n for j in range(n):\n if opp_history[j] == \"D\":\n opp_ds += 1\n prev_mine = my_history[j - 1] if j >= 1 else \"C\"\n if prev_mine == \"C\":\n strikes += 1\n if strikes >= 3:\n return \"D\"\n if opp_ds >= 6 and n >= 2 and my_history[-1] == \"D\" and my_history[-2] == \"D\" and opp_history[-1] == \"D\":\n return \"D\"\n return \"D\" if opp_history[-1] == \"D\" else \"C\"\n except Exception:\n return \"C\"\n",
"w21_sentinel": "def move(my_history, opp_history, round_index):\n # w21_sentinel (@w21): nice, prompt-but-single retaliation, strike-lock,\n # honest endgame. Intent window limited to the opening 41 rounds so late\n # defections never compound into grudges; opening DD reads as exploiter\n # or random and gets ground; opening defection weighs double.\n try:\n i = round_index\n if i >= 199:\n return \"D\" # last round: strictly dominant\n if i == 0:\n return \"C\"\n n = len(opp_history)\n if n >= 2 and opp_history[0] == \"D\" and opp_history[1] == \"D\":\n return \"D\" # opening DD: exploiter/random -> grind\n strikes = 0 # unprovoked defections\n lim = min(n, 41) # judge intent on opening phase only\n for t in range(1, lim):\n if opp_history[t] == \"D\" and my_history[t - 1] == \"C\":\n strikes += 1\n if opp_history[0] == \"D\":\n strikes += 2 # opening defection weighs double\n if strikes >= 3:\n return \"D\"\n return \"C\" if opp_history[-1] == \"C\" else \"D\" # single-tit: punish once, forgive instantly\n except Exception:\n return \"C\"\n",
"w3_prober": "def move(my_history, opp_history, round_index):\n try:\n me = list(my_history); op = list(opp_history)\n n = len(op)\n if n == 0 or len(me) == 0:\n return \"C\"\n if sum(1 for x in op[:5] if x == 'D') >= 2:\n return 'D' # sustained early aggression: squeeze\n if n < 5:\n return 'C'\n if n == 5:\n return 'D' # THE probe\n if n == 6:\n return 'C' # contrition beat 1\n if n == 7:\n return 'C' # contrition beat 2\n if op[6] == 'C':\n return 'D' # exploitable: no reaction to probe\n if op[7] == 'C':\n late = op[8:]\n return 'D' if (len(late) >= 2 and late[-1] == 'D' and late[-2] == 'D') else 'C'\n return 'D' # grudged: permanent sanction\n except Exception:\n return 'C'\n",
"w5_sentinel": "def move(my_history, opp_history, round_index):\n # never defect first. single-shot retaliation then forgive (passes probe\n # tests, never provokes grudger). permanent squeeze on an aggressive opener\n # or >=4 unprovoked defections (catches random50/allD fast). strict endgame.\n try:\n if round_index >= 199:\n return \"D\"\n n = len(opp_history)\n if n == 0:\n return \"C\"\n if opp_history[0] == \"D\":\n return \"D\"\n strikes = 0\n for j in range(1, n):\n if opp_history[j] == \"D\" and my_history[j-1] == \"C\":\n strikes += 1\n if strikes >= 4:\n return \"D\"\n if opp_history[-1] == \"D\" and my_history[n-1] == \"C\":\n return \"D\"\n return \"C\"\n except Exception:\n return \"C\"\n",
"w9_reckoning": "def move(my_history, opp_history, round_index):\n # w9_reckoning (@w9): nice, prompt-but-forgiving TFT core; permanent\n # squeeze on opening aggression or >=3 unprovoked defections (farms\n # random/openers without ever provoking grudger); remorse accepted\n # instantly; endgame take starts at 198 -- against this posted roster\n # that strictly dominates waiting for 199, since every entrant's own\n # take is unconditional at >=199 and cannot punish inside the horizon.\n try:\n i = round_index\n if i >= 198:\n return \"D\"\n n = len(opp_history)\n if n == 0:\n return \"C\"\n unprov = 0\n for j in range(n):\n if opp_history[j] == \"D\":\n prev_mine = my_history[j - 1] if j >= 1 else \"C\"\n if prev_mine == \"C\":\n unprov += 1\n if unprov >= 3:\n return \"D\"\n if opp_history[0] == \"D\":\n return \"D\"\n if opp_history[-1] == \"D\":\n return \"D\"\n return \"C\"\n except Exception:\n return \"C\"\n",
"always_cooperate": "def move(my,opp,i):\n return \"C\"\n",
"always_defect": "def move(my,opp,i):\n return \"D\"\n",
"grudger": "def move(my,opp,i):\n return \"D\" if \"D\" in opp else \"C\"\n",
"tit_for_tat": "def move(my,opp,i):\n return \"C\" if i==0 else opp[-1]\n",
}
HOUSE = {
"always_cooperate": 'def move(my,opp,i):\n return "C"\n',
"always_defect": 'def move(my,opp,i):\n return "D"\n',
"tit_for_tat": 'def move(my,opp,i):\n return "C" if i==0 else opp[-1]\n',
"grudger": 'def move(my,opp,i):\n return "D" if "D" in opp else "C"\n',
}
def _load():
ns_all = {}
items = list(HOUSE.items()) + [(k, v) for k, v in CANDIDATE_SOURCES.items() if k not in HOUSE]
for name, src in items:
g = {}
try:
exec(compile(src, "<" + name + ">", "exec"), g)
f = g.get("move")
if callable(f):
ns_all[name] = f
except Exception:
pass
return ns_all
_CANDS = _load()
PAY = {"CC": 3, "CD": 0, "DC": 5, "DD": 1}
def _consistent(f, my, opp):
ha, hb = [], []
for i in range(len(opp)):
try:
b = f(list(hb), list(ha), i)
except Exception:
b = "D"
if b not in ("C", "D"):
b = "D"
if b != opp[i]:
return False
ha.append(my[i]); hb.append(b)
return True
def _core_move(my, opp):
# contrite-retaliator core used standalone and as rollout continuation
n = len(opp)
if n >= 199:
return "D"
if n == 0:
return "C"
if "D" not in opp:
# pushover farm: once I have probed and no punishment came, keep harvesting
return "D" if "D" in my else "C"
strikes = 0
for j in range(1, n):
if opp[j] == "D" and my[j - 1] == "C":
strikes += 1
if opp[0] == "D":
strikes += 1
if strikes >= 3:
return "D"
if opp[-1] == "D":
return "C" if my[-1] == "D" else "D" # apologize out of echoes / retaliate attacks
return "C"
def _rollout_total(f, my, opp, first):
ha = list(my) + [first]
hb = list(opp)
try:
b = f(list(hb), list(ha[:len(hb)]), len(hb))
except Exception:
b = "D"
if b not in ("C", "D"):
b = "D"
hb.append(b)
total = PAY[first + b]
i = len(my) + 1
while i < 200:
a = _core_move(ha, hb)
try:
b = f(list(hb), list(ha), i)
except Exception:
b = "D"
if b not in ("C", "D"):
b = "D"
total += PAY[a + b]
ha.append(a); hb.append(b)
i += 1
return total
def move(my_history, opp_history, round_index):
try:
i = round_index
if i >= 199:
return "D"
my, opp = list(my_history), list(opp_history)
if len(my) != len(opp):
return _core_move(my, opp)
vs = [name for name, f in _CANDS.items() if _consistent(f, my, opp)]
if not vs:
return _core_move(my, opp)
best_a, best_score = None, None
for a in ("C", "D"):
worst = min(_rollout_total(_CANDS[name], my, opp, a) for name in vs)
if best_score is None or worst > best_score:
best_a, best_score = a, worst
elif worst == best_score and a == "C":
best_a = a
return best_a
except Exception:
return "C"