cargo mutants: missed mutants in vortex-array
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 65/100
Rechercherichtung
Start with vortex-array/src/executor/mod.rs, especially ArrayRef::execute_until and SharedResults; the issue identifies 32 surviving mutants and links to their run artifacts. Review the mutant reports to locate the affected behavior, then find or add tests that fail for the relevant mutations. Done means the tests detect the reported surviving mutants; the issue names no specific test file.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
The nightly run at fdb9507c04e2939724aa39c298653a8ea3fd3b49 found 32 mutants in vortex-array 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-array/src/executor/mod.rs:475:73
replace > with < in ArrayRef::execute_until
--- vortex-array/src/executor/mod.rs
+++ replace > with < in ArrayRef::execute_until
@@ -467,17 +467,17 @@
frame.slot_idx,
&frame.parent_array,
&result
));
current_array = result;
child_rewritten = true;
continue;
}
- if shared_results.other_parents(&stack, ¤t_array) > 0 {
+ if shared_results.other_parents(&stack, ¤t_array) < /* ~ changed by cargo-mutants ~ */ 0 {
keep_result_of = Some(current_array.clone());
}
}
let expected_len = current_array.len();
// Only the debug postcondition compares dtypes, so skip the clone otherwise.
let expected_dtype = cfg!(debug_assertions).then(|| current_array.dtype().clone());
// Share the existing stats handle instead of cloning the set; uninitialised stats stay lazy.
cargo mutants -f vortex-array/src/executor/mod.rs -F ':475:73:'
vortex-array/src/executor/mod.rs:475:73
replace > with == in ArrayRef::execute_until
--- vortex-array/src/executor/mod.rs
+++ replace > with == in ArrayRef::execute_until
@@ -467,17 +467,17 @@
frame.slot_idx,
&frame.parent_array,
&result
));
current_array = result;
child_rewritten = true;
continue;
}
- if shared_results.other_parents(&stack, ¤t_array) > 0 {
+ if shared_results.other_parents(&stack, ¤t_array) == /* ~ changed by cargo-mutants ~ */ 0 {
keep_result_of = Some(current_array.clone());
}
}
let expected_len = current_array.len();
// Only the debug postcondition compares dtypes, so skip the clone otherwise.
let expected_dtype = cfg!(debug_assertions).then(|| current_array.dtype().clone());
// Share the existing stats handle instead of cloning the set; uninitialised stats stay lazy.
cargo mutants -f vortex-array/src/executor/mod.rs -F ':475:73:'
vortex-array/src/executor/mod.rs:475:73
replace > with >= in ArrayRef::execute_until
--- vortex-array/src/executor/mod.rs
+++ replace > with >= in ArrayRef::execute_until
@@ -467,17 +467,17 @@
frame.slot_idx,
&frame.parent_array,
&result
));
current_array = result;
child_rewritten = true;
continue;
}
- if shared_results.other_parents(&stack, ¤t_array) > 0 {
+ if shared_results.other_parents(&stack, ¤t_array) >= /* ~ changed by cargo-mutants ~ */ 0 {
keep_result_of = Some(current_array.clone());
}
}
let expected_len = current_array.len();
// Only the debug postcondition compares dtypes, so skip the clone otherwise.
let expected_dtype = cfg!(debug_assertions).then(|| current_array.dtype().clone());
// Share the existing stats handle instead of cloning the set; uninitialised stats stay lazy.
cargo mutants -f vortex-array/src/executor/mod.rs -F ':475:73:'
vortex-array/src/executor/mod.rs:736:9
replace SharedResults::applies -> bool with true
--- vortex-array/src/executor/mod.rs
+++ replace SharedResults::applies -> bool with true
@@ -728,17 +728,17 @@
impl SharedResults {
/// Whether `array`, about to execute for `parent`, may have its result reused.
///
/// An expression places the same array under each of its references, and a filter pushed
/// below it places the array under each pushed-down filter, so only those parents look for an
/// array that another parent also holds. Checking every parent would cost each execution of
/// an array that its caller keeps, where every array is shared.
fn applies(&self, parent: &ArrayRef, array: &ArrayRef) -> bool {
- (parent.is::<ScalarFn>() || parent.is::<Filter>()) && array.is_shared()
+ true /* ~ changed by cargo-mutants ~ */
}
fn get(&self, array: &ArrayRef) -> Option<ArrayRef> {
if self.executed.is_empty() {
return None;
}
self.executed.get(&ArrayByPtr(array.clone())).cloned()
}
cargo mutants -f vortex-array/src/executor/mod.rs -F ':736:9:'
vortex-array/src/executor/mod.rs:736:9
replace SharedResults::applies -> bool with false
--- vortex-array/src/executor/mod.rs
+++ replace SharedResults::applies -> bool with false
@@ -728,17 +728,17 @@
impl SharedResults {
/// Whether `array`, about to execute for `parent`, may have its result reused.
///
/// An expression places the same array under each of its references, and a filter pushed
/// below it places the array under each pushed-down filter, so only those parents look for an
/// array that another parent also holds. Checking every parent would cost each execution of
/// an array that its caller keeps, where every array is shared.
fn applies(&self, parent: &ArrayRef, array: &ArrayRef) -> bool {
- (parent.is::<ScalarFn>() || parent.is::<Filter>()) && array.is_shared()
+ false /* ~ changed by cargo-mutants ~ */
}
fn get(&self, array: &ArrayRef) -> Option<ArrayRef> {
if self.executed.is_empty() {
return None;
}
self.executed.get(&ArrayByPtr(array.clone())).cloned()
}
cargo mutants -f vortex-array/src/executor/mod.rs -F ':736:9:'
vortex-array/src/executor/mod.rs:736:60
replace && with || in SharedResults::applies
--- vortex-array/src/executor/mod.rs
+++ replace && with || in SharedResults::applies
@@ -728,17 +728,17 @@
impl SharedResults {
/// Whether `array`, about to execute for `parent`, may have its result reused.
///
/// An expression places the same array under each of its references, and a filter pushed
/// below it places the array under each pushed-down filter, so only those parents look for an
/// array that another parent also holds. Checking every parent would cost each execution of
/// an array that its caller keeps, where every array is shared.
fn applies(&self, parent: &ArrayRef, array: &ArrayRef) -> bool {
- (parent.is::<ScalarFn>() || parent.is::<Filter>()) && array.is_shared()
+ (parent.is::<ScalarFn>() || parent.is::<Filter>()) || /* ~ changed by cargo-mutants ~ */ array.is_shared()
}
fn get(&self, array: &ArrayRef) -> Option<ArrayRef> {
if self.executed.is_empty() {
return None;
}
self.executed.get(&ArrayByPtr(array.clone())).cloned()
}
cargo mutants -f vortex-array/src/executor/mod.rs -F ':736:60:'
vortex-array/src/executor/mod.rs:736:34
replace || with && in SharedResults::applies
--- vortex-array/src/executor/mod.rs
+++ replace || with && in SharedResults::applies
@@ -728,17 +728,17 @@
impl SharedResults {
/// Whether `array`, about to execute for `parent`, may have its result reused.
///
/// An expression places the same array under each of its references, and a filter pushed
/// below it places the array under each pushed-down filter, so only those parents look for an
/// array that another parent also holds. Checking every parent would cost each execution of
/// an array that its caller keeps, where every array is shared.
fn applies(&self, parent: &ArrayRef, array: &ArrayRef) -> bool {
- (parent.is::<ScalarFn>() || parent.is::<Filter>()) && array.is_shared()
+ (parent.is::<ScalarFn>() && /* ~ changed by cargo-mutants ~ */ parent.is::<Filter>()) && array.is_shared()
}
fn get(&self, array: &ArrayRef) -> Option<ArrayRef> {
if self.executed.is_empty() {
return None;
}
self.executed.get(&ArrayByPtr(array.clone())).cloned()
}
cargo mutants -f vortex-array/src/executor/mod.rs -F ':736:34:'
vortex-array/src/executor/mod.rs:740:9
replace SharedResults::get -> Option<ArrayRef> with None
--- vortex-array/src/executor/mod.rs
+++ replace SharedResults::get -> Option<ArrayRef> with None
@@ -732,20 +732,17 @@
/// below it places the array under each pushed-down filter, so only those parents look for an
/// array that another parent also holds. Checking every parent would cost each execution of
/// an array that its caller keeps, where every array is shared.
fn applies(&self, parent: &ArrayRef, array: &ArrayRef) -> bool {
(parent.is::<ScalarFn>() || parent.is::<Filter>()) && array.is_shared()
}
fn get(&self, array: &ArrayRef) -> Option<ArrayRef> {
- if self.executed.is_empty() {
- return None;
- }
- self.executed.get(&ArrayByPtr(array.clone())).cloned()
+ None /* ~ changed by cargo-mutants ~ */
}
fn insert(&mut self, executed: ArrayRef, result: ArrayRef) {
self.executed.insert(ArrayByPtr(executed), result);
}
/// The parents of the tree that still hold `array`, other than the suspended parent on top of
/// `stack`, from which `array` was detached.
cargo mutants -f vortex-array/src/executor/mod.rs -F ':740:9:'
vortex-array/src/executor/mod.rs:747:9
replace SharedResults::insert with ()
--- vortex-array/src/executor/mod.rs
+++ replace SharedResults::insert with ()
@@ -739,17 +739,17 @@
fn get(&self, array: &ArrayRef) -> Option<ArrayRef> {
if self.executed.is_empty() {
return None;
}
self.executed.get(&ArrayByPtr(array.clone())).cloned()
}
fn insert(&mut self, executed: ArrayRef, result: ArrayRef) {
- self.executed.insert(ArrayByPtr(executed), result);
+ () /* ~ changed by cargo-mutants ~ */
}
/// The parents of the tree that still hold `array`, other than the suspended parent on top of
/// `stack`, from which `array` was detached.
///
/// When the other owners are outside the tree, such as a caller that keeps the array, a kept
/// result would only be shared, and its parent could no longer decode into it in place.
fn other_parents(&mut self, stack: &[StackFrame], array: &ArrayRef) -> usize {
cargo mutants -f vortex-array/src/executor/mod.rs -F ':747:9:'
vortex-array/src/executor/mod.rs:756:9
replace SharedResults::other_parents -> usize with 0
--- vortex-array/src/executor/mod.rs
+++ replace SharedResults::other_parents -> usize with 0
@@ -748,31 +748,17 @@
}
/// The parents of the tree that still hold `array`, other than the suspended parent on top of
/// `stack`, from which `array` was detached.
///
/// When the other owners are outside the tree, such as a caller that keeps the array, a kept
/// result would only be shared, and its parent could no longer decode into it in place.
fn other_parents(&mut self, stack: &[StackFrame], array: &ArrayRef) -> usize {
- let addr = array.addr();
- let Some(remaining) = &mut self.remaining_parents else {
- // Every other array of the tree hangs below a suspended parent or `array` itself. The
- // edge from the parent on top of `stack` to `array` was detached, so it is not
- // counted.
- let roots = stack.iter().map(|frame| &frame.parent_array).chain([array]);
- let remaining = count_parents(roots);
- let others = remaining.get(&addr).copied().unwrap_or(0);
- self.remaining_parents = Some(remaining);
- return others;
- };
- remaining.get_mut(&addr).map_or(0, |count| {
- *count = count.saturating_sub(1);
- *count
- })
+ 0 /* ~ changed by cargo-mutants ~ */
}
}
/// How many slots of the trees below `roots` hold each array, by address. Each array's own slots
/// are counted once, however many parents hold it.
fn count_parents<'a>(roots: impl Iterator<Item = &'a ArrayRef>) -> HashMap<usize, usize> {
let mut parents: HashMap<usize, usize> = HashMap::new();
let mut visited: HashSet<usize> = HashSet::new();
cargo mutants -f vortex-array/src/executor/mod.rs -F ':756:9:'
vortex-array/src/executor/mod.rs:756:9
replace SharedResults::other_parents -> usize with 1
--- vortex-array/src/executor/mod.rs
+++ replace SharedResults::other_parents -> usize with 1
@@ -748,31 +748,17 @@
}
/// The parents of the tree that still hold `array`, other than the suspended parent on top of
/// `stack`, from which `array` was detached.
///
/// When the other owners are outside the tree, such as a caller that keeps the array, a kept
/// result would only be shared, and its parent could no longer decode into it in place.
fn other_parents(&mut self, stack: &[StackFrame], array: &ArrayRef) -> usize {
- let addr = array.addr();
- let Some(remaining) = &mut self.remaining_parents else {
- // Every other array of the tree hangs below a suspended parent or `array` itself. The
- // edge from the parent on top of `stack` to `array` was detached, so it is not
- // counted.
- let roots = stack.iter().map(|frame| &frame.parent_array).chain([array]);
- let remaining = count_parents(roots);
- let others = remaining.get(&addr).copied().unwrap_or(0);
- self.remaining_parents = Some(remaining);
- return others;
- };
- remaining.get_mut(&addr).map_or(0, |count| {
- *count = count.saturating_sub(1);
- *count
- })
+ 1 /* ~ changed by cargo-mutants ~ */
}
}
/// How many slots of the trees below `roots` hold each array, by address. Each array's own slots
/// are counted once, however many parents hold it.
fn count_parents<'a>(roots: impl Iterator<Item = &'a ArrayRef>) -> HashMap<usize, usize> {
let mut parents: HashMap<usize, usize> = HashMap::new();
let mut visited: HashSet<usize> = HashSet::new();
cargo mutants -f vortex-array/src/executor/mod.rs -F ':756:9:'
vortex-array/src/executor/mod.rs:777:5
replace count_parents -> HashMap<usize, usize> with HashMap::new()
--- vortex-array/src/executor/mod.rs
+++ replace count_parents -> HashMap<usize, usize> with HashMap::new()
@@ -769,29 +769,17 @@
*count
})
}
}
/// How many slots of the trees below `roots` hold each array, by address. Each array's own slots
/// are counted once, however many parents hold it.
fn count_parents<'a>(roots: impl Iterator<Item = &'a ArrayRef>) -> HashMap<usize, usize> {
- let mut parents: HashMap<usize, usize> = HashMap::new();
- let mut visited: HashSet<usize> = HashSet::new();
- let mut unvisited: Vec<&ArrayRef> = roots.collect();
- while let Some(array) = unvisited.pop() {
- if !visited.insert(array.addr()) {
- continue;
- }
- for child in array.slots().iter().flatten() {
- *parents.entry(child.addr()).or_default() += 1;
- unvisited.push(child);
- }
- }
- parents
+ HashMap::new() /* ~ changed by cargo-mutants ~ */
}
struct StackFrame {
parent_array: ArrayRef,
parent_builder: Option<Box<dyn ArrayBuilder>>,
slot_idx: usize,
done: DonePredicate,
/// Whether the parent asked for this slot with [`ExecutionStep::ExecuteSpine`] and
cargo mutants -f vortex-array/src/executor/mod.rs -F ':777:5:'
vortex-array/src/executor/mod.rs:777:5
replace count_parents -> HashMap<usize, usize> with HashMap::from_iter([(0, 0)])
--- vortex-array/src/executor/mod.rs
+++ replace count_parents -> HashMap<usize, usize> with HashMap::from_iter([(0, 0)])
@@ -769,29 +769,17 @@
*count
})
}
}
/// How many slots of the trees below `roots` hold each array, by address. Each array's own slots
/// are counted once, however many parents hold it.
fn count_parents<'a>(roots: impl Iterator<Item = &'a ArrayRef>) -> HashMap<usize, usize> {
- let mut parents: HashMap<usize, usize> = HashMap::new();
- let mut visited: HashSet<usize> = HashSet::new();
- let mut unvisited: Vec<&ArrayRef> = roots.collect();
- while let Some(array) = unvisited.pop() {
- if !visited.insert(array.addr()) {
- continue;
- }
- for child in array.slots().iter().flatten() {
- *parents.entry(child.addr()).or_default() += 1;
- unvisited.push(child);
- }
- }
- parents
+ HashMap::from_iter([(0, 0)]) /* ~ changed by cargo-mutants ~ */
}
struct StackFrame {
parent_array: ArrayRef,
parent_builder: Option<Box<dyn ArrayBuilder>>,
slot_idx: usize,
done: DonePredicate,
/// Whether the parent asked for this slot with [`ExecutionStep::ExecuteSpine`] and
cargo mutants -f vortex-array/src/executor/mod.rs -F ':777:5:'
vortex-array/src/executor/mod.rs:777:5
replace count_parents -> HashMap<usize, usize> with HashMap::from_iter([(0, 1)])
--- vortex-array/src/executor/mod.rs
+++ replace count_parents -> HashMap<usize, usize> with HashMap::from_iter([(0, 1)])
@@ -769,29 +769,17 @@
*count
})
}
}
/// How many slots of the trees below `roots` hold each array, by address. Each array's own slots
/// are counted once, however many parents hold it.
fn count_parents<'a>(roots: impl Iterator<Item = &'a ArrayRef>) -> HashMap<usize, usize> {
- let mut parents: HashMap<usize, usize> = HashMap::new();
- let mut visited: HashSet<usize> = HashSet::new();
- let mut unvisited: Vec<&ArrayRef> = roots.collect();
- while let Some(array) = unvisited.pop() {
- if !visited.insert(array.addr()) {
- continue;
- }
- for child in array.slots().iter().flatten() {
- *parents.entry(child.addr()).or_default() += 1;
- unvisited.push(child);
- }
- }
- parents
+ HashMap::from_iter([(0, 1)]) /* ~ changed by cargo-mutants ~ */
}
struct StackFrame {
parent_array: ArrayRef,
parent_builder: Option<Box<dyn ArrayBuilder>>,
slot_idx: usize,
done: DonePredicate,
/// Whether the parent asked for this slot with [`ExecutionStep::ExecuteSpine`] and
cargo mutants -f vortex-array/src/executor/mod.rs -F ':777:5:'
vortex-array/src/executor/mod.rs:777:5
replace count_parents -> HashMap<usize, usize> with HashMap::from_iter([(1, 0)])
--- vortex-array/src/executor/mod.rs
+++ replace count_parents -> HashMap<usize, usize> with HashMap::from_iter([(1, 0)])
@@ -769,29 +769,17 @@
*count
})
}
}
/// How many slots of the trees below `roots` hold each array, by address. Each array's own slots
/// are counted once, however many parents hold it.
fn count_parents<'a>(roots: impl Iterator<Item = &'a ArrayRef>) -> HashMap<usize, usize> {
- let mut parents: HashMap<usize, usize> = HashMap::new();
- let mut visited: HashSet<usize> = HashSet::new();
- let mut unvisited: Vec<&ArrayRef> = roots.collect();
- while let Some(array) = unvisited.pop() {
- if !visited.insert(array.addr()) {
- continue;
- }
- for child in array.slots().iter().flatten() {
- *parents.entry(child.addr()).or_default() += 1;
- unvisited.push(child);
- }
- }
- parents
+ HashMap::from_iter([(1, 0)]) /* ~ changed by cargo-mutants ~ */
}
struct StackFrame {
parent_array: ArrayRef,
parent_builder: Option<Box<dyn ArrayBuilder>>,
slot_idx: usize,
done: DonePredicate,
/// Whether the parent asked for this slot with [`ExecutionStep::ExecuteSpine`] and
cargo mutants -f vortex-array/src/executor/mod.rs -F ':777:5:'
vortex-array/src/executor/mod.rs:777:5
replace count_parents -> HashMap<usize, usize> with HashMap::from_iter([(1, 1)])
--- vortex-array/src/executor/mod.rs
+++ replace count_parents -> HashMap<usize, usize> with HashMap::from_iter([(1, 1)])
@@ -769,29 +769,17 @@
*count
})
}
}
/// How many slots of the trees below `roots` hold each array, by address. Each array's own slots
/// are counted once, however many parents hold it.
fn count_parents<'a>(roots: impl Iterator<Item = &'a ArrayRef>) -> HashMap<usize, usize> {
- let mut parents: HashMap<usize, usize> = HashMap::new();
- let mut visited: HashSet<usize> = HashSet::new();
- let mut unvisited: Vec<&ArrayRef> = roots.collect();
- while let Some(array) = unvisited.pop() {
- if !visited.insert(array.addr()) {
- continue;
- }
- for child in array.slots().iter().flatten() {
- *parents.entry(child.addr()).or_default() += 1;
- unvisited.push(child);
- }
- }
- parents
+ HashMap::from_iter([(1, 1)]) /* ~ changed by cargo-mutants ~ */
}
struct StackFrame {
parent_array: ArrayRef,
parent_builder: Option<Box<dyn ArrayBuilder>>,
slot_idx: usize,
done: DonePredicate,
/// Whether the parent asked for this slot with [`ExecutionStep::ExecuteSpine`] and
cargo mutants -f vortex-array/src/executor/mod.rs -F ':777:5:'
vortex-array/src/executor/mod.rs:781:12
delete ! in count_parents
--- vortex-array/src/executor/mod.rs
+++ delete ! in count_parents
@@ -773,17 +773,17 @@
/// How many slots of the trees below `roots` hold each array, by address. Each array's own slots
/// are counted once, however many parents hold it.
fn count_parents<'a>(roots: impl Iterator<Item = &'a ArrayRef>) -> HashMap<usize, usize> {
let mut parents: HashMap<usize, usize> = HashMap::new();
let mut visited: HashSet<usize> = HashSet::new();
let mut unvisited: Vec<&ArrayRef> = roots.collect();
while let Some(array) = unvisited.pop() {
- if !visited.insert(array.addr()) {
+ if /* ~ changed by cargo-mutants ~ */visited.insert(array.addr()) {
continue;
}
for child in array.slots().iter().flatten() {
*parents.entry(child.addr()).or_default() += 1;
unvisited.push(child);
}
}
parents
cargo mutants -f vortex-array/src/executor/mod.rs -F ':781:12:'
vortex-array/src/executor/mod.rs:785:55
replace += with *= in count_parents
--- vortex-array/src/executor/mod.rs
+++ replace += with *= in count_parents
@@ -777,17 +777,17 @@
let mut parents: HashMap<usize, usize> = HashMap::new();
let mut visited: HashSet<usize> = HashSet::new();
let mut unvisited: Vec<&ArrayRef> = roots.collect();
while let Some(array) = unvisited.pop() {
if !visited.insert(array.addr()) {
continue;
}
for child in array.slots().iter().flatten() {
- *parents.entry(child.addr()).or_default() += 1;
+ *parents.entry(child.addr()).or_default() *= /* ~ changed by cargo-mutants ~ */ 1;
unvisited.push(child);
}
}
parents
}
struct StackFrame {
parent_array: ArrayRef,
cargo mutants -f vortex-array/src/executor/mod.rs -F ':785:55:'
vortex-array/src/session/mod.rs:194:9
replace SessionRegisterExt::register_scalar_fn with ()
--- vortex-array/src/session/mod.rs
+++ replace SessionRegisterExt::register_scalar_fn with ()
@@ -186,17 +186,16 @@
self.arrays().register(plugin);
self.kernels().register_execute(vtable);
}
/// Register a scalar function: its vtable for lookup by id, in
/// [`scalar_fns`](ScalarFnSessionExt::scalar_fns), and its execution and its own `supports`,
/// in [`kernels`](ArrayKernelsExt::kernels).
fn register_scalar_fn<F: ScalarFnVTable>(&self, scalar_fn: F) {
- self.scalar_fns().register(scalar_fn.clone());
- self.kernels().register_scalar_fn(scalar_fn);
+ () /* ~ changed by cargo-mutants ~ */
}
}
impl<S: SessionExt> SessionRegisterExt for S {}
#[cfg(test)]
mod tests;
cargo mutants -f vortex-array/src/session/mod.rs -F ':194:9:'
vortex-array/src/session/mod.rs:181:9
replace SessionRegisterExt::register_array with ()
--- vortex-array/src/session/mod.rs
+++ replace SessionRegisterExt::register_array with ()
@@ -173,23 +173,17 @@
/// Register an array encoding: `plugin` reads and writes its arrays, in
/// [`arrays`](ArraySessionExt::arrays), and `vtable`'s `execute` runs them, in
/// [`kernels`](ArrayKernelsExt::kernels).
///
/// An encoding's vtable is usually its own plugin, so most callers pass it twice:
/// `session.register_array(Zstd, Zstd)`. A separate plugin, such as one that reads older
/// serialized ids, serializes the arrays of `vtable` under the same id.
fn register_array<P: ArrayPlugin, V: VTable>(&self, plugin: P, vtable: V) {
- debug_assert_eq!(
- plugin.id(),
- vtable.id(),
- "the plugin must serialize the arrays of the vtable"
- );
- self.arrays().register(plugin);
- self.kernels().register_execute(vtable);
+ () /* ~ changed by cargo-mutants ~ */
}
/// Register a scalar function: its vtable for lookup by id, in
/// [`scalar_fns`](ScalarFnSessionExt::scalar_fns), and its execution and its own `supports`,
/// in [`kernels`](ArrayKernelsExt::kernels).
fn register_scalar_fn<F: ScalarFnVTable>(&self, scalar_fn: F) {
self.scalar_fns().register(scalar_fn.clone());
self.kernels().register_scalar_fn(scalar_fn);
cargo mutants -f vortex-array/src/session/mod.rs -F ':181:9:'
vortex-array/src/optimizer/kernels.rs:520:9
replace ArrayKernels::has_execute -> bool with true
--- vortex-array/src/optimizer/kernels.rs
+++ replace ArrayKernels::has_execute -> bool with true
@@ -512,20 +512,17 @@
/// which one the executor runs.
#[cfg(test)]
pub(crate) fn register_execute_fn(&self, id: Id, execute: ExecuteFn) {
self.push_execute(id, execute);
}
/// Returns true when an `execute` is registered for the encoding or scalar function `id`.
pub fn has_execute(&self, id: Id) -> bool {
- self.execute
- .load()
- .get(id.index())
- .is_some_and(Option::is_some)
+ true /* ~ changed by cargo-mutants ~ */
}
fn push_execute(&self, id: Id, execute: ExecuteFn) {
let index = id.index();
self.execute.rcu(|current| {
let mut next = ExecuteKernels::clone(current);
if next.len() <= index {
next.resize(index + 1, None);
cargo mutants -f vortex-array/src/optimizer/kernels.rs -F ':520:9:'
vortex-array/src/optimizer/kernels.rs:688:9
replace KernelSession::retain -> Self with Default::default()
--- vortex-array/src/optimizer/kernels.rs
+++ replace KernelSession::retain -> Self with Default::default()
@@ -680,32 +680,17 @@
fn deref(&self) -> &ArrayKernels {
&self.kernels
}
}
#[cfg(any(test, feature = "_test-harness"))]
impl KernelSession {
pub fn retain(&self, mut keep: impl FnMut(&dyn Debug) -> bool) -> Self {
- let mut reduce_parent = ParentReduceKernels::clone(&self.kernels.reduce_parent.load());
- for kernels in reduce_parent.kernels.values_mut() {
- *kernels = kernels.iter().filter(|k| keep(k)).copied().collect();
- }
- let mut execute_parent = ParentExecutionKernels::clone(&self.kernels.execute_parent.load());
- for kernels in execute_parent.values_mut() {
- *kernels = kernels.iter().filter(|k| keep(k)).cloned().collect();
- }
- let this = Self::empty();
- this.kernels.reduce_parent.store(Arc::new(reduce_parent));
- this.kernels.execute_parent.store(Arc::new(execute_parent));
- this.kernels
- .supports
- .store(self.kernels.supports.load_full());
- this.kernels.execute.store(self.kernels.execute.load_full());
- this
+ Default::default() /* ~ changed by cargo-mutants ~ */
}
}
impl Default for KernelSession {
fn default() -> Self {
// The built-in parent-reduce rules and execute-parent kernels are registered by the
// per-encoding `initialize` functions, which operate on a session. `KernelSession` clones
// share their registry storage, so kernels registered into the temporary session land in
cargo mutants -f vortex-array/src/optimizer/kernels.rs -F ':688:9:'
vortex-array/src/test_harness/trace/mod.rs:670:5
replace record_execute_slot_cached with ()
--- vortex-array/src/test_harness/trace/mod.rs
+++ replace record_execute_slot_cached with ()
@@ -662,22 +662,17 @@
slot_idx,
parent: ArraySummary::new(parent),
child: ArraySummary::new(child),
});
}
/// A shared slot child that this execution already executed, reused instead of executing it again.
pub(crate) fn record_execute_slot_cached(slot_idx: usize, parent: &ArrayRef, cached: &ArrayRef) {
- record(TraceEvent::SlotTransition {
- step: "ExecuteSlotCached",
- slot_idx,
- parent: ArraySummary::new(parent),
- child: ArraySummary::new(cached),
- });
+ () /* ~ changed by cargo-mutants ~ */
}
pub(crate) fn record_fuse_start(array: &ArrayRef) {
record(TraceEvent::FuseStart {
array: ArraySummary::new(array),
});
}
cargo mutants -f vortex-array/src/test_harness/trace/mod.rs -F ':670:5:'
vortex-array/src/arrays/dict/take.rs:278:27
replace match guard parent.values().is::<Extension>() with true in <impl ExecuteParentKernel<Constant> for DictConstantCodesKernel>::execute_parent
--- vortex-array/src/arrays/dict/take.rs
+++ replace match guard parent.values().is::<Extension>() with true in <impl ExecuteParentKernel<Constant> for DictConstantCodesKernel>::execute_parent
@@ -270,17 +270,17 @@
if child_idx != 0 || parent.is_empty() {
return Ok(None);
}
let value = match array.scalar().as_primitive().as_::<usize>() {
Some(code) => match parent.values().execute_scalar(code, ctx) {
Ok(scalar) => scalar.cast(parent.dtype())?,
// Invalid extension values must not prevent storage access or structural
// operations.
- Err(_) if parent.values().is::<Extension>() => return Ok(None),
+ Err(_) if true /* ~ changed by cargo-mutants ~ */ => return Ok(None),
Err(err) => return Err(err),
},
None => Scalar::null(parent.dtype().as_nullable()),
};
Ok(Some(ConstantArray::new(value, parent.len()).into_array()))
}
}
cargo mutants -f vortex-array/src/arrays/dict/take.rs -F ':278:27:'
vortex-array/src/arrays/dict/take.rs:278:27
replace match guard parent.values().is::<Extension>() with false in <impl ExecuteParentKernel<Constant> for DictConstantCodesKernel>::execute_parent
--- vortex-array/src/arrays/dict/take.rs
+++ replace match guard parent.values().is::<Extension>() with false in <impl ExecuteParentKernel<Constant> for DictConstantCodesKernel>::execute_parent
@@ -270,17 +270,17 @@
if child_idx != 0 || parent.is_empty() {
return Ok(None);
}
let value = match array.scalar().as_primitive().as_::<usize>() {
Some(code) => match parent.values().execute_scalar(code, ctx) {
Ok(scalar) => scalar.cast(parent.dtype())?,
// Invalid extension values must not prevent storage access or structural
// operations.
- Err(_) if parent.values().is::<Extension>() => return Ok(None),
+ Err(_) if false /* ~ changed by cargo-mutants ~ */ => return Ok(None),
Err(err) => return Err(err),
},
None => Scalar::null(parent.dtype().as_nullable()),
};
Ok(Some(ConstantArray::new(value, parent.len()).into_array()))
}
}
cargo mutants -f vortex-array/src/arrays/dict/take.rs -F ':278:27:'
vortex-array/src/compute/conformance/mask.rs:296:5
replace test_nullable_mask_input with ()
--- vortex-array/src/compute/conformance/mask.rs
+++ replace test_nullable_mask_input with ()
@@ -288,54 +288,10 @@
.into_nullable()
);
}
}
}
/// Tests masking with nullable mask (nulls treated as false)
fn test_nullable_mask_input(array: &ArrayRef, ctx: &mut ExecutionCtx) {
- let len = array.len();
- if len < 3 {
- return; // Skip for very small arrays
- }
-
- // Create a nullable mask
- let bool_values: Vec<bool> = (0..len).map(|i| i % 2 == 0).collect();
- let validity_values: Vec<bool> = (0..len).map(|i| i % 3 != 0).collect();
-
- let bool_array = BoolArray::from_iter(bool_values.clone());
- let validity = Validity::from_iter(validity_values.clone());
- let nullable_mask = BoolArray::new(bool_array.to_bit_buffer(), validity);
-
- let mask_array = nullable_mask
- .to_mask_fill_null_false(ctx)
- .vortex_expect("nullable mask should convert in conformance test");
- let masked = array
- .clone()
- .mask((!&mask_array).into_array())
- .vortex_expect("mask should succeed in conformance test")
- .execute::<RecursiveCanonical>(ctx)
- .vortex_expect("mask execution should succeed in conformance test")
- .0
- .into_array();
-
- // Elements are masked only if the mask is true AND valid
- for i in 0..len {
- if bool_values[i] && validity_values[i] {
- assert!(
- !masked
- .is_valid(i, ctx)
- .vortex_expect("is_valid should succeed in conformance test")
- );
- } else {
- assert_eq!(
- masked
- .execute_scalar(i, ctx)
- .vortex_expect("scalar_at should succeed in conformance test"),
- array
- .execute_scalar(i, ctx)
- .vortex_expect("scalar_at should succeed in conformance test")
- .into_nullable()
- );
- }
- }
+ () /* ~ changed by cargo-mutants ~ */
}
cargo mutants -f vortex-array/src/compute/conformance/mask.rs -F ':296:5:'
vortex-array/src/scalar/typed_view/struct_.rs:385:9
delete match arm (DType::List(src_elem, _), DType::List(dst_elem, _)) |(DType::FixedSizeList(src_elem, ..), DType::FixedSizeList(dst_elem, ..)) |(DType::List(src_elem, _), DType::FixedSizeList(dst_elem, ..)) |(DType::FixedSizeList(src_elem, ..), DType::List(dst_elem, ..)) in check_struct_cast_dtypes
--- vortex-array/src/scalar/typed_view/struct_.rs
+++ delete match arm (DType::List(src_elem, _), DType::List(dst_elem, _)) |(DType::FixedSizeList(src_elem, ..), DType::FixedSizeList(dst_elem, ..)) |(DType::List(src_elem, _), DType::FixedSizeList(dst_elem, ..)) |(DType::FixedSizeList(src_elem, ..), DType::List(dst_elem, ..)) in check_struct_cast_dtypes
@@ -377,22 +377,17 @@
.field_by_index(i)
.vortex_expect("valid source field index");
check_struct_cast_dtypes(&src_dtype, &target_dtype, mode)?;
}
}
Ok(())
})?;
}
- (DType::List(src_elem, _), DType::List(dst_elem, _))
- | (DType::FixedSizeList(src_elem, ..), DType::FixedSizeList(dst_elem, ..))
- | (DType::List(src_elem, _), DType::FixedSizeList(dst_elem, ..))
- | (DType::FixedSizeList(src_elem, ..), DType::List(dst_elem, ..)) => {
- check_struct_cast_dtypes(src_elem, dst_elem, mode)?;
- }
+ /* ~ changed by cargo-mutants ~ */
(DType::Map(src_map, _), DType::Map(dst_map, _)) => {
check_struct_cast_dtypes(&src_map.key_dtype(), &dst_map.key_dtype(), mode)?;
check_struct_cast_dtypes(&src_map.value_dtype(), &dst_map.value_dtype(), mode)?;
}
_ => {}
}
Ok(())
}
cargo mutants -f vortex-array/src/scalar/typed_view/struct_.rs -F ':385:9:'
vortex-array/src/scalar/typed_view/struct_.rs:391:9
delete match arm (DType::Map(src_map, _), DType::Map(dst_map, _)) in check_struct_cast_dtypes
--- vortex-array/src/scalar/typed_view/struct_.rs
+++ delete match arm (DType::Map(src_map, _), DType::Map(dst_map, _)) in check_struct_cast_dtypes
@@ -383,20 +383,17 @@
})?;
}
(DType::List(src_elem, _), DType::List(dst_elem, _))
| (DType::FixedSizeList(src_elem, ..), DType::FixedSizeList(dst_elem, ..))
| (DType::List(src_elem, _), DType::FixedSizeList(dst_elem, ..))
| (DType::FixedSizeList(src_elem, ..), DType::List(dst_elem, ..)) => {
check_struct_cast_dtypes(src_elem, dst_elem, mode)?;
}
- (DType::Map(src_map, _), DType::Map(dst_map, _)) => {
- check_struct_cast_dtypes(&src_map.key_dtype(), &dst_map.key_dtype(), mode)?;
- check_struct_cast_dtypes(&src_map.value_dtype(), &dst_map.value_dtype(), mode)?;
- }
+ /* ~ changed by cargo-mutants ~ */
_ => {}
}
Ok(())
}
impl Scalar {
/// Creates a new struct scalar with the given fields, checking dtypes at runtime.
pub fn struct_(dtype: DType, children: impl IntoIterator<Item = Scalar>) -> Self {
cargo mutants -f vortex-array/src/scalar/typed_view/struct_.rs -F ':391:9:'
vortex-array/src/scalar_fn/builtin/cast/mod.rs:121:9
delete match arm (DType::Map(source, _), DType::Map(target, _)) in check_extension_cast_with_mode
--- vortex-array/src/scalar_fn/builtin/cast/mod.rs
+++ delete match arm (DType::Map(source, _), DType::Map(target, _)) in check_extension_cast_with_mode
@@ -113,20 +113,17 @@
return Ok(());
}
match (source, target) {
(
DType::List(source, _) | DType::FixedSizeList(source, ..),
DType::List(target, _) | DType::FixedSizeList(target, ..),
) => check_extension_cast_with_mode(source, target, mode),
- (DType::Map(source, _), DType::Map(target, _)) => {
- check_extension_cast_with_mode(&source.key_dtype(), &target.key_dtype(), mode)?;
- check_extension_cast_with_mode(&source.value_dtype(), &target.value_dtype(), mode)
- }
+ /* ~ changed by cargo-mutants ~ */
(DType::Struct(source, _), DType::Struct(target, _)) => {
check_struct_extension_cast(source, target, mode)
}
_ => Ok(()),
}
}
/// Name the function that performs a rejected extension cast, if one exists.
cargo mutants -f vortex-array/src/scalar_fn/builtin/cast/mod.rs -F ':121:9:'
vortex-array/src/scalar_fn/builtin/cast/mod.rs:235:9
replace <impl ScalarFnVTable for Cast>::supports -> bool with false
--- vortex-array/src/scalar_fn/builtin/cast/mod.rs
+++ replace <impl ScalarFnVTable for Cast>::supports -> bool with false
@@ -227,20 +227,17 @@
fn return_dtype(&self, dtype: &DType, arg_dtypes: &[DType]) -> VortexResult<DType> {
let source = &arg_dtypes[0];
check_extension_cast(source, dtype)?;
Ok(dtype.clone())
}
fn supports(&self, _supports: SupportsFn<'_>, target: &DType, args: &[DType]) -> bool {
// What `execute` handles itself; the canonical encodings' cast kernels declare the rest.
- match args {
- [source] => source == target,
- _ => false,
- }
+ false /* ~ changed by cargo-mutants ~ */
}
fn execute(
&self,
target_dtype: &DType,
args: &dyn ExecutionArgs,
ctx: &mut ExecutionCtx,
) -> VortexResult<ArrayRef> {
cargo mutants -f vortex-array/src/scalar_fn/builtin/cast/mod.rs -F ':235:9:'
vortex-array/src/scalar_fn/builtin/cast/mod.rs:236:13
delete match arm [source] in <impl ScalarFnVTable for Cast>::supports
--- vortex-array/src/scalar_fn/builtin/cast/mod.rs
+++ delete match arm [source] in <impl ScalarFnVTable for Cast>::supports
@@ -228,17 +228,17 @@
let source = &arg_dtypes[0];
check_extension_cast(source, dtype)?;
Ok(dtype.clone())
}
fn supports(&self, _supports: SupportsFn<'_>, target: &DType, args: &[DType]) -> bool {
// What `execute` handles itself; the canonical encodings' cast kernels declare the rest.
match args {
- [source] => source == target,
+ /* ~ changed by cargo-mutants ~ */
_ => false,
}
}
fn execute(
&self,
target_dtype: &DType,
args: &dyn ExecutionArgs,
cargo mutants -f vortex-array/src/scalar_fn/builtin/cast/mod.rs -F ':236:13:'
vortex-array/src/arrays/decimal/compute/cast.rs:93:17
replace || with && in <impl CastKernel for Decimal>::supports
--- vortex-array/src/arrays/decimal/compute/cast.rs
+++ replace || with && in <impl CastKernel for Decimal>::supports
@@ -85,17 +85,17 @@
}
}
impl CastKernel for Decimal {
fn supports(_supports: SupportsFn<'_>, source: &DType, target: &DType) -> bool {
// The only float target is F64.
source.is_decimal()
&& (target.is_decimal()
- || target.is_int()
+ && /* ~ changed by cargo-mutants ~ */ target.is_int()
|| matches!(target, DType::Primitive(PType::F64, _)))
}
fn cast(
array: ArrayView<'_, Decimal>,
dtype: &DType,
ctx: &mut ExecutionCtx,
) -> VortexResult<Option<ArrayRef>> {
cargo mutants -f vortex-array/src/arrays/decimal/compute/cast.rs -F ':93:17:'
- Vorherrschende Sprache
- Rust
- Sterne
- 3.2k
- Forks
- 239
- Ø Merge
- 1 T. 4 Std.
- Gemergte PRs (30 T.)
- 684
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus vortex-data/vortex
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
vortex-data/vortex#12633 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
vortex-data/vortex#12628 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
vortex-data/vortex#12491 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Fallible constructor for nested_case_whenEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
vortex-data/vortex#11425 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 67/100
vortex-data/vortex#12635 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in vortex-data/vortex
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
marklauter/tsong#110 ·
-
docs enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
wasm-bindgen/wasm-bindgen#5503 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
marketing
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag
-
area: engine bug needs milestone
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Mudcrab-Team/mudcrab#1197 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag