When a polygon self-intersects within a grid cell, it may cause the coverage fraction of that grid cell to be incorrect. Returning incorrect results is undesirable, but so is pre-checking all inputs for validity. A reasonable alternative might be to sum all of the covered cell areas and compare that to the area of the input polygon, raising an error if these differ beyond some tolerance.
When a polygon self-intersects within a grid cell, it may cause the coverage fraction of that grid cell to be incorrect. Returning incorrect results is undesirable, but so is pre-checking all inputs for validity. A reasonable alternative might be to sum all of the covered cell areas and compare that to the area of the input polygon, raising an error if these differ beyond some tolerance.