Skip to content

Commit

Permalink
refactor!: Simplify testing framework
Browse files Browse the repository at this point in the history
- Drop `Rc<RefCell<_>>` from `RustShadow`
- De-duplicate boilerplate code for `Closure`s
- De-duplicate import statements
- Clean up outdated annotations
- Move various rust-shadow implementations into test modules
  • Loading branch information
jan-ferdinand committed Dec 18, 2024
2 parents 2187793 + cdcad74 commit b733489
Show file tree
Hide file tree
Showing 203 changed files with 3,039 additions and 5,038 deletions.
4 changes: 2 additions & 2 deletions tasm-lib/benchmarks/tasmlib_arithmetic_u128_safe_add.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"benchmark_result": {
"clock_cycle_count": 24,
"hash_table_height": 24,
"u32_table_height": 125,
"u32_table_height": 127,
"op_stack_table_height": 14,
"ram_table_height": 0
},
Expand All @@ -15,7 +15,7 @@
"benchmark_result": {
"clock_cycle_count": 24,
"hash_table_height": 24,
"u32_table_height": 127,
"u32_table_height": 131,
"op_stack_table_height": 14,
"ram_table_height": 0
},
Expand Down
8 changes: 4 additions & 4 deletions tasm-lib/benchmarks/tasmlib_array_sum_of_100_bfes.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
{
"name": "tasmlib_array_sum_of_100_bfes",
"benchmark_result": {
"clock_cycle_count": 125,
"clock_cycle_count": 124,
"hash_table_height": 90,
"u32_table_height": 0,
"op_stack_table_height": 202,
"op_stack_table_height": 200,
"ram_table_height": 100
},
"case": "CommonCase"
},
{
"name": "tasmlib_array_sum_of_100_bfes",
"benchmark_result": {
"clock_cycle_count": 125,
"clock_cycle_count": 124,
"hash_table_height": 90,
"u32_table_height": 0,
"op_stack_table_height": 202,
"op_stack_table_height": 200,
"ram_table_height": 100
},
"case": "WorstCase"
Expand Down
8 changes: 4 additions & 4 deletions tasm-lib/benchmarks/tasmlib_array_sum_of_200_bfes.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
{
"name": "tasmlib_array_sum_of_200_bfes",
"benchmark_result": {
"clock_cycle_count": 245,
"clock_cycle_count": 244,
"hash_table_height": 174,
"u32_table_height": 0,
"op_stack_table_height": 402,
"op_stack_table_height": 400,
"ram_table_height": 200
},
"case": "CommonCase"
},
{
"name": "tasmlib_array_sum_of_200_bfes",
"benchmark_result": {
"clock_cycle_count": 245,
"clock_cycle_count": 244,
"hash_table_height": 174,
"u32_table_height": 0,
"op_stack_table_height": 402,
"op_stack_table_height": 400,
"ram_table_height": 200
},
"case": "WorstCase"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
{
"name": "tasmlib_hashing_algebraic_hasher_sample_indices",
"benchmark_result": {
"clock_cycle_count": 2347,
"clock_cycle_count": 2346,
"hash_table_height": 318,
"u32_table_height": 2621,
"op_stack_table_height": 1683,
"op_stack_table_height": 1681,
"ram_table_height": 208
},
"case": "CommonCase"
},
{
"name": "tasmlib_hashing_algebraic_hasher_sample_indices",
"benchmark_result": {
"clock_cycle_count": 4643,
"clock_cycle_count": 4642,
"hash_table_height": 342,
"u32_table_height": 5220,
"op_stack_table_height": 3331,
"op_stack_table_height": 3329,
"ram_table_height": 412
},
"case": "WorstCase"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
{
"name": "tasmlib_hashing_algebraic_hasher_sample_scalars",
"benchmark_result": {
"clock_cycle_count": 103,
"hash_table_height": 96,
"clock_cycle_count": 96,
"hash_table_height": 90,
"u32_table_height": 44,
"op_stack_table_height": 130,
"op_stack_table_height": 116,
"ram_table_height": 34
},
"case": "CommonCase"
},
{
"name": "tasmlib_hashing_algebraic_hasher_sample_scalars",
"benchmark_result": {
"clock_cycle_count": 454,
"hash_table_height": 258,
"clock_cycle_count": 393,
"hash_table_height": 252,
"u32_table_height": 47,
"op_stack_table_height": 886,
"op_stack_table_height": 764,
"ram_table_height": 304
},
"case": "WorstCase"
Expand Down
8 changes: 4 additions & 4 deletions tasm-lib/benchmarks/tasmlib_hashing_squeeze_repeatedly.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
{
"name": "tasmlib_hashing_squeeze_repeatedly",
"benchmark_result": {
"clock_cycle_count": 137,
"clock_cycle_count": 117,
"hash_table_height": 78,
"u32_table_height": 0,
"op_stack_table_height": 284,
"op_stack_table_height": 244,
"ram_table_height": 100
},
"case": "CommonCase"
},
{
"name": "tasmlib_hashing_squeeze_repeatedly",
"benchmark_result": {
"clock_cycle_count": 2607,
"clock_cycle_count": 2207,
"hash_table_height": 1218,
"u32_table_height": 0,
"op_stack_table_height": 5604,
"op_stack_table_height": 4804,
"ram_table_height": 2000
},
"case": "WorstCase"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
{
"name": "tasmlib_list_contiguous_list_get_pointer_list",
"benchmark_result": {
"clock_cycle_count": 111,
"clock_cycle_count": 110,
"hash_table_height": 84,
"u32_table_height": 32,
"op_stack_table_height": 82,
"op_stack_table_height": 80,
"ram_table_height": 9
},
"case": "CommonCase"
},
{
"name": "tasmlib_list_contiguous_list_get_pointer_list",
"benchmark_result": {
"clock_cycle_count": 186,
"clock_cycle_count": 185,
"hash_table_height": 84,
"u32_table_height": 32,
"op_stack_table_height": 142,
"op_stack_table_height": 140,
"ram_table_height": 15
},
"case": "WorstCase"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
{
"name": "tasmlib_list_higher_order_u32_filter_test_hash_xfield_element_lsb",
"benchmark_result": {
"clock_cycle_count": 870,
"clock_cycle_count": 869,
"hash_table_height": 338,
"u32_table_height": 627,
"op_stack_table_height": 836,
"op_stack_table_height": 834,
"ram_table_height": 54
},
"case": "CommonCase"
},
{
"name": "tasmlib_list_higher_order_u32_filter_test_hash_xfield_element_lsb",
"benchmark_result": {
"clock_cycle_count": 529,
"clock_cycle_count": 528,
"hash_table_height": 286,
"u32_table_height": 347,
"op_stack_table_height": 494,
"op_stack_table_height": 492,
"ram_table_height": 36
},
"case": "WorstCase"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
{
"name": "tasmlib_list_higher_order_u32_map_dyn_length_elements",
"benchmark_result": {
"clock_cycle_count": 472,
"clock_cycle_count": 471,
"hash_table_height": 102,
"u32_table_height": 242,
"op_stack_table_height": 334,
"op_stack_table_height": 332,
"ram_table_height": 54
},
"case": "CommonCase"
},
{
"name": "tasmlib_list_higher_order_u32_map_dyn_length_elements",
"benchmark_result": {
"clock_cycle_count": 4252,
"clock_cycle_count": 4251,
"hash_table_height": 102,
"u32_table_height": 632,
"op_stack_table_height": 3034,
"op_stack_table_height": 3032,
"ram_table_height": 504
},
"case": "WorstCase"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
{
"name": "tasmlib_list_higher_order_u32_map_test_hash_xfield_element",
"benchmark_result": {
"clock_cycle_count": 506,
"hash_table_height": 250,
"clock_cycle_count": 505,
"hash_table_height": 244,
"u32_table_height": 33,
"op_stack_table_height": 584,
"op_stack_table_height": 582,
"ram_table_height": 86
},
"case": "CommonCase"
},
{
"name": "tasmlib_list_higher_order_u32_map_test_hash_xfield_element",
"benchmark_result": {
"clock_cycle_count": 4466,
"hash_table_height": 1420,
"clock_cycle_count": 4465,
"hash_table_height": 1414,
"u32_table_height": 33,
"op_stack_table_height": 5444,
"op_stack_table_height": 5442,
"ram_table_height": 806
},
"case": "WorstCase"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
{
"name": "tasmlib_list_higher_order_u32_zip_xfe_with_digest",
"benchmark_result": {
"clock_cycle_count": 394,
"clock_cycle_count": 393,
"hash_table_height": 96,
"u32_table_height": 32,
"op_stack_table_height": 507,
"op_stack_table_height": 505,
"ram_table_height": 262
},
"case": "CommonCase"
},
{
"name": "tasmlib_list_higher_order_u32_zip_xfe_with_digest",
"benchmark_result": {
"clock_cycle_count": 294,
"clock_cycle_count": 293,
"hash_table_height": 96,
"u32_table_height": 32,
"op_stack_table_height": 367,
"op_stack_table_height": 365,
"ram_table_height": 182
},
"case": "WorstCase"
Expand Down
8 changes: 4 additions & 4 deletions tasm-lib/benchmarks/tasmlib_list_new___digest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
{
"name": "tasmlib_list_new___digest",
"benchmark_result": {
"clock_cycle_count": 33,
"clock_cycle_count": 32,
"hash_table_height": 36,
"u32_table_height": 32,
"op_stack_table_height": 25,
"op_stack_table_height": 23,
"ram_table_height": 3
},
"case": "CommonCase"
},
{
"name": "tasmlib_list_new___digest",
"benchmark_result": {
"clock_cycle_count": 33,
"clock_cycle_count": 32,
"hash_table_height": 36,
"u32_table_height": 32,
"op_stack_table_height": 25,
"op_stack_table_height": 23,
"ram_table_height": 3
},
"case": "WorstCase"
Expand Down
8 changes: 4 additions & 4 deletions tasm-lib/benchmarks/tasmlib_list_range.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
{
"name": "tasmlib_list_range",
"benchmark_result": {
"clock_cycle_count": 916,
"clock_cycle_count": 915,
"hash_table_height": 78,
"u32_table_height": 39,
"op_stack_table_height": 767,
"op_stack_table_height": 765,
"ram_table_height": 49
},
"case": "CommonCase"
},
{
"name": "tasmlib_list_range",
"benchmark_result": {
"clock_cycle_count": 4811,
"clock_cycle_count": 4810,
"hash_table_height": 78,
"u32_table_height": 41,
"op_stack_table_height": 4047,
"op_stack_table_height": 4045,
"ram_table_height": 254
},
"case": "WorstCase"
Expand Down
12 changes: 6 additions & 6 deletions tasm-lib/benchmarks/tasmlib_list_swap_xfe.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
{
"name": "tasmlib_list_swap_xfe",
"benchmark_result": {
"clock_cycle_count": 31,
"hash_table_height": 36,
"clock_cycle_count": 25,
"hash_table_height": 30,
"u32_table_height": 0,
"op_stack_table_height": 37,
"op_stack_table_height": 25,
"ram_table_height": 12
},
"case": "CommonCase"
},
{
"name": "tasmlib_list_swap_xfe",
"benchmark_result": {
"clock_cycle_count": 31,
"hash_table_height": 36,
"clock_cycle_count": 25,
"hash_table_height": 30,
"u32_table_height": 0,
"op_stack_table_height": 37,
"op_stack_table_height": 25,
"ram_table_height": 12
},
"case": "WorstCase"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
{
"name": "tasmlib_mmr_calculate_new_peaks_from_append",
"benchmark_result": {
"clock_cycle_count": 3570,
"clock_cycle_count": 3569,
"hash_table_height": 396,
"u32_table_height": 164,
"op_stack_table_height": 3442,
"op_stack_table_height": 3440,
"ram_table_height": 942
},
"case": "CommonCase"
},
{
"name": "tasmlib_mmr_calculate_new_peaks_from_append",
"benchmark_result": {
"clock_cycle_count": 7038,
"clock_cycle_count": 7037,
"hash_table_height": 582,
"u32_table_height": 165,
"op_stack_table_height": 6812,
"op_stack_table_height": 6810,
"ram_table_height": 1872
},
"case": "WorstCase"
Expand Down
Loading

0 comments on commit b733489

Please sign in to comment.