gpu(draw): batch table descriptor copies/retirements and hoist list hotpath lookups #2813

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

@⁠Nosheboo on GitHub · 2026-11-29 17:37 UTC · original
Nosheboo:port/foxhound-table-batch-and-draw-hotpath → main · +565 −162 · 4 files · 1 commits · open

Motivation

On upstream 55d06914, baseline profiling measures 178.4–184.9 ms across 30,689–33,221 list::thin calls per logging window alongside heavy per-draw descriptor creation/copy/retirement churn and redundant command-list hashing/lookup work.

Changes

  • crates/victory-gpu/src/descriptor/host.rs:
    • Adds TableBatch with bounded TLS reuse (TableBatch::trim_for_reuse capping retained dsts/srcs/retired vector capacities at 512 before returning to thread-local storage), slot_tabled_in, replace_kept/replace_kept_ref, make_at_into (preserving neutral_for stand-ins), make_listed_into, flush_table_batch (using CopyDescriptorsSimple for 1 descriptor and CopyDescriptors for multi-entry batches plus batched resource retirement), make_null_into, and constant_raw_at_into.
    • Adds table_batch_copies_and_retires_in_one_flush and table_batch_trim_for_reuse_caps_oversized_capacity.
  • crates/victory-gpu/src/host.rs & crates/victory-gpu/src/list.rs:
    • Adds HostList::list6, AddressHash on HostList::twins / States / Deferred::textures, and HostList::transition_copy / ensure_state_copy (preserving alias_tracker barriers).
  • crates/victory-gpu/src/draw.rs:
    • Updates prepare/prepare_for to return Option<&'static HostPipeline>.
    • Batches table descriptor copies/retirements with TABLE_BATCH + flush_table_batch and trims oversized scratch via batch.trim_for_reuse() before returning to TLS, uses list6 / slot_tabled_in / ensure_state_copy, removes dead listed_view, and defers selected.binary_search(&k) into lazy checks in both shared-table and fresh-table paths.

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 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 xtask policy --staged passed.
  • cargo clippy -p victory-gpu --no-deps --all-targets --locked and --all-features with -W clippy::undocumented_unsafe_blocks: 0 warnings in changed hunks (pre-existing workspace warnings on upstream/main live outside this PR).
  • cargo test -p victory-gpu --lib --locked descriptor:: -- --test-threads=1 -> 106 passed; 0 failed; 2 ignored (includes table_batch_trim_for_reuse_caps_oversized_capacity)
  • cargo test -p victory-gpu --lib --locked draw:: -- --test-threads=1 -> 25 passed; 0 failed; 2 ignored
  • cargo test -p victory-gpu --lib --locked list:: -- --test-threads=1 -> 20 passed; 0 failed; 0 ignored

Council review

Rounds: 5

