configure(): large finite projection planes pass validation but overflow the lens

Abierto
#110 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
cpp

Línea de trabajo

Start with nftRuntimeSettingsValid() in NFTRuntimeSettings.h, then read arglCameraFrustumRH() in lib/SRC/AR/paramGL.c to understand which plane calculations can overflow. Find the existing settings or lens tests and add coverage for large finite planes; done means configure() rejects the unsafe values instead of returning success with a non-finite lens.

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

Descripción

Problem

nftRuntimeSettingsValid() (NFTRuntimeSettings.h) accepts any planes that are finite and ordered (nearPlane > 0, farPlane > nearPlane). The lens is then built by arglCameraFrustumRH() (lib/SRC/AR/paramGL.c), which computes depth terms from far + near, near - far and 2 * far * near.

With very large finite planes, for example near = 1e200 and far = 1e300, the product overflows. configure() returns success, yet the camera lens holds inf or NaN entries. When ARdouble is float (ARDOUBLE_IS_FLOAT), the overflow starts much sooner, from about far * near > 3.4e38.

Impact

Low. No realistic AR configuration uses such planes; the defaults are 0.1 and 1000. Still, configure() promises to reject what it cannot honour (D7 of the design), and here it reports success and leaves an unusable projection matrix.

Proposed fix

Choose one:

  • In nftRuntimeSettingsValid(), check that far + near, near - far and 2 * far * near are finite in ARdouble before accepting the planes.
  • Or add a generous upper bound to farPlane, documented in the D7 range comment.

Add a test with large finite planes that pass validation today and produce a non-finite lens.

Found in the Qodo review of #109 (release 0.12.0). The code came in with #106.

Lenguaje dominante
C++
Estrellas
21
Forks
8
Merge medio
3 h 42 min
PR fusionados (30 d)
22

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 webarkit/WebARKitLib

Todos los issues de webarkit/WebARKitLib

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.