Skip to content

Fix Z3 translation of ArraySlice and add fuzzing infrastructure.#4136

Merged
copybara-service[bot] merged 1 commit intomainfrom
test_902939100
Apr 21, 2026
Merged

Fix Z3 translation of ArraySlice and add fuzzing infrastructure.#4136
copybara-service[bot] merged 1 commit intomainfrom
test_902939100

Conversation

@copybara-service
Copy link
Copy Markdown

Fix Z3 translation of ArraySlice and add fuzzing infrastructure.

The Z3 translation for ArraySlice is updated to correctly handle index addition by zero-extending the start index to prevent overflow. New tests are added to verify the equivalence of ArraySlice and ArrayIndex operations against alternative IR structures using both exhaustive simulation and Z3 proving. A fuzzing framework is introduced, which generates random IR, exhaustively interprets it to find all possible return values, and then builds a Z3 query to check if the fuzzed function's return value is always within this set of possible values.

The fuzzer should hopefully (very slowly) prove that we do not have any similar translation bugs.

@copybara-service copybara-service Bot force-pushed the test_902939100 branch 2 times, most recently from 690eb16 to 1e6ff8e Compare April 21, 2026 16:47
The Z3 translation for ArraySlice is updated to correctly handle index addition by zero-extending the start index to prevent overflow. New tests are added to verify the equivalence of ArraySlice and ArrayIndex operations against alternative IR structures using both exhaustive simulation and Z3 proving. A fuzzing framework is introduced, which generates random IR, exhaustively interprets it to find all possible return values, and then builds a Z3 query to check if the fuzzed function's return value is always within this set of possible values.

The fuzzer should hopefully (very slowly) prove that we do not have any similar translation bugs.

PiperOrigin-RevId: 903299223
@copybara-service copybara-service Bot merged commit 1a0b379 into main Apr 21, 2026
1 check passed
@copybara-service copybara-service Bot deleted the test_902939100 branch April 21, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant