D3D12.X: fix use-after-move in device init; KBM: per-device absolute mouse #1512
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1522"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by saurabhbhoir456 on 2026-11-24T17:15:37Z.
What changes and why
Two independent fixes:
D3D12.X: fix use-after-move in device initialization (
crates/xcl/src/hle/d3d12x/real.rs)device.into_raw(), which consumesdevice&deviceis validD3D12.X: silence deprecation warning (
crates/xcl/src/hle/xgameruntime/mod.rs)Atomic::fetch_updaterenamed totry_updatein Rust 1.81XUserCloseHandleto usetry_updateKBM: track absolute mouse position per device (
crates/xcl/src/hle/kbm.rs)last_absfromOption<(i32, i32)>toHashMap<usize, (i32, i32)>keyed by Raw Input device handlereset()now clears the map instead of settingNoneWhat is in it
D3D12.X: fix use-after-move in device init, silence deprecation(real.rs, xgameruntime/mod.rs)KBM: track absolute mouse position per device(kbm.rs)Tested
cargo build --workspace; cargo test --workspace -- --test-threads=4Regression run
scripts/smoke.ps1 -Game <folder>on main and this branch head and paste both xcl-smoke blocks.Not tested
AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by gut0to on 2026-11-24T17:16:56Z.
Review: COMMENTED
AI-assisted review (GPT-6): I verified the missing field against the updated
Mousedefinition and this initializer.Imported from ivall/xcl. Originally posted by pickles976 on 2026-11-24T17:18:11Z.
Review (issue author side): the line fires at device creation with all three decision values — that is the acceptance as written — but it drops the one field the originating evidence needed: the received wave range itself. The failure class behind #1407 (Marvisak/VIctory#1086 row 2) turns on why the decision fired:
range=(32,32)(device genuinely can't wave64),range=(32,64)with a forced split (environment), andrange=unknown → assume split(the fail-safe) are three different worlds for triage, and fromcompute_wave32=truealone they are indistinguishable — which re-creates the "assumed, not logged" gap the issue exists to close. Suggested one-line amendment: append the rawOPTIONS1values orunknownverbatim, e.g.wave mode: range=(32,32) compute_wave32=true graphics_wave32=true split_forced=false. Everything else in the line stays. (Non-blocking scope note: theis_adoptedunaligned-read fix is unrelated to the diagnostics and deserves its own changelog line for whoever bisects alignment bugs.)Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T17:47:58Z.
Two things on this head (
1802d25):b11945f"KBM: fix camera whip on focus regain, add absolute mouse support" changeshle/kbm.rs(+72 / −4) andvfs.rs(+25 / −1), which is #963's area, not #1407's or #1434's. Since the description says nothing here was built, that commit is untested too. It may be better as its own PR.pso.rs. This PR logs the device's wave modes once atinit(). They don't conflict in code, but #1407 asks for one of them.AI use: Claude Code (Claude Opus 5.5) read the diff and wrote this.
Imported from ivall/xcl. Originally posted by gut0to on 2026-11-24T17:16:56Z.
Code review location:
crates/xcl/src/hle/kbm.rs; line 323This and the
Mouseinitializers at lines 451 and 635 omit the requiredlast_absfield. There is also an extra closing brace at line 618 that closesmod testsbefore the existing focus-loss test, leaving the file unbalanced. The PR therefore does not compile. Please initializelast_absin everyMouseliteral and remove the extra brace. AI-assisted review: I checked the struct definition, all three initializers, and the surrounding module braces.[PR #1522] D3D12.X: log wave mode diagnostics, fix unaligned read in is_adoptedto [PR #1522] D3D12.X: fix use-after-move in device init; KBM: per-device absolute mouseImported from ivall/xcl. Originally posted by pickles976 on 2026-11-24T18:21:06Z.
Agree with the split — and sharpening the ask using this repo's own standard: a PR whose description says nothing was built is reviewable as text, but an undeclared +72/−4
kbm.rsfunctional change (camera whip + absolute mouse) rides in under a startup-logging description nobody scrutinized for input behavior. That is the same discipline I applied on #1526 — a PR should carry only what its description defends — and the "not tested" label plus the wrong-area commit means it is untested AND unowned in review terms. The fix is mechanical:b11945fbecomes its own PR with repro notes for the camera-whip symptom (which title, which focus transition) so the input lane can own it. On the #1410 overlap: yes, #1410 (wave64 form per program class,pso.rs) and this PR both build startup-logging on top of #1407's workstream — author merge is fine and preferred here; the one thing I would keep whole is the received-range field amendment from my review, whichever PR ends up carrying the wave line, so #1412'-style triage ("adapter advertised X, we chose Y") stays possible from one log line.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T18:54:19Z.
Test report — RTX 3060 Ti (Windows 11): does not compile, even before merging with
main.cargo test -p xcl --libfails incrates/xcl/src/hle/kbm.rs:There's a stray extra
}right after thereset_clears_last_abstest (~line 618) — themod testsblock gets closed twice. Present in the PR head itself, not a merge artifact.Imported from ivall/xcl. Originally posted by throny on 2026-11-25T00:51:18Z.
Two contributors checked independently and found that #1059 #1066 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.
Imported from ivall/xcl. Originally posted by throny on 2026-11-25T01:01:58Z.
Two contributors checked independently and found that #1139 solves the same problem (for #1130) in a different way: #1607, group D67. 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.
Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T03:33:10Z.
Regression run of
457fc240on the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon4178e888, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 101 % of
main's frames, 99 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; I checked the blocks before posting.upstream-sync referenced this pull request2026-11-25 06:04:27 +00:00
Imported from ivall/xcl. Originally posted by winne42 on 2026-11-25T07:00:27Z.
At head
457fc24, the new testvelocity_update_uses_real_dt_for_rate_clamped_for_smoothingfails:The second step expects about 2500 after a single
update(10, 0, 0.004), but withSMOOTHING = 0.03one 4 ms step moves the velocity only bya = 1 - exp(-0.004 / 0.03) ≈ 0.125of the way (9.6 + 0.125 × 2490 ≈ 320): the expectation does not match the smoothing. The other 9kbmtests pass.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).Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T00:23:12Z.
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main(previous head had a compile error; that is fixed):cargo test -p xcl --lib: 2 real failures, deterministic (also fail--test-threads=1, 1306/2):The VFS UNC canonicalization now returns
Translatedwhere the test expectsGame— likely a real regression from the latest push, unrelated to the KBM change.— Devin
Pull request closed