Repository navigation
Conversation
- Share immutable layer geometry without copying, render polygonal collection members, and skip malformed parts. Reuse GDI buffers and fit print and scaled draws to the live visible extent. - Deliver one GDAL notification batch per message, repost wakes consumed by nested pumps, and keep vector-load state alive through reentrant control closure. Match managed completions by operation ID and normalize null warnings. - Invalidate cached features after writes so reads reflect values stored by the driver. - Make ActiveX test exports optional, protect existing COM registrations during activation checks, and add regression tests and documentation.
There was a problem hiding this comment.
🟡 Changes recommended
The hash-mixing expression implicitly narrows a 64-bit value to 32-bit std::size_t on Win32, breaking the Core build with warnings treated as errors.
2 open issues
1 file not reviewed
.idea/.gitignore: Generated file
What changed in this PR
This PR addresses pre-merge review findings across MapWinGIS6’s Core engine, rendering pipeline, and ActiveX wrapper, with supporting tests, documentation, and build controls.
Changes:
- Share immutable layer geometry, handle mixed and degenerate geometry, and invalidate cached features after writes.
- Harden ActiveX callback lifetimes, notification dispatch, COM resource ownership, and alternate-size drawing.
- Add regression coverage, gate test-only exports, and update samples, registration safeguards, and repository guidance.
Windows builds and tests were not run during this review.
| File | Description |
|---|---|
| tests/MapWinGIS.Core.Tests/VectorRenderSceneTests.cpp | Tests collection members and degenerate exteriors. |
| tests/MapWinGIS.Core.Tests/VectorLayerTests.cpp | Tests reads after driver-coerced writes. |
| tests/MapWinGIS.Core.Tests/TestData.h | Defines the fixture field-width constant. |
| tests/MapWinGIS.Core.Tests/TestData.cpp | Uses the shared field-width constant. |
| tests/MapWinGIS.Core.Tests/MapViewTests.cpp | Tests shared scene ownership and lifetime. |
| tests/MapWinGIS.Core.Tests/MapRenderSceneTests.cpp | Adapts assertions to shared layer scenes. |
| tests/MapWinGIS.ActiveX.Tests/Verify-ActiveXActivation.ps1 | Derives protected registration keys from IDL GUIDs. |
| tests/MapWinGIS.ActiveX.Tests/VectorLayerRendererTests.cpp | Adapts fixtures and tests null-scene handling. |
| tests/MapWinGIS.ActiveX.Tests/RenderingBaselineTests.cpp | Adapts benchmarks to shared scenes. |
| tests/MapWinGIS.ActiveX.Tests/ActiveXActivationTests.cpp | Adds re-entry, drawing, dispatch, and error-info coverage. |
| src/MapWinGIS.Core/src/vector/VectorDataset.cpp | Invalidates written-feature cache; explains extent SQL syntax. |
| src/MapWinGIS.Core/src/rendering/VectorRenderScene.cpp | Renders polygonal collection members and counts skipped parts. |
| src/MapWinGIS.Core/src/rendering/PolygonTriangulation.cpp | Uses hash-based vertex deduplication. |
| src/MapWinGIS.Core/src/rendering/MapRenderScene.cpp | Creates shared immutable layer scenes. |
| src/MapWinGIS.Core/src/map/MapView.cpp | Accepts prepared scenes without copying geometry. |
| src/MapWinGIS.Core/src/gdal/GdalAlgorithmRunner.cpp | Corrects destructor documentation only. |
| src/MapWinGIS.Core/include/mapwingis/vector/VectorDataset.h | Clarifies TryOpen exception behavior. |
| src/MapWinGIS.Core/include/mapwingis/rendering/VectorRenderScene.h | Exposes skipped-geometry counts and contracts. |
| src/MapWinGIS.Core/include/mapwingis/rendering/MapRenderScene.h | Changes layer geometry to shared ownership. |
| src/MapWinGIS.Core/include/mapwingis/map/MapView.h | Declares and documents shared prepared-scene support. |
| src/MapWinGIS.ActiveX/OpenGlVectorLayerRenderer.cpp | Reads shared scenes and rejects null pointers. |
| src/MapWinGIS.ActiveX/MapWinGISControl.cpp | Hardens load lifetimes, COM boundaries, and scaled drawing. |
| src/MapWinGIS.ActiveX/MapWinGIS.ActiveX.vcxproj | Adds the MSBuild test-hook switch. |
| src/MapWinGIS.ActiveX/GdiVectorLayerRenderer.cpp | Reuses polygon buffers and handles null scenes. |
| src/MapWinGIS.ActiveX/GdalOperationDispatcher.cpp | Reserves notification storage before clearing pending flags. |
| src/MapWinGIS.ActiveX/GdalEventSource.h | Tracks nested redispatch requests. |
| src/MapWinGIS.ActiveX/GdalEventSource.cpp | Delivers one batch per message and reposts consumed wakes. |
| src/MapWinGIS.ActiveX/ComConversion.cpp | Gives copied BSTR arguments automatic cleanup. |
| src/MapWinGIS.ActiveX/CMakeLists.txt | Conditionally enables test-hook exports. |
| samples/CSharp/ActiveXTestHost/GdalOperationClient.cs | Uses matching completion IDs and normalizes null warnings. |
| docs/gdal-integration.md | Documents bounded notification batches. |
| docs/BUILDING.md | Documents distribution-time test-hook settings. |
| docs/ARCHITECTURE.md | Explains shared scenes and live-extent drawing. |
| CMakeLists.txt | Adds the CMake test-hook option. |
| .idea/.gitignore | Ignores machine-specific project files. |
| .ai/memory/lessons/lessons.md | Records merge-history and driver-coercion lessons. |
| .ai/memory/architecture/core-library.md | Records shared scenes and skipped-geometry behavior. |
| .ai/memory/architecture/activex.md | Records drawing, dispatch, and test-hook behavior. |
Review effort: Balanced
- Avoid Win32 narrowing in the point hash combiner. - Synchronize nested dispatch coverage and disable timer fallback. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
pmeems
enabled auto-merge (squash)
November 18, 2026 16:55
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 the 22 findings from the pre-merge review of
development(review reportdevelopment-review-20261116-152310.html), except #22, which was invalid andgets an explanatory comment only.
Branch topology (#4) - required before merge
maincontains8dfeba2, a squash of earlierdevelopmenthistory. Its treeequals
developmentcommit7f12016, but because it is not an ancestor, atrial merge reports conflicts in 29 files.
This branch records
mainas merged without content changes:Use merge commits, not squash commits, for future
development->mainreleases. The lesson is recorded in
.ai/memory/lessons/lessons.md.Changes
Core
VectorDataset: discard the cached feature after everySetFeature. Drivers may coerce written values (the Shapefile drivertruncates strings to the DBF field width), so later reads now return the
stored value. New test:
VectorLayerEditTest.ReadsBackTheStoredValueAfterTheDriverCoercesAWrite.VectorDataset::TryOpen: documentation now states that only the openprobe is non-throwing; path conversion and GDAL initialization failures still
throw. Behavior is unchanged because an existing test expects
InvalidArgumentfor unconvertible paths.GdalAlgorithmRunnerdestructor comment corrected: releasing therunner may close datasets, and that close runs without the shared GDAL lock.
RECOMPUTE EXTENT ON <layer>: the Shapefile and GPKGdrivers take the rest of the statement as the literal layer name, so quoting
would break it. Added a comment explaining this.
Rendering
std::shared_ptr<const VectorRenderScene>.Map scene assembly and
MapView::AddLayerwith a prepared scene sharegeometry instead of copying it, so peak memory is one copy per layer.
Renderers treat a null layer scene as a failed layer.
API change:
LayerRenderScene::sceneand the prepared-sceneMapView::AddLayeroverload now use the shared pointer type.instead of promoting an interior ring to the exterior.
non-polygonal geometry is skipped instead of failing the whole layer.
Skipped parts are counted in the new
VectorRenderScene::skippedGeometryCount.an ordered
std::map. The double OGR-to-GEOS conversion (IsValidandtriangulation) remains, because Core has no direct GEOS dependency.
ActiveX
Keep GDAL diagnostics suppressed during feature ID scans #1
CompleteVectorLoadholds ashared_ptrto the load state instead ofa reference into the map node. Host callbacks such as
FireViewChangecanre-enter
CloseorEndLoadVectorDatasetand erase the entry.First merge to main from development #2 Alternate-size draws (printing, metafiles, scaled draws) fit the live
visible extent into the target size.
Modern GDAL Integration for MapWinGIS6 #5
DrainNotificationsreserves the batch before clearing pending flags,so an allocation failure cannot drop notifications.
Modern GDAL Integration for MapWinGIS6 #6 Each dispatch message delivers one batch and then returns to the
message loop. Notifications that arrive during delivery post their own wake.
A wake consumed by a sink's nested message pump is re-posted, with the
existing retry timer as fallback.
Caveat: posted messages still outrank input and paint messages in Win32, so
this bounds the work per message but does not guarantee input processing
while an operation reports progress continuously.
Modern GDAL Integration for MapWinGIS6 #7 BSTRs copied from the argument
SAFEARRAYare owned by RAII beforeUTF-8 conversion, so they no longer leak if the conversion throws.
MapWinGIS6 ActiveX Control and Modern Rendering Architecture #8
DispatchGdalNotificationsand the draw callback also catchnon-
std::exceptionexceptions at the COM boundary.Update build yaml #13 The rendering properties report
IID_IMapWinGISControl2, theinterface that declares them, as the
IErrorInfosource.MapWinGIS6 ActiveX Control and Modern Rendering Architecture #17
MapWinGISControlSetVectorPreparationHookForTestingis exportedonly when
MWG_ACTIVEX_TEST_HOOKSis defined:MWG_ENABLE_ACTIVEX_TEST_HOOKS, defaultMWG_BUILD_TESTS.MwgEnableActiveXTestHooks, defaulttrue.Distribution builds must turn it off. Tests that need the hook skip
when it is absent.
Tests, scripts and samples
Verify-ActiveXActivation.ps1derives the TypeLib, CLSID andinterface registration keys from the IDL GUIDs, so it protects and restores
all keys that registration writes.
not from any completion event.
Warningsis nullable and normalized to an empty array.Repository hygiene
MapWinGIS6 ActiveX Control and Modern Rendering Architecture #20 Personal CLion files are removed from the index and ignored:
.idea/debug-profiles.local.json.idea/misc.xml.idea/modules.xml.idea/github.imlShared
.ideafiles are kept.Documentation and memory
docs/ARCHITECTURE.md: shared layer scenes, live-extent drawing.docs/BUILDING.md:MwgEnableActiveXTestHooksswitch.docs/gdal-integration.md: one event batch per dispatch message..ai/memory: shared scenes, event batching, test hook gating, drivercoercion, squash-merge lesson.
Open assumptions to confirm in CI:
new scene tests write.
FireViewChangereaches the advise sink in the Close re-entry test.