Repository navigation
Fix C++11 wrapper shape detection for const and empty arrays - #1643
Merged
GiovanniBussi merged 1 commit intoNov 18, 2026
Merged
GiovanniBussi merged 1 commit into
GiovanniBussi merged 1 commit into
Conversation
Const custom arrays lost their unqualified trait or attempted to cast away const. Empty std::array objects acquired a nonzero sizeof-derived extent and recursive flattening could turn an empty outer dimension into a nonempty shape. Fixed custom arrays also used overloaded address operators, and container detection/size access rejected valid mutable or lvalue-qualified APIs. Preserve exact trait specializations while inheriting const customizations, use std::array logical storage size and data(), acquire real object addresses, and probe/access named container arguments as lvalues. Preserve empty metadata through recursive shape deduction and reject nested dynamic containers rather than describe their container objects as contiguous scalar data. Keep the C ABI, legacy pointer policy, existing custom layout contract and C++11 compatibility. Production changes are confined to src/wrapper/Plumed.h. Add a standalone metadata-capture regtest, compile-rejection probes and a short case/compatibility document. Clang 17 and GCC 15 pass C++11/14/17 strict/legacy matrices; Clang ASan/UBSan strict/legacy checks pass. The new fixture passes the normal runner in C++11, and existing rt-make-10/11 numerical tests pass against the candidate header and a fresh serial kernel. Baseline probes reproduce all corrected failures. Anonymous namespace, C++98, disabled shape detection and C99 smoke checks pass. Cross-platform CI is pending publication. Signed-off-by: Giovanni Bussi <bussi@sissa.it> Agent: Codex (/root); no other agents collaborated.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1643 +/- ##
========================================
Coverage 88.96% 88.97%
========================================
Files 649 651 +2
Lines 81194 81815 +621
========================================
+ Hits 72238 72795 +557
- Misses 8956 9020 +64 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Const custom arrays lost their unqualified trait or attempted to cast away const. Empty std::array objects acquired a nonzero sizeof-derived extent and recursive flattening could turn an empty outer dimension into a nonempty shape. Fixed custom arrays also used overloaded address operators, and container detection/size access rejected valid mutable or lvalue-qualified APIs.
Preserve exact trait specializations while inheriting const customizations, use std::array logical storage size and data(), acquire real object addresses, and probe/access named container arguments as lvalues. Preserve empty metadata through recursive shape deduction and reject nested dynamic containers rather than describe their container objects as contiguous scalar data. Keep the C ABI, legacy pointer policy, existing custom layout contract and C++11 compatibility. Production changes are confined to src/wrapper/Plumed.h.
Add a standalone metadata-capture regtest, compile-rejection probes and a short case/compatibility document. Clang 17 and GCC 15 pass C++11/14/17 strict/legacy matrices; Clang ASan/UBSan strict/legacy checks pass. The new fixture passes the normal runner in C++11, and existing rt-make-10/11 numerical tests pass against the candidate header and a fresh serial kernel. Baseline probes reproduce all corrected failures. Anonymous namespace, C++98, disabled shape detection and C99 smoke checks pass. Cross-platform CI is pending publication.
Signed-off-by: Giovanni Bussi bussi@sissa.it
Agent: Codex (/root); no other agents collaborated.