Skip to content

Add the hand-value riichi response candidate (#384) - #385

Merged
lisbun merged 2 commits into
mainfrom
ccr-f5abd310-arutk8
Nov 17, 2026
Merged

lisbun merged 2 commits into
mainfrom
ccr-f5abd310-arutk8

Conversation

@lisbun

@lisbun lisbun commented Nov 17, 2026

Copy link
Copy Markdown
Owner

目的

#384(承認済み)の実装。他家リーチ下・1向聴の押し引きで、#377の候補が使うdora枚数の代わりに役を含む打点推定を使い、押し返しの閾値を門前と副露で分ける候補を追加する。評価(東1局の対比較)はこのPRの対象外で、merge後に#384で行う。

変更

  • src/lisjong/policies/riichi_response_hand_value.py(新規)
    • estimate_one_shanten_hand_value: 打牌後1向聴の各打牌について、聴牌した場合のロン点(evaluate_win)を見えない残り枚数で加重平均し、その最大値を返す。門前はリーチ込み・裏ドラ除外、副露は役がなければ0、親は2/3で子換算。Fractionで返す。1向聴にならない入力はHandValueEstimateError
    • RiichiResponseHandValueParameters(値から生成するidentity)、RiichiResponseHandValuePlacementAwareSpeedCallPolicy、探索空間v2(8候補、固定順)
    • ゲートと押し返し・降りの動作は#377の実装(_without_opponent_riichi、_minimum_danger_actions)を再利用し、複製しない。点数計算の赤の扱いはriichi_dama_branch.winning_tile_forを再利用
  • src/lisjong/policies/__init__.py: export追加
  • tests/test_riichi_response_hand_value.py(新規、22 tests): 門前のリーチ込みの値(2,000 / 3,900)、親の換算、副露の役(白1,000 / 2,000)、副露の役なし0点、1向聴でない入力の拒否、他家リーチに依存しないこと、門前・副露それぞれの押し返し閾値、残り山、降りの閾値、役なし副露の降り、ゲート外でChampionと同じこと、パラメータ検証・identity・探索空間
  • 文書: docs/riichi-response-hand-value-candidate.md(新規)、docs/policy-status.mdに1行

Championと#377の候補の挙動は変えない。

情報境界

入力はPolicyInputの公開情報(自分の手牌・副露、見えている牌、ドラ表示牌、風、親)だけ。他家の手牌・山・裏ドラは使わない。instanceに状態を持たない。

確認

  • python -m unittest discover -s tests -p "test_riichi_response*.py": 38 tests OK(新規22 + 既存RR 16)
  • python -m ruff format --check . / python -m ruff check .: PASS
  • full suiteはCIに任せる

Refs #384


Generated by Claude Code

Replace the dora count of the #377 candidate with an estimate of the ron
value after reaching tenpai (yaku, fu and dora; riichi for closed hands, zero
for open hands without yaku; dealer points converted to non-dealer points),
and split the push threshold between closed and open hands. Adds the fixed
search space v2 (8 candidates). The Champion and the dora candidate are
unchanged.

Refs #384

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GJ2X5PJT8MPabUgHSnFDr5

lisbun commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Self-review(Claude Code): head 0d02211a84cc276a7fb6277ae7302235012ec09e。

  • #384の承認済み計画どおり: 打点推定(門前はリーチ込み・裏ドラ除外、副露は役なし0、親は2/3換算、Fraction)、門前/副露別の押し返し閾値、共通の降り閾値、探索空間v2の8候補(固定順)。ゲートと押し返し・降りの動作は#377の実装を再利用し、Championと#377候補は変更なし
  • 情報境界: 入力はPolicyInputの公開情報だけ(自分の手牌・副露、見えている牌、ドラ表示牌、風、親)。他家の手牌・山・裏ドラは使わない。instanceに状態なし
  • 初回CIの5件の失敗は、公開名一覧とstructural_efficiency利用者一覧のregistry testへの登録漏れで、0d02211で修正済み
  • CI 5 job すべてsuccess。blockingなし、squash mergeする

Generated by Claude Code

@lisbun
lisbun merged commit 8fc8211 into main Nov 17, 2026
5 checks passed
@lisbun
lisbun deleted the ccr-f5abd310-arutk8 branch November 17, 2026 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants