cargo mutants: missed mutants in vortex-sparse

Ouverte
#12,634 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
68/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
rust
Domaine
databases, testing

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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:'
Langage dominant
Rust
Étoiles
3.2k
Forks
239
Merge moyen
1 j 4 h
PR mergées (30 j)
684

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de vortex-data/vortex

Toutes les issues de vortex-data/vortex

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.