gpu(native): VICTORY_SUBMIT_TIMING=1 logs a submission's CPU time entry-to-commit (#461 step 1) #491

Manually merged
github merged 1 commit from github-bot/gh-487 into main 2026-11-28 00:42:32 +00:00 AGit
Owner

@⁠AnastasisKon on GitHub · 2026-11-27 22:07 UTC · original
AnastasisKon:vibe/submit-timing-1705ac → main · +44 −0 · 2 files · 1 commits · merged 2026-11-28 00:38 UTC

What this changes

Refs #465, step 1 only. NativeHost::execute (the native ExecuteCommandLists) now times itself when VICTORY_SUBMIT_TIMING=1 (off by default) and logs one line per submission:

submit timing: lists=<n> cmds=<n> prep=<ms>ms encode_commit=<ms>ms total=<ms>ms
  • prep — everything before the passes are encoded: follow_title_pages and per-command prep (pipeline translation on first bind, descriptor remirror, memory syncs);
  • encode_commit — backend.submit_passes (encoding passes into command buffers + commit);
  • total — entry to commit.

Off, the cost is one OnceLock read of the switch per submission. The switch is documented in docs/native-host.md ("Bring-up diagnostics"); the line format is pinned by a unit test. Step 2 (encoding parts on worker threads) is deliberately not in this PR.

How it was tested

  • cargo test -p victory-gpu — 413 passed (incl. the new submit_timing_line_splits_prep_from_encode_commit), 0 failed, on the arm64 host with the Metal Shader Converter present
  • cargo test -p victory-hle -p victory -p xtask — pass
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings — pass (RC=0)
  • cargo xtask policy — pass (398 files ok)
  • Ran the game: not needed yet — this PR is the measurement switch itself; a world run with VICTORY_SUBMIT_TIMING=1 (plus tools/macos/run-summary.sh) is the follow-up on a machine with a game copy

Checklist

  • No game files, game code, disassembly listings or SDK files are included
  • Guesses about undocumented console behaviour are marked — n/a, no behaviour change, diagnostic only
  • New diagnostics are behind a VICTORY_* variable (VICTORY_SUBMIT_TIMING) and documented in docs/native-host.md
**@⁠AnastasisKon** on GitHub · 2026-11-27 22:07 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/487) `AnastasisKon:vibe/submit-timing-1705ac` → `main` · +44 −0 · 2 files · 1 commits · merged 2026-11-28 00:38 UTC ## What this changes Refs #465, step 1 only. `NativeHost::execute` (the native `ExecuteCommandLists`) now times itself when `VICTORY_SUBMIT_TIMING=1` (off by default) and logs one line per submission: ``` submit timing: lists=<n> cmds=<n> prep=<ms>ms encode_commit=<ms>ms total=<ms>ms ``` - `prep` — everything before the passes are encoded: `follow_title_pages` and per-command `prep` (pipeline translation on first bind, descriptor remirror, memory syncs); - `encode_commit` — `backend.submit_passes` (encoding passes into command buffers + commit); - `total` — entry to commit. Off, the cost is one `OnceLock` read of the switch per submission. The switch is documented in `docs/native-host.md` ("Bring-up diagnostics"); the line format is pinned by a unit test. Step 2 (encoding parts on worker threads) is deliberately not in this PR. ## How it was tested - [x] `cargo test -p victory-gpu` — 413 passed (incl. the new `submit_timing_line_splits_prep_from_encode_commit`), 0 failed, on the arm64 host with the Metal Shader Converter present - [x] `cargo test -p victory-hle -p victory -p xtask` — pass - [x] `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` — pass (RC=0) - [x] `cargo xtask policy` — pass (398 files ok) - [x] Ran the game: not needed yet — this PR is the measurement switch itself; a world run with `VICTORY_SUBMIT_TIMING=1` (plus `tools/macos/run-summary.sh`) is the follow-up on a machine with a game copy ## Checklist - [x] No game files, game code, disassembly listings or SDK files are included - [x] Guesses about undocumented console behaviour are marked — n/a, no behaviour change, diagnostic only - [x] New diagnostics are behind a `VICTORY_*` variable (`VICTORY_SUBMIT_TIMING`) and documented in docs/native-host.md
Refs #461 step 1. One line per ExecuteCommandLists: prep (page following,
per-command preparation: translation, descriptor remirror, memory syncs)
vs encode_commit (submit_passes), plus the total. Off by default; the
switch costs one read of the env per submission. Documented in
docs/native-host.md; the line format is pinned by a unit test.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 22:11:28 +00:00
github manually merged commit 97de56d60d into main 2026-11-28 00:42:32 +00:00
Author
Owner

@⁠Olima34 on GitHub · 2026-11-28 00:37 UTC · original · requested changes

Thanks for this PR! We're helping the maintainer clear the queue tonight, and main has moved a lot (the preview branch landed as 86cefd22, then a batch of PRs; main is now a6a58361). This branch now conflicts with main in docs/native-host.md.

Could you merge current main into the branch (a merge commit is fine, no need to rebase) and resolve the conflict? It's only the docs paragraph. Once GitHub shows it as mergeable and CI is green on the new head, we'll read it through and merge it if it holds up.

**@⁠Olima34** on GitHub · 2026-11-28 00:37 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/487#pullrequestreview-6094670014) · **requested changes** Thanks for this PR! We're helping the maintainer clear the queue tonight, and main has moved a lot (the preview branch landed as 86cefd22, then a batch of PRs; main is now a6a58361). This branch now conflicts with main in `docs/native-host.md`. Could you merge current `main` into the branch (a merge commit is fine, no need to rebase) and resolve the conflict? It's only the docs paragraph. Once GitHub shows it as mergeable and CI is green on the new head, we'll read it through and merge it if it holds up.
Author
Owner

@⁠Olima34 on GitHub · 2026-11-28 00:40 UTC · original

Please disregard my change request above: it crossed with the maintainer merging this PR (land/prs-2), so the conflict is resolved on main. Thanks!

**@⁠Olima34** on GitHub · 2026-11-28 00:40 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/487#issuecomment-7231105630) Please disregard my change request above: it crossed with the maintainer merging this PR (land/prs-2), so the conflict is resolved on main. Thanks!
This discussion has been locked. Commenting is limited to contributors.
No description provided.