Attacker

phase_locked_ring

rank #4Elo 1287house league, persona generalist2026-09-30_attacker_phase_locked_ring

Idea: Probe the engine's bearing convention with the first four launches, then use per-drone dogleg waypoints so every striker crosses the 150 u identification ring on the same tick, evenly spaced around the circle.

Phase-locked ring (attacker).

How it works ------------

  1. Tick 0 launches four strikers at requested bearings 0, 90, 180 and 270. Read as degrees, those are four compass points. Read as radians, they are about 0, 96, 193 and 289 degrees. Either way the probe is spread out. On the next tick the bot sees the four drones and fits which convention the engine uses: radians or degrees, math or compass orientation. It then aims every later launch exactly.
  2. The rest of the budget goes out four per tick, the engine cap: 24 more strikers and 8 decoys. Final approach slots are 36 bearings spaced evenly around the ring.
  3. Launches are spread over about 9 ticks, so without correction the swarm would arrive over about 9 ticks too. Each drone is steered every tick toward a waypoint on the 150 u ring. The waypoint is rotated so that the drone's path length equals speed * (ticks left until a common target tick). Earlier launches fly a longer dogleg. So every striker is identified on the same tick, from 36 different directions. Decoys aim 3 ticks earlier, slightly ahead of the strikers.

Why it holds up against each defender ------------------------------------- Inside the id range a striker has about 31 ticks to reach the asset. The defender can launch only 2 interceptors per tick and holds 20. When about 28 strikers appear at once:

  • miss_budget_scheduler: every striker's deadline is equally tight, so its model says "only one try fits" for many of them. It then fires pairs, which drains its 20-round magazine even faster. Deadline ordering gives it nothing to sort by. Once stock runs out, the gun's one shot per tick cannot stop the rest, and 3 hits destroy the asset.
  • discriminating_ledger: one interceptor per striker still means at most 20 shots against 28 strikers, plus about 3 expected misses. That leaves roughly 10 or more leakers against a gun that fires once per tick. The decoys cost it nothing, but they cost us only 4 credits in total.
  • identify_then_engage: it has the same confirmed-only limit as the ledger bot, and it has no pair logic. The result is the same saturation.
  • layered: it engages unknowns near the id ring by time to impact. The decoys cross slightly ahead of the strikers and draw its early, reserve-limited shots. The striker wave then arrives all at once.
  • nearest_first: it shoots whatever is closest, so the leading decoy screen soaks interceptors before the strikers even come into the picture.
  • gun_only: it gets one shot per tick with low probability at range. Simultaneous arrival from 36 bearings minimizes the ticks it has to work with.

Because arrival is synchronized to the tick, no defender can win by spreading its fixed launch rate over time. Launch rate is the resource this attacker attacks.

80.5%win rate
0.54cost exchange
760matches
night 3first night (2026-09-30)
Best match
vs gun_only · its score 0.926 · seed 2 · open →
Worst match
vs magazine_staging_pingpong · its score 0.222 · seed 9 · open →

Against each opponent

its mean score
cohort_gap_shell_split_gun_window_stretc0.887
greedy_value_model0.885
eta_balanced_leaker_split_gun_funnel0.884
screen_cohort_writeoff_full_magazine_nea0.881
nearest_first0.881
cohort_screen_skip_shell_balanced_gun0.881
trailing_cohort_full_magazine_deadline_g0.881
first_cohort_screen_skip_balanced_magazi0.881
cohort_fingerprint_full_magazine_gun_swe0.879
screen_skip_reusable_seeker_pool0.878
radar_cohort_screen_skip_edge_magazine0.877
screen_cohort_skip_edge_full_magazine_de0.877
cohort_gated_miss_reserve_deadline_gun0.877
arrival_cohort_fingerprint_edge_strike0.877
birth_cohort_screen_writeoff_reserve_ref0.877
cluster_blast_column_breaker0.876
radar_cohort_fingerprint_spread_gun_rema0.876
screen_writeoff_shell_parity_gun_slot_pl0.876
annealed_assignment_eager0.875
radar_edge_cohort_timing_full_magazine0.875
cohort_screen_blind_one_per_striker0.875
decoy_carrier_retarget_shell_balancer0.874
layered0.874
lull_cohort_shell_balanced_magazine0.873
split_leftover_far_engage_gun_deadline0.872
shell_balanced_id_gated_gun_dedup0.872
ledger_backscheduled_idband_rehomer0.871
gun_ledger_deadline_reserve0.867
cohort_gap_profiler0.866
bait_cohort_skip_rear_shell_first_gun_ha0.866
depth_lag_band_precommit0.866
miss_budget_scheduler0.865
reveal_timed_prelaunch0.864
id_gated_shell_breaker0.863
identify_then_engage0.862
screen_reveal_rear_shell_first0.861
birth_cohort_prefire_deadline_reserve0.858
id_only_deadline_magazine_gun_releaser0.845
id_gated_magazine_hold0.845
radar_cohort_presort_reserve_finisher0.845
bait_cohort_blind_full_magazine_on_strik0.845
id_gated_striker_only_shell_breaker0.845
bait_cohort_hover_blind_full_wave_magazi0.845
defender_id_gate_magazine_vault0.845
birth_cohort_edge_magazine_shell_balance0.844
birth_cohort_lull_splitter0.843
radar_entry_cohort_screen_writeoff0.843
annealed_assignment0.834
decoy_carried_magazine_retarget_staging0.822
type_ledger_retarget_first0.820
class_gated_magazine_keeper0.819
origin_parked_jink_stall0.814
deadline_queue_id_gated_overlap_saver0.812
cohort_screen_skip_deadline_reserve0.805
gun_first_ledger_edf_reserve0.802
discriminating_ledger0.801
convergence_hold_burst_packer0.799
id_gated_front_shell_magazine_rear_shell0.797
cohort_edge_picket_ledger0.777
gun_only0.771
convergent_deadline_packer0.751
deadline_cluster_ledger0.732
backscheduled_blast_packer0.713
defender_ring_triplet_neighbor_blast0.713
wave_adaptive_deadline_convergence_cocov0.686
hover_bank_late_binder0.542
loiter_pool_convergence_volley0.459
dither_parked_magazine0.379
convergence_blast_scheduler0.378
hover_bank_double_lattice0.337
parked_hover_ring_doublecover0.337
loiter_then_collapse0.336
contracting_ring_blaster0.318
magazine_staging_pingpong0.271
pooled_pingpong_cluster_committer0.255
origin_pingpong_salvo0.235

Matches

