Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

🗼 Tower Extensions (Fq2, Fq6, and Fq12) and Torus Compression for BN254 precompiles #38

Draft
wants to merge 109 commits into
base: dl-precompiles
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
7afe9cd
add sage source files and `README.md` file
ZamDimon Mar 12, 2024
ada1149
:sparkles: add the basic multiplication version
ZamDimon Mar 12, 2024
1b1ed54
:sparkles: update `beta` parameter in wnaf scalar multiplication
ZamDimon Mar 13, 2024
7359f51
:technologist: verify that chosen beta parameter is valid on bn254 curve
ZamDimon Mar 13, 2024
7cb291e
:memo: specify what parameters were chosen in the Sage file for wnaf …
ZamDimon Mar 13, 2024
4bf6ed4
:heavy_plus_sign: find values a1,b1,a2,b2 for BN254 curve
ZamDimon Mar 13, 2024
930220e
:twisted_rightwards_arrows: convert constants to Fq field elements
ZamDimon Mar 13, 2024
a0aa6c3
:broom: fix all the constants
ZamDimon Mar 14, 2024
241dd3a
:broom: polish the code
ZamDimon Mar 14, 2024
1cafd0b
:thought_balloon: fix comment
ZamDimon Mar 14, 2024
2eaea09
:arrow_up: add basic implementation for `zeroable_affine`
ZamDimon Mar 15, 2024
b487274
:sparkles: basic implementation of a line function
ZamDimon Mar 18, 2024
f4a644b
:zap: add tangent function evaluation
ZamDimon Mar 18, 2024
3b4ed5d
:rotating_light: run `cargo fmt`
ZamDimon Mar 18, 2024
ccf0f9c
:construction: added basic tower extension
NikitaMasych Mar 21, 2024
34386af
:construction: completed basic `fp2` and `fp6` implementation
ZamDimon Mar 21, 2024
7308d02
:sparkles: complete `fp12` implementation
ZamDimon Mar 21, 2024
2f50fd5
:green_heart: make it somewhat working
ZamDimon Mar 21, 2024
2f92e96
:sparkles: add basic outline of tower extension trait implementations…
ZamDimon Mar 25, 2024
23b911a
:green_heart: add `ExtendedSWProjective` struct for twisted curve
ZamDimon Mar 26, 2024
dd53cab
:construction: added field-specific parametrization for tower and fro…
NikitaMasych Mar 28, 2024
c73c454
:twisted_rightwards_arrows: tower extension params
NikitaMasych Mar 28, 2024
76fb529
:adhesive_bandage: make getting `b_twist` a bit neater
ZamDimon Mar 28, 2024
024965c
:test_tube: add basic outline of `ec_pairing` final function
ZamDimon Mar 28, 2024
d48492e
:sparkles: complete the `easy_part` of final exp
ZamDimon Mar 28, 2024
f329b5a
:sparkles: add `hard_exp` part
ZamDimon Mar 28, 2024
e6a4ac3
:bug: fix `c0c1c4` notation to `c0c3c4`
ZamDimon Mar 29, 2024
8d307d6
:twisted_rightwards_arrows: Merge pull request #3 from `distributed-l…
ZamDimon Mar 29, 2024
3e765d9
:construction: added witness conversion for constant allocation
NikitaMasych Apr 2, 2024
88f602e
Merge branch 'feature/tower-extension-trait-impls' into feature/bn254…
NikitaMasych Apr 2, 2024
f826e39
:sparkles: add field extension inverse methods
ZamDimon Apr 3, 2024
ab97005
:fire: remove `wnaf`-based multiplication in sync with ecmul windowed…
ZamDimon Apr 5, 2024
8fface9
:recycle: make bn256 types public
ZamDimon Apr 5, 2024
f8f9190
:construction: fixing scalar multiplication for bn254
ZamDimon Apr 9, 2024
b3efe94
:sparkles: finish constant allocation and frobenius map for tower ext…
NikitaMasych Apr 9, 2024
63bd0a8
:test_tube: finalize the `ecmul` implementation
ZamDimon Apr 9, 2024
dc06e74
:adhesive_bandage: :fire: remove useless debugging and left shift fun…
ZamDimon Apr 9, 2024
008c487
:sparkles: add `projective_add` function
ZamDimon Apr 10, 2024
c91b3d5
:bug: fix `fq2` inverse operation
ZamDimon Apr 10, 2024
de1295a
:bug: fix `fq6` operations that did not work
ZamDimon Apr 11, 2024
4ad8406
:fire: remove unused `mem` library from `use`s
ZamDimon Apr 11, 2024
8aa50ad
:construction: added torus integration to exponentiation in pairing
NikitaMasych Apr 12, 2024
097e1b3
:adhesive_bandage: fixes after PR review
ZamDimon Apr 12, 2024
25d26e6
:recycle: come back to old `ecmul`
ZamDimon Apr 16, 2024
9c8e923
:technologist: make final exponentiation work
ZamDimon Apr 17, 2024
66c5a9e
:sparkles: further `ecpairing` fixes
ZamDimon Apr 20, 2024
e74cec7
:adhesive_bandage: final `ecpairing` fixes
ZamDimon Apr 25, 2024
4efdc40
:memo: fix comments in `ecpairing`
ZamDimon Apr 25, 2024
f447972
:sparkles: add `NonNativeField` implementation for `Fq6`
ZamDimon Apr 26, 2024
77a2db8
:adhesive_bandage: add `NonNativeField` implementation for all field …
ZamDimon Apr 26, 2024
86fa901
:building_construction: made public convertion functions and added pa…
NikitaMasych Apr 26, 2024
d008332
:construction: trying to make `modexp`
ZamDimon Apr 26, 2024
a55fa99
:fire: remove `bn254`-specific functionality
ZamDimon Apr 29, 2024
bb86ebc
:fire: removed duplicating normalization for fq12
NikitaMasych Apr 30, 2024
7c93122
:sparkles: added enforce_reduced to sw_projective
NikitaMasych Apr 30, 2024
3ca46b8
:construction: continue with `modexp` implementation
ZamDimon Apr 30, 2024
3c82e38
:twisted_rightwards_arrows: Merge branch 'feature/bn254-ec-pairing', …
ZamDimon Apr 30, 2024
155d41b
Merge branch 'main' into feature/bn254-ec-pairing
NikitaMasych Apr 30, 2024
16aaaca
:fire: removed duplicating normalization for fq12
NikitaMasych Apr 30, 2024
902bc84
:sparkles: added enforce_reduced to sw_projective
NikitaMasych Apr 30, 2024
e93d297
:construction: continue with `modmul` implementation
ZamDimon May 3, 2024
814b8f6
:sparkles: add basic working `modmul`
ZamDimon May 3, 2024
a7f3b6f
:art: tiny polishes in `modexp`
ZamDimon May 6, 2024
df347dc
:fire: remove useless `.py` sage file in `modexp`
ZamDimon May 6, 2024
2589656
:adhesive_bandage: fixes according to the PR review
ZamDimon May 7, 2024
9e25358
:sparkles: added CSPlaceholder implementation for tower of extensions…
NikitaMasych May 10, 2024
ab529a3
:sparkles: implemented CircuitVarLengthEncodable for tower of extensi…
May 15, 2024
9772403
:sparkles: added implementation of serialize and deserialize for FFPr…
May 15, 2024
0baba09
:sparkles: added equality traits implementation to FFProxyValue
NikitaMasych May 15, 2024
15ae1dd
Merge branch 'feature/bn254-ec-pairing' into feature/modexp
ZamDimon May 16, 2024
db3c41b
:twisted_rightwards_arrows: Merge pull request #4 from `feature/modexp`
ZamDimon May 16, 2024
65e3b1d
:twisted_rightwards_arrows: merge `ecpairing` branch
ZamDimon May 17, 2024
393ede6
:sparkles: add `TorusWrapper` implementation
ZamDimon May 17, 2024
9f22dde
:bug: fix issues in `torus`
ZamDimon May 20, 2024
61dd23d
:twisted_rightwards_arrows: Merge pull request #5 from `feature/bn254…
ZamDimon May 22, 2024
16c213d
:bug: fixed frobenius map non-homogeneity in tower of extension
NikitaMasych May 23, 2024
dbd8c48
:bug: make `fq12` and `algebraic\_torus` circuits homogeneous
ZamDimon May 27, 2024
f73483e
:fire: remove `modexp` implementation: move to `era-zkevm-circuits`
ZamDimon May 27, 2024
591f781
normalize t1 prior to mul by nonresidue
jules May 27, 2024
1b5f72f
:construction: wip: implementing `u1024` and `u2048`
ZamDimon May 28, 2024
7f1167f
:green_heart: add normalizations to fix `uintx` issue
ZamDimon May 28, 2024
859372c
:adhesive_bandage: fix torus inverse function
ZamDimon May 28, 2024
d402c88
chore: move comments from dbg to log (#51)
mm-zk May 29, 2024
4bcb11f
feat: Update boojum nightly - feature gate packed simd (Attempt 2) (#50)
mm-zk May 29, 2024
c86b422
:1234: add basic `u1024` and `u2048` implementations
ZamDimon May 29, 2024
91c8e60
:heavy_plus_sign: implement `u4096`
ZamDimon May 30, 2024
794750d
:heavy_multiplication_x: implement multiplication for `u2048`
ZamDimon May 30, 2024
8c4f9d6
:1234: implement `modmul` and `long_division` for new uints
ZamDimon May 30, 2024
a0353f7
:bug: fix tiny issues in `long_division` implementation
ZamDimon May 30, 2024
7742e90
:art: fixed warnings and formatted
NikitaMasych May 31, 2024
6f0a42f
:zap: make even more optimizations
ZamDimon Jun 4, 2024
63a7c9e
Ensure nonnative field negate works in case of non-normalized input
jules Jun 9, 2024
2068938
:twisted_rightwards_arrows: Merge branch `fix_negate` into `feature/b…
ZamDimon Jun 11, 2024
f9cfb60
remove superfluous normalizations
jules Jun 12, 2024
1a79557
shave normalizations in the torus
jules Jun 12, 2024
dd82efc
further reduction of normalizations where possible
jules Jun 12, 2024
2200a02
:adhesive_bandage: fix `cargo clippy`, small polishes
ZamDimon Jun 12, 2024
5b8780c
:sparkles: add `one()` function in elliptic curves
ZamDimon Jun 12, 2024
ef80177
:zap: optimize `square` in torus a bit
ZamDimon Jun 12, 2024
a8049b0
:zap: add `mul_by_fq` method in `fq6`
ZamDimon Jun 12, 2024
b874fd0
:sparkles: add `HardExpCompatible` trait
ZamDimon Jun 14, 2024
2931865
:construction: added optimized torus squaring
NikitaMasych Jul 4, 2024
a040d85
Fix native torus square
jules Jul 9, 2024
6f798c1
:art: make torus code cleaner
ZamDimon Jul 10, 2024
7449bb6
:sparkles: add torus multiplication
ZamDimon Jul 10, 2024
b68be4e
:sparkles: finalize torus
ZamDimon Jul 10, 2024
6c9e39d
:sparkles: add sparse multiplication by c5 support
ZamDimon Jul 10, 2024
2a8ed75
:memo: remove useless debugging
ZamDimon Jul 10, 2024
e97e94f
:twisted_rightwards_arrows: Merge pull request #6 from `feature/torus…
ZamDimon Jul 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,25 @@ jobs:
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo build --verbose
- run: cargo test --verbose --all

build_old:
name: cargo build and test (packed_simd)
strategy:
matrix:
# Needs big runners to run tests
# Only macos-13-xlarge is Apple Silicon, as per:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-larger-runners/about-larger-runners#about-macos-larger-runners
os: [ubuntu-22.04-github-hosted-16core, macos-13-xlarge]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-05-31

# Still compile the old rust nightly with packed simd - until we have a good replacement in poseidon.
- run: RUSTFLAGS=-Awarnings cargo +nightly-2023-05-31 build --features include_packed_simd
- run: RUSTFLAGS=-Awarnings cargo +nightly-2023-05-31 test --features include_packed_simd

formatting:
name: cargo fmt
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
/target
/profiling-target/target
/Cargo.lock

.idea/
9 changes: 8 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ itertools = "0.10"
blake2 = "0.10"
sha2 = "0.10"
num-modular = "0.5.1"
packed_simd = { version = "0.3.9" }
packed_simd = { version = "0.3.9" , optional = true}
pairing = { package = "pairing_ce", git = "https://github.com/matter-labs/pairing.git" }
crypto-bigint = "0.5"
convert_case = "*"
Expand Down Expand Up @@ -52,4 +52,11 @@ lto = "fat"
opt-level = 3

[features]
# If enabled, logs will be using trace, if disabled, they will be printed to stdout.
log_tracing = ["tracing"]
# Currently packed_simd is no longer working with the newest nightly.
# But we still keep it as a feature, as we didn't migrate all the code, and
# some people might want to use older rust nightly, to be able to gain some performance.
include_packed_simd = ["packed_simd"]
cr_paranoia_mode = []
debug_track = []
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "nightly-2023-06-25"
channel = "nightly-2024-05-07"
40 changes: 29 additions & 11 deletions src/cs/implementations/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,11 @@ impl<
let required_rows = num_used_rows + 1;
assert!(required_rows <= self.max_trace_len);

dbg!(required_rows);
dbg!(self.lookups_tables_total_len());
log!("Required rows {:?}", required_rows);
log!(
"lookup_tables_total_len = {}",
self.lookups_tables_total_len()
);

let required_rows = std::cmp::max(required_rows, self.lookups_tables_total_len());

Expand Down Expand Up @@ -185,12 +188,27 @@ impl<
.max()
.unwrap_or(0);

dbg!(required_size);
dbg!(max_copiable_in_specialized_columns);
dbg!(max_witnesses_in_general_purpose_columns);
dbg!(max_witnesses_in_specialized_columns);
dbg!(max_constants_for_general_purpose_gates);
dbg!(max_in_column_for_specialized_gates);
log!("required size = {}", required_size);
log!(
"max_copiable_in_specialized_columns = {}",
max_copiable_in_specialized_columns
);
log!(
"max_witnesses_in_general_purpose_columns = {}",
max_witnesses_in_general_purpose_columns
);
log!(
"max_witnesses_in_specialized_columns = {}",
max_witnesses_in_specialized_columns
);
log!(
"max_constants_for_general_purpose_gates = {}",
max_constants_for_general_purpose_gates
);
log!(
"max_in_column_for_specialized_gates = {}",
max_in_column_for_specialized_gates
);

assert!(max_constants_for_general_purpose_gates <= required_size);

Expand Down Expand Up @@ -312,7 +330,7 @@ impl<
dst.resize(precise_required_size, F::ZERO);
}

dbg!(precise_required_size);
log!("precise_required_size = {}", precise_required_size);

self.max_trace_len = precise_required_size;
finalization_hints.final_trace_len = precise_required_size;
Expand Down Expand Up @@ -729,7 +747,7 @@ impl<

let extra_polys_for_selectors = number_of_constant_polys_for_general_purpose_gates
- self.parameters.num_constant_columns;
dbg!(extra_polys_for_selectors);
log!("extra_polys_for_selector = {}", extra_polys_for_selectors);

let quotient_degree_from_constraits = if max_constraint_contribution_degree > 0 {
max_constraint_contribution_degree - 1
Expand Down Expand Up @@ -1037,7 +1055,7 @@ impl<
let (constant_columns, selectors_placement, min_degree) =
self.create_constant_setup_polys(worker);

dbg!(min_degree);
log!("min_degree = {}", min_degree);

let (_, total_num_constants_for_gates_over_general_purpose_columns) =
selectors_placement.compute_stats();
Expand Down
2 changes: 1 addition & 1 deletion src/cs/traits/cs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl<'set, 'tgt: 'set, T: SmallField> DstBuffer<'set, 'tgt, T> {
*offset += 1;
}
DstBuffer::MutSliceIndirect(dst, debug_track, offset) => {
if cfg!(debug_track) && *debug_track {
if cfg!(feature = "debug_track") && *debug_track {
log!(" set out {} <- {}", *offset, value.as_raw_u64())
}

Expand Down
4 changes: 2 additions & 2 deletions src/dag/guide.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ impl<'a, T: Copy + Debug, F: SmallField, Cfg: CSResolverConfig> GuideOrder<'a, T
pos += span.buffer.len();
}

if cfg!(cr_paranoia_mode) && self.guide.tracing {
if cfg!(feature = "cr_paranoia_mode") && self.guide.tracing {
log!(
"Released span {}: {:?}",
self.guide.spans[0].id.0,
Expand Down Expand Up @@ -684,7 +684,7 @@ impl<T: Debug, F: SmallField, Cfg: CSResolverConfig> BufferGuide<T, F, Cfg> {
}

pub(crate) fn flush(&mut self) -> BufferGuideFinalization<'_, T, F, Cfg> {
if cfg!(cr_paranoia_mode) && self.tracing {
if cfg!(feature = "cr_paranoia_mode") && self.tracing {
log!("CRG: flush.");
}

Expand Down
12 changes: 9 additions & 3 deletions src/dag/resolver_box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ pub(crate) fn invocation_binder<Fn, F: SmallField>(
// Safety: This is the actual type of the provided function.
let bound = resolver.resolve_fn::<Fn>();

if (cfg!(cr_paranoia_mode) || crate::dag::resolvers::mt::PARANOIA) && false {
if (cfg!(feature = "cr_paranoia_mode") || crate::dag::resolvers::mt::PARANOIA) && false {
log!(
"Ivk: Ins [{}], Out [{}], Out-addr [{}], Thread [{}]",
resolver
Expand All @@ -448,7 +448,10 @@ pub(crate) fn invocation_binder<Fn, F: SmallField>(
)
}

if (cfg!(cr_paranoia_mode) || crate::dag::resolvers::mt::PARANOIA) && debug_track && false {
if (cfg!(feature = "cr_paranoia_mode") || crate::dag::resolvers::mt::PARANOIA)
&& debug_track
&& false
{
log!(
"Ivk: provided inputs:\n - {:?}",
ins.iter().map(|x| x.as_raw_u64()).collect_vec()
Expand All @@ -457,7 +460,10 @@ pub(crate) fn invocation_binder<Fn, F: SmallField>(

bound(ins, &mut DstBuffer::MutSliceIndirect(out, debug_track, 0));

if (cfg!(cr_paranoia_mode) || crate::dag::resolvers::mt::PARANOIA) && debug_track && true {
if (cfg!(feature = "cr_paranoia_mode") || crate::dag::resolvers::mt::PARANOIA)
&& debug_track
&& true
{
log!(
"Ivk: calculated outputs:\n - {:?}",
out.iter().map(|x| x.as_raw_u64()).collect_vec()
Expand Down
12 changes: 6 additions & 6 deletions src/dag/resolvers/mt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl<V: SmallField, RS: ResolverSortingMode<V>, CFG: CSResolverConfig>

let debug_track = vec![];

if cfg!(cr_paranoia_mode) || PARANOIA {
if cfg!(feature = "cr_paranoia_mode") || PARANOIA {
log!("Contains tracked keys {:?} ", debug_track);
}

Expand Down Expand Up @@ -269,7 +269,7 @@ impl<V: SmallField, RS: ResolverSortingMode<V>, CFG: CSResolverConfig>

self.sorter.write_sequence();

if cfg!(cr_paranoia_mode) || PARANOIA {
if cfg!(feature = "cr_paranoia_mode") || PARANOIA {
log!("CR {:?}", unsafe {
self.common.awaiters_broker.stats.u_deref()
});
Expand Down Expand Up @@ -1487,7 +1487,7 @@ mod test {

storage.wait_till_resolved();

if cfg!(cr_paranoia_mode) {
if cfg!(feature = "cr_paranoia_mode") {
log!("Test: total value result: \n - {}", unsafe {
(*storage.common.values.get())
.variables
Expand All @@ -1509,7 +1509,7 @@ mod test {
let act = Place::from_variable(Variable::from_variable_index(ix as u64))
.to(|x| storage.get_value_unchecked(x));

if cfg!(cr_paranoia_mode) {
if cfg!(feature = "cr_paranoia_mode") {
log!("Test: per item value: ix {}, value {}", ix, act);
}

Expand Down Expand Up @@ -1542,7 +1542,7 @@ mod test {

storage.wait_till_resolved();

if cfg!(cr_paranoia_mode) {
if cfg!(feature = "cr_paranoia_mode") {
log!("Test: total value result: \n - {}", unsafe {
(*storage.common.values.get())
.variables
Expand All @@ -1564,7 +1564,7 @@ mod test {
let act = Place::from_variable(Variable::from_variable_index(ix as u64))
.to(|x| storage.get_value_unchecked(x));

if cfg!(cr_paranoia_mode) {
if cfg!(feature = "cr_paranoia_mode") {
log!("Test: per item value: ix {}, value {}", ix, act);
}

Expand Down
2 changes: 1 addition & 1 deletion src/dag/resolvers/mt/registrar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl Registrar {
}

pub(crate) fn is_empty(&self) -> bool {
if cfg!(cr_paranoia_mode) {
if cfg!(feature = "cr_paranoia_mode") {
log!(
"CRR: total remaining resolvers: {}",
self.vars.values().map(|x| x.len()).sum::<usize>()
Expand Down
34 changes: 19 additions & 15 deletions src/dag/resolvers/mt/resolution_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,12 @@ impl<V: SmallField + 'static, T: TrackId + 'static, Cfg: RWConfig<T> + 'static>
comms,

track_list: Vec::new(),
execution_list: if cfg!(cr_paranoia_mode) { 1 << 26 } else { 0 }
.to(|x| Vec::with_capacity(x).op(|v| v.resize(x, 0))),
execution_list: if cfg!(feature = "cr_paranoia_mode") {
1 << 26
} else {
0
}
.to(|x| Vec::with_capacity(x).op(|v| v.resize(x, 0))),
phantom: PhantomData,
};

Expand Down Expand Up @@ -207,7 +211,7 @@ impl<V: SmallField + 'static, T: TrackId + 'static, Cfg: RWConfig<T> + 'static>

data[data_ix].push(order_ix.into(), task.order_info.value);

if cfg!(cr_paranoia_mode) {
if cfg!(feature = "cr_paranoia_mode") {
self.execution_list[order_ix] += 1;

if self.execution_list[order_ix] > 1 {
Expand Down Expand Up @@ -238,7 +242,7 @@ impl<V: SmallField + 'static, T: TrackId + 'static, Cfg: RWConfig<T> + 'static>
}
}

if (cfg!(cr_paranoia_mode) || crate::dag::resolvers::mt::PARANOIA) && true {
if (cfg!(feature = "cr_paranoia_mode") || crate::dag::resolvers::mt::PARANOIA) && true {
log!("RW: Batch! {} tasks.", count);
}

Expand All @@ -264,7 +268,7 @@ impl<V: SmallField + 'static, T: TrackId + 'static, Cfg: RWConfig<T> + 'static>
.for_each(|x| {
x.state = ResolverState::Done;

if cfg!(cr_paranoia_mode) || crate::dag::resolvers::mt::PARANOIA {
if cfg!(feature = "cr_paranoia_mode") || crate::dag::resolvers::mt::PARANOIA {
unsafe {
let r = self.common.resolvers.u_deref().get(x.order_info.value);

Expand All @@ -291,7 +295,7 @@ impl<V: SmallField + 'static, T: TrackId + 'static, Cfg: RWConfig<T> + 'static>
}
});

if cfg!(cr_paranoia_mode) || crate::dag::resolvers::mt::PARANOIA {
if cfg!(feature = "cr_paranoia_mode") || crate::dag::resolvers::mt::PARANOIA {
if self
.exec_order_buffer
.iter()
Expand Down Expand Up @@ -343,7 +347,7 @@ impl<V: SmallField + 'static, T: TrackId + 'static, Cfg: RWConfig<T> + 'static>

drop(awaiters);

if cfg!(cr_paranoia_mode) && count > 0 {
if cfg!(feature = "cr_paranoia_mode") && count > 0 {
log!(
"RW: Shifted by {}, new range is: {}..{}, buffer len: {}",
count,
Expand Down Expand Up @@ -412,7 +416,7 @@ impl<V: SmallField + 'static, T: TrackId + 'static, Cfg: RWConfig<T> + 'static>

self.stats.total_consumption = extend_to as u64;

if crate::dag::resolvers::mt::PARANOIA || cfg!(cr_paranoia_mode) {
if crate::dag::resolvers::mt::PARANOIA || cfg!(feature = "cr_paranoia_mode") {
log!(
"RW: Extended range by {}, new range {}..{}",
extend_to,
Expand Down Expand Up @@ -474,7 +478,7 @@ impl<V: SmallField + 'static, T: TrackId + 'static, Cfg: RWConfig<T> + 'static>
}
}

if crate::dag::resolvers::mt::PARANOIA || cfg!(cr_paranoia_mode) {
if crate::dag::resolvers::mt::PARANOIA || cfg!(feature = "cr_paranoia_mode") {
log!("[{:?}] RW: Exit conditions met.", std::time::Instant::now())
}

Expand All @@ -484,7 +488,7 @@ impl<V: SmallField + 'static, T: TrackId + 'static, Cfg: RWConfig<T> + 'static>

self.stats.total_time = start_instant.elapsed();

if cfg!(cr_paranoia_mode) || crate::dag::resolvers::mt::PARANOIA {
if cfg!(feature = "cr_paranoia_mode") || crate::dag::resolvers::mt::PARANOIA {
log!("CR {:#?}", self.stats);
log!("CR {:#?}", unsafe { &*self.channel.stats.get() });

Expand Down Expand Up @@ -554,7 +558,7 @@ impl<V: SmallField, T: TrackId + 'static, Cfg: RWConfig<T>, const SIZE: usize>
// here, as this is an unsynchronizd access.
let resolver = this.common.resolvers.u_deref().get(*resolver_ix);

if cfg!(cr_paranoia_mode) || crate::dag::resolvers::mt::PARANOIA {
if cfg!(feature="cr_paranoia_mode") || crate::dag::resolvers::mt::PARANOIA {
std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {
this.invoke(resolver, *order_ix);

Expand Down Expand Up @@ -590,7 +594,7 @@ impl<V: SmallField, T: TrackId + 'static, Cfg: RWConfig<T>, const SIZE: usize>
});
}

if cfg!(cr_paranoia_mode) || crate::dag::resolvers::mt::PARANOIA {
if cfg!(feature = "cr_paranoia_mode") || crate::dag::resolvers::mt::PARANOIA {
log!(
"{}\n{:#?}\n{:#?}",
std::thread::current().name().unwrap_or_default(),
Expand Down Expand Up @@ -629,7 +633,7 @@ impl<V: SmallField, T: TrackId + 'static, Cfg: RWConfig<T>, const SIZE: usize>
.map(|x| {
let (vs, md) = self.common.values.u_deref().get_item_ref(*x);

if cfg!(cr_paranoia_mode) || true {
if cfg!(feature = "cr_paranoia_mode") || true {
if Cfg::ASSERT_TRACKED_VALUES {
assert!(md.is_tracked());
}
Expand Down Expand Up @@ -678,7 +682,7 @@ impl<V: SmallField, T: TrackId + 'static, Cfg: RWConfig<T>, const SIZE: usize>

let mut track = false;

if cfg!(cr_paranoia_mode) || crate::dag::resolvers::mt::PARANOIA {
if cfg!(feature = "cr_paranoia_mode") || crate::dag::resolvers::mt::PARANOIA {
if let Some(x) = self
.debug_track
.iter()
Expand Down Expand Up @@ -831,7 +835,7 @@ impl LockStepChannel {
fn execute(&self) {
use std::sync::atomic::Ordering::*;

if (cfg!(cr_paranoia_mode) || crate::dag::resolvers::mt::PARANOIA) && false {
if (cfg!(feature = "cr_paranoia_mode") || crate::dag::resolvers::mt::PARANOIA) && false {
log!("RW: batch sent {:#?}", unsafe { self.data.u_deref() });
}

Expand Down
Loading