Skip to content

fix!: long sessions degrade — latency triples, then discard crashes on nil G.buttons #235

Description

@Khetnen

Description

After ~70 consecutive games on one instance (menu+start between games), we
observed two stages of degradation:

  1. Per-action latency roughly tripled relative to a fresh instance.

  2. The discard endpoint then began crashing on every game:

    discard.lua:91: attempt to index field 'buttons' (a nil value)
    

    src/lua/endpoints/discard.lua:91 does
    UIBox:get_UIE_by_ID("discard_button", G.buttons.UIRoot) with no nil guard —
    under the degraded latency the endpoint fires while the dealt hand is still
    animating and G.buttons hasn't been built yet.

Six consecutive seeds hit the crash at the end of one long campaign; the same
seeds ran clean on a fresh instance, so this is accumulation, not game content.
Likely the same underlying accumulation as coder/balatrollm#29 (game slowdown
after many rounds).

Impact

Long benchmark campaigns quietly slow down and then start failing runs for
reasons unrelated to the bot under test. Because balatrollm's executor starts
its instances once and cycles the whole task list through them, a large
multi-model campaign is exactly the workload that ages into this state.

Suggested Fix

  • In discard.lua (and play.lua, which shares the button-lookup pattern),
    wait for the button via a condition event instead of asserting on a structure
    that may not exist yet mid-animation.
  • Consider recycling instances every N runs for long campaigns (we restart the
    game between 80-seed batches and never see either symptom).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions