victory-gpu: O(log R) BlockRuns guard cache and fix VICTORY_D3D12_DRED=0 #685

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

@⁠Claudinhomerq on GitHub · 2026-11-25 04:29 UTC · original
Claudinhomerq:perf/watch-block-runs-and-dred → main · +264 −38 · 2 files · 1 commits · open

Summary

  1. O(log R) BlockRuns interval map for guarded clean blocks (crates/victory-gpu/src/watch.rs)

    • Replaces Guards::clean: BTreeSet<usize> with BlockRuns (disjoint, maximally merged half-open [start, end) intervals).
    • Checking a clean guarded view heap is now a single O(log R) range lookup with zero heap allocations, instead of collecting every clean block index into a temporary Vec<usize>.
    • Fast-paths known guarded view memory in writes() so guaranteed-to-fail GetWriteWatch kernel calls are skipped when the range is already covered by BlockRuns or known protected/absent blocks (respecting VICTORY_GUARD_ASK=1).
    • Adds unit test watch::tests::block_runs_merge_split_and_skip_clean_ranges.
  2. Respect VICTORY_D3D12_DRED=0 (crates/victory-gpu/src/host.rs)

    • dred_on() previously checked .is_some(), which kept DRED active even when explicitly set to VICTORY_D3D12_DRED=0. Now checks .is_some_and(|v| v != "0").

Verification

  • cargo xtask policy — asset policy: 169 files ok
  • cargo test -p victory-gpu --lib -- watch::tests — 7 passed; 0 failed
**@⁠Claudinhomerq** on GitHub · 2026-11-25 04:29 UTC · [original](https://github.com/fxceless/victory-fork/pull/685) `Claudinhomerq:perf/watch-block-runs-and-dred` → `main` · +264 −38 · 2 files · 1 commits · open ## Summary 1. **O(log R) `BlockRuns` interval map for guarded clean blocks (`crates/victory-gpu/src/watch.rs`)** - Replaces `Guards::clean: BTreeSet<usize>` with `BlockRuns` (disjoint, maximally merged half-open `[start, end)` intervals). - Checking a clean guarded view heap is now a single O(log R) range lookup with zero heap allocations, instead of collecting every clean block index into a temporary `Vec<usize>`. - Fast-paths known guarded view memory in `writes()` so guaranteed-to-fail `GetWriteWatch` kernel calls are skipped when the range is already covered by `BlockRuns` or known `protected`/`absent` blocks (respecting `VICTORY_GUARD_ASK=1`). - Adds unit test `watch::tests::block_runs_merge_split_and_skip_clean_ranges`. 2. **Respect `VICTORY_D3D12_DRED=0` (`crates/victory-gpu/src/host.rs`)** - `dred_on()` previously checked `.is_some()`, which kept DRED active even when explicitly set to `VICTORY_D3D12_DRED=0`. Now checks `.is_some_and(|v| v != "0")`. ## Verification - `cargo xtask policy` — `asset policy: 169 files ok` - `cargo test -p victory-gpu --lib -- watch::tests` — `7 passed; 0 failed`
- Replace Guards::clean BTreeSet<usize> with a merged interval structure (BlockRuns) so checking/skipping clean guarded blocks is O(log R) with zero per-call Vec allocation, and add a unit test covering merge/split/skip invariants.
- Fast-path clean guarded view memory in writes() without failing GetWriteWatch kernel calls (preserving VICTORY_VIEW_KNOWN and VICTORY_GUARD_ASK=1).
- Fix Host::dred_on() to check != "0" instead of is_some(), so explicitly setting VICTORY_D3D12_DRED=0 in diagnostics builds does not enable DRED notes overhead.

Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:48:58 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host.rs
  • crates/victory-gpu/src/watch.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/685/head:github-bot/gh-685'
git switch 'github-bot/gh-685'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-685'
git switch 'github-bot/gh-685'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-685'
git switch 'github-bot/gh-685'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-685'
git switch 'main'
git merge --squash 'github-bot/gh-685'
git switch 'main'
git merge --ff-only 'github-bot/gh-685'
git switch 'main'
git merge 'github-bot/gh-685'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.