Repository navigation
Fix coordinate transform, border, matching, intersection, and store bugs & perf in ad_map_access - #264
Open
M-Colley wants to merge 1 commit into
Conversation
Bug fixes: - CoordinateTransform: free PROJ handle in destructor, implement rule-of-five copy/move operations, make instance_counter_ atomic, wrap antimeridian longitude delta in Geo2ENU, and guard pole/near-origin singularities in ECEF2Geo. - Point & Geometry operations: declare explicit template instantiations as extern in ECEFOperation.hpp and ENUOperation.hpp, guard empty edges and zero-length denominators in EdgeOperation.hpp and GeometryOperation.cpp, validate edge_right points in calculateWidthRange, wrap antimeridian longitude deltas in GeoOperation::isOnTheLeft, guard degenerate cross products in createECEFHeading, and add thread-safe ENUCache synchronization. - Access, Config & Serialization: cap deserialized container allocations, fix GeometryStore contact lookup against uninitialized singleton store and cap geometric growth, erase all matching contacts in Factory::deleteContacts, avoid O(N^2) landmark scans in Factory::add, close Serializer on version mismatch, check fclose() return in StorageFile, and validate parsed config GeoPoints and path prefixes in MapConfigFileHandler. - OpenDRIVE conversion: avoid unsigned underflow on empty geometry in AdMapFactory, preserve signal subType parsing, and handle multi-digit speed limit strings in DataTypeConversion. - Lane, Border, Match, Landmark, Restriction & Intersection: rewrite fillSmallerEdge with monotonic anchor-to-anchor interpolation (fixing OOB reads and backward folds), add missing throw in getContactLanes, guard cyclic lateral contacts in projectPositionToLaneInHeadingDirection, fix swapped left/right edges in MapMatchedOperation::getENUBorder and bounds-check reference_point_positions, support LandmarkId(0) in uniqueLandmarkId, conjunctively combine conjunctions and disjunctions in RestrictionOperation::isAccessOk, fix AdMapMatching::getHeadingFactor range and single-lane findRouteLanes probability, and make CoreIntersection graph traversals cycle-safe and BIDIRECTIONAL-aware. Performance optimizations: - Avoid deep copies of Lane, Landmark, Geometry, and point vectors across Store, Factory, LaneOperation, CoreIntersection, Intersection, and AdMapMatching. - Replace O(M^2) getLateralAlignmentEdge and getMiddleEdge scans with O(M + N) two-pointer sweeps, cache route-hint lane IDs in AdMapMatching, and skip redundant corner map-matching in getMapMatchedBoundingBox.
This branch has not been deployed
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
Fixes memory leaks, thread-safety bugs, geometric singularities, serialization bounds, border alignment folds, map-matching/restriction logic errors, and algorithmic bottlenecks across
ad_map_accesscore modules.Bug Fixes
PJ *handle in~CoordinateTransform(), implement rule-of-five copy/move semantics, makeinstance_counter_atomic, wrap antimeridian longitude deltas inGeo2ENUandGeoOperation::isOnTheLeft, and guard polar / near-origin singularities inECEF2Geo.externto explicit template instantiation declarations inECEFOperation.hppandENUOperation.hpp.createECEFHeading, right-edge point validation incalculateWidthRange, and synchronizeENUCacheaccess.ISerializer.hpp,StoreSerialization.cpp), closeSerializeron version mismatch, checkfclose()inStorageFile, fixGeometryStoreuninitialized singleton lookup and geometric buffer growth overflow, erase all matching contacts inFactory::deleteContacts, and validate configGeoPointbounds and path prefixes inMapConfigFileHandler.AdMapFactory, preserve signalsubType, and parse multi-digit speed limits inDataTypeConversion.BorderOperation::fillSmallerEdgewith monotonic anchor-to-anchor interpolation (preventing OOB reads and backward edge folds).throwingetContactLanes, guard cyclic lateral contacts inprojectPositionToLaneInHeadingDirection, fix swapped left/right edges inMapMatchedOperation::getENUBorderand bounds-checkreference_point_positions, supportLandmarkId(0)inuniqueLandmarkId, conjunctively combineconjunctionsanddisjunctionsinRestrictionOperation::isAccessOk, fixAdMapMatching::getHeadingFactorrange and single-lanefindRouteLanesprobability, and makeCoreIntersectiontraversals cycle-safe andBIDIRECTIONAL-aware.Performance Improvements
Lane,Landmark,Geometry, and point edges acrossStore,Factory,LaneOperation,CoreIntersection,Intersection, andAdMapMatching, and avoidFactory::add.getLateralAlignmentEdgeandgetMiddleEdgewithAdMapMatching, and avoid redundant corner map-matching ingetMapMatchedBoundingBox.Tests
FactoryTests.cpp,LandmarkOperationTests.cpp,LaneOperationTests.cpp,AdMapBoundingBoxMapMatchingTest.cpp,AdMapMatchingTests.cpp,CoordinateTransformTests.cpp,GeoOperationTests.cpp, andPointOperationTests.cpp.This change is