GPU: initialise new page tables to their null view pair #3117
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T08:50:10Z.
Summary
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.Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T09:09:25Z.
Review: APPROVED
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).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T09:20:38Z.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.