Repository navigation
refactor(circuit_common): bound seq_of_component_size by MAX_SEQUENCE_LOG_SIZE - #672
ilyalesokhin-starkware wants to merge 1 commit into
Conversation
PR SummaryMedium Risk Overview The loop still skips missing Reviewed by Cursor Bugbot for commit 7233106. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1c0fd5a. Configure here.
| }; | ||
|
|
||
| let bit = component_data.get_n_instances_bit(context, log_size); | ||
| let bit = component_data.get_n_instances_bit(context, log_size.try_into().unwrap()); |
There was a problem hiding this comment.
Out-of-bounds instance bit index
High Severity
The loop now runs through MAX_SEQUENCE_LOG_SIZE, but when a matching seq_k column exists in preprocessed_columns for k at or above max_component_size_bits(), get_n_instances_bit indexes past the end of n_instances_bits (length log_trace_size + 1) and panics. The previous loop stopped at max_component_size_bits() and never hit those indices.
Reviewed by Cursor Bugbot for commit 1c0fd5a. Configure here.
…_LOG_SIZE This keeps the seq columns consistent with MAX_SEQUENCE_LOG_SIZE, which the memory_id_to_big component relies on: it reserves ID_TO_BIG_MAX_ROWS == 2^MAX_SEQUENCE_LOG_SIZE ids per instance and places consecutive instances at id offsets that assume no instance exceeds that size. If MAX_SEQUENCE_LOG_SIZE is inconsistent with the preprocessed columns, the id_to_big components can overlap. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1c0fd5a to
9788d22
Compare


refactor(circuit_common): bound seq_of_component_size by MAX_SEQUENCE_LOG_SIZE
This keeps the seq columns consistent with MAX_SEQUENCE_LOG_SIZE, which the
memory_id_to_big component relies on: it reserves ID_TO_BIG_MAX_ROWS ==
2^MAX_SEQUENCE_LOG_SIZE ids per instance and places consecutive instances at id
offsets that assume no instance exceeds that size. If MAX_SEQUENCE_LOG_SIZE is
inconsistent with the preprocessed columns, the id_to_big components can overlap.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com