cargo mutants: missed mutants in vortex-sparse

未關閉
#12,634 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
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 小時
30 天內合併 PR
684

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

vortex-data/vortex 的其他 Issue

查看 vortex-data/vortex 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。