Repository navigation
feat: move remaining non-template definitions to -inl.h files - #6189
Merged
henryiii merged 1 commit intoOct 9, 2026
Merged
Conversation
Weak-symbol counts on PyTorch's torch_python showed these were still compiled in most TUs in precompiled mode: gil_scoped_acquire/release, type_record, clean_type_id, the cpp_conduit helpers, type_caster_generic's module-local loaders, error_already_set's constructor, module_'s non-template members, and get/set_shared_data. Most were already PYBIND11_NOINLINE. The new -inl.h files are compiled from existing src/ files, so the library does not gain TUs. Assisted-by: ClaudeCode:claude-opus-5-5
This was referenced Oct 5, 2026
rwgk
approved these changes
Oct 9, 2026
rwgk
left a comment
Collaborator
There was a problem hiding this comment.
codex GPT-6.1-Sol ultra:
No actionable findings, reviewed at 5a3d18c.
I reviewed all 22 changed files, including GIL ownership, exception construction, module-local and conduit conversions, configuration guards, source wiring, and packaging.
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.
I believe this was another 5% or so for pytorch.
🤖 AI text below 🤖
Description
Follow-up to the precompiled-mode series (#6135–#6138). Weak-symbol counts on PyTorch's
torch_pythonshowed that some non-template code was still compiled in most TUs in precompiled mode. This moves it to-inl.hfiles:gil_scoped_acquire/gil_scoped_release(newgil-inl.h)type_record's constructor andadd_base(newattr-inl.h)clean_type_id(newdetail/typeid-inl.h)cpp_conduithelpers (newdetail/cpp_conduit-inl.h)type_caster_generic's module-local loaders, theerror_already_setconstructor, the non-templatemodule_members, andget_shared_data/set_shared_dataMost of these were already
PYBIND11_NOINLINE. The new-inl.hfiles are compiled from the existingsrc/files, so the library does not get more TUs.tools/check_inl_headers.pynow allowsPYBIND11_HAS_CXXABI_HandGRAALPY_VERSION_NUM. The library and the modules always see the same values for these macros.Suggested changelog entry:
type_record,cpp_conduithelpers,module_members, and others) out of line in the opt-in precompiled mode.