Menu: use an exclusive RAII temp manifest for the activation context #2283
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2283
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@Decodere on GitHub · 2026-11-25 12:23 UTC · original
Decodere:fix-2272-menu-temp-manifest→main· +220 −28 · 1 files · 1 commits · openWhat 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
cargo test --release -p xcl --bin xcl -- --test-threads=1 --nocapture): confirmed unmodifiedUi::enter()overwrote a pre-existingxcl-menu.manifestsentinel (FAILED,0 passed; 1 failed).cargo test --release -p xcl --bin xcl -- --nocapture:2 passed, 0 failed, 0 ignored:temp_manifest_skips_collisions_and_removes_on_drop: pre-populatesxcl-menu.manifest, a hard link tovictim.txtat candidate0, and a directory at candidate1; verifiesTempManifestskips both collisions without touchingxcl-menu.manifestorvictim.txt, writes exactMENU_MANIFESTto candidate2, deletes it onDrop, and returnsErrfor a non-existent directory.live_actctx_activates_after_manifest_removal_and_ui_guards_com: verifies liveCreateActCtxW-> dropTempManifest(confirming file deleted before activation) ->ActivateActCtx+GetCurrentActCtxsucceeds,Ui::enter_inon a fresh STA thread initializes COM and leaves zero extra temp files while active and after drop, andUi::enter_inon an already-MTA thread observesRPC_E_CHANGED_MODE(com_init == false) and drops cleanly.cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocaptureon NVIDIA GeForce RTX 4060):23test binaries,1252 passed, 0 failed, 46 ignored(27pre-existing hardware/debug-layerSKIPPED:20no wave64on 32-lane GPU,3wave32 per-lanerefused,2missing D3D12 debug layer,1driver cache toggle,1no heap windows;0skipped inmain.rs).Regression run
Paired 60 s
scripts/smoke.ps1runs on the same RTX 4060 host againstorigin/main(1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6) and PR head (0ec32afd07a6ce5de24259703cb2e10f983aa372):Baseline (
origin/main):PR head:
Not tested
FILE_FLAG_OPEN_REPARSE_POINTprevents reparse-point traversal).d3d12SDKLayers.dllis not installed on this host).AI use
Implemented and verified with Google Antigravity (Gemini 4 Neon).
Fixes #2272
@jennydeth on GitHub · 2026-11-25 14:33 UTC · original
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.
@S1m0ne1997 on GitHub · 2026-11-25 15:07 UTC · original
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.
@DavidM1911 on GitHub · 2026-11-25 17:17 UTC · original
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!
@raylitebull on GitHub · 2026-11-25 18:28 UTC · original
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).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.