Skip to content

Commit 9e44343

Browse files
Merge branch 'develop' into ji/lazy-invert
2 parents cf47bc6 + 6e1e9d5 commit 9e44343

File tree

4 files changed

+45
-19
lines changed

4 files changed

+45
-19
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ permissions:
2323
env:
2424
CARGO_TERM_COLOR: auto
2525
RUST_BACKTRACE: 1
26+
NIGHTLY_TOOLCHAIN: nightly-2026-02-05
2627

2728
jobs:
2829
lint-toml:
@@ -283,10 +284,10 @@ jobs:
283284
- id: setup-rust
284285
uses: ./.github/actions/setup-rust
285286
with:
286-
toolchain: nightly
287+
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }}
287288
repo-token: ${{ secrets.GITHUB_TOKEN }}
288289
- name: Rust Lint - Format
289-
run: cargo +nightly fmt --all --check
290+
run: cargo +$NIGHTLY_TOOLCHAIN fmt --all --check
290291
- name: Rustc check
291292
run: RUSTFLAGS="-D warnings" cargo check --locked --all-features --all-targets
292293
- name: Rustc check (release)
@@ -404,7 +405,7 @@ jobs:
404405
env:
405406
RUSTFLAGS: "-Cinstrument-coverage -A warnings --cfg vortex_nightly"
406407
run: |
407-
cargo +nightly nextest run --locked --workspace --all-features --no-fail-fast
408+
cargo +$NIGHTLY_TOOLCHAIN nextest run --locked --workspace --all-features --no-fail-fast
408409
- name: Install llvm-tools-preview
409410
run: rustup component add llvm-tools-preview
410411
- name: Generate coverage report
@@ -463,7 +464,7 @@ jobs:
463464
uses: ./.github/actions/setup-rust
464465
with:
465466
repo-token: ${{ secrets.GITHUB_TOKEN }}
466-
toolchain: nightly
467+
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }}
467468
components: "rust-src, rustfmt, clippy, llvm-tools-preview"
468469
- name: Install build dependencies
469470
run: |
@@ -478,11 +479,11 @@ jobs:
478479
RUSTFLAGS: "-A warnings -Zsanitizer=address -Zsanitizer=leak --cfg disable_loom --cfg vortex_nightly -C debuginfo=2 -C opt-level=0 -C strip=none"
479480
run: |
480481
# Build with full debug info first (helps with caching)
481-
cargo +nightly build --locked --all-features \
482+
cargo +$NIGHTLY_TOOLCHAIN build --locked --all-features \
482483
--target x86_64-unknown-linux-gnu \
483484
-p vortex-buffer -p vortex-ffi -p vortex-fastlanes -p vortex-fsst -p vortex-alp -p vortex-array
484485
# Run tests with sanitizers and debug output
485-
cargo +nightly nextest run \
486+
cargo +$NIGHTLY_TOOLCHAIN nextest run \
486487
--locked \
487488
--all-features \
488489
--no-fail-fast \
@@ -516,7 +517,7 @@ jobs:
516517
- uses: ./.github/actions/setup-rust
517518
with:
518519
repo-token: ${{ secrets.GITHUB_TOKEN }}
519-
toolchain: nightly
520+
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }}
520521
components: "rust-src, rustfmt, clippy, llvm-tools-preview"
521522
- name: Install nextest
522523
uses: taiki-e/install-action@v2
@@ -528,9 +529,9 @@ jobs:
528529
FLAT_LAYOUT_INLINE_ARRAY_NODE: true
529530
run: |
530531
# Build with full debug info first (helps with caching)
531-
cargo +nightly build --locked -p vortex-cuda -p vortex-file -p vortex-test-e2e-cuda --all-features --target x86_64-unknown-linux-gnu
532+
cargo +$NIGHTLY_TOOLCHAIN build --locked -p vortex-cuda -p vortex-file -p vortex-test-e2e-cuda --all-features --target x86_64-unknown-linux-gnu
532533
# Run tests with sanitizers and debug output
533-
cargo +nightly nextest run \
534+
cargo +$NIGHTLY_TOOLCHAIN nextest run \
534535
--locked \
535536
-p vortex-file \
536537
-p vortex-cuda \
@@ -557,7 +558,7 @@ jobs:
557558
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER: compute-sanitizer --tool initcheck --error-exitcode 1
558559
run: cargo test -p vortex-cuda
559560
- name: Build cudf test library
560-
run: cargo +nightly build --locked -p vortex-test-e2e-cuda --target x86_64-unknown-linux-gnu
561+
run: cargo +$NIGHTLY_TOOLCHAIN build --locked -p vortex-test-e2e-cuda --target x86_64-unknown-linux-gnu
561562
- name: Download and run cudf-test-harness
562563
run: |
563564
curl -fsSL https://github.com/vortex-data/cudf-test-harness/releases/latest/download/cudf-test-harness-x86_64.tar.gz | tar -xz
@@ -790,13 +791,13 @@ jobs:
790791
- uses: ./.github/actions/setup-rust
791792
with:
792793
repo-token: ${{ secrets.GITHUB_TOKEN }}
793-
toolchain: nightly
794+
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }}
794795
components: "rust-src, rustfmt, clippy, miri"
795796
- uses: taiki-e/install-action@v2
796797
with:
797798
tool: nextest
798799
- name: Run Miri
799-
run: cargo +nightly miri nextest run --no-fail-fast -p vortex-buffer -p vortex-ffi
800+
run: cargo +$NIGHTLY_TOOLCHAIN miri nextest run --no-fail-fast -p vortex-buffer -p vortex-ffi
800801

