{"record":{"id":"2e46e8e37b3ad1f8","repo":"jax-ml/jax","slug":"position-position-is-out-of-range-for-clock-sel","errorCode":null,"errorMessage":"position {position} is out of range for clock {self.clock}","messagePattern":"position (.+?) is out of range for clock (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"jax/_src/pallas/mosaic/interpret/vector_clock.py","lineNumber":56,"sourceCode":"    self.clock = np.zeros(vector_clock_size, dtype=np.int32)\n\n  def copy(self) -> Self:\n    new = self.__new__(self.__class__)\n    new.clock = self.clock.copy()\n    return new\n\n  def update(self, other: Self) -> None:\n    self.clock[:] = np.maximum(self.clock[:], other.clock[:])\n\n  def lt(self, other: Self) -> bool:\n    return bool((self.clock <= other.clock).all() & (self.clock < other.clock).any())\n\n  def ordered(self, other: Self) -> bool:\n    return self.lt(other) or other.lt(self)\n\n  def inc(self, position: int) -> None:\n    if position >= len(self.clock):\n      raise ValueError(f'position {position} is out of range for clock {self.clock}')\n    assert position < len(self.clock)\n    self.clock[position] += 1\n","sourceCodeStart":38,"sourceCodeEnd":59,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/pallas/mosaic/interpret/vector_clock.py#L38-L59","documentation":"VectorClock.inc was called with a position index >= the clock's length. Each clock slot corresponds to one simulated thread/core; incrementing a slot beyond the clock means more threads are active than the clock was sized for.","triggerScenarios":"Race detection incrementing a clock for thread index >= vector_clock_size; typically when vector_clock_size was manually set too small relative to concurrently running simulated threads.","commonSituations":"Setting InterpretParams.vector_clock_size manually and under-sizing it; changing num_cores_or_threads without adjusting the clock; version changes in race-detection plumbing.","solutions":["Set vector_clock_size to None to use the automatic default (2x total cores/threads)","Set vector_clock_size > total number of simulated threads","Verify num_cores_or_threads matches the actual thread count used in the simulation"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"n_threads = num_devices * params.num_cores_or_threads\nsize = params.vector_clock_size if params.vector_clock_size is not None else 2 * n_threads\nassert position < size, 'clock position out of range; under-sized vector clock'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Leave vector_clock_size as None so it auto-sizes to 2x threads","Re-check clock sizing whenever num_cores_or_threads or device count changes"],"tags":["jax","pallas","mosaic","vector-clock","race-detection","config"],"backgroundTag":"invalid-configuration-value","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}