Skip to content

BDSP AutoStory: the fault sweep uses the shared fault classes - #423

Draft
dayfine wants to merge 289 commits into
bdsp/sim-goldensfrom
bdsp/sim-faults
Draft

dayfine wants to merge 289 commits into
bdsp/sim-goldensfrom
bdsp/sim-faults

Conversation

@dayfine

@dayfine dayfine commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Depends on #421. Base bdsp/sim-goldens (#421), with nav/shared merged in (it carries #422's Pokemon_SimFaults and #479's shared failure classes and Pokemon_StoryFaultSweep); the diff also shows nav/shared's commits until the BDSP stack takes them.

BDSP's fault sweep had its own FaultClass enum and its own test class. It now uses the shared Pokemon::FaultClass (its GRASS_BATTLES is the shared WILD_BATTLES) and runs on the shared StoryFaultSweep: BDSP gives its rows (00.00 to 01.11), an injector per sim fault it injects (scene_end_pose, battle_opening, wild_battles, scene_early, slow_fade_in) and its known-failing list (empty). This changes behavior: tests are named by the shared class id (PokemonBDSP::AutoStory - Fault sweep: 00.04, wild_battles) instead of BDSP's own names, a row that fails clean reports "not swept", and a new test checks that the known-failing list names only real tests. Classes BDSP's sim does not inject yet (lost_tap, unseen_step, mount_lost, late_fade, warp_no_op, dark_map) are not swept. BDSP's SimMisses counters stay as they are for now.

The nav/shared merge also moved BDSP onto the moved screen events (CommonTools/ScreenEvents, namespace PokemonAutomation), NintendoSwitch::SwitchHomeObserver and FastCodeEntry::type_on_system_keyboard; TalkOverRule keeps BDSP's door settle next to nav/shared's per-rule calm.

Testing: Fork Draft CI builds and runs the unit tests (no local build: console B was running). Code health: no findings in the files this PR changes; the 100 reported vs bdsp/sim-goldens come from nav/shared.

dayfine and others added 29 commits November 12, 2026 14:14
…ment, README counts

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…shared expect_equal, frame-name parsing

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
… a failed step (red)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
… a failed step stops the segment; comment content, include order, named literals, optional frame colour

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…is public and tested, <utility>

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…or, static_cast, <utility>

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
The README's prepare_parity.py command had no --publisher-revision, and the
script's default pin was older than the workflow's, so following the README
on the pinned checkout failed. The default now matches the workflow pin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine and others added 30 commits November 14, 2026 14:05
AutoStory: one story engine over a backend, save mode from checkpoint metadata.
A reload after that save would land mid-checkpoint while the retry runs
from step 1. The engine now records the save and ends the checkpoint's
attempts there.
…text

A test pins that the engine's SAVE step saves nothing in a testing run;
StoryStepExecutor::run says a game off the engine must gate it itself.
The step reader accepts once_per_save. The Save and Verify Mode texts
say when After verification saves.
Declared poses reach the run as the event layer's pose; a zone's spot and
heading are not carried until a game has a position reader.
… value

INTEGER_ROWS stays: FRLG's foe_threats and BDSP's avoid args use it.
A user's run skips dev-only rows, so the row a reload follows there must
autosave as well.
story_failure_class_info() throws for a class with no row in its place,
and a test checks every class has one.
Covers the first frame's rises, rose/fell edges, the capacity drop and
describe().
AutoStory: review fixes on the shared engine (#312, #313, #332, #474, #479)
…again

StoryDataTests takes the path of a pokesim-story-wire-cases/2 file, reads
each case with the native pose, step and checkpoint readers and checks the
accept/reject and the record read. The workflow pins PokemonSimulation
4e023f3 (#104, cases in the action-plus-args form) and runs it on all three
platforms.
Answers the #312 review: the Switch FireRed/LeafGreen are the GBA releases
reissued, one version per language with no in-game option, so all six
languages stay (as in upstream's FRLG programs). Gen 8-9 games have one
Spanish, so one "es". Code that reads text takes the language option.
…e fails loudly

The standalone main moves to devtools/story-data-tests/StoryDataMain.cpp so program source no longer includes a devtools header; other argument counts print usage and exit 2. The wire-case reader reads a case's own fields outside the try, so a malformed case file throws instead of reading as a rejection. Also plain statements for the verified fields and explicit includes.
Fix shared AutoStory engine review nits
Story data codec: run the shared wire cases natively again
A watch that ends in wall time reads a window full of dropped frames as
"not seen". FrameCoverage records the capture times of the frames a
watcher was handed and finds the largest gap in the window; judge_watch()
returns SEEN, NOT_SEEN (frames cover the window) or UNKNOWN (a gap longer
than max_gap). CoveredWatcher wraps any VisualInferenceCallback and can
stop on the first frame captured at a deadline; run_watched() and
watch_for() end a window in frame time, bounded by a wall-clock cap.
Game languages: FRLG keeps six languages, one Spanish (#312 review)
Review of #114 (dropped frames):
- A hold watcher fires a hold after the screen shows, so a screen that
  shows in the window's last hold fired only after the watch stopped.
  CoveredWatcher now keeps watching until a frame captured `tail` after
  the window's end, still bounded by the wall-clock cap.
- largest_gap rounds up to whole ms, so a gap a fraction over max_gap is
  UNKNOWN, not NOT_SEEN.
- Frames captured before the window opened are not handed to the wrapped
  watcher, so a fire on one is not SEEN.
- The window's end is a constructor argument (watch_for) or set by
  end_at() between sessions (run_watched), documented as such.
- WatchLimits carries max_gap, tail, cap and the poll period; run_watched
  checks only fired(); <cstddef> for size_t.
StoryCheckpoint::postconditions gets = {} so designated initializers that
leave it out build on Windows Clang (-Wmissing-designated-field-initializers).
The eight AutoStory test tables now hold each case's name next to its input
and expectation, as code health's test-case rule asks; the step JSON tests
pass the name to the readers as the parse source.
Conflicts: TalkOverRule keeps BDSP's door settle (DOOR_QUIET, DOOR_CALM,
PLAYER_STILL) next to nav/shared's per-rule `calm`; SCREEN_EVENT_COUNT is 12
with PLAYER_STILL last; the system keyboard detector is nav/shared's, so BDSP's
new game types through FastCodeEntry::type_on_system_keyboard. The screen
events moved to CommonTools/ScreenEvents in namespace PokemonAutomation and
SwitchHomeObserver to NintendoSwitch: BDSP's includes and names follow.
BDSP's sweep is now data for Pokemon_StoryFaultSweep: its rows (00.00 to
01.11), an injector per sim fault its sim injects (scene_end_pose,
battle_opening, wild_battles, scene_early, slow_fade_in) and its
known-failing list. Tests are named by the shared class id
("PokemonBDSP::AutoStory - Fault sweep: 00.04, wild_battles") instead of
BDSP's own names, a row that fails clean reports "not swept", and the shared
test checks the known-failing list names only real tests.
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.

4 participants