From 83b3b0bc29dd1f4c13daec464fa200768f6e655d Mon Sep 17 00:00:00 2001 From: harleywilsoneng Date: Sun, 16 Aug 2026 14:01:12 +0800 Subject: [PATCH 1/2] fix(ltx2): cast positions double/float to avoid MSVC C4244 (#968) Signed-off-by: harleywilsoneng --- src/vllm/multimodal/ltx2_video.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/vllm/multimodal/ltx2_video.cpp b/src/vllm/multimodal/ltx2_video.cpp index aeaeb17e0..c65220770 100644 --- a/src/vllm/multimodal/ltx2_video.cpp +++ b/src/vllm/multimodal/ltx2_video.cpp @@ -200,7 +200,13 @@ Ltx2LatentState ToLatentState(const StreamState& s, int64_t pos_dims) { out.latent = s.latent; out.clean = s.clean; out.mask = s.mask; - out.positions.assign(s.positions.begin(), s.positions.end()); + // Explicit cast: StreamState stores positions as double for the DiT surface, + // Ltx2LatentState keeps float32. Range-assign would narrow implicitly and + // trip MSVC C4244 under /WX (mudler/vllm.cpp#968). + out.positions.resize(s.positions.size()); + for (size_t i = 0; i < s.positions.size(); ++i) { + out.positions[i] = static_cast(s.positions[i]); + } out.keyframes_mask = s.keyframes_mask; return out; } @@ -211,7 +217,10 @@ void FromLatentState(const Ltx2LatentState& in, StreamState* s) { s->latent = in.latent; s->clean = in.clean; s->mask = in.mask; - s->positions.assign(in.positions.begin(), in.positions.end()); + s->positions.resize(in.positions.size()); + for (size_t i = 0; i < in.positions.size(); ++i) { + s->positions[i] = static_cast(in.positions[i]); + } s->keyframes_mask = in.keyframes_mask; } From b6f15806b5d001bb8ced0d9f2d19588aca5db8a5 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sun, 16 Aug 2026 21:00:24 +0000 Subject: [PATCH 2/2] fix(ltx2): refresh the reader anchors the positions cast moved The explicit double/float casts add nine net lines above kKnownLoadExtras, so every recorded reader anchor in ltx2_video.cpp shifted by nine and test_ltx2_video refused the stale list. The anchors are derived from the file on every run precisely so this is caught rather than rotting, and the failure prints the replacement to paste in. Derived against main at 0f8580e26 with the PR merged, because main moved this file twice since the branch base (332aed738, 3ce1cf7c7) and the pre-merge line numbers are not the ones that land. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: ClaudeCode:claude-opus-5 [ClaudeCode] --- src/vllm/multimodal/ltx2_video.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vllm/multimodal/ltx2_video.cpp b/src/vllm/multimodal/ltx2_video.cpp index 89c0e765b..4b5546a55 100644 --- a/src/vllm/multimodal/ltx2_video.cpp +++ b/src/vllm/multimodal/ltx2_video.cpp @@ -372,7 +372,7 @@ constexpr char kLtx2DurationHeadPathExtra[] = "duration_head_path"; // they are no longer trusted: the list below is derived from this file on every // run and compared, and the failure prints the replacement to paste in. // READER ANCHORS (derived and gated by test_ltx2_video): -// 781 791 792 854 950 966 968 1046 1071 1176 1217 +// 790 800 801 863 959 975 977 1055 1080 1185 1226 const char* const kKnownLoadExtras[] = { kLtx2AudioPromptEmbedsExtra, kLtx2PipelineKindExtra, kLtx2ModelVersionExtra, kLtx2AllowUnportedExtra, kLtx2MaxPhaseExtra, kLtx2DitConfigPathExtra,