Defender

wave_adaptive_deadline_convergence_cocov

rank #4Elo 1101house league, persona generalist2026-12-02_defender_wave_adaptive_deadline_convergence_cocov

Idea: A deadline back-scheduler that moves its latest acceptable intercept radius inward when a wave outnumbers the magazine, so converging drones share blasts, and holds fire on unknown tracks until queue pressure, weighted by an observed striker ratio, forces a launch.

Why it holds up across the attacker field:

  • Synchronized and phase-locked rings: when the uncovered threat load exceeds the magazine, the minimum meet radius drops to about 40. Every launch is then back-scheduled against the 2-per-tick launch cap. Intercepts happen where ring spacing is near the blast radius, and tracks inside one blast are counted as co-covered, so one interceptor can account for several drones.
  • Staggered trickles and screens: with a light load, an identified striker is engaged as soon as it enters id range. This leaves time to relaunch after an 85% miss before the gun envelope.
  • Decoy drains, orbits and radar shadows: urgency uses a worst-case range-based arrival time, not noisy heading. A drone orbiting far out never becomes urgent. Revealed decoys are never engaged, and an interceptor whose target turns out to be a decoy is retargeted.
  • Unknown tracks only rank in the launch queue at a weight equal to the running striker ratio. A launch on an unknown also needs spare stock beyond the identified strikers that still need cover. Cheap decoy floods therefore cannot empty the magazine before the real strikers arrive.
  • Veiled and split attacks: the gun always works the nearest striker, uncovered ones first, as a cheap last layer. Smoothed positions keep blast co-cover decisions from being fooled by track noise.
72.3%win rate
0.79cost exchange
310matches
night 59first night (2026-12-02)
Best match
vs hover_expiry_feint_collapse · its score 0.912 · seed 6 · open →
Worst match
vs veiled_full_ring_blastproof_split · its score 0.112 · seed 1 · open →

Matches

last night
OpponentSeedResultScore
staggered_screen_trickle9defended0.727watch
synchronized_ring9defended0.362watch
phase_locked_ring9breached0.154watch
depth_shell_saturation9defended0.359watch
interleaved_shell_ring9defended0.356watch
staggered_trishell_blast_denial9defended0.765watch
shadow_pair_ring9defended0.741watch
blast_proof_depth_interleave9defended0.359watch
column_free_tiered_ring_dive9defended0.762watch
2026_10_15_attacker_dark_ring_release9defended0.743watch
Record · 2026-12-02_defender_wave_adaptive_deadline_convergence_cocov.meta.json
backendcli
date2026-12-02
dry_runFalse
escalationFalse
evidencebudget: 3000, dropped: ['top_three'], included: ['matrix (cut)'], used: 3000
modelopus
name2026-12-02_defender_wave_adaptive_deadline_convergence_cocov
personageneralist
prompt_version2026-10-03.1
raw_responseout/house_raw/2026-12-02T033340_cli_defender_generalist.md
resultbeat_target: False, field_mean: 0.566, rank: 4
roledefender
targetfield
tokensinput: 7792, output: 9945
Source · bots/house/2026-12-02_defender_wave_adaptive_deadline_convergence_cocov.py
"""Idea: A deadline back-scheduler that moves its latest acceptable intercept radius inward when a wave outnumbers the magazine, so converging drones share blasts, and holds fire on unknown tracks until queue pressure, weighted by an observed striker ratio, forces a launch.

Why it holds up across the attacker field:
- Synchronized and phase-locked rings: when the uncovered threat load exceeds the
  magazine, the minimum meet radius drops to about 40. Every launch is then
  back-scheduled against the 2-per-tick launch cap. Intercepts happen where ring
  spacing is near the blast radius, and tracks inside one blast are counted as
  co-covered, so one interceptor can account for several drones.
- Staggered trickles and screens: with a light load, an identified striker is engaged
  as soon as it enters id range. This leaves time to relaunch after an 85% miss before
  the gun envelope.
- Decoy drains, orbits and radar shadows: urgency uses a worst-case range-based arrival
  time, not noisy heading. A drone orbiting far out never becomes urgent. Revealed
  decoys are never engaged, and an interceptor whose target turns out to be a decoy is
  retargeted.
- Unknown tracks only rank in the launch queue at a weight equal to the running striker
  ratio. A launch on an unknown also needs spare stock beyond the identified strikers
  that still need cover. Cheap decoy floods therefore cannot empty the magazine
  before the real strikers arrive.
- Veiled and split attacks: the gun always works the nearest striker, uncovered ones
  first, as a cheap last layer. Smoothed positions keep blast co-cover decisions from
  being fooled by track noise.
"""

NAME = "wave_adaptive_deadline_convergence_cocover"
ROLE = "defender"

_S = {"sm": {}, "cls": {}, "S": 0, "D": 0}


def reset(seed=None):
    global _S
    _S = {"sm": {}, "cls": {}, "S": 0, "D": 0}


def _f(x, d=0.0):
    try:
        return float(x)
    except Exception:
        return d


