Skip to content

Commit e915ec2

Browse files
Add comprehensive tests for dual preference system
This commit adds extensive tests to ensure the dual preference system works correctly in LinearSolveAutotune. The tests verify that both best_algorithm_* and best_always_loaded_* preferences are always set properly. ## New Test Coverage ### Algorithm Classification Tests - Tests is_always_loaded_algorithm() function for accuracy - Verifies always-loaded algorithms: LU, Generic, MKL, AppleAccelerate, Simple - Verifies extension-dependent algorithms: RFLU, FastLU, BLIS, GPU algorithms - Tests unknown algorithm handling ### Best Always-Loaded Algorithm Finding Tests - Tests find_best_always_loaded_algorithm() with mock benchmark data - Verifies data-driven selection from actual performance results - Tests handling of missing data and unknown element types - Confirms correct performance-based ranking ### Dual Preference System Tests - Tests complete dual preference setting workflow with benchmark data - Verifies both best_algorithm_* and best_always_loaded_* preferences are set - Tests preference retrieval in new structured format - Confirms actual LinearSolve preference storage - Tests preference clearing for both types ### Fallback Logic Tests - Tests fallback logic when no benchmark data available - Verifies intelligent heuristics for real vs complex types - Tests conservative fallback for complex types (avoiding RFLU issues) - Confirms fallback selection based on element type characteristics ### Integration Tests - Tests that autotune_setup() actually sets dual preferences - Verifies end-to-end workflow from benchmarking to preference setting - Tests that always_loaded algorithms are correctly classified - Confirms preference validation and type safety ## Test Quality Features - Mock data with realistic performance hierarchies - Comprehensive edge case coverage (missing data, unknown types) - Direct verification of LinearSolve preference storage - Clean test isolation with proper setup/teardown These tests ensure that the dual preference system is robust and always sets both preference types correctly, providing confidence in the fallback mechanism for production deployments. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 0d599f9 commit e915ec2

File tree

2 files changed

+284
-91
lines changed

2 files changed

+284
-91
lines changed

0 commit comments

Comments
 (0)