Menu: use an exclusive RAII temp manifest for the activation context #2273
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2283"
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 Decodere on 2026-11-25T12:23:50Z.
What is in it
Fixes #2272 by hardening and cleaning up the temporary Common Controls 6 activation-context manifest created in
crates/xcl/src/main.rs:TempManifest): Replacesstd::fs::writeto the fixed path%TEMP%\xcl-menu.manifestwithTempManifest::create_in, which generates uniquexcl-menu-<pid>-<seq>.manifestpaths and creates them exclusively viaOpenOptions::new().write(true).create_new(true).share_mode(0).custom_flags(FILE_FLAG_OPEN_REPARSE_POINT). Colliding files, hard links, symlinks, directories, or junctions (AlreadyExists, orPermissionDeniedwhensymlink_metadata().is_ok()) are skipped without truncating or overwriting existing targets, write/flush errors close the file handle before removing the partial file, and the handle is flushed and closed before callingCreateActCtxWwith lossless UTF-16 encoding (OsStrExt::encode_wide).activate_manifest_indropsTempManifestimmediately afterCreateActCtxWreturns (on both success and failure), so no temporary manifest file stays in%TEMP%while the menu is open or after teardown.activate_manifest_incallsReleaseActCtx(h)ifActivateActCtxfails (fixing the handle leak), andUirecordscom_init = CoInitializeEx(...) >= 0soUi::droponly callsCoUninitialize()whenCoInitializeExactually succeeded (avoiding an unbalancedCoUninitialize()afterRPC_E_CHANGED_MODE).Tested
621.40, wave32), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Rust1.100.1(stable-x86_64-pc-windows-msvc), DXC1.9.2602.17.origin/main(1c8b551475e1e7bfe48f94448492a4c3544a2e0f) at139a2ef6e3e0bac56a535c069005cc7d7bd17a60:cargo build --workspace(debug): ok.cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture(43 targets): 2911 passed, 0 failed, 51 ignored (+2 new tests vsorigin/main1c8b5514).unittests src/main.rs: 3/3 passed (console_tests::the_saved_console_is_the_default_of_the_menu,tests::temp_manifest_skips_collisions_and_removes_on_drop,tests::live_actctx_activates_after_manifest_removal_and_ui_guards_com).SKIPPEDlines (28 total, identical toorigin/main1c8b5514): 22no wave64(8 direct + 14lower_dxilsubcases), 2no d3d12SDKLayers.dll, 1no D3D12 debug layer, 2no heap windows, 1cannot disable the driver cache (Windows Developer Mode is required).cargo build --release -p xcl: ok.Ui::enter()overwrote a pre-existingxcl-menu.manifestsentinel).Regression run
Paired 60 s retail title runs with
scripts/smoke.ps1(release build, same title29640639, clean working tree) onorigin/main(1c8b551475e1e7bfe48f94448492a4c3544a2e0f) and this PR (139a2ef6e3e0bac56a535c069005cc7d7bd17a60):Baseline (
origin/main):PR head (
139a2ef6):Not tested
FILE_FLAG_OPEN_REPARSE_POINTprevents reparse-point traversal).d3d12SDKLayers.dllis not installed on this host).AI use
Antigravity (Gemini 4 Neon) wrote the fix, tests, rebase onto
main, and this PR description; all builds, tests, and paired retail smoke runs were executed locally on the hardware listed above.Fixes #2272
upstream-sync referenced this pull request2026-11-25 14:08:43 +00:00
Imported from ivall/xcl. Originally posted by jennydeth on 2026-11-25T14:33:08Z.
NVIDIA run.
Setup: RTX 3060 12 GB (32-lane waves, driver 32.0.16.2101), Ryzen 5 5600X, 32 GB RAM, Windows 11 build 26300, Rust 1.100.0, DXC 1.9.2609.5, debug build. Head
0ec32af.Result: cargo test --workspace -- --test-threads=4: 1252 passed, 0 failed, 46 ignored. SKIPPED: 18 GPU tests for no wave64 (expected on this card) and the usual per-lane / heap-window / driver-cache skips.
Not tested: opening xcl.exe from Explorer and using the menu by hand.
AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.
Imported from ivall/xcl. Originally posted by S1m0ne1997 on 2026-11-25T15:07:55Z.
Test report for
0ec32afd07a6ce5de24259703cb2e10f983aa372(this PR's head), for #1607.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09)x86_64-pc-windows-msvc, debug.cargo build --workspace, thencargo test --workspace -- --test-threads=4at the head: 1252 passed, 0 failed, 46 ignored.a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu(no wave64),coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu(no wave64),cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu(no wave64),the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu(no wave64),a_per_lane_2d_or_3d_group_runs_on_the_gpu(no wave64),const_and_null_mask_operands_agree_with_hlsl_on_the_gpu(const_mask, wave64: no wave64),f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's)); f16 arithmetic, wave64: no wave64),f32_programs_on_the_gpu(f32 arithmetic, wave64: no wave64; f32 compares, wave64: no wave64),f64_programs_on_the_gpu(f64, wave64: no wave64),integer_programs_on_the_gpu(integer arithmetic, wave64: no wave64; integer carries, wave64: no wave64),mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu(mask_ff0_flbit, wave64: no wave64),gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),pso_measurement_compiles_an_exact_synthetic_record(cannot disable the driver cache (Windows Developer Mode is required): L'applicazione ha richiesto un'operazione che dipende da un componente SDK mancante o non corrispondente. (0x887A002D)),test_title_draws_with_a_root_signature_under_the_debug_layer(no d3d12SDKLayers.dll),uploads_start_from_each_subresources_state(no D3D12 debug layer (L'applicazione ha richiesto un'operazione che dipende da un componente SDK mancante o non corrispondente. (0x887A002D))).Regression run (retail title,
scripts/smoke.ps1 -Seconds 60, release;mainbuilt from the commit in its block, this PR from its head with no changes tocrates/, both run with thescripts/smoke.ps1ofmain, which hashes the name of the game folder)main:
this PR:
Not tested
AI use: Claude Code with Claude Opus 5.5 ran the build, the suite and the regression run and wrote this report at my request.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T17:17:31Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T18:28:40Z.
Code review on
0ec32af(crates/xcl/src/menu.rs): clean RAIITempManifestwithcreate_new(true)atomic/process+counter naming and drop cleanup, and CI is green.Remaining before merge: An AMD verification pass on
0ec32af(RTX 4090 + RTX 3060 Ti passed).Imported from ivall/xcl. Originally posted by throny on 2026-11-28T16:26:39Z.
merge-check claim
head:
0ec32afd07Imported from ivall/xcl. Originally posted by throny on 2026-11-28T16:48:36Z.
merge-check
base:
db3921dchead:
0ec32afd07merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2147 passed, 0 failed, 48 ignored (26 SKIPPED lines). Base alone at
db3921dc: 2145 passed, 0 failed, 48 ignored.review: no blocking finding; all hunks read. The manifest file is written, flushed and closed before the activation context is created from it, and it is deleted on every path. Two things main does wrong are fixed on the way: an activation context that could not be activated was leaked, and COM was uninitialised even when its initialisation had been refused. When the temp folder cannot be written the menu falls back to the old look, as on main. Minor: the fixed-name manifest earlier versions left in the temp folder is not cleaned up. The AMD run asked for in the thread is still open, but this code has no GPU path.
performance: none.
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:44:34Z.
Triage (#1607) – head
0ec32afNo open or merged PR makes the same change (issue #2272). Main's
Ui::enterstill writesxcl-menu.manifestto a fixed name in %TEMP% and never deletes it. The newTempManifestcreates the file withcreate_newandFILE_FLAG_OPEN_REPARSE_POINT, deletes it afterCreateActCtxWreturns, and callsCoUninitializeonly whenCoInitializeExsucceeded. That fixes the existing unbalanced call afterRPC_E_CHANGED_MODE, but it is a second change in a PR about the manifest. The PR conflicts with main.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-02T14:40:01Z.
Follow-up review (head
139a2ef6, since0ec32af, diff read, not a merge-check):main(the own change is the same apart from context and commit-message wrapping).New: none.
AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-12-02T17:13:07Z.
Linux / AMD RDNA4 (RADV, Wine + vkd3d-proton): full test suite on
139a2efMerged onto
main5eaadb54(clean merge) and compared withmainrun twice on the same machine.Setup
v3.1-83-gcae8353edand DXVKdxgi.dllfrom GE-Proton11-16, DXC 1.9.2609.5x86_64-pc-windows-msvcwithcargo-xwin; test binaries run under WineTested:
cargo xwin test --workspace --target x86_64-pc-windows-msvc --no-fail-fast -- --test-threads=4 --skip <31 tests>main5eaadb54main: none.temp_manifest_skips_collisions_and_removes_on_drop,live_actctx_activates_after_manifest_removal_and_ui_guards_com).About the failures on
mainand the 31 skipped tests (same for every PR in this batch)main's 177 failures under Wine come from #175: once a test has set up the real device, vkd3d-proton refuses the command allocators XCL adopts (d3d12_command_list_Reset: Invalid command allocator), and later tests getE_INVALIDARG(0x80070057). Running vkd3d-proton master with its vtable check taken out,hle::d3d12x::sparse::testsgoes from 106 passed / 38 failed to 144 / 0.std::terminate()(Cannot reliably convert LLVM pointer type, we cannot differentiate between Function and Private), which kills the whole test binary. They are the split-wave64, dispatch-chain and bridged-mask GPU tests,gpu_compute_mode_dispatch_abi,gpu_compute_thread_limits_leave_the_lanes_past_them_out, the twogpu_mesh_mode_*tests, andconsole_wave64_compute_through_the_pso_hook_dispatch_and_read_back, plusserialize_root_signature_strips_console_flags_and_preserves_pc_flags, whose null descriptor vkd3d-proton dereferences. The dxil-spirv ones crash the same way with vkd3d-proton master (f8c1cae8, dxil-spirv93ab44c5).mainwas run twice: same counts, same failure set.SKIPPEDlines (same asmain): no heap windows (2), no D3D12 debug layer (2-3), driver cache control not implemented in vkd3d-proton (1).Not tested: Windows, NVIDIA, a retail title /
scripts/smoke.ps1, a review of the diff. This is a test report, not amerge-check.AI use: omp (Claude Opus 5.5) merged, built and ran the suites on this machine, compared the results with
main, and drafted this report. The user asked for it to be posted.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.