Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor lt config to gadget and blt #280

Merged
merged 6 commits into from
Sep 26, 2024
Merged

Conversation

hero78119
Copy link
Collaborator

No description provided.

@hero78119 hero78119 changed the title refactor lt config to gadget and blt [WIP] refactor lt config to gadget and blt Sep 25, 2024
@hero78119 hero78119 force-pushed the feat/refactor_lt_config branch from e2052d9 to 1f7a3f7 Compare September 25, 2024 10:49
@hero78119 hero78119 changed the title [WIP] refactor lt config to gadget and blt refactor lt config to gadget and blt Sep 25, 2024
@hero78119 hero78119 requested a review from chaosma September 25, 2024 10:53
Base automatically changed from feat/debug to master September 25, 2024 10:58
@hero78119 hero78119 force-pushed the feat/refactor_lt_config branch from 488a0f9 to d0c8203 Compare September 25, 2024 11:01
let read_rs1 = UInt::new_unchecked(|| "rs1_limbs", circuit_builder)?;
let read_rs2 = UInt::new_unchecked(|| "rs2_limbs", circuit_builder)?;
let is_lt =
circuit_builder.less_than(|| "rs1<rs2", read_rs1.value(), read_rs2.value(), None)?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Great!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this part actually need to be signed comparison 😃
so I just updated to implemented uint signed lt algebraric version (which should somehow be cheaper than previous u8 limb lookup)

Copy link
Collaborator

@naure naure Sep 25, 2024

Choose a reason for hiding this comment

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

I meant to bring this up later, but since you started here, I wrote up the generalization of this technique: #285

Copy link
Collaborator

Choose a reason for hiding this comment

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

Wait, I’m also working on the signed version (I’m doing all the branches). I planned on using this gadget for the unsigned branches (essentially renaming this BLT to BLTU). Can you put it back (have both unsigned and signed)?

Or let’s merge this PR then I’ll glue it all together afterwards.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay! The singed version I implemented was end up with degree = 3 in my side, which is unfavorable, so I just switch back to unsigned version, and will be good to glue/revamping together with your signed version

Copy link
Collaborator

Choose a reason for hiding this comment

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

Will do.

Copy link
Collaborator

@naure naure left a comment

Choose a reason for hiding this comment

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

The soundness issue existed before but let’s fix it now.

@hero78119 hero78119 force-pushed the feat/refactor_lt_config branch from 223041f to 0249d36 Compare September 26, 2024 02:26
@hero78119 hero78119 force-pushed the feat/refactor_lt_config branch from 0249d36 to bbf1393 Compare September 26, 2024 03:17
@hero78119 hero78119 force-pushed the feat/refactor_lt_config branch from bbf1393 to f85777a Compare September 26, 2024 03:23
@KimiWu123
Copy link
Contributor

KimiWu123 commented Sep 26, 2024

haha, I did simliar thing in #278, again.

@hero78119 hero78119 enabled auto-merge (squash) September 26, 2024 03:43
@hero78119 hero78119 merged commit 5f4713d into master Sep 26, 2024
6 checks passed
@hero78119 hero78119 deleted the feat/refactor_lt_config branch September 26, 2024 03:45
hero78119 added a commit that referenced this pull request Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants