GPU: initialise new page tables to their null view pair #3119
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3119
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3119"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@fuzeofficlal on GitHub · 2026-11-26 08:50 UTC · original
fuzeofficlal:fix/gpu-page-table-null-init→main· +91 −0 · 1 files · 1 commits · openSummary
Split out from #3106 per triage feedback.
Shared::newallocates the title-memory page table buffer and reserves anulldescriptor pair (heap.pair()), but previously left the table buffer zeroed until the firstShared::rewrite. If a command list executes with that table beforerewritehas ever run (for example when its view heap is released before its firstprepare), every level-1 lookup resolves to block 0 and every block-0 entry hase.x == 0, causing translated shaders to index descriptor slot 0 instead ofself.null.Changes
crates/victory-gpu/src/memory.rs:Shared::new, point every level-1 entry at block 0 and fill allBLOCKentries of block 0 with[null, 0], matchingwrite_tablefor an empty table.memory::tests::new_table_routes_all_lookups_to_null_before_first_rewrite, verifying both the initial table contents and aSOURCEcompute dispatch against an un-rewritten table with a non-zero buffer bound at slot 0.Testing
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 warningsand--all-features: clean.cargo test -p xtask --locked policy::tests::repository_passes_policy: passed.f0ed7f5931tofe530463ae@Dukestar69 on GitHub · 2026-11-26 09:09 UTC · original · approved these changes
Verified on RTX 5090 & WARP against
origin/main(63bcca4):cargo test -p victory-gpu --lib memory:: -- --test-threads=1 --skip lists_share_a_table_and_copies_keep_their_views: 8/8 passed on RTX 5090 and WARP (includingnew_table_routes_all_lookups_to_null_before_first_rewrite).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Cleanly initializes new page tables to the null view pair before their first rewrite.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@Marvisak on GitHub · 2026-11-26 09:20 UTC · original
Automated triage for the maintainers.
Merge candidate.
Shared::new(crates/victory-gpu/src/memory.rs) now writes level 1 and block 0 of a new page table so that every lookup resolves to the null pair, the same resultwrite_tablegives for a table with no copies. The case can happen. Lists keep their host heap alive (list.keepindraw.rs), butmemory::releasedrops theSharedentry when the title heap is dropped. A list recorded before that release then runs with a tablepreparenever rewrote, and every lookup lands on descriptor slot 0. The fill is 12,288 dwords once per table, so it costs little.new_table_routes_all_lookups_to_null_before_first_rewritechecks both the table contents and a dispatch against the un-rewritten table. It does not overlap #3122, and the two can both land.CI:
checkpassing.Generated by Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.