fix!(lua): G.GAME state survives menu+start — a previous run's won flag marks later losses as wins
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
調査の方向性
start.lua の menu→start パスから始め、次に src/lua/utils/gamestate.lua:739 と play.lua:125 を調べて、won がどのようにシリアライズされ消費されるかを確認します。引用されているアクショントレースまたは repro バンドルを使い、長期間存続する 1 つのインスタンス上で勝利に続いて敗北するケースを再現し、各実行を新しいプロセスのシミュレーターと比較します。4 つの一覧表示された状態フィールドが実行ごとに再構築され、bot.py が敗北を勝利として記録しないことが完了条件です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 80
- フォーク
- 23
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
coder/balatrobot のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
coder/balatrobot#244 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
coder/balatrobot#243 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
coder/balatrobot#235 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
coder/balatrobot#234 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
coder/balatrobot#233 ·
coder/balatrobot の issue をすべて見る
似ている issue
-
DBFS append mode silently overwrites existing files対応中かも @IlyaKhalafi が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
fsspec/filesystem_spec#2429 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: Retrieval rerank fallback statistics stay zero after provider failure対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
volcengine/OpenViking#7014 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
fedora-copr/copr#4600 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ansys/pydpf-core#3620 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信