Skip to content

test_dreamverse_shape

Contract test: Dreamverse-style inputs normalize through the public typed API without needing any private-only compatibility promise.

The private Dreamverse UI server (FastVideo-internal/ui/ltx2-streaming/ server/gpu_pool.py) has historically called VideoGenerator.from_pretrained(**load_kwargs) with a flat kwarg bag containing LTX-2-specific names (ltx2_refine_enabled, ltx2_refine_upsampler_path, etc.). PR 6 gave every one of those kwargs a typed home under GeneratorConfig.

This test makes sure:

  1. The public typed API can represent everything Dreamverse currently passes at init time (legacy_from_pretrained_to_config).
  2. The request-path Dreamverse uses (generator.generate_video(**kwargs) with per-segment flags) round-trips through the typed GenerationRequest without reintroducing private-only fields at the public boundary.
  3. Private-only Dreamverse fields that don't belong on the public surface either go to pipeline.experimental / request.extensions (the documented escape hatch) or raise explicitly, rather than silently becoming part of the public compatibility promise.

Regression guard for the scoping rule in apirefactor.md ยง"Schema Parity Requirement".

Classes

fastvideo.tests.contract.test_dreamverse_shape.TestDreamverseLoadKwargsShape

Every current Dreamverse init-time kwarg must land on a typed field, not in the experimental escape hatch.

fastvideo.tests.contract.test_dreamverse_shape.TestDreamverseNoPrivateImports

The public entry points must not force a Dreamverse integrator to import from fastvideo.pipelines.* or other internal paths.

fastvideo.tests.contract.test_dreamverse_shape.TestDreamversePrivateOnlyFields

Dreamverse carries a handful of private-only names (e.g. legacy internal aliases). These must NOT silently turn into a public compatibility promise โ€” the documented contract is that unknown fields land on pipeline.experimental so integrators see them but FastVideo does not promise to preserve them.

fastvideo.tests.contract.test_dreamverse_shape.TestDreamverseRequestShape

The per-segment Dreamverse request path mirrors OpenAI's shape plus a few LTX-2 knobs. All of them must have a typed home.

Functions

fastvideo.tests.contract.test_dreamverse_shape.TestDreamverseRequestShape.test_return_state_reaches_output_config
test_return_state_reaches_output_config()

PR 7 added output.return_state โ€” must survive the legacy translation path so Dreamverse callers can opt in.

Source code in fastvideo/tests/contract/test_dreamverse_shape.py
def test_return_state_reaches_output_config(self):
    """PR 7 added ``output.return_state`` โ€” must survive the legacy
    translation path so Dreamverse callers can opt in."""
    request = GenerationRequest(
        prompt="x",
        output=__import__(
            "fastvideo.api", fromlist=["OutputConfig"]).OutputConfig(
                return_state=True),
    )
    normalized = normalize_generation_request(request)
    assert normalized.output.return_state is True