Skip to content

Fix ActiveX rendering edge cases - #81

Merged
pmeems merged 7 commits into
phase-7-per-layer-render-scenesfrom
phase-8-activex-rendering-edge-cases
Nov 15, 2026
Merged

pmeems merged 7 commits into
phase-7-per-layer-render-scenesfrom
phase-8-activex-rendering-edge-cases

Conversation

@pmeems

@pmeems pmeems commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements phase 8 of .github/plans/development-review-fix-plan-20261113.md, stacked on #79.

  • Merged the latest phase-7-per-layer-render-scenes base and resolved nine conflicts. Preserved its reviewed flat polygon storage and test fixes, which address the original CI compilation failures.
  • Cached pan draws accept only whole-pixel offsets and reject fractional, non-finite, full-frame, and oversized shifts before integer conversion.
  • Failed resizes invalidate the layer cache and notify the host. Unknown exceptions cannot escape the resize wrapper.
  • Alternate-size draws use temporary frame and OpenGL resources. Both screen CPU staging and GPU framebuffer resources remain unchanged.
  • OpenGL reuses transformed vertices within each layer, reads BGRA directly, and delays retries for 60 draws after initialization failure. Target-size changes retry immediately.
  • Added renderer and class-factory control regressions. Updated README, architecture/testing documentation, shared memory, and the plan.

Local review and validation

The branch was checked out in .worktrees\pr-81. Two additional defects were found and fixed: scaled draws discarded the existing screen staging allocation, and failed context recovery bypassed the retry delay. Three regression cases failed before those fixes and now pass.

Check Result
CMake Debug x64 Build passed; 425 non-interactive cases, zero failures, three opt-in skips
CMake Release x64 Build passed; 425 non-interactive cases, zero failures, three opt-in skips
MSBuild Debug x64 solution Passed, zero warnings
MSBuild Core tests 335 passed, one network case skipped
MSBuild GDAL initialization tests Three passed
MSBuild non-interactive ActiveX tests 83 passed, two performance cases skipped
Build configuration script Passed
Compiler-flag and warning parity Passed, zero lost options, zero counted warnings
Opt-in Release rendering baselines Both passed on the base and updated branch

The regressions cover whole-pixel cached drags, fractional and full-frame fallbacks, offsets beyond LONG range, real pending-fit resize failure and host redraw notification, scaled-buffer preservation, odd-height BGRA output, and initialization retries after a delay or resize. No existing review comments required resolution.

Existing CMake command-line warning D9025 about /external:W0 and /external:W4 remains unchanged; there were no new source warnings.

Release measurements

Sequential runs compared phase 7 a3ea595 with this implementation at 1280x720.

Median frame time Base Updated
OpenGL, 100,000 convex 32-vertex polygons 50.5 ms 51.8 ms
OpenGL, complex scene with 325,000 meshes 75.4 ms 69.5 ms
GDI, convex grid 295.0 ms 297.2 ms
GDI, complex scene 316.4 ms 317.9 ms

This run does not show a consistent speedup. Timings are observations, not test thresholds.

Limitations

The current renderer has no separate convexity/angle calculation. Public scenes are mutable and have no reliable generation token for caching support results, so support checks remain uncached. A pointer-only cache can return stale results. GDI retains its coordinate preflight to avoid partially drawing invalid layers.

Local builds reused existing default-driver packages without reinstalling shared dependencies. Win32, the full-driver Release feature set, network tests, and interactive registration/hosting checks were not run. The source review HTML was unavailable at the referenced D: and equivalent F: paths.

The updated head requires fresh remote CI. The PR remains open and its stack membership and base are unchanged.

@pmeems
pmeems force-pushed the phase-8-activex-rendering-edge-cases branch from 1a7e1a0 to bf6626c Compare November 14, 2026 13:42
@pmeems
pmeems added this pull request to stack #83 November 14, 2026 14:00
@pmeems
pmeems marked this pull request as ready for review November 14, 2026 14:00
- Reuse cached layer geometry across visibility changes
- Add selective layer-scene invalidation
- Skip attribute reads and compute slow extents during geometry traversal
- Cover cache reuse and update rendering documentation
@pmeems
pmeems force-pushed the phase-8-activex-rendering-edge-cases branch from bf6626c to fb3ff5d Compare November 14, 2026 19:44
pmeems and others added 2 commits November 15, 2026 16:25
Preserve the reviewed flat scene storage and phase 7 regression fixes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve screen CPU/GPU buffers during alternate-size draws. Respect retry delays after failed context recovery. Add native control and renderer regressions and record local validation and performance results.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@pmeems pmeems left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommendation: Approve. Risk: Low for the reviewed rendering changes, with the untested configurations noted below. Final decision is with the human reviewer; this is a COMMENT review, not an approval.

Reviewed every phase 8 changed file against the plan and repository guidance after merging the latest phase 7 base in an isolated worktree. Resolved nine merge conflicts and preserved the base's corrected tests, addressing the compilation errors in the original CI run.

Local review found and fixed two additional defects: alternate-size draws discarded the screen staging allocation, and failed context recovery bypassed the initialization retry delay. Three new regression cases failed before these fixes and now pass. Added control regressions for whole-pixel versus fractional/full-frame pan draws, oversized offsets, retained buffer sizes, and a real pending-fit resize failure with cache invalidation and a host redraw notification. Test access does not add COM interfaces or change instance layout.

Validation: CMake Debug and Release x64 each passed 425 non-interactive cases with zero failures and three opt-in skips. MSBuild Debug x64 built with zero warnings; all three native suites passed. Build configuration checks and compiler-flag/warning parity passed with zero lost options. Both opt-in Release renderer baselines passed; their timings are in the PR description and do not show a consistent speedup.

No remaining blocking findings. Outstanding findings by severity: Critical 0, Major 0, Minor 0, Suggestion 0. Existing-comment duplicates skipped: 0; no existing review or issue comments required resolution. Safe scene-support caching remains an explicit plan deviation because public scenes are mutable without generation tokens; a pointer-only cache would risk stale validation. GDI retains its safety preflight.

Limitations: no local Win32, full-driver Release, network, or interactive registration/hosting validation. Existing CMake command-line warning D9025 is unchanged. The source review HTML was unavailable. Remote CI must validate this new head.

@pmeems
pmeems requested a balanced review from Copilot November 15, 2026 15:46
@pmeems
pmeems enabled stacked auto-merge (squash) November 15, 2026 15:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Non-retaining draws discard initialization-failure retry state, causing OpenGL initialization to retry every frame instead of honoring the 60-draw backoff.

1 open issue
What changed in this PR

This PR hardens ActiveX rendering on top of #79’s per-layer scene caching. It addresses cached-pan edge cases, protects screen resources during alternate-size draws, and improves OpenGL recovery.

Changes:

  • Validate cached pan offsets before integer conversion and invalidate caches with host notification after resize failures.
  • Isolate alternate-size rendering resources, reuse transformed vertex storage, read pixels directly in BGRA format, and delay failed OpenGL initialization retries.
  • Add control and renderer regressions, update build file lists, and document behavior and validation.

Builds and tests were not run during this review; the PR reports successful local Windows validation.

File Description
tests/​MapWinGIS.ActiveX.Tests/​VectorLayerRendererTests.cpp Adds pan validation, staging preservation, and recovery regressions.
tests/​MapWinGIS.ActiveX.Tests/​OpenGlVectorLayerRendererTestAccess.h Exposes staging and retry state for tests.
tests/​MapWinGIS.ActiveX.Tests/​MapWinGISControlTestAccess.h Adds test-only control state access.
tests/​MapWinGIS.ActiveX.Tests/​MapWinGIS.ActiveX.Tests.vcxproj Registers new test headers for MSBuild.
tests/​MapWinGIS.ActiveX.Tests/​CMakeLists.txt Registers new test headers for CMake.
tests/​MapWinGIS.ActiveX.Tests/​ActiveXActivationTests.cpp Tests scaled draws, cached pans, and resize-failure notification.
src/​MapWinGIS.ActiveX/​VectorRenderBackend.h Defines the temporary-resource draw option.
src/​MapWinGIS.ActiveX/​VectorLayerRenderer.h Extends the coordinator’s draw interface.
src/​MapWinGIS.ActiveX/​VectorLayerRenderer.cpp Forwards resource-retention settings to OpenGL.
src/​MapWinGIS.ActiveX/​PanBlit.h Adds bounded whole-pixel shift validation.
src/​MapWinGIS.ActiveX/​OpenGlVectorLayerRenderer.h Declares staging and initialization-retry state.
src/​MapWinGIS.ActiveX/​OpenGlVectorLayerRenderer.cpp Implements temporary rendering, BGRA readback, vertex reuse, and backoff.
src/​MapWinGIS.ActiveX/​MapWinGISControl.h Adds test access and resource-retention plumbing.
src/​MapWinGIS.ActiveX/​MapWinGISControl.cpp Hardens resize handling, cached pans, and alternate-size draws.
src/​MapWinGIS.ActiveX/​MapWinGIS.ActiveX.vcxproj Registers the pan helper for MSBuild.
src/​MapWinGIS.ActiveX/​GdiVectorLayerRenderer.h Aligns GDI with the extended backend interface.
src/​MapWinGIS.ActiveX/​GdiVectorLayerRenderer.cpp Accepts the unused resource-retention parameter.
src/​MapWinGIS.ActiveX/​GdalEventSource.h Replaces module-header coupling with direct ATL includes.
src/​MapWinGIS.ActiveX/​CMakeLists.txt Registers the pan helper for CMake.
README.md Summarizes cached-pan and temporary-buffer behavior.
docs/​TESTING.md Documents new control and renderer coverage.
docs/​ARCHITECTURE.md Explains resource isolation, readback, and recovery behavior.
.github/​plans/​development-review-fix-plan-20261113.md Records phase 8 results, measurements, and limitations.
.ai/​memory/​architecture/​activex.md Records rendering resource and recovery constraints.

Review effort: Balanced

- Carry initialization retry bookkeeping across temporary renderer instances.

- Cover repeated non-retaining draws after initialization failure.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pmeems
pmeems merged commit 37f4850 into development Nov 15, 2026
6 checks passed
@pmeems
pmeems deleted the phase-8-activex-rendering-edge-cases branch November 15, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants