Skip to content

Tests: a dev-build test run passes what CI's build passes, not 15 failures and an abort - #26910

Open
sethml wants to merge 4 commits into
tangency-labs:mainfrom
sethml:tests/dev-build-runs-to-the-end
Open

sethml wants to merge 4 commits into
tangency-labs:mainfrom
sethml:tests/dev-build-runs-to-the-end

Conversation

@sethml

@sethml sethml commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Change

A plain cargo test builds the tests in the dev profile, which keeps debug assertions. CI's ci profile and the release builds have none. So some tests pass on CI but fail in every local dev-build run, and one test binary aborts. This PR makes those tests pass in a dev build too. It changes tests and the dev build only; the app does not change.

There are three causes:

  • Dropped texture changes (14 tests). Each egui frame returns the texture uploads that a renderer should apply. In a debug build, egui asserts that these uploads were not dropped. Tests added since Tests: a plain cargo test of the UI crate runs to the end in a dev build #25542 (the last pass at this) again drop a frame's output with its font-atlas upload pending: five in ui-kit, seven in ui-egui, one in window-gpu and one in viewport-egui. A frame that a test throws away now calls drop_without_applying_deltas(), as Tests: a plain cargo test of the UI crate runs to the end in a dev build #25542 did. A frame whose output the test reads clears its textures_delta first.
  • An abort at thread exit in viewport-gpu (macOS, debug builds). The GPU tests share one device per thread through a thread-local, HELD. When a test thread reused a device that another thread had opened, closing the queue in HELD's destructor opened an autorelease pool on Metal. In a debug build, objc2 records each pool in a thread-local of its own. That thread-local was destroyed first, so the whole binary aborted with "thread local panicked on drop", every run. The test helper now makes a small buffer before it first uses HELD. That opens a pool on Metal, so objc2's thread-local outlives HELD. The helper already does the same for wgpu's own thread-local (Tests: the solidcraft-gpu tests deadlock in the NVIDIA driver on Linux, so cargo xtask ci never finishes #10232).
  • A dependency's debug assertion in the Gerber reader (1 test). io's gerber::tests::hostile_input_never_panics trips a debug_assert inside cavalier_contours 0.9.0, the latest release. The assertion checks the library's own intermediate data during a polygon boolean. The dev profile now builds this one crate without debug assertions, as CI and the releases already do.

Changes a default: no

Validation

macOS 15, Apple Silicon. Full runs with cargo xtask test (SOLIDCRAFT_TEST_JOBS=4), graded against tests/KNOWN_FAILING_TESTS:

  • ci profile, on main at 8e3bb3c: 10 tests fail, all Mac-only (listed below). None of the tests in this PR fail.
  • dev profile, on the same commit: the same 10 tests fail, plus 14 texture tests (main has since fixed one of them and added another), the Gerber test, and the viewport-gpu binary aborts.
  • dev profile, on this branch (based on 88669e4): the 14 texture tests, the Gerber test and all 155 viewport-gpu tests pass. The Mac-only 10 still fail, as in the ci profile. One new test, issue_report::tests::an_agents_report_sends_the_design_only_on_the_persons_saved_choice (added today), failed once under the full run's load. It passed 3 of 3 runs alone, so it is not a dev-build failure.
  • viewport-gpu without the change aborted in 8 of 8 runs; with it, 5 of 5 runs passed.
  • cargo clippy on ui-kit, window-gpu, viewport-egui, viewport-gpu and ui-egui with --all-targets -- -D warnings, and cargo fmt --check: clean.

For reference, the 10 Mac-only failures, unchanged by this PR: kernel step_export_bytes and blend::tests::concave_chord_and_g2_rounds…; doc forms::tests::circular_surface_default_and_denser_guides…; engine extent_tests::a_plain_to_on_an_edge… and extend_to_face_on_an_edge_keeps_the_snapped_face…, hole_face_tests::countersunk_hole_on_plane_tangent_to_cylinder_with_flip…, two component_link tests and cmd::drawing::tests::save_as_keeps_drawing_sources… (all three on /var against /private/var), and flat_export_preserves_original_bytes. Two of these are fixed in #19284 (Tests: two engine tests pass on macOS).

Screenshots of the behavior (when observable)

Tests and the dev build only; nothing changes in the app.

Integration status

Branched from main at 88669e4. It merges cleanly with main at d5900c8. No open PR touches these tests' frame handling, the GPU test helper or the dev profile.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated development-build settings for a dependency when processing certain input.
  • Tests
    • Improved UI and rendering test cleanup and GPU test initialization. Existing assertions and tested behavior are unchanged.

sethml and others added 3 commits December 5, 2026 10:47
…a dev-build cargo test passes

egui's TexturesDelta asserts in debug builds that a frame's texture uploads were handled. CI's
ci profile has no debug assertions, so tests added since tangency-labs#25542 that dropped a frame with its
font atlas upload pending pass there and fail every dev-profile run: five in ui-kit, seven in
ui-egui, one each in window-gpu and viewport-egui. A frame thrown away now calls
drop_without_applying_deltas(); one whose output the test reads clears its textures_delta.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… debug build

