{"abstract":"Rehedging buys the full target again.","category":"Options payoff and settlement","checks":8,"contract":"Inputs positions [kind, signed contracts, absolute delta], multiplier, lot size and existing shares. Put delta is negative. Exposure = sum(sign*delta*contracts*multiplier); target shares = -exposure; the order is target - existing, rounded to whole lots with halves away from zero. Return the signed share quantity.","contract_signature":"positions, multiplier, lot, existing","evaluation_group":"w2-options_payoff_and_settlement-delta-hedge-lots","failed_approach":"Adding the existing shares doubles the offset in the wrong direction.","family":"w2-options_payoff_and_settlement-delta-hedge-lots-existing-hedge-offset","id":"FA-61756","implementations":{"attempt":{"sha256":"27c03022ceb30318f92c6c6620728823ebca3bb37f6b20651154e96568854847","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(positions, multiplier, lot, existing):\n    exposure = Fraction(0)\n    for kind, c, d in positions:\n        sgn = -1 if kind == 'P' else 1\n        exposure += sgn * Fraction(str(d)) * c * multiplier\n    target = -exposure\n    trade = target + existing\n    lots = trade / lot\n    n = math.floor(abs(lots) + Fraction(1, 2))\n    return int((n if lots >= 0 else -n) * lot)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression existing hedge offset 1', [[['C', 5, 0.75], ['C', -3, 0.75]], 100, 50, 75], -250], ['regression existing hedge offset 2', [[['C', -3, 0.6]], 100, 50, 75], 100], ['partial repair probe 1', [[['C', 5, 0.25], ['C', -3, 0.6]], 10, 100, 50], 0], ['partial repair probe 2', [[['C', -1, 0.05], ['P', 2, 0.05], ['P', 1, 0.05], ['P', 1, 0.5]], 10, 100, 50], 0], ['boundary control 1', [[['C', 1, 0.5]], 100, 100, 0], -100], ['boundary control 2', [[['P', 1, 0.25]], 100, 50, 0], 50], ['normal control 1', [[['C', 10, 0.35]], 100, 100, 0], -400], ['normal control 2', [[['P', 2, 0.75], ['C', 10, 0.5], ['C', -1, 0.05], ['P', 10, 0.75]], 100, 25, 0], 400]], [['regression existing hedge offset 1', [[['C', 1, 0.25], ['P', 10, 0.25], ['P', -3, 0.35], ['C', 10, 0.05]], 100, 25, 100], -25], ['regression existing hedge offset 2', [[['P', -3, 0.05], ['C', 2, 0.6]], 10, 25, 75], -100], ['partial repair probe 1', [[['C', 10, 0.5]], 10, 100, 50], -100], ['partial repair probe 2', [[['C', 10, 0.35]], 100, 100, 75], -400], ['boundary control 1', [[['C', 1, 0.5]], 100, 100, 0], -100], ['boundary control 2', [[['P', 1, 0.25]], 100, 50, 0], 50], ['normal control 1', [[['P', -3, 0.75], ['P', 1, 0.05]], 100, 50, 0], -200], ['normal control 2', [[['P', 2, 0.75], ['P', -3, 0.6], ['C', 2, 0.25], ['C', -3, 0.5]], 10, 25, 0], 0]], [['regression existing hedge offset 1', [[['P', 1, 0.35]], 10, 25, 50], -50], ['regression existing hedge offset 2', [[['P', 2, 0.5], ['P', 5, 0.5]], 100, 100, -250], 600], ['partial repair probe 1', [[['C', -3, 0.5], ['P', 10, 0.25]], 100, 100, 50], 400], ['partial repair probe 2', [[['C', 10, 0.6], ['C', 1, 0.25], ['C', 1, 0.25], ['P', 1, 0.35]], 10, 100, 75], -100], ['boundary control 1', [[['P', 1, 0.25]], 100, 50, 0], 50], ['boundary control 2', [[['C', 1, 0.5]], 100, 100, 0], -100], ['normal control 1', [[['P', -3, 0.25], ['P', -1, 0.5], ['C', 5, 0.5]], 10, 100, 0], 0], ['normal control 2', [[['C', 5, 0.75], ['P', 10, 0.35], ['P', 1, 0.5]], 10, 25, 0], 0]], [['regression existing hedge offset 1', [[['P', 10, 0.5], ['C', -3, 0.6], ['C', -3, 0.35]], 100, 25, 50], 725], ['regression existing hedge offset 2', [[['C', 1, 0.05], ['C', 5, 0.35], ['P', -3, 0.5], ['P', 1, 0.5]], 10, 25, 75], -100], ['partial repair probe 1', [[['P', 5, 0.75], ['P', 5, 0.25], ['P', 5, 0.6]], 100, 100, 50], 800], ['partial repair probe 2', [[['P', -3, 0.6], ['P', -3, 0.35], ['P', 10, 0.05], ['C', 10, 0.6]], 10, 100, 50], -100], ['boundary control 1', [[['C', 1, 0.5]], 100, 100, 0], -100], ['boundary control 2', [[['P', 1, 0.25]], 100, 50, 0], 50], ['normal control 1', [[['P', 10, 0.75], ['P', -3, 0.25], ['C', 1, 0.75]], 10, 50, 0], 50], ['normal control 2', [[['P', 10, 0.5]], 100, 100, 0], 500]], [['regression existing hedge offset 1', [[['P', -1, 0.6], ['C', -1, 0.35], ['P', 2, 0.5], ['P', -1, 0.05]], 100, 25, 50], 25], ['regression existing hedge offset 2', [[['C', 10, 0.05], ['P', 1, 0.25]], 100, 25, 75], -100], ['partial repair probe 1', [[['P', -3, 0.35], ['P', 2, 0.75], ['P', 1, 0.25], ['C', -1, 0.35]], 10, 100, 50], 0], ['partial repair probe 2', [[['P', -1, 0.75], ['P', -1, 0.25], ['C', -3, 0.6]], 10, 100, 50], 0], ['boundary control 1', [[['P', 1, 0.25]], 100, 50, 0], 50], ['boundary control 2', [[['C', 1, 0.5]], 100, 100, 0], -100], ['normal control 1', [[['P', 2, 0.25], ['C', 10, 0.35], ['C', 1, 0.6], ['C', 5, 0.25]], 100, 100, 0], -500], ['normal control 2', [[['C', 5, 0.6], ['P', 5, 0.35], ['P', -1, 0.5], ['P', 1, 0.05]], 100, 100, 0], -200]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"4f1c6aca714fe34e03517e0b96863ca4c134e8747902b102350d91d09a9e65f8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(positions, multiplier, lot, existing):\n    exposure = Fraction(0)\n    for kind, c, d in positions:\n        sgn = -1 if kind == 'P' else 1\n        exposure += sgn * Fraction(str(d)) * c * multiplier\n    target = -exposure\n    trade = target\n    lots = trade / lot\n    n = math.floor(abs(lots) + Fraction(1, 2))\n    return int((n if lots >= 0 else -n) * lot)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression existing hedge offset 1', [[['C', 5, 0.75], ['C', -3, 0.75]], 100, 50, 75], -250], ['regression existing hedge offset 2', [[['C', -3, 0.6]], 100, 50, 75], 100], ['partial repair probe 1', [[['C', 5, 0.25], ['C', -3, 0.6]], 10, 100, 50], 0], ['partial repair probe 2', [[['C', -1, 0.05], ['P', 2, 0.05], ['P', 1, 0.05], ['P', 1, 0.5]], 10, 100, 50], 0], ['boundary control 1', [[['C', 1, 0.5]], 100, 100, 0], -100], ['boundary control 2', [[['P', 1, 0.25]], 100, 50, 0], 50], ['normal control 1', [[['C', 10, 0.35]], 100, 100, 0], -400], ['normal control 2', [[['P', 2, 0.75], ['C', 10, 0.5], ['C', -1, 0.05], ['P', 10, 0.75]], 100, 25, 0], 400]], [['regression existing hedge offset 1', [[['C', 1, 0.25], ['P', 10, 0.25], ['P', -3, 0.35], ['C', 10, 0.05]], 100, 25, 100], -25], ['regression existing hedge offset 2', [[['P', -3, 0.05], ['C', 2, 0.6]], 10, 25, 75], -100], ['partial repair probe 1', [[['C', 10, 0.5]], 10, 100, 50], -100], ['partial repair probe 2', [[['C', 10, 0.35]], 100, 100, 75], -400], ['boundary control 1', [[['C', 1, 0.5]], 100, 100, 0], -100], ['boundary control 2', [[['P', 1, 0.25]], 100, 50, 0], 50], ['normal control 1', [[['P', -3, 0.75], ['P', 1, 0.05]], 100, 50, 0], -200], ['normal control 2', [[['P', 2, 0.75], ['P', -3, 0.6], ['C', 2, 0.25], ['C', -3, 0.5]], 10, 25, 0], 0]], [['regression existing hedge offset 1', [[['P', 1, 0.35]], 10, 25, 50], -50], ['regression existing hedge offset 2', [[['P', 2, 0.5], ['P', 5, 0.5]], 100, 100, -250], 600], ['partial repair probe 1', [[['C', -3, 0.5], ['P', 10, 0.25]], 100, 100, 50], 400], ['partial repair probe 2', [[['C', 10, 0.6], ['C', 1, 0.25], ['C', 1, 0.25], ['P', 1, 0.35]], 10, 100, 75], -100], ['boundary control 1', [[['P', 1, 0.25]], 100, 50, 0], 50], ['boundary control 2', [[['C', 1, 0.5]], 100, 100, 0], -100], ['normal control 1', [[['P', -3, 0.25], ['P', -1, 0.5], ['C', 5, 0.5]], 10, 100, 0], 0], ['normal control 2', [[['C', 5, 0.75], ['P', 10, 0.35], ['P', 1, 0.5]], 10, 25, 0], 0]], [['regression existing hedge offset 1', [[['P', 10, 0.5], ['C', -3, 0.6], ['C', -3, 0.35]], 100, 25, 50], 725], ['regression existing hedge offset 2', [[['C', 1, 0.05], ['C', 5, 0.35], ['P', -3, 0.5], ['P', 1, 0.5]], 10, 25, 75], -100], ['partial repair probe 1', [[['P', 5, 0.75], ['P', 5, 0.25], ['P', 5, 0.6]], 100, 100, 50], 800], ['partial repair probe 2', [[['P', -3, 0.6], ['P', -3, 0.35], ['P', 10, 0.05], ['C', 10, 0.6]], 10, 100, 50], -100], ['boundary control 1', [[['C', 1, 0.5]], 100, 100, 0], -100], ['boundary control 2', [[['P', 1, 0.25]], 100, 50, 0], 50], ['normal control 1', [[['P', 10, 0.75], ['P', -3, 0.25], ['C', 1, 0.75]], 10, 50, 0], 50], ['normal control 2', [[['P', 10, 0.5]], 100, 100, 0], 500]], [['regression existing hedge offset 1', [[['P', -1, 0.6], ['C', -1, 0.35], ['P', 2, 0.5], ['P', -1, 0.05]], 100, 25, 50], 25], ['regression existing hedge offset 2', [[['C', 10, 0.05], ['P', 1, 0.25]], 100, 25, 75], -100], ['partial repair probe 1', [[['P', -3, 0.35], ['P', 2, 0.75], ['P', 1, 0.25], ['C', -1, 0.35]], 10, 100, 50], 0], ['partial repair probe 2', [[['P', -1, 0.75], ['P', -1, 0.25], ['C', -3, 0.6]], 10, 100, 50], 0], ['boundary control 1', [[['P', 1, 0.25]], 100, 50, 0], 50], ['boundary control 2', [[['C', 1, 0.5]], 100, 100, 0], -100], ['normal control 1', [[['P', 2, 0.25], ['C', 10, 0.35], ['C', 1, 0.6], ['C', 5, 0.25]], 100, 100, 0], -500], ['normal control 2', [[['C', 5, 0.6], ['P', 5, 0.35], ['P', -1, 0.5], ['P', 1, 0.05]], 100, 100, 0], -200]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A deterministic toy contract stated explicitly in the contract field; no claim of conformance to any exchange or clearing rulebook. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-options_payoff_and_settlement-delta-hedge-lots-existing-hedge-offset","generated_at":"2026-09-29T14:46:58.157003+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Option expiry, exercise and settlement engines move cash and shares; a wrong branch misstates obligations.","root_cause":"The order equals the target without subtracting existing shares.","sha256":"14a83029b049ac7710b7f2ef8336031c25b14f1b2882c11601d9e48bafa54d17","title":"Delta hedge order sized in lots: the existing share position is ignored · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":42.033,"exit_code":1,"observations":[{"actual":-100,"check":"regression existing hedge offset 1","expected":-250,"passed":false},{"actual":250,"check":"regression existing hedge offset 2","expected":100,"passed":false},{"actual":100,"check":"partial repair probe 1","expected":0,"passed":false},{"actual":100,"check":"partial repair probe 2","expected":0,"passed":false},{"actual":-100,"check":"boundary control 1","expected":-100,"passed":true},{"actual":50,"check":"boundary control 2","expected":50,"passed":true},{"actual":-400,"check":"normal control 1","expected":-400,"passed":true},{"actual":400,"check":"normal control 2","expected":400,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression existing hedge offset 1\", \"actual\": -100, \"expected\": -250, \"passed\": false}, {\"check\": \"regression existing hedge offset 2\", \"actual\": 250, \"expected\": 100, \"passed\": false}, {\"check\": \"partial repair probe 1\", \"actual\": 100, \"expected\": 0, \"passed\": false}, {\"check\": \"partial repair probe 2\", \"actual\": 100, \"expected\": 0, \"passed\": false}, {\"check\": \"boundary control 1\", \"actual\": -100, \"expected\": -100, \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": 50, \"expected\": 50, \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": -400, \"expected\": -400, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": 400, \"expected\": 400, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.098,"exit_code":1,"observations":[{"actual":-150,"check":"regression existing hedge offset 1","expected":-250,"passed":false},{"actual":200,"check":"regression existing hedge offset 2","expected":100,"passed":false},{"actual":0,"check":"partial repair probe 1","expected":0,"passed":true},{"actual":0,"check":"partial repair probe 2","expected":0,"passed":true},{"actual":-100,"check":"boundary control 1","expected":-100,"passed":true},{"actual":50,"check":"boundary control 2","expected":50,"passed":true},{"actual":-400,"check":"normal control 1","expected":-400,"passed":true},{"actual":400,"check":"normal control 2","expected":400,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression existing hedge offset 1\", \"actual\": -150, \"expected\": -250, \"passed\": false}, {\"check\": \"regression existing hedge offset 2\", \"actual\": 200, \"expected\": 100, \"passed\": false}, {\"check\": \"partial repair probe 1\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"partial repair probe 2\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"boundary control 1\", \"actual\": -100, \"expected\": -100, \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": 50, \"expected\": 50, \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": -400, \"expected\": -400, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": 400, \"expected\": 400, \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}