Skip to content

fix(check): the analysis restarts the idle window with every call it makes - #6919

Merged
miguel-heygen merged 3 commits into
mainfrom
fix/check-analysis-reports-progress
Nov 3, 2026
Merged

miguel-heygen merged 3 commits into
mainfrom
fix/check-analysis-reports-progress

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

After the samples are collected, check now marks an analysis phase ("analyzing the samples") and every call the analysis makes to the page (re-seeks, frame captures, craft sampling, contrast and clock reads) restarts the idle window, as the sample loop already does. A stalled analysis ends with ... while analyzing the samples (<call>) instead of ... while checking samples.

Why

A check --json --at 0,1,2,3 on static native 3D poses finished every sampled frame and contrast pass and then ended with no progress for 120 s after Chrome was ready, while checking samples. The window is restarted only when a phase is entered or an operation settles: the sample loop enters samples per sample, but the analysis that follows (withFrameMotion/markFrameChanges, framesMoved, the craft audit and its seekGeometry(..., { draws: true }) re-seeks) runs many seeks and captures with no restart, all inside the last samples entry. On a 3D scene each draw is slow, so the sum passes 120 s although no single step does, and the error names the wrong phase.

How

reportingProgress(driver, enter) wraps the audit driver in a Proxy that calls enter("analysis", <method>) before each call; runAuditGrid uses it for the whole analysis section. analysis is added to the deadline's phase labels. A step that makes no call for the whole window still ends the check, now under the right name.

Not done: I could not produce a >120 s analysis on my machines, so the timing is covered with fake timers rather than a real scene, and a single call that itself runs longer than the window (one very slow draw) is still ended by it. The other report in this tick (The turn check stopped: the shell left) is not an OSS message.

Test plan

fails without the fix: checkPipeline.reportingProgress.test.ts "restarts the idle window on every call the analysis makes" (reportingProgress is not a function at main).

  • The new file with checkDeadline, checkBrowser and checkProgress tests: 83 passed, 3 runs in a row (devbox); both behavioural new tests fail at main. Fake timers, no real waits.
  • oxfmt check clean; no type errors in the touched files.

Size

About 75 changed lines: one wrapper, one phase label and a test file.

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: APPROVE · 0 blocker · 1 important · 0 nits · head 16d930f4

  • important: the new tests pin reportingProgress and the analysis label on their own, but nothing checks that runAuditGrid actually uses the wrapper. If the analysis section went back to the bare driver, the timeout from the report would return and every test would still pass. check.test.ts:2269–2358 already runs runAuditGrid(..., deadline!.enter) with fake timers. One case there whose motion/craft analysis makes several slow driver calls (together longer than the idle window, each shorter) would pin the fix end to end. A follow-up is fine.
Scope

Read the full diff, CheckDeadline.enter/rearm, runAuditGrid and craftEnabled. The proxy calls the method on the real driver object (member.apply(target)), so private state and calls the driver makes on itself behave as before, and typeof analysing.collectCraftFrame === "function" still holds. The only raw-driver call left after analysis is matchComponents, a single call that the window covers. The fails without the fix: line is present. No prior reviews. Required checks were still running at review time; none had failed.

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 267 (base branch 267), smooth 105 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (8)

Unstable (1)

  • seqplainkeys-none-pct-r0-nested-z100: tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo false, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true

@miguel-heygen

Copy link
Copy Markdown
Collaborator Author

Added at 8d5201b, in check.test.ts's runAuditGrid fake-timer block: 'slow analysis calls that each finish keep the check alive past 120 s'. After the grid it makes hasNoTimelineDeclaration and getCanvas each take 100 s (slow only once report('analyze') fires, so the sample phase is unaffected); together they outlast the 120 s window, so the check survives only if every analysis call restarts it. Proved: 157 tests green x3 with the wrapper; with 'const analysing = reportingProgress(driver, enter)' replaced by 'const analysing = driver', exactly that test fails (check_runtime_failure). fmt and tsc clean.

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: APPROVE — 1 resolved, 0 open, 0 new · 16d930f4 → 8d5201ba. ✅ The wiring gap is closed. I checked locally: check.test.ts and checkPipeline.reportingProgress.test.ts pass (160/160), and with runAuditGrid switched back to the bare driver, "slow analysis calls that each finish keep the check alive past 120 s" fails.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 3, 2026
@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 3aaed65 Nov 3, 2026
84 checks passed
@miguel-heygen
miguel-heygen deleted the fix/check-analysis-reports-progress branch November 3, 2026 20:05
This was referenced Nov 4, 2026
SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Nov 4, 2026
Adopted with tests that fail on the old code (except the link change):
- offload: rewrite media inside <template>, keep same-named files from
  other folders (heygen-com#6842, offload part only)
- autoUpdate: no background upgrade across a 0.x minor; Homebrew installs
  only notify (heygen-com#7013, autoUpdate part only)
- engine: script load failures carry origin/code; aborted scripts are not
  load failures (heygen-com#7088, heygen-com#7093)
- community Discord invite links (heygen-com#7097)
- studio: write media duration to the store once per file (heygen-com#6745)
- check: restart the idle watchdog on each driver call during analysis
  (heygen-com#6919, adapted to this line's fixed 120s idle window)
- check: default wait raised from 10s to 45s, matching snapshot/render
  (heygen-com#6947)
- image cancellations no longer ignored by extension (heygen-com#6928)
- capture: system sleep no longer counts as a stall (heygen-com#7096, hand-ported;
  the sequential branch also uses the shared stall clock)

Commit watermark advances to 183614b (28 consecutive commits with
file:line evidence); PR and issue watermarks are unchanged. The rest of
the review is in docs/UPSTREAM_REVIEW_2026-11-04_CONTINUED.md.

Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com>
Co-authored-by: WaterrrForever <miao.yang@heygen.com>
Co-authored-by: Wenbo Zhu <wenbo_zhu@berkeley.edu>
Co-Authored-By: Claude Opus 5.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