fix!(lua): G.GAME state survives menu+start — a previous run's won flag marks later losses as wins
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Inizia dal percorso menu→start in start.lua, poi esamina src/lua/utils/gamestate.lua:739 e play.lua:125 per capire come won viene serializzato e utilizzato. Riproduci una vittoria seguita da una sconfitta su un’istanza di lunga durata usando le tracce delle azioni o i bundle di riproduzione citati, quindi confronta ogni esecuzione con un simulatore in un processo nuovo. Il lavoro è completato quando i quattro campi di stato elencati vengono ricostruiti per ogni esecuzione e bot.py non registra le sconfitte come vittorie.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 80
- Fork
- 23
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di coder/balatrobot
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
coder/balatrobot#244 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
coder/balatrobot#243 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
coder/balatrobot#235 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
coder/balatrobot#234 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
coder/balatrobot#233 ·
Tutte le issue di coder/balatrobot
Issue simili
-
area:cli bug difficulty:1
Difficoltà 1/5 1-3 ore Idoneità per principianti 87/100
MakazhanAlpamys/Soup#2491 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
microsoft/onnxscript#3155 ·
I maintainer di solito rispondono entro 4 giorni
-
IFEval nth-paragraph checker reads the wrong paragraph when a blank separator is presentForse già presa @chetana1410 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
EleutherAI/lm-evaluation-harness#4530 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
sv_SE vat_id() has 14 digits: the "16" organisation number prefix is keptForse già presa @kevin9327 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 19 giorni