last night
OpponentSeedResultScore
discriminating_ledger9breached0.868watch
miss_budget_scheduler9breached0.864watch
reveal_timed_prelaunch9breached0.858watch
convergence_blast_scheduler9defended0.237watch
loiter_then_collapse9defended0.235watch
backscheduled_blast_packer9defended0.441watch
dither_parked_magazine9defended0.234watch
cluster_blast_column_breaker9breached0.864watch
contracting_ring_blaster9defended0.236watch
deadline_cluster_ledger9breached0.864watch
Record · 2026-09-30_attacker_phase_locked_ring.meta.json
backendcli
date2026-09-30
dry_runFalse
escalationFalse
modelopus
name2026-09-30_attacker_phase_locked_ring
personageneralist
prompt_version2026-09-29.1
raw_responseout/house_raw/2026-09-30T033207_cli_attacker_generalist.md
resultbeat_target: True, field_mean: 0.851, rank: 2
roleattacker
targetfield
tokensinput: 4766, output: 11532
Source · bots/house/2026-09-30_attacker_phase_locked_ring.py
"""Idea: Probe the engine's bearing convention with the first four launches, then use per-drone dogleg waypoints so every striker crosses the 150 u identification ring on the same tick, evenly spaced around the circle.

Phase-locked ring (attacker).

How it works
------------
1. Tick 0 launches four strikers at requested bearings 0, 90, 180 and 270.
   Read as degrees, those are four compass points. Read as radians, they are
   about 0, 96, 193 and 289 degrees. Either way the probe is spread out. On
   the next tick the bot sees the four drones and fits which convention the
   engine uses: radians or degrees, math or compass orientation. It then aims
   every later launch exactly.
2. The rest of the budget goes out four per tick, the engine cap: 24 more
   strikers and 8 decoys. Final approach slots are 36 bearings spaced evenly
   around the ring.
3. Launches are spread over about 9 ticks, so without correction the swarm
   would arrive over about 9 ticks too. Each drone is steered every tick
   toward a waypoint on the 150 u ring. The waypoint is rotated so that the
   drone's path length equals speed * (ticks left until a common target
   tick). Earlier launches fly a longer dogleg. So every striker is
   identified on the same tick, from 36 different directions. Decoys aim 3
   ticks earlier, slightly ahead of the strikers.

Why it holds up against each defender
-------------------------------------
Inside the id range a striker has about 31 ticks to reach the asset. The
defender can launch only 2 interceptors per tick and holds 20. When about 28
strikers appear at once:

* miss_budget_scheduler: every striker's deadline is equally tight, so its
  model says "only one try fits" for many of them. It then fires pairs,
  which drains its 20-round magazine even faster. Deadline ordering gives it
  nothing to sort by. Once stock runs out, the gun's one shot per tick
  cannot stop the rest, and 3 hits destroy the asset.
* discriminating_ledger: one interceptor per striker still means at most 20
  shots against 28 strikers, plus about 3 expected misses. That leaves
  roughly 10 or more leakers against a gun that fires once per tick. The
  decoys cost it nothing, but they cost us only 4 credits in total.
* identify_then_engage: it has the same confirmed-only limit as the ledger
  bot, and it has no pair logic. The result is the same saturation.
* layered: it engages unknowns near the id ring by time to impact. The
  decoys cross slightly ahead of the strikers and draw its early,
  reserve-limited shots. The striker wave then arrives all at once.
* nearest_first: it shoots whatever is closest, so the leading decoy screen
  soaks interceptors before the strikers even come into the picture.
* gun_only: it gets one shot per tick with low probability at range.
  Simultaneous arrival from 36 bearings minimizes the ticks it has to work
  with.

Because arrival is synchronized to the tick, no defender can win by
spreading its fixed launch rate over time. Launch rate is the resource this
attacker attacks.
"""

import math

NAME = "phase_locked_ring"
ROLE = "attacker"

_S = {}


def reset(seed=None):
    _S.clear()


def _init():
    if "init" not in _S:
        _S.update({
            "init": True,
            "probe_tick": None,
            "mode": None,
            "plan": [],
            "T_arr": None,
        })


PROBE = [0.0, 90.0, 180.0, 270.0]

# Hypotheses: (request -> actual angle in radians, actual angle -> request)
HYP = {
    "rad_math": (lambda b: b, lambda a: a),
    "deg_math": (lambda b: math.radians(b), lambda a: math.degrees(a)),
    "rad_comp": (lambda b: math.pi / 2 - b, lambda a: math.pi / 2 - a),
    "deg_comp": (lambda b: math.pi / 2 - math.radians(b),
                 lambda a: 90.0 - math.degrees(a)),
}


def _adiff(a, b):
    d = (a - b) % (2 * math.pi)
    if d > math.pi:
        d -= 2 * math.pi
    return abs(d)


def _theta(r, rho, L):
    if r <= 1e-6:
        return 0.0
    c = (r * r + rho * rho - L * L) / (2.0 * r * rho)
    c = max(-1.0, min(1.0, c))
    return math.acos(c)


def act(obs):
    try:
        return _act(obs)
    except Exception:
        return {"launch": [], "steer": {}}


def _act(obs):
    _init()
    rules = obs.get("rules", {}) or {}
    tick = int(obs.get("tick", 0))
    budget = float(obs.get("budget", 0.0))
    R = float(rules.get("spawn_radius", 490.0))
    rho = float(rules.get("id_range", 150.0))
    vs = float(rules.get("striker_speed", 4.0))
    vd = float(rules.get("decoy_speed", 4.0))
    cs = float(rules.get("striker_cost", 2.0))
    cd = float(rules.get("decoy_cost", 0.5))
    per_tick = int(rules.get("attacker_launches_per_tick", 4))
    ax, ay = 0.0, 0.0
    try:
        ap = obs.get("asset", {}).get("pos", [0.0, 0.0])
        ax, ay = float(ap[0]), float(ap[1])
    except Exception:
        pass

    drones = obs.get("drones", []) or []
    launch = []
    steer = {}

    # Phase 0: probe launch
    if _S["probe_tick"] is None:
        n = min(per_tick, 4, int(budget // cs))
        for b in PROBE[:n]:
            launch.append({"type": "striker", "bearing": b})
        _S["probe_tick"] = tick
        return {"launch": launch, "steer": steer}

    # Phase 1: detect bearing convention, build plan
    if _S["mode"] is None:
        angs = []
        for d in drones:
            p = d.get("pos", [0, 0])
            angs.append(math.atan2(p[1] - ay, p[0] - ax))
        if not angs and tick - _S["probe_tick"] < 5:
            return {"launch": [], "steer": {}}
        best, berr = "rad_math", float("inf")
        if angs:
            for k, (f, _) in HYP.items():
                preds = [f(b) for b in PROBE]
                err = sum(min(_adiff(a, p) for p in preds) for a in angs)
                if err < berr:
                    best, berr = k, err
        _S["mode"] = best
        f, finv = HYP[best]

        td = tick
        remaining_slots = 36 - 4
        batches = (remaining_slots + per_tick - 1) // max(1, per_tick)
        last = td + batches - 1
        T_arr = last + int(math.ceil((R - rho) / min(vs, vd))) + 4
        _S["T_arr"] = T_arr

        # finals of probe drones
        finals = []
        if angs:
            for d in drones:
                p = d.get("pos", [0, 0])
                x, y = p[0] - ax, p[1] - ay
                r = math.hypot(x, y)
                phi = math.atan2(y, x)
                L = vs * (T_arr - tick)
                finals.append(phi + _theta(r, rho, L))
        else:
            for b in PROBE:
                L = vs * (T_arr - _S["probe_tick"])
                finals.append(f(b) + _theta(R, rho, L))
        offset = finals[0] if finals else 0.0
        step = 2 * math.pi / 36
        slots = [offset + j * step for j in range(36)]
        used = set()
        for fa in finals:
            bj, bd = None, 9.0
            for j, s in enumerate(slots):
                if j in used:
                    continue
                dd = _adiff(s, fa)
                if dd < bd:
                    bj, bd = j, dd
            if bj is not None:
                used.add(bj)
        free = [slots[j] for j in range(36) if j not in used]
        plan = []
        nb = max(1, batches)
        for i, F in enumerate(free):
            typ = "decoy" if i % 4 == 2 else "striker"
            bt = i % nb
            tl = td + bt
            T = T_arr - 3 if typ == "decoy" else T_arr
            spd = vd if typ == "decoy" else vs
            L = spd * (T - tl)
            phi = F - _theta(R, rho, L)
            plan.append((tl, typ, finv(phi)))
        _S["plan"] = plan

    # Launch scheduled drones (strikers first within a tick)
    due = [p for p in _S["plan"] if p[0] <= tick]
    due.sort(key=lambda p: (p[0], 0 if p[1] == "striker" else 1))
    left = budget
    sent = []
    for p in due:
        if len(launch) >= per_tick:
            break
        c = cs if p[1] == "striker" else cd
        typ = p[1]
        if left + 1e-9 < c:
            if left + 1e-9 >= cd:
                typ, c = "decoy", cd
            else:
                sent.append(p)
                continue
        launch.append({"type": typ, "bearing": float(p[2])})
        left -= c
        sent.append(p)
    if sent:
        ss = set(id(p) for p in sent)
        _S["plan"] = [p for p in _S["plan"] if id(p) not in ss]

    # Steering: phase-lock arrival at the id ring
    T_arr = _S["T_arr"]
    if T_arr is not None:
        for d in drones:
            try:
                did = d.get("id")
                p = d.get("pos", [0, 0])
                x, y = p[0] - ax, p[1] - ay
                r = math.hypot(x, y)
                if r <= rho + 6.0:
                    continue
                is_decoy = d.get("type") == "decoy"
                T = T_arr - 3 if is_decoy else T_arr
                spd = vd if is_decoy else vs
                L = spd * (T - tick)
                if L <= (r - rho) + 1.0:
                    steer[did] = None
                    continue
                th = _theta(r, rho, L)
                phi = math.atan2(y, x) + th
                steer[did] = [ax + rho * math.cos(phi), ay + rho * math.sin(phi)]
            except Exception:
                continue

    return {"launch": launch, "steer": steer}