{
 "edition": "coding-models/2026-11",
 "product": "hy4",
 "productName": "Hy4",
 "openRouterModel": "tencent/hy4",
 "priceAtTestUsdPerMillionTokens": {
  "input": 0.417,
  "output": 1.2505
 },
 "testedOn": "2026-11-24",
 "place": null,
 "pick": null,
 "result": {
  "passedRuns": 11,
  "runs": 40,
  "scorePercent": 27.5,
  "tasksFailedInEveryRound": [
   "02-slugify",
   "05-leaderboard",
   "06-ticket-tags",
   "08-cart-summary",
   "09-version-compare",
   "10-token-bucket",
   "11-retry-backoff",
   "12-room-bookings",
   "15-normalize-weights",
   "17-bundle-pricing",
   "18-stock-reservations",
   "20-csv-line-parser"
  ],
  "totalCostUsd": 0.648,
  "costPerPassedRunUsd": 0.05891,
  "medianLatencySeconds": 72.36,
  "medianCompletionTokens": 8000,
  "repliesCutOffAtTokenLimit": 29,
  "callsWithoutReply": 0,
  "providers": [
   "DeepInfra",
   "Together"
  ]
 },
 "method": "https://appfor.ai/rankings-evidence/2026-11-coding-models/README.txt",
 "tasks": "https://appfor.ai/rankings-evidence/2026-11-coding-models/tasks.json",
 "runs": [
  {
   "task": "01-invoice-vat",
   "round": 1,
   "passed": true,
   "testResult": "OK",
   "status": "ok",
   "provider": "DeepInfra",
   "latencySeconds": 70.399,
   "finishReason": "stop",
   "promptTokens": 539,
   "completionTokens": 3488,
   "reasoningTokens": 3183,
   "costUsd": 0.0068797605,
   "reply": "```python\n\"\"\"Invoice totals with per-line VAT rounding.\"\"\"\nfrom __future__ import annotations\n\nfrom dataclasses import dataclass\nfrom decimal import Decimal, ROUND_HALF_UP\n\nCENT = Decimal(\"0.01\")\n\n\n@dataclass(frozen=True)\nclass Line:\n    \"\"\"One invoice line: unit price, quantity and VAT rate in percent.\"\"\"\n\n    unit_price: Decimal\n    quantity: int\n    vat_percent: Decimal\n\n\ndef line_net(line: Line) -> Decimal:\n    \"\"\"Net amount of a line, rounded to cents.\"\"\"\n    return (line.unit_price * line.quantity).quantize(CENT, rounding=ROUND_HALF_UP)\n\n\ndef line_vat(line: Line) -> Decimal:\n    \"\"\"VAT for one line, rounded half-up to cents.\"\"\"\n    raw = line_net(line) * line.vat_percent / Decimal(100)\n    return raw.quantize(CENT, rounding=ROUND_HALF_UP)\n\n\ndef invoice_total(lines: list[Line]) -> dict[str, Decimal]:\n    \"\"\"Return net, vat and gross totals for the invoice.\"\"\"\n    net = sum((line_net(item) for item in lines), Decimal(\"0.00\"))\n    vat = sum((line_vat(item) for item in lines), Decimal(\"0.00\"))\n    return {\"net\": net, \"vat\": vat, \"gross\": net + vat}\n```",
   "extractedSolution": "\"\"\"Invoice totals with per-line VAT rounding.\"\"\"\nfrom __future__ import annotations\n\nfrom dataclasses import dataclass\nfrom decimal import Decimal, ROUND_HALF_UP\n\nCENT = Decimal(\"0.01\")\n\n\n@dataclass(frozen=True)\nclass Line:\n    \"\"\"One invoice line: unit price, quantity and VAT rate in percent.\"\"\"\n\n    unit_price: Decimal\n    quantity: int\n    vat_percent: Decimal\n\n\ndef line_net(line: Line) -> Decimal:\n    \"\"\"Net amount of a line, rounded to cents.\"\"\"\n    return (line.unit_price * line.quantity).quantize(CENT, rounding=ROUND_HALF_UP)\n\n\ndef line_vat(line: Line) -> Decimal:\n    \"\"\"VAT for one line, rounded half-up to cents.\"\"\"\n    raw = line_net(line) * line.vat_percent / Decimal(100)\n    return raw.quantize(CENT, rounding=ROUND_HALF_UP)\n\n\ndef invoice_total(lines: list[Line]) -> dict[str, Decimal]:\n    \"\"\"Return net, vat and gross totals for the invoice.\"\"\"\n    net = sum((line_net(item) for item in lines), Decimal(\"0.00\"))\n    vat = sum((line_vat(item) for item in lines), Decimal(\"0.00\"))\n    return {\"net\": net, \"vat\": vat, \"gross\": net + vat}\n",
   "errors": []
  },
  {
   "task": "02-slugify",
   "round": 1,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "DeepInfra",
   "latencySeconds": 167.482,
   "finishReason": "length",
   "promptTokens": 543,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.0153456465,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "03-pagination",
   "round": 1,
   "passed": true,
   "testResult": "OK",
   "status": "ok",
   "provider": "DeepInfra",
   "latencySeconds": 65.148,
   "finishReason": "stop",
   "promptTokens": 530,
   "completionTokens": 3038,
   "reasoningTokens": 2733,
   "costUsd": 0.0060300435,
   "reply": "```python\n\"\"\"Simple 1-based pagination helpers.\"\"\"\nfrom __future__ import annotations\n\nfrom dataclasses import dataclass\nfrom typing import Sequence, TypeVar\n\nT = TypeVar(\"T\")\n\n\n@dataclass(frozen=True)\nclass Page:\n    \"\"\"A page of items plus navigation info.\"\"\"\n\n    items: list\n    number: int\n    total_pages: int\n\n    @property\n    def has_next(self) -> bool:\n        \"\"\"True when a later page exists.\"\"\"\n        return self.number < self.total_pages\n\n    @property\n    def has_prev(self) -> bool:\n        \"\"\"True when an earlier page exists.\"\"\"\n        return self.number > 1\n\n\ndef page_count(total: int, size: int) -> int:\n    \"\"\"Number of pages needed for ``total`` items; at least 1.\"\"\"\n    if size < 1:\n        raise ValueError(\"size must be positive\")\n    return max(1, -(-total // size))\n\n\ndef paginate(items: Sequence[T], number: int, size: int) -> Page:\n    \"\"\"Return page ``number`` (1-based). Out-of-range numbers raise ValueError.\"\"\"\n    pages = page_count(len(items), size)\n    if not 1 <= number <= pages:\n        raise ValueError(\"page out of range\")\n    start = (number - 1) * size\n    return Page(list(items[start:start + size]), number, pages)\n```",
   "extractedSolution": "\"\"\"Simple 1-based pagination helpers.\"\"\"\nfrom __future__ import annotations\n\nfrom dataclasses import dataclass\nfrom typing import Sequence, TypeVar\n\nT = TypeVar(\"T\")\n\n\n@dataclass(frozen=True)\nclass Page:\n    \"\"\"A page of items plus navigation info.\"\"\"\n\n    items: list\n    number: int\n    total_pages: int\n\n    @property\n    def has_next(self) -> bool:\n        \"\"\"True when a later page exists.\"\"\"\n        return self.number < self.total_pages\n\n    @property\n    def has_prev(self) -> bool:\n        \"\"\"True when an earlier page exists.\"\"\"\n        return self.number > 1\n\n\ndef page_count(total: int, size: int) -> int:\n    \"\"\"Number of pages needed for ``total`` items; at least 1.\"\"\"\n    if size < 1:\n        raise ValueError(\"size must be positive\")\n    return max(1, -(-total // size))\n\n\ndef paginate(items: Sequence[T], number: int, size: int) -> Page:\n    \"\"\"Return page ``number`` (1-based). Out-of-range numbers raise ValueError.\"\"\"\n    pages = page_count(len(items), size)\n    if not 1 <= number <= pages:\n        raise ValueError(\"page out of range\")\n    start = (number - 1) * size\n    return Page(list(items[start:start + size]), number, pages)\n",
   "errors": []
  },
  {
   "task": "04-shipping-cost",
   "round": 1,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 75.234,
   "finishReason": "length",
   "promptTokens": 547,
   "completionTokens": 8000,
   "reasoningTokens": 7999,
   "costUsd": 0.020261446,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "05-leaderboard",
   "round": 1,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 58.647,
   "finishReason": "length",
   "promptTokens": 621,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.020525914,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "06-ticket-tags",
   "round": 1,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 76.12,
   "finishReason": "length",
   "promptTokens": 507,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.020430838,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "07-latency-stats",
   "round": 1,
   "passed": true,
   "testResult": "OK",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 6.09,
   "finishReason": "stop",
   "promptTokens": 506,
   "completionTokens": 734,
   "reasoningTokens": 426,
   "costUsd": 0.002257738,
   "reply": "```python\n\"\"\"Response-time statistics for a monitoring dashboard.\"\"\"\nfrom __future__ import annotations\n\nfrom typing import Sequence\n\n\ndef mean_ms(samples: Sequence[int]) -> float:\n    \"\"\"Arithmetic mean of the samples; 0.0 when there are none.\"\"\"\n    if not samples:\n        return 0.0\n    return sum(samples) / len(samples)\n\n\ndef over_budget_ratio(samples: Sequence[int], budget_ms: int) -> float:\n    \"\"\"Fraction of samples strictly slower than ``budget_ms``.\"\"\"\n    if not samples:\n        return 0.0\n    slow = sum(1 for s in samples if s > budget_ms)\n    return slow / len(samples)\n\n\ndef slowest(samples: Sequence[int], n: int) -> list[int]:\n    \"\"\"The ``n`` largest samples, biggest first.\"\"\"\n    if n < 0:\n        raise ValueError(\"n must not be negative\")\n    return sorted(samples, reverse=True)[:n]\n\n\ndef summary(samples: Sequence[int], budget_ms: int) -> dict[str, float]:\n    \"\"\"Mean, worst sample and over-budget ratio in one dict.\"\"\"\n    return {\n        \"mean\": mean_ms(samples),\n        \"worst\": float(max(samples)) if samples else 0.0,\n        \"over_budget\": over_budget_ratio(samples, budget_ms),\n    }\n```",
   "extractedSolution": "\"\"\"Response-time statistics for a monitoring dashboard.\"\"\"\nfrom __future__ import annotations\n\nfrom typing import Sequence\n\n\ndef mean_ms(samples: Sequence[int]) -> float:\n    \"\"\"Arithmetic mean of the samples; 0.0 when there are none.\"\"\"\n    if not samples:\n        return 0.0\n    return sum(samples) / len(samples)\n\n\ndef over_budget_ratio(samples: Sequence[int], budget_ms: int) -> float:\n    \"\"\"Fraction of samples strictly slower than ``budget_ms``.\"\"\"\n    if not samples:\n        return 0.0\n    slow = sum(1 for s in samples if s > budget_ms)\n    return slow / len(samples)\n\n\ndef slowest(samples: Sequence[int], n: int) -> list[int]:\n    \"\"\"The ``n`` largest samples, biggest first.\"\"\"\n    if n < 0:\n        raise ValueError(\"n must not be negative\")\n    return sorted(samples, reverse=True)[:n]\n\n\ndef summary(samples: Sequence[int], budget_ms: int) -> dict[str, float]:\n    \"\"\"Mean, worst sample and over-budget ratio in one dict.\"\"\"\n    return {\n        \"mean\": mean_ms(samples),\n        \"worst\": float(max(samples)) if samples else 0.0,\n        \"over_budget\": over_budget_ratio(samples, budget_ms),\n    }\n",
   "errors": []
  },
  {
   "task": "08-cart-summary",
   "round": 1,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 63.366,
   "finishReason": "length",
   "promptTokens": 534,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.020250604,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "09-version-compare",
   "round": 1,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 67.917,
   "finishReason": "length",
   "promptTokens": 622,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.020526748,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "10-token-bucket",
   "round": 1,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 59.89,
   "finishReason": "length",
   "promptTokens": 735,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.020418238,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "11-retry-backoff",
   "round": 1,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 71.068,
   "finishReason": "length",
   "promptTokens": 589,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.020499226,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "12-room-bookings",
   "round": 1,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 58.339,
   "finishReason": "length",
   "promptTokens": 705,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.020393218,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "13-layered-config",
   "round": 1,
   "passed": true,
   "testResult": "OK",
   "status": "ok",
   "provider": "DeepInfra",
   "latencySeconds": 177.431,
   "finishReason": "stop",
   "promptTokens": 505,
   "completionTokens": 7728,
   "reasoningTokens": 7461,
   "costUsd": 0.0148116735,
   "reply": "```python\n\"\"\"Layered configuration: defaults < file < environment < overrides.\"\"\"\nfrom __future__ import annotations\n\nfrom typing import Any\n\nConfig = dict[str, Any]\n\n\ndef deep_merge(base: Config, top: Config) -> Config:\n    \"\"\"Return a new dict where ``top`` wins; nested dicts merge recursively.\"\"\"\n    result = dict(base)\n    for key, value in top.items():\n        if isinstance(value, dict) and isinstance(result.get(key), dict):\n            result[key] = deep_merge(result[key], value)\n        else:\n            result[key] = value\n    return result\n\n\ndef layered_config(*layers: Config) -> Config:\n    \"\"\"Merge layers, later layers having higher priority.\"\"\"\n    result: Config = {}\n    for layer in layers:\n        result = deep_merge(result, layer)\n    return result\n\n\ndef get_path(config: Config, path: str, default: Any = None) -> Any:\n    \"\"\"Read ``a.b.c`` from nested dicts, or return ``default``.\"\"\"\n    node: Any = config\n    for part in path.split(\".\"):\n        if not isinstance(node, dict) or part not in node:\n            return default\n        node = node[part]\n    return node\n```",
   "extractedSolution": "\"\"\"Layered configuration: defaults < file < environment < overrides.\"\"\"\nfrom __future__ import annotations\n\nfrom typing import Any\n\nConfig = dict[str, Any]\n\n\ndef deep_merge(base: Config, top: Config) -> Config:\n    \"\"\"Return a new dict where ``top`` wins; nested dicts merge recursively.\"\"\"\n    result = dict(base)\n    for key, value in top.items():\n        if isinstance(value, dict) and isinstance(result.get(key), dict):\n            result[key] = deep_merge(result[key], value)\n        else:\n            result[key] = value\n    return result\n\n\ndef layered_config(*layers: Config) -> Config:\n    \"\"\"Merge layers, later layers having higher priority.\"\"\"\n    result: Config = {}\n    for layer in layers:\n        result = deep_merge(result, layer)\n    return result\n\n\ndef get_path(config: Config, path: str, default: Any = None) -> Any:\n    \"\"\"Read ``a.b.c`` from nested dicts, or return ``default``.\"\"\"\n    node: Any = config\n    for part in path.split(\".\"):\n        if not isinstance(node, dict) or part not in node:\n            return default\n        node = node[part]\n    return node\n",
   "errors": []
  },
  {
   "task": "14-password-policy",
   "round": 1,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 65.016,
   "finishReason": "length",
   "promptTokens": 587,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.020294806,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "15-normalize-weights",
   "round": 1,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 85.402,
   "finishReason": "length",
   "promptTokens": 498,
   "completionTokens": 8000,
   "reasoningTokens": 7999,
   "costUsd": 0.020423332,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "16-ellipsize",
   "round": 1,
   "passed": true,
   "testResult": "OK",
   "status": "ok",
   "provider": "DeepInfra",
   "latencySeconds": 116.715,
   "finishReason": "stop",
   "promptTokens": 503,
   "completionTokens": 5725,
   "reasoningTokens": 5442,
   "costUsd": 0.01105329525,
   "reply": "```python\n\"\"\"Shorten strings for fixed-width displays.\"\"\"\nfrom __future__ import annotations\n\nfrom typing import Iterable\n\nELLIPSIS = \"...\"\n\n\ndef ellipsize(text: str, limit: int) -> str:\n    \"\"\"Cut ``text`` to at most ``limit`` characters, ending in '...'.\"\"\"\n    if limit < len(ELLIPSIS):\n        raise ValueError(\"limit too small\")\n    if len(text) <= limit:\n        return text\n    return text[:limit - len(ELLIPSIS)] + ELLIPSIS\n\n\ndef middle_ellipsize(text: str, limit: int) -> str:\n    \"\"\"Like ``ellipsize`` but keeps the start and the end of the text.\"\"\"\n    if limit < len(ELLIPSIS):\n        raise ValueError(\"limit too small\")\n    if len(text) <= limit:\n        return text\n    keep = limit - len(ELLIPSIS)\n    head = (keep + 1) // 2\n    tail = keep - head\n    return text[:head] + ELLIPSIS + text[len(text) - tail:]\n\n\ndef shorten_all(texts: Iterable[str], limit: int) -> list[str]:\n    \"\"\"Apply ``ellipsize`` to every text.\"\"\"\n    return [ellipsize(t, limit) for t in texts]\n```",
   "extractedSolution": "\"\"\"Shorten strings for fixed-width displays.\"\"\"\nfrom __future__ import annotations\n\nfrom typing import Iterable\n\nELLIPSIS = \"...\"\n\n\ndef ellipsize(text: str, limit: int) -> str:\n    \"\"\"Cut ``text`` to at most ``limit`` characters, ending in '...'.\"\"\"\n    if limit < len(ELLIPSIS):\n        raise ValueError(\"limit too small\")\n    if len(text) <= limit:\n        return text\n    return text[:limit - len(ELLIPSIS)] + ELLIPSIS\n\n\ndef middle_ellipsize(text: str, limit: int) -> str:\n    \"\"\"Like ``ellipsize`` but keeps the start and the end of the text.\"\"\"\n    if limit < len(ELLIPSIS):\n        raise ValueError(\"limit too small\")\n    if len(text) <= limit:\n        return text\n    keep = limit - len(ELLIPSIS)\n    head = (keep + 1) // 2\n    tail = keep - head\n    return text[:head] + ELLIPSIS + text[len(text) - tail:]\n\n\ndef shorten_all(texts: Iterable[str], limit: int) -> list[str]:\n    \"\"\"Apply ``ellipsize`` to every text.\"\"\"\n    return [ellipsize(t, limit) for t in texts]\n",
   "errors": []
  },
  {
   "task": "17-bundle-pricing",
   "round": 1,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 82.627,
   "finishReason": "length",
   "promptTokens": 574,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.020283964,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "18-stock-reservations",
   "round": 1,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "DeepInfra",
   "latencySeconds": 185.957,
   "finishReason": "length",
   "promptTokens": 678,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.015049929,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "19-subscription-proration",
   "round": 1,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 54.628,
   "finishReason": "length",
   "promptTokens": 634,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.020536756,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "20-csv-line-parser",
   "round": 1,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 76.762,
   "finishReason": "length",
   "promptTokens": 622,
   "completionTokens": 8000,
   "reasoningTokens": 7999,
   "costUsd": 0.020526748,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "01-invoice-vat",
   "round": 2,
   "passed": true,
   "testResult": "OK",
   "status": "ok",
   "provider": "DeepInfra",
   "latencySeconds": 34.472,
   "finishReason": "stop",
   "promptTokens": 539,
   "completionTokens": 1599,
   "reasoningTokens": 1294,
   "costUsd": 0.00303234075,
   "reply": "```python\n\"\"\"Invoice totals with per-line VAT rounding.\"\"\"\nfrom __future__ import annotations\n\nfrom dataclasses import dataclass\nfrom decimal import Decimal, ROUND_HALF_UP\n\nCENT = Decimal(\"0.01\")\n\n\n@dataclass(frozen=True)\nclass Line:\n    \"\"\"One invoice line: unit price, quantity and VAT rate in percent.\"\"\"\n\n    unit_price: Decimal\n    quantity: int\n    vat_percent: Decimal\n\n\ndef line_net(line: Line) -> Decimal:\n    \"\"\"Net amount of a line, rounded to cents.\"\"\"\n    return (line.unit_price * line.quantity).quantize(CENT, rounding=ROUND_HALF_UP)\n\n\ndef line_vat(line: Line) -> Decimal:\n    \"\"\"VAT for one line, rounded half-up to cents.\"\"\"\n    raw = line_net(line) * line.vat_percent / Decimal(100)\n    return raw.quantize(CENT, rounding=ROUND_HALF_UP)\n\n\ndef invoice_total(lines: list[Line]) -> dict[str, Decimal]:\n    \"\"\"Return net, vat and gross totals for the invoice.\"\"\"\n    net = sum((line_net(item) for item in lines), Decimal(\"0.00\"))\n    vat = sum((line_vat(item) for item in lines), Decimal(\"0.00\"))\n    return {\"net\": net, \"vat\": vat, \"gross\": net + vat}\n```",
   "extractedSolution": "\"\"\"Invoice totals with per-line VAT rounding.\"\"\"\nfrom __future__ import annotations\n\nfrom dataclasses import dataclass\nfrom decimal import Decimal, ROUND_HALF_UP\n\nCENT = Decimal(\"0.01\")\n\n\n@dataclass(frozen=True)\nclass Line:\n    \"\"\"One invoice line: unit price, quantity and VAT rate in percent.\"\"\"\n\n    unit_price: Decimal\n    quantity: int\n    vat_percent: Decimal\n\n\ndef line_net(line: Line) -> Decimal:\n    \"\"\"Net amount of a line, rounded to cents.\"\"\"\n    return (line.unit_price * line.quantity).quantize(CENT, rounding=ROUND_HALF_UP)\n\n\ndef line_vat(line: Line) -> Decimal:\n    \"\"\"VAT for one line, rounded half-up to cents.\"\"\"\n    raw = line_net(line) * line.vat_percent / Decimal(100)\n    return raw.quantize(CENT, rounding=ROUND_HALF_UP)\n\n\ndef invoice_total(lines: list[Line]) -> dict[str, Decimal]:\n    \"\"\"Return net, vat and gross totals for the invoice.\"\"\"\n    net = sum((line_net(item) for item in lines), Decimal(\"0.00\"))\n    vat = sum((line_vat(item) for item in lines), Decimal(\"0.00\"))\n    return {\"net\": net, \"vat\": vat, \"gross\": net + vat}\n",
   "errors": []
  },
  {
   "task": "02-slugify",
   "round": 2,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 64.324,
   "finishReason": "length",
   "promptTokens": 543,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.02025811,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "03-pagination",
   "round": 2,
   "passed": true,
   "testResult": "OK",
   "status": "ok",
   "provider": "DeepInfra",
   "latencySeconds": 171.166,
   "finishReason": "stop",
   "promptTokens": 530,
   "completionTokens": 7318,
   "reasoningTokens": 7016,
   "costUsd": 0.0137541255,
   "reply": "```python\n\"\"\"Simple 1-based pagination helpers.\"\"\"\nfrom __future__ import annotations\n\nfrom dataclasses import dataclass\nfrom typing import Sequence, TypeVar\n\nT = TypeVar(\"T\")\n\n\n@dataclass(frozen=True)\nclass Page:\n    \"\"\"A page of items plus navigation info.\"\"\"\n\n    items: list\n    number: int\n    total_pages: int\n\n    @property\n    def has_next(self) -> bool:\n        \"\"\"True when a later page exists.\"\"\"\n        return self.number < self.total_pages\n\n    @property\n    def has_prev(self) -> bool:\n        \"\"\"True when an earlier page exists.\"\"\"\n        return self.number > 1\n\n\ndef page_count(total: int, size: int) -> int:\n    \"\"\"Number of pages needed for ``total`` items; at least 1.\"\"\"\n    if size < 1:\n        raise ValueError(\"size must be positive\")\n    return max(1, -(-total // size))\n\n\ndef paginate(items: Sequence[T], number: int, size: int) -> Page:\n    \"\"\"Return page ``number`` (1-based). Out-of-range numbers raise ValueError.\"\"\"\n    pages = page_count(len(items), size)\n    if not 1 <= number <= pages:\n        raise ValueError(\"page out of range\")\n    start = (number - 1) * size\n    return Page(list(items[start:start + size]), number, pages)\n```",
   "extractedSolution": "\"\"\"Simple 1-based pagination helpers.\"\"\"\nfrom __future__ import annotations\n\nfrom dataclasses import dataclass\nfrom typing import Sequence, TypeVar\n\nT = TypeVar(\"T\")\n\n\n@dataclass(frozen=True)\nclass Page:\n    \"\"\"A page of items plus navigation info.\"\"\"\n\n    items: list\n    number: int\n    total_pages: int\n\n    @property\n    def has_next(self) -> bool:\n        \"\"\"True when a later page exists.\"\"\"\n        return self.number < self.total_pages\n\n    @property\n    def has_prev(self) -> bool:\n        \"\"\"True when an earlier page exists.\"\"\"\n        return self.number > 1\n\n\ndef page_count(total: int, size: int) -> int:\n    \"\"\"Number of pages needed for ``total`` items; at least 1.\"\"\"\n    if size < 1:\n        raise ValueError(\"size must be positive\")\n    return max(1, -(-total // size))\n\n\ndef paginate(items: Sequence[T], number: int, size: int) -> Page:\n    \"\"\"Return page ``number`` (1-based). Out-of-range numbers raise ValueError.\"\"\"\n    pages = page_count(len(items), size)\n    if not 1 <= number <= pages:\n        raise ValueError(\"page out of range\")\n    start = (number - 1) * size\n    return Page(list(items[start:start + size]), number, pages)\n",
   "errors": []
  },
  {
   "task": "04-shipping-cost",
   "round": 2,
   "passed": true,
   "testResult": "OK",
   "status": "ok",
   "provider": "DeepInfra",
   "latencySeconds": 13.357,
   "finishReason": "stop",
   "promptTokens": 547,
   "completionTokens": 683,
   "reasoningTokens": 353,
   "costUsd": 0.00162328575,
   "reply": "```python\n\"\"\"Shipping cost calculation from weight tiers and destination zone.\"\"\"\nfrom __future__ import annotations\n\nfrom decimal import Decimal\n\n# (max weight in kg, inclusive; price)\nTIERS = [\n    (Decimal(\"1\"), Decimal(\"4.90\")),\n    (Decimal(\"5\"), Decimal(\"7.90\")),\n    (Decimal(\"20\"), Decimal(\"12.90\")),\n]\nZONE_SURCHARGE = {\n    \"domestic\": Decimal(\"0.00\"),\n    \"eu\": Decimal(\"3.00\"),\n    \"other\": Decimal(\"9.50\"),\n}\nMAX_WEIGHT = TIERS[-1][0]\n\n\ndef base_price(weight_kg: Decimal) -> Decimal:\n    \"\"\"Price of the first tier whose limit is >= weight.\"\"\"\n    if weight_kg <= 0:\n        raise ValueError(\"weight must be positive\")\n    for limit, price in TIERS:\n        if weight_kg <= limit:\n            return price\n    raise ValueError(\"parcel too heavy\")\n\n\ndef shipping_cost(weight_kg: Decimal, zone: str, express: bool = False) -> Decimal:\n    \"\"\"Total shipping cost.\n\n    Unknown zones are charged like the ``other`` zone. Express doubles the\n    base price but not the zone surcharge.\n    \"\"\"\n    base = base_price(weight_kg)\n    if express:\n        base *= 2\n    surcharge = ZONE_SURCHARGE.get(zone, ZONE_SURCHARGE[\"other\"])\n    return base + surcharge\n```",
   "extractedSolution": "\"\"\"Shipping cost calculation from weight tiers and destination zone.\"\"\"\nfrom __future__ import annotations\n\nfrom decimal import Decimal\n\n# (max weight in kg, inclusive; price)\nTIERS = [\n    (Decimal(\"1\"), Decimal(\"4.90\")),\n    (Decimal(\"5\"), Decimal(\"7.90\")),\n    (Decimal(\"20\"), Decimal(\"12.90\")),\n]\nZONE_SURCHARGE = {\n    \"domestic\": Decimal(\"0.00\"),\n    \"eu\": Decimal(\"3.00\"),\n    \"other\": Decimal(\"9.50\"),\n}\nMAX_WEIGHT = TIERS[-1][0]\n\n\ndef base_price(weight_kg: Decimal) -> Decimal:\n    \"\"\"Price of the first tier whose limit is >= weight.\"\"\"\n    if weight_kg <= 0:\n        raise ValueError(\"weight must be positive\")\n    for limit, price in TIERS:\n        if weight_kg <= limit:\n            return price\n    raise ValueError(\"parcel too heavy\")\n\n\ndef shipping_cost(weight_kg: Decimal, zone: str, express: bool = False) -> Decimal:\n    \"\"\"Total shipping cost.\n\n    Unknown zones are charged like the ``other`` zone. Express doubles the\n    base price but not the zone surcharge.\n    \"\"\"\n    base = base_price(weight_kg)\n    if express:\n        base *= 2\n    surcharge = ZONE_SURCHARGE.get(zone, ZONE_SURCHARGE[\"other\"])\n    return base + surcharge\n",
   "errors": []
  },
  {
   "task": "05-leaderboard",
   "round": 2,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 60.512,
   "finishReason": "length",
   "promptTokens": 621,
   "completionTokens": 8000,
   "reasoningTokens": 7999,
   "costUsd": 0.020323162,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "06-ticket-tags",
   "round": 2,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 73.661,
   "finishReason": "length",
   "promptTokens": 507,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.020430838,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "07-latency-stats",
   "round": 2,
   "passed": true,
   "testResult": "OK",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 7.146,
   "finishReason": "stop",
   "promptTokens": 506,
   "completionTokens": 802,
   "reasoningTokens": 496,
   "costUsd": 0.002427806,
   "reply": "```python\n\"\"\"Response-time statistics for a monitoring dashboard.\"\"\"\nfrom __future__ import annotations\n\nfrom typing import Sequence\n\n\ndef mean_ms(samples: Sequence[int]) -> float:\n    \"\"\"Arithmetic mean of the samples; 0.0 when there are none.\"\"\"\n    if not samples:\n        return 0.0\n    return sum(samples) / len(samples)\n\n\ndef over_budget_ratio(samples: Sequence[int], budget_ms: int) -> float:\n    \"\"\"Fraction of samples strictly slower than ``budget_ms``.\"\"\"\n    if not samples:\n        return 0.0\n    slow = sum(1 for s in samples if s > budget_ms)\n    return slow / len(samples)\n\n\ndef slowest(samples: Sequence[int], n: int) -> list[int]:\n    \"\"\"The ``n`` largest samples, biggest first.\"\"\"\n    if n < 0:\n        raise ValueError(\"n must not be negative\")\n    return sorted(samples, reverse=True)[:n]\n\n\ndef summary(samples: Sequence[int], budget_ms: int) -> dict[str, float]:\n    \"\"\"Mean, worst sample and over-budget ratio in one dict.\"\"\"\n    return {\n        \"mean\": mean_ms(samples),\n        \"worst\": float(max(samples)) if samples else 0.0,\n        \"over_budget\": over_budget_ratio(samples, budget_ms),\n    }\n```",
   "extractedSolution": "\"\"\"Response-time statistics for a monitoring dashboard.\"\"\"\nfrom __future__ import annotations\n\nfrom typing import Sequence\n\n\ndef mean_ms(samples: Sequence[int]) -> float:\n    \"\"\"Arithmetic mean of the samples; 0.0 when there are none.\"\"\"\n    if not samples:\n        return 0.0\n    return sum(samples) / len(samples)\n\n\ndef over_budget_ratio(samples: Sequence[int], budget_ms: int) -> float:\n    \"\"\"Fraction of samples strictly slower than ``budget_ms``.\"\"\"\n    if not samples:\n        return 0.0\n    slow = sum(1 for s in samples if s > budget_ms)\n    return slow / len(samples)\n\n\ndef slowest(samples: Sequence[int], n: int) -> list[int]:\n    \"\"\"The ``n`` largest samples, biggest first.\"\"\"\n    if n < 0:\n        raise ValueError(\"n must not be negative\")\n    return sorted(samples, reverse=True)[:n]\n\n\ndef summary(samples: Sequence[int], budget_ms: int) -> dict[str, float]:\n    \"\"\"Mean, worst sample and over-budget ratio in one dict.\"\"\"\n    return {\n        \"mean\": mean_ms(samples),\n        \"worst\": float(max(samples)) if samples else 0.0,\n        \"over_budget\": over_budget_ratio(samples, budget_ms),\n    }\n",
   "errors": []
  },
  {
   "task": "08-cart-summary",
   "round": 2,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 69.568,
   "finishReason": "length",
   "promptTokens": 534,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.020250604,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "09-version-compare",
   "round": 2,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 55.23,
   "finishReason": "length",
   "promptTokens": 622,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.020323996,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "10-token-bucket",
   "round": 2,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 87.68,
   "finishReason": "length",
   "promptTokens": 735,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.020418238,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "11-retry-backoff",
   "round": 2,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 79.861,
   "finishReason": "length",
   "promptTokens": 589,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.020296474,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "12-room-bookings",
   "round": 2,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 76.879,
   "finishReason": "length",
   "promptTokens": 705,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.020393218,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "13-layered-config",
   "round": 2,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "DeepInfra",
   "latencySeconds": 161.372,
   "finishReason": "length",
   "promptTokens": 505,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.0153218775,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "14-password-policy",
   "round": 2,
   "passed": true,
   "testResult": "OK",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 10.837,
   "finishReason": "stop",
   "promptTokens": 587,
   "completionTokens": 1010,
   "reasoningTokens": 647,
   "costUsd": 0.002812816,
   "reply": "```python\n\"\"\"Password policy checks.\"\"\"\nfrom __future__ import annotations\n\nfrom typing import Callable\n\nRule = Callable[[str, str], bool]\n\nRULES: list[tuple[str, Rule]] = [\n    (\"length\", lambda pw, user: len(pw) >= 10),\n    (\"digit\", lambda pw, user: any(c.isdigit() for c in pw)),\n    (\"upper\", lambda pw, user: any(c.isupper() for c in pw)),\n    (\"lower\", lambda pw, user: any(c.islower() for c in pw)),\n    (\"no_username\", lambda pw, user: not user or user.lower() not in pw.lower()),\n    (\"no_space\", lambda pw, user: \" \" not in pw),\n]\n\n\ndef check_password(password: str, username: str = \"\") -> list[str]:\n    \"\"\"Names of the rules the password breaks, in rule order.\"\"\"\n    failures: list[str] = []\n    for name, rule in RULES:\n        if not rule(password, username):\n            failures.append(name)\n    return failures\n\n\ndef is_valid(password: str, username: str = \"\") -> bool:\n    \"\"\"True when no rule is broken.\"\"\"\n    return not check_password(password, username)\n\n\ndef strength_label(password: str, username: str = \"\") -> str:\n    \"\"\"'weak' (<= 3 rules passed), 'ok' (4 or 5) or 'strong' (all 6).\"\"\"\n    passed = len(RULES) - len(check_password(password, username))\n    if passed <= 3:\n        return \"weak\"\n    if passed < len(RULES):\n        return \"ok\"\n    return \"strong\"\n```",
   "extractedSolution": "\"\"\"Password policy checks.\"\"\"\nfrom __future__ import annotations\n\nfrom typing import Callable\n\nRule = Callable[[str, str], bool]\n\nRULES: list[tuple[str, Rule]] = [\n    (\"length\", lambda pw, user: len(pw) >= 10),\n    (\"digit\", lambda pw, user: any(c.isdigit() for c in pw)),\n    (\"upper\", lambda pw, user: any(c.isupper() for c in pw)),\n    (\"lower\", lambda pw, user: any(c.islower() for c in pw)),\n    (\"no_username\", lambda pw, user: not user or user.lower() not in pw.lower()),\n    (\"no_space\", lambda pw, user: \" \" not in pw),\n]\n\n\ndef check_password(password: str, username: str = \"\") -> list[str]:\n    \"\"\"Names of the rules the password breaks, in rule order.\"\"\"\n    failures: list[str] = []\n    for name, rule in RULES:\n        if not rule(password, username):\n            failures.append(name)\n    return failures\n\n\ndef is_valid(password: str, username: str = \"\") -> bool:\n    \"\"\"True when no rule is broken.\"\"\"\n    return not check_password(password, username)\n\n\ndef strength_label(password: str, username: str = \"\") -> str:\n    \"\"\"'weak' (<= 3 rules passed), 'ok' (4 or 5) or 'strong' (all 6).\"\"\"\n    passed = len(RULES) - len(check_password(password, username))\n    if passed <= 3:\n        return \"weak\"\n    if passed < len(RULES):\n        return \"ok\"\n    return \"strong\"\n",
   "errors": []
  },
  {
   "task": "15-normalize-weights",
   "round": 2,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 80.266,
   "finishReason": "length",
   "promptTokens": 498,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.020423332,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "16-ellipsize",
   "round": 2,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 67.18,
   "finishReason": "length",
   "promptTokens": 503,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.020427502,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "17-bundle-pricing",
   "round": 2,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 88.991,
   "finishReason": "length",
   "promptTokens": 574,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.020283964,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "18-stock-reservations",
   "round": 2,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 78.199,
   "finishReason": "length",
   "promptTokens": 678,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.020573452,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  },
  {
   "task": "19-subscription-proration",
   "round": 2,
   "passed": true,
   "testResult": "OK",
   "status": "ok",
   "provider": "DeepInfra",
   "latencySeconds": 91.772,
   "finishReason": "stop",
   "promptTokens": 634,
   "completionTokens": 3789,
   "reasoningTokens": 3425,
   "costUsd": 0.00750378375,
   "reply": "```python\n\"\"\"Prorated subscription charges, in integer cents.\"\"\"\nfrom __future__ import annotations\n\nfrom datetime import date, timedelta\n\n\ndef days_in_period(start: date, end: date) -> int:\n    \"\"\"Number of days from ``start`` to ``end``, both inclusive.\"\"\"\n    if end < start:\n        raise ValueError(\"end before start\")\n    return (end - start).days + 1\n\n\ndef prorated_cents(price_cents: int, start_of_service: date,\n                   period_start: date, period_end: date) -> int:\n    \"\"\"Charge for service from ``start_of_service`` through ``period_end``.\n\n    The share is remaining days / total days of the billing period, rounded\n    half-up to whole cents.\n    \"\"\"\n    if not period_start <= start_of_service <= period_end:\n        raise ValueError(\"service start outside the billing period\")\n    remaining = days_in_period(start_of_service, period_end)\n    total = days_in_period(period_start, period_end)\n    return (price_cents * remaining * 2 + total) // (2 * total)\n\n\ndef refund_cents(price_cents: int, cancel_date: date,\n                 period_start: date, period_end: date) -> int:\n    \"\"\"Refund for the unused days after ``cancel_date`` (0 on the last day).\"\"\"\n    if not period_start <= cancel_date <= period_end:\n        raise ValueError(\"cancel date outside the billing period\")\n    if cancel_date == period_end:\n        return 0\n    first_unused = cancel_date + timedelta(days=1)\n    return prorated_cents(price_cents, first_unused, period_start, period_end)\n```",
   "extractedSolution": "\"\"\"Prorated subscription charges, in integer cents.\"\"\"\nfrom __future__ import annotations\n\nfrom datetime import date, timedelta\n\n\ndef days_in_period(start: date, end: date) -> int:\n    \"\"\"Number of days from ``start`` to ``end``, both inclusive.\"\"\"\n    if end < start:\n        raise ValueError(\"end before start\")\n    return (end - start).days + 1\n\n\ndef prorated_cents(price_cents: int, start_of_service: date,\n                   period_start: date, period_end: date) -> int:\n    \"\"\"Charge for service from ``start_of_service`` through ``period_end``.\n\n    The share is remaining days / total days of the billing period, rounded\n    half-up to whole cents.\n    \"\"\"\n    if not period_start <= start_of_service <= period_end:\n        raise ValueError(\"service start outside the billing period\")\n    remaining = days_in_period(start_of_service, period_end)\n    total = days_in_period(period_start, period_end)\n    return (price_cents * remaining * 2 + total) // (2 * total)\n\n\ndef refund_cents(price_cents: int, cancel_date: date,\n                 period_start: date, period_end: date) -> int:\n    \"\"\"Refund for the unused days after ``cancel_date`` (0 on the last day).\"\"\"\n    if not period_start <= cancel_date <= period_end:\n        raise ValueError(\"cancel date outside the billing period\")\n    if cancel_date == period_end:\n        return 0\n    first_unused = cancel_date + timedelta(days=1)\n    return prorated_cents(price_cents, first_unused, period_start, period_end)\n",
   "errors": []
  },
  {
   "task": "20-csv-line-parser",
   "round": 2,
   "passed": false,
   "testResult": "errors=2",
   "status": "ok",
   "provider": "Together",
   "latencySeconds": 91.618,
   "finishReason": "length",
   "promptTokens": 622,
   "completionTokens": 8000,
   "reasoningTokens": 8000,
   "costUsd": 0.020323996,
   "reply": "",
   "extractedSolution": "\n",
   "errors": []
  }
 ]
}
