perf: CLAMP_AFTER_WRITER and NVIDIA Wave32 (opt-in), two cool_fox fixes #377

Manually merged
github merged 4 commits from github-bot/gh-377 into gh-pr/377/base 2026-11-26 16:17:16 +00:00 AGit
Owner

@⁠LooperSalty on GitHub · 2026-11-26 13:51 UTC · original
LooperSalty:perf/clamp-wave32-cool-fox → main · +1123 −32 · 18 files · 5 commits · merged 2026-11-26 14:26 UTC

Stacked on #358: merge that one first, and GitHub then retargets this one to main. Four commits taken from two neighbouring VIctory forks, each credited as rule 10 asks (Source: and Co-authored-by: in the message, rows in THIRD_PARTY.md).

Commit From What Switch
fix: upload buffers wait 500 ms after the driver refuses memory codec-d/cool_fox ab75ac3 no burst of driver calls after E_OUTOFMEMORY bug fix, always on
fix: XMA voices publish complete blocks and resume after a refill codec-d/cool_fox 8cc31ab (audio part) short blocks no longer padded with silence bug fix, always on
feat: port VICTORY_CLAMP_AFTER_WRITER clankenjoyer/neptune-fps 64327b85 indirect records are sanitized once after the pass that writes them, instead of clamped at every read VICTORY_CLAMP_AFTER_WRITER=1, off by default
feat: NVIDIA Wave32 lowering codec-d/cool_fox 8cc31ab3 (shader part) ACCC containers with the active-lane loop made wave-wide, select SCC, restored lanes, uniform-address LDS VICTORY_WAVE32_NVIDIA=1, off by default

The shader translator's source changes, so this build invalidates the shader cache once, even with the switch off: the cache key hashes victory-shader/src.

Measured (maintainer's machine, 2026-11-26: RTX 4070 SUPER, Series X, VIctory logs, one run each, on top of #358 with its three switches)

Run Median fps Last 2 min Dropped draws a frame
#358 base 14.5 14.2 434
+ VICTORY_CLAMP_AFTER_WRITER=1 14.8 16.6 380
+ VICTORY_WAVE32_NVIDIA=1 (with fence and commit-gate switches not in this PR) 15.0 15.5 452

The clamp shows fewer dropped draws and the best last two minutes, with 31 to 35 sanitize passes a frame and no record emptied. Wave32 did not lower the dropped draws: it reaches only the ACCC (FSR) compute shaders. Its frame times were the steadiest of the day (52 to 59 ms). Both stay off by default until more runs confirm them. No crash or device loss in any run. The XMA fix was not judged by ear yet.

Test plan

  • victory-gpu: 8 new tests (indirect/san_tests.rs); victory-shader: 8 new tests; only the 3 WARP failures already on main remain
  • cargo build --release -p victory, cargo xtask policy
  • In-game runs above
  • CI green

🤖 Generated with Claude Code

https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox

**@⁠LooperSalty** on GitHub · 2026-11-26 13:51 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/377) `LooperSalty:perf/clamp-wave32-cool-fox` → `main` · +1123 −32 · 18 files · 5 commits · merged 2026-11-26 14:26 UTC Stacked on #358: merge that one first, and GitHub then retargets this one to `main`. Four commits taken from two neighbouring VIctory forks, each credited as rule 10 asks (`Source:` and `Co-authored-by:` in the message, rows in `THIRD_PARTY.md`). | Commit | From | What | Switch | | --- | --- | --- | --- | | `fix: upload buffers wait 500 ms after the driver refuses memory` | codec-d/cool_fox `ab75ac3` | no burst of driver calls after `E_OUTOFMEMORY` | bug fix, always on | | `fix: XMA voices publish complete blocks and resume after a refill` | codec-d/cool_fox `8cc31ab` (audio part) | short blocks no longer padded with silence | bug fix, always on | | `feat: port VICTORY_CLAMP_AFTER_WRITER` | clankenjoyer/neptune-fps `64327b85` | indirect records are sanitized once after the pass that writes them, instead of clamped at every read | `VICTORY_CLAMP_AFTER_WRITER=1`, off by default | | `feat: NVIDIA Wave32 lowering` | codec-d/cool_fox `8cc31ab3` (shader part) | `ACCC` containers with the active-lane loop made wave-wide, select SCC, restored lanes, uniform-address LDS | `VICTORY_WAVE32_NVIDIA=1`, off by default | The shader translator's source changes, so this build invalidates the shader cache once, even with the switch off: the cache key hashes `victory-shader/src`. ## Measured (maintainer's machine, 2026-11-26: RTX 4070 SUPER, Series X, VIctory logs, one run each, on top of #358 with its three switches) | Run | Median fps | Last 2 min | Dropped draws a frame | | --- | --- | --- | --- | | #358 base | 14.5 | 14.2 | 434 | | + `VICTORY_CLAMP_AFTER_WRITER=1` | 14.8 | **16.6** | **380** | | + `VICTORY_WAVE32_NVIDIA=1` (with fence and commit-gate switches not in this PR) | 15.0 | 15.5 | 452 | The clamp shows fewer dropped draws and the best last two minutes, with 31 to 35 sanitize passes a frame and no record emptied. Wave32 did not lower the dropped draws: it reaches only the `ACCC` (FSR) compute shaders. Its frame times were the steadiest of the day (52 to 59 ms). Both stay off by default until more runs confirm them. No crash or device loss in any run. The XMA fix was not judged by ear yet. ## Test plan - [x] `victory-gpu`: 8 new tests (`indirect/san_tests.rs`); `victory-shader`: 8 new tests; only the 3 WARP failures already on `main` remain - [x] `cargo build --release -p victory`, `cargo xtask policy` - [x] In-game runs above - [ ] CI green 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
After E_OUTOFMEMORY, every small upload of a burst asked the driver again
and logged the refusal. A refusal now holds upload buffers back for 500 ms;
other errors are reported as before. No switch: this only stops a retry
storm.

Source: codec-d/cool_fox ab75ac3
Co-authored-by: codec_d <[email protected]>
Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
(cherry picked from commit dbd4bed9bbaf1d66fc1c5d9e137ec19bfb2c8433)
A pump decoded one frame and published a block even when that frame
added too few samples: the missing samples were written as silence. A
pump now takes up to eight decode steps and publishes only complete
blocks, or the final padded tail of an ended input. A voice whose input
the title refills after its end is decoded again, with its ring left
idle until a valid buffer is published.

Source: codec-d/cool_fox 8cc31ab (XMA audio fixes)
Co-authored-by: codec_d <[email protected]>
Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
(cherry picked from commit 9b80d356b71c87bb67e3a71cab33ee45344498b6)
A single indirect record without a count that shaders of the list write is no
longer clamped by a pass of its own: one sanitizing pass per buffer rewrites in
place the out-of-range records the title was seen to read, and the draw then
executes the record raw. Off unless VICTORY_CLAMP_AFTER_WRITER=1; a record no
pass can make safe is clamped as before. Unit tests cover the list's record of
clean records and the learning of records read.

Not ported from the same commit: VICTORY_INDIRECT_RAW=3, the batched clamp,
and the rest of neptune-fps.

Source: clankenjoyer/neptune-fps 64327b85
Co-authored-by: clankenjoyer <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
(cherry picked from commit a607e68c5cbbaa973e00d03017d29053a1d80518)
A host of 32-lane waves refuses wave64 pipelines (0x80070057 on NVIDIA), which
drops every draw whose program still asks for 64 lanes. With
VICTORY_WAVE32_NVIDIA=1 the translator also takes: ACCC containers (FSPX native
code) and the active-lane loop of such a compute program wave-wide (driver
loop in widen); a scalar select on the SCC of a mask operation as a wave-wide
test; a scalar saved to and restored from a constant VGPR lane in one block
(restored_lanes); and ds_read_b32 at a lane-uniform address as uniform.

Off by default, so translations are as before. Every piece has a test that
fails without it; a program reading the SCC of a mask operation is refused
with the switch off and translates (host wave 32 and 64) with it on.

Source: codec-d/cool_fox 8cc31ab3
Co-authored-by: codec_d <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
(cherry picked from commit 2209bae1649b01bf4dd08bd0f4d73c3427d8b986)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 13:55:33 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 13:51 UTC · original

Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-26T13:51:52.301946Z
We couldn’t complete this review. Comment @codex review to try again.
653d912 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review" or "@⁠codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 13:51 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/377#issuecomment-7193944132) <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"653d9121f1b3dde716a975810b269a72be668967","has_any_findings":true,"has_unresolved_findings":true,"status":"failed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ❌ Failed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ❌ **Failed** <relative-time datetime="2026-11-26T13:51:52.301946Z">2026-11-26T13:51:52.301946Z</relative-time><br/>We couldn’t complete this review. Comment `@codex review` to try again. | `653d912` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review" or "@⁠codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 13:51 UTC · original

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 13:51 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/377#issuecomment-7193944953) You have reached your Codex usage limits for code reviews. You can see your limits in the [Codex usage dashboard](https://chatgpt.com/codex/cloud/settings/usage). To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your [settings](https://chatgpt.com/settings/code-review).
github-bot closed this pull request 2026-11-26 14:22:58 +00:00
github-bot reopened this pull request 2026-11-26 16:17:11 +00:00
github-bot changed target branch from perf/copy-batch-2026-11-26 to gh-pr/377/base 2026-11-26 16:17:12 +00:00
github manually merged commit 388a38086b into gh-pr/377/base 2026-11-26 16:17:15 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.