{
  "schema": "scorecompute.vs-python-bench.v1",
  "recorded_on": "2026-11-26",
  "recorded_at": "2026-11-26T19:17:04.200Z",
  "endpoint": "https://scorecompute.com/mcp",
  "service_release": "0.20.0",
  "note": "Side-by-side execution of naive standard Python 3 (stdlib float64/random/volume-ratio) versus live ScoreCompute Rust MCP tools on 6 bounded trap cases. A careful specialist could write dedicated libraries (SymPy, Z3, OR-Tools, Decimal) in Python; this benchmark shows what fails silently in short ad-hoc scripts.",
  "cases": [
    {
      "id": "decimal_arithmetic",
      "title": "Exact decimal comparison (0.1 + 0.2 == 0.3)",
      "tool": "check_arithmetic",
      "arguments": {
        "expression": "0.1 + 0.2",
        "claimed_value": 0.3
      },
      "naive_python_output": "False 0.30000000000000004",
      "why_naive_python_fails": "Binary IEEE-754 float64 evaluates 0.1 + 0.2 to 0.30000000000000004 != 0.3 unless the caller explicitly reaches for fractions or Decimal.",
      "scorecompute_highlight": {
        "verdict": "consistent",
        "exact_value": "3/10",
        "absolute_error": 0
      },
      "wall_ms": 880.4
    },
    {
      "id": "xirr_multiple_roots",
      "title": "Non-conventional cash flows with two IRR roots (10% and 20%)",
      "tool": "compute_cashflow_metrics",
      "arguments": {
        "flows": [
          {
            "date": "2025-01-01",
            "amount": -100
          },
          {
            "date": "2026-01-01",
            "amount": 230
          },
          {
            "date": "2027-01-01",
            "amount": -132
          }
        ]
      },
      "naive_python_output": "single_newton_root=0.100000 (missed second root at 0.200000)",
      "why_naive_python_fails": "A single-guess Newton solver converges to 10% and never warns that Descartes sign-change parity admits a second valid IRR at 20%.",
      "scorecompute_highlight": {
        "irr_status": "multiple_roots_possible",
        "irr": null,
        "sign_changes": 2,
        "candidate_roots": [
          10,
          20
        ]
      },
      "wall_ms": 589.9
    },
    {
      "id": "nonlinear_uncertainty",
      "title": "Nonlinear product uncertainty (y = x1 * x2, both 1 +/- 1)",
      "tool": "propagate_uncertainty",
      "arguments": {
        "expression": "x1 * x2",
        "variables": [
          {
            "name": "x1",
            "value": 1,
            "distribution": "normal",
            "standard_uncertainty": 1,
            "unit": ""
          },
          {
            "name": "x2",
            "value": 1,
            "distribution": "normal",
            "standard_uncertainty": 1,
            "unit": ""
          }
        ],
        "coverage": 0.95,
        "samples": 200000,
        "seed": 7
      },
      "naive_python_output": "first_order_sd=1.4142 (exact_sd=1.7321)",
      "why_naive_python_fails": "First-order error propagation ignores the product of deviations (variance = 2 instead of exact 3, understating SD by 18.4%) without flagging linearization failure.",
      "scorecompute_highlight": {
        "verdict": "linearization_inadequate",
        "gum_sd": 1.4142,
        "mc_sd": 1.7315
      },
      "wall_ms": 574.7
    },
    {
      "id": "grim_impossible_mean",
      "title": "Granularity-impossible reported survey mean (n=10, mean=3.48, scale 1..5)",
      "tool": "audit_statistics",
      "arguments": {
        "n": 10,
        "mean": 3.48,
        "decimals": 2,
        "min_value": 1,
        "max_value": 5
      },
      "naive_python_output": "range_check_only=True",
      "why_naive_python_fails": "Standard range checks pass 3.48 inside [1, 5], missing that 10 integer responses can only produce means in multiples of 0.1.",
      "scorecompute_highlight": {
        "verdict": "inconsistant",
        "sum_needed": 34.8,
        "nearest_attainable": 3.5
      },
      "wall_ms": 446.2
    },
    {
      "id": "policy_stacking_smt",
      "title": "Hidden discount stacking violation across bounded continuous/integer inputs",
      "tool": "verify_policy",
      "arguments": {
        "spec": "policy sequential; int age 0..120; real amount 0..100000; bool vip; enum tier {free, pro}; real discount = 0; rule senior: age >= 65 & amount >= 100 => discount += 20; rule vip_perk: vip & tier == pro => discount += 25; assert cap40: discount <= 40;"
      },
      "naive_python_output": "50_random_samples_violations=4 (no exhaustive guarantee, no dead-rule or conflict check)",
      "why_naive_python_fails": "Unit tests or random sampling cannot cover continuous/integer combinations exhaustively, nor detect dead rules, overlapping conflicts or coverage gaps.",
      "scorecompute_highlight": {
        "overall_status": "issues_found",
        "invariant_status": "violated",
        "counterexample_reverified": true,
        "discount_exact": "45",
        "smt_queries": 5
      },
      "wall_ms": 638.5
    },
    {
      "id": "packing_3d_fragile_support",
      "title": "3D container packing with fragility, upright lock and 70% underside support",
      "tool": "optimize_packing",
      "arguments": {
        "spec": "mode 3d; unit cm; bin 100x50x100 support=70; wide_fragile: 100x50x50 *1 !fragile !norot; small: 50x50x50 *1;"
      },
      "naive_python_output": "volume_only_bins_estimate=1 (ignores fragile top-clear and 50% overhang < 70% support)",
      "why_naive_python_fails": "Volume-ratio estimates predict 1 bin (75% fill), missing that putting small on fragile breaks !fragile while putting wide_fragile on small leaves only 50% underside support (< 70%), requiring 2 bins.",
      "scorecompute_highlight": {
        "status": "packed_all",
        "bins_used": 2,
        "bin_count_lower_bound": 1,
        "verified_physically": true
      },
      "wall_ms": 679.2
    }
  ]
}
