GPU: initialise new page tables to their null view pair #3119

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

@⁠fuzeofficlal on GitHub · 2026-11-26 08:50 UTC · original
fuzeofficlal:fix/gpu-page-table-null-init → main · +91 −0 · 1 files · 1 commits · open

Summary

Split out from #3106 per triage feedback.

Shared::new allocates the title-memory page table buffer and reserves a null descriptor pair (heap.pair()), but previously left the table buffer zeroed until the first Shared::rewrite. If a command list executes with that table before rewrite has ever run (for example when its view heap is released before its first prepare), every level-1 lookup resolves to block 0 and every block-0 entry has e.x == 0, causing translated shaders to index descriptor slot 0 instead of self.null.

Changes

  • crates/victory-gpu/src/memory.rs:
    • In Shared::new, point every level-1 entry at block 0 and fill all BLOCK entries of block 0 with [null, 0], matching write_table for an empty table.
    • Add memory::tests::new_table_routes_all_lookups_to_null_before_first_rewrite, verifying both the initial table contents and a SOURCE compute dispatch against an un-rewritten table with a non-zero buffer bound at slot 0.

Testing

  • Verified the new test fails on main (63bcca43) before the fix.
  • cargo test -p victory-gpu --locked --lib memory::tests -- --skip lists_share_a_table_and_copies_keep_their_views (RTX 5090): 8 passed, 0 failed.
  • VICTORY_D3D12_WARP=1 cargo test -p victory-gpu --locked --features diagnostics (WARP): 247 passed, 0 failed, 1 ignored.
  • cargo clippy --workspace --all-targets --locked -- -D warnings and --all-features: clean.
  • cargo test -p xtask --locked policy::tests::repository_passes_policy: passed.
**@⁠fuzeofficlal** on GitHub · 2026-11-26 08:50 UTC · [original](https://github.com/Marvisak/VIctory/pull/3119) `fuzeofficlal:fix/gpu-page-table-null-init` → `main` · +91 −0 · 1 files · 1 commits · open ## Summary Split out from #3106 per triage feedback. `Shared::new` allocates the title-memory page table buffer and reserves a `null` descriptor pair (`heap.pair()`), but previously left the table buffer zeroed until the first `Shared::rewrite`. If a command list executes with that table before `rewrite` has ever run (for example when its view heap is released before its first `prepare`), every level-1 lookup resolves to block 0 and every block-0 entry has `e.x == 0`, causing translated shaders to index descriptor slot 0 instead of `self.null`. ## Changes - `crates/victory-gpu/src/memory.rs`: - In `Shared::new`, point every level-1 entry at block 0 and fill all `BLOCK` entries of block 0 with `[null, 0]`, matching `write_table` for an empty table. - Add `memory::tests::new_table_routes_all_lookups_to_null_before_first_rewrite`, verifying both the initial table contents and a `SOURCE` compute dispatch against an un-rewritten table with a non-zero buffer bound at slot 0. ## Testing - Verified the new test fails on `main` (`63bcca43`) before the fix. - `cargo test -p victory-gpu --locked --lib memory::tests -- --skip lists_share_a_table_and_copies_keep_their_views` (RTX 5090): 8 passed, 0 failed. - `VICTORY_D3D12_WARP=1 cargo test -p victory-gpu --locked --features diagnostics` (WARP): 247 passed, 0 failed, 1 ignored. - `cargo clippy --workspace --all-targets --locked -- -D warnings` and `--all-features`: clean. - `cargo test -p xtask --locked policy::tests::repository_passes_policy`: passed.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:52:04 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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