Repository navigation
Conversation
a_copy_is_refreshed_once_per_submission_by_the_pages_written kept both of its Batch values (the first shadowed, not dropped) until the end of the test, after crate::watch::tests::free(p). A Batch holds an Arc<Shadow>, so the copy watching the pool outlived the pool, whose addresses a watch test running in parallel could take. The second batch now replaces the first, and is dropped before the pool is freed. On an RTX 4070: `cargo test -p victory-gpu --lib`, 20 parallel runs, watch::tests failures in 11 of 20 at 70564ae, 0 of 20 with this change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PRMwrhHQKoSVGhHr7Xy53Z
catminou4
left a comment
There was a problem hiding this comment.
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
GPU test: a batch's hold on a copy ends…: test-only GPU coverage for copy lifetime — good.
…ends before its pool is freed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mercuryVM
left a comment
There was a problem hiding this comment.
Tested 27ccf62 on Windows 11, RTX 5070, MSVC: builds, clippy -D warnings clean with and without --all-features, cargo test --workspace --no-fail-fast 730 passed on our fork main; the 9 failures are the ones that fail on that main without this PR (host validator and environment).
- The diagnosis is right. The first
Batchwas shadowed, not dropped, so itsArc<Shadow>kept the copy, and through it the watch on the test's pool, alive pastwatch::tests::free(p). A parallel watch test could then reuse those addresses. - Reassigning
batchdrops the first one at the assignment, and the explicitdrop(batch)beforedrop(copy)andfree(p)releases the last hold in the right order. Test only.
Merged into our fork's main.
AI-assisted (Claude Code).
…its pool is freed
|
Automated triage for the maintainers. Merge candidate. This is a test-only fix in CI: Generated by Claude Code |
…its pool is freed
Summary
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).