diff --git a/tests/test_quant_selector.py b/tests/test_quant_selector.py index 5447d143..a0000584 100644 --- a/tests/test_quant_selector.py +++ b/tests/test_quant_selector.py @@ -20,9 +20,16 @@ from evolution.quant_selector import ( class TestQuantLevels: def test_levels_ordered_by_quality(self): - """Levels should be ordered from best quality to most aggressive.""" - for i in range(len(QUANT_LEVELS) - 1): - assert QUANT_LEVELS[i].bits_per_channel > QUANT_LEVELS[i + 1].bits_per_channel + """Levels should be ordered from best quality to most aggressive compression.""" + # TurboQuant levels (turbo4, turbo3, turbo2) should have strictly ascending compression_ratio + # q4_0 is a fallback and is placed last + turbo_levels = [l for l in QUANT_LEVELS if l.name.startswith("turbo")] + for i in range(len(turbo_levels) - 1): + assert turbo_levels[i].compression_ratio < turbo_levels[i + 1].compression_ratio, \ + f"{turbo_levels[i].name} ({turbo_levels[i].compression_ratio}x) should compress less than {turbo_levels[i+1].name} ({turbo_levels[i+1].compression_ratio}x)" + + # q4_0 should be last (fallback position) + assert QUANT_LEVELS[-1].name == "q4_0", "q4_0 should be last as fallback" def test_all_levels_have_required_fields(self): for level in QUANT_LEVELS: