perf: heap scan every 16 passes by default (+7 %, 4x fewer stutters), stutter study #394

Manually merged
github merged 4 commits from github-bot/gh-394 into main 2026-11-26 16:11:55 +00:00 AGit
Owner

@⁠LooperSalty on GitHub · 2026-11-26 15:51 UTC · original
LooperSalty:perf/heap-scan-default → main · +246 −7 · 12 files · 4 commits · merged 2026-11-26 16:07 UTC

Two commits:

  1. perf: add VICTORY_HEAP_SCAN_ALT (heap_pass.rs): the full scan of every kept descriptor slot for past-the-API records runs once every 16 passes instead of every pass, behind a switch (1, or alt for 20 s on / 20 s off, each change logged). It also adds a stutter study of the 2026-11-26 logs: docs/research/stutter-2026-11-26.md and docs/fr/recherche/a-coups-2026-11-26.md. Of 304 five-second windows, 65 ran over 100 ms a frame (341 s lost). The heap pass caused 43 % of that (211 ms a window against 8 ms outside spikes), copies back 16 %, prepared host copies 11 %. A full card was not a cause.
  2. perf: the launcher scans kept heap slots every 16 passes: VICTORY_HEAP_SCAN_ALT=1 joins anyxboxx run's tuned set and the Windows + NVIDIA profile (46 variables). The golden script, the test counts and the guides (EN and FR) follow. The guides also warn against VICTORY_CLAMP_AFTER_WRITER (#377): with it alone, faces draw black (seen in game today).

Measured (maintainer's machine, 2026-11-26, RTX 4070 SUPER, Series X, one run with alt)

Heap scan Median fps 5 s windows over 100 ms a frame
every 16 passes 15.2 (13 samples) 1
every pass (before) 14.2 (11 samples) 4

The faces were checked in game during this run: they draw correctly.

Test plan

  • cargo test --release -p victory-gpu (porting branch): 238 passed, only the 3 known WARP failures; new heap-pass tests green
  • cargo test --release -p anyxboxx -p anyxboxx-launcher: 23 + 209 passed
  • pytest tests/test_anyxboxx_run.py tests/test_lanceur_victory.py tests/test_readme_sync.py: 37 passed
  • In-game A/B above
  • CI green

🤖 Generated with Claude Code

https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox

**@⁠LooperSalty** on GitHub · 2026-11-26 15:51 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/394) `LooperSalty:perf/heap-scan-default` → `main` · +246 −7 · 12 files · 4 commits · merged 2026-11-26 16:07 UTC Two commits: 1. **`perf: add VICTORY_HEAP_SCAN_ALT`** (`heap_pass.rs`): the full scan of every kept descriptor slot for past-the-API records runs once every 16 passes instead of every pass, behind a switch (`1`, or `alt` for 20 s on / 20 s off, each change logged). It also adds a stutter study of the 2026-11-26 logs: `docs/research/stutter-2026-11-26.md` and `docs/fr/recherche/a-coups-2026-11-26.md`. Of 304 five-second windows, 65 ran over 100 ms a frame (341 s lost). The heap pass caused 43 % of that (211 ms a window against 8 ms outside spikes), copies back 16 %, prepared host copies 11 %. A full card was not a cause. 2. **`perf: the launcher scans kept heap slots every 16 passes`**: `VICTORY_HEAP_SCAN_ALT=1` joins `anyxboxx run`'s tuned set and the Windows + NVIDIA profile (46 variables). The golden script, the test counts and the guides (EN and FR) follow. The guides also warn against `VICTORY_CLAMP_AFTER_WRITER` (#377): with it alone, faces draw black (seen in game today). ## Measured (maintainer's machine, 2026-11-26, RTX 4070 SUPER, Series X, one run with `alt`) | Heap scan | Median fps | 5 s windows over 100 ms a frame | | --- | --- | --- | | every 16 passes | **15.2** (13 samples) | **1** | | every pass (before) | 14.2 (11 samples) | 4 | The faces were checked in game during this run: they draw correctly. ## Test plan - [x] `cargo test --release -p victory-gpu` (porting branch): 238 passed, only the 3 known WARP failures; new heap-pass tests green - [x] `cargo test --release -p anyxboxx -p anyxboxx-launcher`: 23 + 209 passed - [x] `pytest tests/test_anyxboxx_run.py tests/test_lanceur_victory.py tests/test_readme_sync.py`: 37 passed - [x] In-game A/B above - [ ] CI green 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
The marked heap pass compares the record of every kept slot on every
pass (VICTORY_HEAP_SCAN_EVERY defaults to 1). In the 2026-11-26 logs,
the pass over the heap is the largest cost in windows above 100 ms per
frame (about 43 % of the lost time). The new switch is off by default:
1 scans every 16 passes, alt alternates 20 s slow and 20 s default.

Measured in the logs (not in the game run): see docs/research/stutter-2026-11-26.md.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
(cherry picked from commit 4e3592d599fc5d42c37f9ee0640ea5cd1bf36715)
VICTORY_HEAP_SCAN_ALT=1 joins the tuned set and the Windows + NVIDIA
profile (46 variables). Read from the VIctory logs of 2026-11-26, the full
scan of every kept descriptor slot at every heap pass was the largest
single cause of frames over 100 ms. Measured in one run set to `alt`
(RTX 4070 SUPER, Series X): 15.2 fps median against 14.2, 1 frame window
over 100 ms against 4. The guides also warn against
VICTORY_CLAMP_AFTER_WRITER, which draws faces black.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LwHrL62nyr3m1M4tJsHRox
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 15:55:21 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 15:52 UTC · original · edited 2026-11-26 15:53 UTC

Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T15:53:38.251611Z 49786c8 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 15:52 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/394#issuecomment-7196861975) · edited 2026-11-26 15:53 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"49786c8cd85faf626c39c0db14e8e83ac4ce847c","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-26T15:53:38.251611Z">2026-11-26T15:53:38.251611Z</relative-time> | `49786c8` | 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>
github manually merged commit ce0f90f1e4 into main 2026-11-26 16:11:55 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.