refactor(jit): silence Ionic CCQE probe logs and clean up caching - #347
Merged
Conversation
- Route Ionic CCQE detection messages through the standard logging module (logger.info / logger.debug) so they no longer print unconditionally on every mori import. JIT compilation progress ([mori-jit] Compiling/Cached) is intentionally left as print and stays visible by default. - Replace the hand-rolled module-global + None-sentinel cache for is_ccqe_enabled with @functools.cache, giving us thread-safe single-execution semantics and a cache_clear() hook for tests. - Accept 1/true/on/yes (case-insensitive) for MORI_DISABLE_IONIC_CCQE, matching the conventions already used by ENABLE_PROFILER and MORI_DEBUG_INFO elsewhere in mori python.
There was a problem hiding this comment.
Pull request overview
This PR reduces noisy stdout output during import mori by moving Ionic CCQE probing messages to the Python logging framework, while keeping intentional JIT progress output as print. It also simplifies CCQE enablement caching by switching from a module-global sentinel to functools.cache.
Changes:
- Replace unconditional
printdiagnostics for Ionic CCQE probing withlogger.info/logger.debug. - Refactor
is_ccqe_enabled()caching to use@functools.cacheinstead of a module-globalNonesentinel. - Make
MORI_DISABLE_IONIC_CCQEparsing case-insensitive and accept multiple truthy values (1/true/on/yes).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
QizhouZhang97
approved these changes
Jun 1, 2026
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
printto theloggingmodule. They were printing on everyimport moriand cluttering CI / user output. JIT compilation progress lines ([mori-jit] Compiling ...,[mori-jit] Cached: ...) are intentionally kept asprintand remain visible by default._ccqe_enabledmodule-global +None-sentinel cache inis_ccqe_enabled()with@functools.cache. This gives us thread-safe single-execution semantics for free, removes theglobalstatement, and exposesis_ccqe_enabled.cache_clear()for tests.MORI_DISABLE_IONIC_CCQEparsing case-insensitive and accept1/true/on/yes, matching the conventions used byENABLE_PROFILERandMORI_DEBUG_INFOelsewhere in mori python (andIsEnvVarEnabledon the C++ side).Behavior change
Default behavior for end users:
Ionic _ccqe_enabled: ... lib_support ... nic_support: ...INFOlevel)ionic ver: <N>DEBUGlevel)[mori-jit] Compiling .../Cached: ...To re-enable the Ionic diagnostic line, an application can do:
Test plan
import morino longer emits theIonic _ccqe_enabled: ...lineMORI_PRECOMPILE=1 python -c 'import mori'still shows[mori-jit] Compiling .../Cached: ...linesMORI_DISABLE_IONIC_CCQE=true/=on/=yes/=1all disable CCQE