diff --git a/pkgs/servers/sql/postgresql/ext/vectorchord/0003-select_unpredictable-on-bool.diff b/pkgs/servers/sql/postgresql/ext/vectorchord/0003-select_unpredictable-on-bool.diff deleted file mode 100644 index 3a0bdbf7121e..000000000000 --- a/pkgs/servers/sql/postgresql/ext/vectorchord/0003-select_unpredictable-on-bool.diff +++ /dev/null @@ -1,65 +0,0 @@ -diff --git a/crates/algorithm/src/operator.rs b/crates/algorithm/src/operator.rs -index 7de8d07..c496dcd 100644 ---- a/crates/algorithm/src/operator.rs -+++ b/crates/algorithm/src/operator.rs -@@ -672,7 +672,7 @@ impl Operator for Op, L2> { - use std::iter::zip; - let dims = vector.dims(); - let t = zip(&code.1, centroid.slice()) -- .map(|(&sign, &num)| std::hint::select_unpredictable(sign, num, -num)) -+ .map(|(&sign, &num)| sign.select_unpredictable(num, -num)) - .sum::() - / (dims as f32).sqrt(); - let sum_of_x_2 = code.0.dis_u_2; -@@ -763,7 +763,7 @@ impl Operator for Op, Dot> { - use std::iter::zip; - let dims = vector.dims(); - let t = zip(&code.1, centroid.slice()) -- .map(|(&sign, &num)| std::hint::select_unpredictable(sign, num, -num)) -+ .map(|(&sign, &num)| sign.select_unpredictable(num, -num)) - .sum::() - / (dims as f32).sqrt(); - let sum_of_x_2 = code.0.dis_u_2; -@@ -854,7 +854,7 @@ impl Operator for Op, L2> { - use std::iter::zip; - let dims = vector.dims(); - let t = zip(&code.1, centroid.slice()) -- .map(|(&sign, &num)| std::hint::select_unpredictable(sign, num, -num).to_f32()) -+ .map(|(&sign, &num)| sign.select_unpredictable(num, -num).to_f32()) - .sum::() - / (dims as f32).sqrt(); - let sum_of_x_2 = code.0.dis_u_2; -@@ -945,7 +945,7 @@ impl Operator for Op, Dot> { - use std::iter::zip; - let dims = vector.dims(); - let t = zip(&code.1, centroid.slice()) -- .map(|(&sign, &num)| std::hint::select_unpredictable(sign, num, -num).to_f32()) -+ .map(|(&sign, &num)| sign.select_unpredictable(num, -num).to_f32()) - .sum::() - / (dims as f32).sqrt(); - let sum_of_x_2 = code.0.dis_u_2; -diff --git a/crates/simd/src/rotate.rs b/crates/simd/src/rotate.rs -index 7a211e5..0fcd955 100644 ---- a/crates/simd/src/rotate.rs -+++ b/crates/simd/src/rotate.rs -@@ -31,18 +31,17 @@ pub fn givens(lhs: &mut [f32], rhs: &mut [f32]) { - pub mod flip { - #[crate::multiversion("v4", "v3", "v2", "a2")] - pub fn flip(bits: &[u64; 1024], result: &mut [f32]) { -- use std::hint::select_unpredictable; - let result: &mut [u32] = unsafe { std::mem::transmute(result) }; - let (slice, remainder) = result.as_chunks_mut::<64>(); - let n = slice.len(); - assert!(n <= 1024); - for i in 0..n { - for j in 0..64 { -- slice[i][j] ^= select_unpredictable((bits[i] & (1 << j)) != 0, 0x80000000, 0); -+ slice[i][j] ^= ((bits[i] & (1 << j)) != 0).select_unpredictable(0x80000000, 0); - } - } - for j in 0..remainder.len() { -- remainder[j] ^= select_unpredictable((bits[n] & (1 << j)) != 0, 0x80000000, 0); -+ remainder[j] ^= ((bits[n] & (1 << j)) != 0).select_unpredictable(0x80000000, 0); - } - } - } diff --git a/pkgs/servers/sql/postgresql/ext/vectorchord/package.nix b/pkgs/servers/sql/postgresql/ext/vectorchord/package.nix index ea71102357fc..fe024e7092d9 100644 --- a/pkgs/servers/sql/postgresql/ext/vectorchord/package.nix +++ b/pkgs/servers/sql/postgresql/ext/vectorchord/package.nix @@ -44,11 +44,6 @@ buildPgrxExtension (finalAttrs: { }) # Add feature flags needed for features not yet stabilised in rustc stable ./0002-add-feature-flags.diff - # The select_predictable function has been moved from std::bool to std::hint before it has been stabilized. - # This move isn't present in rustc 1.87, but upstream is using nightly so they have already updated their code. - # This patch changes the code to use the function on std::bool instead. - # See https://github.com/rust-lang/rust/pull/139726 - ./0003-select_unpredictable-on-bool.diff ]; buildInputs = lib.optionals (useSystemJemalloc) [