Skip to content

Commit 12ca186

Browse files
change the names of several components
1 parent 5e0cedd commit 12ca186

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+396
-398
lines changed

stwo_cairo_prover/crates/adapter/src/opcodes.rs

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ pub struct CasmStatesByOpcode {
2525
pub assert_eq_opcode: Vec<CasmState>,
2626
pub assert_eq_opcode_double_deref: Vec<CasmState>,
2727
pub assert_eq_opcode_imm: Vec<CasmState>,
28-
pub call_opcode: Vec<CasmState>,
28+
pub call_opcode_abs: Vec<CasmState>,
2929
pub call_opcode_rel_imm: Vec<CasmState>,
30-
pub jnz_opcode: Vec<CasmState>,
30+
pub jnz_opcode_non_taken: Vec<CasmState>,
3131
pub jnz_opcode_taken: Vec<CasmState>,
3232
pub jump_opcode_rel_imm: Vec<CasmState>,
3333
pub jump_opcode_rel: Vec<CasmState>,
3434
pub jump_opcode_double_deref: Vec<CasmState>,
35-
pub jump_opcode: Vec<CasmState>,
35+
pub jump_opcode_abs: Vec<CasmState>,
3636
pub mul_opcode_small: Vec<CasmState>,
3737
pub mul_opcode: Vec<CasmState>,
3838
pub ret_opcode: Vec<CasmState>,
@@ -172,7 +172,7 @@ impl CasmStatesByOpcode {
172172
&& pc_update_jump
173173
&& offset1 == -1
174174
);
175-
self.jump_opcode.push(state);
175+
self.jump_opcode_abs.push(state);
176176
}
177177
}
178178

@@ -211,7 +211,7 @@ impl CasmStatesByOpcode {
211211
} else {
212212
// call abs [ap/fp + offset2].
213213
assert!((op_1_base_ap ^ op_1_base_fp) && !op_1_imm && pc_update_jump);
214-
self.call_opcode.push(state);
214+
self.call_opcode_abs.push(state);
215215
}
216216
}
217217

@@ -244,7 +244,7 @@ impl CasmStatesByOpcode {
244244
if taken {
245245
self.jnz_opcode_taken.push(state);
246246
} else {
247-
self.jnz_opcode.push(state);
247+
self.jnz_opcode_non_taken.push(state);
248248
}
249249
}
250250

