Skip to content

Conversation

@nsarlin-zama
Copy link
Contributor

@nsarlin-zama nsarlin-zama commented Nov 19, 2025

closes: please link all relevant issues

PR content/description

Removes the need for a nightly toolchain to use avx512, since it has now been stabilized. pulp and bytemuck have been updated.
I also added a rust-toolchain.toml that is used to select the default toolchain, as it is the standardized way of doing this in the rust ecosystem.
The toolchain.txt file has been renamed to nightly-toolchain.txt as it is only used when we explicitly need a nightly toolchain.

I also had to put every backward compat data generation crate in a specific workspace, because we have incompatible bytemuck versions between 1.4 and 1.5.


This change is Reviewable

@cla-bot cla-bot bot added the cla-signed label Nov 19, 2025
@nsarlin-zama nsarlin-zama changed the base branch from main to ns/chore/msrv_1_91 November 19, 2025 17:10
Base automatically changed from ns/chore/msrv_1_91 to main November 20, 2025 08:29
@nsarlin-zama nsarlin-zama force-pushed the ns/chore/stable_avx512 branch from 76972f0 to 9174f00 Compare November 20, 2025 09:35
@nsarlin-zama nsarlin-zama marked this pull request as ready for review November 20, 2025 09:55
@nsarlin-zama nsarlin-zama force-pushed the ns/chore/stable_avx512 branch from 9174f00 to aad0cb7 Compare November 20, 2025 12:44
Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some of my comments were not send (perhaps already updated in the meantime, if so disregard)

@IceTDrinker reviewed 1 of 67 files at r1, all commit messages.
Reviewable status: 1 of 67 files reviewed, 6 unresolved discussions (waiting on @soonum)


Makefile line 9 at r1 (raw file):

CARGO_PROFILE?=release
MIN_RUST_VERSION:=$(shell grep '^rust-version[[:space:]]*=' Cargo.toml | cut -d '=' -f 2 | xargs)
AVX512_SUPPORT?=OFF

variable to remove ? and adapt workflows ?


Makefile line 729 at r1 (raw file):

	export RUSTFLAGS="-C target-cpu=x86-64" && \
	export TFHE_SPEC="tfhe" && \
	export CARGO_PROFILE="$(CARGO_PROFILE)" &&	scripts/check_memory_errors.sh --cpu

made sure the script behaves correctly ?


Makefile line 764 at r1 (raw file):

.PHONY: test_integer_long_run_gpu # Run the long run integer tests on the gpu backend
test_integer_long_run_gpu: install_rs_check_toolchain install_cargo_nextest

to be checked : some makefile recipes were not installing the matching toolchain, this one might be removable


Makefile line 802 at r1 (raw file):

.PHONY: test_integer_gpu_ci # Run the tests for integer ci on gpu backend
test_integer_gpu_ci: install_rs_check_toolchain install_cargo_nextest

some rs_check_toolchain left same below


Makefile line 1192 at r1 (raw file):

	DOCS_RS=1 \
	RUSTDOCFLAGS="--html-in-header katex-header.html" \
	cargo +nightly doc \

weird we have a non "pinned" nightly toolchain ?


Makefile line 1355 at r1 (raw file):

.PHONY: bench_integer # Run benchmarks for unsigned integer
bench_integer: install_rs_check_toolchain

should still be installed ?

@nsarlin-zama nsarlin-zama force-pushed the ns/chore/stable_avx512 branch from aad0cb7 to 15018f7 Compare November 20, 2025 14:34
Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IceTDrinker reviewed 64 of 67 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: 66 of 67 files reviewed, 20 unresolved discussions (waiting on @nsarlin-zama and @soonum)


rust-toolchain.toml line 2 at r2 (raw file):

[toolchain]
channel = "stable"

stupid question as we saw on my machine, are we sure it would download at least the MSRV if stable is already on the system but with an older version ? is there a way to require "at least" some version in this file ?


Makefile line 1717 at r2 (raw file):

.PHONY: regex_engine # Run regex_engine example
regex_engine: install_rs_check_toolchain

should be kept or move the toolchain to default by not specifying it I would say


Makefile line 1944 at r2 (raw file):

#=============================== NTT Section ==================================
.PHONY: doc_ntt # Build rust doc for tfhe-ntt
doc_ntt: install_rs_check_toolchain

still needs to be installed ? same everywhere essentially


scripts/shortint-tests.sh line 16 at r2 (raw file):

}

RUST_TOOLCHAIN=""

same remarks as other bash scripts


scripts/integer-tests.sh line 4 at r2 (raw file):

set -e
set -x

to be removed, or do we keep it ?


scripts/integer-tests.sh line 92 at r2 (raw file):

done

if [ -n "${RUST_TOOLCHAIN}" ]; then

https://devhints.io/bash ctrl + F default values, I think there is something in there that can help


scripts/integer-tests.sh line 174 at r2 (raw file):

echo "${filter_expression}"

eval cargo "${RUST_TOOLCHAIN}" nextest run \

eval ?


scripts/integer-tests.sh line 185 at r2 (raw file):

if [[ -z ${multi_bit_argument} && -z ${long_tests_argument} ]]; then
    eval cargo "${RUST_TOOLCHAIN}" test \

eval ?


tfhe-benchmark/Cargo.toml line 30 at r2 (raw file):

