Skip to content

KBM: fix camera whip on focus regain, add absolute mouse support - #1059

Open
saurabhbhoir456 wants to merge 4 commits into
xcl-dev:mainfrom
saurabhbhoir456:main
Open

saurabhbhoir456 wants to merge 4 commits into
xcl-dev:mainfrom
saurabhbhoir456:main

Conversation

@saurabhbhoir456

Copy link
Copy Markdown

Add unit tests for all three fixes.

What is in it

Tested

  • hardware (GPU + driver, CPU), Rust version, debug / release:
  • cargo test --workspace -- --test-threads=4: N passed, N failed, N ignored (SKIPPED GPU tests: …)

Regression run

main:

PR:

Not tested

AI use

  • none / tool and model, and what it did

- Issue xcl-dev#963: Use real dt for velocity rate calculation, clamp only for smoothing
- Issue xcl-dev#962: Add last_abs field for absolute mouse coordinate delta calculation
- Issue xcl-dev#961: Canonicalize game_root path in VFS (handles UNC paths)

Add unit tests for all three fixes.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@ettehn

ettehn commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

On b11945f, rustfmt --edition 2021 --check crates/xcl/src/hle/kbm.rs reports an unexpected closing }. There is an extra brace between mouse_reset_clears_last_abs and focus_loss_resets_mouse_velocity_and_wheel_state. Several Mouse { ... } initializers also omit last_abs.

For #962, a single shared last_abs can produce a large delta when two devices report alternately. Raw Input absolute positions are normalized over the primary screen or virtual desktop, so converting to pixels and keeping a separate baseline per device would address both cases.

OpenAI Codex (GPT-6.2 Sol) assisted with verification.

@pvfreis pvfreis mentioned this pull request Nov 24, 2026
@throny

throny commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Two contributors checked independently and found that #1066 #1522 solves the same problem (for #963) in a different way: #1607, group D66. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.

This is a hint from the community triage in #1607, not a maintainer decision.

AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.

@JJAutoCompare

Copy link
Copy Markdown

PR #1059 verification

KBM changes mouse velocity smoothing after long input gaps and adds absolute mouse handling. The PR diff also changes UNC game-root canonicalization in crates/xcl/src/vfs.rs.

  • PR head fetched from origin (refs/pull/1059/head): 54d51d71de6d3790b464ff3357785814cfd29279
  • Fetched origin/main: aaa093657bd96a146c05c0c1a9b61149fe761453
  • git merge-tree --write-tree origin/main HEAD exited 0 and returned tree 3d0cfa8c88979de8a7b3f03e57b505b583805fc9. Build and test commands used the clean, detached PR head.

Tested

  • STOR-WINLAB, Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB (driver 32.0.101.9175, wave range 8–32, DoublePrecisionFloatShaderOps=0). Rust rustc 1.100.0 (0ef1bc386 2026-11-09). Debug build and test profiles with debug info and incremental compilation disabled. Configured DXC/DXIL 1.9.2609.5.
  • cargo build --workspace and cargo test --workspace --no-run both exited 101.
  • cargo test -p xcl --lib hle::kbm::tests -- --show-output exited 101 before running any tests.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output exited 101 after acquiring the Arc A770 test lock. The lock was released. Full output is in L:\XclTooling\neon-slot-2\tmp\pr1059-suite.log.
  • All four commands stopped on an unexpected closing delimiter at crates/xcl/src/hle/kbm.rs:661. The diff adds a standalone closing brace at line 618 just before focus_loss_resets_mouse_velocity_and_wheel_state.
  • Zero tests executed. Cargo emitted no passed, failed, or ignored totals and no SKIPPED lines.

Not tested

  • Runtime and GPU behavior, interactive focus regain, absolute mouse input, UNC game-root canonicalization, and retail-title smoke comparisons on main and the PR head. Compilation blocked test execution.

AI use

  • T3 Code / Codex (gpt-6.2-sol) ran the build and test commands and drafted this report. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified the compiler error in pr1059-suite.log and published this report.

@winne42

winne42 commented Nov 25, 2026

Copy link
Copy Markdown

At head 733f42b this PR does not compile, not even the library (cargo check -p xcl --target x86_64-pc-windows-gnu):

error: unexpected closing delimiter: `}`
   --> crates/xcl/src/hle/kbm.rs:661:1

There is an extra } after the new mouse_reset_clears_last_abs test, which closes mod tests early. Once that is fixed, the Mouse { … } literals in on_message, apply and focus_loss_resets_mouse_velocity_and_wheel_state still lack the new last_abs field.

Checked on Linux, Wine 10.0, Rust 1.98.1 (x86_64-pc-windows-gnu), as part of the D66 check on #1607. Written with Claude Code (Claude Opus 5.5).

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • Does not compile: error: unexpected closing delimiter: '}' at crates/xcl/src/hle/kbm.rs:661 (extra } after the tests module). Fails on the PR head itself, not a merge artifact.

— Devin

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.

6 participants