Commit cf4e672
authored
fix(ltx2): cast positions double/float to avoid MSVC C4244 (#968)
MSVC refuses the implicit narrowing in the two `StreamState` <-> `Ltx2LatentState`
position copies under `/WX`, so the native Windows build cannot compile
`ltx2_video.cpp` at all. The range-assign is replaced by an explicit
`static_cast` loop in each direction.
The cast is not a claim that precision does not matter here; it is a claim that
none is lost, and the file already carries the argument. `ltx2_video.cpp:193-196`
records that the positions round trip exactly because every value in the `double`
buffer was widened from a `float` in the first place -- the `double` exists only
because the DiT surface takes one. Both writers agree: the video axis is
`static_cast<double>(float_expr)` at `:2463-2466`, and the audio axis comes from
`Ltx2AudioPatchTimings`, which returns `std::vector<float>`, at `:2535`. So
`float -> double -> float` reproduces the bits, and the explicit cast performs
exactly the conversion the implicit assign already performed.
This closes the last MSVC compile blocker in the #503 class. The lane still fails
afterwards, later and for a different reason -- `test_openai_api_server.exe` exits
`0xC0000409` with no doctest summary, a runtime defect the build never reached
before. That is tracked separately and is not this change.
A second commit refreshes the READER ANCHORS comment. The casts add nine net
lines above `kKnownLoadExtras`, shifting every recorded anchor by nine, and
`test_ltx2_video` derives and compares that list on every run so the drift is
caught rather than silently rotting. The replacement list was derived against
main at `0f8580e26` with this branch merged, because main moved this file twice
since the branch base (`332aed738`, `3ce1cf7c7`).
Fixes #968
FOLLOWING_AGENTS_PROTOCOL
Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: ClaudeCode:claude-opus-5 [ClaudeCode]
Signed-off-by: harleywilsoneng <harleywilsoneng@users.noreply.github.com>1 parent a332fb9 commit cf4e672
1 file changed
Lines changed: 12 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
207 | 213 | | |
208 | 214 | | |
209 | 215 | | |
| |||
214 | 220 | | |
215 | 221 | | |
216 | 222 | | |
217 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
218 | 227 | | |
219 | 228 | | |
220 | 229 | | |
| |||
364 | 373 | | |
365 | 374 | | |
366 | 375 | | |
367 | | - | |
| 376 | + | |
368 | 377 | | |
369 | 378 | | |
370 | 379 | | |
| |||
0 commit comments