fix!(lua): G.GAME state survives menu+start — a previous run's won flag marks later losses as wins
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Comienza con la ruta menu→start en start.lua y luego inspecciona src/lua/utils/gamestate.lua:739 y play.lua:125 para ver cómo se serializa y consume won. Reproduce una victoria seguida de una derrota en una instancia de larga duración usando los trazados de acciones o los paquetes de reproducción indicados, y compara cada ejecución con un simulador en un proceso nuevo. Se considera terminado cuando los cuatro campos de estado indicados se reconstruyen en cada ejecución y bot.py no registra las derrotas como victorias.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
Starting a new run via menu + start on a long-lived instance does not fully
reset run state. We catalogued four distinct cross-run leaks, each confirmed by
replaying the identical action trace on a vanilla-faithful simulator (fresh
G.GAME every run) and diffing the full gamestate after every action.
G.GAME.won— after any win in the session, a later run'sGAME_OVER
loss reportswon = true. 16 instances observed; e.g. seedESVPE7W2: 696
chips vs Amber Acorn, unambiguous loss, live gamestatewon = true— leaked
from the previous run's ante-8 win on the same instance.
src/lua/utils/gamestate.lua:739serializes the raw global
(state_data.won = G.GAME.won), so the stale value flows straight to
clients;play.lua:125also branches on it.G.GAME.last_tarot_planet— a fresh run's first Fool copied the tarot
last used in the previous seed's run.G.GAME.pool_flags—gros_michel_extinctleaked: a run that never
owned a Gros Michel was offered Cavendish in the shop (seedLS4ECDCB).
Extinction only rolls for owned jokers at round end, so this is
vanilla-impossible in-run.G.GAME.used_jokerskey loss (mechanism unidentified, same family):
live's shop offeredj_bannerwhile Banner sat in play (seedLS6VZ3ES) —
impossible under the no-repeat pool. RNG forensics showed both sides drawing
identical raw picks from the same stream; the sim resampled per no-repeat,
live kept the duplicate, i.e. live had lost the key.
Root cause is presumably in how the run is rebuilt through the menu→start path
versus a fresh process launch (possibly SMODS-side), but balatrobot's start
endpoint is the natural place to defend against it.
Impact
This corrupts benchmark results, not just convenience:
- balatrollm runs its whole task list through long-lived instances (the
executor's port pool starts instances once) and starts each run with
menu+start.bot.pyends a run as won whengamestate["won"]is truthy — so
a loss that occurs on an instance after that instance has produced any win can
be recorded and published as a win (run_wonin the leaderboard data and
the CC0 dataset). - Leaks 2–4 make seeded runs non-reproducible: shop and consumable outcomes
depend on what earlier seeds did in the same instance.
Suggested Fix
In start.lua, after the run initializes, explicitly reset the leak-prone keys:
G.GAME.won = false, clear last_tarot_planet, and verify pool_flags /
used_jokers are freshly built. Alternatively (or additionally), document that
benchmark-grade data requires one process per run.
Repro bundles (action trace + both gamestates + field diff) available for every
seed cited.
- Lenguaje dominante
- Python
- Estrellas
- 80
- Forks
- 23
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de coder/balatrobot
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
coder/balatrobot#244 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
coder/balatrobot#243 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
coder/balatrobot#235 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
coder/balatrobot#234 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
coder/balatrobot#233 ·
Todos los issues de coder/balatrobot
Issues similares
-
area:docs documentation effort:M ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
mczielinski/ob-analytics#423 ·
Los mantenedores suelen responder en 1 día
-
flaky: test_ci_eval_scope_exclude never-matches case spends its 1s budget on the rollout waitAbiertoneeds-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
gke-labs/kube-agents#4838 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
danyuchn/asd-ste100-skill#60 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 64/100
Gathin23/cleanyourtv#3299 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
autowarefoundation/autoware_carla_scenario#1485 ·
Los mantenedores suelen responder en 1 día