You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checked arithmetic has extra cost, both in constrained and unconstrained. We could both offer the user unchecked arithmetic blocks similarly to solidity, and have compiler issued operations like loop counter arithmetic be unchecked.
Happy Case
SSA operations can be checked or unchecked so we can issue unchecked operations where we know no overflow is possible (loops, for example)
Users can write unchecked {} blocks to denote which arithmetic operations don't need overflow checks. These will issue unchecked SSA ops.
Unchecked operations in Brillig can use native arithmetic saving on bytecode size and execution cost. Unchecked operations in ACIR can be cheaper by chaining operations without truncating until we need to truncate to avoid overflowing the field.
Workaround
None
Workaround Description
No response
Additional Context
No response
Project Impact
None
Blocker Context
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered:
Problem
Checked arithmetic has extra cost, both in constrained and unconstrained. We could both offer the user unchecked arithmetic blocks similarly to solidity, and have compiler issued operations like loop counter arithmetic be unchecked.
Happy Case
unchecked {}
blocks to denote which arithmetic operations don't need overflow checks. These will issue unchecked SSA ops.Unchecked operations in Brillig can use native arithmetic saving on bytecode size and execution cost. Unchecked operations in ACIR can be cheaper by chaining operations without truncating until we need to truncate to avoid overflowing the field.
Workaround
None
Workaround Description
No response
Additional Context
No response
Project Impact
None
Blocker Context
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered: