Commit dd0cd5f
committed
ui: harden score card against deploy lag, polish styling, expose physics problems
Bug fix (TypeError on Streamlit Cloud)
- The new pre_polish_loss kwarg added to render_score_card last release
raised TypeError on Cloud during the window between git push and
Cloud's bytecode-cache refresh (the deployed _common.py was on the
previous signature). To make the wire format resilient:
* pre_polish_loss is now carried inside the score dict (just like
every other field), so out-of-sync deployments never crash.
* render_score_card grew a **_extra catch-all so future kwargs
cannot break callers either.
* format strings are guarded by isinstance(..., int | float) so a
stray Tensor / None can no longer trip f"{x:.4g}".
UI polish
- Score card got softer radii, a radial-gradient highlight, a subtle
drop shadow, tabular numerals for the loss line, and a dedicated
green "polish improved by Δ" badge style (one rule for light, one
for dark theme).
- New helper render_config_chips() draws a chip-style row of
(problem, size, device, seed, plus optional hyper-params). The
Solve page uses one chip row at the top (problem identity) and a
second one right above the Run button (active hyper-params,
including polish/warm-start state) so the user can verify the
full configuration at a glance.
- Run button is now type=primary + width="stretch" so it stops
competing with the Apply-preset button for visual weight.
- Sidebar references row gained a "Cite (Zenodo DOI)" link.
Physics catalog (PSpinGlass + RandomFieldIsing)
- Both problems are reachable from the Home Physics/spin family
selector with appropriate auxiliary sliders (p-order for PSpin;
dim, J, σ_h for RFIM).
- _solution_viz reuses render_sk for PSpin (no useful lattice) and
render_ea for RFIM (same hyper-cubic geometry). Tests cover the
catalog visibility (AppTest sweeps the family selector) and an
end-to-end Solve flow on min_dominating_set / maxcut.
Made-with: Cursor1 parent 790df7c commit dd0cd5f
5 files changed
Lines changed: 198 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
453 | | - | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
454 | 456 | | |
455 | | - | |
456 | | - | |
457 | | - | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
458 | 460 | | |
| 461 | + | |
| 462 | + | |
459 | 463 | | |
460 | 464 | | |
461 | 465 | | |
| |||
465 | 469 | | |
466 | 470 | | |
467 | 471 | | |
468 | | - | |
| 472 | + | |
469 | 473 | | |
470 | 474 | | |
471 | 475 | | |
| 476 | + | |
472 | 477 | | |
473 | 478 | | |
474 | 479 | | |
| |||
481 | 486 | | |
482 | 487 | | |
483 | 488 | | |
| 489 | + | |
484 | 490 | | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
485 | 497 | | |
486 | 498 | | |
487 | 499 | | |
| |||
661 | 673 | | |
662 | 674 | | |
663 | 675 | | |
664 | | - | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
665 | 679 | | |
666 | | - | |
667 | | - | |
668 | | - | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
669 | 683 | | |
| 684 | + | |
| 685 | + | |
670 | 686 | | |
671 | 687 | | |
672 | 688 | | |
673 | 689 | | |
674 | 690 | | |
675 | 691 | | |
676 | 692 | | |
677 | | - | |
| 693 | + | |
| 694 | + | |
678 | 695 | | |
679 | 696 | | |
680 | 697 | | |
| |||
683 | 700 | | |
684 | 701 | | |
685 | 702 | | |
| 703 | + | |
686 | 704 | | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
687 | 711 | | |
688 | 712 | | |
689 | 713 | | |
| |||
705 | 729 | | |
706 | 730 | | |
707 | 731 | | |
| 732 | + | |
708 | 733 | | |
709 | 734 | | |
710 | 735 | | |
| |||
851 | 876 | | |
852 | 877 | | |
853 | 878 | | |
| 879 | + | |
| 880 | + | |
854 | 881 | | |
855 | 882 | | |
856 | 883 | | |
| |||
893 | 920 | | |
894 | 921 | | |
895 | 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 | + | |
896 | 978 | | |
897 | 979 | | |
898 | 980 | | |
899 | | - | |
900 | | - | |
| 981 | + | |
901 | 982 | | |
902 | 983 | | |
903 | 984 | | |
904 | 985 | | |
905 | 986 | | |
906 | 987 | | |
907 | | - | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
908 | 992 | | |
909 | 993 | | |
910 | 994 | | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | | - | |
915 | | - | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
916 | 999 | | |
917 | | - | |
| 1000 | + | |
918 | 1001 | | |
919 | | - | |
| 1002 | + | |
920 | 1003 | | |
921 | 1004 | | |
922 | 1005 | | |
923 | 1006 | | |
924 | 1007 | | |
925 | 1008 | | |
926 | | - | |
| 1009 | + | |
927 | 1010 | | |
928 | 1011 | | |
929 | | - | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
930 | 1015 | | |
| 1016 | + | |
931 | 1017 | | |
932 | | - | |
933 | | - | |
| 1018 | + | |
| 1019 | + | |
934 | 1020 | | |
935 | | - | |
| 1021 | + | |
936 | 1022 | | |
937 | | - | |
| 1023 | + | |
938 | 1024 | | |
939 | | - | |
940 | | - | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
941 | 1028 | | |
942 | 1029 | | |
943 | 1030 | | |
| |||
1006 | 1093 | | |
1007 | 1094 | | |
1008 | 1095 | | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
1009 | 1114 | | |
1010 | 1115 | | |
1011 | 1116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1422 | 1422 | | |
1423 | 1423 | | |
1424 | 1424 | | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
1425 | 1429 | | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
1426 | 1433 | | |
1427 | 1434 | | |
1428 | 1435 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 53 | + | |
56 | 54 | | |
57 | 55 | | |
58 | 56 | | |
| |||
447 | 445 | | |
448 | 446 | | |
449 | 447 | | |
450 | | - | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
451 | 463 | | |
452 | 464 | | |
453 | 465 | | |
| |||
521 | 533 | | |
522 | 534 | | |
523 | 535 | | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
529 | 547 | | |
530 | | - | |
| 548 | + | |
531 | 549 | | |
532 | 550 | | |
533 | 551 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
157 | 159 | | |
158 | 160 | | |
159 | 161 | | |
| |||
168 | 170 | | |
169 | 171 | | |
170 | 172 | | |
171 | | - | |
172 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
173 | 179 | | |
174 | 180 | | |
175 | 181 | | |
| |||
178 | 184 | | |
179 | 185 | | |
180 | 186 | | |
| 187 | + | |
| 188 | + | |
181 | 189 | | |
182 | 190 | | |
183 | 191 | | |
| |||
203 | 211 | | |
204 | 212 | | |
205 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
206 | 220 | | |
207 | 221 | | |
208 | 222 | | |
| |||
0 commit comments