Skip to content

Keep pending group members across order updates and fix monthly coverage - #171

Merged
leafOfTree merged 2 commits into
mainfrom
fix-monthly-coverage
Dec 1, 2026
Merged

leafOfTree merged 2 commits into
mainfrom
fix-monthly-coverage

Conversation

@leafOfTree

Copy link
Copy Markdown
Owner

Fixes all 5 failures from the 2026-12-01 Monthly coverage run (#46543763123):

Root causes & fixes

  • Optimistic group-membership race (WtProgram/Desktop.fs, ests/StartupGrouping.fsx, ests/GroupLifecycle.fsx):
    • GroupInfo.publishOrder() previously overwrote windowsCell with _group.lorder, wiping out a second window still queued on the group STA under AltCover slowdown and causing discovery scans to split restored windows across two groups.
    • Added pendingAdds tracking + GroupSnapshot.mergeOrder so in-flight �ddWindow / �ddAfterDetaching handles survive earlier order updates and stale _group.removed callbacks, plus pure and cross-STA regression assertions in GroupLifecycle.fsx.
    • Updated StartupGrouping.fsx to pause grouping via suspendTabMonitoring()/
      esumeTabMonitoring() (instead of making �part untabbable) and wait for keptGroup to leave Desktop.groups.
  • Shadow convolution hot loop (WtProgram/TabShadow.fs):
    • Optimized TabShadow.Renderer.Render to skip empty mask rows, non-overlapping vertical spans (colMinY/colMaxY), and opaque interior pixels without changing output pixels (bit-for-bit verified by TabShadow.fsx against
      eferenceShadow).
  • Instrumentation overhead handling ( ests/Run-Tests.ps1, ests/TestInit.fsx, ests/Reliability.fsx, ests/GroupLifecycle.fsx, ests/TabInteraction.fsx):
    • Set WINDOWTABS_COVERAGE=1 (TestInit.isCoverage) and default -TimeoutSeconds to 420 when -Coverage is passed (normal runs keep 120 s and all strict assertions unchanged).
    • Adjusted Reliability.fsx (ResourceMonitor.readWith ceiling under instrumented Win32.dll), GroupLifecycle.fsx (pumpUntil wait under coverage), and TabInteraction.fsx (representative simulated-drag matrix and real-time intermediate animation frame checks under coverage).

Verification

  • ./tests/Run-Tests.ps1 -Coverage -MinimumLineCoverage 50 -MinimumBranchCoverage 50: 18/18 suites passed in 655 s (83.4% lines, 66.7% branches, 84.4% methods — up from 65.5% / 51.3%).
  • Uninstrumented runs: Reliability, GroupLifecycle, GroupOperations, TabInteraction, and StartupGrouping (3x repeat) passed.
  • dotnet build WindowTabs.sln: 0 warnings, 0 errors.

- Track in-flight addWindow/addAfterDetaching tokens in GroupInfo and merge them in GroupSnapshot.mergeOrder so an earlier tab's publishOrder (or stale removed event) cannot hide a queued window from discovery scans.
- Add pure and cross-STA regression tests for pending-add preservation in GroupLifecycle.fsx, and pause grouping via suspendTabMonitoring() in StartupGrouping.fsx while waiting for keptGroup to leave Desktop.groups.
- Skip empty rows, non-overlapping vertical spans, and opaque interior pixels in TabShadow.Renderer.Render while preserving bit-for-bit identical output.
- Export WINDOWTABS_COVERAGE=1 (TestInit.isCoverage) and default -TimeoutSeconds to 420 under -Coverage in Run-Tests.ps1, and relax instrumentation-sensitive perf/frame-count checks in Reliability.fsx, GroupLifecycle.fsx, and TabInteraction.fsx.
@leafOfTree
leafOfTree merged commit 7c161db into main Dec 1, 2026
6 checks passed
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.

1 participant