Skip to content

Desktop Swift test lane red on main: 77 failures across 3 suites block every desktop PR (scrim regression root-caused to 15a51fb985) #11563

Closed

Description

@kodjima33

Desktop Swift Static & Test Contracts fails on every desktop PR right now, so no desktop change can reach main and the release train has no qualification signal. It is red on PR #11553 (58m25s, Nik's own branch) and on #11559, and I reproduced it locally on unmodified main at d20f89153d with the identical failure counts, so it is not any one branch's diff.

Three independent suites are red — 77 assertion failures total:

Suite Failures
ShellModalScrimTests (Tests/PageGlassLaneTests.swift) 74
GlassSurfaceReviewRegressionTests 1
ProactiveLaneClientTests 2

main shows green because the lane is path-filtered: Detect Desktop Swift Changes skips the test job on every commit that does not touch desktop/macos/**, so runs 31779563942 / 31778317070 / 31778252500 all report success having skipped it. The red only appears on desktop PRs.

1. ShellModalScrimTests — 74 failures, root-caused to 15a51fb

15a51fb985 ("fix(desktop): pass clicks through transparent dead zones of the shell and notch windows", Nik Shevchenko, 2026-08-14 02:10 -0400) added a reporter to the modal scrim's host-sized transparent barrier — desktop/macos/Desktop/Sources/MainWindow/ShellModalScrim.swift:

Color.clear
  .contentShape(Rectangle())
  .onTapGesture { onTap?() }
  .background(InkGlassHitRegionReporter())   // <- added by 15a51fb985

PaintedExtent.of measures what the view actually paints, and the reporter makes that host-sized barrier paint, so the measured extent becomes the whole window instead of the shell's lane:

XCTAssertEqualWithAccuracy failed: ("3440.0") is not equal to ("900.0") +/- ("1.5")
  - the confirmation's card is drawn but its dim is not: at (3440.0, 1440.0) the paint is narrower than the shell's lane
XCTAssertGreaterThan failed: ("0.0") is not greater than ("0.0")
  - wholeShell at (3440.0, 1440.0): the confirmation painted to the top edge, which on this window is the user's wallpaper

Verified by reverting only that one line locally: swift test --filter ShellModalScrimTests goes from 7 tests / 74 failures to 7 tests / 0 failures. Nothing else changed.

The reporter is there for a real reason (it keeps the barrier inside the window's pointer ownership so a modal stays modal under the new click-through sync), so the fix is not a plain revert — the barrier needs to register its hit region without contributing paint, or the test's measurement has to exclude a zero-alpha reporter. That is a call for the author of 15a51fb / InkGlassHitRegions, which is why I am filing rather than patching it.

2. GlassSurfaceReviewRegressionTests — 1 failure

Tests/GlassSurfaceReviewRegressionTests.swift:61: testInkGlassPanelClipsReturnedContentButNotAnOuterOverlay
  XCTAssertLessThan failed: ("0.8") is not less than ("0.5")
  - the returned red content must not paint through the panel's rounded corner

Still fails with the 15a51fb hunk reverted, so it is a separate defect.

3. ProactiveLaneClientTests — 2 failures

Tests/ProactiveLaneClientTests.swift:303,312: testLaterShorterRetryWindowDoesNotShortenActiveCooldown
  XCTAssertEqual failed: ("1") is not equal to ("2")
  - the later shorter Retry-After must not have shortened the active cooldown

Also independent of 15a51fb.

Repro

git checkout d20f89153d          # unmodified main
cd desktop/macos/Desktop
swift test --filter ShellModalScrimTests              # 7 tests, 74 failures
swift test --filter GlassSurfaceReviewRegressionTests # 3 tests, 1 failure
swift test --filter ProactiveLaneClientTests          # 11 tests, 2 failures

Found by the hourly desktop bug watchdog while trying to land #11559; that PR is otherwise green (20/20 make preflight, its own suites pass) and is blocked purely by this.

Activity

  1. moved this from Someday to In progress in omi TODO / bountieson Aug 14, 2026
  2. kodjima33 commented on Aug 14, 2026

    @kodjima33
    CollaboratorAuthor

    Root-caused and fixed 76 of the 77, CI-proven; the lane still has a fourth failure this issue did not record.

    1. The 74 + 1 (ShellModalScrimTests, GlassSurfaceReviewRegressionTests) are one cause, and it is not the scrim. ImageRenderer cannot rasterise an NSViewRepresentable and substitutes an opaque placeholder for it. InkGlassHitRegionReporter mounts one, so every pixel-truth test of a surface that mounts a marker measured that placeholder covering the marker's whole host — which is why the dim read as painting to the window's edge. Measured directly: Color.clear.background(InkGlassHitRegionReporter()) rendered at 40x40 comes back fully opaque (centre RGBA 255,56,60,255), where Color.clear alone is 0,0,0,0.

    So it is not a call for the author of 15a51fb after all, and it is not a revert: mount the marker at zero opacity. The placeholder then contributes no pixels while the AppKit view stays mounted, unhidden and registered — SwiftUI applies opacity to the host layer, not to the view's own alphaValue, which is what InkGlassHitRegions.containsPoint reads. Verified both halves, since dropping the reporter would satisfy the paint half and silently return the shell to passing clicks through its own modals.

    2. The 2 (ProactiveLaneClientTests) were never reachable. testLaterShorterRetryWindowDoesNotShortenActiveCooldown (ff97490) issues its two 429s sequentially, but an armed cooldown short-circuits the network before the second request is built — as testExtractionSkipsNetworkDuringQuotaCooldownThenResumesAfterDeadline asserts — so the shorter Retry-After is never parsed and requestCount cannot reach the 2 it asserts. Overlapping the two attempts on a rendezvous makes the max-deadline preservation it is named for actually run.

    3. There is a fourth failure: ChatCitationTests.testRewindCitationFocusIsOneShotAndPreservesExactScreenshotID (from #11519). It fails on every CI run of this lane and passes locally, so a filtered local repro of the three suites above misses it — it is why fixing the 76 does not turn the lane green. See #11566 for what is ruled out (the capture fence is not suspended there; capture() is non-nil) and what remains.

    Branch with the two proven fixes: watchdog/issue-11563-desktop-swift-lane-red (PR #11566, closed rather than left open — CI cannot be green while 3 stands).

    🤖 hourly desktop watchdog

  3. kodjima33 commented on Aug 14, 2026

    @kodjima33
    CollaboratorAuthor

    All four suites root-caused and fixed, with the fourth failure — the one that blocked the previous attempt — reproduced locally rather than theorised.

    ChatCitationTests.testRewindCitationFocusIsOneShotAndPreservesExactScreenshotID fails because RewindCaptureOwnerSnapshot.capture() resolves the owner id from the authorization snapshot (persistent auth_userId default) while isCurrent() compares against RewindDatabase.currentUserId ?? "anonymous", which is in-memory and nil in a fresh process. swift-test-suites.sh gives each suite its own process, but UserDefaults is on disk and outlives all of them — so on a runner where an earlier suite left auth_userId set, the focus request captures owner "X" and consume() refuses it against "anonymous". Setting auth_userId before that test locally reproduces CI's message verbatim (("nil") is not equal to ("Optional(42)")); pinning the two sources turns it green with that default still set.

    PR #11571 — 77 failures → 0 across ChatCitation 18/18, ShellModalScrim 7/7, GlassSurfaceReviewRegression 3/3, ProactiveLaneClient 11/11, InkGlassHitRegionReporter 2/2. The underlying owner-source divergence is a real product defect and is filed separately as #11572; narrowing a fail-closed ownership fence does not belong in a CI unblock.

  4. kodjima33 commented on Aug 14, 2026

    @kodjima33
    CollaboratorAuthor

    Correction to this issue's scope, from CI evidence: the lane has 7 failing suites, not 3.

    The four assertion suites are fixed and CI-proven on watchdog/issue-11563-desktop-swift-lane-red (run 31809160446) — ShellModalScrimTests, GlassSurfaceReviewRegressionTests, ProactiveLaneClientTests, ChatCitationTests all drop out of the failure list. 77 assertion failures → 0.

    The other three — AgentPillLifecycleTests, ChatTimelineContinuityTests, MarkdownNestedScrollTests — crash with signal code 11 and were never recorded here. They predate everything: identical crashes on security/transport-egress, #11553 and #11559. Filed as #11573; that is now the blocker for a green lane, so this issue cannot close on the assertion fixes alone.

    #11571 held the four fixes and is closed rather than left open, since it could not go green behind #11573. The branch is kept, rebased, ready to reopen.

  5. undivisible commented on Aug 20, 2026

    @undivisible
    Collaborator

    Closing per automated triage (2026-08-20): verified fixed: #11571 repaired 4 suites / 77 assertion failures. See /tmp/omi-issue-triage.md.

  6. moved this from In progress to In review in omi TODO / bountieson Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions