GPU: a list waiting on memory that cannot be read yet runs at once and is counted as an unknown comparison #2604
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#2604
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@BastienRodz on GitHub · 2026-11-25 16:41 UTC · original
What happens
ValueWait::holds(crates/victory-gpu/src/hold.rs, from9cc37c5) documents two distinct cases:It returns
Nonefor both, though (read(self.address, self.bytes)?). The caller can't tell them apart:Held::pumptakes everyNoneas an unknown comparison (done.unknown += 1, the segment counted as holding). So a list that waits (Wait32BitValueX/Wait64BitValueX) on memory that can't be read yet, for example a page not mapped yet, runs at once, before the work that would write the value. It is also counted as an unknown comparison in the frame's summary.Held::blocked(holds(..) == Some(false)) leaves such a wait out of the unmet ones.The unit test
comparisons_test_the_masked_valueassertsNonefor unreadable memory, so the code matches the test rather than the doc comment.Expected
The doc comment says memory that cannot be read is "taken as not holding": the queue should hold the segment until the memory reads and the comparison holds, or until the safety valve releases old heads. If releasing at once is the intent, the doc comment, and the summary's "unknown comparison" count, should say so instead.
Where
crates/victory-gpu/src/hold.rs:ValueWait::holds,Held::pump,Held::blocked.AI-assisted (Gemini 4 Neon found it, Claude Code reviewed and verified it); synthetic test only, no game data.
github-bot referenced this issue2026-11-26 05:10:09 +00:00
@Marvisak on GitHub · 2026-11-25 18:47 UTC · original · edited 2026-11-26 06:45 UTC
Automated triage for the maintainers.
Confirmed in
main(63bcca4), incrates/victory-gpu/src/hold.rs.ValueWait::holdsreturnsNonethroughread(self.address, self.bytes)?when the memory cannot be read.Held::pumpcounts everyNoneas an unknown comparison and runs the segment, andHeld::blockedonly listsSome(false). This contradicts the doc comment, which says memory that cannot be read is taken as not holding.PR #2693 was closed without being merged. Open PR #2605 (head
74ccd68, verified in a comment here on an RTX 4070) addresses the counting half only: an unreadable wait is now counted asunreadableand named in the frame warning, and its doc comment matches the code, but the wait still runs at once. The PR body saysFixes #2604; if it is merged as is, the "runs at once" half should stay open here or move to a follow-up issue. The last comment lays out the options for holding the work (hold with the 10 s valve, a shorter separate limit, or keep running until a title run reportsunreadablewaits).Generated by Claude Code
@pawrenity on GitHub · 2026-11-26 04:06 UTC · original
Comparative verification of the open PRs for this issue, against
mainat63bcca4.Hardware: NVIDIA GeForce RTX 4070, Windows 11 (rustc 1.98.1 MSVC, debug,
--locked). Unit tests only. No title run, no game data.-D warnings(victory-gpu, default +diagnostics)main74ccd68hold::tests::unreadable_waits_are_counted_apart_and_do_not_hold_workpasses.hold::/queue::/fence::18/18main: does not compile (needs the newPumped::unreadablefield). With the PR's files and only the two newpumparms removed: fails,left: (2, 2, 0)right: (2, 0, 1)(both waits counted as unknown)63bcca4)37f5700victory-hle), doesn't touchhold.rs/queue.rs. Closed on 2026-11-26.Full
cargo test -p victory-gpu --libat74ccd68: 229 passed, 3 failed, 1 ignored.maingives 229/2/1 (one fewer test).descriptor::host::tests::dynamic_slots_are_held_until_releasedandmemory::tests::lists_share_a_table_and_copies_keep_their_viewsalso fail onmainwhen run alone. They are the NVIDIA heap cap failures (#1744).frame::tests::waits_end_on_ticks_and_count_framesfailed only in the parallel run. It passed alone 3 times out of 3 with--test-threads=1, so it's a timing flake under load and not caused by this PR.Scope note: the head moved from
c5d0230(which held the queue until the memory read) to74ccd68. The current head deliberately keepsmain's behaviour. A wait on unreadable memory still runs at once (hold.rs:50still returnsNone), but it is now counted asunreadableinstead ofunknown(hold.rs:151-154), summed inAccount, and named in the frame warning (queue.rs:225-231,344-349). AnALWAYSwait is not counted. Its doc comment now matches the code. So this head fixes the "counted as an unknown comparison" half of the issue title. The "runs at once" half is left for a follow-up, pending title-run numbers, yet the PR body still saysFixes #2604. I found no correctness defect in the diff.Recommendation: #2605 (
74ccd68) is the only applicable PR. It is clean, tested, and merges as is. If it is merged, keep #2604 open, or open a follow-up for holding work until the memory reads, sinceFixes #2604would close the issue with that part unaddressed.AI-assisted (Claude Code).
@pawrenity on GitHub · 2026-11-26 04:33 UTC · original
Follow-up on the "runs at once" half of this issue: what holding the work would take, and why it isn't a code-only fix yet. Read against
mainat63bcca4, with #2605 at74ccd68. Static analysis only. No title run, no game data.Where it happens
crates/victory-gpu/src/hold.rs:50:read(self.address, self.bytes)?returnsNonewhen the memory cannot be read.hold.rs:146-150:Held::pumptreats thatNonelike an unknown comparison, so the segment runs (#2605 counts it asunreadableand still runs it).hold.rs:210:Held::blockedlists onlySome(false). A wait on unreadable memory therefore never starts the 2 ms timer either (queue.rs:237-246).Why the hold was dropped (from the history of #2605 and #2693)
c5d0230both made an unreadable wait returnSome(false)(Some(comparison == ALWAYS)after theALWAYSreview). The queue was then held until the memory could be read.VALVE= 10 s (queue.rs:186-191), forced inqueue.rs:200-203. So each such wait would stall its queue, and every fence behind it, for 10 s per occurrence. Today it runs at once.host::read_intoisReadProcessMemoryon our own process, title memory is unified, so a never-readable address is one the title never commits) is plausible but unverified. I found noVirtualProtect/PAGE_NOACCESSon title memory invictory-gputhat would make such reads fail only for a while.74ccd68) chose to keepmain's behaviour and to hold the work "once a title run shows non-zerounreadablecounts".Options
c5d0230). Small change (hold.rs:50plus theALWAYScase), and it matches the original doc comment. Risk: 10 s stalls if the memory never becomes readable.Heldto track why the head is held (the per-item state is only(Item, Instant, fresh)today,hold.rs:95).unreadableandforcedcounts in a title run.unreadable > 0alone would show the case exists. Whether the memory later becomes readable would need one more signal: for example, a debug log of the address on the first unreadable test, compared againstread_valuein the frame summary (queue.rs:327already printsis {:?}for blocked waits).Assessment
Holding the work is a two-line change and needs nothing from #2605 to work. What it still lacks is a decision on the stall, not code. Option 1 brings back the risk the triage deferred. Option 2 needs a limit that only run data can set. Until a run reports
unreadable, option 3 (the current plan) looks like the right order. If a run shows the memory becomes readable soon after the wait is tested, option 1 or option 2 with that measured limit can stack on #2605: returnSome(false)fromholdsfor unreadable memory (exceptALWAYS), move theunreadablecount to the test that holds, and adapt #2605's test to "held while unreadable, runs once readable" (asan_unreadable_wait_holds_its_queue_until_readabledid inc5d0230).I found no other open PR on this half. #2693 is closed in favour of #2605. #2611 is closed. #2608 deals with segment splitting after read-backs, not unreadable waits.
AI-assisted (Claude Code).