Java bindings: evaluate replacing hand-written JNI with the Foreign Function & Memory API

Abierto
#1,794 1 comentario 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@hlinsen ya está trabajando en esto.

Desde el 25/8/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

The Java bindings added in #1524 are hand-written JNI. Java 22 and later ship the Foreign Function & Memory API (JEP 454), which calls the C API directly and would remove cuopt_jni.cpp and its build entirely.

Why it was not done now: the bindings target Java 17, which is still a common default. An earlier revision of #1524 did use FFM and required Java 22 or higher.

Trade-off to settle:

  • Hand-written JNI keeps the Java 17 floor, but every static native declaration and its entry point must be kept in sync by hand. #1524 adds scripts/check_jni_symbols.sh to catch drift, since JNI resolves lazily and a mismatch otherwise surfaces only when something calls the method.
  • FFM removes the native shim and the drift class of bug, at the cost of requiring Java 22+.

cuVS uses FFM (via jextract) for its Java interface, so there is in-house precedent for the tooling.

Raised by @mlubin in review: https://github.com/NVIDIA/cuopt/pull/1524#discussion_r3839538078

Part of #1535.

Lenguaje dominante
Cuda
Estrellas
1.1k
Forks
255
Merge medio
1 d 22 h
PR fusionados (30 d)
102

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

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.