When a scenario contains multiple samples with different model type requirements, the model picker allows users to select model combinations that no individual sample supports, resulting in viableSamples.Count == 0 and preventing any sample from loading.
Steps to Reproduce
-
Navigate to a scenario that contains multiple samples with different Model1Types requirements
- For example, Text -> Retrieval Augmented Generation (RAG) might have:
- Sample A requiring
Model1Types = [LanguageModels]
- Sample B requiring
Model1Types = [KnowledgeRetrieval]
-
Open the model picker - observe that it shows models from both LanguageModels and KnowledgeRetrieval types (union of all samples' requirements)
-
Select the 1st model "Retrieval Augmented Generation (RAG)" (that belongs to KnowledgeRetrieval type)
-
Select the 2nd model "all-MiniLM" (that belongs to KnowledgeRetrieval type, too)
-
Click "Run Sample"
-
The sample can not be loaded then always show the loading image:
Expected Behavior
Either:
- The model picker should only show models that are compatible with at least one complete sample configuration, OR
- The UI should provide clear feedback explaining why the selection is invalid
Actual Behavior
- The model picker closes and immediately reopens without any error message
- No sample loads
- User is left confused with no indication of what went wrong
- The debug output shows:
viableSamples.Count == 0
Code Analysis
Location: ScenarioPage.xaml.cs
Collection Logic (LoadPicker, lines ~99-106)
// Merges ALL model types from ALL samples (UNION)
List<List<ModelType>> modelDetailsList = [samples.SelectMany(s => s.Model1Types).ToList()];
This allows the picker to show models from any type that any sample needs.
Validation Logic (HandleModelSelectionChanged, lines ~249-251)
// Requires finding a sample that matches BOTH selected models (INTERSECTION)
List<Sample> viableSamples = samples!.Where(s =>
IsModelFromTypes(s.Model1Types, selectedModels[0]) &&
IsModelFromTypes(s.Model2Types, selectedModels[1])).ToList();
This requires at least one sample to support the entire selected model combination.
The Mismatch: Collection uses union logic, but validation uses intersection logic, creating a gap where users can select "theoretically valid but practically unsupported" model combinations.
Debug Output Example
[IsModelFromTypes] Checking model: 6a526fdd-359f-4eac-9aa6-f01db11ae542, Name: Retrieval Augmented Generation (RAG)
[IsModelFromTypes] Required types: LanguageModels, PhiSilica
[IsModelFromTypes] Total 14 model IDs collected. Model 6a526fdd-359f-4eac-9aa6-f01db11ae542 NOT FOUND
[IsModelFromTypes] Checking model: 6a526fdd-359f-4eac-9aa6-f01db11ae542
[IsModelFromTypes] Required types: KnowledgeRetrieval, PhiSilica
[IsModelFromTypes] Total 2 model IDs collected. Model 6a526fdd-359f-4eac-9aa6-f01db11ae542 FOUND
The RAG model is found in KnowledgeRetrieval type but not in LanguageModels type, yet both types were presented as valid options to the user.
Additional Notes
- The code comment states
// this should never happen, but this scenario does occur in practice
- When
viableSamples.Count == 0, the code simply calls App.MainWindow.ModelPicker.Show(selectedModels) without providing any user feedback about why the selection failed
When a scenario contains multiple samples with different model type requirements, the model picker allows users to select model combinations that no individual sample supports, resulting in
viableSamples.Count == 0and preventing any sample from loading.Steps to Reproduce
Navigate to a scenario that contains multiple samples with different
Model1TypesrequirementsModel1Types = [LanguageModels]Model1Types = [KnowledgeRetrieval]Open the model picker - observe that it shows models from both
LanguageModelsandKnowledgeRetrievaltypes (union of all samples' requirements)Select the 1st model "Retrieval Augmented Generation (RAG)" (that belongs to
KnowledgeRetrievaltype)Select the 2nd model "all-MiniLM" (that belongs to
KnowledgeRetrievaltype, too)Click "Run Sample"
The sample can not be loaded then always show the loading image:
Expected Behavior
Either:
Actual Behavior
viableSamples.Count == 0Code Analysis
Location:
ScenarioPage.xaml.csCollection Logic (LoadPicker, lines ~99-106)
This allows the picker to show models from any type that any sample needs.
Validation Logic (HandleModelSelectionChanged, lines ~249-251)
This requires at least one sample to support the entire selected model combination.
The Mismatch: Collection uses union logic, but validation uses intersection logic, creating a gap where users can select "theoretically valid but practically unsupported" model combinations.
Debug Output Example
The RAG model is found in
KnowledgeRetrievaltype but not inLanguageModelstype, yet both types were presented as valid options to the user.Additional Notes
// this should never happen, but this scenario does occur in practiceviableSamples.Count == 0, the code simply callsApp.MainWindow.ModelPicker.Show(selectedModels)without providing any user feedback about why the selection failed