801802
generated-files:
802803
name: "Check generated source files are up to date"
@@ -807,15 +808,15 @@ jobs:
807808
- uses: ./.github/actions/setup-rust
808809
with:
809810
repo-token: ${{ secrets.GITHUB_TOKEN }}
810-
toolchain: nightly
811+
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }}
811812
- uses: ./.github/actions/setup-flatc
812813
- name: "regenerate all .fbs/.proto Rust code"
813814
run: |
814815
cargo xtask generate-fbs
815816
cargo xtask generate-proto
816817
- name: "regenerate FFI header file"
817818
run: |
818-
cargo +nightly build -p vortex-ffi
819+
cargo +$NIGHTLY_TOOLCHAIN build -p vortex-ffi
819820
- name: "Make sure no files changed after regenerating"
820821
run: |
821822
git status --porcelain

vortex-array/src/arrays/scalar_fn/array.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ impl ScalarFnArray {
4040
}
4141

4242
/// Get the scalar function bound to this array.
43+
#[allow(clippy::same_name_method)]
4344
pub fn scalar_fn(&self) -> &ScalarFn {
4445
&self.scalar_fn
4546
}
4647

4748
/// Get the children arrays of this scalar function array.
49+
#[allow(clippy::same_name_method)]
4850
pub fn children(&self) -> &[ArrayRef] {
4951
&self.children
5052
}

vortex-array/src/arrays/scalar_fn/rules.rs

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,10 @@ impl ArrayReduceRule<ScalarFnVTable> for ScalarFnConstantRule {
9090
struct ScalarFnAbstractReduceRule;
9191
impl ArrayReduceRule<ScalarFnVTable> for ScalarFnAbstractReduceRule {
9292
fn reduce(&self, array: &ScalarFnArray) -> VortexResult<Option<ArrayRef>> {
93-
if let Some(reduced) = array.scalar_fn.reduce(
94-
// Blergh, re-boxing
95-
&array.to_array(),
96-
&ArrayReduceCtx { len: array.len },
97-
)? {
93+
if let Some(reduced) = array
94+
.scalar_fn
95+
.reduce(array, &ArrayReduceCtx { len: array.len })?
96+
{
9897
return Ok(Some(
9998
reduced
10099
.as_any()
@@ -107,6 +106,29 @@ impl ArrayReduceRule<ScalarFnVTable> for ScalarFnAbstractReduceRule {
107106
}
108107
}
109108

109+
impl ReduceNode for ScalarFnArray {
110+
fn as_any(&self) -> &dyn Any {
111+
self
112+
}
113+
114+
fn node_dtype(&self) -> VortexResult<DType> {
115+
Ok(self.dtype().clone())
116+
}
117+
118+
#[allow(clippy::same_name_method)]
119+
fn scalar_fn(&self) -> Option<&ScalarFn> {
120+
Some(ScalarFnArray::scalar_fn(self))
121+
}
122+
123+
fn child(&self, idx: usize) -> ReduceNodeRef {
124+
Arc::new(self.children()[idx].clone())
125+
}
126+
127+
fn child_count(&self) -> usize {
128+
self.children.len()
129+
}
130+
}
131+
110132
impl ReduceNode for ArrayRef {
111133
fn as_any(&self) -> &dyn Any {
112134
self

vortex-array/src/expr/vtable.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ pub trait ReduceNode {
243243
fn child_count(&self) -> usize;
244244

245245
/// Returns the children of this node.
246+
#[allow(clippy::same_name_method)]
246247
fn children(&self) -> Vec<ReduceNodeRef> {
247248
(0..self.child_count()).map(|i| self.child(i)).collect()
248249
}

0 commit comments

Comments
 (0)