Skip to content

Commit

Permalink
chore(ci): re-enable release profile for doctest
Browse files Browse the repository at this point in the history
- following merge of 17.0.4 in rust stable the bug uncovered by lto on
aarch64 has been fixed rust-lang/rust#116941 so
we remove the hard coded override
- update nightly toolchain to have fixed LLVM as well
- fix lints linked to latest nightly
  • Loading branch information
IceTDrinker committed Nov 30, 2023
1 parent 62feb59 commit 09579a1
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/aws_tfhe_fast_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
- name: Run user docs tests
run: |
CARGO_PROFILE=release_lto_off make test_user_doc
make test_user_doc
- name: Run js on wasm API tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/aws_tfhe_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
- name: Run user docs tests
run: |
CARGO_PROFILE=release_lto_off make test_user_doc
make test_user_doc
- name: Gen Keys if required
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/m1_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
- name: Run user docs tests
run: |
CARGO_PROFILE=release_lto_off make test_user_doc
make test_user_doc
# JS tests are more easily launched in docker, we won't test that on M1 as docker is pretty
# slow on Apple machines due to the virtualization layer.
Expand Down
3 changes: 3 additions & 0 deletions concrete-csprng/src/seeders/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ pub trait Seeder {
}

mod implem;
// This import statement can be empty if seeder features are disabled, rustc's behavior changed to
// warn of empty modules, we know this can happen, so allow it.
#[allow(unused_imports)]
pub use implem::*;

#[cfg(test)]
Expand Down
4 changes: 1 addition & 3 deletions scripts/integer-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ not_multi_bit="_multi_bit"
signed=""
not_signed=""
cargo_profile="release"
# TODO: revert to release once the bug is properly fixed/identified
cargo_profile_doctests="release_lto_off"
avx512_feature=""

while [ -n "$1" ]
Expand Down Expand Up @@ -163,7 +161,7 @@ cargo "${RUST_TOOLCHAIN}" nextest run \

