Accept moved vectors in table data loaders - #131
sylvesterkaczmarek wants to merge 1 commit into
Conversation
|
I'm closing this PR because I'm not accepting drive-by submissions to CML by bot accounts, regardless of the correctness or size of the changes. Changes to CML by people who use and derive value from CML, whether internal to NASA or from industry/academia, are the only submissions that will be reviewed. This is a library of simulation models used in the formal verification of human-rated flight systems. It's not a sandbox for you to boost GitHub contribution metrics. When this is properly implemented in the future, the documentation needs to be appropriately updated and an appropriate number of well-designed tests need to be added. Documenting one public function in the model overview README is not the appropriate documentation change. 12 new tests for a single new interface function, many of which duplicate the existing test functionality in Our contributing policy mandates that PRs and comments are submitted by humans. Your account has a history of low-quality, inauthentic, automated activity in many NASA repositories. Do not violate this policy again. |
Fixes #129.
Changes
Add
DoubleVec&&overloads toTableIndependentVariable::load_dataandGenericMultiInputTable::load_data, the vector-loading methods in the current implementation. Callers can transfer large data vectors withstd::moveinstead of copying their elements.Both overloads validate before moving. Independent-variable monotonicity checks and dependent-table dimension checks are shared with the existing copy paths. Rejected vector arguments retain their contents and storage. Existing lvalue and pointer overloads remain available, and the single-input table subclasses inherit the new dependent-data overload. Existing reload rules are unchanged.
Document the usage and moved-from state, and register twelve new tests in the utilities test target.
Validation
All 20 focused table tests passed on Linux arm64 with GCC 12.2 and on hosted Ubuntu 24.04 x86_64 with GCC 13.3, against commit
338bd013652e8eee7689321641cd177ac56d36fd.The test executable compiles the actual independent-variable, multi-input and single-input table sources, the existing CML message mock, all eight existing independent-variable tests, and twelve new tests. It uses C++17, the repository's GCC warning set with warnings treated as errors, AddressSanitizer and UndefinedBehaviorSanitizer.
The new checks cover storage-address transfer, increasing/decreasing and single-point inputs, rejected-input preservation, reloading, retained pointer/lvalue copy semantics, interpolation with multiple dimensions, and the inherited single-input API. Restoring only the four original production headers/sources makes six storage-transfer tests fail; restoring the fix passes all 20 again.
The instrumented local run covered 24/24 changed executable lines in the two modified source files. Build logs, before/after test logs and coverage reports are retained in the hosted run.
git diff --checkpasses.Scope
Validation used a focused model test executable with real JEOD headers and GoogleTest 1.17.0. The complete CML/Trick simulation and verification suites were not run; the changed-line coverage result is not a claim of coverage across the complete interpolation model. The hosted validation workflow is on a separate fork branch and is not included in this PR.