starkware-libs / stwo

Apache License 2.0
251 stars 86 forks source link

Add next_preprocessed_mask() #882

Closed yoichi-nexus closed 1 week ago

yoichi-nexus commented 2 weeks ago

This commit adds next_preprocessed_mask() to EvalAtRow interface. In most cases it's just a thin wrapper over next_interaction_mask(). However, in InfoEvaluator, next_preprocessed_mask() is the only way to access rows except the current one.

Motivation

I wanted to use the IsFirst column to get both [is_first, is_last] by looking at the current row and the next row. An assertion in InfoEvaluator::next_interaction_mask() failed with an error message: use get_preprocessed_column().

However, get_preprocessed_column() didn't have access to the next row, so this change.

reviewable-StarkWare commented 2 weeks ago

This change is Reviewable