Delegate Round 1 Round 2 Round 3 Round 4 (Rebase) Round 5
Concurrency & Safety Auditor (gpt-6-luna, xhigh) 8/10 9/10 9/10 10/10 10/10
Performance & Modernization Architect (gpt-6-luna, xhigh) 8/10 7/10 9/10 8/10 10/10
Upstream PR Hygiene & Test Critic (gpt-6-luna, xhigh) 7/10 8/10 8/10 10/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/2813) `Nosheboo:port/foxhound-table-batch-and-draw-hotpath` → `main` · +565 −162 · 4 files · 1 commits · open ## Motivation On upstream `55d06914`, baseline profiling measures `178.4–184.9 ms` across `30,689–33,221` `list::thin` calls per logging window alongside heavy per-draw descriptor creation/copy/retirement churn and redundant command-list hashing/lookup work. ## Changes - `crates/victory-gpu/src/descriptor/host.rs`: - Adds `TableBatch` with bounded TLS reuse (`TableBatch::trim_for_reuse` capping retained `dsts`/`srcs`/`retired` vector capacities at `512` before returning to thread-local storage), `slot_tabled_in`, `replace_kept`/`replace_kept_ref`, `make_at_into` (preserving `neutral_for` stand-ins), `make_listed_into`, `flush_table_batch` (using `CopyDescriptorsSimple` for 1 descriptor and `CopyDescriptors` for multi-entry batches plus batched resource retirement), `make_null_into`, and `constant_raw_at_into`. - Adds `table_batch_copies_and_retires_in_one_flush` and `table_batch_trim_for_reuse_caps_oversized_capacity`. - `crates/victory-gpu/src/host.rs` & `crates/victory-gpu/src/list.rs`: - Adds `HostList::list6`, `AddressHash` on `HostList::twins` / `States` / `Deferred::textures`, and `HostList::transition_copy` / `ensure_state_copy` (preserving `alias_tracker` barriers). - `crates/victory-gpu/src/draw.rs`: - Updates `prepare`/`prepare_for` to return `Option<&'static HostPipeline>`. - Batches table descriptor copies/retirements with `TABLE_BATCH` + `flush_table_batch` and trims oversized scratch via `batch.trim_for_reuse()` before returning to TLS, uses `list6` / `slot_tabled_in` / `ensure_state_copy`, removes dead `listed_view`, and defers `selected.binary_search(&k)` into lazy checks in both shared-table and fresh-table paths. ## 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 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 xtask policy --staged` passed. - `cargo clippy -p victory-gpu --no-deps --all-targets --locked` and `--all-features` with `-W clippy::undocumented_unsafe_blocks`: `0` warnings in changed hunks (pre-existing workspace warnings on `upstream/main` live outside this PR). - `cargo test -p victory-gpu --lib --locked descriptor:: -- --test-threads=1` -> `106 passed; 0 failed; 2 ignored` (includes `table_batch_trim_for_reuse_caps_oversized_capacity`) - `cargo test -p victory-gpu --lib --locked draw:: -- --test-threads=1` -> `25 passed; 0 failed; 2 ignored` - `cargo test -p victory-gpu --lib --locked list:: -- --test-threads=1` -> `20 passed; 0 failed; 0 ignored` ## Council review Rounds: 5 | Delegate | Round 1 | Round 2 | Round 3 | Round 4 (Rebase) | Round 5 | | --- | --- | --- | --- | --- | --- | | Concurrency & Safety Auditor (`gpt-6-luna`, `xhigh`) | 8/10 | 9/10 | 9/10 | 10/10 | 10/10 | | Performance & Modernization Architect (`gpt-6-luna`, `xhigh`) | 8/10 | 7/10 | 9/10 | 8/10 | 10/10 | | Upstream PR Hygiene & Test Critic (`gpt-6-luna`, `xhigh`) | 7/10 | 8/10 | 8/10 | 10/10 | 10/10 | Created in T3 Code (reviewed by Council: 3× gpt-6-luna on xhigh).
Ports TableBatch descriptor batching, slot_tabled_in, HostList::list6, AddressHash on HostList::twins/States/Deferred::textures, HostList::transition_copy / ensure_state_copy, and prepare() returning Option<&'static HostPipeline> from readmet3xt-lab/foxhound commit 6c67166d (PR #36, by Dilim0n, GPL-3.0-or-later), preserving upstream neutral_for stand-ins, alias_tracker barriers, and constant_raw_at batching.

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:13 +00:00
github-bot force-pushed github-bot/gh-2813 from f813e4cf22 to 8f84bd9084 2026-11-29 23:21:26 +00:00 Compare
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/descriptor/host.rs
  • crates/victory-gpu/src/draw.rs
  • crates/victory-gpu/src/host.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/2813/head:github-bot/gh-2813'
git switch 'github-bot/gh-2813'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2813'
git switch 'github-bot/gh-2813'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2813'
git switch 'github-bot/gh-2813'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2813'
git switch 'main'
git merge --squash 'github-bot/gh-2813'
git switch 'main'
git merge --ff-only 'github-bot/gh-2813'
git switch 'main'
git merge 'github-bot/gh-2813'
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!2813
No description provided.