Median aggregation overflows for large finite middle values
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- data
Línea de trabajo
Empieza por el cálculo de la mediana en packages/table-core/src/features/row-aggregation/aggregationFns.ts y las pruebas de regresión específicas de Vitest descritas en la issue. Comprueba cómo maneja el cálculo los pares de valores finitos grandes junto con entradas subnormales, cero, NaN e infinito. Se considerará terminado cuando los casos de desbordamiento devuelvan medianas finitas y los controles enumerados conserven su comportamiento actual.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
TanStack Table version
@tanstack/table-core 9.3.1, main at c14e0221b1e656c7bb35e7b3d4cdf188719a3599.
Framework/Library version
Framework-independent aggregation API; reproduced with Node 24.19.0.
Describe the bug and the steps to reproduce it
The even-length median adds the two middle values before dividing by two. That intermediate addition can overflow even when the median is finite and representable.
For example, the median of [Number.MAX_VALUE, Number.MAX_VALUE] is Number.MAX_VALUE, but the current implementation returns Infinity. The negative equivalent returns -Infinity. Unequal large finite pairs have the same issue.
The fix should also preserve tiny/subnormal results: always dividing both operands first would turn the median of [Number.MIN_VALUE, Number.MIN_VALUE] into zero. The existing zero, NaN and infinity behavior should remain unchanged.
Your Minimal, Reproducible Example
Run this with Node 24 from a checkout; this source module only has type imports and needs no framework setup:
import { aggregationFn_median } from './packages/table-core/src/features/row-aggregation/aggregationFns.ts'
const context = values => ({
rows: values.map(value => ({ value })),
getValue: row => row.value,
})
console.log(aggregationFn_median.aggregate(context([
Number.MAX_VALUE,
Number.MAX_VALUE,
]))) // Infinity; expected Number.MAX_VALUE
Source of the current median calculation.
Four focused Vitest overflow regressions fail on main, while six controls pass (opposite signs, subnormal values, ordinary numbers, signed zero and non-finite inputs).
Do you intend to try to help solve this bug with your own PR?
Yes. I am preparing a small fallback for intermediate overflow and will complete the repository's required checks before opening a PR.
- Lenguaje dominante
- TypeScript
- Estrellas
- 28.5k
- Forks
- 3.6k
- Merge medio
- 18 h 5 min
- PR fusionados (30 d)
- 12
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TanStack/table
-
Column resize does not end if mouseup is missed (screenshot, switching tabs)Posiblemente ocupada @lx3133584 la tomó hoy. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
svelte-table: controlled expanded and pagination state resets straight after every changePosiblemente ocupada @NickSpag la tomó hace 15 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
TanStack/table#6601 · 5 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Cast required to access custom options when defining a custom plugin/featurePosiblemente ocupada @sorena-paydar la tomó hace 45 días. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
`aggregatedCell` not typed against bound `cellComponents` in `createAppColumnHelper`Posiblemente ocupada @cpruijsen la tomó hace 56 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
Todos los issues de TanStack/table
Issues similares
-
Add: ESP 2 ROAbiertoapproved check:passed streams:add
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
ipaas: Configure form shows "Deploy to apply." and "Overrides selected Link" when they don't applyAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
wso2/integration-control-plane#1118 ·
Los mantenedores suelen responder en 1 día
-
File reporting form UI DesignAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
UTDNebula/utd-notebook#311 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
binding:python bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día