[Major Feature] Coverage-guided fuzz harness for Python API (libFuzzer + ASan) #283
Labels
No labels
Alpha Release Requirement
Bugfix
Demo Target
Documentation
Major Feature
Minor Feature
priority:tier1-active
priority:tier2-foundation
priority:tier3-future
priority:tier4-deferred
Refactoring & Cleanup
system:animation
system:documentation
system:grid
system:input
system:performance
system:procgen
system:python-binding
system:rendering
system:ui-hierarchy
Tiny Feature
workflow:blocked
workflow:needs-benchmark
workflow:needs-documentation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
john/McRogueFace#283
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The 7DRL 2026 post-mortem found 22 memory safety bugs, most of which require specific input sequences to trigger (entity cross-grid transfer, holding references across mutations, etc.). The existing test suite exercises normal operation paths and misses these edge cases entirely — ASan found 0 bugs when run against the full test suite, but immediately found the gridstate overflow when given a targeted trigger.
Coverage-guided fuzzing would systematically explore these edge cases.
Proposal
Create
tests/fuzz/with Atheris-based fuzz targets:Each target creates mcrfpy objects and performs random operations, letting ASan catch any memory corruption.
Prerequisites
make asan)Related
Closing. Resolution: shipped as a native clang+libFuzzer+ASan harness instead of Atheris. Python-level coverage would have added nothing — every bug from #258-#278 lives below the Python/C++ boundary and is reached through normal
mcrfpy.*calls. libFuzzer already instruments the C++ engine code and drives input through a byte-consumer that the Python fuzz scripts read from; noatherisdependency was needed.What shipped
make fuzz-build/make fuzz/make fuzz-long/make fuzz-repro(tranche W1)build-fuzz/mcrfpy_fuzzsingle binary, target chosen byMCRF_FUZZ_TARGETenv var (W2/W3)tests/fuzz/:fuzz_grid_entity— EntityCollection lifecycle (W4 → closed #258-#263, #273, #274)fuzz_property_types— type confusion on Frame/Caption/Sprite/Entity/Grid/TileLayer/ColorLayer (W5 → closed #267, #268, #272)fuzz_anim_timer_scene— animation/timer/scene lifecycle (W6)fuzz_fov—compute_fov/is_in_fovwith enum fuzzing (W8 → surfaced #310)fuzz_maps_procgen— HeightMap/DiscreteMap/NoiseSource/BSP (W7)fuzz_pathfinding_behavior— DijkstraMap,grid.step, entity behavior (W9 → surfaced #311)tests/fuzz/README.mdwith triage workflowGaps intentionally left open (flagged for follow-up issues, not this one)
from_bytes,composite,hsl_shift)These represent new attack surface rather than gaps in the original proposal.
[Major Feature] Atheris coverage-guided fuzzing harness for Python APIto [Major Feature] Coverage-guided fuzz harness for Python API (libFuzzer + ASan)