Repository navigation
GPU in place: the heap is held until the submissions that could read through it have finished - #943
Open
HailLucifer666 wants to merge 2 commits into
Open
HailLucifer666 wants to merge 2 commits into
HailLucifer666 wants to merge 2 commits into
Conversation
HailLucifer666
added a commit
to HailLucifer666/victory-fork
that referenced
this pull request
Nov 25, 2026
The in-place heap fix and the MSVC environment script no longer travel together: fxceless#943 is the fix, fxceless#944 is the build script, each one commit, each one reviewable on its own.
triippywhale
pushed a commit
to triippywhale/victory-fork
that referenced
this pull request
Nov 25, 2026
…ntil the submissions that could read through it have finished Hand port of PalmVIDev 64f709832 (in fxceless#239; fxceless#943): a copy placed in a heap opened over title memory let the heap go the moment the copy went, while a submission still running could read through it. The heap now goes through the host's retirement queue (host::retire), which holds it until the submissions running then have finished; the buffer placed in it is a field and goes first. Its retirement-queue test is not ported: it rewrites the process-wide STARTED/FINISHED counters, which other host tests in the same process use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
notquiteog
added a commit
to notquiteog/VIctory
that referenced
this pull request
Nov 26, 2026
… the submissions that could read through it have finished (by HailLucifer666) Changed in porting: the one change to Shadow's drop is taken as it is (the heap of a copy in place goes to host::retire). The PR's test is left out: it expects a retirement with nothing running to drop at once, and here VICTORY_BURY_LAG (64 submissions by default) keeps every retirement. Only reached with VICTORY_INPLACE or VICTORY_STRETCH set; both are off by default. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…through it have finished A heap opened from the title's address locks those pages. While it stands, the title's own `VirtualFree` of them answers `ERROR_INVALID_PARAMETER` (87). When a placed buffer's shadow went, the heap was let go in the same breath, so a title that decommitted those pages in the next moment failed a call that should have worked. The heap now goes through the host's existing retirement queue, which holds it while a submission is running and drops it once that submission has finished. The buffer that stands in the heap is a field of the shadow, so the drop glue runs it after this call returns: buffer first, as it must be. Tested: `a_retirement_waits_for_the_submission_that_was_running` covers the queue this depends on, red when the queue is made to never wait. It does NOT cover this one-line wiring: that needs a shadow, which needs a whole host, and the title itself is the only end-to-end check.
HailLucifer666
force-pushed
the
perf/inplace-fence-retirer
branch
from
November 26, 2026 14:10
f021e65 to
de27629
Compare
Author
|
Rebased onto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 Clippy: main is clean again with -D warnings, with and without --all-features (3 lints) #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.