Skip to content

Max Lair: keep going on an opponent misread (upstream #1851 follow-up) - #172

Closed
dayfine wants to merge 3 commits into
swsh/maxlair-boss-testsfrom
swsh/maxlair-boss-fix
Closed

dayfine wants to merge 3 commits into
swsh/maxlair-boss-testsfrom
swsh/maxlair-boss-fix

Conversation

@dayfine

@dayfine dayfine commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Mirror of upstream PokemonAutomation#1851 plus one commit addressing Mysticial's review: a persistent opponent/stage mismatch after the summary retry no longer resets the adventure.

  • read_battle_menu: log + dump image on mismatch, then continue. A wrong opponent only costs move choice; accept_opponent() still never records a rental as the boss.
  • Drop the rental-form whitelist (compatible_rental_forms): an ambiguous read passes in a rental battle when no candidate is a boss.
  • Tests: 16 of 18 cases unchanged; {lycanroc-midday, magmar} now accepted; unknown-slug case removed with the rule.

Testing: Test_MaxLairBossState table tests; fork CI (mac, windows-clang, ubuntu). Not yet run on hardware; the previous tip (aab6684) ran 30+ adventures on console A.

🤖 Generated with Claude Code

https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss

const std::string& opponent_slug = *opponent.begin();
// wins is incremented after each battle is won: battles 1-3 (wins < 3) are
// against rental Pokemon, and battle 4 (wins == 3) is against the legendary boss.
const bool in_boss_battle = (wins == 3);

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: define this as an internal reader function in the unnamed namespace on line 16

namespace {

bool IsBossBattle(const GlobalState & state) {
   return state.wins == 3;
}

} // namspace 

@dayfine

dayfine commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

bug report.log

dayfine and others added 3 commits November 5, 2026 23:06
Port the state fix and regressions from e17fba3 in fork #172. Supported rental forms sharing one OCR species remain candidates before the boss stage; unrelated, unknown and boss-stage ambiguity still reject. Preserve the existing inline opponent-read flow.

The 19 native state tests reproduced two failures before the fix and all pass after it. No console actions performed.
A read that still doesn't fit the battle stage after the summary retry is
almost always an OCR misread, and a wrong opponent only costs move choice.
Log it and continue instead of resetting the adventure. The boss stays
protected: accept_opponent() still never records a rental as the boss.

Drop the rental-form whitelist: an ambiguous read is fine in a rental
battle as long as no candidate is a boss, which is all that matters once a
mismatch no longer resets.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
@dayfine dayfine changed the title Fix Max Lair Boss Finder after failed adventures (behavior change) Max Lair: keep going on an opponent misread (upstream #1851 follow-up) Nov 8, 2026
@dayfine
dayfine force-pushed the swsh/maxlair-boss-tests branch from e019799 to 1e5f52a Compare November 8, 2026 07:50
@dayfine
dayfine force-pushed the swsh/maxlair-boss-fix branch from e17fba3 to 76266ba Compare November 8, 2026 07:50
@dayfine
dayfine removed this pull request from stack #225 November 11, 2026 03:20
dayfine added a commit that referenced this pull request Nov 11, 2026
)

* Fix Max Lair boss inference and boss-catch reporting

* Max Lair: preserve supported rental-form ambiguity

Port the state fix and regressions from e17fba3 in fork #172. Supported rental forms sharing one OCR species remain candidates before the boss stage; unrelated, unknown and boss-stage ambiguity still reject. Preserve the existing inline opponent-read flow.

The 19 native state tests reproduced two failures before the fix and all pass after it. No console actions performed.

* Max Lair: keep going on an opponent misread instead of resetting

A read that still doesn't fit the battle stage after the summary retry is
almost always an OCR misread, and a wrong opponent only costs move choice.
Log it and continue instead of resetting the adventure. The boss stays
protected: accept_opponent() still never records a rental as the boss.

Drop the rental-form whitelist: an ambiguous read is fine in a rental
battle as long as no candidate is a boss, which is all that matters once a
mismatch no longer resets.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss

* Max Lair: use is_boss_battle() for the stage check in accept_opponent()

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss

* Max Lair: keep the battle read's candidates when the summary read is empty

An ambiguous battle read (both Persian forms) was replaced by an empty
summary read, which accept_opponent() rejects. Keeping the candidates
lets a rental battle go on with the ambiguity it already accepts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss

* Max Lair: an ambiguous read is accepted only in rental battles (wins < 3)

74c0512 replaced the `wins < 3` check on ambiguous reads in
accept_opponent() with `!is_boss_battle()`, which also accepted an
ambiguous read at wins == 4, after the last battle. That broke the existing
test "form ambiguity is only valid during rental battles". Add
is_rental_battle() and use it there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss

* Max Lair: limit the fix to not recording a wrong boss

Back to main's behavior except one rule: at the boss stage, accept_opponent()
records the boss only from a single boss-species read. A rental misread
(Kyurem read as Mimikyu on 2026-11-02, which later crashed Boss Finder)
no longer becomes the boss; a later turn's correct read still records it.

Reverts the other changes in this PR (stage-mismatch retries, the rental-form
ambiguity rules, the summary fallback, continuing instead of resetting, and
boss_if_caught() requiring four wins) to keep the change to that one rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
@dayfine

dayfine commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Merged upstream as PokemonAutomation#1851 (in main as b79d9e0); closing the fork copy.

@dayfine dayfine closed this Nov 12, 2026
@dayfine
dayfine deleted the swsh/maxlair-boss-fix branch November 13, 2026 03:26
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.

1 participant