• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vortex-data / vortex / 16992591828

15 Aug 2025 02:51PM UTC coverage: 87.203% (-0.5%) from 87.72%
16992591828

Pull #2456

github

web-flow
Merge fe7e226a7 into 4a23f65b3
Pull Request #2456: feat: basic BoolBuffer / BoolBufferMut

476 of 1230 new or added lines in 107 files covered. (38.7%)

74 existing lines in 19 files now uncovered.

56525 of 64820 relevant lines covered (87.2%)

623751.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

16.0
/vortex-array/src/arrays/bool/compute/is_sorted.rs
1
// SPDX-License-Identifier: Apache-2.0
2
// SPDX-FileCopyrightText: Copyright the Vortex contributors
3

4
use vortex_error::VortexResult;
5
use vortex_mask::Mask;
6

7
use crate::arrays::{BoolArray, BoolVTable};
8
use crate::compute::{IsSortedIteratorExt, IsSortedKernel, IsSortedKernelAdapter};
9
use crate::register_kernel;
10

11
impl IsSortedKernel for BoolVTable {
12
    fn is_sorted(&self, array: &BoolArray) -> VortexResult<bool> {
78✔
13
        match array.validity_mask()? {
78✔
14
            Mask::AllFalse(_) => Ok(true),
×
15
            Mask::AllTrue(_) => Ok(array.boolean_buffer().iter().is_sorted()),
78✔
16
            Mask::Values(mask_values) => {
×
NEW
17
                let set_indices = mask_values.boolean_buffer().set_indices();
×
NEW
18
                let values = array.boolean_buffer();
×
UNCOV
19
                let values_iter = set_indices.map(|idx|
×
20
                    // Safety:
21
                    // All idxs are in-bounds for the array.
22
                    unsafe {
23
                        values.value_unchecked(idx)
×
24
                    });
×
25

26
                Ok(values_iter.is_sorted())
×
27
            }
28
        }
29
    }
78✔
30

31
    fn is_strict_sorted(&self, array: &BoolArray) -> VortexResult<bool> {
×
32
        match array.validity_mask()? {
×
33
            Mask::AllFalse(_) => Ok(false),
×
NEW
34
            Mask::AllTrue(_) => Ok(array.boolean_buffer().iter().is_strict_sorted()),
×
35
            Mask::Values(mask_values) => {
×
NEW
36
                let validity_buffer = mask_values.boolean_buffer();
×
NEW
37
                let values = array.boolean_buffer();
×
38

39
                Ok(validity_buffer
×
40
                    .iter()
×
41
                    .zip(values.iter())
×
42
                    .map(|(is_valid, value)| is_valid.then_some(value))
×
43
                    .is_strict_sorted())
×
44
            }
45
        }
46
    }
×
47
}
48

49
register_kernel!(IsSortedKernelAdapter(BoolVTable).lift());
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc