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

Open
github-bot wants to merge 1 commit from github-bot/gh-1372 into main AGit
Owner

@⁠slopgobblercobbler on GitHub · 2026-11-24 15:20 UTC · original
slopgobblercobbler:fix/frame-interval-tolerances → main · +53 −2 · 1 files · 1 commits · open

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.
**@⁠slopgobblercobbler** on GitHub · 2026-11-24 15:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/1372) `slopgobblercobbler:fix/frame-interval-tolerances` → `main` · +53 −2 · 1 files · 1 commits · open 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:52:15 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 15:24 UTC · original · edited 2026-11-24 15:27 UTC

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.
**@⁠futurepro62** on GitHub · 2026-11-24 15:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/1372#issuecomment-7135972477) · edited 2026-11-24 15:27 UTC 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.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 16:41 UTC · original

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

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

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 16:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/1372#issuecomment-7138067995) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~21 ignored. Thanks!
Author
Owner

@⁠Toons29 on GitHub · 2026-11-25 03:26 UTC · original

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.

**@⁠Toons29** on GitHub · 2026-11-25 03:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/1372#issuecomment-7151915884) 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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1372/head:github-bot/gh-1372'
git switch 'github-bot/gh-1372'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1372'
git switch 'github-bot/gh-1372'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1372'
git switch 'github-bot/gh-1372'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1372'
git switch 'main'
git merge --squash 'github-bot/gh-1372'
git switch 'main'
git merge --ff-only 'github-bot/gh-1372'
git switch 'main'
git merge 'github-bot/gh-1372'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.