Repository navigation
Fix inherited Reporter methods on Runner subclasses - #501
Merged
Merged
Conversation
Enable pybind11's base-pointer adjustment for Runner, whose non-polymorphic Reporter base can have a nonzero offset. Add tests for inherited reporting prefixes, intervals, and timer resets. Fixes #447. AI assistance: OpenAI Codex investigated the invalid casts, prepared the binding fix and regression tests, and ran validation. Co-authored-by: Codex <codex@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Inherited reporting methods on
Runnersubclasses can access the wrong memory, causing the crashes and incorrect reporting state described in #447.Runneris polymorphic and its non-polymorphicReporterbase can have a nonzero offset. RegisteringRunnerwithpy::multiple_inheritance()makes pybind11 apply the required base-pointer adjustment.Add 20 test cases covering reporting prefixes, intervals, and timer resets on
Reporter,FroidurePin,ToddCoxeter, and both Knuth–Bendix rewriting systems. Existing public signatures and return types are preserved.Fixes #447.
Validation on macOS with Python 3.13, pybind11 3.0.1, and libsemigroups 3.6.1-298-g906ffc2:
pytest tests/test_runner.py tests/test_knuth_bendix.py tests/test_todd_coxeter.py tests/test_froidure_pin.py -q: 79 passed.pytest -m quick -q: 111 passed, 641 deselected.make doccompleted without warnings, andmake doctestpassed 1,509 tests. Optional diagram regeneration was skipped after Inkscape crashed.AI assistance: OpenAI Codex investigated the invalid casts, prepared the binding fix and regression tests, and ran validation.