[BUG] Constraint validation reports CSR offset count as the number of rows

Aperta Adatta ai principianti
#2,274 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@0z5a ci sta già lavorando.

Dal 4/11/2026.

  • #2275 di @0z5a — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend, databases

Direzione di ricerca

Leggi cpp/src/pdlp/utilities/problem_checking.cu intorno al controllo RHS alle righe 201–208, quindi esamina i due controlli dei limiti menzionati nel rapporto. Confronta il numero di righe usato in ciascun messaggio di errore con il calcolo offsets.size() - 1 della convalida. Il lavoro è completato quando i vettori RHS e dei limiti malformati riportano il numero effettivo di righe della matrice; esegui i test di convalida pertinenti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Bug

When the length of a constraint vector does not match the CSR matrix, the solver rejects the model, but the validation message reports the length of the CSR offsets array as the number of matrix rows. For a two-row matrix, a three-element RHS can therefore produce the contradictory message:

The right hand side vector has size 3 and the number of rows (constraints) in the matrix is 3.

The actual matrix has two rows (offsets = [0, 1, 2]). The lower/upper-bound representation has the same diagnostic issue. The validation itself rejected the malformed models in the cases checked; this report does not assert an out-of-bounds access.

Reproducer

import numpy as np
from cuopt.linear_programming.data_model import DataModel
from cuopt.linear_programming.solver import Solve
from cuopt.linear_programming.solver_settings import SolverMethod, SolverSettings

model = DataModel()
model.set_csr_constraint_matrix(
    np.array([1.0, 1.0]),
    np.array([0, 0], dtype=np.int32),
    np.array([0, 1, 2], dtype=np.int32),
)
model.set_objective_coefficients(np.array([1.0]))
model.set_variable_lower_bounds(np.array([0.0]))
model.set_variable_upper_bounds(np.array([np.inf]))
model.set_variable_types(np.array(["C"], dtype="S1"))
model.set_constraint_bounds(np.array([1.0, 2.0, 3.0]))
model.set_row_types(np.array(["G", "G", "G"]))

settings = SolverSettings()
settings.set_parameter("method", SolverMethod.PDLP)
settings.set_parameter("time_limit", 10.0)
settings.set_parameter("log_to_console", False)
solution = Solve(model, settings)
print(solution.get_error_status(), solution.get_error_message())

Expected: a validation error reporting 2 matrix rows. Observed with cuOpt 26.12.00a62 (52d14b4c), CUDA 13, B300: a validation error reporting 3 rows. A valid two-element RHS/row-types control solves to Optimal.

At 52d14b4c, the RHS check compares against offsets.size() - 1 but formats offsets.size(); the two bounds checks use the same pattern. Related: #2254.

Lingua principale
Cuda
Stelle
1.1k
Fork
255
Merge medio
1g 11h
PR unite (30g)
123

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NVIDIA/cuopt

Tutte le issue di NVIDIA/cuopt

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.