diff --git a/OpenBench/static/style.css b/OpenBench/static/style.css
index 1726d8d..f1341c1 100644
--- a/OpenBench/static/style.css
+++ b/OpenBench/static/style.css
@@ -309,6 +309,159 @@ body, html, main{
padding: 0.50rem 0.75rem;
}
+#content .llr-history-panel {
+ margin: 0.5rem 0 0.75rem;
+}
+
+#content .llr-history-widget {
+ position: relative;
+ width: 372px;
+}
+
+#content .llr-history-chart {
+ display: flex;
+ align-items: stretch;
+ gap: 0.55rem;
+}
+
+#content .llr-history-yaxis {
+ width: 44px;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ color: #A7B1C2;
+ font-size: 10px;
+ text-align: right;
+ padding: 0.35rem 0 1.6rem;
+}
+
+#content .llr-history-main {
+ display: flex;
+ flex-direction: column;
+ gap: 0.28rem;
+}
+
+#content .llr-history-plot {
+ position: relative;
+}
+
+#content .llr-history-label {
+ color: var(--color-font3);
+ font-size: 0.85rem;
+ margin-bottom: 0.2rem;
+}
+
+#content .llr-history-graph {
+ display: block;
+ width: 320px;
+ height: 112px;
+}
+
+#content .llr-history-graph .llr-bg {
+ fill: #242933;
+ stroke: #4C566A;
+ stroke-width: 1;
+}
+
+#content .llr-history-graph .llr-grid-line {
+ stroke: rgba(236, 239, 244, 0.14);
+ stroke-width: 1;
+}
+
+#content .llr-history-graph .llr-boundary {
+ stroke: #BF616A;
+ stroke-width: 1;
+ stroke-dasharray: 4 3;
+ opacity: 0.85;
+}
+
+#content .llr-history-graph .llr-zero {
+ stroke: #81A1C1;
+ stroke-width: 1;
+ opacity: 0.7;
+}
+
+#content .llr-history-graph .llr-path-positive,
+#content .llr-history-graph .llr-path-negative {
+ fill: none;
+ stroke-width: 2;
+ stroke-linecap: round;
+ stroke-linejoin: round;
+}
+
+#content .llr-history-graph .llr-path-positive {
+ stroke: #7BCB8B;
+}
+
+#content .llr-history-graph .llr-path-negative {
+ stroke: #E07A7A;
+}
+
+#content .llr-history-xaxis {
+ display: flex;
+ justify-content: space-between;
+ color: #A7B1C2;
+ font-size: 10px;
+ padding: 0 0.2rem;
+}
+
+#content .llr-history-graph .llr-point {
+ fill: #ECEFF4;
+}
+
+#content .llr-history-graph .llr-hover-line {
+ stroke: #ECEFF4;
+ stroke-width: 1;
+ stroke-dasharray: 2 2;
+ opacity: 0;
+}
+
+#content .llr-history-graph .llr-hover-point {
+ fill: #ECEFF4;
+ stroke-width: 1.5;
+ opacity: 0;
+}
+
+#content .llr-history-graph .llr-hover-line.active,
+#content .llr-history-graph .llr-hover-point.active {
+ opacity: 0.85;
+}
+
+#content .llr-history-graph .llr-hover-point-positive {
+ stroke: #7BCB8B;
+}
+
+#content .llr-history-graph .llr-hover-point-negative {
+ stroke: #E07A7A;
+}
+
+#content .llr-history-graph .llr-hitbox {
+ fill: transparent;
+ cursor: crosshair;
+}
+
+#content .llr-history-tooltip {
+ position: absolute;
+ left: 0;
+ top: 0;
+ padding: 0.18rem 0.4rem 0.12rem;
+ border-radius: 4px;
+ background-color: rgba(36, 41, 51, 0.96);
+ border: 1px solid #4C566A;
+ color: var(--color-font1);
+ font-size: 0.72rem;
+ pointer-events: none;
+ opacity: 0;
+ transform: translateY(2px);
+ transition: opacity 0.12s ease, transform 0.12s ease;
+ white-space: nowrap;
+}
+
+#content .llr-history-tooltip.active {
+ opacity: 1;
+ transform: translateY(0);
+}
+
/* Test Views */
#content #config {
diff --git a/OpenBench/templatetags/mytags.py b/OpenBench/templatetags/mytags.py
index 8e69745..ec320ec 100644
--- a/OpenBench/templatetags/mytags.py
+++ b/OpenBench/templatetags/mytags.py
@@ -18,9 +18,13 @@
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+import html
+import json
import re, django
import OpenBench.config, OpenBench.utils, OpenBench.stats, OpenBench.models
+from django.utils.safestring import mark_safe
+
def oneDigitPrecision(value):
try:
value = round(value, 1)
@@ -200,6 +204,207 @@ def machine_name(machine_id):
return machine.info['machine_name']
except: return 'None'
+def llr_history_graph(test, width=320, height=112):
+
+ if test.test_mode != 'SPRT':
+ return ''
+
+ history = list(OpenBench.utils.get_llr_history(test))
+ if not history:
+ history = [[0, 0.0], [max(test.games, 1), test.currentllr]]
+ elif history[-1][0] != test.games or history[-1][1] != test.currentllr:
+ history.append([test.games, test.currentllr])
+
+ x_max = max(max(point[0] for point in history), 1)
+ observed = [point[1] for point in history] + [0.0]
+ observed_min = min(observed)
+ observed_max = max(observed)
+ observed_span = observed_max - observed_min
+
+ if observed_span < 0.75:
+ center = (observed_min + observed_max) / 2.0
+ y_min = center - 0.375
+ y_max = center + 0.375
+ else:
+ padding = max(observed_span * 0.15, 0.15)
+ y_min = observed_min - padding
+ y_max = observed_max + padding
+
+ left_pad = 8
+ right_pad = 8
+ top_pad = 8
+ bottom_pad = 8
+ inner_width = max(width - left_pad - right_pad, 1)
+ inner_height = max(height - top_pad - bottom_pad, 1)
+
+ def scale_x(value):
+ return left_pad + inner_width * (value / x_max)
+
+ def scale_y(value):
+ return top_pad + inner_height * (1.0 - ((value - y_min) / (y_max - y_min)))
+
+ plotted_points = [
+ {
+ 'games': x,
+ 'llr': round(y, 4),
+ 'x': round(scale_x(x), 2),
+ 'y': round(scale_y(y), 2),
+ }
+ for x, y in history
+ ]
+ y_mid = (y_min + y_max) / 2.0
+ x_mid = x_max / 2.0
+ x_quarter = x_max / 4.0
+ x_three_quarter = 3.0 * x_max / 4.0
+
+ grid_lines = []
+ for value in [y_max, y_mid, y_min]:
+ y_pos = scale_y(value)
+ grid_lines.append(
+ '