File size: 26,419 Bytes
5c58519
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
{
  "op": "ai.onnx.Hardmax",
  "fixtureArrays": {
    "ort_three_dims_input_x": [1.0856307, 0.99734545, 0.2829785, 1.5062947, 0.5786002, 1.6514366, 2.4266791, 0.42891264, 1.2659363, 0.8667404, 0.6788862, 0.09470897, 1.4913896, 0.638902, 0.44398195, 0.43435127, 2.20593, 2.1867862, 1.004054, 0.3861864, 0.7373686, 1.4907321, 0.9358339, 1.175829, 1.2538806, 0.6377515, 0.9071052, 1.4286807, 0.14006872, 0.8617549, 0.25561938, 2.798589, 1.7715331, 0.69987726, 0.92746246, 0.17363568, 0.002845916, 0.6882227, 0.87953633, 0.28362733, 0.8053665, 1.7276695, 0.3908998, 0.57380587, 0.33858904, 0.011830495, 2.3923652, 0.41291216, 0.978736, 2.2381434, 1.2940853, 1.0387882, 1.7437122, 0.79806274, 0.02968323, 1.0693159, 0.8907064, 1.7548862, 1.4956441, 1.0693927],
    "onnx_backend_hardmax_input_x": [1.764052391052246, 0.40015721321105957, 0.978738009929657, 2.2408931255340576, 1.8675580024719238, -0.9772778749465942, 0.9500884413719177, -0.15135720372200012, -0.10321885347366333, 0.4105985164642334, 0.14404356479644775, 1.4542734622955322, 0.7610377073287964, 0.12167501449584961, 0.44386324286460876, 0.3336743414402008, 1.4940791130065918, -0.2051582634449005, 0.3130677044391632, -0.8540957570075989, -2.5529897212982178, 0.653618574142456, 0.8644362092018127, -0.7421650290489197, 2.269754648208618, -1.4543657302856445, 0.04575851559638977, -0.18718385696411133, 1.5327792167663574, 1.4693588018417358, 0.154947429895401, 0.37816253304481506, -0.8877857327461243, -1.980796456336975, -0.34791216254234314, 0.15634897351264954, 1.2302906513214111, 1.202379822731018, -0.38732680678367615, -0.302302747964859, -1.0485529899597168, -1.420017957687378, -1.7062702178955078, 1.950775384902954, -0.5096521973609924, -0.4380742907524109, -1.2527953386306763, 0.7774903774261475, -1.6138978004455566, -0.21274028718471527, -0.8954665660858154, 0.38690251111984253, -0.5108051300048828, -1.18063223361969, -0.02818222902715206, 0.4283318817615509, 0.06651721894741058, 0.30247190594673157, -0.6343221068382263, -0.3627411723136902],
    "onnx_backend_example_4x4_input_x": [3, 0, 1, 2, 2, 5, 1, 0, 0, 1, 3, 2, 0, 1, 2, 3]
  },
  "cases": [
    {
      "name": "f32_positive_subnormal_beats_zero_gpu_gap",
      "skipGpu": {
        "category": "permanent",
        "reason": "Portable WGSL floating-point semantics do not guarantee preservation of the subnormal values required by this fixture. Backend evidence: WebGPU/Metal flushes subnormals to zero in f32; bit-exact subnormal preservation is unattainable on GPU."
      },
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/math/hardmax_test.cc",
        "test": "HardmaxOperator.Simple",
        "notes": "A positive subnormal is strictly greater than zero; Hardmax should put the one-hot at that element rather than tie-breaking on a flushed zero."
      },
      "attrs": { "axis": -1 },
      "inputs": {
        "x": { "dtype": "float32", "shape": [1, 3], "data": { "kind": "values", "values": [-1e-40, 0.0, 1e-40] } }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [1, 3], "tolerance": 0 } }
    },
    {
      "name": "f32_positive_subnormal_beats_zero_axis0_gpu_gap",
      "skipGpu": {
        "category": "permanent",
        "reason": "Portable WGSL floating-point semantics do not guarantee preservation of the subnormal values required by this fixture. Backend evidence: WebGPU/Metal flushes subnormals to zero in f32; bit-exact subnormal preservation is unattainable on GPU."
      },
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/math/hardmax_test.cc",
        "test": "HardmaxOperator.Simple",
        "notes": "Axis-0 companion for finite subnormal ordering: a positive subnormal is strictly greater than zero and should receive the one-hot."
      },
      "attrs": { "axis": 0 },
      "inputs": {
        "x": { "dtype": "float32", "shape": [3, 1], "data": { "kind": "values", "values": [-1e-40, 0.0, 1e-40] } }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [3, 1], "tolerance": 0 } }
    },
    {
      "name": "f32_positive_subnormal_beats_zero_last_axis_vec4_gpu_gap",
      "skipGpu": {
        "category": "permanent",
        "reason": "Portable WGSL floating-point semantics do not guarantee preservation of the subnormal values required by this fixture. Backend evidence: WebGPU/Metal flushes subnormals to zero in f32; bit-exact subnormal preservation is unattainable on GPU."
      },
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/math/hardmax_test.cc",
        "test": "HardmaxOperator.Simple",
        "notes": "Vec4 last-axis companion: a positive subnormal is strictly greater than zero and should win over zero-valued lanes."
      },
      "attrs": { "axis": -1 },
      "inputs": {
        "x": { "dtype": "float32", "shape": [1, 4], "data": { "kind": "values", "values": [0.0, 1e-40, 0.0, -1e-40] } }
      },
      "outputs": {
        "y": {
          "dtype": "float32",
          "shape": [1, 4],
          "tolerance": 0,
          "data": { "kind": "values", "values": [0.0, 1.0, 0.0, 0.0] }
        }
      }
    },
    {
      "name": "f32_positive_subnormal_beats_zero_last_axis_subgroup_gpu_gap",
      "skipGpu": {
        "category": "permanent",
        "reason": "Portable WGSL floating-point semantics do not guarantee preservation of the subnormal values required by this fixture. Backend evidence: WebGPU/Metal flushes subnormals to zero in f32; bit-exact subnormal preservation is unattainable on GPU."
      },
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/math/hardmax_test.cc",
        "test": "HardmaxOperator.LargeNumber",
        "notes": "Subgroup last-axis companion: width 1025 bypasses the vec4 specialization, and a positive subnormal must still beat zero-valued lanes."
      },
      "attrs": { "axis": -1 },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [1, 1025],
          "data": { "kind": "cycle", "values": [0.0, 1e-40, 0.0, -1e-40] }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [1, 1025], "tolerance": 0 } }
    },
    {
      "name": "dispatch_cliff_axis_last_dim1",
      "attrs": { "axis": -1 },
      "inputs": { "x": { "dtype": "float32", "shape": [16776961, 1], "data": { "kind": "constant", "value": 1.0 } } },
      "outputs": { "y": { "dtype": "float32", "shape": [16776961, 1], "tolerance": 0 } }
    },
    {
      "name": "simple_last_axis",
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/math/hardmax_test.cc",
        "test": "HardmaxOperator.Simple"
      },
      "inputs": {
        "x": { "dtype": "float32", "shape": [1, 3], "data": { "kind": "values", "values": [-1.0, 0.0, 1.0] } }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [1, 3] } }
    },
    {
      "name": "onnx_backend_example_4x4",
      "provenance": {
        "source": "cmake/external/onnx/onnx/backend/test/data/node/test_hardmax_example",
        "test": "test_hardmax_example"
      },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [4, 4],
          "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_example_4x4_input_x" } }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [4, 4], "tolerance": 0 } }
    },
    {
      "name": "onnx_backend_one_hot_tie_first",
      "provenance": {
        "source": "cmake/external/onnx/onnx/backend/test/data/node/test_hardmax_one_hot",
        "test": "test_hardmax_one_hot"
      },
      "inputs": {
        "x": { "dtype": "float32", "shape": [1, 4], "data": { "kind": "values", "values": [3.0, 3.0, 3.0, 1.0] } }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [1, 4], "tolerance": 0 } }
    },
    {
      "name": "large_values",
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/math/hardmax_test.cc",
        "test": "HardmaxOperator.LargeNumber"
      },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [2, 4],
          "data": { "kind": "values", "values": [0.0, 1.0, 2.0, 3.0, 10000.0, 10001.0, 10002.0, 10003.0] }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [2, 4] } }
    },
    {
      "name": "ort_compact_axis0_f32",
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/math/hardmax_test.cc",
        "test": "HardmaxOperator.ThreeDimsAxis0",
        "notes": "Compact axis-0 variant covering the same non-last-axis behavior without the full ORT random tensor."
      },
      "attrs": { "axis": 0 },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [3, 2],
          "data": { "kind": "values", "values": [1.0, 5.0, 9.0, 4.0, 7.0, 6.0] }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [3, 2], "tolerance": 0 } }
    },
    {
      "name": "axis1_rank3",
      "attrs": { "axis": 1 },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [2, 3, 2],
          "data": { "kind": "values", "values": [1.0, 9.0, 7.0, 4.0, 5.0, 6.0, 3.0, 2.0, 8.0, 1.0, 4.0, 5.0] }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [2, 3, 2] } }
    },
    {
      "name": "negative_axis",
      "attrs": { "axis": -2 },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [2, 3, 2],
          "data": { "kind": "values", "values": [1.0, 9.0, 7.0, 4.0, 5.0, 6.0, 3.0, 2.0, 8.0, 1.0, 4.0, 5.0] }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [2, 3, 2] } }
    },
    {
      "name": "ties_choose_first",
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [2, 4],
          "data": { "kind": "values", "values": [1.0, 3.0, 3.0, 2.0, 5.0, 5.0, 1.0, 5.0] }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [2, 4] } }
    },
    {
      "name": "ort_axis1_nan_rows",
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/math/hardmax_test.cc",
        "test": "HardmaxOperator.Simple",
        "notes": "Compatibility NaN behavior on the last axis: a leading NaN or all-NaN row produces all zeros, while a NaN after a finite incumbent does not replace the selected maximum."
      },
      "attrs": { "axis": 1 },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [4, 4],
          "data": {
            "kind": "values",
            "values": ["NaN", 1.0, 2.0, 0.0, 1.0, "NaN", 2.0, 0.0, 1.0, 2.0, "NaN", 0.0, "NaN", "NaN", "NaN", "NaN"]
          }
        }
      },
      "outputs": {
        "y": {
          "dtype": "float32",
          "shape": [4, 4],
          "tolerance": 0,
          "data": {
            "kind": "values",
            "values": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
          }
        }
      }
    },
    {
      "name": "ort_rank3_axis1_nan_columns",
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/math/hardmax_test.cc",
        "test": "HardmaxOperator.ThreeDimsAxis1_opset13",
        "notes": "Compatibility NaN behavior on a non-last axis: leading-NaN and all-NaN reduced columns produce all zeros, while later NaNs after a finite value are ignored."
      },
      "attrs": { "axis": 1 },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [2, 3, 2],
          "data": {
            "kind": "values",
            "values": ["NaN", 1.0, 1.0, "NaN", 2.0, 2.0, 1.0, "NaN", 2.0, "NaN", "NaN", "NaN"]
          }
        }
      },
      "outputs": {
        "y": {
          "dtype": "float32",
          "shape": [2, 3, 2],
          "tolerance": 0,
          "data": { "kind": "values", "values": [0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0] }
        }
      }
    },
    {
      "name": "float16_axis0",
      "attrs": { "axis": 0 },
      "inputs": {
        "x": {
          "dtype": "float16",
          "shape": [3, 2],
          "data": { "kind": "values", "values": [1.0, 5.0, 4.0, 2.0, 3.0, 6.0] }
        }
      },
      "outputs": { "y": { "dtype": "float16", "shape": [3, 2], "tolerance": 0.001 } }
    },
    {
      "name": "rank4_axis2_ties_choose_first",
      "attrs": { "axis": 2 },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [1, 2, 3, 2],
          "data": { "kind": "values", "values": [1.0, 9.0, 3.0, 9.0, 3.0, 8.0, 5.0, 0.0, 5.0, 1.0, 4.0, 1.0] }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [1, 2, 3, 2], "tolerance": 0 } }
    },
    {
      "name": "float16_ties_choose_first",
      "inputs": {
        "x": {
          "dtype": "float16",
          "shape": [2, 4],
          "data": { "kind": "values", "values": [1.0, 3.0, 3.0, 2.0, 5.0, 5.0, 1.0, 5.0] }
        }
      },
      "outputs": { "y": { "dtype": "float16", "shape": [2, 4], "tolerance": 0 } }
    },
    {
      "name": "last_axis_64_tie_first_f32",
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [1, 64],
          "data": {
            "kind": "values",
            "values": [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 100.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0, 100.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0, 49.0, 50.0, 51.0, 52.0, 53.0, 54.0, 55.0, 56.0, 57.0, 58.0, 59.0, 60.0, 61.0, 62.0, 63.0]
          }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [1, 64], "tolerance": 0 } }
    },
    {
      "name": "last_axis_128_f16",
      "inputs": {
        "x": {
          "dtype": "float16",
          "shape": [2, 128],
          "data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29 }
        }
      },
      "outputs": { "y": { "dtype": "float16", "shape": [2, 128], "tolerance": 0 } }
    },
    {
      "name": "last_axis_1025_f32",
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [1, 1025],
          "data": { "kind": "fillFloat32", "sinStep": 0.07, "cosStep": 0.19 }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [1, 1025], "tolerance": 0 } }
    },
    {
      "name": "ort_three_dims_axis1_opset13",
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/math/hardmax_test.cc",
        "test": "HardmaxOperator.ThreeDimsAxis1_opset13"
      },
      "attrs": { "axis": 1 },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [3, 4, 5],
          "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_three_dims_input_x" } }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [3, 4, 5], "tolerance": 0 } }
    },
    {
      "name": "ort_three_dims_default_axis_opset13",
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/math/hardmax_test.cc",
        "test": "HardmaxOperator.ThreeDimsDefaultAxis_opset13"
      },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [3, 4, 5],
          "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_three_dims_input_x" } }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [3, 4, 5], "tolerance": 0 } }
    },
    {
      "name": "ort_three_dims_axis2_opset13",
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/math/hardmax_test.cc",
        "test": "HardmaxOperator.ThreeDimsAxis2_opset13"
      },
      "attrs": { "axis": 2 },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [3, 4, 5],
          "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_three_dims_input_x" } }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [3, 4, 5], "tolerance": 0 } }
    },
    {
      "name": "ort_three_dims_negative_axis_last",
      "provenance": {
        "source": "onnxruntime/test/providers/cpu/math/hardmax_test.cc",
        "test": "HardmaxOperator.ThreeDimsNegAxis2",
        "notes": "Axis=-1 maps to the last dimension; this matches opset-13 last-axis semantics."
      },
      "attrs": { "axis": -1 },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [3, 4, 5],
          "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_three_dims_input_x" } }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [3, 4, 5], "tolerance": 0 } }
    },
    {
      "name": "onnx_backend_hardmax_axis_0",
      "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_hardmax_axis_0" },
      "attrs": { "axis": 0 },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [3, 4, 5],
          "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_hardmax_input_x" } }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [3, 4, 5], "tolerance": 0 } }
    },
    {
      "name": "onnx_backend_hardmax_axis_1",
      "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_hardmax_axis_1" },
      "attrs": { "axis": 1 },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [3, 4, 5],
          "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_hardmax_input_x" } }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [3, 4, 5], "tolerance": 0 } }
    },
    {
      "name": "onnx_backend_hardmax_axis_2",
      "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_hardmax_axis_2" },
      "attrs": { "axis": 2 },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [3, 4, 5],
          "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_hardmax_input_x" } }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [3, 4, 5], "tolerance": 0 } }
    },
    {
      "name": "onnx_backend_hardmax_default_axis",
      "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_hardmax_default_axis" },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [3, 4, 5],
          "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_hardmax_input_x" } }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [3, 4, 5], "tolerance": 0 } }
    },
    {
      "name": "onnx_backend_hardmax_negative_axis",
      "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_hardmax_negative_axis" },
      "attrs": { "axis": -1 },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [3, 4, 5],
          "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_hardmax_input_x" } }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [3, 4, 5], "tolerance": 0 } }
    },
    {
      "name": "onnx_backend_hardmax_example",
      "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_hardmax_example" },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [4, 4],
          "data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/onnx_backend_example_4x4_input_x" } }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [4, 4], "tolerance": 0.0001 } }
    },
    {
      "name": "onnx_backend_hardmax_one_hot",
      "provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_hardmax_one_hot" },
      "inputs": {
        "x": { "dtype": "float32", "shape": [1, 4], "data": { "kind": "values", "values": [3.0, 3.0, 3.0, 1.0] } }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [1, 4], "tolerance": 0.0001 } }
    },
    {
      "name": "empty_input_zero_dim",
      "inputs": { "x": { "dtype": "float32", "shape": [0, 3], "data": { "kind": "values", "values": [] } } },
      "outputs": { "y": { "dtype": "float32", "shape": [0, 3], "tolerance": 0 } }
    },
    {
      "name": "rank7_last_axis",
      "provenance": {
        "source": "ONNX spec: Hardmax permits arbitrary rank; onnxruntime CPU coerces dims [0,axis) to rows and [axis,end) to cols with no rank cap.",
        "notes": "Rank-7 last-axis coverage for the generalized last_axis_vec4 path. ORT and WebGPU both compute the normal one-hot result."
      },
      "attrs": { "axis": -1 },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [2, 1, 1, 1, 1, 1, 4],
          "data": { "kind": "values", "values": [3.0, 1.0, 4.0, 2.0, 5.0, 9.0, 1.0, 6.0] }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [2, 1, 1, 1, 1, 1, 4], "tolerance": 0 } }
    },
    {
      "name": "rank7_axis0",
      "provenance": {
        "source": "ONNX spec: Hardmax permits arbitrary rank; onnxruntime CPU reduces over the requested axis at any rank.",
        "notes": "Rank-7 non-last-axis coverage for the generic axis path. ORT and WebGPU reduce over axis 0 per inner column."
      },
      "attrs": { "axis": 0 },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [3, 1, 1, 1, 1, 1, 2],
          "data": { "kind": "values", "values": [1.0, 5.0, 9.0, 4.0, 7.0, 6.0] }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [3, 1, 1, 1, 1, 1, 2], "tolerance": 0 } }
    },
    {
      "name": "f16_last_axis_subgroup_1025",
      "provenance": {
        "source": "Clean coverage: the adaptive f16 last-axis row path (dim(last) >= 1024, f16Ok) was correctness-untested (only f16 vec4 cols=128 and f16 axis-0 rank2 existed).",
        "notes": "Last dim 1025 (>=1024, not %4==0) skips last_axis_vec4 and selects last_axis_row with f16. linspace 0..1025 gives exact distinct f16 integers (representable to 2048) so argmax is unambiguous at the final lane."
      },
      "attrs": { "axis": -1 },
      "inputs": {
        "x": { "dtype": "float16", "shape": [1, 1025], "data": { "kind": "linspace", "start": 0.0, "end": 1025.0 } }
      },
      "outputs": { "y": { "dtype": "float16", "shape": [1, 1025], "tolerance": 0 } }
    },
    {
      "name": "f16_axis1_rank3",
      "provenance": {
        "source": "Clean coverage: f16 'axis' scalar fallback on a non-last axis (existing f16 fixtures only cover axis-0 rank2 and last-axis rank2).",
        "notes": "Rank-3 axis=1 f16 selects the generic 'axis' variant with usesF16. Distinct per-column values avoid ties."
      },
      "attrs": { "axis": 1 },
      "inputs": {
        "x": {
          "dtype": "float16",
          "shape": [2, 3, 2],
          "data": { "kind": "values", "values": [1.0, 9.0, 7.0, 4.0, 5.0, 6.0, 3.0, 2.0, 8.0, 1.0, 4.0, 5.0] }
        }
      },
      "outputs": { "y": { "dtype": "float16", "shape": [2, 3, 2], "tolerance": 0 } }
    },
    {
      "name": "vec4_lone_finite_among_neg_inf",
      "attrs": { "axis": -1 },
      "provenance": {
        "source": "Coverage gap: vec4 last-axis path with -Infinity seed. Existing vec4 tests use finite fillFloat32/values; a row of all -Infinity except one finite element is untested.",
        "notes": "cols=8 selects last_axis_vec4. Only index 6 is finite (3.0); every other lane is -Infinity, so the one-hot must land at index 6."
      },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [1, 8],
          "data": {
            "kind": "values",
            "values": ["-Infinity", "-Infinity", "-Infinity", "-Infinity", "-Infinity", "-Infinity", 3.0, "-Infinity"]
          }
        }
      },
      "outputs": {
        "y": {
          "dtype": "float32",
          "shape": [1, 8],
          "tolerance": 0,
          "data": { "kind": "values", "values": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0] }
        }
      }
    },
    {
      "name": "subgroup_cross_slot_lowest_index_tie_1025",
      "attrs": { "axis": -1 },
      "provenance": {
        "source": "Coverage gap: subgroup last-axis lowest-index tie reduction. Existing 1025-wide subgroup tests use unique-max linspace, so cross-subgroup/slot ties are untested.",
        "notes": "cols=1025 (>=1024, %4!=0) selects last_axis_row, whose capability-adaptive reduction uses subgroup or portable execution. Alternating 0/1 makes 1.0 the max at every odd index; first occurrence is index 1, so the one-hot must land at index 1 despite ties spanning multiple reduction slots."
      },
      "inputs": { "x": { "dtype": "float32", "shape": [1, 1025], "data": { "kind": "cycle", "values": [0.0, 1.0] } } },
      "outputs": { "y": { "dtype": "float32", "shape": [1, 1025], "tolerance": 0 } }
    },
    {
      "name": "f16_subgroup_all_equal_tie_index0_1025",
      "attrs": { "axis": -1 },
      "provenance": {
        "source": "Coverage gap: the adaptive f16 last-axis row path under a full tie. The existing f16_last_axis_subgroup_1025 fixture uses distinct linspace values, so an all-equal f16 row is untested.",
        "notes": "cols=1025 (>=1024, %4!=0) with f16 selects the adaptive last_axis_row path. All values equal (1.0) => first max is index 0, so the one-hot must land at index 0."
      },
      "inputs": { "x": { "dtype": "float16", "shape": [1, 1025], "data": { "kind": "constant", "value": 1.0 } } },
      "outputs": { "y": { "dtype": "float16", "shape": [1, 1025], "tolerance": 0 } }
    },
    {
      "name": "axis_tree_axis0_1024x2",
      "attrs": { "axis": 0 },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [1024, 2],
          "data": { "kind": "fillFloat32", "sinStep": 0.013, "cosStep": 0.027, "scale": 2.0 }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [1024, 2], "tolerance": 0 } }
    },
    {
      "name": "rank8_last_axis",
      "attrs": { "axis": -1 },
      "inputs": {
        "x": {
          "dtype": "float32",
          "shape": [2, 1, 1, 1, 1, 1, 2, 4],
          "data": {
            "kind": "values",
            "values": [3.0, 1.0, 4.0, 2.0, 5.0, 9.0, 1.0, 6.0, 2.0, 7.0, 1.0, 8.0, 0.5, 0.25, 3.5, 1.25]
          }
        }
      },
      "outputs": { "y": { "dtype": "float32", "shape": [2, 1, 1, 1, 1, 1, 2, 4], "tolerance": 0 } }
    }
  ]
}