@@ -1278,6 +1278,50 @@ def test_dispatch_audio_codec_pipeline(tmp_path):
12781278 assert workflow ["outputs" ]["waveform" ]["stage" ] == "post_adapter"
12791279
12801280
1281+ @pytest .mark .parametrize ("package_kind" , ["codec" , "speech-to-text" ])
1282+ def test_recognized_topology_superset_exports_advisory_contract (tmp_path , package_kind ):
1283+ if package_kind == "codec" :
1284+ encoder = _model (
1285+ "encoder" ,
1286+ [_value ("waveform" , ir .DataType .FLOAT , ["batch" , 1 , "audio_samples" ])],
1287+ [("codes" , ir .DataType .INT64 , ["batch" , 16 , "frames" ])],
1288+ )
1289+ decoder = _model (
1290+ "decoder" ,
1291+ [_value ("codes" , ir .DataType .INT64 , ["batch" , 16 , "frames" ])],
1292+ [("waveform" , ir .DataType .FLOAT , ["batch" , 1 , "audio_samples" ])],
1293+ )
1294+ pkg = _EncoderDecoderPkg ({"encoder" : encoder , "decoder" : decoder })
1295+ else :
1296+ pkg = _EncoderDecoderPkg (dict (_speech_package ()))
1297+ pkg ["auxiliary" ] = _FakeModel (["aux_input" ], ["aux_output" ])
1298+
1299+ artifacts = write_onnx_genai_config (pkg , str (tmp_path ))
1300+ compatibility = json .loads (
1301+ Path (artifacts ["runtime_compatibility" ]).read_text (encoding = "utf-8" )
1302+ )
1303+
1304+ assert compatibility ["runtime_validation_status" ] == "unsupported-by-tested-runtime"
1305+ assert set (compatibility ["components" ]) == {"encoder" , "decoder" , "auxiliary" }
1306+
1307+
1308+ @pytest .mark .parametrize ("package_kind" , ["codec" , "speech-to-text" ])
1309+ def test_recognized_topology_superset_with_malformed_component_fails (tmp_path , package_kind ):
1310+ if package_kind == "codec" :
1311+ pkg = _EncoderDecoderPkg (
1312+ {
1313+ "encoder" : _FakeModel (["waveform" ], ["codes" ]),
1314+ "decoder" : _FakeModel (["codes" ], ["waveform" ]),
1315+ }
1316+ )
1317+ else :
1318+ pkg = _EncoderDecoderPkg (dict (_speech_package ()))
1319+ pkg ["auxiliary" ] = object ()
1320+
1321+ with pytest .raises (ValueError , match = r"auxiliary.*no graph contract" ):
1322+ write_onnx_genai_config (pkg , str (tmp_path ))
1323+
1324+
12811325def test_multi_decoder_tts_without_pre_embedder_raises_precise_not_implemented (tmp_path ):
12821326 # A nested multi-decoder TTS stack lacking the talker_step_embedder
12831327 # pre-embedder cannot yet be mapped and must fail with a precise error.
0 commit comments