@@ -14,6 +14,7 @@ import { localModelRadarAxes } from "@magnitudedev/client-common"
1414import {
1515 GIB ,
1616 makeCatalogOnlyModel ,
17+ makeModel ,
1718 TEST_MEMORY_DOMAIN_ID ,
1819} from "../local-inference/test-fixtures"
1920
@@ -37,6 +38,56 @@ describe("catalog radar", () => {
3738 ] )
3839 } )
3940
41+ test ( "labels catalog fidelity using the quantization-scale buckets" , ( ) => {
42+ const base = makeCatalogOnlyModel ( )
43+ for ( const [ fidelityRank , expected ] of [
44+ [ 20 , "Reduced" ] ,
45+ [ 40 , "Medium" ] ,
46+ [ 50 , "High" ] ,
47+ [ 58 , "High" ] ,
48+ [ 60 , "High" ] ,
49+ [ 80 , "Very high" ] ,
50+ ] as const ) {
51+ const axes = Option . getOrThrow ( localModelRadarAxes ( {
52+ ...base ,
53+ catalogData : { ...base . catalogData , fidelityRank } ,
54+ } ) )
55+ expect ( axes [ 4 ] . detail ) . toBe ( `${ expected } (Q4)` )
56+ }
57+ } )
58+
59+ test ( "uses the same quantization-scale labels for discovered models" , ( ) => {
60+ const base = makeModel ( )
61+ const serving = base . state . servingState
62+ if ( serving . _tag !== "Assessed" || serving . assessment . _tag !== "Fits" ) {
63+ throw new Error ( "Discovered radar fixture must have a fitting assessment" )
64+ }
65+ for ( const [ bits , expected ] of [
66+ [ 3 , "Reduced" ] ,
67+ [ 4 , "Medium" ] ,
68+ [ 5 , "High" ] ,
69+ [ 6 , "High" ] ,
70+ [ 8 , "Very high" ] ,
71+ ] as const ) {
72+ const quantization = `Q${ bits } `
73+ const axes = Option . getOrThrow ( localModelRadarAxes ( {
74+ ...base ,
75+ state : {
76+ ...base . state ,
77+ servingState : {
78+ ...serving ,
79+ metadata : {
80+ ...serving . metadata ,
81+ quantization,
82+ quantizationName : `${ bits } -bit` ,
83+ } ,
84+ } ,
85+ } ,
86+ } ) )
87+ expect ( axes [ 4 ] . detail ) . toBe ( `${ expected } (${ quantization } )` )
88+ }
89+ } )
90+
4091 test ( "omits the profile when assessment has no performance samples" , ( ) => {
4192 const model = makeCatalogOnlyModel ( )
4293 if (
0 commit comments