Mf type erased binding - #897
Draft
crimson11 wants to merge 11 commits into
Draft
Conversation
Currently we determine shm-sizes of the CTRL and DATA shm-objects by a simulation run. I.e. we initialize the content of both section 1st within a heap-allocated resource. At the end we use the sizes to correctly size the shm-objects. This "SIMULATION" method is exact but has high runtime costs and might consume lots of memory during startup. This change now redesigns the containers/dynamic data types being used within the DATA section, to use only classes, which we are in control of and where we exactly know based on our configuration, who much size they will need. Thus the whole simulation canbe skipped and we calculate the size correctly from the configuration settins for the service instance. We re-introduce therefore the ESTIMATION mode in parallel to the SIMULATION mode.
Added analytical estimate/ANALYSIS mode for the shm-size calculation for the CONTROL section.
Adapted signature of LinearSearchMap to support custom KeqEqual just like std::unordered_map.
In the skeleton component tests we were testing the lola::Skeleton with a event and field service element. But we only provided the config/ deployment info for these elements, but did never register them at their parent Skeleton. Thus, essential tests checking the shm-size calculation were off! The tests now correctly register the elements.
Fixed review comments for ne ANALYSIS based size calculations. Added unit test for parsing of new ANALYSIS mode.
Moved the shm-size calc for ServiceDataStorage and ServiceDataControl out of SkeletonMemoryManager to the correspoinding data structures itself.
Added death-test for LinearSearchMap for capacity overflow. SkeletonMemoryManager now uses GetServiceElementInstanceDeployment helper.
Added tests for ServiceDataControl for size calculation.
Added tests for ServiceDataStorage for size calculation.
Added additional skeleton component tests to verify, that the size resulting from analysis is not extensively overshooting the (real) size determined by simulation. Some overshoot is acceptable as we have to take into account worst case padding taking place in an allocation. To support better testing, the methods to calculate size for ServiceDataControl and ServiceDataStorage by analysis now return a pair of sizes: Minimal size (no additional padding needed) and worst case size (each allocation needs max. padding). Unit tests take now take benefit of these changes, to verify, that the size delta for a shm-object between simulation and analysis is NOT greater than the diff between min/worst-case size of the analysis.
crimson11
requested review from
LittleHuba,
bemerybmw,
castler,
hoe-jo and
limdor
as code owners
August 11, 2026 11:40
crimson11
marked this pull request as draft
August 11, 2026 11:41
| const SkeletonEventProperties& element_properties) | ||
| EventDataStorage<memory::shared::PolymorphicOffsetPtrAllocator<std::max_align_t>>* | ||
| SkeletonMemoryManager::RetrieveGenericEventDataFromOpenedSharedMemory(const ElementFqId element_fq_id, | ||
| const SkeletonEventProperties& element_properties) |
| { | ||
| return ShmSizeCalculationMode::kSimulation; | ||
| } | ||
| else if (shm_size_calc_mode_value == kShmSizeCalcModeAnalysis) |
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.
No description provided.