geudrik's picture
download
raw
46.5 kB
"""Disjoint 12-case held-out validation suite for Clairic 27B on SM120.
Designed for out-of-sample evaluation strictly disjoint from both PTQ calibration
(`quantize_nvfp4_mixed.py`) and layer-map selection (`workload_suite.py`):
- 12 cases across pharmaceutical quality control, cross-border customs, semiconductor wafer
testing, auto-repair thermal receipt scan, municipal utility bill scan, 2-page Engineering
Change Order scan, power-grid telemetry, SaaS cohort finance, freight Bill of Lading hybrid
scan, bioreactor batch log, non-repetitive 18-event database postmortem, and SIEM alert routing.
- Every image is unique (never reused across cases) and rendered with deterministic scan
artifacts: off-white paper background, rotation skew (`-1.4°` to `+1.6°`), pixel grain noise,
and JPEG lossy compression (`quality` 72–78).
- Complete ground-truth `expected_all` annotations cover every deterministic scalar, null,
list, and object-list field; `options.include_quantiles = True` exercises quantile calibration
on all `estimate` and `forecast` fields.
"""
from __future__ import annotations
import base64
import io
import random
from typing import Any
from PIL import Image, ImageDraw, ImageFont
def _font(size: int = 20, bold: bool = False, mono: bool = False) -> Any:
if mono:
candidates = [
"/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf"
if bold
else "/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf",
"/usr/share/fonts/truetype/liberation/LiberationMono-Bold.ttf"
if bold
else "/usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf",
]
elif bold:
candidates = [
"/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf",
"/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf",
]
else:
candidates = [
"/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf",
"/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf",
]
for path in candidates:
try:
return ImageFont.truetype(path, size=size)
except OSError:
continue
try:
return ImageFont.load_default(size=size)
except TypeError:
return ImageFont.load_default()
def _degraded_jpeg_uri(
img: Image.Image,
*,
angle_deg: float,
jpeg_quality: int,
seed: int,
bg_rgb: tuple[int, int, int] = (247, 245, 240),
) -> str:
"""Apply deterministic scan skew, pixel grain noise, and JPEG recompression."""
rng = random.Random(seed)
rotated = img.rotate(angle_deg, resample=Image.Resampling.BICUBIC, expand=False, fillcolor=bg_rgb)
raw = bytearray(rotated.tobytes())
# Apply deterministic scan speckle/grain across pixel channels
step = 17
for idx in range(0, len(raw), step):
delta = rng.randint(-14, 14)
v = raw[idx] + delta
raw[idx] = 0 if v < 0 else (255 if v > 255 else v)
noisy = Image.frombytes("RGB", rotated.size, bytes(raw))
buf = io.BytesIO()
noisy.save(buf, format="JPEG", quality=jpeg_quality, subsampling=2)
return "data:image/jpeg;base64," + base64.b64encode(buf.getvalue()).decode("ascii")
def render_auto_repair_scan() -> str:
bg = (246, 244, 238)
img = Image.new("RGB", (800, 1020), bg)
d = ImageDraw.Draw(img)
f_title = _font(28, bold=True, mono=True)
f_head = _font(21, bold=True, mono=True)
f_body = _font(19, bold=False, mono=True)
y = 42
d.text((145, y), "CASCADIA DRIVELINE SERVICE", fill=(20, 20, 22), font=f_title)
y += 40
d.text((175, y), "2910 SE Powell Blvd, Portland, OR 97202", fill=(30, 30, 32), font=f_body)
y += 32
d.text((60, y), "Work Order: WO-88310", fill=(20, 20, 22), font=f_head)
d.text((450, y), "Completed: 2026-08-19", fill=(20, 20, 22), font=f_body)
y += 32
d.text((60, y), "Vehicle: 2022 Subaru Outback | Mileage: 48,215", fill=(30, 30, 32), font=f_body)
y += 36
d.line((55, y, 745, y), fill=(40, 40, 40), width=2)
y += 16
d.text((60, y), "SERVICE / PART", fill=(20, 20, 22), font=f_head)
d.text((485, y), "QTY", fill=(20, 20, 22), font=f_head)
d.text((610, y), "CHARGE", fill=(20, 20, 22), font=f_head)
y += 32
d.line((55, y, 745, y), fill=(60, 60, 60), width=1)
y += 18
items = [
("CVT Fluid Drain & Fill", "1", "215.00"),
("Front Ceramic Brake Pads", "1", "164.50"),
("Synthetic 0W-20 Oil Quart", "5", "47.50"),
("Cabin HEPA Filter", "1", "38.00"),
]
for desc, qty, amt in items:
d.text((60, y), desc, fill=(25, 25, 25), font=f_body)
d.text((500, y), qty, fill=(25, 25, 25), font=f_body)
d.text((615, y), f"${amt}", fill=(25, 25, 25), font=f_body)
y += 38
y += 16
d.line((55, y, 745, y), fill=(40, 40, 40), width=2)
y += 22
d.text((430, y), "Parts & Labor:", fill=(25, 25, 25), font=f_body)
d.text((615, y), "$465.00", fill=(25, 25, 25), font=f_body)
y += 34
d.text((430, y), "Shop Disposal Fee:", fill=(25, 25, 25), font=f_body)
d.text((615, y), "$14.25", fill=(25, 25, 25), font=f_body)
y += 38
d.text((430, y), "BALANCE PAID:", fill=(15, 15, 15), font=f_head)
d.text((610, y), "$479.25", fill=(15, 15, 15), font=f_head)
y += 50
d.text((60, y), "Warranty: 24 Months / 24,000 Miles Parts & Labor", fill=(30, 30, 32), font=f_body)
return _degraded_jpeg_uri(img, angle_deg=1.55, jpeg_quality=72, seed=1004, bg_rgb=bg)
def render_utility_statement_scan() -> str:
bg = (248, 247, 242)
img = Image.new("RGB", (840, 980), bg)
d = ImageDraw.Draw(img)
f_title = _font(28, bold=True)
f_head = _font(21, bold=True)
f_body = _font(19, bold=False)
d.text((60, 45), "FRONTIER MUNICIPAL POWER & LIGHT", fill=(18, 24, 32), font=f_title)
d.text((60, 88), "Account Number: FMP-440918-7", fill=(25, 25, 25), font=f_head)
d.text((490, 88), "Statement Date: 2026-09-28", fill=(25, 25, 25), font=f_body)
d.text((60, 122), "Service Address: 814 Sycamore Ridge Rd, Boise, ID 83702", fill=(25, 25, 25), font=f_body)
d.text((60, 154), "Due Date: 2026-10-19", fill=(25, 25, 25), font=f_head)
d.line((60, 192, 780, 192), fill=(30, 30, 30), width=2)
d.text((60, 215), "ELECTRIC METER SUMMARY (Meter #EM-90241)", fill=(18, 24, 32), font=f_head)
d.text((60, 252), "Previous Reading: 41,280 kWh", fill=(30, 30, 30), font=f_body)
d.text((60, 284), "Present Reading: 42,195 kWh", fill=(30, 30, 30), font=f_body)
d.text((60, 316), "Billed Usage: 915 kWh", fill=(18, 24, 32), font=f_head)
d.line((60, 360, 780, 360), fill=(80, 80, 80), width=1)
d.text((60, 385), "Energy Charge (915 kWh @ $0.1120):", fill=(30, 30, 30), font=f_body)
d.text((635, 385), "$102.48", fill=(30, 30, 30), font=f_body)
d.text((60, 420), "Grid Reliability Rider:", fill=(30, 30, 30), font=f_body)
d.text((635, 420), "$16.50", fill=(30, 30, 30), font=f_body)
d.text((60, 455), "Municipal Franchise Tax:", fill=(30, 30, 30), font=f_body)
d.text((635, 455), "$4.76", fill=(30, 30, 30), font=f_body)
d.line((60, 495, 780, 495), fill=(30, 30, 30), width=2)
d.text((60, 520), "TOTAL AMOUNT DUE:", fill=(15, 15, 15), font=f_head)
d.text((630, 520), "$123.74", fill=(15, 15, 15), font=f_head)
d.text((60, 580), "AutoPay Status: ENROLLED (Bank Draft on Due Date)", fill=(25, 25, 25), font=f_body)
return _degraded_jpeg_uri(img, angle_deg=-1.35, jpeg_quality=75, seed=1005, bg_rgb=bg)
def render_eco_two_pages_scan() -> list[str]:
bg = (247, 246, 241)
f_title = _font(28, bold=True)
f_head = _font(21, bold=True)
f_body = _font(19, bold=False)
p1 = Image.new("RGB", (900, 1080), bg)
d1 = ImageDraw.Draw(p1)
d1.text((60, 45), "ENGINEERING CHANGE ORDER", fill=(15, 15, 20), font=f_title)
d1.text((555, 50), "ECO Number: ECO-2026-319A", fill=(15, 15, 20), font=f_head)
d1.text((555, 84), "Effective Date: 2026-11-12", fill=(25, 25, 25), font=f_body)
d1.text((555, 114), "Sheet 1 of 2", fill=(25, 25, 25), font=f_body)
d1.line((60, 155, 840, 155), fill=(30, 30, 30), width=2)
d1.text((60, 180), "Originating Division: Avionics Power Systems", fill=(25, 25, 25), font=f_body)
d1.text((60, 214), "Change Severity: MANDATORY", fill=(15, 15, 20), font=f_head)
d1.text((60, 248), "Reason: Upgrade DC bus transient suppression diodes to AEC-Q101 rev D.", fill=(25, 25, 25), font=f_body)
d1.line((60, 295, 840, 295), fill=(30, 30, 30), width=2)
d1.text((60, 318), "PART NUMBER", fill=(15, 15, 20), font=f_head)
d1.text((310, 318), "ASSEMBLY DESCRIPTION", fill=(15, 15, 20), font=f_head)
d1.text((710, 318), "NEW REV", fill=(15, 15, 20), font=f_head)
d1.line((60, 350, 840, 350), fill=(70, 70, 70), width=1)
rows_p1 = [
("APS-4100-PCB", "28V Primary Bus Regulator Board", "Rev E"),
("APS-4122-HAR", "Shielded Telemetry Harness", "Rev C"),
]
y = 376
for pn, desc, rev in rows_p1:
d1.text((60, y), pn, fill=(25, 25, 25), font=f_body)
d1.text((310, y), desc, fill=(25, 25, 25), font=f_body)
d1.text((725, y), rev, fill=(25, 25, 25), font=f_body)
y += 44
d1.text((60, 960), "Continued on Sheet 2...", fill=(35, 35, 35), font=f_body)
p2 = Image.new("RGB", (900, 1080), bg)
d2 = ImageDraw.Draw(p2)
d2.text((60, 45), "ENGINEERING CHANGE ORDER (CONTINUED)", fill=(15, 15, 20), font=f_head)
d2.text((555, 45), "ECO Number: ECO-2026-319A", fill=(15, 15, 20), font=f_head)
d2.text((555, 78), "Sheet 2 of 2", fill=(25, 25, 25), font=f_body)
d2.line((60, 120, 840, 120), fill=(30, 30, 30), width=2)
d2.text((60, 148), "PART NUMBER", fill=(15, 15, 20), font=f_head)
d2.text((310, 148), "ASSEMBLY DESCRIPTION", fill=(15, 15, 20), font=f_head)
d2.text((710, 148), "NEW REV", fill=(15, 15, 20), font=f_head)
d2.line((60, 180, 840, 180), fill=(70, 70, 70), width=1)
d2.text((60, 206), "APS-4190-ENC", fill=(25, 25, 25), font=f_body)
d2.text((310, 206), "Milled Aluminum EMI Enclosure", fill=(25, 25, 25), font=f_body)
d2.text((725, 206), "Rev B", fill=(25, 25, 25), font=f_body)
d2.line((60, 290, 840, 290), fill=(30, 30, 30), width=2)
d2.text((60, 322), "Field Stock Disposition: REWORK EXISTING INVENTORY", fill=(25, 25, 25), font=f_body)
d2.text((60, 362), "Non-Recurring Tooling Cost (USD): $14,650.00", fill=(15, 15, 20), font=f_head)
d2.text((60, 402), "FAA Recertification Required: Yes", fill=(25, 25, 25), font=f_body)
d2.text((60, 460), "Approved By: Dr. Henrik Lindqvist, VP Hardware Quality", fill=(25, 25, 25), font=f_body)
return [
_degraded_jpeg_uri(p1, angle_deg=1.10, jpeg_quality=78, seed=10061, bg_rgb=bg),
_degraded_jpeg_uri(p2, angle_deg=-0.95, jpeg_quality=78, seed=10062, bg_rgb=bg),
]
def render_freight_bol_scan() -> str:
bg = (245, 243, 237)
img = Image.new("RGB", (840, 920), bg)
d = ImageDraw.Draw(img)
f_title = _font(28, bold=True)
f_head = _font(21, bold=True)
f_body = _font(19, bold=False)
d.text((60, 42), "STRAIGHT BILL OF LADING", fill=(20, 20, 20), font=f_title)
d.text((515, 48), "BOL #: BOL-77419-NW", fill=(20, 20, 20), font=f_head)
d.text((515, 82), "Ship Date: 2026-10-27", fill=(25, 25, 25), font=f_body)
d.line((60, 125, 780, 125), fill=(30, 30, 30), width=2)
d.text((60, 150), "Carrier: Olympic Refrigerated Freight Inc.", fill=(25, 25, 25), font=f_body)
d.text((60, 184), "Origin: Yakima, WA | Destination: Denver, CO", fill=(25, 25, 25), font=f_body)
d.text((60, 218), "Total Pallets: 18", fill=(20, 20, 20), font=f_head)
d.text((60, 252), "Gross Lading Weight: 31,400 lbs", fill=(20, 20, 20), font=f_head)
d.text((60, 286), "Hazardous Materials (DOT): NO", fill=(25, 25, 25), font=f_body)
d.text((60, 320), "Linehaul Freight Charge: $3,420.00", fill=(20, 20, 20), font=f_head)
return _degraded_jpeg_uri(img, angle_deg=1.25, jpeg_quality=74, seed=1009, bg_rgb=bg)
def _build_non_repetitive_postmortem() -> str:
events = [
("02:14 UTC", "eu-frankfurt-1", "Primary WAL disk latency rose from 1.8 ms to 19.4 ms on node pg-prod-07 during scheduled NVMe firmware telemetry polling."),
("02:19 UTC", "eu-frankfurt-1", "Synchronous replica pg-prod-08 lagged by 412 MB of WAL segments as checkpoint flushing throttled write IOPS."),
("02:24 UTC", "eu-frankfurt-1", "Connection pooler pgbouncer-eu-02 reached 4,800 active server connections; checkout wait exceeded 650 ms for checkout-api."),
("02:29 UTC", "us-east-va", "Cross-region webhook relay queued 18,400 delivery notifications awaiting European ledger confirmation."),
("02:33 UTC", "eu-frankfurt-1", "Automated Patroni health probe observed leader lease renewal jitter of 4.2 seconds but held failover because quorum witness remained reachable."),
("02:38 UTC", "eu-frankfurt-1", "On-call database engineer paged via alert DB-WAL-904 and disabled background SMART extended self-test on array nvme3n1."),
("02:44 UTC", "eu-frankfurt-1", "Write latency initially dropped to 6.1 ms before secondary compaction storm started on analytics materialized view mv_hourly_settlement."),
("02:49 UTC", "eu-frankfurt-1", "API gateway shed 1,920 non-critical reporting queries under HTTP 429 while preserving payment authorization traffic."),
("02:55 UTC", "eu-frankfurt-1", "Operator executed controlled switchover from pg-prod-07 to replica pg-prod-08; leader transition completed in 8.5 seconds."),
("03:02 UTC", "eu-frankfurt-1", "pgbouncer pools drained stale sockets and re-established 2,150 TLS backend sessions against new primary pg-prod-08."),
("03:09 UTC", "us-east-va", "Webhook backlog drained from 18,400 to 6,100 messages at 29.3 deliveries per second with zero dead-letter drops."),
("03:16 UTC", "eu-frankfurt-1", "Isolated former primary pg-prod-07 revealed drive firmware version 2.14.0-rc1 regression under queue depth > 64."),
("03:24 UTC", "eu-frankfurt-1", "Storage fleet audit identified 5 sibling bare-metal hosts running firmware 2.14.0-rc1 across Frankfurt and Amsterdam."),
("03:33 UTC", "eu-amsterdam-1", "Preventive traffic drain completed on ams-pg-03 before pinning NVMe queue depth cap to 32 via udev rule."),
("03:41 UTC", "global-finops", "SLA impact ledger calculated $18,750.00 in contractual credits for Frankfurt enterprise tier and $6,450.00 for Amsterdam merchant tier."),
("03:50 UTC", "eu-frankfurt-1", "Replica pg-prod-07 rebuilt cleanly on downgraded stable firmware 2.12.6 and rejoined cluster as async standby."),
("04:01 UTC", "global-sre", "All regional error rates returned below 0.01% baseline; incident INC-2026-1108 downgraded from SEV-1 to RESOLVED."),
("04:15 UTC", "global-sre", "Action items filed: block RC storage firmware in production Ansible role and cap MV refresh concurrency to 2 workers."),
]
header = (
"CLOUD DATABASE INCIDENT POSTMORTEM — INC-2026-1108\n"
"Author: Astrid Lindholm (Principal SRE, Ledger Storage)\n"
"Incident Date: 2026-11-08\n"
"Final Severity Classification: SEV-1\n"
"Data Loss Confirmed: ZEROBYTES (0 transactions lost)\n"
"Monthly SEV-1/SEV-2 storage incidents over past 6 months: 6, 5, 5, 4, 3, 3.\n\n"
"DETAILED CHRONOLOGY:\n"
)
body = "\n\n".join(
f"[{idx:02d}] {ts} ({loc}): {txt} Verification checksum tag TL-{100 + idx * 7} recorded in immutable audit store."
for idx, (ts, loc, txt) in enumerate(events, start=1)
)
return header + body
def build_heldout_suite() -> list[dict[str, Any]]:
auto_uri = render_auto_repair_scan()
util_uri = render_utility_statement_scan()
eco_uris = render_eco_two_pages_scan()
bol_uri = render_freight_bol_scan()
postmortem_text = _build_non_repetitive_postmortem()
return [
{
"id": "ho01_clinical_coa_text",
"category": "ar_pharma_coa_scalars_null_and_list",
"request": {
"state": (
"CERTIFICATE OF ANALYSIS — Document ID: COA-2026-9914\n"
"Manufacturer: Veridian Biologics GmbH\n"
"Lot Number: VB-L8842 | Release Date: 2026-07-15 | Retest Date: 2028-07-15\n"
"Active Ingredient: Trehalose Dihydrate USP\n"
"HPLC Purity Assay: 99.64%\n"
"Endotoxin Result: PASS (< 0.05 EU/mg)\n"
"Batch Disposition: APPROVED\n"
"Analytical Methods Executed:\n"
"- USP <621> Chromatography\n"
"- USP <85> Bacterial Endotoxins\n"
"- USP <731> Loss on Drying\n"
"- Karl Fischer Titration"
),
"fields": {
"coa_id": {"type": "text", "instructions": "Certificate of Analysis document ID."},
"manufacturer": {"type": "text", "instructions": "Issuing manufacturer name."},
"lot_number": {"type": "text", "instructions": "Batch or lot number."},
"release_date": {"type": "date", "instructions": "Printed release date."},
"purity_percent": {"type": "number", "decimals": 2, "source_only": True, "instructions": "HPLC purity percentage numeric value."},
"endotoxin_passed": {"type": "boolean", "instructions": "Did the batch pass endotoxin testing?"},
"disposition": {"type": "enum", "enum": ["APPROVED", "QUARANTINED", "REJECTED"], "instructions": "Batch disposition."},
"dea_schedule": {"type": "text", "instructions": "Controlled substance DEA schedule if stated on certificate."},
"methods": {
"type": "list",
"items": "text",
"instructions": "Analytical methods executed in listed order.",
},
},
},
"expected": {
"coa_id": "COA-2026-9914",
"manufacturer": "Veridian Biologics GmbH",
"lot_number": "VB-L8842",
"release_date": "2026-07-15",
"purity_percent": 99.64,
"endotoxin_passed": True,
"disposition": "APPROVED",
"dea_schedule": None,
"methods": [
"USP <621> Chromatography",
"USP <85> Bacterial Endotoxins",
"USP <731> Loss on Drying",
"Karl Fischer Titration",
],
},
"expected_all": {
"coa_id": "COA-2026-9914",
"manufacturer": "Veridian Biologics GmbH",
"lot_number": "VB-L8842",
"release_date": "2026-07-15",
"purity_percent": 99.64,
"endotoxin_passed": True,
"disposition": "APPROVED",
"dea_schedule": None,
"methods": [
"USP <621> Chromatography",
"USP <85> Bacterial Endotoxins",
"USP <731> Loss on Drying",
"Karl Fischer Titration",
],
},
},
{
"id": "ho02_customs_commercial_invoice",
"category": "ar_customs_table_objects_and_null",
"request": {
"state": (
"COMMERCIAL EXPORT DECLARATION — Decl #: EXP-DE-55201\n"
"Exporter: Rheinmetall Sensorik AG\n"
"Incoterm: DAP Rotterdam\n"
"Export Date: 2026-09-18\n\n"
"| HS Code | Commodity | Cartons | Declared EUR |\n"
"|---|---|---|---|\n"
"| 9031.80 | Laser Interferometer Heads | 6 | 28800.00 |\n"
"| 8504.40 | Low-Noise DC Power Supplies | 12 | 9600.00 |\n"
"| 9002.19 | Fused Silica Collimators | 20 | 15400.00 |\n"
),
"fields": {
"declaration_id": {"type": "text", "instructions": "Export declaration identifier."},
"exporter": {"type": "text", "instructions": "Exporter company name."},
"export_date": {"type": "date", "instructions": "Printed export date."},
"customs_broker_license": {"type": "text", "instructions": "Licensed customs broker number if printed."},
"tariff_lines": {
"type": "list",
"items": {
"type": "object",
"properties": {
"hs_code": {"type": "text", "instructions": "HS tariff code."},
"cartons": {"type": "number", "integer": True, "instructions": "Number of cartons."},
"declared_eur": {"type": "number", "decimals": 2, "instructions": "Declared EUR value."},
},
},
"instructions": "Extract each tariff line row in table order.",
},
},
},
"expected": {
"declaration_id": "EXP-DE-55201",
"exporter": "Rheinmetall Sensorik AG",
"export_date": "2026-09-18",
"customs_broker_license": None,
"tariff_lines": [
{"hs_code": "9031.80", "cartons": 6, "declared_eur": 28800.0},
{"hs_code": "8504.40", "cartons": 12, "declared_eur": 9600.0},
{"hs_code": "9002.19", "cartons": 20, "declared_eur": 15400.0},
],
},
"expected_all": {
"declaration_id": "EXP-DE-55201",
"exporter": "Rheinmetall Sensorik AG",
"export_date": "2026-09-18",
"customs_broker_license": None,
"tariff_lines": [
{"hs_code": "9031.80", "cartons": 6, "declared_eur": 28800.0},
{"hs_code": "8504.40", "cartons": 12, "declared_eur": 9600.0},
{"hs_code": "9002.19", "cartons": 20, "declared_eur": 15400.0},
],
},
},
{
"id": "ho03_semiconductor_wafer_lot",
"category": "ar_fab_wafer_scalars_and_list",
"request": {
"state": (
"WAFER ACCEPTANCE TEST REPORT — Fab 4 Dresden\n"
"Lot ID: WFR-2026-7109 | Technology Node: 22FDX\n"
"Test Date: 2026-10-22\n"
"Wafers Tested: 25 | Gross Good Die Count: 18,450\n"
"Median PMOS Vt Shift: -14.8 mV\n"
"Parametric Yield: 96.82%\n"
"Hold Triggered: No\n"
"Top Failing Bin Codes: BIN07_IDDQ, BIN12_SRAM_VMIN, BIN19_RINGOSC"
),
"fields": {
"lot_id": {"type": "text", "instructions": "Wafer lot identifier."},
"tech_node": {"type": "text", "instructions": "Process technology node."},
"test_date": {"type": "date", "instructions": "Printed test date."},
"good_die_count": {"type": "number", "integer": True, "source_only": True, "instructions": "Gross good die count."},
"pmos_vt_shift_mv": {"type": "number", "decimals": 1, "source_only": True, "instructions": "Median PMOS Vt shift in mV (preserve sign)."},
"parametric_yield": {"type": "number", "decimals": 2, "source_only": True, "instructions": "Parametric yield percentage."},
"on_hold": {"type": "boolean", "instructions": "Was a lot hold triggered?"},
"failing_bins": {
"type": "list",
"items": "text",
"instructions": "Failing bin codes in listed order.",
},
},
},
"expected": {
"lot_id": "WFR-2026-7109",
"tech_node": "22FDX",
"test_date": "2026-10-22",
"good_die_count": 18450,
"pmos_vt_shift_mv": -14.8,
"parametric_yield": 96.82,
"on_hold": False,
"failing_bins": ["BIN07_IDDQ", "BIN12_SRAM_VMIN", "BIN19_RINGOSC"],
},
"expected_all": {
"lot_id": "WFR-2026-7109",
"tech_node": "22FDX",
"test_date": "2026-10-22",
"good_die_count": 18450,
"pmos_vt_shift_mv": -14.8,
"parametric_yield": 96.82,
"on_hold": False,
"failing_bins": ["BIN07_IDDQ", "BIN12_SRAM_VMIN", "BIN19_RINGOSC"],
},
},
{
"id": "ho04_scan_thermal_receipt_image",
"category": "multimodal_noisy_skewed_jpeg_receipt",
"request": {
"state": "Extract the shop details, completion date, totals, and billed line items from the scanned work order receipt.",
"images": [auto_uri],
"fields": {
"shop_name": {"type": "text", "instructions": "Repair shop name at top of work order."},
"work_order": {"type": "text", "instructions": "Work order identifier."},
"completed_date": {"type": "date", "instructions": "Completed date printed on work order."},
"parts_and_labor": {"type": "number", "decimals": 2, "source_only": True, "instructions": "Parts & Labor subtotal."},
"disposal_fee": {"type": "number", "decimals": 2, "source_only": True, "instructions": "Shop disposal fee."},
"balance_paid": {"type": "number", "decimals": 2, "source_only": True, "instructions": "Final balance paid."},
"services": {
"type": "list",
"items": {
"type": "object",
"properties": {
"description": {"type": "text", "instructions": "Service or part name."},
"qty": {"type": "number", "integer": True, "instructions": "Quantity."},
"charge": {"type": "number", "decimals": 2, "instructions": "Dollar charge."},
},
},
"instructions": "All billed service and part rows in order.",
},
},
},
"expected": {
"shop_name": "CASCADIA DRIVELINE SERVICE",
"work_order": "WO-88310",
"completed_date": "2026-08-19",
"parts_and_labor": 465.00,
"disposal_fee": 14.25,
"balance_paid": 479.25,
"services": [
{"description": "CVT Fluid Drain & Fill", "qty": 1, "charge": 215.0},
{"description": "Front Ceramic Brake Pads", "qty": 1, "charge": 164.5},
{"description": "Synthetic 0W-20 Oil Quart", "qty": 5, "charge": 47.5},
{"description": "Cabin HEPA Filter", "qty": 1, "charge": 38.0},
],
},
"expected_all": {
"shop_name": "CASCADIA DRIVELINE SERVICE",
"work_order": "WO-88310",
"completed_date": "2026-08-19",
"parts_and_labor": 465.00,
"disposal_fee": 14.25,
"balance_paid": 479.25,
"services": [
{"description": "CVT Fluid Drain & Fill", "qty": 1, "charge": 215.0},
{"description": "Front Ceramic Brake Pads", "qty": 1, "charge": 164.5},
{"description": "Synthetic 0W-20 Oil Quart", "qty": 5, "charge": 47.5},
{"description": "Cabin HEPA Filter", "qty": 1, "charge": 38.0},
],
},
},
{
"id": "ho05_scan_utility_statement_image",
"category": "multimodal_noisy_skewed_jpeg_utility",
"request": {
"state": "Scanned electric utility statement.",
"images": [util_uri],
"fields": {
"utility_provider": {"type": "text", "instructions": "Utility provider name."},
"account_number": {"type": "text", "instructions": "Customer account number."},
"statement_date": {"type": "date", "instructions": "Printed statement date."},
"due_date": {"type": "date", "instructions": "Payment due date."},
"billed_kwh": {"type": "number", "integer": True, "source_only": True, "instructions": "Billed electricity usage in kWh."},
"amount_due": {"type": "number", "decimals": 2, "source_only": True, "instructions": "Total amount due in dollars."},
"autopay_enrolled": {"type": "boolean", "instructions": "Is the account enrolled in AutoPay?"},
},
},
"expected": {
"utility_provider": "FRONTIER MUNICIPAL POWER & LIGHT",
"account_number": "FMP-440918-7",
"statement_date": "2026-09-28",
"due_date": "2026-10-19",
"billed_kwh": 915,
"amount_due": 123.74,
"autopay_enrolled": True,
},
"expected_all": {
"utility_provider": "FRONTIER MUNICIPAL POWER & LIGHT",
"account_number": "FMP-440918-7",
"statement_date": "2026-09-28",
"due_date": "2026-10-19",
"billed_kwh": 915,
"amount_due": 123.74,
"autopay_enrolled": True,
},
},
{
"id": "ho06_two_page_eco_images",
"category": "multimodal_two_page_noisy_eco",
"request": {
"state": "Two-page scanned Engineering Change Order.",
"images": eco_uris,
"fields": {
"eco_number": {"type": "text", "instructions": "Engineering Change Order identifier."},
"effective_date": {"type": "date", "instructions": "Printed effective date."},
"severity": {"type": "enum", "enum": ["OPTIONAL", "RECOMMENDED", "MANDATORY"], "instructions": "Change severity."},
"tooling_cost": {"type": "number", "decimals": 2, "source_only": True, "instructions": "Non-recurring tooling cost in USD on sheet 2."},
"faa_recert_required": {"type": "boolean", "instructions": "Is FAA recertification required?"},
"approver": {"type": "text", "instructions": "Person who approved the ECO on sheet 2 (name only or name with title as printed)."},
"part_numbers": {
"type": "list",
"items": "text",
"instructions": "All affected part numbers across both sheets in order.",
},
},
},
"expected": {
"eco_number": "ECO-2026-319A",
"effective_date": "2026-11-12",
"severity": "MANDATORY",
"tooling_cost": 14650.00,
"faa_recert_required": True,
"part_numbers": ["APS-4100-PCB", "APS-4122-HAR", "APS-4190-ENC"],
},
"expected_all": {
"eco_number": "ECO-2026-319A",
"effective_date": "2026-11-12",
"severity": "MANDATORY",
"tooling_cost": 14650.00,
"faa_recert_required": True,
"part_numbers": ["APS-4100-PCB", "APS-4122-HAR", "APS-4190-ENC"],
},
},
{
"id": "ho07_head_energy_grid_telemetry",
"category": "clairic_head_grid_compute_forecast",
"request": {
"state": (
"Substation North-7 dispatch telemetry (2026-11-15):\n"
"- Gross wind generation: 410 MW\n"
"- Gross solar generation: 185 MW\n"
"- Pumped-hydro auxiliary station draw: 45 MW\n"
"- Curtailment losses: 20 MW\n"
"- Scheduled transformer tap maintenance window: 3 hours 45 minutes\n"
"- Observed substation peak load over the past 6 hours (MW): 460, 472, 485, 498, 510, 522."
),
"reference_date": "2026-11-15",
"fields": {
"net_deliverable_mw": {
"type": "compute",
"decimals": 0,
"instructions": "Compute net deliverable generation in MW: wind + solar - auxiliary draw - curtailment losses.",
},
"net_losses_and_draw_mw": {
"type": "compute",
"decimals": 0,
"instructions": "Compute combined auxiliary draw plus curtailment losses in MW.",
},
"maintenance_minutes": {
"type": "duration",
"unit": "minutes",
"instructions": "Scheduled transformer maintenance window in minutes.",
},
"next_hour_load_mw": {
"type": "estimate",
"min": 400,
"max": 650,
"instructions": "Estimated substation peak load in the next hour (MW).",
},
"four_hour_load_forecast": {
"type": "forecast",
"min": 400,
"max": 680,
"horizon": 4,
"interval": "hour",
"instructions": "Forecast substation peak load (MW) for the next 4 hours.",
},
},
"options": {"include_quantiles": True},
},
"expected": {
"net_deliverable_mw": 530,
"net_losses_and_draw_mw": 65,
"maintenance_minutes": 225,
},
"expected_all": {
"net_deliverable_mw": 530,
"net_losses_and_draw_mw": 65,
"maintenance_minutes": 225,
},
},
{
"id": "ho08_head_saas_cohort_finance",
"category": "clairic_head_finance_compute_forecast",
"request": {
"state": (
"Enterprise Cohort Q3-2026 Ledger:\n"
"- Starting cohort ARR: $4,800,000\n"
"- Expansion upsells booked: $920,000\n"
"- Contraction downgrades: $180,000\n"
"- Churned ARR: $340,000\n"
"- Median enterprise onboarding duration: 2 days 12 hours\n"
"- Historical monthly net new ARR ($K) over last 6 months: 310, 325, 340, 355, 370, 385."
),
"reference_date": "2026-10-01",
"fields": {
"ending_cohort_arr": {
"type": "compute",
"decimals": 0,
"instructions": "Compute ending cohort ARR: starting + expansion - contraction - churned.",
},
"net_arr_delta": {
"type": "compute",
"decimals": 0,
"instructions": "Compute net ARR change: expansion - contraction - churned.",
},
"onboarding_hours": {
"type": "duration",
"unit": "hours",
"instructions": "Median enterprise onboarding duration in hours.",
},
"next_month_net_new_k": {
"type": "estimate",
"min": 250,
"max": 500,
"instructions": "Estimated next-month net new ARR ($K).",
},
"three_month_net_new_forecast": {
"type": "forecast",
"min": 250,
"max": 520,
"horizon": 3,
"interval": "month",
"instructions": "Forecast monthly net new ARR ($K) for the next 3 months.",
},
},
"options": {"include_quantiles": True},
},
"expected": {
"ending_cohort_arr": 5200000,
"net_arr_delta": 400000,
"onboarding_hours": 60,
},
"expected_all": {
"ending_cohort_arr": 5200000,
"net_arr_delta": 400000,
"onboarding_hours": 60,
},
},
{
"id": "ho09_hybrid_freight_bol_image_and_head",
"category": "hybrid_noisy_bol_image_ar_plus_head",
"request": {
"state": (
"Dispatch trailer weight cap is 44,000 lbs gross lading. "
"Recent Yakima-to-Denver reefer linehaul spot rates ($): 3180, 3260, 3340, 3420."
),
"images": [bol_uri],
"fields": {
"bol_number": {"type": "text", "instructions": "Bill of Lading number on scan."},
"carrier": {"type": "text", "instructions": "Carrier company name on scan."},
"pallet_count": {"type": "number", "integer": True, "source_only": True, "instructions": "Total pallets on scan."},
"hazmat": {"type": "boolean", "instructions": "Does the shipment contain DOT hazardous materials?"},
"remaining_weight_lbs": {
"type": "compute",
"decimals": 0,
"instructions": "Compute remaining trailer weight capacity in lbs (44,000 minus gross lading weight on scan).",
},
"next_load_spot_rate": {
"type": "estimate",
"min": 2800,
"max": 4200,
"instructions": "Estimated spot rate ($) for the next Yakima-to-Denver load.",
},
},
"options": {"include_quantiles": True},
},
"expected": {
"bol_number": "BOL-77419-NW",
"carrier": "Olympic Refrigerated Freight Inc.",
"pallet_count": 18,
"hazmat": False,
"remaining_weight_lbs": 12600,
},
"expected_all": {
"bol_number": "BOL-77419-NW",
"carrier": "Olympic Refrigerated Freight Inc.",
"pallet_count": 18,
"hazmat": False,
"remaining_weight_lbs": 12600,
},
},
{
"id": "ho10_hybrid_lab_log_and_head",
"category": "hybrid_text_ar_plus_clairic_head",
"request": {
"state": (
"Bioreactor Run Log — Batch ID: FERM-2026-118\n"
"Host Strain: CHO-K1 Clone 14B\n"
"Run Start Date: 2026-10-09\n"
"Inoculation Titer: 0.45 g/L | Harvest Titer: 6.85 g/L\n"
"Fed-Batch Hold Phase Duration: 4 hours 15 minutes\n"
"Sterility / Contamination Detected: None (Sterile)\n"
"Historical harvest titers across last 5 runs (g/L): 5.9, 6.1, 6.4, 6.6, 6.85."
),
"reference_date": "2026-10-09",
"fields": {
"batch_id": {"type": "text", "instructions": "Bioreactor batch ID."},
"host_strain": {"type": "text", "instructions": "Host cell line strain."},
"start_date": {"type": "date", "instructions": "Run start date."},
"contamination_detected": {"type": "boolean", "instructions": "Was any contamination detected?"},
"manual_override_code": {"type": "text", "instructions": "Operator manual override authorization code if recorded."},
"net_titer_gain_gl": {
"type": "compute",
"decimals": 2,
"instructions": "Compute net titer gain in g/L (harvest titer minus inoculation titer).",
},
"hold_phase_minutes": {
"type": "duration",
"unit": "minutes",
"instructions": "Fed-batch hold phase duration in minutes.",
},
"next_run_harvest_titer": {
"type": "estimate",
"min": 4.0,
"max": 9.0,
"instructions": "Estimated harvest titer (g/L) for the next bioreactor run.",
},
},
"options": {"include_quantiles": True},
},
"expected": {
"batch_id": "FERM-2026-118",
"host_strain": "CHO-K1 Clone 14B",
"start_date": "2026-10-09",
"contamination_detected": False,
"manual_override_code": None,
"net_titer_gain_gl": 6.40,
"hold_phase_minutes": 255,
},
"expected_all": {
"batch_id": "FERM-2026-118",
"host_strain": "CHO-K1 Clone 14B",
"start_date": "2026-10-09",
"contamination_detected": False,
"manual_override_code": None,
"net_titer_gain_gl": 6.40,
"hold_phase_minutes": 255,
},
},
{
"id": "ho11_long_incident_postmortem",
"category": "long_non_repetitive_ar_plus_head",
"request": {
"state": postmortem_text,
"fields": {
"incident_id": {"type": "text", "instructions": "Incident identifier."},
"incident_date": {"type": "date", "instructions": "Printed incident date."},
"webhook_backlog_peak": {"type": "number", "integer": True, "source_only": True, "instructions": "Peak queued webhook delivery notifications in us-east-va."},
"switchover_seconds": {"type": "number", "decimals": 1, "source_only": True, "instructions": "Controlled leader switchover completion time in seconds."},
"data_loss_occurred": {"type": "boolean", "instructions": "Were any committed database transactions lost?"},
"external_regulator_case": {"type": "text", "instructions": "External regulatory docket number if cited."},
"total_sla_credits_usd": {
"type": "compute",
"decimals": 2,
"instructions": "Compute combined contractual SLA credits in USD across Frankfurt and Amsterdam tiers.",
},
"next_month_storage_incidents": {
"type": "estimate",
"min": 0,
"max": 10,
"instructions": "Estimated monthly SEV-1/SEV-2 storage incidents next month continuing the 6-month trend.",
},
},
"options": {"include_quantiles": True},
},
"expected": {
"incident_id": "INC-2026-1108",
"incident_date": "2026-11-08",
"webhook_backlog_peak": 18400,
"switchover_seconds": 8.5,
"data_loss_occurred": False,
"external_regulator_case": None,
"total_sla_credits_usd": 25200.00,
},
"expected_all": {
"incident_id": "INC-2026-1108",
"incident_date": "2026-11-08",
"webhook_backlog_peak": 18400,
"switchover_seconds": 8.5,
"data_loss_occurred": False,
"external_regulator_case": None,
"total_sla_credits_usd": 25200.00,
},
},
{
"id": "ho12_fast_security_triage",
"category": "fast_compact_siem_ar",
"request": {
"state": "SIEM Finding: CVE-2026-44102 exploited attempt blocked on gateway-tyo-09 (CVSS 9.1). Action: ISOLATE_HOST.",
"fields": {
"cve_id": {"type": "text", "instructions": "CVE identifier."},
"hostname": {"type": "text", "instructions": "Target gateway hostname."},
"cvss": {"type": "number", "decimals": 1, "source_only": True, "instructions": "Numeric CVSS score."},
"action": {"type": "enum", "enum": ["ALLOW", "MONITOR", "ISOLATE_HOST"], "instructions": "Recorded response action."},
},
},
"expected": {
"cve_id": "CVE-2026-44102",
"hostname": "gateway-tyo-09",
"cvss": 9.1,
"action": "ISOLATE_HOST",
},
"expected_all": {
"cve_id": "CVE-2026-44102",
"hostname": "gateway-tyo-09",
"cvss": 9.1,
"action": "ISOLATE_HOST",
},
},
]
if __name__ == "__main__":
s = build_heldout_suite()
print(
f"Built {len(s)} held-out cases with "
f"{sum(len(c['request']['fields']) for c in s)} public fields "
f"({sum(len(c['expected_all']) for c in s)} deterministic ground-truth fields)."
)

Xet Storage Details

Size:
46.5 kB
·
Xet hash:
a80661105ac4989851f1e6520fb05d222641a4bfce2a03aa951d5b774a6822c9

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.