diff --git a/engine/79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074.json b/engine/79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074.json new file mode 100644 index 000000000..5a7f6ee08 --- /dev/null +++ b/engine/79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074.json @@ -0,0 +1,63 @@ +{ + "accepted_by_drive_record": null, + "actor": { + "authenticated_principal_id": "github-app-installation:0 (fixture)", + "declared_model": "fixture", + "declared_provider": "fixture", + "exposure": "fixture: nothing was read", + "session_id": "fixture-session" + }, + "body_sha256": "970525c0d90ba2f2099f6d28fed7fc0a7ed40880431f32fd9b6b2565653ddc03", + "does_not_establish": "This is a design example, not a receipt. Nothing ran: no commit, no command, no test and no negative control is recorded, and none may be read into it. It was not reviewed, was not delivered to Drive, was not accepted, carries zero independence credit, and changes no mathematical status; the contract it illustrates is PROPOSED / NOT DEPLOYED.", + "drive_return": { + "acceptance_status": "NOT_ACCEPTED", + "delivery_id": null, + "expected_old_head": null, + "readback_sha256": null, + "readback_utc": null, + "receipt_file_id": null + }, + "execution": { + "commands": [ + "python3 -m pytest -q tests/test_bridge.py", + "python3 tools/bridge_check.py" + ], + "commit_sha": "0000000000000000000000000000000000000000", + "dirty_worktree": false, + "end_utc": "2026-09-18T12:05:00.000000Z", + "environment_identity": "fixture runner (no real environment)", + "exit_codes": [ + 0, + 0 + ], + "repository_id": 1117225690, + "start_utc": "2026-09-18T12:00:00.000000Z", + "tree_sha": "1111111111111111111111111111111111111111" + }, + "idempotency_key": "79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074", + "outputs": [], + "record_kind": "RECORD", + "review": { + "authorship_exposure": null, + "independence_credit": 0, + "organizational_independence_record_id": null, + "technical_verdict": "NOT_REVIEWED" + }, + "run_id": "FIXTURE-RUN-0", + "schema": "q0.bridge.run_receipt/v1", + "scientific_status_change": "UNCHANGED", + "status": "EXECUTED", + "task_id": "FIXTURE-TASK-EXEC", + "verification": { + "coverage": "tests/test_bridge.py", + "excluded_scope": [ + "all mathematics" + ], + "negative_controls": [ + "a receipt with tests_passed null cannot PASS" + ], + "tests_failed": 0, + "tests_passed": 3 + }, + "work_order_digest": "e106ad65043a7d938a47d56d7945e1b1680cbb39f443b417b1fffd4e3726b460" +} diff --git a/engine/bridge/79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074.json b/engine/bridge/79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074.json new file mode 100644 index 000000000..5a7f6ee08 --- /dev/null +++ b/engine/bridge/79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074.json @@ -0,0 +1,63 @@ +{ + "accepted_by_drive_record": null, + "actor": { + "authenticated_principal_id": "github-app-installation:0 (fixture)", + "declared_model": "fixture", + "declared_provider": "fixture", + "exposure": "fixture: nothing was read", + "session_id": "fixture-session" + }, + "body_sha256": "970525c0d90ba2f2099f6d28fed7fc0a7ed40880431f32fd9b6b2565653ddc03", + "does_not_establish": "This is a design example, not a receipt. Nothing ran: no commit, no command, no test and no negative control is recorded, and none may be read into it. It was not reviewed, was not delivered to Drive, was not accepted, carries zero independence credit, and changes no mathematical status; the contract it illustrates is PROPOSED / NOT DEPLOYED.", + "drive_return": { + "acceptance_status": "NOT_ACCEPTED", + "delivery_id": null, + "expected_old_head": null, + "readback_sha256": null, + "readback_utc": null, + "receipt_file_id": null + }, + "execution": { + "commands": [ + "python3 -m pytest -q tests/test_bridge.py", + "python3 tools/bridge_check.py" + ], + "commit_sha": "0000000000000000000000000000000000000000", + "dirty_worktree": false, + "end_utc": "2026-09-18T12:05:00.000000Z", + "environment_identity": "fixture runner (no real environment)", + "exit_codes": [ + 0, + 0 + ], + "repository_id": 1117225690, + "start_utc": "2026-09-18T12:00:00.000000Z", + "tree_sha": "1111111111111111111111111111111111111111" + }, + "idempotency_key": "79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074", + "outputs": [], + "record_kind": "RECORD", + "review": { + "authorship_exposure": null, + "independence_credit": 0, + "organizational_independence_record_id": null, + "technical_verdict": "NOT_REVIEWED" + }, + "run_id": "FIXTURE-RUN-0", + "schema": "q0.bridge.run_receipt/v1", + "scientific_status_change": "UNCHANGED", + "status": "EXECUTED", + "task_id": "FIXTURE-TASK-EXEC", + "verification": { + "coverage": "tests/test_bridge.py", + "excluded_scope": [ + "all mathematics" + ], + "negative_controls": [ + "a receipt with tests_passed null cannot PASS" + ], + "tests_failed": 0, + "tests_passed": 3 + }, + "work_order_digest": "e106ad65043a7d938a47d56d7945e1b1680cbb39f443b417b1fffd4e3726b460" +} diff --git a/packages/_probe/79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074.json b/packages/_probe/79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074.json new file mode 100644 index 000000000..5a7f6ee08 --- /dev/null +++ b/packages/_probe/79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074.json @@ -0,0 +1,63 @@ +{ + "accepted_by_drive_record": null, + "actor": { + "authenticated_principal_id": "github-app-installation:0 (fixture)", + "declared_model": "fixture", + "declared_provider": "fixture", + "exposure": "fixture: nothing was read", + "session_id": "fixture-session" + }, + "body_sha256": "970525c0d90ba2f2099f6d28fed7fc0a7ed40880431f32fd9b6b2565653ddc03", + "does_not_establish": "This is a design example, not a receipt. Nothing ran: no commit, no command, no test and no negative control is recorded, and none may be read into it. It was not reviewed, was not delivered to Drive, was not accepted, carries zero independence credit, and changes no mathematical status; the contract it illustrates is PROPOSED / NOT DEPLOYED.", + "drive_return": { + "acceptance_status": "NOT_ACCEPTED", + "delivery_id": null, + "expected_old_head": null, + "readback_sha256": null, + "readback_utc": null, + "receipt_file_id": null + }, + "execution": { + "commands": [ + "python3 -m pytest -q tests/test_bridge.py", + "python3 tools/bridge_check.py" + ], + "commit_sha": "0000000000000000000000000000000000000000", + "dirty_worktree": false, + "end_utc": "2026-09-18T12:05:00.000000Z", + "environment_identity": "fixture runner (no real environment)", + "exit_codes": [ + 0, + 0 + ], + "repository_id": 1117225690, + "start_utc": "2026-09-18T12:00:00.000000Z", + "tree_sha": "1111111111111111111111111111111111111111" + }, + "idempotency_key": "79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074", + "outputs": [], + "record_kind": "RECORD", + "review": { + "authorship_exposure": null, + "independence_credit": 0, + "organizational_independence_record_id": null, + "technical_verdict": "NOT_REVIEWED" + }, + "run_id": "FIXTURE-RUN-0", + "schema": "q0.bridge.run_receipt/v1", + "scientific_status_change": "UNCHANGED", + "status": "EXECUTED", + "task_id": "FIXTURE-TASK-EXEC", + "verification": { + "coverage": "tests/test_bridge.py", + "excluded_scope": [ + "all mathematics" + ], + "negative_controls": [ + "a receipt with tests_passed null cannot PASS" + ], + "tests_failed": 0, + "tests_passed": 3 + }, + "work_order_digest": "e106ad65043a7d938a47d56d7945e1b1680cbb39f443b417b1fffd4e3726b460" +} diff --git a/quarantine/79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074.json b/quarantine/79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074.json new file mode 100644 index 000000000..5a7f6ee08 --- /dev/null +++ b/quarantine/79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074.json @@ -0,0 +1,63 @@ +{ + "accepted_by_drive_record": null, + "actor": { + "authenticated_principal_id": "github-app-installation:0 (fixture)", + "declared_model": "fixture", + "declared_provider": "fixture", + "exposure": "fixture: nothing was read", + "session_id": "fixture-session" + }, + "body_sha256": "970525c0d90ba2f2099f6d28fed7fc0a7ed40880431f32fd9b6b2565653ddc03", + "does_not_establish": "This is a design example, not a receipt. Nothing ran: no commit, no command, no test and no negative control is recorded, and none may be read into it. It was not reviewed, was not delivered to Drive, was not accepted, carries zero independence credit, and changes no mathematical status; the contract it illustrates is PROPOSED / NOT DEPLOYED.", + "drive_return": { + "acceptance_status": "NOT_ACCEPTED", + "delivery_id": null, + "expected_old_head": null, + "readback_sha256": null, + "readback_utc": null, + "receipt_file_id": null + }, + "execution": { + "commands": [ + "python3 -m pytest -q tests/test_bridge.py", + "python3 tools/bridge_check.py" + ], + "commit_sha": "0000000000000000000000000000000000000000", + "dirty_worktree": false, + "end_utc": "2026-09-18T12:05:00.000000Z", + "environment_identity": "fixture runner (no real environment)", + "exit_codes": [ + 0, + 0 + ], + "repository_id": 1117225690, + "start_utc": "2026-09-18T12:00:00.000000Z", + "tree_sha": "1111111111111111111111111111111111111111" + }, + "idempotency_key": "79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074", + "outputs": [], + "record_kind": "RECORD", + "review": { + "authorship_exposure": null, + "independence_credit": 0, + "organizational_independence_record_id": null, + "technical_verdict": "NOT_REVIEWED" + }, + "run_id": "FIXTURE-RUN-0", + "schema": "q0.bridge.run_receipt/v1", + "scientific_status_change": "UNCHANGED", + "status": "EXECUTED", + "task_id": "FIXTURE-TASK-EXEC", + "verification": { + "coverage": "tests/test_bridge.py", + "excluded_scope": [ + "all mathematics" + ], + "negative_controls": [ + "a receipt with tests_passed null cannot PASS" + ], + "tests_failed": 0, + "tests_passed": 3 + }, + "work_order_digest": "e106ad65043a7d938a47d56d7945e1b1680cbb39f443b417b1fffd4e3726b460" +} diff --git a/research/79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074.json b/research/79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074.json new file mode 100644 index 000000000..5a7f6ee08 --- /dev/null +++ b/research/79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074.json @@ -0,0 +1,63 @@ +{ + "accepted_by_drive_record": null, + "actor": { + "authenticated_principal_id": "github-app-installation:0 (fixture)", + "declared_model": "fixture", + "declared_provider": "fixture", + "exposure": "fixture: nothing was read", + "session_id": "fixture-session" + }, + "body_sha256": "970525c0d90ba2f2099f6d28fed7fc0a7ed40880431f32fd9b6b2565653ddc03", + "does_not_establish": "This is a design example, not a receipt. Nothing ran: no commit, no command, no test and no negative control is recorded, and none may be read into it. It was not reviewed, was not delivered to Drive, was not accepted, carries zero independence credit, and changes no mathematical status; the contract it illustrates is PROPOSED / NOT DEPLOYED.", + "drive_return": { + "acceptance_status": "NOT_ACCEPTED", + "delivery_id": null, + "expected_old_head": null, + "readback_sha256": null, + "readback_utc": null, + "receipt_file_id": null + }, + "execution": { + "commands": [ + "python3 -m pytest -q tests/test_bridge.py", + "python3 tools/bridge_check.py" + ], + "commit_sha": "0000000000000000000000000000000000000000", + "dirty_worktree": false, + "end_utc": "2026-09-18T12:05:00.000000Z", + "environment_identity": "fixture runner (no real environment)", + "exit_codes": [ + 0, + 0 + ], + "repository_id": 1117225690, + "start_utc": "2026-09-18T12:00:00.000000Z", + "tree_sha": "1111111111111111111111111111111111111111" + }, + "idempotency_key": "79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074", + "outputs": [], + "record_kind": "RECORD", + "review": { + "authorship_exposure": null, + "independence_credit": 0, + "organizational_independence_record_id": null, + "technical_verdict": "NOT_REVIEWED" + }, + "run_id": "FIXTURE-RUN-0", + "schema": "q0.bridge.run_receipt/v1", + "scientific_status_change": "UNCHANGED", + "status": "EXECUTED", + "task_id": "FIXTURE-TASK-EXEC", + "verification": { + "coverage": "tests/test_bridge.py", + "excluded_scope": [ + "all mathematics" + ], + "negative_controls": [ + "a receipt with tests_passed null cannot PASS" + ], + "tests_failed": 0, + "tests_passed": 3 + }, + "work_order_digest": "e106ad65043a7d938a47d56d7945e1b1680cbb39f443b417b1fffd4e3726b460" +} diff --git a/research/cover/README.md b/research/cover/README.md index e3ca7efc6..793cbd2cd 100644 --- a/research/cover/README.md +++ b/research/cover/README.md @@ -444,14 +444,39 @@ given the caveat below. | `ledger.py:667` | `<=` -> `<` | the "(+N more)" threshold in a message, at exactly 8 pending cells. Cosmetic. | | `ledger.py:684` | `or` -> `and` | a defensive branch already marked `# pragma: no cover`. | | `regions.py:297`, `:299` | `>` -> `>=` | the theta-halving policy, differing only when arc and radial extent are *exactly* equal. | -| `regions.py:399`, `:412` (x2) | `<=` -> `<`, `<` -> `<=` | disjointness tests, differing only at exact tangency. | +| `regions.py:412` (x2) | `<` -> `<=`, `>` -> `>=` | **KILLED 2026-09-24**, controls 44 and 45. A genuine disjointness test, and the equality is reachable: a box tangent to the inner circle (`hi2 = r_lo^2` exactly) and one tangent to the outer (`lo2 = r_hi^2`) each classify `STRADDLE` live and `OUTSIDE` mutated. Each box kills one comparison; both are needed. | +| `regions.py:399` | `<=` -> `<` (x2) | **provably equivalent**, control 46 -- see below. Not a disjointness test and not a tangency case. | | `driver.py:217` | `<=` -> `<` | accept-at-budget, differing only when the width is *exactly* the budget. | -Six of the nine are exact-equality boundaries that the reference geometry never -lands on, and three are message text or a `pragma`-marked branch. That is a -statement about what was measured, not a claim that they are all provably -equivalent; a cover whose cell widths happened to hit one of those equalities -would separate them. +That last sentence used to read that all six equality boundaries were sites +"the reference geometry never lands on", under one description covering both +`regions.py:399` and `:412`. **The description was wrong for `:399` and the +generalisation was wrong for `:412`,** and the two errors point in opposite +directions. + +`:412` is `if hi2 < rlo2 or lo2 > rhi2: return OUTSIDE`. That is a disjointness +test, the equality is reachable, and exact rationals make a witness easy: +`[0, 3/50] x [0, 4/50]` has `hi2 = 9/2500 + 16/2500 = 1/100 = r_lo^2` exactly. +It is `STRADDLE` live and `OUTSIDE` mutated -- a cell touching the region, +rejected as *proved disjoint*, whose residual `total()` then discards. Killed +by controls 44 and 45. + +`:399` is not a disjointness test at all. It is the per-axis min/max helper, +`lo = Fraction(0) if (a <= 0 <= b) else min(abs(a), abs(b))`, and its two +operand flips differ **nowhere** on a legal box rather than only at tangency: +`a < 0 <= b` can diverge only when `a == 0`, and the else branch then returns +`min(|0|, |b|) = 0`, which is what the if branch returns; `a <= 0 < b` +likewise when `b == 0`. So no cover, no cell width and no input separates them. +Control 46 asserts the equivalence over 797 legal pairs rather than pretending +a kill is available, because for an equivalence claim that is the only guard +there is: if `_axis_min_max` ever changes so the flips disagree, the claim here +becomes false and the control fails. + +The remaining entries above are still the sweep's classification, measured and +not proved. Two of the nine are now killed and one is proved equivalent; the +other six have not been re-examined by hand, and the count of "six exact-equality +boundaries the geometry never lands on" should be read as the sweep's, which +this correction has now shown to be wrong at least once in each direction. **A caveat on the harness, stated because it bit.** The sweep identifies a mutation site by index and reports the source line of the node it mutated. On diff --git a/reviews/79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074.json b/reviews/79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074.json new file mode 100644 index 000000000..5a7f6ee08 --- /dev/null +++ b/reviews/79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074.json @@ -0,0 +1,63 @@ +{ + "accepted_by_drive_record": null, + "actor": { + "authenticated_principal_id": "github-app-installation:0 (fixture)", + "declared_model": "fixture", + "declared_provider": "fixture", + "exposure": "fixture: nothing was read", + "session_id": "fixture-session" + }, + "body_sha256": "970525c0d90ba2f2099f6d28fed7fc0a7ed40880431f32fd9b6b2565653ddc03", + "does_not_establish": "This is a design example, not a receipt. Nothing ran: no commit, no command, no test and no negative control is recorded, and none may be read into it. It was not reviewed, was not delivered to Drive, was not accepted, carries zero independence credit, and changes no mathematical status; the contract it illustrates is PROPOSED / NOT DEPLOYED.", + "drive_return": { + "acceptance_status": "NOT_ACCEPTED", + "delivery_id": null, + "expected_old_head": null, + "readback_sha256": null, + "readback_utc": null, + "receipt_file_id": null + }, + "execution": { + "commands": [ + "python3 -m pytest -q tests/test_bridge.py", + "python3 tools/bridge_check.py" + ], + "commit_sha": "0000000000000000000000000000000000000000", + "dirty_worktree": false, + "end_utc": "2026-09-18T12:05:00.000000Z", + "environment_identity": "fixture runner (no real environment)", + "exit_codes": [ + 0, + 0 + ], + "repository_id": 1117225690, + "start_utc": "2026-09-18T12:00:00.000000Z", + "tree_sha": "1111111111111111111111111111111111111111" + }, + "idempotency_key": "79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074", + "outputs": [], + "record_kind": "RECORD", + "review": { + "authorship_exposure": null, + "independence_credit": 0, + "organizational_independence_record_id": null, + "technical_verdict": "NOT_REVIEWED" + }, + "run_id": "FIXTURE-RUN-0", + "schema": "q0.bridge.run_receipt/v1", + "scientific_status_change": "UNCHANGED", + "status": "EXECUTED", + "task_id": "FIXTURE-TASK-EXEC", + "verification": { + "coverage": "tests/test_bridge.py", + "excluded_scope": [ + "all mathematics" + ], + "negative_controls": [ + "a receipt with tests_passed null cannot PASS" + ], + "tests_failed": 0, + "tests_passed": 3 + }, + "work_order_digest": "e106ad65043a7d938a47d56d7945e1b1680cbb39f443b417b1fffd4e3726b460" +} diff --git a/sandbox/79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074.json b/sandbox/79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074.json new file mode 100644 index 000000000..5a7f6ee08 --- /dev/null +++ b/sandbox/79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074.json @@ -0,0 +1,63 @@ +{ + "accepted_by_drive_record": null, + "actor": { + "authenticated_principal_id": "github-app-installation:0 (fixture)", + "declared_model": "fixture", + "declared_provider": "fixture", + "exposure": "fixture: nothing was read", + "session_id": "fixture-session" + }, + "body_sha256": "970525c0d90ba2f2099f6d28fed7fc0a7ed40880431f32fd9b6b2565653ddc03", + "does_not_establish": "This is a design example, not a receipt. Nothing ran: no commit, no command, no test and no negative control is recorded, and none may be read into it. It was not reviewed, was not delivered to Drive, was not accepted, carries zero independence credit, and changes no mathematical status; the contract it illustrates is PROPOSED / NOT DEPLOYED.", + "drive_return": { + "acceptance_status": "NOT_ACCEPTED", + "delivery_id": null, + "expected_old_head": null, + "readback_sha256": null, + "readback_utc": null, + "receipt_file_id": null + }, + "execution": { + "commands": [ + "python3 -m pytest -q tests/test_bridge.py", + "python3 tools/bridge_check.py" + ], + "commit_sha": "0000000000000000000000000000000000000000", + "dirty_worktree": false, + "end_utc": "2026-09-18T12:05:00.000000Z", + "environment_identity": "fixture runner (no real environment)", + "exit_codes": [ + 0, + 0 + ], + "repository_id": 1117225690, + "start_utc": "2026-09-18T12:00:00.000000Z", + "tree_sha": "1111111111111111111111111111111111111111" + }, + "idempotency_key": "79c3ac77a33dea232e7b9370ba5d0b20436593e06ea35e01f7ecf0e312439074", + "outputs": [], + "record_kind": "RECORD", + "review": { + "authorship_exposure": null, + "independence_credit": 0, + "organizational_independence_record_id": null, + "technical_verdict": "NOT_REVIEWED" + }, + "run_id": "FIXTURE-RUN-0", + "schema": "q0.bridge.run_receipt/v1", + "scientific_status_change": "UNCHANGED", + "status": "EXECUTED", + "task_id": "FIXTURE-TASK-EXEC", + "verification": { + "coverage": "tests/test_bridge.py", + "excluded_scope": [ + "all mathematics" + ], + "negative_controls": [ + "a receipt with tests_passed null cannot PASS" + ], + "tests_failed": 0, + "tests_passed": 3 + }, + "work_order_digest": "e106ad65043a7d938a47d56d7945e1b1680cbb39f443b417b1fffd4e3726b460" +} diff --git a/tests/test_cover.py b/tests/test_cover.py index c96be542f..47bc33615 100644 --- a/tests/test_cover.py +++ b/tests/test_cover.py @@ -1521,3 +1521,100 @@ def test_43_uniform_cost_meets_its_target_and_the_published_count_is_pinned(): continue with open(path, encoding="utf-8") as handle: assert fragment in handle.read(), f"{rel} no longer quotes {fragment}" + + +def test_44_a_cell_tangent_to_the_inner_circle_is_not_OUTSIDE(): + """CONTROL 44. Kills `regions.py:412` `hi2 < rlo2` -> `hi2 <= rlo2`. + + The README recorded this site as surviving because "the reference geometry + never lands on" the equality. True of the reference runs, and not a reason + the mutant is unkillable: a box whose greatest radius is EXACTLY the inner + radius separates them, and exact rationals make one easy to build. + + ``[0, 3/50] x [0, 4/50]`` straddles the origin on both axes, so + ``_axis_min_max`` gives ``lo = 0`` on each and ``hi2 = (3/50)^2 + (4/50)^2 + = 9/2500 + 16/2500 = 1/100``, exactly ``r_lo^2``. The cell reaches the + inner circle and is therefore NOT provably disjoint from the annulus: + + live classify -> STRADDLE + mutant classify -> OUTSIDE + + which matters because ``OUTSIDE`` is the disposition whose rejection reason + says *proved disjoint* and whose residual ``total()`` discards outright + (control 41). A cell touching the region, rejected as disjoint, is how a + cover loses area it should have accounted for. + """ + r = rn5_annulus_bracket() + box = Box(F(0), F(3, 50), F(0), F(4, 50)) + lo2, hi2 = r.radius2_range(box) + assert lo2 == 0 + assert hi2 == r.r_lo ** 2, "the box must be exactly tangent, or this proves nothing" + assert r.classify(box) == STRADDLE + + +def test_45_a_cell_tangent_to_the_outer_circle_is_not_OUTSIDE(): + """CONTROL 45. Kills `regions.py:412` `lo2 > rhi2` -> `lo2 >= rhi2`. + + The mirror of control 44, and a separate control because each box kills + exactly one of the two comparisons: the inner-tangent box leaves this + mutant alive and vice versa. + + ``[5, 6] x [0, 1]`` does not straddle zero on the u axis, so + ``_axis_min_max`` gives ``lo = 5`` there, and ``lo2 = 25 + 0 = 25``, + exactly ``r_hi^2``. The cell reaches the outer circle: + + live classify -> STRADDLE + mutant classify -> OUTSIDE + """ + r = rn5_annulus_bracket() + box = Box(F(5), F(6), F(0), F(1)) + lo2, hi2 = r.radius2_range(box) + assert lo2 == r.r_hi ** 2, "the box must be exactly tangent, or this proves nothing" + assert r.classify(box) == STRADDLE + + +def test_46_the_axis_min_max_operand_flips_are_provably_equivalent(): + """CONTROL 46. `regions.py:399` is NOT killable, and that is the finding. + + The README listed `regions.py:399` beside `:412` under one description -- + "disjointness tests, differing only at exact tangency" -- and that + description is wrong for this site on both counts. Line 399 is not a + disjointness test; it is the per-axis min/max helper:: + + lo = Fraction(0) if (a <= 0 <= b) else min(abs(a), abs(b)) + + and its two operand flips differ NOWHERE on a legal box, not merely at + tangency. Proof, one line each: + + * ``a < 0 <= b`` can only diverge when ``a == 0``; the else branch then + returns ``min(|0|, |b|) = 0``, which is what the if branch returns. + * ``a <= 0 < b`` can only diverge when ``b == 0``; the else branch then + returns ``min(|a|, 0) = 0``, likewise. + + So no cover, no cell width and no input separates them. This control + therefore cannot kill the mutant -- nothing can -- and asserts the + EQUIVALENCE instead, over a grid of legal boxes. If someone later changes + ``_axis_min_max`` so that the flips stop agreeing, the README's claim of + equivalence becomes false and this fails, which is the only guard an + equivalence claim can carry. + """ + def live(a, b): + return F(0) if (a <= 0 <= b) else min(abs(a), abs(b)) + + def flip_first(a, b): + return F(0) if (a < 0 <= b) else min(abs(a), abs(b)) + + def flip_second(a, b): + return F(0) if (a <= 0 < b) else min(abs(a), abs(b)) + + values = [F(n, d) for n in range(-6, 7) for d in (1, 2, 3)] + pairs = [(a, b) for a in values for b in values if a <= b] + assert len(pairs) > 700, "the grid must be wide enough to be worth quoting" + for a, b in pairs: + assert live(a, b) == flip_first(a, b) == flip_second(a, b), (a, b) + + # And the live helper is the one the region actually uses, so the proof is + # about shipped code rather than a copy that has drifted from it. + r = rn5_annulus_bracket() + for a, b in ((F(-1), F(2)), (F(0), F(3)), (F(-4), F(0)), (F(2), F(5))): + assert r._axis_min_max(a, b) == (live(a, b), max(abs(a), abs(b)))