11import { describe , expect , it } from 'vitest' ;
22
3- import { KNOWN_CONFIG_ISSUES , knownIssueCsvNote , matchKnownConfigIssues } from './known-issues' ;
3+ import {
4+ type KnownConfigIssue ,
5+ KNOWN_CONFIG_ISSUES ,
6+ knownIssueCsvNote ,
7+ matchKnownConfigIssues ,
8+ pointMatchesIssue ,
9+ runIdFromRunUrl ,
10+ } from './known-issues' ;
411
512const DSR1 = 'DeepSeek-R1-0528' ;
613
7- describe ( 'matchKnownConfigIssues' , ( ) => {
8- it ( 'matches the GB300 Dynamo TRT MTP entry for DeepSeek R1 FP8' , ( ) => {
9- const issues = matchKnownConfigIssues ( DSR1 , [
10- { hwKey : 'gb300_dynamo-trt_mtp' , precision : 'fp8' } ,
11- ] ) ;
12- expect ( issues ) . toHaveLength ( 1 ) ;
13- expect ( issues [ 0 ] . url ) . toBe ( 'https://github.com/NVIDIA/srt-slurm/issues/51' ) ;
14+ const GB300_AFFECTED_RUN = '21785935852' ;
15+ const GB300_AFFECTED_URL = `https://github.com/SemiAnalysisAI/InferenceX/actions/runs/${ GB300_AFFECTED_RUN } /attempts/2` ;
16+ const GB300_AFFECTED_URL_FEB5 =
17+ 'https://github.com/SemiAnalysisAI/InferenceX/actions/runs/21726915223/attempts/1' ;
18+ const GB300_FIXED_URL =
19+ 'https://github.com/SemiAnalysisAI/InferenceX/actions/runs/99999999999/attempts/1' ;
20+
21+ const MI355X_AFFECTED_URL_MAR13 =
22+ 'https://github.com/SemiAnalysisAI/InferenceX/actions/runs/23052579053' ;
23+ const MI355X_AFFECTED_URL_MAY7 =
24+ 'https://github.com/SemiAnalysisAI/InferenceX/actions/runs/25471873049' ;
25+ const MI355X_AFFECTED_URL_MAY31 =
26+ 'https://github.com/SemiAnalysisAI/InferenceX/actions/runs/26714221123' ;
27+ const MI355X_UNFLAGGED_URL =
28+ 'https://github.com/SemiAnalysisAI/InferenceX/actions/runs/26491418772' ;
29+
30+ const gb300Issue = KNOWN_CONFIG_ISSUES . find ( ( i ) => i . hwKey === 'gb300_dynamo-trt_mtp' ) ! ;
31+ const mi355xIssue = KNOWN_CONFIG_ISSUES . find ( ( i ) => i . hwKey === 'mi355x_mori-sglang_mtp' ) ! ;
32+
33+ describe ( 'runIdFromRunUrl' , ( ) => {
34+ it ( 'extracts the run id, ignoring the /attempts suffix and host' , ( ) => {
35+ expect ( runIdFromRunUrl ( GB300_AFFECTED_URL ) ) . toBe ( GB300_AFFECTED_RUN ) ;
36+ expect ( runIdFromRunUrl ( 'https://example.test/x/runs/777/attempts/3' ) ) . toBe ( '777' ) ;
1437 } ) ;
1538
16- it ( 'does not match GB300 Dynamo TRT MTP for non-FP8 precisions' , ( ) => {
17- const issues = matchKnownConfigIssues ( DSR1 , [
18- { hwKey : 'gb300_dynamo-trt_mtp' , precision : 'fp4' } ,
19- ] ) ;
20- expect ( issues ) . toHaveLength ( 0 ) ;
39+ it ( 'returns null for missing or unparseable URLs' , ( ) => {
40+ expect ( runIdFromRunUrl ( undefined ) ) . toBeNull ( ) ;
41+ expect ( runIdFromRunUrl ( null ) ) . toBeNull ( ) ;
42+ expect ( runIdFromRunUrl ( 'https://github.com/o/r/actions' ) ) . toBeNull ( ) ;
2143 } ) ;
44+ } ) ;
2245
23- it ( 'matches the MI355X MoRI SGLang MTP entry for DeepSeek R1 FP4' , ( ) => {
24- const issues = matchKnownConfigIssues ( DSR1 , [
25- { hwKey : 'mi355x_mori-sglang_mtp' , precision : 'fp4' } ,
26- ] ) ;
27- expect ( issues ) . toHaveLength ( 1 ) ;
28- expect ( issues [ 0 ] . url ) . toBe ( 'https://github.com/sgl-project/sglang/issues/27194' ) ;
46+ // pointMatchesIssue holds the real matching logic; matchKnownConfigIssues just
47+ // wraps it in a model filter + dedup, so the behavior matrix lives here.
48+ describe ( 'pointMatchesIssue' , ( ) => {
49+ it ( 'matches each affected run of a run-scoped issue and nothing else' , ( ) => {
50+ for ( const run_url of [ GB300_AFFECTED_URL , GB300_AFFECTED_URL_FEB5 ] ) {
51+ expect (
52+ pointMatchesIssue ( gb300Issue , { hwKey : 'gb300_dynamo-trt_mtp' , precision : 'fp8' , run_url } ) ,
53+ ) . toBe ( true ) ;
54+ }
55+ expect (
56+ pointMatchesIssue ( gb300Issue , {
57+ hwKey : 'gb300_dynamo-trt_mtp' ,
58+ precision : 'fp8' ,
59+ run_url : GB300_FIXED_URL ,
60+ } ) ,
61+ ) . toBe ( false ) ;
62+
63+ for ( const run_url of [
64+ MI355X_AFFECTED_URL_MAR13 ,
65+ MI355X_AFFECTED_URL_MAY7 ,
66+ MI355X_AFFECTED_URL_MAY31 ,
67+ ] ) {
68+ expect (
69+ pointMatchesIssue ( mi355xIssue , {
70+ hwKey : 'mi355x_mori-sglang_mtp' ,
71+ precision : 'fp4' ,
72+ run_url,
73+ } ) ,
74+ ) . toBe ( true ) ;
75+ }
76+ expect (
77+ pointMatchesIssue ( mi355xIssue , {
78+ hwKey : 'mi355x_mori-sglang_mtp' ,
79+ precision : 'fp4' ,
80+ run_url : MI355X_UNFLAGGED_URL ,
81+ } ) ,
82+ ) . toBe ( false ) ;
2983 } ) ;
3084
31- it ( 'does not match MI355X MoRI SGLang MTP for non-FP4 precisions' , ( ) => {
32- const issues = matchKnownConfigIssues ( DSR1 , [
33- { hwKey : 'mi355x_mori-sglang_mtp' , precision : 'fp8' } ,
34- ] ) ;
35- expect ( issues ) . toHaveLength ( 0 ) ;
85+ it ( 'ignores the /attempts/<n> suffix when matching the run id' , ( ) => {
86+ const reattempt = `https://github.com/SemiAnalysisAI/InferenceX/actions/runs/${ GB300_AFFECTED_RUN } /attempts/1` ;
87+ expect (
88+ pointMatchesIssue ( gb300Issue , {
89+ hwKey : 'gb300_dynamo-trt_mtp' ,
90+ precision : 'fp8' ,
91+ run_url : reattempt ,
92+ } ) ,
93+ ) . toBe ( true ) ;
3694 } ) ;
3795
38- it ( 'does not match other models' , ( ) => {
39- const issues = matchKnownConfigIssues ( 'DeepSeek-V4-Pro' , [
40- { hwKey : 'gb300_dynamo-trt_mtp' , precision : 'fp4' } ,
41- { hwKey : 'mi355x_mori-sglang_mtp' , precision : 'fp4' } ,
42- ] ) ;
43- expect ( issues ) . toHaveLength ( 0 ) ;
96+ it ( 'does not match a run-scoped issue when the point has no run_url' , ( ) => {
97+ expect ( pointMatchesIssue ( gb300Issue , { hwKey : 'gb300_dynamo-trt_mtp' , precision : 'fp8' } ) ) . toBe (
98+ false ,
99+ ) ;
100+ } ) ;
101+
102+ it ( 'does not match on a wrong precision or hwKey' , ( ) => {
103+ expect (
104+ pointMatchesIssue ( gb300Issue , {
105+ hwKey : 'gb300_dynamo-trt_mtp' ,
106+ precision : 'fp4' ,
107+ run_url : GB300_AFFECTED_URL ,
108+ } ) ,
109+ ) . toBe ( false ) ;
110+ expect (
111+ pointMatchesIssue ( gb300Issue , {
112+ hwKey : 'b200_trt_mtp' ,
113+ precision : 'fp8' ,
114+ run_url : GB300_AFFECTED_URL ,
115+ } ) ,
116+ ) . toBe ( false ) ;
117+ } ) ;
118+
119+ it ( 'matches an issue with no affectedRuns on any point regardless of run' , ( ) => {
120+ const unscoped : KnownConfigIssue = {
121+ hwKey : 'foo_bar_mtp' ,
122+ model : gb300Issue . model ,
123+ precisions : [ 'fp8' ] ,
124+ summary : 'Accuracy issues' ,
125+ filed : 'Jan 1, 2026' ,
126+ url : 'https://example.test/issue' ,
127+ issueRef : 'example/repo#1' ,
128+ } ;
129+ expect ( pointMatchesIssue ( unscoped , { hwKey : 'foo_bar_mtp' , precision : 'fp8' } ) ) . toBe ( true ) ;
130+ expect (
131+ pointMatchesIssue ( unscoped , {
132+ hwKey : 'foo_bar_mtp' ,
133+ precision : 'fp8' ,
134+ run_url : GB300_FIXED_URL ,
135+ } ) ,
136+ ) . toBe ( true ) ;
44137 } ) ;
138+ } ) ;
45139
46- it ( 'does not match unaffected configs (non-MTP, other hardware)' , ( ) => {
47- const issues = matchKnownConfigIssues ( DSR1 , [
48- { hwKey : 'gb300_dynamo-trt' , precision : 'fp4' } ,
49- { hwKey : 'mi355x_sglang' , precision : 'fp4' } ,
50- { hwKey : 'b200_trt_mtp' , precision : 'fp4' } ,
140+ describe ( 'matchKnownConfigIssues' , ( ) => {
141+ it ( 'resolves a matching point to its issue, per config' , ( ) => {
142+ const gb = matchKnownConfigIssues ( DSR1 , [
143+ { hwKey : 'gb300_dynamo-trt_mtp' , precision : 'fp8' , run_url : GB300_AFFECTED_URL } ,
51144 ] ) ;
52- expect ( issues ) . toHaveLength ( 0 ) ;
145+ expect ( gb ) . toHaveLength ( 1 ) ;
146+ expect ( gb [ 0 ] . issueRef ) . toBe ( 'NVIDIA/srt-slurm#51' ) ;
147+
148+ const amd = matchKnownConfigIssues ( DSR1 , [
149+ { hwKey : 'mi355x_mori-sglang_mtp' , precision : 'fp4' , run_url : MI355X_AFFECTED_URL_MAY7 } ,
150+ ] ) ;
151+ expect ( amd ) . toHaveLength ( 1 ) ;
152+ expect ( amd [ 0 ] . issueRef ) . toBe ( 'sgl-project/sglang#27194' ) ;
53153 } ) ;
54154
55- it ( 'returns each issue at most once even with many matching points' , ( ) => {
56- const issues = matchKnownConfigIssues ( DSR1 , [
57- { hwKey : 'gb300_dynamo-trt_mtp' , precision : 'fp8' } ,
58- { hwKey : 'gb300_dynamo-trt_mtp' , precision : 'fp8' } ,
59- { hwKey : 'mi355x_mori-sglang_mtp' , precision : 'fp4' } ,
155+ it ( 'filters by model and returns each issue at most once' , ( ) => {
156+ expect (
157+ matchKnownConfigIssues ( 'DeepSeek-V4-Pro' , [
158+ { hwKey : 'gb300_dynamo-trt_mtp' , precision : 'fp8' , run_url : GB300_AFFECTED_URL } ,
159+ ] ) ,
160+ ) . toHaveLength ( 0 ) ;
161+
162+ const both = matchKnownConfigIssues ( DSR1 , [
163+ { hwKey : 'gb300_dynamo-trt_mtp' , precision : 'fp8' , run_url : GB300_AFFECTED_URL } ,
164+ { hwKey : 'gb300_dynamo-trt_mtp' , precision : 'fp8' , run_url : GB300_AFFECTED_URL } ,
165+ { hwKey : 'mi355x_mori-sglang_mtp' , precision : 'fp4' , run_url : MI355X_AFFECTED_URL_MAY7 } ,
60166 ] ) ;
61- expect ( issues ) . toHaveLength ( 2 ) ;
167+ expect ( both ) . toHaveLength ( 2 ) ;
62168 } ) ;
63169
64170 it ( 'returns nothing for an empty point list' , ( ) => {
@@ -68,7 +174,7 @@ describe('matchKnownConfigIssues', () => {
68174
69175describe ( 'knownIssueCsvNote' , ( ) => {
70176 it ( 'includes the config label, filing date, issue ref, and URL' , ( ) => {
71- const note = knownIssueCsvNote ( KNOWN_CONFIG_ISSUES [ 0 ] , 'GB300 NVL72 (Dynamo TRT, MTP)' ) ;
177+ const note = knownIssueCsvNote ( gb300Issue , 'GB300 NVL72 (Dynamo TRT, MTP)' ) ;
72178 expect ( note ) . toContain ( 'WARNING: GB300 NVL72 (Dynamo TRT, MTP)' ) ;
73179 expect ( note ) . toContain ( 'filed since Apr 21, 2026' ) ;
74180 expect ( note ) . toContain ( 'NVIDIA/srt-slurm#51' ) ;
0 commit comments