if [[ "${multi_bit}" == "" ]]; then
cargo "${RUST_TOOLCHAIN}" test \
--profile "${cargo_profile_doctests}" \
--profile "${cargo_profile}" \
--package tfhe \
--features="${ARCH_FEATURE}",integer,internal-keycache,"${avx512_feature}" \
--doc \
Expand Down
2 changes: 1 addition & 1 deletion tfhe/benches/shortint/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ fn _bench_wopbs_param_message_8_norm2_5(c: &mut Criterion) {
let mut bench_group = c.benchmark_group("programmable_bootstrap");

let param = WOPBS_PARAM_MESSAGE_4_NORM2_6_KS_PBS;
let param_set: ShortintParameterSet = param.try_into().unwrap();
let param_set: ShortintParameterSet = param.into();
let pbs_params = param_set.pbs_parameters().unwrap();

let keys = KEY_CACHE_WOPBS.get_from_param((pbs_params, param));
Expand Down
2 changes: 1 addition & 1 deletion tfhe/examples/regex_engine/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub fn has_match(

let res = if branches.len() <= 1 {
branches
.get(0)
.first()
.map_or(exec.ct_false(), |branch| branch(&mut exec))
.0
} else {
Expand Down
2 changes: 1 addition & 1 deletion tfhe/src/core_crypto/fft_impl/fft128_u128/crypto/tests.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use dyn_stack::{GlobalPodBuffer, PodStack, ReborrowMut};

use super::super::super::{fft128, fft128_u128};
use super::super::math::fft::{Fft128, Fft128View};
use super::super::math::fft::Fft128View;
use crate::core_crypto::fft_impl::common::tests::{
gen_keys_or_get_from_cache_if_enabled, generate_keys,
};
Expand Down
2 changes: 1 addition & 1 deletion tfhe/src/core_crypto/fft_impl/fft128_u128/math/fft/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::core_crypto::commons::utils::izip;
pub use crate::core_crypto::fft_impl::fft128::math::fft::{Fft128, Fft128View};
pub use crate::core_crypto::fft_impl::fft128::math::fft::Fft128View;
use concrete_fft::fft128::f128;
use dyn_stack::PodStack;

Expand Down
2 changes: 1 addition & 1 deletion tfhe/src/js_on_wasm_api/boolean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ impl Boolean {
}

#[wasm_bindgen]
pub fn trivial_encrypt(&mut self, message: bool) -> BooleanCiphertext {
pub fn trivial_encrypt(message: bool) -> BooleanCiphertext {
set_hook(Box::new(console_error_panic_hook::hook));
BooleanCiphertext(crate::boolean::ciphertext::Ciphertext::Trivial(message))
}
Expand Down
8 changes: 3 additions & 5 deletions tfhe/src/js_on_wasm_api/mod.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#[cfg(feature = "shortint-client-js-wasm-api")]
mod shortint;
#[cfg(feature = "shortint-client-js-wasm-api")]
pub use shortint::*;

#[cfg(feature = "boolean-client-js-wasm-api")]
mod boolean;
#[cfg(feature = "boolean-client-js-wasm-api")]
pub use boolean::*;

// We need to use the init_thread_pool for it to be publicly visible but it appears unused when
// compiling
#[allow(unused_imports)]
#[cfg(feature = "parallel-wasm-api")]
pub use wasm_bindgen_rayon::init_thread_pool;

mod js_high_level_api;
pub use js_high_level_api::*;
8 changes: 4 additions & 4 deletions tfhe/src/js_on_wasm_api/shortint.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::core_crypto::commons::generators::DeterministicSeeder;
pub use crate::core_crypto::commons::math::random::Seed;
use crate::core_crypto::commons::math::random::Seed;
use crate::core_crypto::prelude::ActivatedRandomGenerator;
pub use crate::shortint::parameters::parameters_compact_pk::*;
pub use crate::shortint::parameters::*;
use crate::shortint::parameters::parameters_compact_pk::*;
use crate::shortint::parameters::*;
use wasm_bindgen::prelude::*;

use std::panic::set_hook;
Expand Down Expand Up @@ -349,7 +349,7 @@ impl Shortint {
let mut seeder = DeterministicSeeder::<ActivatedRandomGenerator>::new(Seed(seed));
ShortintClientKey(
crate::shortint::engine::ShortintEngine::new_from_seeder(&mut seeder)
.new_client_key(parameters.0.try_into().unwrap()),
.new_client_key(parameters.0.into()),
)
}

Expand Down
6 changes: 2 additions & 4 deletions tfhe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ pub mod shortint;
#[cfg(feature = "__wasm_api")]
/// cbindgen:ignore
mod js_on_wasm_api;
#[cfg(feature = "__wasm_api")]
pub use js_on_wasm_api::*;

#[cfg(all(
doctest,
Expand All @@ -106,15 +104,15 @@ pub use js_on_wasm_api::*;
))]
mod test_user_docs;

/// cbindgen:ignore
#[cfg(feature = "integer")]
/// cbindgen:ignore
pub(crate) mod high_level_api;

#[cfg(feature = "integer")]
pub use high_level_api::*;

/// cbindgen:ignore
#[cfg(any(test, doctest, feature = "internal-keycache"))]
/// cbindgen:ignore
pub mod keycache;

#[cfg(feature = "safe-deserialization")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub use crate::core_crypto::commons::dispersion::{DispersionParameter, StandardDev};
pub use crate::core_crypto::commons::dispersion::StandardDev;
pub use crate::core_crypto::commons::parameters::{
DecompositionBaseLog, DecompositionLevelCount, GlweDimension, LweDimension, PolynomialSize,
};
Expand Down
2 changes: 1 addition & 1 deletion toolchain.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2023-10-17
nightly-2023-11-30

0 comments on commit 09579a1

Please sign in to comment.