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
From PR #2435 description:
The internal structure of slices in SSA was changed in #2347. Slices and arrays are polymorphic over each other, thus slices can be passed to functions that accept arrays with a generic size (ex. fn foo(input: [Field; N]). The slice structure is handled in SSA, but in ACIR gen we setup the inputs to for the black box calls manually. As the slice length always precedes the slice contents, without changes to call_black_box in acir gen, the slice length was being passed to the bb funcs rather than the contents of the slice.
Happy Case
PR #2435 introduced a quick solution to get this fixed, but we should introduce a clean abstraction for differentiating between arrays and slices. Slice inputs to black box function should be handled in a generalizable way that reduces the surface area for bugs.
Alternatives Considered
Keep the manual check for every potential slice input. This can lead to potential bugs if the implementer of a new black box func that accepts arrays generic over their size forgets to handle slices.
Additional Context
N/A
Would you like to submit a PR for this Issue?
No
Support Needs
No response
The text was updated successfully, but these errors were encountered:
Problem
From PR #2435 description:
The internal structure of slices in SSA was changed in #2347. Slices and arrays are polymorphic over each other, thus slices can be passed to functions that accept arrays with a generic size (ex. fn foo(input: [Field; N]). The slice structure is handled in SSA, but in ACIR gen we setup the inputs to for the black box calls manually. As the slice length always precedes the slice contents, without changes to call_black_box in acir gen, the slice length was being passed to the bb funcs rather than the contents of the slice.
Happy Case
PR #2435 introduced a quick solution to get this fixed, but we should introduce a clean abstraction for differentiating between arrays and slices. Slice inputs to black box function should be handled in a generalizable way that reduces the surface area for bugs.
Alternatives Considered
Keep the manual check for every potential slice input. This can lead to potential bugs if the implementer of a new black box func that accepts arrays generic over their size forgets to handle slices.
Additional Context
N/A
Would you like to submit a PR for this Issue?
No
Support Needs
No response
The text was updated successfully, but these errors were encountered: