Skip to content

spark-model: restore GLM reference video preprocessing (port of #256 onto main) - #307

Merged
AzeezIsh merged 1 commit into
mainfrom
port/256-on-main-v2
Nov 1, 2026
Merged

AzeezIsh merged 1 commit into
mainfrom
port/256-on-main-v2

Conversation

@AzeezIsh

@AzeezIsh AzeezIsh commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Standalone port of #256 (GLM reference video preprocessing, Enntity/atlas f3f3876 via 5497364b2, plus 8a8a959b5 from #295) onto current main's #286 video path.

Changes:

  • video_preprocess/glm.rs, gif_access.rs, patchify.rs, video_decode_ffmpeg/frames.rs and video_sample.rs: vLLM glm5next frame-index sampling, one canvas, pair padding, and the payload-bounded frame count. GLM is reached only through the is_glm5_next early return in preprocess_video.
  • ensure_decoder is the single source for the ffmpeg enabled/available check (video_decode_ffmpeg/probe.rs).
  • The moov/faststart decode tests use the enabled() policy. On a host with ffmpeg, main fails both under FfmpegPolicy::default(), as seen on sparky at b45811d.
  • Main's generic-path GLM single-frame refusal test is replaced by the reference pad test. Qwen behaviour is unchanged.

Follow-up, not here: the generic path's is_glm5_next branches are now unreachable.

Test plan

In train #305 (same files, base 8c2b672, sparky GB10):

  • FP4-Local, Flash-Next NVFP4 and 27B NVFP4 controls identical to main.
  • BFCL ST-995 all subsets identical; agentic-50 identical failure set; 0 errors.
  • cargo test --release -p spark-model --lib video_: 73 / 0.

On b45811d + this change (sparky), at an intermediate commit that lacked #256/#295's two declared_frames tests. Those tests were restored here and pass in the train run:

  • fmt, clippy and the 500-LoC cap loop are clean.
  • Full spark-model lib run twice: 2021/0, then 2020/1. The one failure is hour_tests::probe_timeout_covers_a_blocked_stdout_read, Text file busy.
  • That test also flakes on main b45811d (2016/3, with the two moov/faststart failures this PR fixes), and passes 5/5 when run alone.

Not covered: there's no GLM checkpoint on sparky, so the GLM path is covered by unit tests only.

Supersedes #256 (stacked on a base that no longer exists).

Generated with Devin

Port of #256 (Enntity/atlas f3f3876 via 5497364, plus 8a8a959 from
#295) onto main's #286 video path. #256's stack base already landed
through #282, and the DFlash warm-ctx port from the same stack (#255) is
not included. Every video file here is byte-identical to the version
gated in train #305.

- ensure_decoder is the single source for the ffmpeg enabled/available
  check, in video_decode_ffmpeg/probe.rs (pub(super)); decode_with_plan
  and frames.rs call it.
- The moov/faststart decode tests use the enabled() policy; on a host
  with ffmpeg they fail on main under FfmpegPolicy::default().
- The GLM reference path pads a single sampled frame into a temporal
  pair. Qwen's generic path is unchanged.
- The generic-path GLM single-frame refusal test is dropped, superseded
  by the reference pad test (the generic GLM branches are now unreachable
  behind the is_glm5_next early return; follow-up).

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.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