Guard deferred texture uploads and add hitch diagnostics #15

Manually merged
github merged 45 commits from github-bot/gh-15 into main 2026-12-04 02:41:36 +00:00 AGit
Owner

@⁠SovietBearz0r on GitHub · 2026-12-02 16:35 UTC · original
SovietBearz0r:belobug-texture-diagnostics → main · +172 −16 · 5 files · 1 commits · merged 2026-12-04 02:40 UTC

Summary

Adapt four changes from the local VIctory-Belobug-AMD source snapshot. This PR is based directly on main and is independent of #14.

  • First texture upload: claim an upload only after a refresh prepares the staging image and any GPU copies. A dirty flag alone can come from a level change while pooled staging is still untouched.
  • Partial reads: an all-zero partial read leaves the previous staging hash intact. If no image has been staged, request a retry through the existing bounded short-read queue.
  • Opt-in hitch diagnostics: with VICTORY_PANEL_LOG=1 and victory_gpu::perf=info in the log filter, F4 records a timestamped PLAYER_MARK, and gaps of at least 150 ms between successful presents produce SLOW_PRESENT. Both work with the HUD hidden. F4 avoids the existing F8 lighting shortcut.
  • Shader test runner: scripts/shader-diff.ps1 finds the installed GDK and Windows SDK compilers, runs the existing differential tests serially, and saves output under target/diagnostics. It supports -Warp, -Filter, and -List.

The local Belobug snapshot did not include Git metadata, so the exact source commit IDs and authors could not be verified.

Validation

  • Standalone PR branch: Windows diagnostic cargo check and staged asset policy.
  • Local integration build with the same texture logic: both upload regression tests passed, including a deferred first read and a three-buffer video ring. The shader runner listed all four tests, detected both compilers, and passed the floating-point differential test on WARP.
  • RX 9070 XT, 3840×2160 output, 60 FPS cap: the Prologue run finished normally on the local integration build. SLOW_PRESENT recorded two startup hitches and a 1.31 s gap around entry into the 3D scene, where the longest late list was 1.14 s and no pipelines were being created. No physical F4 keypress was verified.
  • In the 4,000–5,999 draws/frame bucket, median FPS was 27.1 vs. 26.5 on an earlier run, and median submit time was 20.0 vs. 21.1 ms. The runs used different routes and builds, so this is not a controlled FPS comparison. The logs do not establish whether visible texture pop-in improved.

No game assets, captures, or runtime logs are included.

**@⁠SovietBearz0r** on GitHub · 2026-12-02 16:35 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/15) `SovietBearz0r:belobug-texture-diagnostics` → `main` · +172 −16 · 5 files · 1 commits · merged 2026-12-04 02:40 UTC ## Summary Adapt four changes from the local VIctory-Belobug-AMD source snapshot. This PR is based directly on `main` and is independent of #14. - **First texture upload:** claim an upload only after a refresh prepares the staging image and any GPU copies. A dirty flag alone can come from a level change while pooled staging is still untouched. - **Partial reads:** an all-zero partial read leaves the previous staging hash intact. If no image has been staged, request a retry through the existing bounded short-read queue. - **Opt-in hitch diagnostics:** with `VICTORY_PANEL_LOG=1` and `victory_gpu::perf=info` in the log filter, F4 records a timestamped `PLAYER_MARK`, and gaps of at least 150 ms between successful presents produce `SLOW_PRESENT`. Both work with the HUD hidden. F4 avoids the existing F8 lighting shortcut. - **Shader test runner:** `scripts/shader-diff.ps1` finds the installed GDK and Windows SDK compilers, runs the existing differential tests serially, and saves output under `target/diagnostics`. It supports `-Warp`, `-Filter`, and `-List`. The local Belobug snapshot did not include Git metadata, so the exact source commit IDs and authors could not be verified. ## Validation - Standalone PR branch: Windows diagnostic `cargo check` and staged asset policy. - Local integration build with the same texture logic: both upload regression tests passed, including a deferred first read and a three-buffer video ring. The shader runner listed all four tests, detected both compilers, and passed the floating-point differential test on WARP. - RX 9070 XT, 3840×2160 output, 60 FPS cap: the Prologue run finished normally on the local integration build. `SLOW_PRESENT` recorded two startup hitches and a 1.31 s gap around entry into the 3D scene, where the longest late list was 1.14 s and no pipelines were being created. No physical F4 keypress was verified. - In the 4,000–5,999 draws/frame bucket, median FPS was 27.1 vs. 26.5 on an earlier run, and median submit time was 20.0 vs. 21.1 ms. The runs used different routes and builds, so this is not a controlled FPS comparison. The logs do not establish whether visible texture pop-in improved. No game assets, captures, or runtime logs are included.
Adapt the staging guard, partial-read retry, present-gap logging, player marker, and shader test runner from the local VIctory-Belobug-AMD source snapshot. Keep the diagnostics opt-in and use F4 to avoid the existing F8 lighting shortcut.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 18:16:57 +00:00
Author
Owner

@⁠cloph-dsp on GitHub · 2026-12-02 17:57 UTC · original

Verified: claim_upload's new staged gate behaves as the commit message says, on synthetic inputs only.

This is an extension of a test that already exists on the base: texture::prelude_upload_tests::first_upload_clean_skip_and_immediate_same_frame_reupload is present at base 925ac0a3 (only two-argument claim_upload then) and the PR extends it with the prepared-image flag — a level change that marks staging dirty before an image exists now claims nothing, and the frame-1/2/3 sequence still resolves to Some(true), None, None, Some(false).

  • base: 925ac0a32f6a05c31373a2843bc555f57afba4f7, head: e0e5d5e43a7f0eb47b1646fc9967f523dd012699
  • git diff --check "925ac0a3..e0e5d5e4" → exit 0
  • cargo test --locked -p victory-gpu --lib -- texture::prelude_upload_tests::first_upload_clean_skip_and_immediate_same_frame_reupload --exact --test-threads=1 --quiet → running 1 test / test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 675 filtered out
  • dedicated CARGO_TARGET_DIR for the worktree; no shared target
  • rustc 1.100.0 (MSVC, no rustup locally; the repo's rust-toolchain.toml pin of 1.98.1 is not applied here)
  • GPU/driver: N/A (CPU-only unit test, no device opened)
  • no game data

Limit worth naming: this covers the pure claim helper only. detile/refresh ordering, the pooled-staging reuse path and the actual CopyTextureRegion recording in a submission are not exercised by the test.

**@⁠cloph-dsp** on GitHub · 2026-12-02 17:57 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/15#issuecomment-7353808661) Verified: `claim_upload`'s new `staged` gate behaves as the commit message says, on synthetic inputs only. This is an **extension of a test that already exists on the base**: `texture::prelude_upload_tests::first_upload_clean_skip_and_immediate_same_frame_reupload` is present at base `925ac0a3` (only two-argument `claim_upload` then) and the PR extends it with the prepared-image flag — a level change that marks staging dirty before an image exists now claims nothing, and the frame-1/2/3 sequence still resolves to `Some(true)`, `None`, `None`, `Some(false)`. - base: `925ac0a32f6a05c31373a2843bc555f57afba4f7`, head: `e0e5d5e43a7f0eb47b1646fc9967f523dd012699` - `git diff --check "925ac0a3..e0e5d5e4"` → exit 0 - `cargo test --locked -p victory-gpu --lib -- texture::prelude_upload_tests::first_upload_clean_skip_and_immediate_same_frame_reupload --exact --test-threads=1 --quiet` → `running 1 test` / `test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 675 filtered out` - dedicated `CARGO_TARGET_DIR` for the worktree; no shared target - rustc 1.100.0 (MSVC, no rustup locally; the repo's `rust-toolchain.toml` pin of 1.98.1 is not applied here) - GPU/driver: N/A (CPU-only unit test, no device opened) - no game data Limit worth naming: this covers the pure claim helper only. `detile`/`refresh` ordering, the pooled-staging reuse path and the actual `CopyTextureRegion` recording in a submission are not exercised by the test.
github-bot force-pushed github-bot/gh-15 from e0e5d5e43a to 9c332a1a7c 2026-12-04 02:41:34 +00:00 Compare
github manually merged commit 77c943367b into main 2026-12-04 02:41:36 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.