def _act(obs):
    rules = obs.get("rules") or {}
    asset = obs.get("asset") or {}
    apos = asset.get("pos") or [0.0, 0.0]
    ax, ay = _f(apos[0]), _f(apos[1])
    a_rad = _f(asset.get("radius", rules.get("asset_radius", 25.0)), 25.0)
    d_speed = max(0.5, _f(rules.get("striker_speed", 4.0), 4.0))
    i_speed = max(1.0, _f(rules.get("interceptor_speed", 12.0), 12.0))
    rate = int(rules.get("interceptor_launches_per_tick", 2) or 2)
    id_range = _f(rules.get("id_range", 150.0), 150.0)
    gun_range = _f(rules.get("gun_range", 100.0), 100.0)
    blast = _f(rules.get("blast_radius", 10.0), 10.0)
    stock = int(obs.get("stock", 0) or 0)
    ammo = int(obs.get("ammo", 0) or 0)

    sm = _S["sm"]
    tracks = {}
    for t in obs.get("tracks") or []:
        tid = t.get("id")
        if tid is None:
            continue
        p = t.get("pos") or [0.0, 0.0]
        v = t.get("vel") or [0.0, 0.0]
        px, py = _f(p[0]), _f(p[1])
        vx, vy = _f(v[0]), _f(v[1])
        if tid in sm:
            ox, oy = sm[tid]
            prx, pry = ox + vx, oy + vy
            sx, sy = prx + 0.45 * (px - prx), pry + 0.45 * (py - pry)
        else:
            sx, sy = px, py
        sm[tid] = (sx, sy)
        r = t.get("range")
        r = _f(r, None) if r is not None else None
        if r is None:
            r = ((px - ax) ** 2 + (py - ay) ** 2) ** 0.5
        cls = t.get("cls") or "unknown"
        if cls in ("striker", "decoy") and tid not in _S["cls"]:
            _S["cls"][tid] = cls
            if cls == "striker":
                _S["S"] += 1
            else:
                _S["D"] += 1
        if tid in _S["cls"]:
            cls = _S["cls"][tid]
        tracks[tid] = {"id": tid, "x": sx, "y": sy, "r": r, "cls": cls}

    # Drop stale smoothing entries
    for k in list(sm.keys()):
        if k not in tracks:
            del sm[k]

    p_str = (_S["S"] + 1.0) / (_S["S"] + _S["D"] + 2.0)

    def w(t):
        return 1.0 if t["cls"] == "striker" else p_str

    threats = {k: t for k, t in tracks.items() if t["cls"] != "decoy"}

    covered = set()
    free_ints = []
    for it in obs.get("interceptors") or []:
        iid = it.get("id")
        tg = it.get("target")
        if tg is not None and tg in threats and tg not in covered:
            covered.add(tg)
        else:
            free_ints.append(it)

    retarget = {}
    for it in free_ints:
        iid = it.get("id")
        if iid is None:
            continue
        ip = it.get("pos") or [ax, ay]
        ix, iy = _f(ip[0]), _f(ip[1])
        best, bk = None, None
        for k, t in threats.items():
            if k in covered:
                continue
            d = ((t["x"] - ix) ** 2 + (t["y"] - iy) ** 2) ** 0.5
            key = (0 if t["cls"] == "striker" else 1, d)
            if bk is None or key < bk:
                bk, best = key, k
        if best is not None:
            retarget[iid] = best
            covered.add(best)

    uncovered = [t for k, t in threats.items() if k not in covered]
    load = sum(w(t) for t in uncovered if t["r"] < 350.0)
    wave = load > stock + 3
    r_meet = a_rad + 15.0 if wave else 72.0
    co_rad = min(7.0, 0.7 * blast)

    def neighbors(t, pool):
        out = []
        for o in pool:
            if o["id"] == t["id"]:
                continue
            if (o["x"] - t["x"]) ** 2 + (o["y"] - t["y"]) ** 2 <= co_rad * co_rad:
                out.append(o["id"])
        return out

    if wave:
        for k in list(covered):
            t = threats.get(k)
            if t is not None and t["r"] < 250.0:
                for n in neighbors(t, uncovered):
                    covered.add(n)
        uncovered = [t for t in uncovered if t["id"] not in covered]

    def slack(t):
        return (t["r"] - r_meet) / d_speed - r_meet / i_speed - 1.0

    cands = sorted(uncovered,
                   key=lambda t: (slack(t), -len(neighbors(t, uncovered)), t["r"]))
    known_unc = sum(1 for t in uncovered if t["cls"] == "striker")

    launches = []
    remaining = stock
    cum = 0.0
    for t in cands:
        if len(launches) >= rate or remaining <= 0:
            break
        if t["id"] in covered:
            continue
        need = cum / max(1, rate)
        cum += w(t)
        s = slack(t)
        fire = False
        if t["cls"] == "striker":
            if (not wave and t["r"] <= id_range + 5.0) or s <= need + 1.0:
                fire = True
        else:
            if s <= need + 1.0 and remaining - 1 >= known_unc and t["r"] > a_rad:
                fire = True
        if fire:
            launches.append(t["id"])
            remaining -= 1
            covered.add(t["id"])
            if t["cls"] == "striker":
                known_unc -= 1
            if wave:
                for n in neighbors(t, uncovered):
                    covered.add(n)

    gun = None
    if ammo > 0:
        bk = None
        for k, t in threats.items():
            if t["r"] > gun_range:
                continue
            key = (0 if t["cls"] == "striker" else 1,
                   1 if k in covered else 0, t["r"])
            if bk is None or key < bk:
                bk, gun = key, k

    return {"intercept": launches, "retarget": retarget, "gun": gun}


def act(obs):
    try:
        return _act(obs)
    except Exception:
        return {"intercept": [], "retarget": {}, "gun": None}