gpu(native): log a reason for every dropped draw, and count the skipped ones (#531) #625

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

@⁠AnastasisKon on GitHub · 2026-11-28 15:42 UTC · original
AnastasisKon:vibe/drop-reason-log-1705ac → main · +26 −4 · 1 files · 1 commits · open

Refs #535 — the "make the host log a reason for every draw it drops" item. Claimed on the issue.

What this changes

crates/victory-gpu/src/native/glue.rs only, 26 insertions:

  • make_pipe: when native_stages(key) is None the pipeline was previously refused with no log at all — likely the three reflection/post-pass draws e2945217, 456f02b5, a1f08b8b from #535. It now calls refused_translation, which warns once per pipeline key and counts the refusal by reason in the shader stats.
  • make_host_pipe: the two remaining silent Pipe::Refused returns — a compute pipeline whose stages hold no compute shader, and a guessed graphics pipeline without a vertex stage — now also go through refused_translation with a specific reason.
  • graphics_inner's Pipe::Skipped arm called warn_once directly, so those draws were never counted in no_pipeline ("native draws so far"). It now calls dropped(...), which warns once, increments the counter, and keeps the reason for the pass trace.
  • New test a_dropped_draw_is_counted_every_time_and_warned_once pins that dropped() counts every drop.

The put-off path (frame pipeline budget spent) already logs a counter line plus the generic draw-level reason, so it is unchanged. The rectangle stage-in and v_cvt_f32_f64 parts of #535 stay separate.

How it was tested

  • cargo test --target x86_64-apple-darwin -p victory-gpu --lib -- a_dropped_draw — passes (native mod is x86_64-only, runs under Rosetta)
  • cargo test -p victory-hle -p victory -p victory-gpu -p xtask (host arm64) — green
  • cargo test --target x86_64-apple-darwin -p victory-gpu — green except 2–3 pre-existing Metal GPU tests in native/tests.rs that flake under parallel Rosetta on this M1 right now; the identical set fails on a clean upstream/main checkout at the same moment and each passes in isolation (issue #552 class)
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings — clean
  • cargo xtask policy — 404 files ok
  • Not game-dependent; no game run needed for this change

Checklist

  • One change, one PR; branch vibe/drop-reason-log-1705ac from upstream/main, pushed to my fork only
  • No game/GDK files, no dumps/logs in the repo
  • No new VICTORY_* switches; existing warn/refusal paths only
  • No AI attribution in the diff

Note: the fork's main already carries 7fa3a417 (warn_drop_pipe, which names the dropped pipeline at each drop path). This PR is complementary, not duplicative: it gives the silent Pipe::Refused returns a refused_translation reason where no warning fired at all, and makes the Pipe::Skipped draw arm count in no_pipeline.

**@⁠AnastasisKon** on GitHub · 2026-11-28 15:42 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/621) `AnastasisKon:vibe/drop-reason-log-1705ac` → `main` · +26 −4 · 1 files · 1 commits · open Refs #535 — the "make the host log a reason for every draw it drops" item. Claimed on the issue. ## What this changes `crates/victory-gpu/src/native/glue.rs` only, 26 insertions: - `make_pipe`: when `native_stages(key)` is `None` the pipeline was previously refused with no log at all — likely the three reflection/post-pass draws `e2945217`, `456f02b5`, `a1f08b8b` from #535. It now calls `refused_translation`, which warns once per pipeline key and counts the refusal by reason in the shader stats. - `make_host_pipe`: the two remaining silent `Pipe::Refused` returns — a compute pipeline whose stages hold no compute shader, and a guessed graphics pipeline without a vertex stage — now also go through `refused_translation` with a specific reason. - `graphics_inner`'s `Pipe::Skipped` arm called `warn_once` directly, so those draws were never counted in `no_pipeline` ("native draws so far"). It now calls `dropped(...)`, which warns once, increments the counter, and keeps the reason for the pass trace. - New test `a_dropped_draw_is_counted_every_time_and_warned_once` pins that `dropped()` counts every drop. The put-off path (frame pipeline budget spent) already logs a counter line plus the generic draw-level reason, so it is unchanged. The rectangle stage-in and `v_cvt_f32_f64` parts of #535 stay separate. ## How it was tested - [x] `cargo test --target x86_64-apple-darwin -p victory-gpu --lib -- a_dropped_draw` — passes (native mod is x86_64-only, runs under Rosetta) - [x] `cargo test -p victory-hle -p victory -p victory-gpu -p xtask` (host arm64) — green - [x] `cargo test --target x86_64-apple-darwin -p victory-gpu` — green except 2–3 pre-existing Metal GPU tests in `native/tests.rs` that flake under parallel Rosetta on this M1 right now; the identical set fails on a clean `upstream/main` checkout at the same moment and each passes in isolation (issue #552 class) - [x] `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` — clean - [x] `cargo xtask policy` — 404 files ok - [x] Not game-dependent; no game run needed for this change ## Checklist - [x] One change, one PR; branch `vibe/drop-reason-log-1705ac` from `upstream/main`, pushed to my fork only - [x] No game/GDK files, no dumps/logs in the repo - [x] No new `VICTORY_*` switches; existing warn/refusal paths only - [x] No AI attribution in the diff Note: the fork's `main` already carries 7fa3a417 (`warn_drop_pipe`, which names the dropped pipeline at each drop path). This PR is complementary, not duplicative: it gives the *silent* `Pipe::Refused` returns a `refused_translation` reason where no warning fired at all, and makes the `Pipe::Skipped` draw arm count in `no_pipeline`.
Three reflection/post-pass draws (e2945217, 456f02b5, a1f08b8b, #531) had
no host pipeline with no reason logged anywhere. The silent Pipe::Refused
returns in make_pipe (native_stages None) and make_host_pipe (compute
pipeline without a compute stage; guessed graphics pipeline without a
vertex stage) now go through refused_translation, which warns once per
pipeline with its stage hashes and counts the refusal by reason in the
shader stats. The Pipe::Skipped draw arm called warn_once directly, so
those draws were never counted in no_pipeline; it now calls dropped(),
which warns once, counts, and keeps the reason for the pass trace.
New test pins that dropped() counts every drop.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 15:47:10 +00:00
github-bot force-pushed github-bot/gh-621 from 179a02cdbb to 06659314d8 2026-11-28 15:52:28 +00:00 Compare
This pull request can be merged automatically.
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/625/head:github-bot/gh-621'
git switch 'github-bot/gh-621'

Merge

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