A test thread that reused the shared device another thread opened first used objc2's
autorelease-pool thread-local only when HELD's destructor closed the queue on Metal, after that
thread-local was destroyed: the process aborted with "thread local panicked on drop". Making a
buffer before HELD is first used opens a pool on Metal, so objc2's thread-local outlives HELD.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s CI and releases do

io's gerber::tests::hostile_input_never_panics trips one of cavalier_contours 0.9.0's checks on
its own boolean's intermediate slices. Only dev builds have debug assertions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the area:ui desktop/web front end, dialogs, viewport label Dec 5, 2026
@coderabbitai

coderabbitai Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The development profile disables debug assertions for cavalier_contours. UI tests now clear or discard rendered texture deltas. The shared GPU test setup creates and destroys a 4-byte buffer after polling the device.

Changes: Development profile

Layer / File(s) Summary
Dependency assertion override
Cargo.toml
The development profile disables debug assertions for cavalier_contours.

UI test output handling

Layer / File(s) Summary
UI test output handling
crates/ui-egui/src/browser_canvas.rs, crates/ui-egui/src/prefs/pen.rs, crates/ui-egui/src/render_workspace_tests.rs, crates/ui-kit/src/file_preview_tests.rs, crates/ui-kit/src/window_chrome.rs, crates/viewport-egui/src/lib.rs, crates/window-gpu/src/runner.rs
Tests clear texture deltas before shape checks or explicitly drop UI outputs without applying deltas. Existing assertions remain unchanged.

GPU test setup

Layer / File(s) Summary
Shared device buffer setup
crates/viewport-gpu/src/test_env.rs
After polling the device, shared creates and destroys a 4-byte COPY_DST buffer before retaining the device in HELD.

Estimated code review effort: 2 (Simple) | ~12 minutes

Merge Risk: Minimal · previous review 6e5e1

This change only affects the dev build profile and tests, so the app behavior is unchanged. It makes plain cargo test pass under the dev profile, and no merge-blocking risk remains.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title names the main change: making a plain dev-profile test run match CI's pass results. It is specific to tests and the dev build, and it does not overstate the scope. The wording is slightly aw…
Description check Passed The description follows the template well. It has a Change section that explains the purpose in plain words, names the three causes, and states that the app does not change. It includes the required '…
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.
Existing Defaults Unchanged Passed The check fails only if the PR changes a UX default: a default setting or preference, the usual behavior of a command or tool, the default layout or behavior, or shortcuts. I compared the reviewed ran…
Full details: Title check

Explanation

The title names the main change: making a plain dev-profile test run match CI's pass results. It is specific to tests and the dev build, and it does not overstate the scope. The wording is slightly awkward, but the title is accurate and descriptive.

Full details: Description check

Explanation

The description follows the template well. It has a Change section that explains the purpose in plain words, names the three causes, and states that the app does not change. It includes the required 'Changes a default: no' line. It has a detailed Validation section with commands, environment, and before/after results. The Screenshots section says that the change is tests and dev build only. The Integration status section records the base and merge state. The Change section does not add a 'Test change:' line. The template only requires that line when a kernel change alters existing test expectations, and this PR does not touch the kernel. The description is mostly complete.

Full details: Existing Defaults Unchanged

Explanation

The check fails only if the PR changes a UX default: a default setting or preference, the usual behavior of a command or tool, the default layout or behavior, or shortcuts. I compared the reviewed range against its base. Nine files changed, and all are in scope for tests or the dev build: - Cargo.toml adds [profile.dev.package.cavalier_contours] debug-assertions = false. This changes only debug-assertion checks inside one dependency in dev builds. It does not change any user-facing setting, command, or layout. Per the check, a changed geometry or kernel result is not a UX default. The ci and release profiles are unchanged. - The ui-egui, ui-kit, viewport-egui, and window-gpu files change only test code. They call drop_without_applying_deltas() or clear textures_delta in tests. - crates/viewport-gpu/src/test_env.rs changes only the test helper shared. It adds a small buffer create and destroy before HELD is used. No application source changed. No preference, default value, shortcut, or layout changed. The description's Changes a default: no agrees with the diff. The check passes.

Finishing Touches

Generate unit tests (beta)

  • 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

Commits

Reviewing files that changed from the base of the PR and between d5900c8 and 6e5e10d.

Files selected for processing: 9

  • Cargo.toml
  • crates/ui-egui/src/browser_canvas.rs
  • crates/ui-egui/src/prefs/pen.rs
  • crates/ui-egui/src/render_workspace_tests.rs
  • crates/ui-kit/src/file_preview_tests.rs
  • crates/ui-kit/src/window_chrome.rs
  • crates/viewport-egui/src/lib.rs
  • crates/viewport-gpu/src/test_env.rs
  • crates/window-gpu/src/runner.rs

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

@bherbruck bherbruck added the approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) label Dec 5, 2026
…to-the-end

# Conflicts:
#	crates/ui-egui/src/browser_canvas.rs
@bherbruck

Copy link
Copy Markdown
Collaborator

@sethml quick status: this is green. What holds it is the change to the dev build profile in the root Cargo.toml, which I sign off on myself; it's on my list. Nothing is needed from you right now.

@bherbruck bherbruck added the status:decision Waiting on a maintainer group decision; don't merge or close label Dec 6, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) area:ui desktop/web front end, dialogs, viewport status:decision Waiting on a maintainer group decision; don't merge or close

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants