Skip to content

fix(shots): hold the transition while a scene leaving program is removed - #271

Merged
kixelated merged 6 commits into
mainfrom
quest/m0/shots-scene-remove-flake
Nov 27, 2026
Merged

kixelated merged 6 commits into
mainfrom
quest/m0/shots-scene-remove-flake

Conversation

@kixelated

@kixelated kixelated commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Finishes quest/m0/shots-scene-remove-flake.md: shots::a_scene_removes_from_its_pad no longer races the program clock.

Root cause

The test took Interview using the show's 300 ms fade, with Instant::now() as the start. Then it checked that removing Main while Main was leaving finishes the transition. The engine's program clock ends that fade on its own after 300 ms of real time, so under load the test lost the race in two ways:

  • shots.rs:832 assert!(transitioning()): a stall longer than 300 ms after take ended the fade first.
  • shots.rs:836, Main not removed: the sheet says "It is leaving the program…" only while the fade is under way. The fade ended between the frame kittest read the sheet's Remove position from and the click. The sheet lost that sentence, got shorter, and re-centered. The click then landed on the backdrop, which closes the modal without removing anything.

Instrumented runs also showed the fade had usually ended before the confirm click (159 of 163 passing runs). So the step mostly wasn't testing the "leaving in a transition" path it describes.

Fix

The test starts the transition an hour ahead. The program clock holds it at its start, and the removal under test is what ends it. No retry, sleep, or timeout changed. This is a test-only change: the product code behaves as #266 intended.

Caused by

  • moq-dev/studio#266 - the test raced a real-clock 300 ms transition against the window's frames (found by check)

Validation

Stress loop: the test binary run directly, 96 copies at once on a 24-core host (4× oversubscription), each with its own SHOTS_DIR, through quest gate.

runs :832 transitioning :836 not removed settle 20 s timeout (:727) segfault after pass
before 192 1 6 14 1
before (instrumented) 192 0 10 19 0
after 192 0 0 38 2
  • With 24 copies at once (one per core), 48 of 48 runs passed before the fix, so it takes heavy oversubscription to show.
  • Second check: the fixed test with 2 s of injected stalls and extra frames before the removal passes. Before the fix, a single 500 ms stall ended the transition.
  • just ci passes, and a full just shots run passes (110 of 110).

The settle timeouts and the crash on exit are separate from this race; see Decisions and Follow-ups.

Decisions

Made without the maintainer (away); please review:

  • Hold the transition with a start an hour ahead, rather than installing a kio::clock::Manual clock on the shots runtime. The manual clock would stop the program clock that settle, the thumbnails, and quit rely on. A stinger was the other way to hold it, but it needs a playing media clip. The one-hour start fixes state instead of widening a wait.
  • The sheet re-centering under the pointer when its text changes is left as it is. With the default 300 ms fade, a person can't read the sheet and click before the fade ends. Recommend revisiting only if long transitions become common.
  • settle's 20 s bound is unchanged. It only ran out at 4× oversubscription (quest gate keeps load below that). It is shared by every shots view, which the quest puts out of scope. No follow-up was added; recommend one only if it shows up at normal load.

Follow-ups

  • quest/m0/shots-exit-segfault.md [S] - a shots test process sometimes crashes with SIGSEGV after test result: ok under 4× oversubscription (3 of 384 runs). Nextest would fail that run. Decided 2026-11-26 (maintainer, /quest-run): ✅ keep it (rejected: drop it), recorded in its Plan. No open decisions.

API and wire impact

None (test and quest files only).

Models

Size: S
Implementer: Claude Code, claude-opus-5-5, unknown (arm A)
Implementer: Claude Code, claude-opus-5-5, unknown (iterate, XS, arm A)

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

Review

Rewritten by quest review after each round.

  • Head: 044ab7a

  • Base: origin/main at f78243b

  • Risk: medium, the base has no RISK.md to name what is always high or customer-facing, so every change is medium

  • Classified: medium by default

  • Reviewer: Codex, gpt-6.2-sol, medium effort

  • Session: 01a21a93-7cbf-7302-8f03-d0ef52194a87, round 2

  • Score: 10/10, The revised teardown note correctly limits the comparison to tests that call `quit` and identifies `shoot` as the named-view teardown path.

  • Rounds: 2; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

kixelated and others added 2 commits November 26, 2026 02:27
The test took Interview by the show's 300 ms fade on the real clock, which
the program clock ends on its own. Under load it ended before the
transitioning assertion, or between the frame kittest read and the click on
the sheet's Remove: the sheet then lost its "leaving the program" line,
re-centered shorter, and the click landed on the backdrop, closing it.
Starting the transition an hour ahead holds it at its start until the
removal ends it.

Finishes quest/m0/shots-scene-remove-flake.md and adds
quest/m0/shots-exit-segfault.md for a crash on exit found while
reproducing it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title Removing a scene passes every time under load fix(shots): hold the transition while a scene leaving program is removed Nov 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 26, 2026 11:13
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The scene-removal test now schedules its transition to Interview one hour ahead. The prior document about investigating intermittent scene-removal failures is deleted. A new document describes a reported SIGSEGV after shots-test runs and outlines a core-dump investigation.

Merge Risk: Minimal · up to d770f

This change makes a scene-removal test deterministic by holding its transition at the start, and it adds a follow-up note for a rare crash after a passing test. Product behavior is unchanged. I found no merge-blocking risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(shots): hold the transition while a scene leaving program is removed" matches the main change: the test now starts the transition an hour ahead so the program clock holds it while Main …
Description check Passed The description explains the root cause (the test raced the 300 ms real-clock fade), the fix (start the transition an hour ahead, test-only), the validation runs, and the decisions and follow-ups. It …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(shots): hold the transition while a scene leaving program is removed" matches the main change: the test now starts the transition an hour ahead so the program clock holds it while Main is removed. It names the area (shots) and the behavior. It is a test-only change, and the title describes the test fix accurately enough for a teammate scanning history.

Full details: Description check

Explanation

The description explains the root cause (the test raced the 300 ms real-clock fade), the fix (start the transition an hour ahead, test-only), the validation runs, and the decisions and follow-ups. It is closely tied to the changeset.

Finishing Touches

Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f14fa035-233a-4282-b018-953d2d58e400
Commits

Reviewing files that changed from the base of the PR and between 80b33d1 and d770fca.

Files selected for processing: 1

  • quest/m0/shots-exit-segfault.md
Files skipped from review as they are similar to previous changes: 1

  • quest/m0/shots-exit-segfault.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@kixelated

Copy link
Copy Markdown
Contributor Author

Maintainer decision (/quest-run, 2026-11-26):

  • ✅ /quest-merge this PR (rejected: /quest-iterate, skip, delete).
  • ✅ Keep the follow-up quest/m0/shots-exit-segfault.md (rejected: drop it). A rare crash after a pass will turn into a CI flake under nextest.

(Written by Claude Opus 5.5)

kixelated and others added 2 commits November 26, 2026 17:13
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…quit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated merged commit 31fac84 into main Nov 27, 2026
3 checks passed
@kixelated
kixelated deleted the quest/m0/shots-scene-remove-flake branch November 27, 2026 03:35
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