Skip to content

feat(security): acir vs circuit components comparison tool#21737

Open
defkit wants to merge 17 commits intonextfrom
sn/acir_components_count
Open

feat(security): acir vs circuit components comparison tool#21737
defkit wants to merge 17 commits intonextfrom
sn/acir_components_count

Conversation

@defkit
Copy link
Contributor

@defkit defkit commented Mar 18, 2026

TL;DR

Build a graph on ACIR constraints' witnesses, build a circuit on this constraints, build a graph on the circuit
Check that:

$$ \forall a \in AcirGraphComponents ; \exists c \in CircuitGraphComponents \ \mid \ (a \subseteq c) $$

std::unordered_map<uint32_t, size_t> get_witness_component_map() const;

private:
std::unordered_map<uint32_t, std::unordered_set<uint32_t>> adjacency_lists_;
Copy link
Contributor Author

@defkit defkit Mar 18, 2026

Choose a reason for hiding this comment

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

opus suggested using union-find with dfs to save time and memory for larger circuits.

I'm not sure about this -- it still seems more expensive to construct the circuit

Will migrate to union-find if we decide to use this check in our main workflow

@defkit defkit requested a review from Rumata888 March 18, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant