Frame clock: revalidate clock state before committing ScheduleFrameEventX #1621
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!1621
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1621"
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?
@b3IKK on GitHub · 2026-11-24 18:19 UTC · original
b3IKK:d3d12x/frame-schedule-toctou→main· +60 −22 · 1 files · 1 commits · openschedule_frame_event_xreleased theCLOCKmutex while duplicating ancillary event handles, then committedc.active = trueandk.scheduled = truewithout re-checking whether another thread had stopped the clock viaSetFrameIntervalX(0)in the meantime. That left the clock marked active and scheduled withinterval_us == 0, whereclock_threaddoes not run andWaitFrameEventXhangs indefinitely.This extracts
schedule_invalid()andcommit_schedule(), re-checking validity under theCLOCKlock before mutating state and closing duplicated handles onE_INVALIDARG.What is in it
crates/xcl/src/hle/d3d12x/frame.rs: addschedule_invalid()andcommit_schedule()to revalidate underCLOCKbefore committing inschedule_frame_event_x; add unit testcommit_schedule_rejects_clock_stopped_between_check_and_commit.Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 777 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2no wave64—gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware; 1no heap windows—heap_window_out_of_memory_falls_back_to_the_switch_form)cargo test -p xcl --lib hle::d3d12x::frame::tests: 5 passed, 0 failedRegression run
main:
PR:
Not tested
AI use
frame.rs, wrote the fix and unit test, ran the test suite andscripts/smoke.ps1regression runs, and drafted this PR description.@DavidM1911 on GitHub · 2026-11-24 20:37 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored.Thanks!
@JJAutoCompare on GitHub · 2026-11-25 05:00 UTC · original
XCL PR #1621 focused Windows verification
Tested head
39788e8cbe7d12828b1e54a40112340ac0d6adbain a clean detached checkout. The PR changescrates/xcl/src/hle/d3d12x/frame.rs.Tested
cargo build --workspacesucceeded.cargo test --workspace --no-runcompiled all workspace test executables.cargo test -p xcl --lib hle::d3d12x::frame::tests:: -- --nocaptureran withXCL_ADAPTER=NONE_CPU_ONLY. Parsed frompr1621-focused.log— 5 passed, 0 failed, 0 ignored, 0 SKIPPED, 744 filtered out. All three commands ran outside the Arc mutex.E_INVALIDARG, stays inactive, and leaves the origin unscheduled. With a 16,667 µs interval, scheduling type 0 returnsSTARTED_CLOCK, activates the clock, and schedules the origin.Not tested
Execution was limited to the focused CPU frame-clock tests. The rest of the workspace was compiled only. The full GPU workspace suite and retail-title smoke comparisons were omitted.
AI use
T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr1621-focused.logand published.@afpruivo on GitHub · 2026-11-26 12:18 UTC · original
Tested
39788e8on an RTX 3090, as part of a batch merged ontomainb49be18: no failures, no regression.e15ddb2, #15946ea563b, #162139788e8, #165369f70c1. They touch no common file and merged cleanly ontob49be18(local commit1e3fb07). Check posted in #1607: B21, #1607.cargo test --workspace -- --test-threads=4(debug): 1,439 passed, 0 failed, 47 ignored. 26SKIPPEDGPU tests, mostly no wave64 on this card; they are not coverage.scripts/smoke.ps1, 60 s, retail 1.0.2.1 (title: 3c290c16), release. Peak commit was lower on the batch.mainb49be181e3fb07schedule_invalidnow runs again inside the clock lock incommit_schedule, and the duplicated handles are closed when it refuses. Dropping.max(1)is safe becauseinterval_us == 0is refused first.Not tested: a run that reaches this change on purpose (the smoke title only shows that nothing regresses); AMD.
AI use: Claude Code (Claude Opus 5.5) ran the commands on my machine and drafted this. Checked by me before posting.
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.