{"record":{"id":"5953a2ef2a650194","repo":"jax-ml/jax","slug":"self-should-have-the-same-core-axis-name-and-num-5953a2","errorCode":null,"errorMessage":"{self} should have the same core axis name and number of cores as the ScalarSubcoreMesh {other_mesh}.","messagePattern":"(.+?) should have the same core axis name and number of cores as the ScalarSubcoreMesh (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"jax/_src/pallas/mosaic/sc_core.py","lineNumber":176,"sourceCode":"  @property\n  def dimension_semantics(self) -> Sequence[tpu_core.DimensionSemantics]:\n    return [\n        tpu_core.GridDimensionSemantics.CORE_PARALLEL,\n        tpu_core.GridDimensionSemantics.SUBCORE_PARALLEL,\n    ]\n\n  def discharges_effect(self, effect):\n    del effect  # Unused.\n    return False\n\n  def check_is_compatible_with(self, other_mesh):\n    if isinstance(other_mesh, VectorSubcoreMesh):\n      raise ValueError(\"You can't use two different VectorSubcoreMeshes.\")\n    elif isinstance(other_mesh, ScalarSubcoreMesh):\n      if (other_mesh.axis_name == self.core_axis_name\n          and other_mesh.num_cores == self.num_cores):\n        return True\n      raise ValueError(f\"{self} should have the same core axis name and number\"\n                       f\" of cores as the ScalarSubcoreMesh {other_mesh}.\")\n    elif isinstance(other_mesh, tpu_core.TensorCoreMesh):\n      if self.core_axis_name == other_mesh.axis_name:\n        raise ValueError(\n            f\"{self} should have a different core axis name from the\"\n            f\" TensorCoreMesh {other_mesh}.\"\n        )\n      if self.subcore_axis_name == other_mesh.axis_name:\n        raise ValueError(\n            f\"{self} should have a different subcore axis name from the\"\n            f\" TensorCoreMesh {other_mesh}.\"\n        )\n      return True\n    return super().check_is_compatible_with(other_mesh)\n\n  @property\n  def supported_memory_spaces(self) -> Sequence[Any]:\n    return [","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/pallas/mosaic/sc_core.py#L158-L194","documentation":"VectorSubcoreMesh.check_is_compatible_with raises when paired with a ScalarSubcoreMesh whose axis_name/num_cores do not match the vector mesh's core_axis_name/num_cores. The two mesh views must agree on which cores they span.","triggerScenarios":"Mixing VectorSubcoreMesh and ScalarSubcoreMesh with differing core axis names or core counts.","commonSituations":"Renaming an axis in one mesh definition but not the other; deriving num_cores differently (hardcode vs hardware query).","solutions":["Make scalar_mesh.axis_name == vector_mesh.core_axis_name","Make num_cores equal on both","Centralize mesh constants in one config"],"exampleFix":"# before\nvec.check_is_compatible_with(pl_mosaic.ScalarSubcoreMesh(axis_name='sparse', num_cores=4))\n# after\nvec.check_is_compatible_with(pl_mosaic.ScalarSubcoreMesh(axis_name=vec.core_axis_name, num_cores=vec.num_cores))","handlingStrategy":"validation","validationCode":"def compatible(v, s):\n    return s.axis_name == v.core_axis_name and s.num_cores == v.num_cores","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Share a config for axis names and core counts across mesh types"],"tags":["jax","pallas","tpu","sparsecore","mesh-compat"],"backgroundTag":"mesh-incompatibility","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}