Skip to content

AutoStory: frame coverage, covered watches and scene judges - #537

Draft
dayfine wants to merge 11 commits into
plza/upstream/s2-02from
plza/upstream/s2-03
Draft

dayfine wants to merge 11 commits into
plza/upstream/s2-02from
plza/upstream/s2-03

Conversation

@dayfine

@dayfine dayfine commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Depends on #536

Adds the screen judgements a step makes over time: frame coverage (which frames a watch actually inspected, and whether they are enough to say a screen did not show), a watcher wrapper that records it for judge_watch(), and the scene judges (a warp is a fade or the arrival banner; a talk or scene is over after a quiet overworld). The coverage check comes from the PLZA 03.08 catch (2026-11-14), where a missed banner under CPU load read as no banner. Tests: the FrameCoverage, CoveredWatch and SceneJudges suites, built and run by Fork Draft CI. Part of the re-split of #522/#524/#525 into reviewable steps; review fixes are new commits on the PR that owns each problem, merged up the chain.

@dayfine dayfine left a comment

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.

Reviewed SHA: d245b9d

Verdict

NEEDS_REWORK

First-pass review of this PR's own diff against plza/upstream/s2-02. Code health: 0 failures (5 advisories). Fork Draft CI build passed; the ubuntu job was still pending when read.

High

  1. Nothing in the chain calls the new runtime code. At the chain tip (#545, plza/upstream/s2-11), run_watched, watch_for, CoveredWatcher, TalkOver and note_warp are used only by their own tests. run_watched is a template that nothing instantiates, so it has never been compiled. The PR body says these are "the screen judgements a step makes", but no step makes them. Either say in the body which later PR (outside this chain) wires them in, or move them to that PR. Upstream will not take unused helpers.
  2. Comments name a lab run. Engine/Pokemon_CoveredWatch.h:9 ("the PLZA 03.08 catch (2026-11-14) read a missed ... banner") and Engine/Pokemon_FrameCoverage.h:9 ("ConvertFrame at 150 ms mean, PLZA 03.08 on 2026-11-14"). Describe the failure mode, e.g. "under CPU load the pivot can hand over the same frame for a second", and move the run and date to the PR description (user theme T3).

Medium

  1. Pokemon_SceneJudges.h:30 WarpSeen::banner: "" means "no banner". That is a sentinel. Use std::optional<std::string>; any() and describe() then read it directly.
  2. Pokemon_SceneJudges_Tests.cpp test_talk_over(): Row is positional ({"5 s of quiet ends it", {}, repeat(QUIET, 8), SceneMove::DONE, 5}). It is not the name / input / expectation shape the other suites in this PR use (WatchCase, CoverageCase). Use nested Input / Expectation with designated initializers. SceneJudgesCase (a function pointer as Input and an empty Expectation) is that shape in name only.

Low

  1. Pokemon_SceneJudges.h:38 note_warp(..., const std::string& banner_read): a read-only string should be std::string_view by value.
  2. Pokemon_TestExpect.h is a shared header with one user (Pokemon_SceneJudges_Tests.cpp). CommonTools/ScreenEvents/ScreenEvents_Tests.cpp:29 (#534) defines its own expect_equal with the same signature. Keep one: CommonTools cannot include a Pokemon header, so a shared copy would have to live under CommonTools or Common/Cpp/TestRunners.
  3. Pokemon_SceneJudges.h: :92, the comment on TalkOver::describe(), gives "black fade, banner read" as an example, but the code prints "black back up, banner read" or "black still down, ...". Make the comment match.

Checked: brace style, no std::filesystem/std::thread/std::mutex, CRLF kept, every new file is in SourceFiles.cmake, and WarpFade/fade_in/warp_fade_name come from the parent #534.

# Conflicts:
#	SerialPrograms/cmake/SourceFiles.cmake
… describe the fault

The talk-over table names its fields (nested input and expectation), and the
scene judge cases are plain named tests. The covered watch and frame coverage
headers describe the missed-banner fault instead of the run that found it.
@dayfine

dayfine commented Nov 15, 2026

Copy link
Copy Markdown
Owner Author

Review fixes, tip ae9332f55:

Fixed: 2 (run and date out of both headers; the run is in the description), 4 (talk-over rows use nested input/expectation with designated initializers; SceneJudgesCase is a plain named test), 7 (describe() comment).
1: the description now says run_watched()/watch_for() have no caller in this chain. I found no caller in the PLZA program branch either, so this one needs the user's call: drop them or keep for batch 2.
Not changed: 3, 5, 6.

@dayfine

dayfine commented Nov 15, 2026

Copy link
Copy Markdown
Owner Author

Second fix round, tip 37417c22b: run_watched(), watch_for() and WatchLimits are gone, since nothing calls them; CoveredWatcher and its suite stay, and judge_watch() in FrameCoverage reads its coverage (commit dde4b28). The CoveredWatch suite only tested CoveredWatcher, so no test left with them. pose_matches() in #538 is untouched.

The catch stop's banner watch (fork #563) runs a press under a covered
watch; the helper belongs with CoveredWatcher and judge_watch().
# Conflicts:
#	SerialPrograms/Source/Pokemon/AutoStory/Pokemon_AutoStory_Tests.h
PLZA's throw watches with run_until() plus a short extra wait; TalkOver stays.
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