Skip to content

GPU: a list that binds a heap's view-address table keeps it until reset - #2329

Open
denkencar-sketch wants to merge 1 commit into
Marvisak:mainfrom
denkencar-sketch:fix/dhost-003
Open

denkencar-sketch wants to merge 1 commit into
Marvisak:mainfrom
denkencar-sketch:fix/dhost-003

Conversation

@denkencar-sketch

Copy link
Copy Markdown

Summary

The view-address table a list binds lived and died with its heap, which the title may release while the GPU still reads the table as a root view. A list that binds it now keeps it until reset. It is also made under the made-slots lock now, so a view noted meanwhile is not lost.

Testing

Test a_list_keeps_the_view_address_table_it_binds fails without the keep and passes with this change. The second part, holding the lock across the publish, is not covered by a test (it is right by reading).

cargo test --workspace --locked passes apart from known flakes: modules::dstorage::tests::a_page_list_filled_after_its_request_starts fails now and then on main too, and so does a parallel-run flake in victory-gpu's lib tests (watch:: and descriptor::host:: tests, 2 of 40 runs on pristine main).

This changes the same function as open PR #1906, so a small textual conflict is expected. Not tried: a run in the game.

AI-assisted.

The table lived and died with the heap, which the title may release while
the GPU still reads it as a root view. It is also made under the made-slots
lock now, so a view noted meanwhile is not lost.

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A list binding a heap's view-address table keeps it until published — lock ordering documented. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.

@DenRakEiw DenRakEiw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified against origin/main (940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:

  • Retaining the bound view-address table on the command list until reset cleanly prevents use-after-free when a heap's table is replaced while commands are still in flight.
  • cargo test -p victory-gpu draw::tests: 6/6 passed on RTX 5090, 6/6 passed on WARP (including a_list_keeps_the_view_address_table_it_binds).
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings.
  • cargo xtask policy: 183 files ok.

AI-assisted (Gemini 4 Neon).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants