windows-reactor test and diagnostics hardening and simplification - #4644
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens and simplifies windows-reactor’s panic/diagnostics story and expands test coverage around pointer handling, while also improving windows-canvas robustness on GPU-less environments and adding an end-to-end editor sample that composes pointer input + geometry hit-testing.
Changes:
- Remove the
windows-reactordefault “diagnostics” panic hook, keeping only small panic-formatting helpers on FFI error paths and documentingpanic = "abort"for release builds. - Add headless (
test_reactor) coverage for pointer handler attach/detach/dedup behavior and add an integration (reactor_selftest) fixture that injects real OS mouse input via WinRTInputInjector. - Improve
windows-canvasresilience withGpuDevice::new_or_warp()and device-lost helpers exported as public API, plus add an interactive “editor” sample demonstrating the full interaction loop.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| docs/crates/windows-reactor.md | Documents panic-boundary behavior, removes diagnostics demo reference, and clarifies testing/test-crate rules. |
| docs/crates/windows-canvas.md | Updates samples/testing guidance; documents device-lost helpers, WARP fallback, and new editor/hit-test samples. |
| crates/tools/reactor/src/test.txt | Adds binding surface needed by reactor_selftest for input injection + Win32 helpers. |
| crates/tests/libs/reactor/tests/pointer_handlers.rs | New headless tests pinning pointer handler bundle semantics via RecordingBackend. |
| crates/tests/libs/reactor/src/lib.rs | Extends RecordingBackend op log to record set_pointer_handlers calls. |
| crates/tests/libs/reactor_selftest/src/registry.rs | Registers the new pointer injection integration fixture. |
| crates/tests/libs/reactor_selftest/src/main.rs | Switches to windows_core::Result (removes windows crate dependency). |
| crates/tests/libs/reactor_selftest/src/harness.rs | Removes windows crate Win32/COM usage in favor of generated bindings; exposes hwnd() for injection. |
| crates/tests/libs/reactor_selftest/src/fixtures/pointer_input.rs | New end-to-end fixture injecting OS mouse input and validating reactor pointer callbacks + flags. |
| crates/tests/libs/reactor_selftest/src/fixtures/mod.rs | Exports the new pointer_input fixture module. |
| crates/tests/libs/reactor_selftest/src/exec.rs | Switches to windows_core::Result. |
| crates/tests/libs/reactor_selftest/src/bindings.rs | Regenerated bindings including InputInjector + needed Win32/COM symbols. |
| crates/tests/libs/reactor_selftest/Cargo.toml | Drops the dependency on windows crate features; relies on windows-core + generated bindings. |
| crates/tests/libs/canvas/src/lib.rs | Adds tests for device-lost classification, WARP/hardware fallback, and swapchain resize behaviors. |
| crates/samples/reactor/apps/examples/diagnostics_demo.rs | Removes the diagnostics demo sample (no longer applicable without the global panic hook). |
| crates/samples/canvas/editor/src/main.rs | New interactive editor sample composing reactor pointer events with canvas geometry hit-testing. |
| crates/samples/canvas/editor/Cargo.toml | Adds the new canvas_editor sample crate. |
| crates/samples/canvas/editor/build.rs | Uses windows-reactor-setup to make the sample self-contained. |
| crates/libs/reactor/src/reconciler/wrappers.rs | Removes ExpectPanicGuard usage around error boundaries (panic hook removed). |
| crates/libs/reactor/src/diagnostics.rs | Replaces panic-hook infrastructure with small crate-private helpers for FFI error-path reporting. |
| crates/libs/reactor/src/app.rs | Stops installing diagnostics panic hook during app initialization. |
| crates/libs/reactor/Cargo.toml | Removes default diagnostics feature. |
| crates/libs/canvas/src/reactor.rs | Uses GpuDevice::new_or_warp() and refactors surface pixel sizing into surface_pixels(). |
| crates/libs/canvas/src/lib.rs | Exports is_device_lost / check_device_lost as public API. |
| crates/libs/canvas/src/device.rs | Adds GpuDevice::new_or_warp() hardware→WARP fallback constructor. |
| crates/libs/canvas/src/device_lost.rs | Documents and exposes device-lost classification helpers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.