Skip to content

Add gen7 compatibility#87

Open
hagitran wants to merge 5 commits into
UT-Austin-RPL:mainfrom
hagitran:main
Open

Add gen7 compatibility#87
hagitran wants to merge 5 commits into
UT-Austin-RPL:mainfrom
hagitran:main

Conversation

@hagitran

Copy link
Copy Markdown

Adds gen7ou: replay parser, observation space, tokenizer, and action mapping for mega/Z-moves (sharing the +9 slots like tera).

The main issue is Z-moves: the log shows the Z-move name, not the base move, so the base move is resolved by crystal type in forward fill when already revealed, otherwise enforced in team prediction and a final fallback in from_ReplayAction. Also haven't tested online play.

  • All gen7 replays sampled by me (100 from high ELO and 100 recent replays) passed.
  • No regressions on gen1–4/9
  • Tokenizer is append-only on v1 (existing ids unchanged)
  • gen7uu and gen7nu also enabled, but I haven't tested all gen7 formats yet. gen7ubers is left out for now (a few parser bugs around Marshadow's Z-move name, Ultra Burst + Z-move, and a team-prediction crash).

hagitran and others added 5 commits June 4, 2026 18:57
- Parser: unlock gen 7 in _parse_gen; implement _parse_zpower,
  _parse_mega, _parse_burst; thread can_z/can_mega flags from Turn
  through ReplayState to UniversalState; add MultipleZMove/MultipleMega
  consistency checks
- Z-move names stripped from had_moves after use (one-turn transforms,
  not permanent move slots); backup_from_future trims full-PP predictor
  guesses when an observed move would overflow the 4-slot limit
- check_gimmick_consistency: mega valid in gens 6-7, Z only gen 7;
  Zoroark ActionMisaligned skipped when ZOROARK warning is set
- Tokenizer: DefaultObservationSpace-v1-gen7 built from 200 gen7ou
  replays (2639 tokens); gen7ou added to SUPPORTED_BATTLE_FORMATS
- Gen7ObservationSpace: DefaultObservationSpace + can_z/can_mega (50 dims)
- action_idx_to_BattleOrder: +9 maps to mega/Z/tera based on what's
  available; Z only applied when move matches the held crystal
- stat_reader: PreloadedSmogonUsageStats falls back to full history when
  a date-windowed load is empty (handles retired formats with recent dates)
- Baselines: gen 7 added to BASELINES_BY_GEN (fixes KeyError: 7)
- 196/200 bootstrap replays pass full pipeline; 4 remaining are data
  quality issues (incomplete downloads, early forfeit)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… replays parse.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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