-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathscoreboard.html
More file actions
1614 lines (1569 loc) · 96.3 KB
/
Copy pathscoreboard.html
File metadata and controls
1614 lines (1569 loc) · 96.3 KB
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
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Transcoding GPU Benchmark</title>
<style>
:root{
--bg:#0a0e14; --panel:#121823; --ink:#e8eef7; --muted:#7b8aa0;
--green:#2ecc71; --red:#e74c3c; --amber:#f1c40f;
--accent:#4aa3ff; /* brand color — swapped per GPU vendor */
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
background:radial-gradient(1200px 800px at 50% -10%,#16202e 0%,var(--bg) 60%);
color:var(--ink); font-family:"Segoe UI",system-ui,-apple-system,sans-serif;
padding:28px 32px; min-height:100%;
}
header{display:flex;justify-content:space-between;align-items:baseline;
border-bottom:1px solid #1e2b3d;padding-bottom:14px;margin-bottom:22px}
header h1{font-size:26px;font-weight:700;letter-spacing:.3px}
header .profile{color:var(--muted);font-size:15px}
header .profile b{color:var(--accent)}
.hwline{color:var(--muted);font-size:14px;margin-top:6px;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.hwline b{color:var(--ink)} .hwline .warn{color:var(--amber)}
#verdict .specs .warn{color:var(--amber)}
#suberr{display:none;margin-top:12px;font-size:14px;color:var(--red);font-weight:600}
#suberr.show{display:block}
#suberr.ok{color:var(--green)}
.vchip{display:inline-flex;align-items:center;gap:7px;font-size:12px;font-weight:700;
letter-spacing:1.5px;text-transform:uppercase;color:var(--accent);
border:1px solid var(--accent);border-radius:999px;padding:3px 11px}
.vchip .dot{width:9px;height:9px;border-radius:50%;background:var(--accent)}
.top{display:grid;grid-template-columns:1.1fr 1.5fr;gap:22px;margin-bottom:24px}
.panel{background:var(--panel);border:1px solid #1e2b3d;border-radius:16px;padding:22px 26px}
.label{color:var(--muted);font-size:14px;text-transform:uppercase;letter-spacing:2px;margin-bottom:8px}
.streams-num{font-size:120px;line-height:1;font-weight:800;letter-spacing:-2px}
.sub{color:var(--muted);font-size:15px;margin-top:10px}
.gauge{display:flex;align-items:flex-end;gap:12px}
.gauge .val{font-size:80px;line-height:.9;font-weight:800;letter-spacing:-2px}
.gauge .x{font-size:30px;color:var(--muted);font-weight:700;padding-bottom:8px}
.gauge.ok .val{color:var(--green)} .gauge.bad .val{color:var(--red)}
.meterwrap{margin-top:18px}
.meter{height:18px;border-radius:9px;background:#0c121b;overflow:hidden;border:1px solid #223247;position:relative}
.meter .fill{height:100%;border-radius:9px;transition:width .4s ease,background .3s}
.meter .line{position:absolute;top:-4px;bottom:-4px;width:2px;background:var(--amber);left:50%}
.meter-legend{display:flex;justify-content:space-between;color:var(--muted);font-size:12px;margin-top:6px}
.small-stats{display:flex;gap:30px;margin-top:16px}
.small-stats div span{display:block}
.small-stats .k{color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:1.5px}
.small-stats .v{font-size:24px;font-weight:700;margin-top:3px}
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(116px,1fr));gap:12px}
.card{background:#0e1521;border:2px solid #233247;border-radius:12px;padding:14px 12px;text-align:center;transition:border-color .3s,background .3s}
.card.ok{border-color:var(--green);background:rgba(46,204,113,.08)}
.card.bad{border-color:var(--red);background:rgba(231,76,60,.10)}
.card .id{color:var(--muted);font-size:12px;letter-spacing:1px}
.card .spd{font-size:28px;font-weight:800;margin:4px 0}
.card.ok .spd{color:var(--green)} .card.bad .spd{color:var(--red)}
.card .fps{color:var(--muted);font-size:12px}
.flash{animation:flash .6s steps(1) infinite}
@keyframes flash{50%{background:rgba(231,76,60,.45);border-color:#ff6b5b}}
.status{color:var(--muted);font-size:15px;margin-top:18px;min-height:20px}
/* telemetry strip */
.tele{display:flex;gap:12px;flex-wrap:wrap;margin-top:16px}
.tele .t{background:#0e1521;border:1px solid #233247;border-radius:10px;padding:8px 14px;font-size:13px;min-width:96px}
.tele .t .tk{color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:1px}
.tele .t .tv{font-size:20px;font-weight:700;margin-top:2px}
.tele .t.accent .tv{color:var(--accent)}
.tele .t[title]{cursor:help;border-bottom:1px dotted #3a4d66}
/* verdict overlay */
#verdict{position:fixed;inset:0;display:none;flex-direction:column;align-items:center;justify-content:center;justify-content:safe center;overflow-y:auto;
background:radial-gradient(900px 600px at 50% 40%,#11161f 0%,#070b11 70%);z-index:50;text-align:center;padding:40px}
#verdict.show{display:flex}
#verdict.fail{background:radial-gradient(900px 600px at 50% 40%,#3a1414 0%,#150606 70%)}
#verdict .accentbar{position:fixed;top:0;left:0;right:0;height:8px;background:var(--accent)}
#verdict.fail .accentbar{background:var(--red)}
#verdict .cap{color:var(--muted);font-size:22px;letter-spacing:4px;text-transform:uppercase}
#verdict .n{font-size:220px;line-height:1;font-weight:900;color:var(--accent);letter-spacing:-6px;margin:6px 0}
#verdict.fail .n{color:var(--red)}
#verdict .desc{font-size:25px;max-width:900px;color:var(--ink)}
#verdict .foot{color:var(--muted);font-size:16px;margin-top:18px;max-width:840px}
#verdict .specs{color:var(--muted);font-size:14px;margin-top:14px;max-width:840px}
#verdict .specs b{color:var(--ink)}
#verdict .eff{margin-top:20px;font-size:22px}
#verdict .eff .effmain{font-weight:800;color:var(--accent)}
#verdict .eff [title]{cursor:help;border-bottom:1px dotted #44566e}
#verdict .eff .pwrrow{font-size:16px;color:var(--muted);margin-top:6px}
#verdict .eff .pwrrow b{color:var(--ink)}
#verdict .insight{margin:14px auto 0;max-width:760px;font-size:16px;line-height:1.45;
color:#cdd9e8;background:rgba(74,163,255,.08);border:1px solid #25405d;border-radius:12px;padding:12px 18px}
/* conversion verdict: two co-equal panels (per-file speed | best worker count) */
#convbody{display:none;margin:16px auto 0;max-width:860px}
#convbody.show{display:block}
#convbody .cvcols{display:flex;gap:18px;align-items:stretch}
#convbody .cvcol{flex:1;background:#0e1521;border:1px solid #25405d;border-radius:12px;padding:18px 20px;text-align:center;display:flex;flex-direction:column}
#convbody .cvtitle{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-bottom:12px}
#convbody .cvbignum{font-size:44px;font-weight:800;color:var(--accent);line-height:1}
#convbody .cvbignum span{display:block;font-size:13px;font-weight:600;color:var(--muted);margin-top:5px}
#convbody .cvtimes{display:flex;flex-direction:column;gap:7px;font-size:15px;margin:16px 0 0;color:#cdd9e8}
#convbody .cvtimes b{color:var(--accent)}
#convbody .cvlib{font-size:13px;color:var(--muted);margin-top:auto;padding-top:14px;line-height:1.45}
#convbody .cvlib b{color:#cdd9e8}
#convbody .cvrec{font-size:26px;font-weight:800;color:var(--accent);line-height:1.1}
#convbody .cvrec span{display:block;font-size:12.5px;font-weight:600;color:var(--muted);margin-top:5px}
#convbody .cvchart{margin:10px 0 2px}
#convbody .batch{text-align:left;margin-top:6px}
#convbody .batch .brow{display:flex;justify-content:space-between;font-size:14px;padding:4px 0;border-top:1px solid #1a2738}
#convbody .batch .brow:first-of-type{border-top:none}
#convbody .batch .brow .bgain{color:var(--muted)}
#convbody .batch .brow.best .bn{color:var(--accent);font-weight:700}
#convbody .beff{margin-top:12px;padding-top:12px;border-top:1px solid #1a2738;font-size:13.5px;color:#cdd9e8;line-height:1.45;text-align:left}
#convbody .beff b{color:var(--accent)}
@media(max-width:720px){#convbody .cvcols{flex-direction:column}}
/* "vs CPU" efficiency block (shown on GPU verdicts that have a matching CPU baseline) */
#vscpu{display:none;margin:16px auto 0;max-width:640px}
#vscpu.show{display:block}
#vscpu .vscard{background:#0e1521;border:1px solid #25405d;border-radius:12px;padding:16px 22px;text-align:left}
#vscpu .vshead{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-bottom:8px}
#vscpu .vsbig{font-size:26px;font-weight:800;color:var(--accent);margin-bottom:14px}
#vscpu .vsgrid{display:flex;flex-wrap:wrap;gap:12px 30px}
#vscpu .vsm{display:flex;flex-direction:column}
#vscpu .vsm .vk{font-size:12px;color:var(--muted)}
#vscpu .vsm .vv{font-size:16px;font-weight:700;color:#e8eef7}
#vscpu .vscaveat{margin-top:14px;font-size:12.5px;color:var(--muted);line-height:1.4}
#vscpu .vsnote{background:#0e1521;border:1px solid #25405d;border-radius:12px;padding:14px 20px;font-size:14.5px;color:#cdd9e8;text-align:center}
#vscpu .vsnote b{color:var(--accent)}
/* streaming verdict signpost → conversion mode (replaces the old re-encode-time panel) */
#reconv{display:none;margin:18px auto 0;max-width:560px;font-size:15px;color:var(--muted)}
#reconv.show{display:block}
#reconv a{color:var(--accent);cursor:pointer;font-weight:600;border-bottom:1px solid rgba(74,163,255,.4)}
#reconv a:hover{border-bottom-color:var(--accent)}
/* shared throughput-vs-workers curve (live panel + verdict right column).
Height is CAPPED and the SVG sizes by height (centred) — a width:100% SVG would grow
~450px tall on a wide panel and push the telemetry off-screen. */
.cvchart{width:100%;display:flex;align-items:center;justify-content:center}
.cvsvg{height:100%;width:auto;max-width:100%;display:block;overflow:visible}
#curvepanel .cvchart{height:190px}
#convbody .cvchart{height:150px}
.cvaxis{stroke:#25405d;stroke-width:1}
.cvline{fill:none;stroke:var(--accent);stroke-width:2.5;stroke-linejoin:round;stroke-linecap:round}
.cvdot{fill:var(--accent)}
.cvdot.best{fill:#fff;stroke:var(--accent);stroke-width:2}
.cvval{fill:#cdd9e8;font-size:10px;text-anchor:middle}
.cvval.best{fill:var(--accent);font-weight:700}
.cvx{fill:var(--muted);font-size:10px;text-anchor:middle}
.cvmeas{fill:none;stroke:var(--accent);stroke-width:2;animation:cvpulse 1s ease-in-out infinite}
@keyframes cvpulse{0%,100%{opacity:.25}50%{opacity:1}}
#curvepanel .cvhead{display:flex;align-items:baseline;gap:8px;justify-content:center;margin:6px 0 2px}
#curvepanel .cvbig{font-size:40px;font-weight:800;color:var(--accent);line-height:1}
#curvepanel .cvunit{font-size:15px;color:var(--muted)}
#curvepanel .cvsub{text-align:center;color:var(--muted);font-size:13px;min-height:18px;margin-bottom:6px}
#curvepanel .cvchart{margin-top:6px}
/* busy-GPU warning overlay */
#warn{position:fixed;inset:0;display:none;flex-direction:column;align-items:center;justify-content:center;justify-content:safe center;overflow-y:auto;
background:radial-gradient(900px 600px at 50% 40%,#2a2410 0%,#0f0c05 70%);z-index:70;text-align:center;padding:40px}
#warn.show{display:flex}
#warn .accentbar{background:var(--amber)}
#warn .cap{font-size:26px;letter-spacing:3px;text-transform:uppercase;color:var(--amber)}
/* mid-run cancel: a floating button while a run is in progress + a confirm overlay */
#streamspanel{display:flex;flex-direction:column}
#cancelrun{display:none;align-self:flex-start;margin-top:auto;
font-size:15px;font-weight:700;padding:11px 20px;border-radius:11px;cursor:pointer;
color:var(--ink);background:#1a2330;border:1px solid #34465c}
#cancelrun:hover{border-color:var(--red);color:var(--red)}
#cancelrun.show{display:block}
#confirm{position:fixed;inset:0;display:none;flex-direction:column;align-items:center;justify-content:center;
background:radial-gradient(900px 600px at 50% 40%,#2a1410 0%,#0f0605 70%);z-index:80;text-align:center;padding:40px}
#confirm.show{display:flex}
#confirm .cap{font-size:26px;letter-spacing:3px;text-transform:uppercase;color:var(--red)}
#confirm .desc{font-size:19px;color:var(--ink);max-width:560px;margin-top:14px}
.btnrow{display:flex;gap:14px;flex-wrap:wrap;justify-content:center;margin-top:30px}
.bigbtn{font-size:30px;font-weight:800;letter-spacing:1px;padding:20px 56px;
border:none;border-radius:14px;cursor:pointer;color:#06140c;background:var(--green);
box-shadow:0 8px 30px rgba(46,204,113,.35);transition:transform .1s,box-shadow .2s}
.bigbtn:hover{transform:translateY(-2px)} .bigbtn:active{transform:translateY(0)}
.bigbtn:disabled{opacity:.45;cursor:default;transform:none;box-shadow:none}
.btn2{font-size:17px;font-weight:700;padding:14px 26px;border-radius:11px;cursor:pointer;
border:1px solid #2c3e55;background:#16202e;color:var(--ink);transition:border-color .2s,background .2s}
.btn2:hover{border-color:var(--accent)}
.btn2.primary{background:var(--accent);color:#06140c;border-color:var(--accent)}
/* ready screen */
/* overlays scroll when content is taller than the window ("safe center" starts at the top
instead of clipping it; browsers without `safe` keep plain center as before) */
#ready{position:fixed;inset:0;display:none;flex-direction:column;align-items:center;justify-content:center;justify-content:safe center;overflow-y:auto;
background:radial-gradient(1000px 700px at 50% 35%,#10243b 0%,#06101c 70%);z-index:60;text-align:center;padding:40px}
#ready.show{display:flex}
#ready .cap{color:var(--muted);font-size:22px;letter-spacing:4px;text-transform:uppercase}
#ready .rtitle{font-size:60px;line-height:1;font-weight:900;letter-spacing:-2px;margin:8px 0 6px}
#ready .rdesc{font-size:21px;color:var(--ink)}
#ready .rsrc{margin-top:18px;font-size:16px;color:var(--muted)}
#ready .rsrc b{color:var(--green)}
.picker{display:flex;gap:16px;flex-wrap:wrap;justify-content:center;margin:26px 0 4px;max-width:1000px}
.gcard{background:#0e1928;border:2px solid #21405f;border-radius:14px;padding:18px 22px;min-width:210px;
cursor:pointer;text-align:center;transition:border-color .2s,background .2s,transform .1s}
.gcard:hover{transform:translateY(-2px)}
.gcard.sel{border-color:var(--accent);background:rgba(74,163,255,.12);box-shadow:0 0 0 1px var(--accent) inset}
.gcard.disabled{opacity:.55;cursor:not-allowed;border-style:dashed}
.gcard .gname{font-size:19px;font-weight:700}
.gcard .gvendor{font-size:12px;letter-spacing:2px;text-transform:uppercase;color:var(--accent);margin-top:4px}
.gcard .gnote{font-size:12px;color:var(--amber);margin-top:8px;max-width:230px}
.codecrow{margin:14px 0 4px;color:var(--muted);font-size:15px;display:none;align-items:center;gap:10px}
.codecrow select{background:#0e1928;color:var(--ink);border:1px solid #2c3e55;border-radius:9px;
padding:9px 14px;font-size:16px;font-weight:700;cursor:pointer}
#customrow{display:none;margin:18px auto 0;max-width:560px}
#customrow.show{display:block}
.customhead{color:var(--muted);font-size:13px;text-transform:uppercase;letter-spacing:1.5px;margin-bottom:8px}
.customhead .cmuted{text-transform:none;letter-spacing:0;color:#5d6b80}
#customlist{display:flex;flex-direction:column;gap:7px}
.cfile{display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;
background:#0e1928;border:1px solid #2c3e55;border-radius:9px;padding:9px 13px;font-size:14px}
.cempty{font-size:13px;color:var(--muted);padding:10px 4px;line-height:1.5}
.cempty b{color:#cdd9e8}
.cfile:hover{border-color:var(--accent)}
.cfile.sel{border-color:var(--accent);background:#13233a}
.cfile.disabled{opacity:.45;cursor:not-allowed}
.cfile .cname{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cfile .cmeta{color:var(--muted);font-size:12px;white-space:nowrap}
.clib{color:var(--amber);font-size:13px;background:#23200d;border:1px solid #4a3f10;
border-radius:9px;padding:10px 13px}
.codecrow .crlabel{min-width:74px;text-align:right}
#clipsrow{margin:10px 0 0;width:min(560px,92%)}
.clipsbar{display:flex;align-items:center;gap:12px;color:var(--muted);font-size:14px;margin-top:6px}
.clipsbar button{background:#14324e;color:#bfe0ff;border:1px solid #2c5c8a;border-radius:9px;
padding:6px 14px;font-size:14px;cursor:pointer}
.clipsbar button:disabled{opacity:.45;cursor:default}
.dlwrap{display:none;position:relative;height:16px;background:#0e1928;border:1px solid #2c3e55;
border-radius:8px;margin-top:8px;overflow:hidden}
.dlwrap.show{display:block}
.dlbar{height:100%;width:0;background:#2f81d6;transition:width .4s}
.dltext{position:absolute;inset:0;text-align:center;font-size:11px;line-height:16px;color:#dce8f5}
.subslbl{display:inline-flex;align-items:center;gap:8px;cursor:pointer;color:var(--ink);font-size:15px}
.subslbl input{accent-color:#4da3ff;width:16px;height:16px;cursor:pointer}
.subslbl .cmuted{color:#5d6b80;font-size:13px}
#readyboard{margin-top:14px;font-size:13.5px;color:var(--muted);text-decoration:none;border:1px solid #2c3e55;border-radius:999px;padding:7px 16px}
#readyboard:hover{color:var(--ink);border-color:var(--accent)}
.codecrow .crlabel2{margin-left:6px}
.codecrow #sres,.codecrow #tres{min-width:88px}
.respart{display:inline-flex;align-items:center;gap:10px}
/* streaming mode shows the LOCKED 4K/1080p as static text (no control chrome) for row parity */
.resfixed{color:var(--ink);font-weight:700;min-width:88px}
/* capability badges on picker cards: per-codec decode/encode marks */
.gcaps{display:flex;gap:6px;justify-content:center;margin-top:9px;flex-wrap:wrap}
.gcap{font-size:10.5px;letter-spacing:.4px;color:var(--muted);border:1px solid #24364d;border-radius:6px;padding:2px 7px;white-space:nowrap}
.gcap .y{color:var(--green)} .gcap .n{color:#5a6a80}
/* run history strip on the verdict */
#vhistory{display:none;margin:14px auto 0;max-width:640px}
#vhistory.show{display:block}
#vhistory .hdelta{font-size:17px;font-weight:700;margin-bottom:6px}
#vhistory .hdelta.up{color:var(--green)} #vhistory .hdelta.down{color:var(--red)}
#vhistory .hdelta .hnote{font-weight:600;font-size:13.5px;color:var(--amber)}
#vhistory .hrow{font-size:13px;color:var(--muted);padding:2px 0}
#vhistory .hrow b{color:#cdd9e8}
#vhistory .hhead{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-bottom:4px}
/* live worst-stream stability sparkline (streaming holds) */
.sparkwrap{margin-top:10px;display:none}
.sparkwrap.show{display:block}
.sparkwrap .sklbl{font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-bottom:3px}
.sparksvg{width:100%;height:84px;display:block}
/* non-scaling-stroke keeps the line crisp despite the horizontal stretch (aspect="none") */
.sparksvg .skline{fill:none;stroke:var(--accent);stroke-width:1.8;vector-effect:non-scaling-stroke}
.sparksvg .skmark{stroke:var(--amber);stroke-width:1;stroke-dasharray:4 3;vector-effect:non-scaling-stroke}
.sparksvg .skfill{fill:var(--accent);opacity:.10}
/* tap/click tooltip popover (title= is invisible on touch) */
#tipbox{position:absolute;display:none;max-width:320px;background:#141f33;border:1px solid #2c4562;border-radius:10px;padding:10px 14px;font-size:13px;line-height:1.45;color:#cdd9e8;z-index:99;box-shadow:0 8px 24px rgba(0,0,0,.5)}
[title]{cursor:help}
/* test-all batch: button + comparison table */
#allbtn{display:block;margin:10px auto 0;background:none;border:1px solid #2c3e55;color:var(--muted);border-radius:10px;padding:9px 18px;font-size:14.5px;cursor:pointer}
#allbtn:hover{border-color:var(--accent);color:var(--ink)}
#batchprog{font-size:13px;color:var(--amber);margin-top:6px}
#batchpanel{display:none;margin:10px auto 0;width:min(560px,92%);background:#0e1521;border:1px solid #25405d;border-radius:12px;padding:14px 18px;text-align:left}
#batchpanel.show{display:block}
#batchpanel .bpk label{display:block;font-size:14px;color:var(--ink);margin:4px 0;cursor:pointer}
#batchpanel .bpk input{accent-color:#4da3ff;margin-right:6px}
#batchpanel .bpd{margin:10px 0 4px;display:flex;flex-wrap:wrap;gap:10px}
#batchpanel .bpd label{font-size:13.5px;color:#cdd9e8;background:#12233a;border:1px solid #2c3e55;border-radius:9px;padding:5px 10px;cursor:pointer}
#batchpanel .bpd input{accent-color:#4da3ff;margin-right:5px}
#batchpanel .bpn{font-size:12.5px;color:var(--muted);margin:8px 0}
#batchpanel .bprow{display:flex;align-items:center;gap:10px;font-size:13px;color:var(--muted);margin:5px 0}
#batchpanel .bplab{min-width:60px}
#batchpanel .bphint{font-size:12px;color:var(--muted);margin:2px 0 4px}
#batchpanel .bpouts{display:inline-flex;gap:6px;vertical-align:middle;flex-wrap:nowrap}
#batchpanel .bps:disabled{opacity:.35;cursor:default}
#batchpanel .bpo{background:#0e1928;border:1px solid #2c3e55;border-radius:999px;padding:3px 10px;font-size:12.5px;color:var(--muted);cursor:pointer}
#batchpanel .bpo.on{background:var(--accent);color:#04121f;font-weight:700;border-color:var(--accent)}
#batchpanel .bpo.dis{opacity:.35;cursor:default;pointer-events:none}
#batchpanel .bps{background:var(--accent);color:#04121f;font-weight:700;border:none;border-radius:9px;padding:8px 18px;font-size:14px;cursor:pointer}
#ddetail{display:none;margin-top:26px;border-top:1px solid #1a2738;padding-top:20px}
#ddetail.show{display:block}
#batchbody .btr.clickable{cursor:pointer}
#batchbody .btr.clickable:hover .bdev{color:var(--accent)}
#batchbody .btr.rowsel{background:#132a44;border-radius:8px;margin:0 -10px;padding-left:10px;padding-right:10px;border-top-color:transparent}
#batchbody .btr.rowsel + .btr{border-top-color:transparent}
#suballbtn{display:none;margin:14px auto 0;background:var(--accent);color:#04121f;font-weight:700;border:none;border-radius:10px;padding:10px 20px;font-size:14.5px;cursor:pointer}
#suballbtn.show{display:inline-block}
.bsub{font-size:12px;margin-left:8px}.bsub.ok{color:var(--green)}.bsub.err{color:var(--red)}.bsub.local{color:var(--muted)}
#batchbody{display:none;margin:14px auto 0;max-width:720px}
#batchbody.show{display:block}
#batchbody .btable{background:#0e1521;border:1px solid #25405d;border-radius:12px;padding:14px 20px;text-align:left}
#batchbody .btr{display:flex;justify-content:space-between;gap:14px;font-size:15px;padding:7px 0;border-top:1px solid #1a2738;align-items:baseline}
#batchbody .btr:first-of-type{border-top:none}
#batchbody .btr .bdev{flex:1;font-weight:700;color:#e8eef7}
#batchbody .btr.best .bdev{color:var(--accent)}
#batchbody .btr .bcell{color:#cdd9e8;white-space:nowrap}
#batchbody .btr .bcell small{color:var(--muted)}
#batchbody .btr.skip .bdev,#batchbody .btr.skip .bcell{color:var(--muted);font-weight:600}
#batchbody .bth{display:flex;justify-content:space-between;gap:14px;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);padding-bottom:6px}
#batchbody .bth span:first-child{flex:1}
/* flex:none is LOAD-BEARING: as a flex item of the #ready column, overflow:hidden removes
the min-content floor, so when the screen's content outgrows the viewport (e.g. the custom
file list appears) the toggle is the one element allowed to shrink — Safari collapses it
to a 2px line. Never let it shrink. */
.modetoggle{display:inline-flex;flex:none;margin:4px 0 10px;border:1px solid #2c3e55;border-radius:12px;overflow:hidden;background:#0e1928}
.modebtn{background:none;border:none;color:var(--muted);font-size:15px;font-weight:700;padding:10px 24px;cursor:pointer;transition:background .15s,color .15s}
.modebtn:hover{color:var(--ink)}
.modebtn.active{background:var(--accent);color:#06140c}
#advnote{font-size:13px;color:var(--muted);max-width:520px;text-align:center;margin:14px auto 18px}
#advnote .local{color:var(--amber)}
</style>
</head>
<body>
<header>
<div>
<h1>Transcoding GPU Benchmark</h1>
<div class="hwline" id="hwline"></div>
</div>
<div class="profile"><b id="sreslbl">4K</b> <b id="inlbl">HEVC</b> → <b id="treslbl">1080p</b> · <b id="codeclbl">H.264</b> · <b id="bitrate">8M</b> · <b id="encoder">—</b></div>
</header>
<div class="top">
<div class="panel" id="streamspanel">
<div class="label" id="streamslabel">Streams</div>
<div class="streams-num" id="streams">0</div>
<div class="sub" id="predict"></div>
<div id="batchprog"></div>
<button id="cancelrun" onclick="askCancel()">✕ Cancel run</button>
</div>
<div class="panel" id="streampanel">
<div class="label">Worst stream speed (× realtime)</div>
<div class="gauge" id="gauge"><div class="val" id="minspeed">—</div><div class="x">×</div></div>
<div class="meterwrap">
<div class="meter"><div class="line"></div><div class="fill" id="fill"></div></div>
<div class="meter-legend"><span>0×</span><span>1.0× realtime</span><span>2×+</span></div>
</div>
<div class="small-stats">
<div><span class="k">Average</span><span class="v" id="avgspeed">—</span></div>
<div><span class="k">Combined</span><span class="v" id="combined">—</span></div>
<div><span class="k">Pass mark</span><span class="v" id="thresh">—</span></div>
</div>
<div class="sparkwrap" id="sparkwrap"><div class="sklbl">Worst-stream stability</div>
<div id="sparkchart"></div></div>
</div>
<div class="panel" id="curvepanel" style="display:none">
<div class="label">Throughput vs workers</div>
<div class="cvhead"><span class="cvbig" id="cvcombined">—</span><span class="cvunit">× combined</span></div>
<div class="cvsub" id="cvsub"></div>
<div class="cvchart" id="cvchartlive"></div>
</div>
</div>
<div class="panel">
<div class="label">Per-stream</div>
<div class="cards" id="cards"></div>
<div class="label" style="margin-top:20px" id="telelabel">GPU telemetry</div>
<div class="tele" id="tele"></div>
<div class="status" id="status"></div>
</div>
<div id="ready">
<div class="cap">Transcoding GPU Benchmark</div>
<div class="rtitle" id="rtitle">Choose a GPU to test</div>
<div class="modetoggle">
<button class="modebtn" data-mode="streaming" onclick="selectMode('streaming')">How many streams</button>
<button class="modebtn" data-mode="convert" onclick="selectMode('convert')">How fast it converts</button>
</div>
<div class="rdesc" id="rdesc">4K → 1080p · <b id="rbitrate">8M</b> · strict ≥ 1.0× realtime</div>
<div class="picker" id="picker"></div>
<div class="codecrow" id="inputrow"><span class="crlabel">Source</span>
<select id="inputc" onchange="selectInput(this.value)"></select>
<b class="resfixed" id="inputfixed" style="display:none"></b>
<span class="respart" id="srespart"><span class="crlabel2">Resolution</span>
<select id="sres" onchange="selectSourceRes(this.value)"></select>
<b class="resfixed" id="sresfixed">4K</b></span>
</div>
<div class="codecrow" id="codecrow"><span class="crlabel">Output</span>
<select id="codec" onchange="selectCodec(this.value)"></select>
<span class="respart" id="trespart"><span class="crlabel2">Resolution</span>
<select id="tres" onchange="selectTargetRes(this.value)"></select>
<b class="resfixed" id="tresfixed">1080p</b></span>
</div>
<div class="codecrow" id="subsrow" style="display:none"><span class="crlabel">Subtitles</span>
<label class="subslbl" title="Burns a shipped subtitle track into every stream (libass render, like PGS/ASS burn-in on Plex or Jellyfin) — the frames must leave the GPU, get composited on the CPU and come back, which is exactly what makes burn-in expensive on a real server. Same subtitles for everyone, so the result stays comparable as its own leaderboard profile.">
<input type="checkbox" id="subschk" onchange="selectSubs(this.checked)"> burn in subtitles
<span class="cmuted" id="subsnote"></span>
</label>
</div>
<div class="codecrow" id="hdrrow" style="display:none"><span class="crlabel" title="The HDR source can be tone-mapped down to SDR (the heaviest job a media server does) or kept as HDR10 - just downscaled, 10-bit end to end. Keeping HDR needs an HEVC or AV1 output; H.264 can't carry HDR10. Each choice is its own leaderboard profile.">HDR handling</span>
<select id="hdrsel" onchange="selectHdrOut(this.value)"></select>
</div>
<div id="advnote"></div>
<div id="clipsrow" style="display:none">
<div class="customhead">Test clips <span class="cmuted" id="clipsnote"></span></div>
<div class="clipsbar"><span id="clipstext"></span>
<button id="fetchbtn" onclick="fetchClips()" title="The benchmark decodes pinned, checksummed source clips so every result is comparable. They download once into this container's appdata and are kept forever — container updates never re-download them.">⬇ Download all</button>
</div>
<div class="dlwrap" id="dlwrap"><div class="dlbar" id="dlbar"></div><span class="dltext" id="dltext"></span></div>
</div>
<div id="customrow">
<div class="customhead">Or test your own file <span class="cmuted">— local only, not comparable</span></div>
<div id="customlist"></div>
</div>
<button class="bigbtn" id="startbtn" onclick="start()">▶ START</button>
<button id="allbtn" onclick="toggleBatchPanel()" title="Run several tests one after another (strictly sequential — parallel GPUs would skew each other). Pick the devices and whether to sweep every source codec or repeat the current test.">⚡ Batch tests</button>
<div id="batchpanel">
<div class="bpk" id="bpsweepui">
<div class="bprow"><span class="bplab">Sources</span><span class="bpouts" id="bpsrcs"></span></div>
<div class="bprow"><span class="bplab">Output</span><span class="bpouts" id="bpouts"></span></div>
<div class="bphint">One run per selected source each device supports.</div>
</div>
<div class="bpk" id="bpconvlbl" style="display:none">Current test on the selected devices</div>
<div class="bpd" id="bpdevs"></div>
<div class="bpn" id="bpnote"></div>
<button class="bps" onclick="startBatch()">▶ Start batch</button>
</div>
<div class="rsrc" id="rsrc"></div>
<a id="readyboard" target="_blank" rel="noopener" style="display:none">🏆 View the community leaderboard</a>
</div>
<div id="warn">
<div class="accentbar"></div>
<div class="cap" id="warncap">⚠ GPU in use</div>
<div class="desc" id="warndesc"></div>
<div class="specs" id="warnapps"></div>
<div class="foot">For an accurate result, stop the other GPU apps first — then continue.</div>
<div class="btnrow">
<button class="btn2" onclick="cancelRun()">Cancel</button>
<button class="bigbtn" style="font-size:20px;padding:14px 30px" onclick="continueRun()">Continue anyway</button>
</div>
</div>
<div id="confirm">
<div class="cap">Cancel this run?</div>
<div class="desc">This stops the test and returns to the GPU picker. No result is saved.</div>
<div class="btnrow">
<button class="btn2" onclick="dismissCancel()">Keep running</button>
<button class="bigbtn" style="font-size:20px;padding:14px 30px;background:var(--red);color:#fff" onclick="abortRun()">Yes, cancel</button>
</div>
</div>
<div id="verdict">
<div class="accentbar"></div>
<div class="cap" id="vcap">Max sustained</div>
<div class="n" id="vnum">—</div>
<div class="desc" id="vdesc"></div>
<div class="foot" id="vfoot"></div>
<div id="batchbody"></div>
<button id="suballbtn" onclick="submitBatch()"></button>
<div id="ddetail"><div class="cap" id="dcap"></div><div class="n" id="dnum"></div><div class="desc" id="ddesc"></div><div class="foot" id="dfoot"></div></div>
<div id="convbody"></div>
<div id="vscpu"></div>
<div id="vhistory"></div>
<div class="eff" id="veff"></div>
<div class="insight" id="vinsight"></div>
<div id="reconv">Re-encoding a library instead? <a onclick="goConvert()">How fast it converts</a> gives per-file times for any codec.</div>
<div class="specs" id="vspecs"></div>
<div class="btnrow">
<button class="btn2" id="copybtn" onclick="copyResult()">⧉ Copy result</button>
<button class="btn2" id="pngbtn" onclick="downloadCard()">⭳ Save card (PNG)</button>
<button class="btn2 primary" id="submitbtn" onclick="submitResult()" style="display:none">⇪ Submit to database</button>
<a class="btn2" id="boardbtn" target="_blank" rel="noopener" style="display:none;text-decoration:none">🏆 View leaderboard</a>
<button class="bigbtn" id="againbtn" onclick="reset()" style="font-size:20px;padding:14px 30px">↻ Run Again</button>
</div>
<div id="suberr"></div>
</div>
<script>
const VENDOR_COLORS = {intel:"#2aa3ff", nvidia:"#76b900", amd:"#ed1c24", cpu:"#9aa7bd"};
const CODEC_LABEL = {h264:"H.264", hevc:"HEVC (H.265)", av1:"AV1", hdr:"HDR10 (HEVC)"};
let LAST = {};
function fmt(x){ return (x==null||isNaN(x)) ? "—" : Number(x).toFixed(2); }
function drvStr(o){ return [...new Set([o.driver, o.kernel_driver].filter(Boolean))].join(" · "); }
function applyAccent(vendor){
const c = VENDOR_COLORS[vendor] || "#4aa3ff";
document.documentElement.style.setProperty("--accent", c);
}
async function tick(){
let s;
try{ s = await (await fetch("/state.json",{cache:"no-store"})).json(); }
catch(e){ return; }
LAST = s;
// theme accent: running/done use s.vendor; idle uses the selected GPU's vendor
let vendor = s.vendor;
if(!vendor && s.selected_idx!=null){
const g = (s.gpus||[]).find(x=>x.idx===s.selected_idx); if(g) vendor = g.vendor;
}
applyAccent(vendor);
document.getElementById("bitrate").textContent = s.bitrate || "—";
document.getElementById("encoder").textContent = s.encoder || "—";
document.getElementById("codeclbl").textContent = (CODEC_LABEL[s.selected_codec] || "H.264")
+ ((["hevc","av1"].indexOf(s.selected_input)>=0 && s.selected_target_res===s.selected_source_res
&& ["hevc","av1"].indexOf(s.selected_codec)>=0) ? " 10-bit" : "");
document.getElementById("inlbl").textContent = (s.selected_input || "hevc").toUpperCase();
document.getElementById("sreslbl").textContent = (RES_LABEL[s.selected_source_res]||"4K");
document.getElementById("treslbl").textContent = (RES_LABEL[s.selected_target_res]||"1080p");
document.getElementById("streams").textContent = s.stream_count ?? 0;
document.getElementById("thresh").textContent = fmt(s.threshold)+"×";
document.getElementById("avgspeed").textContent = fmt(s.avg_speed)+"×";
document.getElementById("combined").textContent = fmt(s.combined_speed)+"×";
document.getElementById("status").textContent = s.message || "";
// hardware line: vendor chip + GPU name; CPU & RAM for the Intel iGPU; driver
const hw = document.getElementById("hwline");
let h = "";
if(vendor) h += '<span class="vchip"><span class="dot"></span>'+escHtml(vendor)+'</span>';
if(s.selected_name) h += '<b>'+escHtml(s.selected_name)+'</b>';
const drvh = drvStr(s); if(drvh) h += ' · drv '+escHtml(drvh);
if(s.is_igpu && s.cpu) h += ' · '+escHtml(s.cpu);
if((s.is_igpu || s.vendor==="cpu") && s.ram_speed) h += ' · RAM '+escHtml(s.ram_speed)+(s.ram_hint?' <span class="warn">('+escHtml(s.ram_hint)+')</span>':'');
hw.innerHTML = h;
// live estimate tracks measured aggregate throughput
const predict = document.getElementById("predict");
if(s.projected) predict.textContent = "measured throughput ≈ "+s.projected+" streams' worth of real-time";
else if(s.single_stream_speed) predict.textContent = "1 stream at "+fmt(s.single_stream_speed)+"× — measuring throughput…";
else predict.textContent = "";
if(s.ui==="running" && s.hold_seconds) // per-level ETA so the run length isn't a mystery
predict.textContent += (predict.textContent?" · ":"")
+"≈"+Math.round((s.settle_seconds||0)+(s.hold_seconds||0)+4)+"s per level";
if(s.ui==="running" && s.vram_note) // dGPU: live per-stream VRAM cost + predicted wall
predict.textContent += (predict.textContent?" · ":"")+s.vram_note;
document.getElementById("batchprog").textContent =
(s.batch && (s.ui==="running"||s.ui==="preparing") && (s.batch_queue||[]).length)
? ("Run "+Math.min((s.batch_done||0)+1,(s.batch_queue||[]).length)+" of "+s.batch_queue.length+" — "+(s.batch_queue[Math.min(s.batch_done||0, s.batch_queue.length-1)]||""))
: "";
// stability sparkline: worst-stream speed across the current level (streaming runs only)
const sparkOn = (s.ui==="running") && (s.selected_mode||"streaming")==="streaming";
if(sparkOn){
if(SPARK.n !== s.stream_count){ SPARK.n = s.stream_count; SPARK.pts = []; }
if(s.min_speed!=null) SPARK.pts.push(s.min_speed);
if(SPARK.pts.length>150) SPARK.pts.shift();
document.getElementById("sparkchart").innerHTML = sparkSvg(SPARK.pts, s.threshold||1);
} else { SPARK.pts = []; SPARK.n = -1; }
document.getElementById("sparkwrap").classList.toggle("show", sparkOn && SPARK.pts.length>1);
// headline gauge = worst (min) stream speed
const mn = s.min_speed;
const gauge = document.getElementById("gauge");
document.getElementById("minspeed").textContent = fmt(mn);
const fill = document.getElementById("fill");
fill.style.width = Math.max(0, Math.min(100, (mn||0)/2*100))+"%";
const ok = (mn!=null) && (mn >= (s.threshold||1.0));
gauge.className = "gauge " + (mn==null ? "" : ok ? "ok":"bad");
fill.style.background = ok ? "var(--green)" : "var(--red)";
// convert mode uses a throughput-vs-workers curve instead of the 1.0×-realtime gauge
const convLive = (s.selected_mode === "convert");
document.getElementById("streampanel").style.display = convLive ? "none" : "";
document.getElementById("curvepanel").style.display = convLive ? "" : "none";
document.getElementById("streamslabel").textContent = convLive ? "Workers" : "Streams";
if(convLive){
const cur = s.combined_speed;
document.getElementById("cvcombined").textContent = (cur!=null ? fmt(cur) : "—");
document.getElementById("cvsub").textContent = s.single_stream_speed
? "per file "+fmt(s.single_stream_speed)+"× realtime"
: (s.conv_testing_n ? "measuring worker 1…" : "");
document.getElementById("cvchartlive").innerHTML =
curveSvg(s.conv_levels||[], s.conv_testing_n, null);
}
// per-stream cards
const wrap = document.getElementById("cards");
const holding = s.phase === "holding";
wrap.innerHTML = "";
(s.streams||[]).forEach(st=>{
const c = document.createElement("div");
const good = (st.pass !== undefined) ? st.pass : (st.speed >= 1.0); // convert mode: moving = healthy
c.className = "card " + (good ? "ok" : "bad") + ((!good && holding) ? " flash":"");
c.innerHTML = '<div class="id">STREAM '+st.id+'</div><div class="spd">'+fmt(st.speed)+
'×</div><div class="fps">'+fmt(st.fps)+' fps</div>';
wrap.appendChild(c);
});
renderTelemetry(s);
renderScreens(s, vendor);
}
function teleChip(k,v,accent,title){
return '<div class="t'+(accent?' accent':'')+'"'+(title?' title="'+title+'"':'')+
'><div class="tk">'+k+'</div><div class="tv">'+v+'</div></div>';
}
// temperature display unit: browser override > server's Unraid dashboard setting > °C.
// Data is always °C internally — this is presentation only. localStorage access is wrapped:
// cookie-blocking browsers THROW on it, and an unguarded throw here killed every render tick.
function tempUnit(s){
let o = null; try{ o = localStorage.getItem("tempUnit"); }catch(e){}
return o || s.temp_unit || "C";
}
function tempDisplay(c, s){
return (tempUnit(s)==="F") ? Math.round(c*9/5+32)+"°F" : Math.round(c)+"°C";
}
function toggleTempUnit(){
try{ localStorage.setItem("tempUnit", tempUnit(LAST)==="F" ? "C" : "F"); }catch(e){}
if(LAST) renderTelemetry(LAST);
}
function renderTelemetry(s){
const t = s.telemetry || {}; const out = [];
document.getElementById("telelabel").textContent =
(s.vendor==="cpu") ? "CPU telemetry" : "GPU telemetry";
// engine load (the star metric) — for the CPU device that's the CPU itself
if(t.cpu_load!=null) out.push(teleChip("CPU load", Math.round(t.cpu_load)+"%", true,
"Whole-box CPU utilisation (all cores) — the same figure as the Unraid dashboard, "+
"so other apps' load is included."));
if(t.enc!=null) out.push(teleChip("Encoder", Math.round(t.enc)+"%", true));
if(t.dec!=null) out.push(teleChip("Decoder", Math.round(t.dec)+"%"));
if(t.engines){ Object.entries(t.engines).forEach(([n,b])=>{
if(/Video/.test(n)) out.push(teleChip(n, fmt(b)+"%", /Video$/.test(n))); }); }
if(t.enc==null && !t.engines && t.util!=null) out.push(teleChip("Util", Math.round(t.util)+"%", true));
if(t.clock!=null) out.push(teleChip("Clock", Math.round(t.clock)+" MHz"));
// power: real (dGPU) or estimated (iGPU package-delta)
if(s.power_estimated && t.power_pkg!=null)
out.push(teleChip("Power (est.)", Math.round(t.power_pkg)+" W", true,
"iGPU has no power sensor. Estimated from CPU-package power under load vs idle; "+
"includes some CPU overhead and assumes an otherwise-idle box. Rough figure."));
else if(t.power!=null) out.push(teleChip("Power", Math.round(t.power)+" W", true));
else if(t.power_pkg!=null) out.push(teleChip("Pkg power", Math.round(t.power_pkg)+" W"));
if(t.temp!=null) out.push('<div class="t" style="cursor:pointer" onclick="toggleTempUnit()" '+
'title="Click to switch °C/°F. The default follows your Unraid display setting.">'+
'<div class="tk">Temp</div><div class="tv">'+tempDisplay(t.temp, s)+'</div></div>');
if(t.throttle) out.push(teleChip("Throttle", "YES"));
if(s.streams_per_watt!=null)
out.push(teleChip("Streams/W"+(s.power_estimated?" (est.)":""), fmt(s.streams_per_watt), true,
s.power_estimated ? "Based on the estimated iGPU power — rough." : ""));
document.getElementById("tele").innerHTML = out.join("") ||
'<div class="t"><div class="tk">telemetry</div><div class="tv">—</div></div>';
}
function renderScreens(s, vendor){
const ui = s.ui || "idle";
const ready = document.getElementById("ready");
const v = document.getElementById("verdict");
if(ui === "idle"){
ready.classList.add("show");
renderMode(s);
renderPicker(s);
renderInput(s);
renderCodec(s);
renderSubs(s);
renderHdr(s);
renderClips(s);
renderCustom(s);
renderNote(s);
const gpus = s.gpus || [];
const hasAvail = gpus.some(g => g.available);
document.getElementById("rtitle").textContent = hasAvail ? "Choose a GPU to test" : "No testable GPU found";
document.getElementById("startbtn").style.display = hasAvail ? "" : "none";
document.getElementById("startbtn").disabled = (s.selected_idx == null);
// batches need shipped clips (a custom file can't be decoded everywhere); a source
// sweep is useful even with a single device, so no 2+ device requirement any more
document.getElementById("allbtn").style.display =
(hasAvail && !s.selected_custom) ? "" : "none";
renderBatchPanel(s);
const rb = document.getElementById("readyboard");
rb.style.display = s.board_url ? "" : "none";
if(s.board_url) rb.href = s.board_url;
document.getElementById("rsrc").innerHTML = !hasAvail
? "Pass <b>/dev/dri</b> (Intel/AMD) and/or add <b>--runtime=nvidia</b> (NVIDIA)."
: (s.selected_custom
? "A 60-second sample from your file is loaded into RAM."
: "A sample clip is loaded into RAM — so it measures the GPU, not your disk.");
} else ready.classList.remove("show");
const warn = document.getElementById("warn");
if(ui === "warn"){
warn.classList.add("show");
document.getElementById("warncap").textContent = (s.vendor==="cpu") ? "⚠ CPU in use" : "⚠ GPU in use";
document.getElementById("warndesc").textContent =
"This "+(s.vendor==="cpu"?"CPU":"GPU")+" looks busy (~"+Math.round(s.busy_load||0)+"% load) before the test.";
document.getElementById("warnapps").textContent =
(s.busy_apps && s.busy_apps.length) ? ("Active: "+s.busy_apps.join(", "))
: (s.busy_named ? "" : "Add --pid=host to name the apps using this GPU.");
} else warn.classList.remove("show");
if(ui === "done"){
const r = s.result || {};
v.classList.add("show");
const batch = !!(s.batch && (s.batch_results||[]).length);
document.getElementById("batchbody").classList.toggle("show", batch);
if(!batch){
document.getElementById("ddetail").classList.remove("show");
document.getElementById("suballbtn").classList.remove("show");
}
document.getElementById("copybtn").style.display = batch ? "none" : "";
document.getElementById("pngbtn").style.display = batch ? "none" : "";
if(batch){
// BATCH verdict: summary table first; clicking a row shows the FULL standard verdict
// for that run beneath it — the SAME rendering as a single run, for consistency
v.classList.remove("fail");
document.getElementById("vcap").style.display = "";
document.getElementById("vcap").textContent = "Batch results";
document.getElementById("vnum").style.display = "none";
const nOK = s.batch_results.filter(b=>!b.error).length;
document.getElementById("vdesc").innerHTML = nOK+" run"+(nOK!==1?"s":"")+" — summary below, click a run for its full result";
document.getElementById("vfoot").textContent = "Runs are strictly sequential with a cool-down between — parallel GPUs would skew each other.";
const comps = s.batch_results.filter(b=>b.full && b.comparable && !b.submitted).length;
const sab = document.getElementById("suballbtn");
sab.classList.toggle("show", !!(s.submit_url_set && comps));
sab.textContent = "⇪ Submit "+comps+" result"+(comps!==1?"s":"")+" to the leaderboard";
// once anything from this batch is on the board, offer the trip there
const bbb = document.getElementById("boardbtn");
bbb.style.display = (s.board_url && s.batch_results.some(b=>b.submitted)) ? "" : "none";
if(s.board_url) bbb.href = s.board_url;
document.getElementById("submitbtn").style.display = "none";
document.getElementById("vhistory").className = "";
document.getElementById("reconv").classList.remove("show");
document.getElementById("suberr").className = "";
renderBatch(s);
// selected-row detail (default: first successful run)
const ok = s.batch_results;
if(BSEL >= ok.length || !ok[BSEL] || ok[BSEL].error || !ok[BSEL].full)
BSEL = ok.findIndex(b=>!b.error && b.full);
const sel = BSEL >= 0 ? ok[BSEL] : null;
document.getElementById("ddetail").classList.toggle("show", !!sel);
if(sel) renderRunDetail(s, sel.full, true);
else { document.getElementById("veff").innerHTML=""; document.getElementById("vinsight").style.display="none";
document.getElementById("convbody").classList.remove("show"); document.getElementById("vscpu").className="";
document.getElementById("vspecs").innerHTML=""; }
return _doneTail(ui);
}
const sb = document.getElementById("submitbtn");
sb.style.display = (s.submit_url_set && r.comparable) ? "" : "none";
sb.disabled = !!s.submitted;
sb.textContent = s.submitted ? "✓ Submitted" : "⇪ Submit to database";
const bb = document.getElementById("boardbtn"); // appears once THIS result is on the board
bb.style.display = (s.submitted && s.board_url) ? "" : "none";
if(s.board_url) bb.href = s.board_url;
renderRunDetail(s, r, false);
// submit status line under the buttons: the "goes live in ~1 h" note on success (this used
// to only land in the hidden live status line), or the rejection reason on failure
const se = document.getElementById("suberr");
if(s.submitted){
se.textContent = "✓ Submitted — new results appear on the leaderboard within about an hour.";
se.className = "show ok";
} else if(/^Submit (failed|rejected)/.test(s.message||"")){
se.textContent = s.message; se.className = "show";
} else { se.textContent = ""; se.className = ""; }
} else if(ui === "error"){
v.classList.add("show","fail");
// clear ALL verdict furniture from any previous run — a stage failure after a finished
// convert run used to show the ✕ on top of the old two-panel verdict + efficiency lines
document.getElementById("vcap").textContent = "";
document.getElementById("vcap").style.display = "";
document.getElementById("vnum").style.display = "";
document.getElementById("vnum").textContent = "✕";
document.getElementById("vdesc").textContent = s.message || "error";
document.getElementById("vfoot").textContent = "";
document.getElementById("vspecs").textContent = "";
document.getElementById("veff").innerHTML = "";
document.getElementById("vinsight").style.display = "none";
document.getElementById("convbody").classList.remove("show");
document.getElementById("submitbtn").style.display = "none";
document.getElementById("copybtn").style.display = "none";
document.getElementById("pngbtn").style.display = "none";
document.getElementById("boardbtn").style.display = "none";
} else v.classList.remove("show");
_doneTail(ui);
}
function _doneTail(ui){
if(ui !== "done"){ // collapse + hide the verdict-only panels off the verdict screen
document.getElementById("vscpu").className = "";
document.getElementById("vhistory").className = "";
document.getElementById("batchbody").classList.remove("show");
document.getElementById("ddetail").classList.remove("show");
document.getElementById("suballbtn").classList.remove("show");
document.getElementById("reconv").classList.remove("show");
document.getElementById("suberr").className = "";
}
// mid-run cancel button: visible only while a run is actually in progress
const inRun = (ui === "preparing" || ui === "running");
if(inRun) BSEL = 0; // a new run/batch is underway — don't carry the previous batch's
// row selection into the next summary ("first successful" default)
document.getElementById("cancelrun").classList.toggle("show", inRun);
if(!inRun) dismissCancel(); // run ended/cancelled — drop any open confirm dialog
}
const TIP_EFF_DGPU = "Watts per stream at full load (total board power divided by throughput). Lower is better. A discrete GPU only reaches good efficiency under heavy load.";
const TIP_EFF_IGPU = "Estimated watts per stream — the iGPU has no power sensor, so this is the rise in CPU-package power under load divided by throughput. Rough figure.";
const TIP_EFF_CPU = "Watts per stream of throughput — the rise in CPU package power under load vs idle, divided by combined throughput. Lower is better.";
const TIP_EFF_CONV = "Energy per hour of converted video: full-load watts divided by combined throughput (e.g. 35× realtime = 35 hours of video per hour of wall time). Lower is better. This is the honest per-file energy cost — no realtime streams exist in a conversion run.";
const TIP_PWR_DGPU = "A discrete GPU jumps to a high power state to transcode anything, then each extra stream adds little. Most of the draw is fixed overhead, so it is only power-efficient running many streams — or when the card is already busy with other work.";
const TIP_PWR_IGPU = "The iGPU has no isolated power sensor. This is the rise in CPU-package power (CPU+GPU) under load vs idle. The iGPU's own draw is tiny — great for light or always-on transcoding.";
const TIP_PWR_CPU = "The rise in CPU package power while software-transcoding, vs idle. Software encoding keeps every core busy, so this is usually far more power than a GPU media engine doing the same job.";
function movieWh(wps){
// 1.5 hr movie energy: sub-10 keeps a decimal ("≈6.9 Wh"), bigger rounds whole
const v = wps * 1.5;
return v >= 10 ? Math.round(v) : Math.round(v*10)/10;
}
function effBlock(r){
if(!r) return "";
const est = r.power_estimated, cpu = r.is_cpu, conv = r.mode === "convert";
// RAPL package power is a real measurement — only hedge with "(est.)" when it isn't (iGPU
// keeps the hedge regardless: the package delta still blends in some CPU feeding-overhead)
const hedge = est && !(cpu && r.power_rapl);
let out = "";
if(r.watts_per_stream!=null){
// convert mode has NO streams — "W / stream" invites reading it as per-WORKER power (off by
// >10×). Same number, honest clothes: watts ÷ combined-×realtime IS Wh per hour of video.
out += conv
? '<span class="effmain" title="'+TIP_EFF_CONV+'">≈'+r.watts_per_stream+' Wh per hour of video converted'+(hedge?' (est.)':'')+'</span>'
+ ' · a 1.5 hr movie ≈ '+movieWh(r.watts_per_stream)+' Wh'
: '<span class="effmain" title="'+(cpu?TIP_EFF_CPU:est?TIP_EFF_IGPU:TIP_EFF_DGPU)+'">≈'+r.watts_per_stream+' W / stream'+(hedge?' (est.)':'')+'</span>';
}
if(!conv && r.streams_per_watt!=null) out += ' · '+r.streams_per_watt+' streams/W';
let pl = "";
if(est){
if(r.peak_power_w!=null)
pl = '<span title="'+(cpu?TIP_PWR_CPU:TIP_PWR_IGPU)+'">'+(cpu?'CPU transcoding adds':'iGPU adds')+' ~<b>'+Math.round(r.peak_power_w)+' W</b> under load'+(hedge?' (est.)':'')+'</span>';
} else {
const parts = [];
if(r.idle_power_w!=null) parts.push('idle <b>'+Math.round(r.idle_power_w)+' W</b>');
if(r.one_stream_power_w!=null) parts.push((conv?'1 worker':'1 stream')+' <b>'+Math.round(r.one_stream_power_w)+' W</b>');
if(r.load_power_w!=null) parts.push('full load <b>'+Math.round(r.load_power_w)+' W</b>');
if(parts.length) pl = '<span title="'+TIP_PWR_DGPU+'">Power: '+parts.join(' → ')+'</span>';
}
return '<div class="effrow">'+out+'</div>'+(pl?'<div class="pwrrow">'+pl+'</div>':'');
}
function specLine(s){
const r = s.result || {}; const bits = [];
if(r.is_cpu){
// CPU runs: the levers that actually explain the result — encoder+preset, threads, RAM+XMP
bits.push("encoder <b>"+escHtml(r.cpu_encoder||"software")+" · "+escHtml(r.cpu_preset||"")+"</b>");
if(r.cpu) bits.push(escHtml(r.cpu) + (r.cpu_threads?" (<b>"+escHtml(String(r.cpu_threads))+" threads</b>)":""));
if(s.ram_speed) bits.push("RAM <b>"+escHtml(s.ram_speed)+"</b>"+(s.ram_hint?' <span class="warn">('+escHtml(s.ram_hint)+')</span>':''));
} else {
const drv = drvStr(r); if(drv) bits.push("driver <b>"+escHtml(drv)+"</b>");
if(s.is_igpu && s.ram_speed) bits.push("RAM <b>"+escHtml(s.ram_speed)+"</b>"+(s.ram_hint?' <span class="warn">('+escHtml(s.ram_hint)+')</span>':''));
if(r.cpu) bits.push(escHtml(r.cpu));
}
if(r.os_version) bits.push("Unraid <b>"+escHtml(r.os_version)+"</b>");
if(r.kernel) bits.push("kernel "+escHtml(r.kernel));
return bits.join(" · ");
}
function renderPicker(s){
const p = document.getElementById("picker");
const gpus = s.gpus || [];
const sig = JSON.stringify(gpus.map(g=>[g.idx,g.available]))+"|"+s.selected_idx;
if(p.dataset.sig === sig) return;
p.dataset.sig = sig; p.innerHTML = "";
gpus.forEach(g => {
const c = document.createElement("div");
c.className = "gcard" + (g.idx===s.selected_idx ? " sel":"") + (g.available ? "" : " disabled");
if(g.idx===s.selected_idx){ const col=VENDOR_COLORS[g.vendor]||"#4aa3ff";
c.style.borderColor=col; c.style.boxShadow="0 0 0 1px "+col+" inset"; }
let html = '<div class="gname">'+escHtml(g.name)+'</div><div class="gvendor">'+escHtml(g.vendor)+' · '+escHtml(g.api)+'</div>';
if(g.note) html += '<div class="gnote">'+escHtml(g.note)+'</div>';
if(g.available) html += capBadges(g);
c.innerHTML = html;
if(g.available) c.onclick = () => select(g.idx);
p.appendChild(c);
});
}
const RES_LABEL = {"4k":"4K","1080p":"1080p","720p":"720p"};
function fillSel(id, opts, selected, labelFn){
// opts: strings, or {v, dis, why} — unsupported entries stay VISIBLE but greyed out, so the
// user learns "this GPU can't do it" rather than "the tool doesn't offer it"
const sel = document.getElementById(id);
const norm = opts.map(o => typeof o === "string" ? {v:o} : o);
const sig = norm.map(o=>o.v+(o.dis?"!":"")).join(",")+"|"+selected;
if(sel.dataset.sig !== sig){
sel.dataset.sig = sig;
sel.innerHTML = norm.map(o=>'<option value="'+o.v+'"'+(o.v===selected?' selected':'')
+(o.dis?' disabled':'')+'>'+labelFn(o.v)+(o.dis&&o.why?' — '+o.why:'')+'</option>').join("");
}
}
function srcCodecs(s, g){
// source codecs = what the GPU can hw-decode AND what we ship at the chosen source resolution
const sr = s.selected_source_res || "4k";
const shipped = (s.source_codecs_by_res||{})[sr] || ["h264"];
return (g && g.decodes ? g.decodes : []).filter(c => shipped.indexOf(c) >= 0);
}
function resFromWH(res){
// "3840x2160" → "4K" / "1080p" / "<h>p" — display label for a custom file's resolution
const h = parseInt((res||"").split("x")[1]||0, 10);
if(!h) return "";
return h >= 2000 ? "4K" : h >= 1000 ? "1080p" : h+"p";
}
function renderInput(s){
// Source row: [source codec] [source resolution]. Codecs are gated to what the GPU can
// hw-decode ∩ what ships at the chosen resolution. When a CUSTOM file is picked, the row
// shows the file's DETECTED codec + resolution as static text (the file dictates them).
const row = document.getElementById("inputrow");
const g = (s.gpus||[]).find(x=>x.idx===s.selected_idx);
if(!g){ row.style.display="none"; return; }
row.style.display="flex";
const f = s.selected_custom ? (s.custom_files||[]).find(x=>x.name===s.selected_custom) : null;
const sel = document.getElementById("inputc"), fx = document.getElementById("inputfixed");
const sresSel = document.getElementById("sres"), sresFx = document.getElementById("sresfixed");
if(f){
sel.style.display = "none"; fx.style.display = "";
fx.textContent = (CODEC_LABEL[f.codec] || (f.codec||"?").toUpperCase()) + " · your file";
sresSel.style.display = "none"; sresFx.style.display = "";
sresFx.textContent = resFromWH(f.res) || "—";
return;
}
sel.style.display = ""; fx.style.display = "none";
// restore the mode-driven resolution control (convert = dropdown, streaming = locked 4K)
const conv = (s.selected_mode||"streaming") === "convert";
sresSel.style.display = conv ? "" : "none";
sresFx.style.display = conv ? "none" : "";
sresFx.textContent = "4K";
const sr2 = s.selected_source_res || "4k";
const shipped = ((s.source_codecs_by_res||{})[sr2]) || ["hevc"];
const srcOpts = shipped.map(c => (g.decodes||[]).indexOf(c)>=0 ? {v:c}
: {v:c, dis:true, why:(c==="hdr"?"can't process HDR":"can't decode")});
fillSel("inputc", srcOpts, s.selected_input, c=>CODEC_LABEL[c]||c);
fillSel("sres", s.source_res_options||["4k"], s.selected_source_res||"4k", r=>RES_LABEL[r]||r);
}
function renderCodec(s){
// Output row: [output codec] [output resolution (<= source, no upscaling)].
const row = document.getElementById("codecrow");
const g = (s.gpus||[]).find(x=>x.idx===s.selected_idx);
if(!g){ row.style.display="none"; return; }
row.style.display="flex";
const keep = !!s.selected_hdr_out && s.selected_input === "hdr";
const outOpts = ["h264","hevc","av1"].map(c => {
if(keep){ // keep-HDR: 10-bit HEVC/AV1 only - H.264 can't carry HDR10
if(c === "h264") return {v:c, dis:true, why:"can't carry HDR10"};
return (g.hdr_pass||[]).indexOf(c)>=0 ? {v:c} : {v:c, dis:true, why:"can't 10-bit encode"};
}
return (g.codecs||["h264"]).indexOf(c)>=0 ? {v:c} : {v:c, dis:true, why:"can't encode"};
});
fillSel("codec", outOpts, s.selected_codec, c=>CODEC_LABEL[c]||c);
const sr = s.selected_source_res||"4k";
fillSel("tres", (s.target_res_by_source||{})[sr]||["1080p"], s.selected_target_res||"1080p", r=>RES_LABEL[r]||r);
}
function fetchClips(){ post("/fetchclips"); }
function renderClips(s){
// canonical-clip cache panel — moot (hidden) when the image ships clips baked in
const row = document.getElementById("clipsrow");
const clips = s.clips || [];
if(s.clips_shipped || !clips.length){ row.style.display="none"; return; }
row.style.display = "";
const ready = clips.filter(c=>c.status!=="missing");
const missing = clips.filter(c=>c.status==="missing");
const missMB = missing.reduce((a,c)=>a+(c.size_mb||0),0);
document.getElementById("clipstext").textContent = missing.length
? ready.length+" of "+clips.length+" clips ready · "+(missMB>=1000?(missMB/1000).toFixed(1)+" GB":missMB+" MB")+" to download"
: "all "+clips.length+" clips downloaded ✓";
document.getElementById("clipsnote").textContent = missing.length
? "— downloaded once, kept in appdata forever" : "";
const dl = s.clip_dl;
document.getElementById("fetchbtn").style.display = missing.length ? "" : "none";
document.getElementById("fetchbtn").disabled = !!dl;
const wrap = document.getElementById("dlwrap");
wrap.classList.toggle("show", !!dl);
if(dl){
document.getElementById("dlbar").style.width = dl.pct+"%";
document.getElementById("dltext").textContent = dl.name+" — "+dl.mb+" / "+dl.total_mb+" MB ("+dl.pct.toFixed(0)+"%)";
}
}
function selectSubs(on){ post("/subs?b="+(on?1:0)); }
function selectHdrOut(v){ post("/hdrout?b="+(v==="keep"?1:0)); }
function renderHdr(s){
// HDR handling: tone-map to SDR vs keep HDR10 (issue #4). Only for the HDR source; each
// option gated by its own probe - AMD/Mesa can't tone-map but CAN keep HDR, so it shows
// keep-only. The backend re-validates everything at /hdrout and /start.
const row = document.getElementById("hdrrow");
const g = (s.gpus||[]).find(x=>x.idx===s.selected_idx);
const hdr = s.selected_input === "hdr" && !s.selected_custom;
if(!g || !hdr){ row.style.display="none"; return; }
row.style.display = "flex";
const canKeep = (g.hdr_pass||[]).length > 0;
const opts = [
g.tonemap ? {v:"sdr"} : {v:"sdr", dis:true, why:"can't tone-map"},
canKeep ? {v:"keep"} : {v:"keep", dis:true, why:"can't 10-bit encode"}];
fillSel("hdrsel", opts, s.selected_hdr_out ? "keep" : "sdr",
v => v==="keep" ? "Keep HDR (HDR10)" : "Tone-map to SDR");
}
function renderSubs(s){
// burn-in toggle: streaming-mode realism modifier. Hidden in convert mode; disabled for the
// HDR source (combined tone-map + burn chain is unsupported in v1 — the backend enforces it).
const row = document.getElementById("subsrow");
const g = (s.gpus||[]).find(x=>x.idx===s.selected_idx);
const streaming = (s.selected_mode||"streaming") === "streaming";
if(!g || !streaming){ row.style.display="none"; return; }
row.style.display = "flex";
const hdr = s.selected_input === "hdr";
const chk = document.getElementById("subschk");
chk.checked = !!s.selected_subs && !hdr;