Skip to content

spark-model: restore GLM reference video preprocessing (Enntity f3f3876b) - #256

Closed
AzeezIsh wants to merge 4 commits into
stack/dflash-warm-ctxfrom
stack/glm-video
Closed

AzeezIsh wants to merge 4 commits into
stack/dflash-warm-ctxfrom
stack/glm-video

Conversation

@AzeezIsh

@AzeezIsh AzeezIsh commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Replaces #246. GitHub closed #246 automatically during a restack: its branch briefly pointed at a commit its base already contained. It's the same branch (stack/glm-video), now corrected; the history and receipts are on #246.

Ports Enntity/atlas f3f3876: GLM-5.3 reference video preprocessing — index sampling (glm_sample_frame_indices), one-canvas sizing, last-frame pair padding, per-group whole-second timestamps, and the max_total_decoded_pixels volume bound counting the padded group.\n\nPorted pieces:\n- video_preprocess/glm.rs — preprocess_glm_video, dispatched from preprocess_video when vcfg.is_glm5_next (Qwen path unchanged).\n- video_preprocess/gif_access.rs + patchify.rs — shared helpers the GLM path needs.\n- video_decode_ffmpeg/input.rs (seekable staged input — end-indexed MP4s can't seek on a pipe), frames.rs (probe_frames, decode_frame_indices, PPM reader), spawn_ffmpeg, ensure_decoder.\n- video_sample.rs — select_frames, glm_sample_frame_indices, linspace_floor, GLM_DEFAULT_*.\n- vision_preprocess.rs — glm_pixel_budget pub(crate) re-export.\n- Upstream's three GLM tests (single-sample padding, reference frames/canvas/timestamps, volume bound) into video_preprocess/tests.rs.\n\nCredit: Enntity/atlas f3f3876 (Jason McCartney).\nBase: stack/dflash-warm-ctx 5f0b6dd9d.

AzeezIsh and others added 2 commits October 29, 2026 08:54
probe_frames took nb_frames, or duration × rate, with no upper bound, and
glm_sample_frame_indices grows one usize per sampled step of that count
before extract_t applies. Patching one stts entry in a 1,848-byte MP4 made
ffprobe 7.1.1 report 4,000,000,000 frames, a walk of about 13 GB.

Every stored frame takes at least a byte, so refuse a count above the
payload size. An honest clip is unaffected.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t hold (data-angel)

Into the parked GLM stack branch (stack/glm-video, #256). Reviewed; video tests 66/0 on reiner at 8a8a959. The Qwen path has no equivalent unbounded walk: its sample plan is capped (MAX_SAMPLE_PLAN) before any allocation.
@AzeezIsh

Copy link
Copy Markdown
Contributor Author

Merged data-angel's #295 into this branch. It bounds declared_frames by the payload size; a patched stts had ffprobe report 4e9 frames for a 1.8 KB MP4. On reiner, video tests are 66/0 at 8a8a959b5. The Qwen video path doesn't have this walk: it caps its sample plan at MAX_SAMPLE_PLAN before allocating anything.

@AzeezIsh

AzeezIsh commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Included in GB10 integration train #305 on main 8c2b672: ported onto main, because its stack base landed via #282 (see #305 for the resolution notes). The sparky gate (job 68b) builds #305's exact head and runs tests, three model controls, agentic-50, BFCL ST-995 and error counts. The results will be posted on #305 and here. This PR will be closed in favour of #305 once it lands.

@AzeezIsh

AzeezIsh commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #307: the same GLM reference video preprocessing ported straight onto main, since this PR's stacked base no longer exists. Every file in #307 is byte-identical to the version gated in train #305 on GB10: controls identical on three models, BFCL and agentic identical to main. The DFlash warm-ctx port from #255 is not included (see #255). Closing in favour of #307.

@AzeezIsh AzeezIsh closed this Nov 1, 2026
AzeezIsh added a commit that referenced this pull request Nov 1, 2026
…ort of #256)

spark-model: restore GLM reference video preprocessing (port of #256 onto main)
AzeezIsh added a commit that referenced this pull request Nov 1, 2026
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
AzeezIsh pushed a commit that referenced this pull request Nov 1, 2026
vcruz305 pushed a commit to vcruz305/atlas that referenced this pull request Nov 11, 2026
…-Inf#256)

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

2 participants