Repository navigation
Conversation
python/cinbase/config.py rebinds the CinBaseConfig class name to one shared module-level instance. Each cinbase backend reset that singleton with CinBaseConfig.__init__() and then copy.deepcopy()'d it, so constructing a service snapped the config the configtool reads back to the constructor defaults, and two backends starting concurrently could race between the reset and the copy, picking up each other's state. Export the class before the rebinding as CinBaseConfigClass and let every cinbase IME build a private instance instead. Behaviour is unchanged otherwise: each IME still sets imeDirName and cinFileList and calls load() on its own config right after, and the previous deepcopy came from a just-reset object, so a fresh instance carries the same defaults. Architecture and design by asdf80730. Implementation generated with AI assistance from omp (Qwen3.8-Flash-Next).
asdf80730
added a commit
to asdf80730/PIME
that referenced
this pull request
Oct 27, 2026
Regression coverage for the upstream fix: constructing a cinbase backend must leave the shared CinBaseConfig singleton untouched, and configs of separate service instances must not share state. The test skips itself until the exported CinBaseConfigClass lands in python/, so it activates once the upstream merge reaches this branch. Fully generated by omp (Qwen3.8-Flash-Next) without human intervention.
This branch has not been deployed
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.
Resetting the shared module-level config in every backend constructor clobbers state that is visible to users.
python/cinbase/config.pyrebinds the nameCinBaseConfigto a single shared instance, and each cinbase input method built its settings by callingCinBaseConfig.__init__()and thencopy.deepcopy()-ing that object — so constructing a service snapped the very singletonconfigtoolreads back to the constructor defaults, and two input methods starting at the same time could race between the reset and the copy, picking up each other's values.config.pyasCinBaseConfigClassbefore the name is rebound to the shared instance.CinBaseConfigClass()in all eight cinbase IMEs: no shared-object reset, no deepcopy.import copy.Each IME still sets
imeDirNameandcinFileListand callsload()on its own config; the removed deepcopy came from a just-reset object, so a fresh instance starts from the same defaults and behaviour is unchanged.Validation:
python -m compileall pythonclean on the bundled 32-bit interpreter.CinBaseConfiguntouched fails on master (AssertionError: 3 != 9) and passes on this branch.Architecture and design by asdf80730. Implementation generated with AI assistance from omp (Qwen3.8-Flash-Next).