QuorumGuard-Explorer / index.html
batistado's picture
Publish QuorumGuard & QuorumBench static HTML5 interactive explorer
c27a19a verified
Raw History Blame Contribute Delete
31 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>QuorumGuard & QuorumBench Explorer</title>
<style>
:root { --bg: #0f172a; --card: #1e293b; --border: #334155; --text: #f8fafc; --muted: #94a3b8; --accent: #10b981; --warn: #ef4444; }
body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); margin: 0; padding: 24px; line-height: 1.5; }
.wrap { max-width: 1080px; margin: 0 auto; }
h1 { margin: 0 0 6px; font-size: 1.65rem; }
.sub { color: var(--muted); margin-bottom: 20px; font-size: 0.95rem; }
.sub a { color: #38bdf8; text-decoration: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 16px; margin-bottom: 20px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.card h2 { margin: 0 0 10px; font-size: 1.08rem; }
label { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
input[type=range], select { width: 100%; margin-top: 4px; }
select { background: #0f172a; color: var(--text); border: 1px solid var(--border); padding: 7px; border-radius: 6px; }
.stat { font-size: 1.25rem; font-weight: 700; color: var(--accent); }
.bad { color: var(--warn); }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; margin-top: 8px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }
.badge { padding: 2px 7px; border-radius: 4px; font-size: 0.76rem; font-weight: 600; }
.ok { background: rgba(16,185,129,0.18); color: #34d399; }
.err { background: rgba(239,68,68,0.18); color: #f87171; }
</style>
</head>
<body>
<div class="wrap">
<h1>QuorumGuard &amp; QuorumBench Interactive Explorer</h1>
<div class="sub">
Live MPS Telemetry across Qwen2.5-3B, 7B, and 14B-Coder &middot;
<a href="https://huggingface.co/datasets/batistado/QuorumBench" target="_blank">Dataset</a> &middot;
<a href="https://huggingface.co/batistado/QuorumGuard" target="_blank">Hub Package</a> &middot;
<a href="https://github.com/batistado/quorumguard" target="_blank">GitHub</a>
</div>
<div class="grid">
<div class="card">
<h2>Theorem 1 Phase-Transition Calculator</h2>
<label><span>Shallow Error p0</span><span id="v_p0">0.78</span></label>
<input type="range" id="p0" min="0.52" max="0.95" step="0.01" value="0.78" />
<label><span>Asymptotic Deep Error p_inf</span><span id="v_pinf">0.08</span></label>
<input type="range" id="pinf" min="0.01" max="0.30" step="0.01" value="0.08" />
<label><span>Verification Rate lambda / mu</span><span id="v_rat">1.22</span></label>
<input type="range" id="rat" min="0.30" max="3.00" step="0.05" value="1.22" />
<label><span>Fast Quorum Ratio phi = k / N</span><span id="v_phi">0.35</span></label>
<input type="range" id="phi" min="0.10" max="0.99" step="0.01" value="0.35" />
<div style="margin-top:12px; font-size:0.88rem;">
Population Mean Error p_bar: <strong id="out_pbar"></strong><br/>
Critical Quorum Threshold phi_crit: <strong id="out_crit"></strong><br/>
Fast-Quorum Member Error p_fast(phi): <span id="out_pfast" class="stat"></span>
</div>
</div>
<div class="card">
<h2>QuorumBench-50 Summary (3B + 7B + 14B-Coder)</h2>
<table>
<thead><tr><th>Policy</th><th>Joint Acc</th><th>Trap Acc</th><th>P95 (s)</th></tr></thead>
<tbody>
<tr><td>Fast k-of-N</td><td class="bad">28.0%</td><td class="bad">6.7%</td><td>1.46s</td></tr>
<tr><td>CVaR Cutoff</td><td class="bad">28.0%</td><td class="bad">6.7%</td><td>5.60s</td></tr>
<tr><td>Sync N-of-N</td><td>42.0%</td><td>23.3%</td><td>49.86s</td></tr>
<tr><td>Genealogy Sync</td><td>72.0%</td><td>63.3%</td><td>48.86s</td></tr>
<tr><td><strong>QuorumGuard</strong></td><td><strong style="color:#34d399">72.0%</strong></td><td><strong style="color:#34d399">63.3%</strong></td><td><strong style="color:#34d399">14.82s</strong></td></tr>
</tbody>
</table>
</div>
</div>
<div class="card">
<h2>50-Workflow Live MPS Trace Browser</h2>
<select id="task_sel"></select>
<div id="task_detail" style="margin-top:12px; font-size:0.9rem;"></div>
</div>
</div>
<script>
const DATA = {"summary_50": {"Fast_k_of_N": {"stage1_accuracy": 0.46, "stage2_accuracy": 0.56, "end_to_end_joint_accuracy": 0.28, "boundary_trap_joint_accuracy": 0.0667, "routine_joint_accuracy": 0.6, "mean_workflow_latency_s": 1.1146, "routine_mean_latency_s": 1.0228, "p50_workflow_latency_s": 1.0775, "p95_workflow_latency_s": 1.459, "p99_workflow_latency_s": 1.5027, "cvar95_workflow_latency_s": 1.4891, "p_stage2_err_given_stage1_err": 0.4815, "p_stage2_err_given_stage1_ok": 0.3913, "stage1_boost_rate": 0.0}, "Sync_N_of_N": {"stage1_accuracy": 0.66, "stage2_accuracy": 0.68, "end_to_end_joint_accuracy": 0.42, "boundary_trap_joint_accuracy": 0.2333, "routine_joint_accuracy": 0.7, "mean_workflow_latency_s": 36.3392, "routine_mean_latency_s": 37.452, "p50_workflow_latency_s": 35.3277, "p95_workflow_latency_s": 49.8562, "p99_workflow_latency_s": 52.0719, "cvar95_workflow_latency_s": 51.4032, "p_stage2_err_given_stage1_err": 0.2353, "p_stage2_err_given_stage1_ok": 0.3636, "stage1_boost_rate": 0.0}, "Genealogy_Sync_HPR": {"stage1_accuracy": 0.84, "stage2_accuracy": 0.88, "end_to_end_joint_accuracy": 0.72, "boundary_trap_joint_accuracy": 0.6333, "routine_joint_accuracy": 0.85, "mean_workflow_latency_s": 35.9742, "routine_mean_latency_s": 37.452, "p50_workflow_latency_s": 35.1347, "p95_workflow_latency_s": 48.8589, "p99_workflow_latency_s": 52.0719, "cvar95_workflow_latency_s": 51.1952, "p_stage2_err_given_stage1_err": 0.0, "p_stage2_err_given_stage1_ok": 0.1429, "stage1_boost_rate": 0.0}, "CVaR_Static_Cutoff": {"stage1_accuracy": 0.46, "stage2_accuracy": 0.52, "end_to_end_joint_accuracy": 0.28, "boundary_trap_joint_accuracy": 0.0667, "routine_joint_accuracy": 0.6, "mean_workflow_latency_s": 5.6, "routine_mean_latency_s": 5.6, "p50_workflow_latency_s": 5.6, "p95_workflow_latency_s": 5.6, "p99_workflow_latency_s": 5.6, "cvar95_workflow_latency_s": 5.6, "p_stage2_err_given_stage1_err": 0.5556, "p_stage2_err_given_stage1_ok": 0.3913, "stage1_boost_rate": 0.0}, "QuorumGuard": {"stage1_accuracy": 0.84, "stage2_accuracy": 0.88, "end_to_end_joint_accuracy": 0.72, "boundary_trap_joint_accuracy": 0.6333, "routine_joint_accuracy": 0.85, "mean_workflow_latency_s": 10.1032, "routine_mean_latency_s": 8.4953, "p50_workflow_latency_s": 9.7349, "p95_workflow_latency_s": 14.8164, "p99_workflow_latency_s": 16.7789, "cvar95_workflow_latency_s": 16.1095, "p_stage2_err_given_stage1_err": 0.0, "p_stage2_err_given_stage1_ok": 0.1429, "stage1_boost_rate": 1.0}}, "tiers_50": {"fast_3b": {"model_tier": "Qwen2.5-3B Direct", "count": 150, "overall_accuracy": 0.5067, "boundary_trap_accuracy": 0.1889, "mean_completion_s": 0.5465, "mean_mps_wall_s": 0.0966, "mean_normalized_entropy": 0.2114}, "short_cot_3b": {"model_tier": "Qwen2.5-3B Short-CoT", "count": 50, "overall_accuracy": 0.4, "boundary_trap_accuracy": 0.2, "mean_completion_s": 2.691, "mean_mps_wall_s": 1.7752, "mean_normalized_entropy": 0.1873}, "cot_7b": {"model_tier": "Qwen2.5-7B CoT", "count": 50, "overall_accuracy": 0.64, "boundary_trap_accuracy": 0.4333, "mean_completion_s": 6.9671, "mean_mps_wall_s": 5.4683, "mean_normalized_entropy": 0.0938}, "verifier_7b": {"model_tier": "Qwen2.5-Coder-14B + Sandbox", "count": 100, "overall_accuracy": 0.8, "boundary_trap_accuracy": 0.7167, "mean_completion_s": 18.9132, "mean_mps_wall_s": 12.9253, "mean_normalized_entropy": 0.0928}}, "tasks_preview": [{"id": "R01_sha256_bytes", "regime": "routine", "cat": "systems_basics", "q1": "How many raw bytes (not hex characters) are produced by a standard SHA-256 digest?", "gold1": "B", "fast_c": "B", "fast_t": 0.9539, "fast_ok": true, "sync_t": 53.8198, "sync_ok": true, "qg_c": "B", "qg_t": 5.9087, "qg_ok": true}, {"id": "T01_uint16_overflow", "regime": "boundary_trap", "cat": "systems_bugs", "q1": "In C/CUDA, a kernel computes `uint16_t total_tokens = batch_size * seq_len;` When `batch_size = 256` and `seq_len = 256`, what exact value is stored in `total_tokens`?", "gold1": "C", "fast_c": "A", "fast_t": 1.0042, "fast_ok": false, "sync_t": 35.7391, "sync_ok": false, "qg_c": "A", "qg_t": 9.7123, "qg_ok": false}, {"id": "T02_float32_precision_stall", "regime": "boundary_trap", "cat": "numerical", "q1": "A telemetry counter uses IEEE-754 single-precision `float32` (`np.float32`). Starting at `x = np.float32(16777216.0)` (`2**24`), the loop runs `x = np.float32(x + np.float32(1.0))` 100 times. What is the exact final value of `x`?", "gold1": "B", "fast_c": "A", "fast_t": 1.4622, "fast_ok": false, "sync_t": 42.9566, "sync_ok": true, "qg_c": "B", "qg_t": 14.4467, "qg_ok": true}, {"id": "R02_binary_heap_left_child", "regime": "routine", "cat": "algorithms", "q1": "In a 0-indexed binary heap stored in a contiguous array, what is the index of the left child of node i = 14?", "gold1": "C", "fast_c": "C", "fast_t": 0.9658, "fast_ok": false, "sync_t": 31.8221, "sync_ok": false, "qg_c": "C", "qg_t": 7.9728, "qg_ok": false}, {"id": "T03_sql_not_in_null", "regime": "boundary_trap", "cat": "databases", "q1": "Table `orders` has 5 rows with `id` in `(1, 2, 3, 4, 5)`. Subquery `blocked_ids` returns `(2, 4, NULL)`. How many rows does `SELECT id FROM orders WHERE id NOT IN (SELECT uid FROM blocked_ids);` return in standard SQL / PostgreSQL / SQLite?", "gold1": "B", "fast_c": "A", "fast_t": 0.7921, "fast_ok": false, "sync_t": 33.7614, "sync_ok": false, "qg_c": "A", "qg_t": 7.6593, "qg_ok": false}, {"id": "T04_shift_add_precedence", "regime": "boundary_trap", "cat": "systems_bugs", "q1": "In both C and Python 3, what exact integer value does the unparenthesized expression `1 << 2 + 3` evaluate to?", "gold1": "B", "fast_c": "A", "fast_t": 1.2246, "fast_ok": false, "sync_t": 30.8385, "sync_ok": true, "qg_c": "B", "qg_t": 8.3332, "qg_ok": true}, {"id": "R03_http_idempotent", "regime": "routine", "cat": "distributed_systems", "q1": "According to RFC 9110 (HTTP Semantics), which of the following HTTP methods is NOT guaranteed to be idempotent?", "gold1": "D", "fast_c": "D", "fast_t": 0.9549, "fast_ok": false, "sync_t": 27.9196, "sync_ok": true, "qg_c": "D", "qg_t": 7.0227, "qg_ok": true}, {"id": "T05_python_xor_caret", "regime": "boundary_trap", "cat": "systems_bugs", "q1": "In Python 3, what is the exact integer value evaluated by the expression `3 ^ 4 % 5`?", "gold1": "B", "fast_c": "A", "fast_t": 1.1115, "fast_ok": false, "sync_t": 31.746, "sync_ok": true, "qg_c": "B", "qg_t": 10.4643, "qg_ok": true}, {"id": "T06_python_bankers_rounding", "regime": "boundary_trap", "cat": "numerical", "q1": "In Python 3, evaluate `sum(round(x + 0.5) for x in range(8))` (i.e., `round(0.5) + round(1.5) + round(2.5) + round(3.5) + round(4.5) + round(5.5) + round(6.5) + round(7.5)`).", "gold1": "B", "fast_c": "A", "fast_t": 0.9381, "fast_ok": false, "sync_t": 31.526, "sync_ok": true, "qg_c": "B", "qg_t": 10.6459, "qg_ok": true}, {"id": "R04_matmul_flops", "regime": "routine", "cat": "numerical", "q1": "If matrix X has shape (4, 8) and matrix Y has shape (8, 5), what is the output shape of the matrix product X @ Y?", "gold1": "A", "fast_c": "A", "fast_t": 1.0227, "fast_ok": false, "sync_t": 37.1754, "sync_ok": true, "qg_c": "A", "qg_t": 7.6389, "qg_ok": true}, {"id": "T07_closure_late_binding", "regime": "boundary_trap", "cat": "systems_bugs", "q1": "What exact value is returned by the Python 3 snippet:\n`funcs = [lambda x: x * i for i in range(5)]\nresult = funcs[1](10) + funcs[2](10)`", "gold1": "B", "fast_c": "A", "fast_t": 1.2037, "fast_ok": false, "sync_t": 30.4771, "sync_ok": true, "qg_c": "B", "qg_t": 10.6556, "qg_ok": true}, {"id": "T08_shallow_list_multiply", "regime": "boundary_trap", "cat": "systems_bugs", "q1": "What exact integer is printed by this Python snippet?\n`dp = [[0] * 4] * 5\ndp[0][2] = 7\ndp[3][2] += 2\nprint(sum(row[2] for row in dp))`", "gold1": "B", "fast_c": "A", "fast_t": 1.1075, "fast_ok": false, "sync_t": 30.2633, "sync_ok": true, "qg_c": "B", "qg_t": 9.7897, "qg_ok": true}, {"id": "R05_tcp_syn_seq", "regime": "routine", "cat": "networking", "q1": "During a TCP 3-way handshake, if the client sends SYN with sequence number ISN = 1000, what acknowledgment number (ACK) does the server send in its SYN-ACK packet?", "gold1": "C", "fast_c": "C", "fast_t": 0.9959, "fast_ok": true, "sync_t": 48.0594, "sync_ok": true, "qg_c": "C", "qg_t": 8.2769, "qg_ok": true}, {"id": "T09_utf8_emoji_bytes", "regime": "boundary_trap", "cat": "systems_bugs", "q1": "In Python 3, what exact integer does `len('café 🚀'.encode('utf-8'))` return? (Note: string is `'c'`, `'a'`, `'f'`, `'é'` U+00E9, `' '` U+0020, `'🚀'` U+1F680.)", "gold1": "C", "fast_c": "B", "fast_t": 1.2334, "fast_ok": false, "sync_t": 32.3774, "sync_ok": true, "qg_c": "C", "qg_t": 9.2135, "qg_ok": true}, {"id": "T10_harmonic_throughput", "regime": "boundary_trap", "cat": "distributed_systems", "q1": "A backup job uploads a 600 GB snapshot over Link A at 60 MB/s, and immediately downloads/verifies the exact same 600 GB snapshot over Link B at 20 MB/s. What is the exact effective average transfer rate (total GB transferred divided by total elapsed time) across the round-trip?", "gold1": "B", "fast_c": "D", "fast_t": 1.3012, "fast_ok": false, "sync_t": 30.7587, "sync_ok": true, "qg_c": "B", "qg_t": 11.2849, "qg_ok": true}, {"id": "R06_raft_quorum_size", "regime": "routine", "cat": "distributed_systems", "q1": "In a standard symmetric Raft cluster of N = 9 voting nodes, what is the minimum number of nodes required to form a commit quorum?", "gold1": "B", "fast_c": "B", "fast_t": 1.0095, "fast_ok": false, "sync_t": 35.9513, "sync_ok": false, "qg_c": "B", "qg_t": 9.3677, "qg_ok": false}, {"id": "T11_bayes_false_positive", "regime": "boundary_trap", "cat": "math", "q1": "In a cluster of 10,000 nodes, exactly 0.1% (10 nodes) truly have silent hardware corruption. An automated detector flags corrupt nodes with 99% true-positive sensitivity, and has a 1% false-positive rate on healthy nodes (99% specificity). If a randomly chosen node triggers an alert, what is the closest posterior probability that the node truly has silent corruption?", "gold1": "C", "fast_c": "A", "fast_t": 0.9783, "fast_ok": false, "sync_t": 32.717, "sync_ok": false, "qg_c": "B", "qg_t": 11.79, "qg_ok": false}, {"id": "T12_int32_midpoint_overflow", "regime": "boundary_trap", "cat": "algorithms", "q1": "In C/Java (`int32_t`, signed 32-bit two's complement range `-2,147,483,648` to `2,147,483,647`), binary search computes `int32_t mid = (low + high) / 2;` with `low = 1500000000` and `high = 1700000000`. Wrapping in 32-bit two's complement before `/ 2`, what happens to `mid`?", "gold1": "B", "fast_c": "B", "fast_t": 1.1974, "fast_ok": true, "sync_t": 37.1413, "sync_ok": true, "qg_c": "B", "qg_t": 7.8384, "qg_ok": true}, {"id": "R07_dag_topo_cycle", "regime": "routine", "cat": "algorithms", "q1": "Kahn's topological sort algorithm runs on a directed graph with V = 12 vertices and terminates having popped only 9 vertices from the zero-indegree queue. What does this guarantee?", "gold1": "B", "fast_c": "B", "fast_t": 1.0934, "fast_ok": true, "sync_t": 27.9027, "sync_ok": true, "qg_c": "B", "qg_t": 6.6413, "qg_ok": true}, {"id": "T13_sliding_window_fencepost", "regime": "boundary_trap", "cat": "algorithms", "q1": "A function computes the maximum sum of any contiguous subarray of length `k = 4` over `arr = [2, 1, 5, 1, 3, 2, 9]` (`len(arr) = 7`) using:\n`best = max(sum(arr[i : i + k]) for i in range(len(arr) - k))`\nWhat exact value does `best` evaluate to?", "gold1": "B", "fast_c": "A", "fast_t": 1.2888, "fast_ok": false, "sync_t": 35.1901, "sync_ok": false, "qg_c": "B", "qg_t": 10.9806, "qg_ok": false}, {"id": "T14_mutable_default_retry", "regime": "boundary_trap", "cat": "systems_bugs", "q1": "Consider Python function:\n`def record_attempt(code, history=[]):\n history.append(code)\n return sum(history)`\nIf a worker calls `a = record_attempt(200)`, then `b = record_attempt(500)`, then `c = record_attempt(200)`, what is the exact value of `a + b + c`?", "gold1": "B", "fast_c": "A", "fast_t": 0.8843, "fast_ok": false, "sync_t": 31.4425, "sync_ok": true, "qg_c": "B", "qg_t": 11.5479, "qg_ok": true}, {"id": "R08_ipv4_cidr_hosts", "regime": "routine", "cat": "networking", "q1": "How many total IPv4 addresses (including network and broadcast addresses) are contained in a /26 CIDR block?", "gold1": "B", "fast_c": "B", "fast_t": 0.9297, "fast_ok": true, "sync_t": 31.0056, "sync_ok": true, "qg_c": "B", "qg_t": 7.5074, "qg_ok": true}, {"id": "T15_neg_floor_mod_c_vs_py", "regime": "boundary_trap", "cat": "numerical", "q1": "In Python 3, what exact tuple is produced by `(-17 // 5, -17 % 5)`?", "gold1": "B", "fast_c": "A", "fast_t": 1.394, "fast_ok": false, "sync_t": 39.0865, "sync_ok": false, "qg_c": "B", "qg_t": 8.1634, "qg_ok": false}, {"id": "T16_generator_exhaustion", "regime": "boundary_trap", "cat": "systems_bugs", "q1": "What exact float value is computed by this Python 3 snippet?\n`scores = (x * 2 for x in [1, 2, 3, 4])\ntotal = sum(scores)\ncount = len(list(scores))\navg = total / max(count, 1)`", "gold1": "B", "fast_c": "A", "fast_t": 1.0429, "fast_ok": false, "sync_t": 30.2101, "sync_ok": true, "qg_c": "B", "qg_t": 10.6851, "qg_ok": true}, {"id": "R09_btree_search_complexity", "regime": "routine", "cat": "databases", "q1": "What is the worst-case asymptotic time complexity of point-key lookup in a balanced B-Tree indexing N keys?", "gold1": "B", "fast_c": "B", "fast_t": 1.0357, "fast_ok": true, "sync_t": 31.2164, "sync_ok": true, "qg_c": "B", "qg_t": 7.1548, "qg_ok": true}, {"id": "T17_float_nan_sort_membership", "regime": "boundary_trap", "cat": "numerical", "q1": "In Python 3, execute:\n`v = float('nan')\na = (v == v)\nb = (v in [v])`\nWhat exact pair `(a, b)` is produced?", "gold1": "B", "fast_c": "A", "fast_t": 1.1835, "fast_ok": false, "sync_t": 35.4653, "sync_ok": true, "qg_c": "B", "qg_t": 11.5597, "qg_ok": true}, {"id": "T18_modulo_chain_remainder", "regime": "boundary_trap", "cat": "math", "q1": "What is the exact remainder when `7**2026 + 3**2026` is divided by `10`?", "gold1": "B", "fast_c": "A", "fast_t": 1.3003, "fast_ok": false, "sync_t": 32.1752, "sync_ok": false, "qg_c": "B", "qg_t": 10.8512, "qg_ok": false}, {"id": "R10_geometric_series", "regime": "routine", "cat": "math", "q1": "What is the exact sum of the finite geometric series 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128?", "gold1": "B", "fast_c": "B", "fast_t": 1.0857, "fast_ok": true, "sync_t": 50.2527, "sync_ok": true, "qg_c": "B", "qg_t": 12.1493, "qg_ok": true}, {"id": "T19_sql_count_col_null", "regime": "boundary_trap", "cat": "databases", "q1": "Table `sessions` has 6 rows with column `latency_ms` values `(12, NULL, 18, NULL, 0, 25)`. What exact pair of integers does `SELECT COUNT(*), COUNT(latency_ms) FROM sessions;` return in SQL?", "gold1": "B", "fast_c": "B", "fast_t": 0.8291, "fast_ok": false, "sync_t": 38.1706, "sync_ok": true, "qg_c": "B", "qg_t": 14.1415, "qg_ok": true}, {"id": "T20_python_dict_bool_int_float_keys", "regime": "boundary_trap", "cat": "systems_bugs", "q1": "In Python 3, execute:\n`d = {True: 'yes', 1: 'int_one', 1.0: 'float_one'}\nprint(len(d), list(d.keys())[0], list(d.values())[0])`\nWhat exact output is printed?", "gold1": "B", "fast_c": "A", "fast_t": 1.2794, "fast_ok": false, "sync_t": 39.4202, "sync_ok": false, "qg_c": "A", "qg_t": 7.8341, "qg_ok": false}, {"id": "R11_mutex_deadlock_order", "regime": "routine", "cat": "concurrency", "q1": "Thread 1 locks Mutex A then Mutex B, while Thread 2 locks Mutex B then Mutex A. Which classic Coffman condition is violated if we enforce a strict global lock acquisition order (always lock A before B)?", "gold1": "B", "fast_c": "B", "fast_t": 0.9876, "fast_ok": true, "sync_t": 40.6185, "sync_ok": true, "qg_c": "B", "qg_t": 5.6695, "qg_ok": true}, {"id": "T21_signed_right_shift_mask", "regime": "boundary_trap", "cat": "systems_bugs", "q1": "In Python 3 (and two's-complement arithmetic right shift), what exact integer does `-1 >> 5` evaluate to?", "gold1": "B", "fast_c": "A", "fast_t": 1.0571, "fast_ok": false, "sync_t": 31.7615, "sync_ok": true, "qg_c": "B", "qg_t": 10.3015, "qg_ok": true}, {"id": "T22_dijkstra_negative_edge", "regime": "boundary_trap", "cat": "algorithms", "q1": "Directed graph has 4 nodes `{S, A, B, T}` and edges `S->A (weight 2)`, `S->B (weight 5)`, `B->A (weight -4)`, `A->T (weight 1)`. Standard non-revisiting Dijkstra (marking popped nodes finalized once) runs from `S`. What `(dijkstra_output, true_shortest_path)` pair for `S -> T` occurs?", "gold1": "B", "fast_c": "A", "fast_t": 1.2296, "fast_ok": false, "sync_t": 49.5131, "sync_ok": false, "qg_c": "A", "qg_t": 18.183, "qg_ok": false}, {"id": "R12_kv_cache_bytes", "regime": "routine", "cat": "ml_systems", "q1": "A transformer layer caches K and V tensors for 1 sequence of 1024 tokens with 8 KV heads, head_dim = 128, stored in FP16 (2 bytes/element). How many megabytes (1 MB = 1,048,576 bytes) does this single layer's KV cache occupy?", "gold1": "C", "fast_c": "C", "fast_t": 1.4979, "fast_ok": false, "sync_t": 44.154, "sync_ok": true, "qg_c": "C", "qg_t": 14.828, "qg_ok": true}, {"id": "T23_python_chained_comparison", "regime": "boundary_trap", "cat": "systems_bugs", "q1": "In Python 3, what exact boolean value does the expression `(False == False) in [False]` vs `False == False in [False]` evaluate to, specifically `False == False in [False]`?", "gold1": "B", "fast_c": "B", "fast_t": 1.2584, "fast_ok": true, "sync_t": 39.7571, "sync_ok": true, "qg_c": "B", "qg_t": 14.8023, "qg_ok": true}, {"id": "T24_c_sizeof_array_param_decay", "regime": "boundary_trap", "cat": "systems_bugs", "q1": "On 64-bit Linux (`LP64`, `sizeof(int) == 4`, `sizeof(int*) == 8`), a C function is defined as:\n`size_t get_len(int arr[100]) { return sizeof(arr) / sizeof(arr[0]); }`\nWhat exact value does `get_len(my_buf)` return?", "gold1": "B", "fast_c": "A", "fast_t": 1.1585, "fast_ok": false, "sync_t": 37.7457, "sync_ok": true, "qg_c": "B", "qg_t": 13.3228, "qg_ok": true}, {"id": "R13_http_429_status", "regime": "routine", "cat": "distributed_systems", "q1": "In standard HTTP status codes (RFC 6585), what condition does status code 429 indicate?", "gold1": "B", "fast_c": "B", "fast_t": 1.0424, "fast_ok": true, "sync_t": 40.5339, "sync_ok": true, "qg_c": "B", "qg_t": 8.9713, "qg_ok": true}, {"id": "T25_list_remove_while_iterating", "regime": "boundary_trap", "cat": "systems_bugs", "q1": "In Python 3, execute:\n`nums = [2, 4, 6, 8, 9]\nfor x in nums:\n if x % 2 == 0:\n nums.remove(x)`\nWhat is the exact final list `nums`?", "gold1": "B", "fast_c": "A", "fast_t": 1.5073, "fast_ok": false, "sync_t": 35.0141, "sync_ok": false, "qg_c": "D", "qg_t": 13.226, "qg_ok": false}, {"id": "T26_modular_inverse_existence", "regime": "boundary_trap", "cat": "math", "q1": "How many integers `x` in `{0, 1, ..., 20}` satisfy the modular congruence `(6 * x) % 21 == 1`?", "gold1": "B", "fast_c": "A", "fast_t": 1.2405, "fast_ok": false, "sync_t": 36.4605, "sync_ok": true, "qg_c": "B", "qg_t": 12.6878, "qg_ok": true}, {"id": "R14_quicksort_worst_case", "regime": "routine", "cat": "algorithms", "q1": "What is the worst-case time complexity of deterministic first-element-pivot Quicksort on an already sorted array of N distinct elements?", "gold1": "C", "fast_c": "C", "fast_t": 0.9869, "fast_ok": true, "sync_t": 37.89, "sync_ok": true, "qg_c": "C", "qg_t": 7.2944, "qg_ok": true}, {"id": "T27_python_string_strip_chars", "regime": "boundary_trap", "cat": "systems_bugs", "q1": "In Python 3, what exact string does `'prefix_price_id'.lstrip('prefix_')` return?", "gold1": "B", "fast_c": "A", "fast_t": 1.294, "fast_ok": false, "sync_t": 28.4513, "sync_ok": false, "qg_c": "A", "qg_t": 6.7987, "qg_ok": false}, {"id": "T28_amdahl_parallel_limit", "regime": "boundary_trap", "cat": "distributed_systems", "q1": "A workload has a strictly serial initialization/commit fraction of `s = 20%` (`0.20`) and a perfectly parallelizable fraction of `80%` (`0.80`). Under Amdahl's Law, if we scale from 1 GPU to `P = 16` GPUs, what is the exact end-to-end speedup (rounded to 2 decimal places)?", "gold1": "B", "fast_c": "D", "fast_t": 1.2458, "fast_ok": false, "sync_t": 36.9528, "sync_ok": true, "qg_c": "B", "qg_t": 13.9217, "qg_ok": true}, {"id": "R15_raid1_capacity", "regime": "routine", "cat": "systems_basics", "q1": "A storage server pairs two identical 4 TB NVMe drives in a standard RAID-1 (full mirroring) array. What is the usable logical storage capacity?", "gold1": "B", "fast_c": "B", "fast_t": 0.9523, "fast_ok": true, "sync_t": 28.2279, "sync_ok": true, "qg_c": "B", "qg_t": 7.6487, "qg_ok": true}, {"id": "T29_twos_complement_abs_int8_min", "regime": "boundary_trap", "cat": "numerical", "q1": "In 8-bit signed two's-complement arithmetic (`np.int8`, range `-128` to `127`), wrapping modulo 256 in signed `int8`, what value does `-np.int8(-128)` produce?", "gold1": "B", "fast_c": "D", "fast_t": 1.0692, "fast_ok": false, "sync_t": 26.748, "sync_ok": true, "qg_c": "B", "qg_t": 9.0963, "qg_ok": true}, {"id": "T30_lease_clock_skew_split_brain", "regime": "boundary_trap", "cat": "distributed_systems", "q1": "Leader L1 acquires a 10.0-second lease at true physical time `t = 0.0s`. L1's local monotonic clock runs `15%` slow (`0.85s` measured per `1.0s` real time), while the Lock Server's clock runs `5%` fast (`1.05s` per `1.0s` real time) and grants Leader L2 the lease as soon as `10.0s` elapse on the Lock Server's clock. For how many real physical seconds do L1 and L2 BOTH believe they hold the active exclusive lease simultaneously (split-brain window)?", "gold1": "B", "fast_c": "A", "fast_t": 1.455, "fast_ok": false, "sync_t": 45.805, "sync_ok": false, "qg_c": "A", "qg_t": 15.3175, "qg_ok": false}, {"id": "R16_bloom_filter_fn", "regime": "routine", "cat": "algorithms", "q1": "In a standard insert-only Bloom filter (without deletions or bit corruption), what is the exact theoretical false-negative rate for keys that were previously inserted?", "gold1": "A", "fast_c": "A", "fast_t": 0.936, "fast_ok": true, "sync_t": 40.8189, "sync_ok": true, "qg_c": "A", "qg_t": 9.4695, "qg_ok": true}, {"id": "R17_euler_dag_edges", "regime": "routine", "cat": "math", "q1": "How many edges does a connected undirected tree with V = 25 vertices contain?", "gold1": "B", "fast_c": "B", "fast_t": 0.9069, "fast_ok": false, "sync_t": 29.1548, "sync_ok": true, "qg_c": "B", "qg_t": 7.2512, "qg_ok": true}, {"id": "R18_page_table_offset_bits", "regime": "routine", "cat": "systems_basics", "q1": "On an architecture using 4 KiB (4096-byte) virtual memory pages, how many least-significant virtual address bits form the intra-page byte offset?", "gold1": "B", "fast_c": "B", "fast_t": 0.9934, "fast_ok": false, "sync_t": 44.6066, "sync_ok": false, "qg_c": "B", "qg_t": 12.9617, "qg_ok": false}, {"id": "R19_attention_mask_causal", "regime": "routine", "cat": "ml_systems", "q1": "In causal self-attention over a sequence of L = 10 tokens (0-indexed 0..9), how many non-masked key positions (including itself) can query token at index q = 6 attend to?", "gold1": "B", "fast_c": "B", "fast_t": 1.1746, "fast_ok": false, "sync_t": 35.0792, "sync_ok": true, "qg_c": "B", "qg_t": 9.7574, "qg_ok": true}, {"id": "R20_acid_isolation_serializable", "regime": "routine", "cat": "databases", "q1": "Among the four standard ANSI SQL transaction isolation levels, which is the strictest level that prevents dirty reads, non-repeatable reads, AND phantom reads?", "gold1": "D", "fast_c": "D", "fast_t": 0.9316, "fast_ok": true, "sync_t": 32.8308, "sync_ok": true, "qg_c": "D", "qg_t": 6.4139, "qg_ok": true}]};
function pFast(phi, p0, pinf, ratio) {
if (phi >= 0.9999) return pinf + (p0 - pinf) * (1.0 / (1.0 + ratio));
const exp = 1.0 + ratio;
const term = (1.0 / (1.0 + ratio)) * (1.0 - Math.pow(1.0 - phi, exp));
return pinf + (p0 - pinf) * (term / phi);
}
function updateCalc() {
const p0 = parseFloat(document.getElementById('p0').value);
const pinf = parseFloat(document.getElementById('pinf').value);
const rat = parseFloat(document.getElementById('rat').value);
const phi = parseFloat(document.getElementById('phi').value);
document.getElementById('v_p0').textContent = p0.toFixed(2);
document.getElementById('v_pinf').textContent = pinf.toFixed(2);
document.getElementById('v_rat').textContent = rat.toFixed(2);
document.getElementById('v_phi').textContent = phi.toFixed(2);
const pbar = pinf + (p0 - pinf) * (1.0 / (1.0 + rat));
let lo = 0.001, hi = 0.9999;
for (let i = 0; i < 50; i++) {
const mid = 0.5 * (lo + hi);
if (pFast(mid, p0, pinf, rat) > 0.5) lo = mid; else hi = mid;
}
const crit = (pbar >= 0.5) ? 1.0 : 0.5 * (lo + hi);
const pf = pFast(phi, p0, pinf, rat);
document.getElementById('out_pbar').textContent = pbar.toFixed(3) + (pbar < 0.5 ? ' (Sync -> 0% err)' : ' (Unreliable)');
document.getElementById('out_crit').textContent = crit.toFixed(3);
const el = document.getElementById('out_pfast');
el.textContent = pf.toFixed(3) + (pf > 0.5 ? ' -> FALSE CONSENSUS' : ' -> Stable Quorum');
el.className = pf > 0.5 ? 'stat bad' : 'stat';
}
['p0','pinf','rat','phi'].forEach(id => document.getElementById(id).addEventListener('input', updateCalc));
updateCalc();
const sel = document.getElementById('task_sel');
DATA.tasks_preview.forEach((t, idx) => {
const opt = document.createElement('option');
opt.value = idx;
opt.textContent = `[${t.regime.toUpperCase()}] ${t.id} (${t.cat})`;
sel.appendChild(opt);
});
function renderTask() {
const t = DATA.tasks_preview[parseInt(sel.value, 10)];
const b = ok => `<span class="badge ${ok ? 'ok' : 'err'}">${ok ? 'BOTH STAGES OK' : 'FAILED'}</span>`;
document.getElementById('task_detail').innerHTML = `
<div style="color:#cbd5e1; margin-bottom:8px;"><strong>Stage-1 Prompt:</strong> ${t.q1} (Gold: <code>${t.gold1}</code>)</div>
<table>
<thead><tr><th>Policy</th><th>Stage-1 Commit</th><th>2-Stage Latency</th><th>Workflow Outcome</th></tr></thead>
<tbody>
<tr><td>Fast k-of-N</td><td><code>${t.fast_c}</code></td><td>${t.fast_t.toFixed(2)}s</td><td>${b(t.fast_ok)}</td></tr>
<tr><td>Genealogy Sync (HPR)</td><td><code>${t.qg_c}</code></td><td>${t.sync_t.toFixed(2)}s</td><td>${b(t.sync_ok)}</td></tr>
<tr><td><strong>QuorumGuard</strong></td><td><code>${t.qg_c}</code></td><td><strong>${t.qg_t.toFixed(2)}s</strong></td><td>${b(t.qg_ok)}</td></tr>
</tbody>
</table>`;
}
sel.addEventListener('change', renderTask);
renderTask();
</script>
</body>
</html>