Compare commits
1 Commits
step35/104
...
fix/138-qu
| Author | SHA1 | Date | |
|---|---|---|---|
| 9958943871 |
@@ -20,9 +20,16 @@ from evolution.quant_selector import (
|
|||||||
|
|
||||||
class TestQuantLevels:
|
class TestQuantLevels:
|
||||||
def test_levels_ordered_by_quality(self):
|
def test_levels_ordered_by_quality(self):
|
||||||
"""Levels should be ordered from best quality to most aggressive."""
|
"""Levels should be ordered from best quality to most aggressive compression."""
|
||||||
for i in range(len(QUANT_LEVELS) - 1):
|
# TurboQuant levels (turbo4, turbo3, turbo2) should have strictly ascending compression_ratio
|
||||||
assert QUANT_LEVELS[i].bits_per_channel > QUANT_LEVELS[i + 1].bits_per_channel
|
# 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):
|
def test_all_levels_have_required_fields(self):
|
||||||
for level in QUANT_LEVELS:
|
for level in QUANT_LEVELS:
|
||||||
|
|||||||
Reference in New Issue
Block a user