Skip to content

Add fuzzer for operator module#44

Open
AdamKorcz wants to merge 1 commit intopython:mainfrom
AdamKorcz:add-operator-fuzzer
Open

Add fuzzer for operator module#44
AdamKorcz wants to merge 1 commit intopython:mainfrom
AdamKorcz:add-operator-fuzzer

Conversation

@AdamKorcz
Copy link
Copy Markdown
Contributor

@AdamKorcz AdamKorcz commented Apr 10, 2026

Fuzzes the CPython _operator C module (Modules/_operator.c). Dispatches per input across seven targets: comparisons (lt/le/gt/ge/eq/ne) over random-typed value pairs to reach rich-comparison type-mismatch paths; arithmetic (add/sub/mul/mod/floordiv/truediv/pow plus bit shifts and bitwise and/or/xor) over fuzzed 4-byte integers, with pow exponents and shift counts clamped to keep the operation bounded; unary ops (neg/pos/abs/invert/index) over random-typed values; sequence ops (contains, countOf, indexOf, getitem, concat, setitem, delitem, length_hint) over fuzzed int lists; and the itemgetter / attrgetter / methodcaller helpers driven with multi-key / multi-attr forms to exercise both the single- and variadic-key code paths.

@AdamKorcz AdamKorcz requested a review from a team as a code owner April 10, 2026 19:56
@AdamKorcz AdamKorcz marked this pull request as draft April 10, 2026 21:26
@AdamKorcz AdamKorcz marked this pull request as draft April 10, 2026 21:26
@AdamKorcz AdamKorcz marked this pull request as draft April 10, 2026 21:26
@AdamKorcz AdamKorcz force-pushed the add-operator-fuzzer branch from ecf0a57 to 67ea34f Compare April 11, 2026 21:00
@AdamKorcz AdamKorcz force-pushed the add-operator-fuzzer branch from 67ea34f to 2a1a255 Compare April 22, 2026 20:32
@AdamKorcz AdamKorcz marked this pull request as ready for review April 22, 2026 20:41
Fuzzes the CPython _operator C module (Modules/_operator.c). Dispatches
per input across seven targets: comparisons (lt/le/gt/ge/eq/ne) over
random-typed value pairs to reach rich-comparison type-mismatch paths;
arithmetic (add/sub/mul/mod/floordiv/truediv/pow plus bit shifts and
bitwise and/or/xor) over fuzzed 4-byte integers, with pow exponents
and shift counts clamped to keep the operation bounded; unary ops
(neg/pos/abs/invert/index) over random-typed values; sequence ops
(contains, countOf, indexOf, getitem, concat, setitem, delitem,
length_hint) over fuzzed int lists; and the itemgetter / attrgetter /
methodcaller helpers driven with multi-key / multi-attr forms to
exercise both the single- and variadic-key code paths.
@AdamKorcz AdamKorcz force-pushed the add-operator-fuzzer branch from 2a1a255 to b3536b3 Compare April 22, 2026 21:02
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