{
  "schema": "nodus.shape-broadcast-demonstration.v1",
  "kind": "Original authored finite CPU arrays; actual NumPy API decisions, not timings",
  "environment": {
    "python": "3.12.14",
    "implementation": "CPython",
    "numpy": "2.5.0",
    "system": "Darwin",
    "machine": "arm64"
  },
  "tolerances": {
    "rtol": 0,
    "atol": 0,
    "equal_nan": false
  },
  "declared_contract": "Actual and desired have exactly equal shape and dtype, both finite, and elementwise equality with rtol=atol=0.",
  "rows": [
    {
      "case": "exact_matrix",
      "label": "Exact matrix",
      "actual": {
        "shape": [
          2,
          2
        ],
        "dtype": "float64",
        "values": [
          [
            1.0,
            2.0
          ],
          [
            1.0,
            2.0
          ]
        ]
      },
      "desired": {
        "shape": [
          2,
          2
        ],
        "dtype": "float64",
        "values": [
          [
            1.0,
            2.0
          ],
          [
            1.0,
            2.0
          ]
        ]
      },
      "broadcast_expansion": {
        "shape": [
          2,
          2
        ],
        "actual": [
          [
            1.0,
            2.0
          ],
          [
            1.0,
            2.0
          ]
        ],
        "desired": [
          [
            1.0,
            2.0
          ],
          [
            1.0,
            2.0
          ]
        ]
      },
      "results": {
        "allclose": {
          "decision": true
        },
        "assert_allclose_non_strict": {
          "decision": true
        },
        "assert_allclose_strict": {
          "decision": true
        },
        "explicit_contract": {
          "decision": true,
          "failed_contract_fields": [],
          "value_check_ran": true
        }
      }
    },
    {
      "case": "missing_row_axis",
      "label": "Missing row axis",
      "actual": {
        "shape": [
          2
        ],
        "dtype": "float64",
        "values": [
          1.0,
          2.0
        ]
      },
      "desired": {
        "shape": [
          2,
          2
        ],
        "dtype": "float64",
        "values": [
          [
            1.0,
            2.0
          ],
          [
            1.0,
            2.0
          ]
        ]
      },
      "broadcast_expansion": {
        "shape": [
          2,
          2
        ],
        "actual": [
          [
            1.0,
            2.0
          ],
          [
            1.0,
            2.0
          ]
        ],
        "desired": [
          [
            1.0,
            2.0
          ],
          [
            1.0,
            2.0
          ]
        ]
      },
      "results": {
        "allclose": {
          "decision": true
        },
        "assert_allclose_non_strict": {
          "decision": false,
          "exception": "AssertionError",
          "detail": "\nNot equal to tolerance rtol=0, atol=0\n\n(shapes (2,), (2, 2) mismatch)\n ACTUAL: array([1., 2.])\n DESIRED: array([[1., 2.],\n       [1., 2.]])"
        },
        "assert_allclose_strict": {
          "decision": false,
          "exception": "AssertionError",
          "detail": "\nNot equal to tolerance rtol=0, atol=0\n\n(shapes (2,), (2, 2) mismatch)\n ACTUAL: array([1., 2.])\n DESIRED: array([[1., 2.],\n       [1., 2.]])"
        },
        "explicit_contract": {
          "decision": false,
          "failed_contract_fields": [
            "shape"
          ],
          "value_check_ran": false
        }
      }
    },
    {
      "case": "singleton_column",
      "label": "Singleton column",
      "actual": {
        "shape": [
          2,
          1
        ],
        "dtype": "float64",
        "values": [
          [
            1.0
          ],
          [
            2.0
          ]
        ]
      },
      "desired": {
        "shape": [
          2,
          2
        ],
        "dtype": "float64",
        "values": [
          [
            1.0,
            1.0
          ],
          [
            2.0,
            2.0
          ]
        ]
      },
      "broadcast_expansion": {
        "shape": [
          2,
          2
        ],
        "actual": [
          [
            1.0,
            1.0
          ],
          [
            2.0,
            2.0
          ]
        ],
        "desired": [
          [
            1.0,
            1.0
          ],
          [
            2.0,
            2.0
          ]
        ]
      },
      "results": {
        "allclose": {
          "decision": true
        },
        "assert_allclose_non_strict": {
          "decision": false,
          "exception": "AssertionError",
          "detail": "\nNot equal to tolerance rtol=0, atol=0\n\n(shapes (2, 1), (2, 2) mismatch)\n ACTUAL: array([[1.],\n       [2.]])\n DESIRED: array([[1., 1.],\n       [2., 2.]])"
        },
        "assert_allclose_strict": {
          "decision": false,
          "exception": "AssertionError",
          "detail": "\nNot equal to tolerance rtol=0, atol=0\n\n(shapes (2, 1), (2, 2) mismatch)\n ACTUAL: array([[1.],\n       [2.]])\n DESIRED: array([[1., 1.],\n       [2., 2.]])"
        },
        "explicit_contract": {
          "decision": false,
          "failed_contract_fields": [
            "shape"
          ],
          "value_check_ran": false
        }
      }
    },
    {
      "case": "scalar",
      "label": "Scalar",
      "actual": {
        "shape": [],
        "dtype": "float64",
        "values": 3.0
      },
      "desired": {
        "shape": [
          2,
          2
        ],
        "dtype": "float64",
        "values": [
          [
            3.0,
            3.0
          ],
          [
            3.0,
            3.0
          ]
        ]
      },
      "broadcast_expansion": {
        "shape": [
          2,
          2
        ],
        "actual": [
          [
            3.0,
            3.0
          ],
          [
            3.0,
            3.0
          ]
        ],
        "desired": [
          [
            3.0,
            3.0
          ],
          [
            3.0,
            3.0
          ]
        ]
      },
      "results": {
        "allclose": {
          "decision": true
        },
        "assert_allclose_non_strict": {
          "decision": true
        },
        "assert_allclose_strict": {
          "decision": false,
          "exception": "AssertionError",
          "detail": "\nNot equal to tolerance rtol=0, atol=0\n\n(shapes (), (2, 2) mismatch)\n ACTUAL: array(3.)\n DESIRED: array([[3., 3.],\n       [3., 3.]])"
        },
        "explicit_contract": {
          "decision": false,
          "failed_contract_fields": [
            "shape"
          ],
          "value_check_ran": false
        }
      }
    },
    {
      "case": "dtype_only",
      "label": "Dtype only",
      "actual": {
        "shape": [
          2,
          2
        ],
        "dtype": "float32",
        "values": [
          [
            1.0,
            2.0
          ],
          [
            1.0,
            2.0
          ]
        ]
      },
      "desired": {
        "shape": [
          2,
          2
        ],
        "dtype": "float64",
        "values": [
          [
            1.0,
            2.0
          ],
          [
            1.0,
            2.0
          ]
        ]
      },
      "broadcast_expansion": {
        "shape": [
          2,
          2
        ],
        "actual": [
          [
            1.0,
            2.0
          ],
          [
            1.0,
            2.0
          ]
        ],
        "desired": [
          [
            1.0,
            2.0
          ],
          [
            1.0,
            2.0
          ]
        ]
      },
      "results": {
        "allclose": {
          "decision": true
        },
        "assert_allclose_non_strict": {
          "decision": true
        },
        "assert_allclose_strict": {
          "decision": false,
          "exception": "AssertionError",
          "detail": "\nNot equal to tolerance rtol=0, atol=0\n\n(dtypes float32, float64 mismatch)\n ACTUAL: array([[1., 2.],\n       [1., 2.]], dtype=float32)\n DESIRED: array([[1., 2.],\n       [1., 2.]])"
        },
        "explicit_contract": {
          "decision": false,
          "failed_contract_fields": [
            "dtype"
          ],
          "value_check_ran": false
        }
      }
    },
    {
      "case": "wrong_value",
      "label": "Wrong value",
      "actual": {
        "shape": [
          2,
          2
        ],
        "dtype": "float64",
        "values": [
          [
            1.0,
            2.0
          ],
          [
            1.0,
            9.0
          ]
        ]
      },
      "desired": {
        "shape": [
          2,
          2
        ],
        "dtype": "float64",
        "values": [
          [
            1.0,
            2.0
          ],
          [
            1.0,
            2.0
          ]
        ]
      },
      "broadcast_expansion": {
        "shape": [
          2,
          2
        ],
        "actual": [
          [
            1.0,
            2.0
          ],
          [
            1.0,
            9.0
          ]
        ],
        "desired": [
          [
            1.0,
            2.0
          ],
          [
            1.0,
            2.0
          ]
        ]
      },
      "results": {
        "allclose": {
          "decision": false
        },
        "assert_allclose_non_strict": {
          "decision": false,
          "exception": "AssertionError",
          "detail": "\nNot equal to tolerance rtol=0, atol=0\n\nMismatched elements: 1 / 4 (25%)\nMismatch at index:\n [1, 1]: 9.0 (ACTUAL), 2.0 (DESIRED)\nMax absolute difference among violations: 7.\nMax relative difference among violations: 3.5\n ACTUAL: array([[1., 2.],\n       [1., 9.]])\n DESIRED: array([[1., 2.],\n       [1., 2.]])"
        },
        "assert_allclose_strict": {
          "decision": false,
          "exception": "AssertionError",
          "detail": "\nNot equal to tolerance rtol=0, atol=0\n\nMismatched elements: 1 / 4 (25%)\nMismatch at index:\n [1, 1]: 9.0 (ACTUAL), 2.0 (DESIRED)\nMax absolute difference among violations: 7.\nMax relative difference among violations: 3.5\n ACTUAL: array([[1., 2.],\n       [1., 9.]])\n DESIRED: array([[1., 2.],\n       [1., 2.]])"
        },
        "explicit_contract": {
          "decision": false,
          "failed_contract_fields": [
            "values"
          ],
          "value_check_ran": true
        }
      }
    },
    {
      "case": "incompatible",
      "label": "Incompatible shape",
      "actual": {
        "shape": [
          3
        ],
        "dtype": "float64",
        "values": [
          1.0,
          2.0,
          3.0
        ]
      },
      "desired": {
        "shape": [
          2,
          2
        ],
        "dtype": "float64",
        "values": [
          [
            1.0,
            2.0
          ],
          [
            1.0,
            2.0
          ]
        ]
      },
      "broadcast_expansion": {
        "exception": "ValueError",
        "detail": "shape mismatch: objects cannot be broadcast to a single shape.  Mismatch is between arg 0 with shape (3,) and arg 1 with shape (2, 2)."
      },
      "results": {
        "allclose": {
          "decision": "ValueError",
          "detail": "operands could not be broadcast together with shapes (3,) (2,2) "
        },
        "assert_allclose_non_strict": {
          "decision": false,
          "exception": "AssertionError",
          "detail": "\nNot equal to tolerance rtol=0, atol=0\n\n(shapes (3,), (2, 2) mismatch)\n ACTUAL: array([1., 2., 3.])\n DESIRED: array([[1., 2.],\n       [1., 2.]])"
        },
        "assert_allclose_strict": {
          "decision": false,
          "exception": "AssertionError",
          "detail": "\nNot equal to tolerance rtol=0, atol=0\n\n(shapes (3,), (2, 2) mismatch)\n ACTUAL: array([1., 2., 3.])\n DESIRED: array([[1., 2.],\n       [1., 2.]])"
        },
        "explicit_contract": {
          "decision": false,
          "failed_contract_fields": [
            "shape"
          ],
          "value_check_ran": false
        }
      }
    },
    {
      "case": "unequal_rows",
      "label": "Unequal desired rows",
      "actual": {
        "shape": [
          2
        ],
        "dtype": "float64",
        "values": [
          1.0,
          2.0
        ]
      },
      "desired": {
        "shape": [
          2,
          2
        ],
        "dtype": "float64",
        "values": [
          [
            1.0,
            2.0
          ],
          [
            3.0,
            4.0
          ]
        ]
      },
      "broadcast_expansion": {
        "shape": [
          2,
          2
        ],
        "actual": [
          [
            1.0,
            2.0
          ],
          [
            1.0,
            2.0
          ]
        ],
        "desired": [
          [
            1.0,
            2.0
          ],
          [
            3.0,
            4.0
          ]
        ]
      },
      "results": {
        "allclose": {
          "decision": false
        },
        "assert_allclose_non_strict": {
          "decision": false,
          "exception": "AssertionError",
          "detail": "\nNot equal to tolerance rtol=0, atol=0\n\n(shapes (2,), (2, 2) mismatch)\n ACTUAL: array([1., 2.])\n DESIRED: array([[1., 2.],\n       [3., 4.]])"
        },
        "assert_allclose_strict": {
          "decision": false,
          "exception": "AssertionError",
          "detail": "\nNot equal to tolerance rtol=0, atol=0\n\n(shapes (2,), (2, 2) mismatch)\n ACTUAL: array([1., 2.])\n DESIRED: array([[1., 2.],\n       [3., 4.]])"
        },
        "explicit_contract": {
          "decision": false,
          "failed_contract_fields": [
            "shape"
          ],
          "value_check_ran": false
        }
      }
    }
  ],
  "authored_checks": [
    {
      "case": "exact_matrix",
      "expected": {
        "allclose": true,
        "assert_allclose_non_strict": true,
        "assert_allclose_strict": true,
        "explicit_contract": true
      },
      "observed": {
        "allclose": true,
        "assert_allclose_non_strict": true,
        "assert_allclose_strict": true,
        "explicit_contract": true
      },
      "passed": true
    },
    {
      "case": "missing_row_axis",
      "expected": {
        "allclose": true,
        "assert_allclose_non_strict": false,
        "assert_allclose_strict": false,
        "explicit_contract": false
      },
      "observed": {
        "allclose": true,
        "assert_allclose_non_strict": false,
        "assert_allclose_strict": false,
        "explicit_contract": false
      },
      "passed": true
    },
    {
      "case": "singleton_column",
      "expected": {
        "allclose": true,
        "assert_allclose_non_strict": false,
        "assert_allclose_strict": false,
        "explicit_contract": false
      },
      "observed": {
        "allclose": true,
        "assert_allclose_non_strict": false,
        "assert_allclose_strict": false,
        "explicit_contract": false
      },
      "passed": true
    },
    {
      "case": "scalar",
      "expected": {
        "allclose": true,
        "assert_allclose_non_strict": true,
        "assert_allclose_strict": false,
        "explicit_contract": false
      },
      "observed": {
        "allclose": true,
        "assert_allclose_non_strict": true,
        "assert_allclose_strict": false,
        "explicit_contract": false
      },
      "passed": true
    },
    {
      "case": "dtype_only",
      "expected": {
        "allclose": true,
        "assert_allclose_non_strict": true,
        "assert_allclose_strict": false,
        "explicit_contract": false
      },
      "observed": {
        "allclose": true,
        "assert_allclose_non_strict": true,
        "assert_allclose_strict": false,
        "explicit_contract": false
      },
      "passed": true
    },
    {
      "case": "wrong_value",
      "expected": {
        "allclose": false,
        "assert_allclose_non_strict": false,
        "assert_allclose_strict": false,
        "explicit_contract": false
      },
      "observed": {
        "allclose": false,
        "assert_allclose_non_strict": false,
        "assert_allclose_strict": false,
        "explicit_contract": false
      },
      "passed": true
    },
    {
      "case": "incompatible",
      "expected": {
        "allclose": "ValueError",
        "assert_allclose_non_strict": false,
        "assert_allclose_strict": false,
        "explicit_contract": false
      },
      "observed": {
        "allclose": "ValueError",
        "assert_allclose_non_strict": false,
        "assert_allclose_strict": false,
        "explicit_contract": false
      },
      "passed": true
    },
    {
      "case": "unequal_rows",
      "expected": {
        "allclose": false,
        "assert_allclose_non_strict": false,
        "assert_allclose_strict": false,
        "explicit_contract": false
      },
      "observed": {
        "allclose": false,
        "assert_allclose_non_strict": false,
        "assert_allclose_strict": false,
        "explicit_contract": false
      },
      "passed": true
    }
  ],
  "all_checks_passed": true,
  "counts": {
    "main_cases": 8,
    "decisions": 32,
    "excluded_cases": 0,
    "authored_case_checks": 8
  },
  "limits": [
    "Eight designed finite arrays are not a sample of benchmark failures or a prevalence estimate.",
    "Broadcasting is documented NumPy behavior; no NumPy bug, existing kernel/grader defect or vulnerability is claimed.",
    "Exact shape and dtype are declared requirements of this example, not universal requirements for every task.",
    "Zero tolerance and exactly representable small integers isolate shape/dtype rules; this is not a numerical-tolerance recommendation.",
    "No GPU, PyTorch, model training, timing, throughput, economic or provider-comparison experiment.",
    "Strict assert_allclose is not a complete kernel contract: aliasing, layout, mutation, device and additional semantic requirements remain separate."
  ]
}