@@ -490,14 +490,14 @@ impl CasmStatesByOpcode {
490490
assert_eq_opcode,
491491
assert_eq_opcode_double_deref,
492492
assert_eq_opcode_imm,
493-
call_opcode,
493+
call_opcode_abs,
494494
call_opcode_rel_imm,
495-
jnz_opcode,
495+
jnz_opcode_non_taken,
496496
jnz_opcode_taken,
497497
jump_opcode_rel_imm,
498498
jump_opcode_rel,
499499
jump_opcode_double_deref,
500-
jump_opcode,
500+
jump_opcode_abs,
501501
mul_opcode_small,
502502
mul_opcode,
503503
ret_opcode,
@@ -513,15 +513,15 @@ impl CasmStatesByOpcode {
513513
self.assert_eq_opcode_double_deref
514514
.extend(assert_eq_opcode_double_deref);
515515
self.assert_eq_opcode_imm.extend(assert_eq_opcode_imm);
516-
self.call_opcode.extend(call_opcode);
516+
self.call_opcode_abs.extend(call_opcode_abs);
517517
self.call_opcode_rel_imm.extend(call_opcode_rel_imm);
518-
self.jnz_opcode.extend(jnz_opcode);
518+
self.jnz_opcode_non_taken.extend(jnz_opcode_non_taken);
519519
self.jnz_opcode_taken.extend(jnz_opcode_taken);
520520
self.jump_opcode_rel_imm.extend(jump_opcode_rel_imm);
521521
self.jump_opcode_rel.extend(jump_opcode_rel);
522522
self.jump_opcode_double_deref
523523
.extend(jump_opcode_double_deref);
524-
self.jump_opcode.extend(jump_opcode);
524+
self.jump_opcode_abs.extend(jump_opcode_abs);
525525
self.mul_opcode_small.extend(mul_opcode_small);
526526
self.mul_opcode.extend(mul_opcode);
527527
self.ret_opcode.extend(ret_opcode);
@@ -544,12 +544,15 @@ impl CasmStatesByOpcode {
544544
"assert_eq_opcode_imm".to_string(),
545545
self.assert_eq_opcode_imm.len(),
546546
),
547-
("call_opcode".to_string(), self.call_opcode.len()),
547+
("call_opcode_abs".to_string(), self.call_opcode_abs.len()),
548548
(
549549
"call_opcode_rel_imm".to_string(),
550550
self.call_opcode_rel_imm.len(),
551551
),
552-
("jnz_opcode".to_string(), self.jnz_opcode.len()),
552+
(
553+
"jnz_opcode_non_taken".to_string(),
554+
self.jnz_opcode_non_taken.len(),
555+
),
553556
("jnz_opcode_taken".to_string(), self.jnz_opcode_taken.len()),
554557
(
555558
"jump_opcode_rel_imm".to_string(),
@@ -560,7 +563,7 @@ impl CasmStatesByOpcode {
560563
"jump_opcode_double_deref".to_string(),
561564
self.jump_opcode_double_deref.len(),
562565
),
563-
("jump_opcode".to_string(), self.jump_opcode.len()),
566+
("jump_opcode_abs".to_string(), self.jump_opcode_abs.len()),
564567
("mul_opcode_small".to_string(), self.mul_opcode_small.len()),
565568
("mul_opcode".to_string(), self.mul_opcode.len()),
566569
("ret_opcode".to_string(), self.ret_opcode.len()),
@@ -904,7 +907,7 @@ mod mappings_tests {
904907

905908
let input = input_from_plain_casm(instructions);
906909
let casm_states_by_opcode = input.state_transitions.casm_states_by_opcode;
907-
assert_eq!(casm_states_by_opcode.jump_opcode.len(), 1);
910+
assert_eq!(casm_states_by_opcode.jump_opcode_abs.len(), 1);
908911
assert_eq!(casm_states_by_opcode.call_opcode_rel_imm.len(), 1);
909912
assert_eq!(casm_states_by_opcode.add_opcode_small.len(), 1);
910913
}
@@ -968,7 +971,7 @@ mod mappings_tests {
968971

969972
let input = input_from_plain_casm(instructions);
970973
let casm_states_by_opcode = input.state_transitions.casm_states_by_opcode;
971-
assert_eq!(casm_states_by_opcode.call_opcode.len(), 2);
974+
assert_eq!(casm_states_by_opcode.call_opcode_abs.len(), 2);
972975
assert_eq!(casm_states_by_opcode.call_opcode_rel_imm.len(), 1);
973976
}
974977

@@ -983,7 +986,7 @@ mod mappings_tests {
983986

984987
let input = input_from_plain_casm(instructions);
985988
let casm_states_by_opcode = input.state_transitions.casm_states_by_opcode;
986-
assert_eq!(casm_states_by_opcode.call_opcode.len(), 2);
989+
assert_eq!(casm_states_by_opcode.call_opcode_abs.len(), 2);
987990
}
988991

989992
#[test]
@@ -997,7 +1000,7 @@ mod mappings_tests {
9971000

9981001
let input = input_from_plain_casm(instructions);
9991002
let casm_states_by_opcode = input.state_transitions.casm_states_by_opcode;
1000-
assert_eq!(casm_states_by_opcode.jnz_opcode.len(), 1);
1003+
assert_eq!(casm_states_by_opcode.jnz_opcode_non_taken.len(), 1);
10011004
}
10021005

10031006
#[test]
@@ -1012,7 +1015,7 @@ mod mappings_tests {
10121015

10131016
let input = input_from_plain_casm(instructions);
10141017
let casm_states_by_opcode = input.state_transitions.casm_states_by_opcode;
1015-
assert_eq!(casm_states_by_opcode.jnz_opcode.len(), 1);
1018+
assert_eq!(casm_states_by_opcode.jnz_opcode_non_taken.len(), 1);
10161019
}
10171020

10181021
#[test]

stwo_cairo_prover/crates/cairo-air/src/air.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ pub struct CairoInteractionElements {
588588
pub poseidon_full_round_chain: relations::PoseidonFullRoundChain,
589589
pub cube_252: relations::Cube252,
590590
pub poseidon_round_keys: relations::PoseidonRoundKeys,
591-
pub range_check_felt_252_width_27: relations::RangeCheckFelt252Width27,
591+
pub range_check_252_width_27: relations::RangeCheck252Width27,
592592
pub memory_address_to_id: relations::MemoryAddressToId,
593593
pub memory_id_to_value: relations::MemoryIdToBig,
594594
pub range_checks: RangeChecksInteractionElements,
@@ -612,7 +612,7 @@ impl CairoInteractionElements {
612612
poseidon_full_round_chain: relations::PoseidonFullRoundChain::draw(channel),
613613
cube_252: relations::Cube252::draw(channel),
614614
poseidon_round_keys: relations::PoseidonRoundKeys::draw(channel),
615-
range_check_felt_252_width_27: relations::RangeCheckFelt252Width27::draw(channel),
615+
range_check_252_width_27: relations::RangeCheck252Width27::draw(channel),
616616
partial_ec_mul: relations::PartialEcMul::draw(channel),
617617
pedersen_points_table: relations::PedersenPointsTable::draw(channel),
618618
memory_address_to_id: relations::MemoryAddressToId::draw(channel),

stwo_cairo_prover/crates/cairo-air/src/builtins_air.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ impl BuiltinComponents {
294294
.range_checks
295295
.rc_4_4_4_4
296296
.clone(),
297-
range_check_felt_252_width_27_lookup_elements: interaction_elements
298-
.range_check_felt_252_width_27
297+
range_check_252_width_27_lookup_elements: interaction_elements
298+
.range_check_252_width_27
299299
.clone(),
300300
},
301301
interaction_claim.poseidon_builtin.unwrap().claimed_sum,

stwo_cairo_prover/crates/cairo-air/src/components/call_opcode.rs renamed to stwo_cairo_prover/crates/cairo-air/src/components/call_opcode_abs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,10 @@ mod tests {
213213
use stwo_constraint_framework::expr::ExprEvaluator;
214214

215215
use super::*;
216-
use crate::components::constraints_regression_test_values::CALL_OPCODE;
216+
use crate::components::constraints_regression_test_values::CALL_OPCODE_ABS;
217217

218218
#[test]
219-
fn call_opcode_constraints_regression() {
219+
fn call_opcode_abs_constraints_regression() {
220220
let mut rng = SmallRng::seed_from_u64(0);
221221
let eval = Eval {
222222
claim: Claim { log_size: 4 },
@@ -233,6 +233,6 @@ mod tests {
233233
sum += c.assign(&assignment) * rng.gen::<QM31>();
234234
}
235235

236-
assert_eq!(sum, CALL_OPCODE);
236+
assert_eq!(sum, CALL_OPCODE_ABS);
237237
}
238238
}

stwo_cairo_prover/crates/cairo-air/src/components/constraints_regression_test_values.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ pub const BLAKE_G: QM31 = qm31!(589517194, 1714400972, 124778100, 1709965715);
2020
pub const BLAKE_ROUND_SIGMA: QM31 = qm31!(1679325815, 2032005875, 1831081253, 999201494);
2121
pub const BLAKE_ROUND: QM31 = qm31!(689010793, 1714718853, 1598356108, 1862084735);
2222
pub const CALL_OPCODE_REL_IMM: QM31 = qm31!(1058958974, 291699845, 1067131259, 1385778936);
23-
pub const CALL_OPCODE: QM31 = qm31!(753588549, 110829970, 382462386, 1929508194);
23+
pub const CALL_OPCODE_ABS: QM31 = qm31!(753588549, 110829970, 382462386, 1929508194);
2424
pub const CUBE_252: QM31 = qm31!(2138805547, 791862161, 1496263445, 1432185054);
2525
pub const GENERIC_OPCODE: QM31 = qm31!(1897142610, 70087557, 1948231093, 404344144);
2626
pub const JNZ_OPCODE_TAKEN: QM31 = qm31!(863863896, 1799155008, 2087434855, 1577176263);
27-
pub const JNZ_OPCODE: QM31 = qm31!(527000951, 699354015, 1174877270, 2099424613);
27+
pub const JNZ_OPCODE_NON_TAKEN: QM31 = qm31!(527000951, 699354015, 1174877270, 2099424613);
2828
pub const JUMP_OPCODE_DOUBLE_DEREF: QM31 = qm31!(1104346987, 1319193194, 162676979, 376017635);
2929
pub const JUMP_OPCODE_REL_IMM: QM31 = qm31!(79712695, 631991609, 2034114495, 1081569364);
3030
pub const JUMP_OPCODE_REL: QM31 = qm31!(1321760482, 1745914118, 2079741091, 369317996);
31-
pub const JUMP_OPCODE: QM31 = qm31!(1822069462, 1014890554, 653917245, 1477843164);
31+
pub const JUMP_OPCODE_ABS: QM31 = qm31!(1822069462, 1014890554, 653917245, 1477843164);
3232
pub const MEMORY_ADDRESS_TO_ID: QM31 = qm31!(1557081375, 1030421885, 614292297, 1358103414);
3333
pub const SMALL_MEMORY_ID_TO_BIG: QM31 = qm31!(1926563719, 1031963008, 80105391, 1734885910);
3434
pub const BIG_MEMORY_ID_TO_BIG: QM31 = qm31!(482978858, 145449557, 1999339889, 1114454455);
@@ -38,15 +38,15 @@ pub const MUL_OPCODE: QM31 = qm31!(1765238355, 567102279, 1303576643, 132743394)
3838
pub const PARTIAL_EC_MUL: QM31 = qm31!(1047475528, 531269891, 634870981, 2036983447);
3939
pub const PEDERSEN_BUILTIN: QM31 = qm31!(830213408, 1658716778, 2015482698, 1847357253);
4040
pub const PEDERSEN_POINTS_TABLE: QM31 = qm31!(2016504587, 1568791972, 1116506128, 884768463);
41-
pub const POSEIDON_3_PARTIAL_ROUNDS_CHAIN: QM31 = qm31!(999129644, 603403435, 224776492, 211478069);
42-
pub const POSEIDON_BUILTIN: QM31 = qm31!(943376676, 1660908785, 1242555985, 619448508);
41+
pub const POSEIDON_3_PARTIAL_ROUNDS_CHAIN: QM31 =
42+
qm31!(2033262826, 667964543, 319252363, 1402641406);
43+
pub const POSEIDON_BUILTIN: QM31 = qm31!(1982000500, 548063079, 361145103, 1920658348);
4344
pub const POSEIDON_FULL_ROUND_CHAIN: QM31 = qm31!(941127383, 452604700, 507558048, 839794501);
4445
pub const POSEIDON_ROUND_KEYS: QM31 = qm31!(1182501131, 1048397214, 2019522910, 988967040);
4546
pub const QM_31_ADD_MUL_OPCODE: QM31 = qm31!(989822133, 613070772, 258458924, 1917445389);
4647
pub const RANGE_CHECK_BUILTIN_BITS_96: QM31 = qm31!(1203114103, 1251795602, 1884838449, 1758114216);
4748
pub const RANGE_CHECK_BUILTIN_BITS_128: QM31 = qm31!(98318865, 510635574, 1814943674, 477505709);
48-
pub const RANGE_CHECK_FELT_252_WIDTH_27: QM31 =
49-
qm31!(1797698280, 1382662020, 2068921887, 1211498423);
49+
pub const RANGE_CHECK_252_WIDTH_27: QM31 = qm31!(432510888, 1744417094, 1925158638, 1069774182);
5050
pub const RANGE_CHECK_6: QM31 = qm31!(1839596244, 1029136098, 314080530, 1911163288);
5151
pub const RANGE_CHECK_8: QM31 = qm31!(619380186, 51892308, 1959448152, 27164417);
5252
pub const RANGE_CHECK_11: QM31 = qm31!(1797671535, 1448714071, 655307656, 610124137);

stwo_cairo_prover/crates/cairo-air/src/components/jnz_opcode.rs renamed to stwo_cairo_prover/crates/cairo-air/src/components/jnz_opcode_non_taken.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@ mod tests {
177177
use stwo_constraint_framework::expr::ExprEvaluator;
178178

179179
use super::*;
180-
use crate::components::constraints_regression_test_values::JNZ_OPCODE;
180+
use crate::components::constraints_regression_test_values::JNZ_OPCODE_NON_TAKEN;
181181

182182
#[test]
183-
fn jnz_opcode_constraints_regression() {
183+
fn jnz_opcode_non_taken_constraints_regression() {
184184
let mut rng = SmallRng::seed_from_u64(0);
185185
let eval = Eval {
186186
claim: Claim { log_size: 4 },
@@ -197,6 +197,6 @@ mod tests {
197197
sum += c.assign(&assignment) * rng.gen::<QM31>();
198198
}
199199

200-
assert_eq!(sum, JNZ_OPCODE);
200+
assert_eq!(sum, JNZ_OPCODE_NON_TAKEN);
201201
}
202202
}

stwo_cairo_prover/crates/cairo-air/src/components/jump_opcode.rs renamed to stwo_cairo_prover/crates/cairo-air/src/components/jump_opcode_abs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ mod tests {
160160
use stwo_constraint_framework::expr::ExprEvaluator;
161161

162162
use super::*;
163-
use crate::components::constraints_regression_test_values::JUMP_OPCODE;
163+
use crate::components::constraints_regression_test_values::JUMP_OPCODE_ABS;
164164

165165
#[test]
166-
fn jump_opcode_constraints_regression() {
166+
fn jump_opcode_abs_constraints_regression() {
167167
let mut rng = SmallRng::seed_from_u64(0);
168168
let eval = Eval {
169169
claim: Claim { log_size: 4 },
@@ -180,6 +180,6 @@ mod tests {
180180
sum += c.assign(&assignment) * rng.gen::<QM31>();
181181
}
182182

183-
assert_eq!(sum, JUMP_OPCODE);
183+
assert_eq!(sum, JUMP_OPCODE_ABS);
184184
}
185185
}

stwo_cairo_prover/crates/cairo-air/src/components/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ pub mod blake_compress_opcode;
1010
pub mod blake_g;
1111
pub mod blake_round;
1212
pub mod blake_round_sigma;
13-
pub mod call_opcode;
13+
pub mod call_opcode_abs;
1414
pub mod call_opcode_rel_imm;
1515
pub mod cube_252;
1616
pub mod generic_opcode;
17-
pub mod jnz_opcode;
17+
pub mod jnz_opcode_non_taken;
1818
pub mod jnz_opcode_taken;
19-
pub mod jump_opcode;
19+
pub mod jump_opcode_abs;
2020
pub mod jump_opcode_double_deref;
2121
pub mod jump_opcode_rel;
2222
pub mod jump_opcode_rel_imm;
@@ -45,6 +45,7 @@ pub mod range_check_20_e;
4545
pub mod range_check_20_f;
4646
pub mod range_check_20_g;
4747
pub mod range_check_20_h;
48+
pub mod range_check_252_width_27;
4849
pub mod range_check_3_3_3_3_3;
4950
pub mod range_check_3_6_6_3;
5051
pub mod range_check_4_3;
@@ -64,7 +65,6 @@ pub mod range_check_9_9_g;
6465
pub mod range_check_9_9_h;
6566
pub mod range_check_builtin_bits_128;
6667
pub mod range_check_builtin_bits_96;
67-
pub mod range_check_felt_252_width_27;
6868
pub mod ret_opcode;
6969
pub mod triple_xor_32;
7070
pub mod verify_bitwise_xor_12;

stwo_cairo_prover/crates/cairo-air/src/components/poseidon_3_partial_rounds_chain.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub const RELATION_USES_PER_ROW: [RelationUse; 6] = [
1818
uses: 1,
1919
},
2020
RelationUse {
21-
relation_id: "RangeCheckFelt252Width27",
21+
relation_id: "RangeCheck252Width27",
2222
uses: 3,
2323
},
2424
RelationUse {
@@ -37,7 +37,7 @@ pub struct Eval {
3737
pub cube_252_lookup_elements: relations::Cube252,
3838
pub range_check_4_4_4_4_lookup_elements: relations::RangeCheck_4_4_4_4,
3939
pub range_check_4_4_lookup_elements: relations::RangeCheck_4_4,
40-
pub range_check_felt_252_width_27_lookup_elements: relations::RangeCheckFelt252Width27,
40+
pub range_check_252_width_27_lookup_elements: relations::RangeCheck252Width27,
4141
pub poseidon_3_partial_rounds_chain_lookup_elements: relations::Poseidon3PartialRoundsChain,
4242
}
4343

@@ -381,7 +381,7 @@ impl FrameworkEval for Eval {
381381
&self.cube_252_lookup_elements,
382382
&self.range_check_4_4_4_4_lookup_elements,
383383
&self.range_check_4_4_lookup_elements,
384-
&self.range_check_felt_252_width_27_lookup_elements,
384+
&self.range_check_252_width_27_lookup_elements,
385385
&mut eval,
386386
);
387387
PoseidonPartialRound::evaluate(
@@ -472,7 +472,7 @@ impl FrameworkEval for Eval {
472472
&self.cube_252_lookup_elements,
473473
&self.range_check_4_4_4_4_lookup_elements,
474474
&self.range_check_4_4_lookup_elements,
475-
&self.range_check_felt_252_width_27_lookup_elements,
475+
&self.range_check_252_width_27_lookup_elements,
476476
&mut eval,
477477
);
478478
PoseidonPartialRound::evaluate(
@@ -563,7 +563,7 @@ impl FrameworkEval for Eval {
563563
&self.cube_252_lookup_elements,
564564
&self.range_check_4_4_4_4_lookup_elements,
565565
&self.range_check_4_4_lookup_elements,
566-
&self.range_check_felt_252_width_27_lookup_elements,
566+
&self.range_check_252_width_27_lookup_elements,
567567
&mut eval,
568568
);
569569
eval.add_to_relation(RelationEntry::new(
@@ -689,8 +689,7 @@ mod tests {
689689
cube_252_lookup_elements: relations::Cube252::dummy(),
690690
range_check_4_4_4_4_lookup_elements: relations::RangeCheck_4_4_4_4::dummy(),
691691
range_check_4_4_lookup_elements: relations::RangeCheck_4_4::dummy(),
692-
range_check_felt_252_width_27_lookup_elements:
693-
relations::RangeCheckFelt252Width27::dummy(),
692+
range_check_252_width_27_lookup_elements: relations::RangeCheck252Width27::dummy(),
694693
poseidon_3_partial_rounds_chain_lookup_elements:
695694
relations::Poseidon3PartialRoundsChain::dummy(),
696695
};

0 commit comments

Comments
 (0)