Skip to content

Fix inherited Reporter methods on Runner subclasses - #501

Merged
james-d-mitchell merged 1 commit into
mainfrom
codex/fix-447-reporter-casts
Sep 10, 2026
Merged

james-d-mitchell merged 1 commit into
mainfrom
codex/fix-447-reporter-casts

Conversation

@james-d-mitchell

Copy link
Copy Markdown
Member

Inherited reporting methods on Runner subclasses can access the wrong memory, causing the crashes and incorrect reporting state described in #447. Runner is polymorphic and its non-polymorphic Reporter base can have a nonzero offset. Registering Runner with py::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:

  • Rebuilt the C++ extension and verified the tests imported it.
  • 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.
  • Both pre-commit and pre-push hook stages passed for the changed files.
  • make doc completed without warnings, and make doctest passed 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.

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>
@james-d-mitchell
james-d-mitchell merged commit 26df767 into main Sep 10, 2026
24 checks passed
@james-d-mitchell
james-d-mitchell deleted the codex/fix-447-reporter-casts branch September 12, 2026 12:12
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.

MemoryError when calling report_prefix, reset_last_report and reset_start_time

2 participants