cargo mutants: missed mutants in vortex-sparse

オープン
#12,634 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
databases, testing

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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:'
主要言語
Rust
スター
3.2k
フォーク
239
平均マージ
1日 4時間
マージ済み PR(30日)
684

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

vortex-data/vortex のほかの issue

vortex-data/vortex の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。