D3D12.X: adjust frame interval tolerances for 60 Hz, 15 Hz, and NTSC (#103) #1362

Open
slopgobblercobbler wants to merge 1 commit from upstream-pr/1372 into main
slopgobblercobbler commented 2026-11-24 15:20:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by slopgobblercobbler on 2026-11-24T15:20:30Z.


Addresses #103 Item 4 (Frame pacing interval validation tolerances):
In crates/xcl/src/hle/d3d12x/frame.rs, interval_valid previously used narrow tolerance spans that rejected common frame pacing intervals:

  • near(16667, 16) rejected 16666 µs (1_000_000 / 60).
  • near(66667, 67) rejected 66666 µs (1_000_000 / 15).
  • near(50000, 49) rejected NTSC 19.98 Hz (50050 µs) by 1 µs.

What is in it

  • crates/xcl/src/hle/d3d12x/frame.rs:
    • Adjusted near() tolerance spans: 16667 µs span expanded to 17 µs (accepts 16666 µs, rounding down to 16650 µs, and NTSC 59.94 Hz up to 16684 µs), 50000 µs span to 50 µs (accepts 50050 µs), and 66667 µs span to 68 µs (accepts 66666 µs and 14.985 Hz).
    • Preserves strict rejection of random jitter, zero intervals, and unadvertised high refresh rates.
    • Unit tests: console_intervals_accept_ntsc_and_rounding_and_reject_invalid_jitter covering 120, 60, 40, 30, 20, 15 Hz, NTSC variations, and jitter bounds.

Tested

  • cargo test -p xcl -- frame (10 passed, 0 failed).
  • Full workspace test suite: cargo test --workspace (707 passed, 0 failed).
  • Windows 11 x64, MSVC toolchain, rebased onto upstream/main (930e8b4).

Not tested

  • Variable Refresh Rate (G-Sync/FreeSync) displays.

AI use

  • Developed with Antigravity swarm coordinator & dedicated author/verifier agents (author-frame-timing, verify-frame-timing). Verified and reviewed independently.
<!-- greyfinch-sync:ivall/xcl:issue:5475013970 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1372). Originally posted by [slopgobblercobbler](https://github.com/slopgobblercobbler) on 2026-11-24T15:20:30Z. --- Addresses #103 Item 4 (Frame pacing interval validation tolerances): In `crates/xcl/src/hle/d3d12x/frame.rs`, `interval_valid` previously used narrow tolerance spans that rejected common frame pacing intervals: - `near(16667, 16)` rejected `16666 µs` (`1_000_000 / 60`). - `near(66667, 67)` rejected `66666 µs` (`1_000_000 / 15`). - `near(50000, 49)` rejected NTSC 19.98 Hz (`50050 µs`) by 1 µs. **What is in it** - `crates/xcl/src/hle/d3d12x/frame.rs`: - Adjusted `near()` tolerance spans: 16667 µs span expanded to 17 µs (accepts 16666 µs, rounding down to 16650 µs, and NTSC 59.94 Hz up to 16684 µs), 50000 µs span to 50 µs (accepts 50050 µs), and 66667 µs span to 68 µs (accepts 66666 µs and 14.985 Hz). - Preserves strict rejection of random jitter, zero intervals, and unadvertised high refresh rates. - Unit tests: `console_intervals_accept_ntsc_and_rounding_and_reject_invalid_jitter` covering 120, 60, 40, 30, 20, 15 Hz, NTSC variations, and jitter bounds. **Tested** - `cargo test -p xcl -- frame` (10 passed, 0 failed). - Full workspace test suite: `cargo test --workspace` (707 passed, 0 failed). - Windows 11 x64, MSVC toolchain, rebased onto `upstream/main` (`930e8b4`). **Not tested** - Variable Refresh Rate (G-Sync/FreeSync) displays. **AI use** - Developed with Antigravity swarm coordinator & dedicated author/verifier agents (`author-frame-timing`, `verify-frame-timing`). Verified and reviewed independently.
futurepro62 commented 2026-11-24 16:07:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T15:24:26Z.


Full-suite run, since this PR has no test report yet. Tested exact head 5fab29a (on its base 930e8b4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: console_intervals_accept_ntsc_and_rounding_and_reject_invalid_jitter.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored, no skips.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7135972477 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1372#issuecomment-7135972477). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T15:24:26Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `5fab29a` (on its base `930e8b4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **752 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `console_intervals_accept_ntsc_and_rounding_and_reject_invalid_jitter`. - Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **752 passed, 0 failed, 41 ignored**, no skips. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
DavidM1911 commented 2026-11-24 17:06:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T16:41:52Z.


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

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored.

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7138067995 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1372#issuecomment-7138067995). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T16:41:52Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~21 ignored. Thanks!
Toons29 commented 2026-11-25 04:10:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T03:26:25Z.


Regression run of 5fab29aa on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: 5fab29aa94327e22c3e32d99f0ceb42e6ee527e5
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1631 (PresentX 1631)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14815 MB

Against the limits in CONTRIBUTING.md: 101 % of main's frames, 100 % 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.

<!-- greyfinch-sync:ivall/xcl:comment:7151915884 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1372#issuecomment-7151915884). Originally posted by [Toons29](https://github.com/Toons29) on 2026-11-25T03:26:25Z. --- Regression run of `5fab29aa` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `4178e888`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` ``` xcl-smoke v1 commit: 5fab29aa94327e22c3e32d99f0ceb42e6ee527e5 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1631 (PresentX 1631) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14815 MB ``` Against the limits in CONTRIBUTING.md: 101 % of `main`'s frames, 100 % 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.
github-actions[bot] commented 2026-11-28 08:01:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T08:01:45Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7236314866 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1372#issuecomment-7236314866). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T08:01:45Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
JJAutoCompare commented 2026-11-28 08:38:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-28T08:38:28Z.


Tested

Exact 5fab29aa94327e22c3e32d99f0ceb42e6ee527e5 on Windows 11 x64 build 26200.9974, Ryzen 7 3800X, Rust 1.100.1 MSVC debug. I verified the 221 original Git blobs, reconstructed the single private test insertion in memory, and reran the pinned libtest without rebuilding.

I ran <libtest.exe> <filter> --exact --nocapture --test-threads=1 separately for two CPU tests under hle::d3d12x::frame::tests.

  • setter_accepts_interval_edges_and_retains_state_on_rejection verified that XCL's SetFrameIntervalX returned S_FALSE for 16,650, 16,684, 49,950, 50,050, 66,599 and 66,735 µs, advancing the generation once each time. The adjacent values 16,649, 16,685, 49,949, 50,051, 66,598 and 66,736 µs returned E_INVALIDARG and preserved both the interval and generation. A zero-length reset returned S_FALSE and left the snapshot at (0, 7).
  • The stock predicate control console_intervals_accept_ntsc_and_rounding_and_reject_invalid_jitter passed.

2 passed, 0 failed, 0 ignored, 0 runtime skips. Both native processes exited 0, with 729 tests filtered out per invocation.

Not tested

Xbox hardware behavior, clock-thread timing, display rates, the base revision, retail smoke, and the full suite. Xbox support for 50,050 µs remains unconfirmed per the maintainer. Issue #103

AI use

T3 Code through the Codex harness (gpt-6.2-sol) verified the source and executable, reran the tests, and wrote this report.

<!-- greyfinch-sync:ivall/xcl:comment:7236713422 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1372#issuecomment-7236713422). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-28T08:38:28Z. --- **Tested** Exact `5fab29aa94327e22c3e32d99f0ceb42e6ee527e5` on Windows 11 x64 build 26200.9974, Ryzen 7 3800X, Rust 1.100.1 MSVC debug. I verified the 221 original Git blobs, reconstructed the single private test insertion in memory, and reran the pinned libtest without rebuilding. I ran `<libtest.exe> <filter> --exact --nocapture --test-threads=1` separately for two CPU tests under `hle::d3d12x::frame::tests`. - `setter_accepts_interval_edges_and_retains_state_on_rejection` verified that XCL's `SetFrameIntervalX` returned `S_FALSE` for 16,650, 16,684, 49,950, 50,050, 66,599 and 66,735 µs, advancing the generation once each time. The adjacent values 16,649, 16,685, 49,949, 50,051, 66,598 and 66,736 µs returned `E_INVALIDARG` and preserved both the interval and generation. A zero-length reset returned `S_FALSE` and left the snapshot at `(0, 7)`. - The stock predicate control `console_intervals_accept_ntsc_and_rounding_and_reject_invalid_jitter` passed. **2 passed, 0 failed, 0 ignored, 0 runtime skips.** Both native processes exited 0, with 729 tests filtered out per invocation. **Not tested** Xbox hardware behavior, clock-thread timing, display rates, the base revision, retail smoke, and the full suite. Xbox support for 50,050 µs remains unconfirmed per the maintainer. [Issue #103](https://github.com/xcl-dev/xcl/issues/103#issuecomment-7099992212) **AI use** T3 Code through the Codex harness (`gpt-6.2-sol`) verified the source and executable, reran the tests, and wrote this report.
Foniass commented 2026-12-01 05:33:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:33:03Z.


Triage (#1607) – head 5fab29a

No open or merged PR changes these tolerances (#317 and #786 are other #103 items).
Main already accepts 16683 (NTSC 59.94 Hz), 33367 and 66733/66734, so the change only adds 16650/16684, 49950/50050 and 66599/66735. The description gives no title or measurement that passes those lengths. Main has since added near(41667, 42) to the same line, so the branch conflicts.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7301888153 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1372#issuecomment-7301888153). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T05:33:03Z. --- **Triage (#1607)** – head 5fab29a No open or merged PR changes these tolerances (#317 and #786 are other #103 items). Main already accepts 16683 (NTSC 59.94 Hz), 33367 and 66733/66734, so the change only adds 16650/16684, 49950/50050 and 66599/66735. The description gives no title or measurement that passes those lengths. Main has since added `near(41667, 42)` to the same line, so the branch conflicts. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1372:upstream-pr/1372'
git switch 'upstream-pr/1372'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/1372'
git switch 'upstream-pr/1372'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1372'
git switch 'upstream-pr/1372'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1372'
git switch 'main'
git merge --squash 'upstream-pr/1372'
git switch 'main'
git merge --ff-only 'upstream-pr/1372'
git switch 'main'
git merge 'upstream-pr/1372'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!1362
No description provided.