gpu(card_steps): prune dependency scans and batch constant slot writes #2812

Open
github-bot wants to merge 1 commit from github-bot/gh-2812 into main AGit
Owner

@⁠Nosheboo on GitHub · 2026-11-29 17:37 UTC · original
Nosheboo:port/foxhound-card-steps-and-constant-batch → main · +515 −88 · 3 files · 1 commits · open

Motivation

On upstream 55d06914, baseline telemetry shows the submitter spending 2.5–3.3 ms/frame in card_steps and 4.4–5.3 ms/frame in copies & fills. Per-slot constant_slot calls repeatedly take/drop SHADER_HEAPS locks and query host() / GetGPUVirtualAddress(), while fill-only submissions still pay full read-range merging and Box<dyn Iterator> overhead in plan_with.

Changes

  • crates/victory-gpu/src/host/card_steps.rs:
    • Raises MOST from 12288 to 16384.
    • Prunes unnecessary read-range merges, dependency rescans, behind-range checks, and Box<dyn Iterator> boxing when planning fill-only/no-copy submissions, while preserving !given[i] checks in in_the_way and served_fills.
    • Pre-sizes places/held and uses held.retain, plus reuses bounded thread-local SLOT_BATCH scratch storage (flush_slot_batch) per worker shard inside land::each_view / land::each_under.
    • Adds plan_handles_fill_only_lazy_behind_coalescing_and_served_placed.
  • crates/victory-gpu/src/descriptor.rs & crates/victory-gpu/src/descriptor/host.rs:
    • Adds constant_slots (using single-heap fast path plus order-preserving per-heap grouping with bounded thread-local CONSTANT_SLOT_SCRATCH) forwarding to HostHeap::constant_at_batch (adapted to upstream's 16-shard retire_resource).
    • Adds constant_at_batch_writes_slots_and_retires_replaced_buffers and constant_slots_batches_across_heaps_and_handles_empty_or_stale.

Attribution

Ported from FoxHound v0.8.1: readmet3xt-lab/foxhound commit 6c67166d (PR #36, author Dilim0n, GPL-3.0-or-later). Commit trailers and source doc comments credit Dilim0n and readmet3xt-lab.

Verification

  • Rebased cleanly onto upstream/main (41adb551): git diff --check upstream/main..HEAD clean; trailers intact (Co-authored-by: Dilim0n, Co-authored-by: readmet3xt-lab).
  • cargo clippy -p victory-gpu --no-deps --all-targets --locked and --all-features with -W clippy::undocumented_unsafe_blocks: 0 new warnings vs upstream/main baseline (41adb551).
  • cargo test -p victory-gpu --lib --locked host::card_steps:: -- --test-threads=1 -> 22 passed; 0 failed; 1 ignored
  • cargo test -p victory-gpu --lib --locked descriptor:: -- --test-threads=1 -> 106 passed; 0 failed; 2 ignored

Council review

Rounds: 4

Delegate Round 1 Round 2 Round 3 Round 4 (Rebase)
Concurrency & Safety Auditor (gpt-6-luna, xhigh) 9/10 9/10 9/10 10/10
Performance & Modernization Architect (gpt-6-luna, xhigh) 7/10 7/10 9/10 9/10
Upstream PR Hygiene & Test Critic (gpt-6-luna, xhigh) 8/10 8/10 8/10 10/10

Created in T3 Code (reviewed by Council: 3× gpt-6-luna on xhigh).

**@⁠Nosheboo** on GitHub · 2026-11-29 17:37 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2812) `Nosheboo:port/foxhound-card-steps-and-constant-batch` → `main` · +515 −88 · 3 files · 1 commits · open ## Motivation On upstream `55d06914`, baseline telemetry shows the submitter spending `2.5–3.3 ms/frame` in `card_steps` and `4.4–5.3 ms/frame` in `copies & fills`. Per-slot `constant_slot` calls repeatedly take/drop `SHADER_HEAPS` locks and query `host()` / `GetGPUVirtualAddress()`, while fill-only submissions still pay full read-range merging and `Box<dyn Iterator>` overhead in `plan_with`. ## Changes - `crates/victory-gpu/src/host/card_steps.rs`: - Raises `MOST` from `12288` to `16384`. - Prunes unnecessary read-range merges, dependency rescans, behind-range checks, and `Box<dyn Iterator>` boxing when planning fill-only/no-copy submissions, while preserving `!given[i]` checks in `in_the_way` and `served_fills`. - Pre-sizes `places`/`held` and uses `held.retain`, plus reuses bounded thread-local `SLOT_BATCH` scratch storage (`flush_slot_batch`) per worker shard inside `land::each_view` / `land::each_under`. - Adds `plan_handles_fill_only_lazy_behind_coalescing_and_served_placed`. - `crates/victory-gpu/src/descriptor.rs` & `crates/victory-gpu/src/descriptor/host.rs`: - Adds `constant_slots` (using single-heap fast path plus order-preserving per-heap grouping with bounded thread-local `CONSTANT_SLOT_SCRATCH`) forwarding to `HostHeap::constant_at_batch` (adapted to upstream's 16-shard `retire_resource`). - Adds `constant_at_batch_writes_slots_and_retires_replaced_buffers` and `constant_slots_batches_across_heaps_and_handles_empty_or_stale`. ## Attribution Ported from **FoxHound v0.8.1**: [`readmet3xt-lab/foxhound`](https://github.com/readmet3xt-lab/foxhound) commit `6c67166d` (PR #36, author `Dilim0n`, `GPL-3.0-or-later`). Commit trailers and source doc comments credit `Dilim0n` and `readmet3xt-lab`. ## Verification - Rebased cleanly onto `upstream/main` (`41adb551`): `git diff --check upstream/main..HEAD` clean; trailers intact (`Co-authored-by: Dilim0n`, `Co-authored-by: readmet3xt-lab`). - `cargo clippy -p victory-gpu --no-deps --all-targets --locked` and `--all-features` with `-W clippy::undocumented_unsafe_blocks`: `0` new warnings vs `upstream/main` baseline (`41adb551`). - `cargo test -p victory-gpu --lib --locked host::card_steps:: -- --test-threads=1` -> `22 passed; 0 failed; 1 ignored` - `cargo test -p victory-gpu --lib --locked descriptor:: -- --test-threads=1` -> `106 passed; 0 failed; 2 ignored` ## Council review Rounds: 4 | Delegate | Round 1 | Round 2 | Round 3 | Round 4 (Rebase) | | --- | --- | --- | --- | --- | | Concurrency & Safety Auditor (`gpt-6-luna`, `xhigh`) | 9/10 | 9/10 | 9/10 | 10/10 | | Performance & Modernization Architect (`gpt-6-luna`, `xhigh`) | 7/10 | 7/10 | 9/10 | 9/10 | | Upstream PR Hygiene & Test Critic (`gpt-6-luna`, `xhigh`) | 8/10 | 8/10 | 8/10 | 10/10 | Created in T3 Code (reviewed by Council: 3× gpt-6-luna on xhigh).
Ports card_steps planning/held-cache speedups and batched constant_slots/constant_at_batch updates from readmet3xt-lab/foxhound commit 6c67166d (PR #36, by Dilim0n, GPL-3.0-or-later), adapted to upstream's 16-shard retire_resource and land::each_view/each_under threading.

Co-authored-by: Dilim0n <[email protected]>
Co-authored-by: readmet3xt-lab <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 17:39:11 +00:00
github-bot force-pushed github-bot/gh-2812 from 192a15a3e6 to 2706a11570 2026-11-29 23:15:54 +00:00 Compare
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/descriptor.rs
  • crates/victory-gpu/src/descriptor/host.rs
  • crates/victory-gpu/src/host/card_steps.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2812/head:github-bot/gh-2812'
git switch 'github-bot/gh-2812'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2812'
git switch 'github-bot/gh-2812'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2812'
git switch 'github-bot/gh-2812'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2812'
git switch 'main'
git merge --squash 'github-bot/gh-2812'
git switch 'main'
git merge --ff-only 'github-bot/gh-2812'
git switch 'main'
git merge 'github-bot/gh-2812'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
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
github/trustno1-coder--VIctory-NVIDIA!2812
No description provided.