mstar.model.cosmos3.tests.test_sound#

Tests for the Cosmos3 opt-in sound generation path.

CPU-safe unit tests cover the sound segment packing (mrope band, indexes, position ids), the duration -> latent-frame math, the request-level validation and walk selection, a tiny AVAE decoder shape check, and the decoder-subset checkpoint load. GPU tests (gated on COSMOS3_NANO_DIR + CUDA) check the engine cache-once [video | sound] loop against the fused reference pipeline — bit-tight with the sdpa handle, PSNR-level with FlashInfer — and smoke the real checkpoint sound tokenizer.

Run CPU only: python3 test_sound.py Run with GPU: COSMOS3_NANO_DIR=<snap> python3 test_sound.py

Functions

mstar.model.cosmos3.tests.test_sound.test_sound_cache_once_matches_fused_exact()[source]#
Return type:

None

mstar.model.cosmos3.tests.test_sound.test_sound_engine_path_flashinfer()[source]#
Return type:

None

mstar.model.cosmos3.tests.test_sound.test_sound_forward_smoke_cpu()[source]#
Return type:

None

mstar.model.cosmos3.tests.test_sound.test_sound_frame_math()[source]#
Return type:

None

mstar.model.cosmos3.tests.test_sound.test_sound_request_validation()[source]#
Return type:

None

mstar.model.cosmos3.tests.test_sound.test_sound_segment_layout()[source]#
Return type:

None

mstar.model.cosmos3.tests.test_sound.test_sound_tokenizer_decode_real()[source]#
Return type:

None

mstar.model.cosmos3.tests.test_sound.test_sound_tokenizer_load_ignores_encoder_keys()[source]#
Return type:

None

mstar.model.cosmos3.tests.test_sound.test_sound_tokenizer_tiny_decode()[source]#
Return type:

None