GPU tests: a batch's hold on a copy ends before its pool is freed #1913
No reviewers
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!1913
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1913/head"
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?
@Mericas77 on GitHub · 2026-11-25 00:46 UTC · original
fix/watch-test-race→main· +4 −1 · 1 files · 1 commits · closed without mergingSummary
On an RTX 4070,
cargo test -p victory-gpu --libin its default parallel mode fails intermittently inwatch::tests:writes_mark_every_tracker_of_their_page,writes_through_another_mapping_mark_the_trackerandkernel_reads_into_guarded_blocks_after_opening. They never fail with--test-threads=1.One cause is in
host.rs'sa_copy_is_refreshed_once_per_submission_by_the_pages_written. It keeps both of itsBatchvalues until the end of the test: the first one is shadowed, not dropped. ABatchholds anArc<Shadow>(inrefreshesandcurrent), so the copy watching the test's pool outlivescrate::watch::tests::free(p). A watch test running in parallel can then take the same addresses.With this change, the second batch replaces the first and is dropped before the pool is freed. It changes tests only; the runtime is unchanged.
Testing (RTX 4070, driver 621.01, Windows 11 26300)
cargo test -p victory-gpu --lib --locked, 20 parallel runs each:watch::testsfailure70564ae70564ae+ this PRcargo clippy -p victory-gpu --all-targets --locked -- -D warningsis clean.At
70564aethere is a second source: on NVIDIA,memory::tests::lists_share_a_table_and_copies_keep_their_viewspanics early because of the 1,000,000 view heap cap, and leaves watched memory behind. #1779 fixes that, which is why the flake is rarer on top of it. This change fixes the separate leak in the batch test.AI-assisted (Gemini found it; Claude Code verified it and wrote it up).
@Marvisak on GitHub · 2026-11-25 08:17 UTC · original
Automated triage for the maintainers.
Merge candidate.
This is a test-only fix in
crates/victory-gpu/src/host.rs, testa_copy_is_refreshed_once_per_submission_by_the_pages_written. Onmain, the secondlet mut batchshadows the first batch without dropping it. BothBatchvalues hold anArc<Shadow>(inrefreshes/current) until aftercrate::watch::tests::free(p).Shadow::drop(inshadow.rs) gives the watch marks back, so the pool is freed while still watched. The PR reuses the variable, which drops the first batch, and drops the second batch beforecopyand the pool. That matches the leak the PR describes, and the runtime is unchanged.CI:
checkfails, but only invictory-shader'ssynthetic_tests(gathers_at_a_level_match_the_hardware,permutes_read_the_lane_named_and_zero_from_lanes_left_out). This PR doesn't touch that code, and other PRs show the same two failures.Generated by Claude Code
Pull request closed