GPU in place: the heap is held until the submissions that could read through it have finished #942
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/943"
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 fxceless/victory-fork. Originally posted by HailLucifer666 on 2026-11-25T13:24:53Z.
Problem
A heap opened from the title's own memory locks those pages. While it stands, the title's
VirtualFree,VirtualProtector release of them answersERROR_INVALID_PARAMETER(87) — the module's own header says so, and the probe shows it.When a placed buffer's shadow went,
Shadow::droplet the heap go in the same breath as the buffer, without asking whether a queue had run the work that used it. A title that decommitted those pages in the next moment failed a call that should have worked.This is not hypothetical:
inplace::tests::warp_a_title_buffer_in_place_shows_its_bytes_at_its_offsetasserts that decommit and passes and fails on the same commit (3 of 6 full runs onf85101b6).What actually fixes it
host::retirealready exists (host.rs:209) — "Dropsobjectonce every submission running now has finished: at once if none is." No new retirement queue is needed; this branch adds none.Shadow::placedkeeps only the heap (place = Some((heap, bias))); the buffer that stands in it is a field of the shadow, so Rust's drop glue runs the buffer afterDrop::dropreturns. Retiring the heap inside that body therefore yields buffer-then-heap for free, which is the COM ordering rule: a placed resource must not outlive the heap it stands in.Four lines in
Shadow::drop.Tests
host::tests::a_retirement_waits_for_the_submission_that_was_running— the queue the fix depends on. Probe: make the queue never wait → red namingheld while a submission runs→ restored byte-identical (sha256 a8f68df6…).cargo test -p victory-gpu --lib inplace:: -- --test-threads=1→ 6 passed.cargo clippy -p victory-gpu --lib -- -D warnings→ only the two pre-existing (placed_filler_twins,sort_unstable_by_key), both owned by #841.What this does not cover
drop(placed)path, which never goes throughShadow::drop— so this does not make it redundant, and closing it on the strength of this would leave that path flaky.INPLACEheaps on the ≥ 1 TiB persistent alias for buffers only is not in this PR; that was the other half of the planned phase and is untouched.Measured, not asserted
cargo test -p victory-gpu --lib -- --test-threads=1on this head: 159 passed, 1 failed, 4 ignored — the failure beingindirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields, which fails onf85101b6too and is fixed by #849/#847.Imported from fxceless/victory-fork. Originally posted by HailLucifer666 on 2026-11-26T14:10:01Z.
Rebased onto
maina20809de; head is nowde276299(the two commits replayed). Two conflicts: a both-added tests block (main's card-sync test kept alongside the retirement test), andretire/bury, where main has since added theretire_lean/reaper_onfast paths inline while this PR extractedretire_into/bury_fromfor the test. Resolution keeps main'sretireverbatim (the lean path needs ownership of the object), keepsbury's lean path followed bybury_from, and marksretire_into#[cfg(test)]since only the test drives it. Verified:cargo checkandclippy -D warningsclean;a_retirement_waits_for_the_submission_that_was_runningpassed.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.