rand = { workspace = true }
rayon = { workspace = true }
tfhe = { path = "../tfhe", features = [] }

why the empty feature array here ?


scripts/install_zizmor.sh line 45 at r2 (raw file):

if ! which zizmor ; then
    eval cargo "${rust_toolchain}" install --locked zizmor --version ~"${required_zizmor_version}" || \

eval ?

also if we are supposed to use the stable toolchain just remove the argument


scripts/install_zizmor.sh line 64 at r2 (raw file):

    exit 0
else
    eval cargo "${rust_toolchain}" install --locked zizmor --version ~"${required_zizmor_version}" || \

eval


scripts/install_typos.sh line 45 at r2 (raw file):

if ! which typos ; then
    eval cargo "${rust_toolchain}" install --locked typos-cli --version ~"${required_typos_version}" || \

eval 😱


scripts/install_typos.sh line 64 at r2 (raw file):

    exit 0
else
    eval cargo "${rust_toolchain}" install --locked typos-cli --version ~"${required_typos_version}" || \

same here ?


tfhe/src/lib.rs line 79 at r2 (raw file):

    feature(avx512_target_feature, stdarch_x86_avx512)
)]
#![cfg_attr(all(doc, not(doctest)), feature(doc_cfg))]

not required anymore I take it the doc_cfg ?

@nsarlin-zama nsarlin-zama force-pushed the ns/chore/stable_avx512 branch from 15018f7 to ccfd1d0 Compare November 21, 2025 09:22
Copy link
Contributor Author

@nsarlin-zama nsarlin-zama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 64 of 67 files reviewed, 17 unresolved discussions (waiting on @IceTDrinker and @soonum)


Makefile line 9 at r1 (raw file):

Previously, IceTDrinker wrote…

variable to remove ? and adapt workflows ?

don't we want to keep this to be able to easily run the tests without avx512 if needed?


Makefile line 729 at r1 (raw file):

Previously, IceTDrinker wrote…

made sure the script behaves correctly ?

yes


Makefile line 764 at r1 (raw file):

Previously, IceTDrinker wrote…

to be checked : some makefile recipes were not installing the matching toolchain, this one might be removable

done


Makefile line 802 at r1 (raw file):

Previously, IceTDrinker wrote…

some rs_check_toolchain left same below

done


Makefile line 1192 at r1 (raw file):

Previously, IceTDrinker wrote…

weird we have a non "pinned" nightly toolchain ?

fixed


Makefile line 1355 at r1 (raw file):

Previously, IceTDrinker wrote…

should still be installed ?

yes indeed!


Makefile line 1717 at r2 (raw file):

Previously, IceTDrinker wrote…

should be kept or move the toolchain to default by not specifying it I would say

done


rust-toolchain.toml line 2 at r2 (raw file):

Previously, IceTDrinker wrote…

stupid question as we saw on my machine, are we sure it would download at least the MSRV if stable is already on the system but with an older version ? is there a way to require "at least" some version in this file ?

I don't know, it's not very clear from the doc.
I wonder if having it set to "stable" is useful at all.
Maybe we should instead pin it to the msrv, to be sure we don't accidentally use features from more recent rust version: webrtc-rs/webrtc#728

@nsarlin-zama nsarlin-zama force-pushed the ns/chore/stable_avx512 branch from ccfd1d0 to d66e15f Compare November 21, 2025 09:58
Copy link
Contributor Author

@nsarlin-zama nsarlin-zama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 64 of 67 files reviewed, 16 unresolved discussions (waiting on @IceTDrinker and @soonum)


scripts/install_typos.sh line 45 at r2 (raw file):

Previously, IceTDrinker wrote…

eval 😱

removed


scripts/install_typos.sh line 64 at r2 (raw file):

Previously, IceTDrinker wrote…

same here ?

removed


scripts/install_zizmor.sh line 45 at r2 (raw file):

Previously, IceTDrinker wrote…

eval ?

also if we are supposed to use the stable toolchain just remove the argument

removed


scripts/install_zizmor.sh line 64 at r2 (raw file):

Previously, IceTDrinker wrote…

eval

removed


scripts/integer-tests.sh line 4 at r2 (raw file):

Previously, IceTDrinker wrote…

to be removed, or do we keep it ?

removed


scripts/integer-tests.sh line 92 at r2 (raw file):

Previously, IceTDrinker wrote…

https://devhints.io/bash ctrl + F default values, I think there is something in there that can help

thanks!


scripts/integer-tests.sh line 174 at r2 (raw file):

Previously, IceTDrinker wrote…

eval ?

removed


scripts/integer-tests.sh line 185 at r2 (raw file):

Previously, IceTDrinker wrote…

eval ?

removed


scripts/shortint-tests.sh line 16 at r2 (raw file):

Previously, IceTDrinker wrote…

same remarks as other bash scripts

done


tfhe/src/lib.rs line 79 at r2 (raw file):

Previously, IceTDrinker wrote…

not required anymore I take it the doc_cfg ?

maybe you reviewed an older version, should be ok now?


tfhe-benchmark/Cargo.toml line 30 at r2 (raw file):

Previously, IceTDrinker wrote…

why the empty feature array here ?

to remove the default features unless we have them on this crate too (which is the case by default).
This allows to bench without avx512 if needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants