Repository navigation
docs: state what pygame.quit() and the caches do to draw calls - #69
Merged
dmccoystephenson merged 1 commit intoNov 7, 2026
Merged
Conversation
Document and pin three behaviors the docs left out: a Graphik bound to the display or a subsurface must be rebound after pygame.quit() (on pygame 2.1.2 drawRectangle segfaults otherwise), a whole-number float font size is accepted once its font is cached, and drawImage needs a display mode only for the first load of a path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric, scored against the diff at e1059e1 and CI run 42361748515. This is an inline review by the authoring session, not an independent one. A Copilot review could not be requested (
Do-not-auto-merge paths: none matched. Findings accepted without change:
The PR description's CI checkbox was written before CI finished and is left unticked. CI's result is recorded here. Verdict: ready to merge. This review comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
dmccoystephenson
deleted the
docs/pin-restart-and-cache-history-behavior
branch
November 7, 2026 09:56
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.
Summary
Lifecycle probes of each public method found three behaviors the docs either omitted or misstated. No executable code changes:
graphik.pychanges only in docstrings.pygame.quit()destroys the display surface and its subsurfaces, and aGraphikbound to either stays bound to it. On pygame 2.1.2,drawRectangleanddrawButtonthen segfault the process with no traceback, and on a subsurfacedrawTextdoes too. The class docstring and README now state the hazard and the recovery (assign a live surface togameDisplay, or build a newGraphik), and that an ordinary off-screen surface keeps working.TypeError, but16.0is served from the cache once16has been drawn. The exception is now documented and pinned. It is not changed, because making it raise could break a caller that works today. The direction is left to a maintainer in drawText: a whole-number float size raises or succeeds depending on what the font cache already holds #68.drawImagedisplay mode (misstated): the docs said it raises unless a display mode is set. Only the first load of a path needs one, because the conversion happens alongside the load. Docs are corrected and the behavior is pinned.test_drawing_to_a_destroyed_surface_fails_after_a_pygame_restart(two cases), in a subprocess so that a segfault cannot end the test runtest_rebinding_game_display_restores_every_draw_method_after_a_restarttest_off_screen_surface_keeps_drawing_across_a_pygame_restarttest_draw_text_accepts_a_whole_float_size_only_once_its_font_is_cachedtest_draw_image_needs_a_display_mode_only_for_the_first_load_of_a_pathNo public member is changed, so the consumer-impact gate does not apply.
No tracking issue was filed for the destroyed-surface and
drawImagegaps, which were found during triage. Refs #68, which stays open for the maintainer decision.Test plan
python3 -m py_compile src/main/python/preponderous/graphik/graphik.pypython3 -m pytest: 148 passed. The conftest forces the dummy SDL drivers, so this is headless.graphik.py(float-aware font key,convert_alphaon every call, reload when no display is set): each was caught by the new tests, and the source was restored.Local validation used pygame 2.1.2 on Python 3.8, which is below the supported floor. Installing a newer pygame was not available in this dispatch, so CI is the only check against current pygame versions. The segfault is documented as a 2.1.2 observation for that reason, and the destroyed-surface test asserts only a nonzero exit.
Backlog
Each open issue not picked was skipped for a stated reason:
.github/workflows/edits, which are on the do-not-auto-merge list. Opening them as held PRs would block later dispatches.This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson