cargo mutants: missed mutants in vortex-sparse

Aberta
#12,634 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
68/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
rust
Domínio
databases, testing

Direção de pesquisa

Start with encodings/sparse/src/lib.rs at SparseData::encode, around line 520, and inspect the three surviving mutant reports linked in the issue. Identify or add tests that fail when the null-count threshold comparison or its multiplication changes; run cargo mutants -f encodings/sparse/src/lib.rs -F ':520:42:' and cargo mutants -f encodings/sparse/src/lib.rs -F ':520:49:' to check them. Done when tests kill the reported mutants.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

The nightly run at fdb9507c04e2939724aa39c298653a8ea3fd3b49 found 3 mutants in vortex-sparse that survive the tests. They are in code that changed during the last day.

Artifacts:

encodings/sparse/src/lib.rs:520:42

replace > with == in SparseData::encode

--- encodings/sparse/src/lib.rs
+++ replace > with == in SparseData::encode
@@ -512,17 +512,17 @@
         let mask = array.validity()?.execute_mask(array.len(), ctx)?;
 
         if mask.all_false() {
             // Array is constant NULL
             return Ok(
                 ConstantArray::new(Scalar::null(array.dtype().clone()), array.len()).into_array(),
             );
         } else if (fill_value.as_ref().is_some_and(Scalar::is_null) && !mask.all_true())
-            || mask.false_count() as f64 > (0.9 * mask.len() as f64)
+            || mask.false_count() as f64 == /* ~ changed by cargo-mutants ~ */ (0.9 * mask.len() as f64)
         {
             // Array uses a null fill and has both nulls and non-null values.
             // The values are stored as they are, so their validity must not stay a lazy filter
             // over the input's bitmap, which may itself be compressed.
             let non_null_values = array
                 .filter(mask.clone())?
                 .execute::<CanonicalValidity>(ctx)?
                 .0
cargo mutants -f encodings/sparse/src/lib.rs -F ':520:42:'
encodings/sparse/src/lib.rs:520:42

replace > with >= in SparseData::encode

--- encodings/sparse/src/lib.rs
+++ replace > with >= in SparseData::encode
@@ -512,17 +512,17 @@
         let mask = array.validity()?.execute_mask(array.len(), ctx)?;
 
         if mask.all_false() {
             // Array is constant NULL
             return Ok(
                 ConstantArray::new(Scalar::null(array.dtype().clone()), array.len()).into_array(),
             );
         } else if (fill_value.as_ref().is_some_and(Scalar::is_null) && !mask.all_true())
-            || mask.false_count() as f64 > (0.9 * mask.len() as f64)
+            || mask.false_count() as f64 >= /* ~ changed by cargo-mutants ~ */ (0.9 * mask.len() as f64)
         {
             // Array uses a null fill and has both nulls and non-null values.
             // The values are stored as they are, so their validity must not stay a lazy filter
             // over the input's bitmap, which may itself be compressed.
             let non_null_values = array
                 .filter(mask.clone())?
                 .execute::<CanonicalValidity>(ctx)?
                 .0
cargo mutants -f encodings/sparse/src/lib.rs -F ':520:42:'
encodings/sparse/src/lib.rs:520:49

replace * with + in SparseData::encode

--- encodings/sparse/src/lib.rs
+++ replace * with + in SparseData::encode
@@ -512,17 +512,17 @@
         let mask = array.validity()?.execute_mask(array.len(), ctx)?;
 
         if mask.all_false() {
             // Array is constant NULL
             return Ok(
                 ConstantArray::new(Scalar::null(array.dtype().clone()), array.len()).into_array(),
             );
         } else if (fill_value.as_ref().is_some_and(Scalar::is_null) && !mask.all_true())
-            || mask.false_count() as f64 > (0.9 * mask.len() as f64)
+            || mask.false_count() as f64 > (0.9 + /* ~ changed by cargo-mutants ~ */ mask.len() as f64)
         {
             // Array uses a null fill and has both nulls and non-null values.
             // The values are stored as they are, so their validity must not stay a lazy filter
             // over the input's bitmap, which may itself be compressed.
             let non_null_values = array
                 .filter(mask.clone())?
                 .execute::<CanonicalValidity>(ctx)?
                 .0
cargo mutants -f encodings/sparse/src/lib.rs -F ':520:49:'
Linguagem predominante
Rust
Estrelas
3.2k
Forks
239
Merge médio
1d 4h
PRs com merge (30d)
684

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de vortex-data/vortex

Todas as issues de vortex-data/vortex

Issues semelhantes

Mais issues de Rust

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.