OnPair trainer should draw Rust's sample (StdRng + partial_shuffle) for byte-identical dictionaries
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 22/100
Línea de trabajo
Start in OnPairEncodingEncoder.Encoder.train, which uses SplittableRandom(42) and a full Fisher-Yates shuffle, and compare it with the Rust training_order in encoding/trainer.rs. Port the partial_shuffle tail selection and doubling retry loop on top of SampleRng, and check that SampleRng.nextIntInclusive matches random_range from rand 0.9.5. Done when the 100k-row URL column gives the same dict_bytes_len and encoded size per chunk as the Rust 0.88.0 oracle.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
OnPairEncodingEncoder does not draw the same training sample as the Rust onpair crate, so it trains different dictionaries on identical data. Prime directive: behavioral parity with Rust.
Found by comparing a 100k-row URL column (https://example.com/products/<n>/reviews?page=<m>, 7 chunks of 16,384 rows) written by vortex-java and by Rust 0.88.0 (the release vortex-jni uses), both at cascade 3 with global dict off. Both pick vortex.onpair per chunk.
dict_bytes_len per chunk:
| chunk | Rust | Java |
|---|---|---|
| 0 | 8191 | 8429 |
| 1 | 8525 | 8368 |
| 2 | 8447 | 8387 |
| 3 | 8363 | 8452 |
| 4 | 8379 | 8473 |
| 5 | 8757 | 5670 |
| 6 | 1872 | 1877 |
Chunks 0-4 end up within 0.04% in total, but Java's chunk 5 is 18% smaller (131,904 B vs 161,507 B): its trainer built a 761-token dictionary and the cascade then dict-encoded the 467 distinct codes. That one chunk is 29.6 KB of the 31.6 KB (3.2%) by which Java's file is smaller. This is training luck, not a systematic advantage, and it could go the other way on other data.
Cause
- Rust (
onpair0.2.1,training_orderinencoding/trainer.rs):StdRng::seed_from_u64(42)(ChaCha12,rand0.9.5) andorder.partial_shuffle(&mut rng, k)withk = min(n, 2 * sample_fraction * n + 1024). Training consumes only the selected tailorder[n-k..]; if that tail is shorter than the byte budget,kdoubles and the shuffle restarts. - Java (
OnPairEncodingEncoder.Encoder.train):SplittableRandom(42), a full Fisher-Yates shuffle, and training consumesorderfrom the start.
Proposed fix
- Port
rand0.9.5partial_shuffleon top ofSampleRng(already a bit-exact ChaCha12StdRngandrandom_rangeforu32). It usesIncreasingUniform/calculate_bound_u32, which batches several swaps into one random chunk. Check thatSampleRng.nextIntInclusive(written againstrand0.10) gives the same values as 0.9.5'srandom_range. - Reproduce the
kcomputation, the tail consumption and the doubling retry loop intrain. - Parity test: the URL column above, Rust as the oracle, comparing
dict_bytes_lenand encoded size per chunk (expect identical).
Repro
Scratch crate with vortex = "=0.88.0"; data dumped from the Java CascadeDepthGainIntegrationTest patterns (utf8-urls), seed 42. Not committed.
- Lenguaje dominante
- Java
- Estrellas
- 3
- Forks
- 2
- Merge medio
- 9 h 47 min
- PR fusionados (30 d)
- 128
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 dfa1/vortex-java
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
dfa1/vortex-java#636 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 70/100
dfa1/vortex-java#655 ·
Los mantenedores suelen responder en 1 día
-
perf
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
dfa1/vortex-java#651 ·
Los mantenedores suelen responder en 1 día
-
Writer: string columns written as per-chunk dicts where Rust uses its dict layout (up to 2x larger)Abiertoperf
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
dfa1/vortex-java#650 ·
Los mantenedores suelen responder en 1 día
-
perf
Dificultad 4/5 3-5 días Aptitud para principiantes 28/100
dfa1/vortex-java#649 ·
Los mantenedores suelen responder en 1 día
Todos los issues de dfa1/vortex-java
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
a2aproject/a2a-java#1275 ·
Los mantenedores suelen responder en 1 día
-
module/ftp Type/Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ballerina-platform/ballerina-library#9476 ·
Los mantenedores suelen responder en 1 día
-
[Feature] 为世界管理页面添加打开存档文件夹按钮Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
HMCL-dev/HMCL#7175 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
anwilli5/coin-collection-android-US#515 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
FasterXML/jackson-databind#6398 ·
Los mantenedores suelen responder en 1 día