Skip to content

test(engine): tone-map concurrency test passes on macOS - #6323

Merged
miguel-heygen merged 1 commit into
mainfrom
fix/video-extractor-probe-once
Oct 25, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
fix/video-extractor-probe-once

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

What

videoFrameExtractor.concurrency.test.ts ("finishes tone-mapped cuts of shared sources in the one slot, probing each source once") passes on macOS. It failed on clean main on every Mac whose ffmpeg has zscale, and is skipped or green on Linux CI.

Why

The test counts every ffmpeg the extractor starts through a shim and expects 8 cuts plus one probe per source (10). On macOS, tone mapping first checks whether ffmpeg has zscale (toneMapsWithZscale, packages/engine/src/services/videoFrameExtractor.ts:322-324). That check runs ffmpeg -hide_banner -filters once per process and is cached (isFfmpegFilterAvailable, packages/engine/src/utils/psnrFilterAvailability.ts:33-38). In the test it ran through the shim, so the count was 11. On Linux the check is skipped, so CI never saw it.

The extractor is right: the check is per process, not per cut, and it is not an extraction. The test now takes the check with the real ffmpeg before the shim starts counting, so the expectation stays 8 cuts plus 2 probes on every platform.

Test plan

  • Unit tests added/updated

  • Manual testing performed

  • Documentation updated (if applicable)

  • Comments follow CONTRIBUTING.md "Comments": they say why, not what, and a bug fix says what the code must do and how to reproduce the bug

  • On main on an Apple silicon Mac (its ffmpeg has zscale): fails 3 of 3 with 11 runs; the eleventh is -hide_banner -filters.

  • With this change: the file passes 3 runs in a row.

  • Still guards the cache: with the filter check no longer memoized, the test fails with 18 runs.

Small on purpose: a lone test fix that makes local engine runs green on every Mac again; it shares nothing with any other open change.

On macOS the extractor checks once per process whether ffmpeg has zscale. The test ran that
check through its counting shim, so it saw 11 ffmpeg runs instead of 8 cuts plus 2 probes and
failed on every Mac with zscale. Take the check with the real ffmpeg before the shim counts.

@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 · 0 important · 0 nits · head 4858ebd0

Test-only. isFfmpegFilterAvailable memoizes one process-wide filter list (not keyed by binary path), so warming it with the real ffmpeg before FFMPEG_PATH_ENV points at the shim keeps the -filters run out of the count on every platform. It never rejects, so a host without ffmpeg is unaffected. The count still catches a cache regression.

Scope

Read the diff, psnrFilterAvailability.ts and toneMapsWithZscale at head. CI was still running when I posted (CI, regression, CodeQL, Windows render verification); the required checks still gate the merge.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Oct 25, 2026
Merged via the queue into main with commit 15b0000 Oct 25, 2026
114 checks passed
@miguel-heygen
miguel-heygen deleted the fix/video-extractor-probe-once branch October 25, 2026 17:49
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