[PR #4] Perf Phase 8: pipeline wait budget, exact builder translation, ray-tracing groundwork #3

Open
opened 2026-11-26 20:06:21 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/4ld0-vito/victory-gta6/pull/4
Author: @4ld0-vito
Created: 11/25/2026
Status: 🔄 Open

Base: docs/agent-handoff ← Head: perf/phase-8-indirect-gpu-sync


📝 Commits (10+)

  • 81c77c3 Phase 8a perf: guard outside the journal lock, Deferred::gpu_writes side list
  • 25dacda Pipeline wait budget switch, name missing structure-builder programs
  • b64e8f0 Shaders: every structure-builder program translates exactly on wave32 hosts
  • b7a8c4e Memory by address: root views of such shaders take the directory's copy
  • 166060e Diagnostics for the structure-builder crash: copy-back conflicts, write trace
  • b2804b2 Shader tests: the structure builder's group prefix sums against the CPU
  • f895202 Indirect windows survive draws that cannot store to buffers
  • 2a1969e docs: perf handoff status 2026-11-25 (pipeline budget, GPU-bound indirect mesh, ray-tracing crash hunt)
  • 3ab173a Phase 8b perf: rotating 8+16 indirect scratch pool, no-op done(), 16-window cache, diag miss stats
  • 45ebc00 victory precompile: translate shader containers into the run's shader cache ahead of time

📊 Changes

20 files changed (+1206 additions, -191 deletions)

View changed files

📝 apps/victory/src/main.rs (+11 -0)
➕ apps/victory/src/precompile.rs (+78 -0)
📝 crates/victory-gpu/src/copystat.rs (+26 -1)
📝 crates/victory-gpu/src/draw.rs (+206 -64)
📝 crates/victory-gpu/src/host.rs (+108 -32)
📝 crates/victory-gpu/src/indirect.rs (+175 -36)
📝 crates/victory-gpu/src/lib.rs (+2 -0)
📝 crates/victory-gpu/src/memory.rs (+24 -0)
📝 crates/victory-gpu/src/pipeline.rs (+7 -0)
📝 crates/victory-gpu/src/pipeline/make.rs (+14 -3)
📝 crates/victory-gpu/src/shader_cache.rs (+21 -0)
📝 crates/victory-gpu/src/shadow.rs (+56 -6)
📝 crates/victory-gpu/src/watch.rs (+37 -9)
➕ crates/victory-gpu/src/writetrace.rs (+128 -0)
📝 crates/victory-hle/src/modules/d3d12x.rs (+4 -0)
➕ crates/victory-shader/src/emit/builder_tests.rs (+127 -0)
📝 crates/victory-shader/src/emit/host.rs (+27 -1)
📝 crates/victory-shader/src/emit/lower.rs (+113 -39)
📝 crates/victory-shader/src/emit/mod.rs (+2 -0)
📝 docs/perf-handoff.md (+40 -0)

📄 Description

Stacked on #3 (docs/agent-handoff). Code only, no game data.

Summary

  • Pipeline wait budget (VICTORY_PIPELINE_BUDGET_MS, default 500 ms as before): with =8 the heavy gameplay scene goes from 1.0–1.7 fps to a steady 4–6 fps. The title had stood idle for 400–1,700 ms a frame waiting for a few new pipelines.
  • Ray-tracing structure builder:
    • All 53 builder programs now translate exactly on 32-lane GPUs. This comes from an optimistic lane_uniform fixpoint and from constant lane masks in local waves.
    • The builder's group prefix sums are checked bit-exact on the GPU (new test harness Root::Uav).
    • Root views of by-address shaders now take the memory directory's copy, which fixes a stale-copy bug.
    • The builder stays off by default: the title still faults about 20 s after it starts. The investigation and next steps are in docs/perf-handoff.md §0.
  • Smaller changes:
    • writes_ex guards outside the journal lock, kept in order by a GUARD_ORDER mutex.
    • Deferred::gpu_writes side list.
    • Indirect windows now survive draws that cannot store to buffers.
    • Diagnostics, all off by default: VICTORY_BACK_CONFLICTS, VICTORY_BACK_TITLE_WINS, VICTORY_WRITE_TRACE.
  • docs/perf-handoff.md §0 describes the new bottleneck. The GPU is 80–90% busy in indirect mesh draws, about 25–40 µs per command. It also lists the dead ends ruled out this session and the ordered next steps.

Tests

  • cargo test -p victory-gpu: 115 passed, 0 failed, 1 ignored.
  • cargo test -p victory-shader: 186 passed, 2 ignored.
  • cargo xtask policy: 169 files ok.
  • Release and diag builds are clean. Every benchmark run on Series X had 0 ERROR lines.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/4ld0-vito/victory-gta6/pull/4 **Author:** [@4ld0-vito](https://github.com/4ld0-vito) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `docs/agent-handoff` ← **Head:** `perf/phase-8-indirect-gpu-sync` --- ### 📝 Commits (10+) - [`81c77c3`](https://github.com/4ld0-vito/victory-gta6/commit/81c77c35d0509b8fbbc7b1f689db04a034248f65) Phase 8a perf: guard outside the journal lock, Deferred::gpu_writes side list - [`25dacda`](https://github.com/4ld0-vito/victory-gta6/commit/25dacdac0dc60163ec7481e77e40269da2954e15) Pipeline wait budget switch, name missing structure-builder programs - [`b64e8f0`](https://github.com/4ld0-vito/victory-gta6/commit/b64e8f0365abb03e7249d101645dc9558a22bac0) Shaders: every structure-builder program translates exactly on wave32 hosts - [`b7a8c4e`](https://github.com/4ld0-vito/victory-gta6/commit/b7a8c4ed4c9db173403f8a7969fab32bfadeb677) Memory by address: root views of such shaders take the directory's copy - [`166060e`](https://github.com/4ld0-vito/victory-gta6/commit/166060e13e7748d6c2bffeb18aabf9e409e33a40) Diagnostics for the structure-builder crash: copy-back conflicts, write trace - [`b2804b2`](https://github.com/4ld0-vito/victory-gta6/commit/b2804b2f29689faccc0cf85255580124b7e6499f) Shader tests: the structure builder's group prefix sums against the CPU - [`f895202`](https://github.com/4ld0-vito/victory-gta6/commit/f895202790e817118b10a9e6b2bb98862bec0a2d) Indirect windows survive draws that cannot store to buffers - [`2a1969e`](https://github.com/4ld0-vito/victory-gta6/commit/2a1969ed096e2233d5b85fdf3d711b120e21cdb0) docs: perf handoff status 2026-11-25 (pipeline budget, GPU-bound indirect mesh, ray-tracing crash hunt) - [`3ab173a`](https://github.com/4ld0-vito/victory-gta6/commit/3ab173a0ba56b5a7511379975788b60a6c3c6294) Phase 8b perf: rotating 8+16 indirect scratch pool, no-op done(), 16-window cache, diag miss stats - [`45ebc00`](https://github.com/4ld0-vito/victory-gta6/commit/45ebc00a1ae25b8985314a1a10e672f223c77df6) victory precompile: translate shader containers into the run's shader cache ahead of time ### 📊 Changes **20 files changed** (+1206 additions, -191 deletions) <details> <summary>View changed files</summary> 📝 `apps/victory/src/main.rs` (+11 -0) ➕ `apps/victory/src/precompile.rs` (+78 -0) 📝 `crates/victory-gpu/src/copystat.rs` (+26 -1) 📝 `crates/victory-gpu/src/draw.rs` (+206 -64) 📝 `crates/victory-gpu/src/host.rs` (+108 -32) 📝 `crates/victory-gpu/src/indirect.rs` (+175 -36) 📝 `crates/victory-gpu/src/lib.rs` (+2 -0) 📝 `crates/victory-gpu/src/memory.rs` (+24 -0) 📝 `crates/victory-gpu/src/pipeline.rs` (+7 -0) 📝 `crates/victory-gpu/src/pipeline/make.rs` (+14 -3) 📝 `crates/victory-gpu/src/shader_cache.rs` (+21 -0) 📝 `crates/victory-gpu/src/shadow.rs` (+56 -6) 📝 `crates/victory-gpu/src/watch.rs` (+37 -9) ➕ `crates/victory-gpu/src/writetrace.rs` (+128 -0) 📝 `crates/victory-hle/src/modules/d3d12x.rs` (+4 -0) ➕ `crates/victory-shader/src/emit/builder_tests.rs` (+127 -0) 📝 `crates/victory-shader/src/emit/host.rs` (+27 -1) 📝 `crates/victory-shader/src/emit/lower.rs` (+113 -39) 📝 `crates/victory-shader/src/emit/mod.rs` (+2 -0) 📝 `docs/perf-handoff.md` (+40 -0) </details> ### 📄 Description Stacked on #3 (`docs/agent-handoff`). Code only, no game data. ## Summary - **Pipeline wait budget** (`VICTORY_PIPELINE_BUDGET_MS`, default 500 ms as before): with `=8` the heavy gameplay scene goes from 1.0–1.7 fps to a steady 4–6 fps. The title had stood idle for 400–1,700 ms a frame waiting for a few new pipelines. - **Ray-tracing structure builder:** - All 53 builder programs now translate exactly on 32-lane GPUs. This comes from an optimistic `lane_uniform` fixpoint and from constant lane masks in local waves. - The builder's group prefix sums are checked bit-exact on the GPU (new test harness `Root::Uav`). - Root views of by-address shaders now take the memory directory's copy, which fixes a stale-copy bug. - The builder stays off by default: the title still faults about 20 s after it starts. The investigation and next steps are in `docs/perf-handoff.md` §0. - **Smaller changes:** - `writes_ex` guards outside the journal lock, kept in order by a `GUARD_ORDER` mutex. - `Deferred::gpu_writes` side list. - Indirect windows now survive draws that cannot store to buffers. - Diagnostics, all off by default: `VICTORY_BACK_CONFLICTS`, `VICTORY_BACK_TITLE_WINS`, `VICTORY_WRITE_TRACE`. - **`docs/perf-handoff.md` §0** describes the new bottleneck. The GPU is 80–90% busy in indirect mesh draws, about 25–40 µs per command. It also lists the dead ends ruled out this session and the ordered next steps. ## Tests - `cargo test -p victory-gpu`: 115 passed, 0 failed, 1 ignored. - `cargo test -p victory-shader`: 186 passed, 2 ignored. - `cargo xtask policy`: 169 files ok. - Release and diag builds are clean. Every benchmark run on Series X had 0 `ERROR` lines. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
4ld0/victory-gta6#3
No description provided.