cargo mutants: missed mutants in vortex-scan
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 58/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- rust
- 領域
- backend, testing-qa
研究方向
Start by reviewing the listed mutant diffs in vortex-scan/src/execution/retain.rs and vortex-scan/src/execution/filter.rs, then inspect the nightly run artifacts for the remaining mutants. Run the focused cargo mutants commands shown in the issue to reproduce survivors and identify missing behavioral coverage. Done when tests in vortex-scan fail for the reported mutations and pass with the original code.
由索引模型根據 Issue 內容生成。
描述
The nightly run at fdb9507c04e2939724aa39c298653a8ea3fd3b49 found 19 mutants in vortex-scan that survive the tests. They are in code that changed during the last day.
Artifacts:
- mutants-0
- mutants-2
- mutants-13
- mutants-1
- mutants-3
- mutants-6
- mutants-10
- mutants-5
- mutants-4
- mutants-11
- mutants-9
- mutants-12
- mutants-15
- mutants-14
vortex-scan/src/execution/retain.rs:134:28
replace * with + in RetainedSegments::evict
--- vortex-scan/src/execution/retain.rs
+++ replace * with + in RetainedSegments::evict
@@ -126,17 +126,17 @@
self.evict(&mut shard.write(), id);
}
}
/// Evicts segments of `state` until the retained bytes fit the budget, keeping `keep`.
fn evict(&self, state: &mut State, keep: SegmentId) {
// Two passes over the shard's queue clear every mark once, so the loop ends even when
// the shard holds only the kept segment.
- let mut visits = 2 * state.queue.len();
+ let mut visits = 2 + /* ~ changed by cargo-mutants ~ */ state.queue.len();
while visits > 0 && self.bytes.load(Ordering::Relaxed) > self.budget {
visits -= 1;
let Some(oldest) = state.queue.pop_front() else {
break;
};
let Some(retained) = state.segments.get(&oldest) else {
continue;
};
cargo mutants -f vortex-scan/src/execution/retain.rs -F ':134:28:'
vortex-scan/src/execution/retain.rs:136:20
replace -= with += in RetainedSegments::evict
--- vortex-scan/src/execution/retain.rs
+++ replace -= with += in RetainedSegments::evict
@@ -128,17 +128,17 @@
}
/// Evicts segments of `state` until the retained bytes fit the budget, keeping `keep`.
fn evict(&self, state: &mut State, keep: SegmentId) {
// Two passes over the shard's queue clear every mark once, so the loop ends even when
// the shard holds only the kept segment.
let mut visits = 2 * state.queue.len();
while visits > 0 && self.bytes.load(Ordering::Relaxed) > self.budget {
- visits -= 1;
+ visits += /* ~ changed by cargo-mutants ~ */ 1;
let Some(oldest) = state.queue.pop_front() else {
break;
};
let Some(retained) = state.segments.get(&oldest) else {
continue;
};
// The segment being inserted is about to be used, and a segment used since it was
// queued goes to the back once, unmarked.
cargo mutants -f vortex-scan/src/execution/retain.rs -F ':136:20:'
vortex-scan/src/execution/retain.rs:136:20
replace -= with /= in RetainedSegments::evict
--- vortex-scan/src/execution/retain.rs
+++ replace -= with /= in RetainedSegments::evict
@@ -128,17 +128,17 @@
}
/// Evicts segments of `state` until the retained bytes fit the budget, keeping `keep`.
fn evict(&self, state: &mut State, keep: SegmentId) {
// Two passes over the shard's queue clear every mark once, so the loop ends even when
// the shard holds only the kept segment.
let mut visits = 2 * state.queue.len();
while visits > 0 && self.bytes.load(Ordering::Relaxed) > self.budget {
- visits -= 1;
+ visits /= /* ~ changed by cargo-mutants ~ */ 1;
let Some(oldest) = state.queue.pop_front() else {
break;
};
let Some(retained) = state.segments.get(&oldest) else {
continue;
};
// The segment being inserted is about to be used, and a segment used since it was
// queued goes to the back once, unmarked.
cargo mutants -f vortex-scan/src/execution/retain.rs -F ':136:20:'
vortex-scan/src/execution/filter.rs:172:9
replace FilterPlans::dynamic_versions -> Vec<Option<u64>> with vec![Some(0)]
--- vortex-scan/src/execution/filter.rs
+++ replace FilterPlans::dynamic_versions -> Vec<Option<u64>> with vec![Some(0)]
@@ -164,19 +164,17 @@
fn dynamic_version(&self, conjunct_idx: usize) -> Option<u64> {
self.expression
.dynamic_updates(conjunct_idx)
.map(DynamicExprUpdates::version)
}
/// The current version of each conjunct's dynamic values, `None` for a static conjunct.
pub(crate) fn dynamic_versions(&self) -> Vec<Option<u64>> {
- (0..self.conjuncts.len())
- .map(|idx| self.dynamic_version(idx))
- .collect()
+ vec![Some(0)] /* ~ changed by cargo-mutants ~ */
}
/// Whether the conjunct is dynamic and, at its current values, kept almost every row on its
/// last evaluations, so a scan that may skip unselective dynamic conjuncts skips it.
pub(crate) fn is_unselective(&self, conjunct_idx: usize) -> bool {
self.conjuncts[conjunct_idx]
.dynamic
.as_ref()
cargo mutants -f vortex-scan/src/execution/filter.rs -F ':172:9:'
vortex-scan/src/execution/filter.rs:213:60
replace && with || in FilterPlans::scan_pruning
--- vortex-scan/src/execution/filter.rs
+++ replace && with || in FilterPlans::scan_pruning
@@ -205,17 +205,17 @@
skip_unselective_dynamic: bool,
) -> impl Iterator<Item = &PlanRef> {
let small = rows <= FILTERED_ROWS_PER_CHUNK as u64;
self.conjuncts
.iter()
.enumerate()
.filter(move |(idx, conjunct)| {
conjunct.dynamic.is_none()
- || !(small || skip_unselective_dynamic && self.is_unselective(*idx))
+ || !(small || skip_unselective_dynamic || /* ~ changed by cargo-mutants ~ */ self.is_unselective(*idx))
})
.flat_map(|(_, conjunct)| &conjunct.pruning)
}
/// The pruning plans of the dynamic conjuncts whose values changed since `versions`, from
/// [`dynamic_versions`](Self::dynamic_versions): a chunk prunes with them again before its
/// conjuncts run, as their new values may exclude zones the scan's pruning kept.
pub(crate) fn moved_dynamic_pruning(
cargo mutants -f vortex-scan/src/execution/filter.rs -F ':213:60:'
vortex-scan/src/execution/filter.rs:232:51
replace && with || in FilterPlans::moved_dynamic_pruning
--- vortex-scan/src/execution/filter.rs
+++ replace && with || in FilterPlans::moved_dynamic_pruning
@@ -224,17 +224,17 @@
skip_unselective_dynamic: bool,
) -> Vec<PlanRef> {
self.conjuncts
.iter()
.enumerate()
.filter(|(idx, conjunct)| {
conjunct.dynamic.is_some()
&& self.dynamic_version(*idx) != versions[*idx]
- && !(skip_unselective_dynamic && self.is_unselective(*idx))
+ && !(skip_unselective_dynamic || /* ~ changed by cargo-mutants ~ */ self.is_unselective(*idx))
})
.flat_map(|(_, conjunct)| conjunct.pruning.iter().cloned())
.collect()
}
/// Whether any dynamic conjunct has a pruning plan, so its chunks may prune again.
pub(crate) fn has_dynamic_pruning(&self) -> bool {
self.conjuncts
cargo mutants -f vortex-scan/src/execution/filter.rs -F ':232:51:'
vortex-scan/src/execution/filter.rs:240:9
replace FilterPlans::has_dynamic_pruning -> bool with true
--- vortex-scan/src/execution/filter.rs
+++ replace FilterPlans::has_dynamic_pruning -> bool with true
@@ -232,19 +232,17 @@
&& !(skip_unselective_dynamic && self.is_unselective(*idx))
})
.flat_map(|(_, conjunct)| conjunct.pruning.iter().cloned())
.collect()
}
/// Whether any dynamic conjunct has a pruning plan, so its chunks may prune again.
pub(crate) fn has_dynamic_pruning(&self) -> bool {
- self.conjuncts
- .iter()
- .any(|conjunct| conjunct.dynamic.is_some() && !conjunct.pruning.is_empty())
+ true /* ~ changed by cargo-mutants ~ */
}
}
/// A pruning plan must not fetch data, materialize row indices, or execute unresolved statistics
/// when its requested statistics are unavailable.
fn metadata_only(plan: &PlanRef) -> VortexResult<bool> {
if plan
.as_opt::<Zoned>()
cargo mutants -f vortex-scan/src/execution/filter.rs -F ':240:9:'
vortex-scan/src/execution/filter.rs:242:56
replace && with || in FilterPlans::has_dynamic_pruning
--- vortex-scan/src/execution/filter.rs
+++ replace && with || in FilterPlans::has_dynamic_pruning
@@ -234,17 +234,17 @@
.flat_map(|(_, conjunct)| conjunct.pruning.iter().cloned())
.collect()
}
/// Whether any dynamic conjunct has a pruning plan, so its chunks may prune again.
pub(crate) fn has_dynamic_pruning(&self) -> bool {
self.conjuncts
.iter()
- .any(|conjunct| conjunct.dynamic.is_some() && !conjunct.pruning.is_empty())
+ .any(|conjunct| conjunct.dynamic.is_some() || /* ~ changed by cargo-mutants ~ */ !conjunct.pruning.is_empty())
}
}
/// A pruning plan must not fetch data, materialize row indices, or execute unresolved statistics
/// when its requested statistics are unavailable.
fn metadata_only(plan: &PlanRef) -> VortexResult<bool> {
if plan
.as_opt::<Zoned>()
cargo mutants -f vortex-scan/src/execution/filter.rs -F ':242:56:'
vortex-scan/src/execution/filter.rs:363:17
replace && with || in FilterPlanner::start_next
--- vortex-scan/src/execution/filter.rs
+++ replace && with || in FilterPlanner::start_next
@@ -355,17 +355,17 @@
);
continue;
}
Some(_) => self.filter.dynamic_version(conjunct),
};
let predicate = self.filter.conjuncts[conjunct].predicate.clone();
// For dense selections, evaluate the vectorized predicate before gathering rows.
let predicate = if !selected.mask.all_true()
- && selected.mask.true_count().saturating_mul(2) >= selected.mask.len()
+ || /* ~ changed by cargo-mutants ~ */ selected.mask.true_count().saturating_mul(2) >= selected.mask.len()
{
FilterPlan::new(predicate).into_plan()
} else {
predicate
};
let scan = Scan::try_new(
self.scan.session.clone(),
predicate,
cargo mutants -f vortex-scan/src/execution/filter.rs -F ':363:17:'
vortex-scan/src/execution/filter.rs:362:32
delete ! in FilterPlanner::start_next
--- vortex-scan/src/execution/filter.rs
+++ delete ! in FilterPlanner::start_next
@@ -354,17 +354,17 @@
"v2 filter conjunct switched off"
);
continue;
}
Some(_) => self.filter.dynamic_version(conjunct),
};
let predicate = self.filter.conjuncts[conjunct].predicate.clone();
// For dense selections, evaluate the vectorized predicate before gathering rows.
- let predicate = if !selected.mask.all_true()
+ let predicate = if /* ~ changed by cargo-mutants ~ */selected.mask.all_true()
&& selected.mask.true_count().saturating_mul(2) >= selected.mask.len()
{
FilterPlan::new(predicate).into_plan()
} else {
predicate
};
let scan = Scan::try_new(
self.scan.session.clone(),
cargo mutants -f vortex-scan/src/execution/filter.rs -F ':362:32:'
vortex-scan/src/execution/filter.rs:363:65
replace >= with < in FilterPlanner::start_next
--- vortex-scan/src/execution/filter.rs
+++ replace >= with < in FilterPlanner::start_next
@@ -355,17 +355,17 @@
);
continue;
}
Some(_) => self.filter.dynamic_version(conjunct),
};
let predicate = self.filter.conjuncts[conjunct].predicate.clone();
// For dense selections, evaluate the vectorized predicate before gathering rows.
let predicate = if !selected.mask.all_true()
- && selected.mask.true_count().saturating_mul(2) >= selected.mask.len()
+ && selected.mask.true_count().saturating_mul(2) < /* ~ changed by cargo-mutants ~ */ selected.mask.len()
{
FilterPlan::new(predicate).into_plan()
} else {
predicate
};
let scan = Scan::try_new(
self.scan.session.clone(),
predicate,
cargo mutants -f vortex-scan/src/execution/filter.rs -F ':363:65:'
vortex-scan/src/execution/filter.rs:445:33
replace match guard evaluation.adaptor.state() != State::Done with false in <impl Planner for FilterPlanner>::state
--- vortex-scan/src/execution/filter.rs
+++ replace match guard evaluation.adaptor.state() != State::Done with false in <impl Planner for FilterPlanner>::state
@@ -437,17 +437,17 @@
}
impl Planner for FilterPlanner {
fn state(&self) -> State {
if self.selected.is_none() {
return State::Done;
}
match &self.active {
- Some(evaluation) if evaluation.adaptor.state() != State::Done => {
+ Some(evaluation) if false /* ~ changed by cargo-mutants ~ */ => {
evaluation.adaptor.state()
}
_ => State::NeedsCompute,
}
}
fn compute(&mut self) -> VortexResult<PlannerOutput> {
let Some(selected) = &self.selected else {
cargo mutants -f vortex-scan/src/execution/filter.rs -F ':445:33:'
vortex-scan/src/execution/selection.rs:26:60
replace - with + in select_chunk
--- vortex-scan/src/execution/selection.rs
+++ replace - with + in select_chunk
@@ -18,17 +18,17 @@
scope: WorkScope,
selection: &Selection,
kept: Option<(&Mask, u64)>,
) -> Option<SelectedRows> {
let selected = select_rows(scope, selection)?;
let Some((kept, first_row)) = kept else {
return Some(selected);
};
- let offset = usize::try_from(selected.scope.rows.start - first_row)
+ let offset = usize::try_from(selected.scope.rows.start + /* ~ changed by cargo-mutants ~ */ first_row)
.vortex_expect("a work chunk fits usize");
let kept = kept.slice(offset..offset + selected.mask.len());
SelectedRows::narrowed(selected.scope, &selected.mask & &kept)
}
impl SelectedRows {
/// The rows of `scope` that `mask`, over all of them, selects, bounded to their span, or
/// `None` when it selects none.
cargo mutants -f vortex-scan/src/execution/selection.rs -F ':26:60:'
vortex-scan/src/execution/planning/driver/mod.rs:173:34
replace || with && in Work::narrow
--- vortex-scan/src/execution/planning/driver/mod.rs
+++ replace || with && in Work::narrow
@@ -165,17 +165,17 @@
};
let Some(rows) = remaining else {
return Ok(());
};
let claimed = claim.rows();
if rows == *claimed {
return Ok(());
}
- if rows.start > rows.end || rows.start < claimed.start || rows.end > claimed.end {
+ if rows.start > rows.end && /* ~ changed by cargo-mutants ~ */ rows.start < claimed.start || rows.end > claimed.end {
vortex_bail!(
"work for scope {:?} reported remaining rows {rows:?} outside its claim {claimed:?}",
self.scope
);
}
claim.restrict_to(rows);
Ok(())
}
cargo mutants -f vortex-scan/src/execution/planning/driver/mod.rs -F ':173:34:'
vortex-scan/src/execution/planning/driver/mod.rs:173:48
replace < with == in Work::narrow
--- vortex-scan/src/execution/planning/driver/mod.rs
+++ replace < with == in Work::narrow
@@ -165,17 +165,17 @@
};
let Some(rows) = remaining else {
return Ok(());
};
let claimed = claim.rows();
if rows == *claimed {
return Ok(());
}
- if rows.start > rows.end || rows.start < claimed.start || rows.end > claimed.end {
+ if rows.start > rows.end || rows.start == /* ~ changed by cargo-mutants ~ */ claimed.start || rows.end > claimed.end {
vortex_bail!(
"work for scope {:?} reported remaining rows {rows:?} outside its claim {claimed:?}",
self.scope
);
}
claim.restrict_to(rows);
Ok(())
}
cargo mutants -f vortex-scan/src/execution/planning/driver/mod.rs -F ':173:48:'
vortex-scan/src/execution/planning/driver/mod.rs:173:48
replace < with <= in Work::narrow
--- vortex-scan/src/execution/planning/driver/mod.rs
+++ replace < with <= in Work::narrow
@@ -165,17 +165,17 @@
};
let Some(rows) = remaining else {
return Ok(());
};
let claimed = claim.rows();
if rows == *claimed {
return Ok(());
}
- if rows.start > rows.end || rows.start < claimed.start || rows.end > claimed.end {
+ if rows.start > rows.end || rows.start <= /* ~ changed by cargo-mutants ~ */ claimed.start || rows.end > claimed.end {
vortex_bail!(
"work for scope {:?} reported remaining rows {rows:?} outside its claim {claimed:?}",
self.scope
);
}
claim.restrict_to(rows);
Ok(())
}
cargo mutants -f vortex-scan/src/execution/planning/driver/mod.rs -F ':173:48:'
vortex-scan/src/execution/planning/driver/liveness/mod.rs:129:9
replace Liveness::pinned -> usize with 0
--- vortex-scan/src/execution/planning/driver/liveness/mod.rs
+++ replace Liveness::pinned -> usize with 0
@@ -121,17 +121,17 @@
_value: Box::new(value),
},
);
true
}
/// The number of values currently pinned.
pub fn pinned(&self) -> usize {
- self.state.lock().pins.len()
+ 0 /* ~ changed by cargo-mutants ~ */
}
fn add(&self, rows: &Range<u64>) {
self.state.lock().coverage.add(rows);
}
/// Releases one claim on `rows`. Evicted values are dropped after the lock is released, so
/// a value's destructor may use this liveness.
cargo mutants -f vortex-scan/src/execution/planning/driver/liveness/mod.rs -F ':129:9:'
vortex-scan/src/execution/planning/driver/liveness/coverage.rs:46:9
replace Coverage::join_at with ()
--- vortex-scan/src/execution/planning/driver/liveness/coverage.rs
+++ replace Coverage::join_at with ()
@@ -38,24 +38,17 @@
&& row < span.end
{
self.0.get_mut(&start).vortex_expect("span exists").end = row;
self.0.insert(row, span);
}
}
fn join_at(&mut self, row: u64) {
- if let Some((&start, &left)) = self.0.range(..row).next_back()
- && let Some(&right) = self.0.get(&row)
- && left.end == row
- && left.owners == right.owners
- {
- self.0.get_mut(&start).vortex_expect("span exists").end = right.end;
- self.0.remove(&row);
- }
+ () /* ~ changed by cargo-mutants ~ */
}
pub(super) fn add(&mut self, rows: &Range<u64>) {
if rows.is_empty() {
return;
}
self.split_at(rows.start);
self.split_at(rows.end);
cargo mutants -f vortex-scan/src/execution/planning/driver/liveness/coverage.rs -F ':46:9:'
vortex-scan/src/execution/planning/driver/liveness/coverage.rs:69:23
replace < with > in Coverage::add
--- vortex-scan/src/execution/planning/driver/liveness/coverage.rs
+++ replace < with > in Coverage::add
@@ -61,17 +61,17 @@
self.split_at(rows.end);
let starts: Vec<_> = self
.0
.range(rows.clone())
.map(|(&start, _)| start)
.collect();
let mut cursor = rows.start;
for start in starts {
- if cursor < start {
+ if cursor > /* ~ changed by cargo-mutants ~ */ start {
self.0.insert(
cursor,
Span {
end: start,
owners: 1,
},
);
}
cargo mutants -f vortex-scan/src/execution/planning/driver/liveness/coverage.rs -F ':69:23:'
- 主要語言
- Rust
- 星號
- 3.2k
- 分支
- 239
- 平均合併
- 1 天 4 小時
- 30 天內合併 PR
- 684
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
vortex-data/vortex 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 70/100
vortex-data/vortex#12633 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 77/100
vortex-data/vortex#12628 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 88/100
vortex-data/vortex#12491 ·
維護者通常 1 天內回覆
-
Fallible constructor for nested_case_when可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
vortex-data/vortex#11425 ·
維護者通常 1 天內回覆
-
難度 3/5 1-2 天 新手友好度 67/100
vortex-data/vortex#12635 ·
維護者通常 1 天內回覆
查看 vortex-data/vortex 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
area: plugins bug
難度 2/5 1-3 小時 新手友好度 72/100
clipy-recorder/clipy#1039 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 83/100
valkey-io/valkey-glide#7975 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
gofractally/psibase#2379 ·
維護者通常 3 天內回覆
-
Qwen stream parser: a chunk with "error": null is treated as a stream error可能已有人在做 @Beehtrix 今天認領。 未關閉area:models bug good first issue
難度 2/5 1-3 小時 新手友好度 88/100
維護者通常 2 天內回覆