videos: per-request shift/audio_shift; the fried look is decode/quant, not schedule

Adds `shift` (video) and `audio_shift` (soundtrack) as per-request /v1/videos
fields, (0,100], each defaulting to the model's trained shift; echoed in the
video object and advertised in the model card as video_shift/video_audio_shift.

ABI-invisible: VideoRequest carries the two doubles, video_schedule() re-shifts
that stream's sigma grid, and the shifted sigmas ride RadVideoGenBatch::sched --
the plugin reads only sigmas/timesteps, never a shift scalar, so RAD_ABI_VERSION
stays 24 and no plugin rebuilds.

Diagnosis (cont.20): the review batch's blown-highlight/crushed-black "fried"
look is present in the text-only T2VA control at native res (clip 54-79% vs the
reference's ~4.5%), so it is not the keyframe/tower path (#52) and not a
regression (old ex10 T2VA has clip 51%). It is not the sampler (euler vs
res_multistep: clip 53-61% vs 56-65%) and not the shift: the container already
runs 12/3 (the reference's settings) and shift=4 leaves clip at ~54%. With
sampler, shift and CFG (=1, no guidance) all matched, the gap is downstream of
the schedule -- the video VAE decode scale parity and/or the DiT int8 quant, i.e.
#37/#44/#45. The shift field ships regardless: correct, useful, and requested.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
gearwave00001andClaude committed 2026-10-21 09:11:34 -05:00
1 parent cd393a0973
commit 3a7a79fb47
9 files changed
+149 -9

No files matched your search

+15
View File
@@ -334,6 +334,21 @@ TEST(the_schedule_counts_grid_points_and_shifts_each_modality) {
CHECK_EQ(gen::video_schedule(d, 2).steps, 1);
}
/* A request's shift re-shapes ONLY the stream it names; the stream it leaves at 0 keeps the
* declaration's trained shift (decl_small is video 12, audio 3). */
TEST(a_request_shift_overrides_the_declaration_per_stream) {
const RadVideoGenDecl d = decl_small();
const gen::VideoSchedule base = gen::video_schedule(d, 50);
const gen::VideoSchedule s = gen::video_schedule(d, 50, 6.0, 0.0); /* video -> 6, audio keep 3 */
REQUIRE_EQ(s.sig_v.size(), base.sig_v.size());
REQUIRE_EQ(s.sig_a.size(), base.sig_a.size());
const double b = 1.0 - 30.0 / 49.0;
CHECK(std::fabs(s.sig_v[30] - 6.0 * b / (1.0 + 5.0 * b)) < 1e-6); /* re-shifted by 6 */
CHECK(std::fabs(s.sig_a[30] - 3.0 * b / (1.0 + 2.0 * b)) < 1e-6); /* still the decl's 3 */
CHECK(s.sig_v[30] != base.sig_v[30]); /* video actually moved */
CHECK(std::fabs(s.sig_a[30] - base.sig_a[30]) < 1e-9); /* audio untouched */
}
/* A trained schedule (a distilled checkpoint's): its rungs in f32, each modality's shift applied
* as the reference's tensor arithmetic does (f32 throughout), then the terminal 0; one evaluation a
* rung, and no other step count. */