Add bounded-compute diagnostic and M1 Pro benchmark findings #571

Closed
github-bot wants to merge 1 commit from github-bot/gh-567 into main AGit
Owner

@⁠willbtty on GitHub · 2026-11-28 05:22 UTC · original
willbtty:vibe/m1-compute-batches-01a220 → main · +181 −1 · 4 files · 1 commits · closed without merging

What this changes

Refs #553.

On an M1 Pro with 32 GB RAM, a single native compute pass can contain hundreds of dispatches even with VICTORY_PASSES_PER_BUFFER=1. Add an off-by-default VICTORY_COMPUTE_DISPATCHES_PER_PASS diagnostic to cap consecutive prepared dispatches per pass, including expanded indirect records, while preserving command order and existing boundaries. Pairing it with one pass per command buffer lets the existing Metal splitting and fence handling isolate smaller batches.

This does not establish a performance or stability improvement and is not a recommended tuning setting. The Series S experiments are documented in docs/native-host.md:

  • With no dispatch cap and one pass per buffer, the info-only run measured 0.379, 0.606 and 0.345 FPS between world counters and logged at least 40 GPU failures before its 660 s limit. The comparable traced baseline measured 0.499 FPS and logged 26 failures in 360 s.
  • Caps of 32 and 8 still logged GPU failures and produced fewer than two qualifying world counters. Caps of 1 and 4 without tracing ended in the guest watchdog after 152 and 175 s, before a qualifying FPS interval.
  • In the traced cap-1 run, 187 submissions spent 23.056 s in encode/commit and 1.738 s in preparation; one submission held the shared title lock for 14.994 s. Investigating those stalls is the next lead, not evidence of a completed fix.

All runs used Series S and VICTORY_LOG=info. FPS uses only native draws so far counters with nonzero mesh. Raw logs, run metadata and game files remain outside the repository and were not uploaded. No shader translation or default scheduling behavior changes.

How it was tested

  • Native arm64 tests, serial to avoid the known Rosetta/GPU-test issue: cargo test --locked --offline -j4 -p victory-hle -p victory -p victory-gpu -p xtask -- --test-threads=1 — one complete passing run, 610 passed and 8 ignored. This replaces the template's x86 test invocation for this GPU change.
  • cargo clippy --workspace --all-targets --locked -j4 --target x86_64-pc-windows-gnullvm -- -D warnings — passed once.
  • The same Windows-target clippy command with --all-features — passed once.
  • cargo xtask policy — 400 files passed.
  • cargo build --release --locked --offline -j4 --target x86_64-apple-darwin -p victory — passed.
  • Ran the game serially on M1 Pro / 32 GB / macOS 27.2.1 with a warm shader cache. World counters occurred in baseline and some candidate runs; no run established sustained playable gameplay. Exact settings and endpoints are in the new documentation section.

Regression coverage includes direct dispatch order across a render boundary, expanded indirect count-buffer addresses and indices, unchanged grouping with cap zero, and five dependent Metal dispatches across three command buffers with final values checked after the submission fence. The grouping tests failed before the cap was implemented.

Checklist

  • No game files, game code, disassembly listings or SDK files are included.
  • No new guesses about undocumented console behavior; the new control changes host scheduling. Observed timings are explicitly not presented as a documented GPU time limit.
  • New diagnostic is behind a VICTORY_* variable, off by default and documented.

Kept as a draft for CI and maintainer review; #553 remains unresolved. Hosted CI reports action_required with no jobs started. The submitting account has read-only upstream permissions, so maintainer action is needed before hosted validation can proceed.

**@⁠willbtty** on GitHub · 2026-11-28 05:22 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/567) `willbtty:vibe/m1-compute-batches-01a220` → `main` · +181 −1 · 4 files · 1 commits · closed without merging ## What this changes Refs #553. On an M1 Pro with 32 GB RAM, a single native compute pass can contain hundreds of dispatches even with `VICTORY_PASSES_PER_BUFFER=1`. Add an off-by-default `VICTORY_COMPUTE_DISPATCHES_PER_PASS` diagnostic to cap consecutive prepared dispatches per pass, including expanded indirect records, while preserving command order and existing boundaries. Pairing it with one pass per command buffer lets the existing Metal splitting and fence handling isolate smaller batches. **This does not establish a performance or stability improvement and is not a recommended tuning setting.** The Series S experiments are documented in `docs/native-host.md`: - With no dispatch cap and one pass per buffer, the info-only run measured 0.379, 0.606 and 0.345 FPS between world counters and logged at least 40 GPU failures before its 660 s limit. The comparable traced baseline measured 0.499 FPS and logged 26 failures in 360 s. - Caps of 32 and 8 still logged GPU failures and produced fewer than two qualifying world counters. Caps of 1 and 4 without tracing ended in the guest watchdog after 152 and 175 s, before a qualifying FPS interval. - In the traced cap-1 run, 187 submissions spent 23.056 s in encode/commit and 1.738 s in preparation; one submission held the shared title lock for 14.994 s. Investigating those stalls is the next lead, not evidence of a completed fix. All runs used Series S and `VICTORY_LOG=info`. FPS uses only `native draws so far` counters with nonzero `mesh`. Raw logs, run metadata and game files remain outside the repository and were not uploaded. No shader translation or default scheduling behavior changes. ## How it was tested - [x] Native arm64 tests, serial to avoid the known Rosetta/GPU-test issue: `cargo test --locked --offline -j4 -p victory-hle -p victory -p victory-gpu -p xtask -- --test-threads=1` — one complete passing run, 610 passed and 8 ignored. This replaces the template's x86 test invocation for this GPU change. - [x] `cargo clippy --workspace --all-targets --locked -j4 --target x86_64-pc-windows-gnullvm -- -D warnings` — passed once. - [x] The same Windows-target clippy command with `--all-features` — passed once. - [x] `cargo xtask policy` — 400 files passed. - [x] `cargo build --release --locked --offline -j4 --target x86_64-apple-darwin -p victory` — passed. - [x] Ran the game serially on M1 Pro / 32 GB / macOS 27.2.1 with a warm shader cache. World counters occurred in baseline and some candidate runs; no run established sustained playable gameplay. Exact settings and endpoints are in the new documentation section. Regression coverage includes direct dispatch order across a render boundary, expanded indirect count-buffer addresses and indices, unchanged grouping with cap zero, and five dependent Metal dispatches across three command buffers with final values checked after the submission fence. The grouping tests failed before the cap was implemented. ## Checklist - [x] No game files, game code, disassembly listings or SDK files are included. - [x] No new guesses about undocumented console behavior; the new control changes host scheduling. Observed timings are explicitly not presented as a documented GPU time limit. - [x] New diagnostic is behind a `VICTORY_*` variable, off by default and documented. Kept as a draft for CI and maintainer review; #553 remains unresolved. [Hosted CI](https://github.com/LakshanSivakumar/Native-Victory-macOS/actions/runs/46111801195) reports `action_required` with no jobs started. The submitting account has read-only upstream permissions, so maintainer action is needed before hosted validation can proceed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 05:23:41 +00:00
github-bot closed this pull request 2026-11-28 05:31:51 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.