v1.0.0 — qverify-mini-50 hero card + stable badge
Browse files
app.py
CHANGED
|
@@ -270,6 +270,46 @@ def _safety_status_md() -> str:
|
|
| 270 |
)
|
| 271 |
|
| 272 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 273 |
def _load_benchmark_summaries() -> str:
|
| 274 |
"""Read every benchmarks/results/*/report.json checked into the repo and
|
| 275 |
render a summary Markdown table. Called once at Space load time."""
|
|
@@ -765,7 +805,11 @@ _HERO_HTML = f"""
|
|
| 765 |
</h1>
|
| 766 |
<span style="font-family:JetBrains Mono,monospace;font-size:12px;font-weight:700;
|
| 767 |
color:#06B6D4;border:1px solid #06B6D4;padding:2px 8px;border-radius:999px;">
|
| 768 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 769 |
</span>
|
| 770 |
<span style="font-family:JetBrains Mono,monospace;font-size:12px;color:#A78BFA;">
|
| 771 |
Quantum Labor · Project 1 of 3
|
|
@@ -847,6 +891,8 @@ with gr.Blocks(title="QVerify · Quantum Logic Verifier") as demo:
|
|
| 847 |
gr.HTML(_HERO_HTML)
|
| 848 |
gr.Markdown(_INTRO_MD)
|
| 849 |
gr.Markdown("---")
|
|
|
|
|
|
|
| 850 |
gr.Markdown("# Try it now")
|
| 851 |
|
| 852 |
with gr.Row():
|
|
|
|
| 270 |
)
|
| 271 |
|
| 272 |
|
| 273 |
+
def _load_qverify_mini_summary() -> str:
|
| 274 |
+
"""Render the qverify-mini-50 hero card from the in-repo report.json.
|
| 275 |
+
|
| 276 |
+
Returns a static Markdown card with accuracy, avg verify time, and
|
| 277 |
+
example count so visitors see real numbers right under the intro
|
| 278 |
+
copy. If the report file is missing (e.g. someone running locally
|
| 279 |
+
before the first run) we fall back to a one-line placeholder.
|
| 280 |
+
"""
|
| 281 |
+
import json as _json
|
| 282 |
+
|
| 283 |
+
here = Path(__file__).resolve().parent
|
| 284 |
+
candidates = (
|
| 285 |
+
here / "benchmarks" / "results" / "qverify_mini_simulator" / "report.json",
|
| 286 |
+
here.parent / "benchmarks" / "results" / "qverify_mini_simulator" / "report.json",
|
| 287 |
+
)
|
| 288 |
+
for p in candidates:
|
| 289 |
+
if p.exists():
|
| 290 |
+
try:
|
| 291 |
+
data = _json.loads(p.read_text(encoding="utf-8"))
|
| 292 |
+
except Exception:
|
| 293 |
+
continue
|
| 294 |
+
acc = float(data.get("accuracy", 0.0)) * 100
|
| 295 |
+
avg = float(data.get("avg_seconds", 0.0))
|
| 296 |
+
n = int(data.get("n_examples", 0))
|
| 297 |
+
return (
|
| 298 |
+
"## qverify-mini-50 — verifier accuracy on the simulator\n\n"
|
| 299 |
+
"Hand-crafted SAT/UNSAT benchmark, every label cross-checked "
|
| 300 |
+
"against the PySAT Glucose3 oracle.\n\n"
|
| 301 |
+
"| Metric | Value |\n"
|
| 302 |
+
"| --- | --- |\n"
|
| 303 |
+
f"| Accuracy | **{acc:.1f}%** |\n"
|
| 304 |
+
f"| Avg verify time | {avg:.2f}s |\n"
|
| 305 |
+
f"| Examples | {n} (25 SAT / 25 UNSAT) |\n"
|
| 306 |
+
"\n"
|
| 307 |
+
"Source: `benchmarks/qverify_mini/dataset.json` · "
|
| 308 |
+
"[Methodology](https://github.com/Quantum-Labor/qverify/blob/main/benchmarks/qverify_mini/README.md)"
|
| 309 |
+
)
|
| 310 |
+
return "_qverify-mini-50 report not yet generated._"
|
| 311 |
+
|
| 312 |
+
|
| 313 |
def _load_benchmark_summaries() -> str:
|
| 314 |
"""Read every benchmarks/results/*/report.json checked into the repo and
|
| 315 |
render a summary Markdown table. Called once at Space load time."""
|
|
|
|
| 805 |
</h1>
|
| 806 |
<span style="font-family:JetBrains Mono,monospace;font-size:12px;font-weight:700;
|
| 807 |
color:#06B6D4;border:1px solid #06B6D4;padding:2px 8px;border-radius:999px;">
|
| 808 |
+
v1.0.0
|
| 809 |
+
</span>
|
| 810 |
+
<span style="font-family:JetBrains Mono,monospace;font-size:12px;font-weight:700;
|
| 811 |
+
color:#10B981;border:1px solid #10B981;padding:2px 8px;border-radius:999px;">
|
| 812 |
+
stable · 433 tests · CI green
|
| 813 |
</span>
|
| 814 |
<span style="font-family:JetBrains Mono,monospace;font-size:12px;color:#A78BFA;">
|
| 815 |
Quantum Labor · Project 1 of 3
|
|
|
|
| 891 |
gr.HTML(_HERO_HTML)
|
| 892 |
gr.Markdown(_INTRO_MD)
|
| 893 |
gr.Markdown("---")
|
| 894 |
+
gr.Markdown(_load_qverify_mini_summary())
|
| 895 |
+
gr.Markdown("---")
|
| 896 |
gr.Markdown("# Try it now")
|
| 897 |
|
| 898 |
with gr.Row():
|