CI: nightly Cython build with bounds checking enabled

Abierto
#2,255 0 comentarios 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@ramakrishnap-nv ya está trabajando en esto.

Desde el 3/11/2026.

  • #2262 de @ramakrishnap-nv — abierto

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
22/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python

Línea de trabajo

Start with the file-level # cython: boundscheck=False and wraparound=False header in python/cuopt/cuopt/linear_programming/solver/solver_wrapper.pyx, and with how CYTHON_FLAGS reaches the build through rapids-cmake. Confirm whether a header directive overrides the flag, then measure the cost of checks in the nogil loops. Done means a nightly CI job builds with checks and runs the Python tests, with the design decision recorded. The issue has no chosen approach, so agree on one with maintainers first.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Problem

python/cuopt/cuopt/linear_programming/solver/solver_wrapper.pyx sets # cython: boundscheck=False and # cython: wraparound=False at file level. Out-of-bounds indexing in its nogil loops is therefore silent: CI passes and the result is garbage rather than an error. That is how #2249 (introduced with _compute_slack_csr in #1615) went unnoticed in 26.10.

Proposal

Add a nightly (not per-PR) CI job that builds the Python extension with bounds checking enabled and runs the Python test suite. A checked build would have raised IndexError as soon as the DataModel tests hit the bounds-only path.

Caveat to resolve first

A # cython: header comment in a file overrides command-line directives, so passing --directive boundscheck=True through rapids-cmake's CYTHON_FLAGS would not affect this file. Options:

  • Remove the file-level header and use @cython.boundscheck(False) / @cython.wraparound(False) only on the specific hot functions that need it, then enable checks globally in the checked build.
  • Make the header conditional in the checked configuration.

Neither has been tried. The overhead of checks in the hot loops should be measured, which is why release builds should stay unchecked.

Related: #2249, #2253, #1615.

Lenguaje dominante
Cuda
Estrellas
1.1k
Forks
249
Merge medio
1 d 15 h
PR fusionados (30 d)
126

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de NVIDIA/cuopt

Todos los issues de NVIDIA/cuopt

Issues similares

Más issues de Build System

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.