Skip to content

Conversation

jialinli98
Copy link
Contributor

@jialinli98 jialinli98 commented Aug 7, 2025

Description

Problem*

use bool for push_layer, push_layer_type_of_root, and pop_layer.

closes #57

Summary*

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@jialinli98 jialinli98 force-pushed the jl/token_validation_in_bool branch from 15b7da2 to c7661ba Compare August 7, 2025 02:17
@jialinli98 jialinli98 changed the title chore: use bool for token validation fields chore: use bool for ValidationFlag fields Aug 7, 2025
@jialinli98 jialinli98 requested a review from TomAFrench August 7, 2025 02:51
@TomAFrench
Copy link
Member

It seems like there's three options for the layer type however:

pub(crate) mod Layer {
pub(crate) global OBJECT_LAYER: u32 = 0;
pub(crate) global ARRAY_LAYER: u32 = 1;
pub(crate) global SINGLE_VALUE_LAYER: u32 = 2;
}

Looks like this needs more investigation.

@jialinli98
Copy link
Contributor Author

jialinli98 commented Aug 7, 2025

assert(r.push_layer_type_of_root * r.push_layer_type_of_root == r.push_layer_type_of_root);
single_value_layer isn't used in the implementation, as standalone values are not supported by this library. Previously, we also checked that this value was a boolean.

@TomAFrench
Copy link
Member

Ok, can you remove this from the enum in that case?

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

ACIR Opcodes

Benchmark suite Current: 4fda91d Previous: 38f3f26 Ratio
get_array_JSON16kb_Bench.json/main 42557 acir_opcodes 42557 acir_opcodes 1
get_array_JSON512b_Bench.json/main 2365 acir_opcodes 2365 acir_opcodes 1
get_keys_at_root_JSON16kb_Bench.json/main 3331178 acir_opcodes 3331178 acir_opcodes 1
get_keys_at_root_JSON512b_Bench.json/main 3315306 acir_opcodes 3315306 acir_opcodes 1
get_literal_JSON16kb_Bench.json/main 17709 acir_opcodes 17709 acir_opcodes 1
get_literal_JSON512b_Bench.json/main 1837 acir_opcodes 1837 acir_opcodes 1
get_number_JSON16kb_Bench.json/main 17836 acir_opcodes 17836 acir_opcodes 1
get_number_JSON512b_Bench.json/main 1964 acir_opcodes 1964 acir_opcodes 1
get_object_JSON16kb_Bench.json/main 42557 acir_opcodes 42557 acir_opcodes 1
get_object_JSON512b_Bench.json/main 2365 acir_opcodes 2365 acir_opcodes 1
get_string_JSON16kb_Bench.json/main 43258 acir_opcodes 43258 acir_opcodes 1
get_string_JSON512b_Bench.json/main 27386 acir_opcodes 27386 acir_opcodes 1
get_value_JSON16kb_Bench.json/main 20747 acir_opcodes 20747 acir_opcodes 1
get_value_JSON512b_Bench.json/main 4875 acir_opcodes 4875 acir_opcodes 1
key_exists_JSON16kb_Bench.json/main 18077 acir_opcodes 18077 acir_opcodes 1
key_exists_JSON512b_Bench.json/main 2205 acir_opcodes 2205 acir_opcodes 1
parse_json_from_string_JSON16kb_Bench.json/main 1100710 acir_opcodes 1098668 acir_opcodes 1.00
parse_json_from_string_JSON512b_Bench.json/main 38237 acir_opcodes 38179 acir_opcodes 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Circuit Size

Benchmark suite Current: 4fda91d Previous: 38f3f26 Ratio
get_array_JSON16kb_Bench.json/main 54968 circuit_size 54968 circuit_size 1
get_array_JSON512b_Bench.json/main 5848 circuit_size 5848 circuit_size 1
get_keys_at_root_JSON16kb_Bench.json/main 3310898 circuit_size 3310898 circuit_size 1
get_keys_at_root_JSON512b_Bench.json/main 3285104 circuit_size 3285104 circuit_size 1
get_literal_JSON16kb_Bench.json/main 32182 circuit_size 32182 circuit_size 1
get_literal_JSON512b_Bench.json/main 6388 circuit_size 6388 circuit_size 1
get_number_JSON16kb_Bench.json/main 32611 circuit_size 32611 circuit_size 1
get_number_JSON512b_Bench.json/main 6882 circuit_size 6882 circuit_size 1
get_object_JSON16kb_Bench.json/main 54968 circuit_size 54968 circuit_size 1
get_object_JSON512b_Bench.json/main 5848 circuit_size 5848 circuit_size 1
get_string_JSON16kb_Bench.json/main 75573 circuit_size 75573 circuit_size 1
get_string_JSON512b_Bench.json/main 50741 circuit_size 50741 circuit_size 1
get_value_JSON16kb_Bench.json/main 36167 circuit_size 36167 circuit_size 1
get_value_JSON512b_Bench.json/main 10373 circuit_size 10373 circuit_size 1
key_exists_JSON16kb_Bench.json/main 31277 circuit_size 31277 circuit_size 1
key_exists_JSON512b_Bench.json/main 9452 circuit_size 9452 circuit_size 1
parse_json_from_string_JSON16kb_Bench.json/main 1475290 circuit_size 1473490 circuit_size 1.00
parse_json_from_string_JSON512b_Bench.json/main 68579 circuit_size 68763 circuit_size 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Brillig Bytecode Size

Benchmark suite Current: 4fda91d Previous: 38f3f26 Ratio
get_array_JSON16kb_Bench 18499 opcodes 18499 opcodes 1
get_array_JSON512b_Bench 2627 opcodes 2627 opcodes 1
get_keys_at_root_JSON16kb_Bench 43577 opcodes 43577 opcodes 1
get_keys_at_root_JSON512b_Bench 27704 opcodes 27704 opcodes 1
get_literal_JSON16kb_Bench 22291 opcodes 22291 opcodes 1
get_literal_JSON512b_Bench 6418 opcodes 6418 opcodes 1
get_number_JSON16kb_Bench 22601 opcodes 22601 opcodes 1
get_number_JSON512b_Bench 6728 opcodes 6728 opcodes 1
get_object_JSON16kb_Bench 18499 opcodes 18499 opcodes 1
get_object_JSON512b_Bench 2627 opcodes 2627 opcodes 1
get_string_JSON16kb_Bench 24349 opcodes 24349 opcodes 1
get_string_JSON512b_Bench 8476 opcodes 8476 opcodes 1
get_value_JSON16kb_Bench 23399 opcodes 23399 opcodes 1
get_value_JSON512b_Bench 7526 opcodes 7526 opcodes 1
key_exists_JSON16kb_Bench 18131 opcodes 18131 opcodes 1
key_exists_JSON512b_Bench 2259 opcodes 2259 opcodes 1
parse_json_from_string_JSON16kb_Bench 16563 opcodes 16817 opcodes 0.98
parse_json_from_string_JSON512b_Bench 16552 opcodes 16806 opcodes 0.98

This comment was automatically generated by workflow using github-action-benchmark.

@TomAFrench
Copy link
Member

Ok, can you remove this from the enum in that case?

Can you please address this comment?

@jialinli98 jialinli98 force-pushed the jl/token_validation_in_bool branch from 48ff34a to 1c02a14 Compare August 26, 2025 04:40
@jialinli98 jialinli98 requested a review from TomAFrench August 26, 2025 05:46
@TomAFrench TomAFrench merged commit fdeb176 into main Sep 1, 2025
18 checks passed
@github-project-automation github-project-automation bot moved this from 👀 To Triage to ✅ Done in Noir Libraries Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

use boolean for Validation flags
2 participants