Skip missing DXGI present counts in frame generation timing #14

Open
github-bot wants to merge 2 commits from github-bot/gh-14 into beta AGit
Owner

@⁠HandshakeHackin on GitHub · 2026-11-25 16:21 UTC · original
HandshakeHackin:fix/missing-present-count → beta · +38 −12 · 1 files · 2 commits · open

GetLastPresentCount().ok() can yield None. Converting that to zero makes wrapping_sub treat a failed query as a real counter wrap. The next successful query can then produce another inflated sample. Keep the previous valid baseline through missing queries. The real frame ID still advances on every present.

In an isolated harness compiled from the original and patched Rust function, cumulative readings [100, None, 104] spaced ~1.05 s apart produced ~4.09 billion and 99.0 presented FPS before the patch. Afterward they produced one 1.9 FPS sample over the two valid readings. Also checked an initially missing reading, a genuine u32 wrap, and valid zero counts.

Windows target compile check passed: cargo check --locked -p victory-gpu --tests --target x86_64-pc-windows-msvc --features blake3/pure. No hardware run.

The GPU crate now includes a fixed-clock regression at d184745. It covers an initially missing query, a sub-second reading, a second missing query, a genuine wrap to zero and consecutive valid zeros. All three frame-generation module tests passed on native Windows. Restoring the old missing-as-zero behavior made the regression report 4,294,967,292 presented FPS on the first interval. Windows test and negative control.

**@⁠HandshakeHackin** on GitHub · 2026-11-25 16:21 UTC · [original](https://github.com/PastiiJay/klbf-lab/pull/14) `HandshakeHackin:fix/missing-present-count` → `beta` · +38 −12 · 1 files · 2 commits · open `GetLastPresentCount().ok()` can yield `None`. Converting that to zero makes `wrapping_sub` treat a failed query as a real counter wrap. The next successful query can then produce another inflated sample. Keep the previous valid baseline through missing queries. The real frame ID still advances on every present. In an isolated harness compiled from the original and patched Rust function, cumulative readings `[100, None, 104]` spaced ~1.05 s apart produced ~4.09 billion and 99.0 presented FPS before the patch. Afterward they produced one 1.9 FPS sample over the two valid readings. Also checked an initially missing reading, a genuine u32 wrap, and valid zero counts. Windows target compile check passed: `cargo check --locked -p victory-gpu --tests --target x86_64-pc-windows-msvc --features blake3/pure`. No hardware run. The GPU crate now includes a fixed-clock regression at `d184745`. It covers an initially missing query, a sub-second reading, a second missing query, a genuine wrap to zero and consecutive valid zeros. All three frame-generation module tests passed on native Windows. Restoring the old missing-as-zero behavior made the regression report 4,294,967,292 presented FPS on the first interval. [Windows test and negative control](https://github.com/HandshakeHackin/klbf-lab/actions/runs/45812871826).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:51:49 +00:00
Author
Owner

@⁠PastiiJay on GitHub · 2026-11-25 17:02 UTC · original

Thanks a lot @⁠HandshakeHackin! Noted. I'll test it on the RX 9070 XT in the next test build and report back here.

**@⁠PastiiJay** on GitHub · 2026-11-25 17:02 UTC · [original](https://github.com/PastiiJay/klbf-lab/pull/14#issuecomment-7168912694) Thanks a lot @⁠HandshakeHackin! Noted. I'll test it on the RX 9070 XT in the next test build and report back here.
Author
Owner

@⁠PastiiJay on GitHub · 2026-11-26 11:49 UTC · original

Thanks for adding the deterministic clock, that makes the missing-count case testable without real frames. We will merge it with the next beta batch; a short line in the description on what the test covers would be handy.

**@⁠PastiiJay** on GitHub · 2026-11-26 11:49 UTC · [original](https://github.com/PastiiJay/klbf-lab/pull/14#issuecomment-7191216095) Thanks for adding the deterministic clock, that makes the missing-count case testable without real frames. We will merge it with the next beta batch; a short line in the description on what the test covers would be handy.
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/14/head:github-bot/gh-14'
git switch 'github-bot/gh-14'

Merge

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