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

Feature/optimise step selector builder #154

Conversation

rutefig
Copy link
Contributor

@rutefig rutefig commented Oct 16, 2023

Optimisation of Step Selector for Log2(n) Columns

Description

  • Goal: is to optimise the Step Selector Builder to have Log2(n) Columns per n Step Types instead of one Column per each Step Type.

  • Current Implementation: implemented a new type of Selector and implemented the build function for it

  • Explanation: If we use binary representation for the step types instead of using the actual columns we will get an optimised version for the Selector Builder since we can get the total of columns from the following expression

$$n\_cols = \lceil \log_2(n\_step\_types + 1) \rceil$$

We need take into consideration that we also need to save one binary value for the case when there is no step type, because of this we do the math with (n_step_types + 1).

What is missing

  • Ensure compatibility with the backend
  • Unit tests

@rutefig rutefig marked this pull request as ready for review October 20, 2023 04:25
@leolara
Copy link
Collaborator

leolara commented Oct 21, 2023

4 steps require 3 columns, because 00 is not used. Please add a test with 4 steps that checks that 3 columns are used.

@leolara
Copy link
Collaborator

leolara commented Oct 25, 2023

Rusfmt problems

@rutefig rutefig requested a review from leolara October 26, 2023 06:52
@leolara
Copy link
Collaborator

leolara commented Oct 26, 2023

I think you test the expresions and the assignments, the expressions can be converted to a string with print!(":#?", expr) and then compared to a string @rutefig

@codecov-commenter
Copy link

codecov-commenter commented Oct 30, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (009690b) 46.84% compared to head (8eaea22) 48.02%.
Report is 2 commits behind head on main.

❗ Current head 8eaea22 differs from pull request most recent head de44409. Consider uploading reports for the commit de44409 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #154      +/-   ##
==========================================
+ Coverage   46.84%   48.02%   +1.17%     
==========================================
  Files          21       21              
  Lines        5364     5483     +119     
==========================================
+ Hits         2513     2633     +120     
+ Misses       2851     2850       -1     
Files Coverage Δ
src/plonkish/compiler/step_selector.rs 49.21% <98.31%> (+43.28%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rutefig
Copy link
Contributor Author

rutefig commented Oct 30, 2023

@leolara need approval here, the previous run failed on the Clippy so I committed a fix for that

@leolara leolara added this pull request to the merge queue Oct 30, 2023
Merged via the queue into privacy-scaling-explorations:main with commit 93e0fad Oct 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants