victory-gpu tests of the global guard state fail at random in parallel (10 tests, real Windows machine): a BESIDE bit outlives its view, and more #321
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX#321
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?
@compaccount1-coder on GitHub · 2026-11-26 16:32 UTC · original
Summary
On a real Windows machine,
cargo test -p victory-gpu --libfails now and then on tests of the process-global, address-keyed guard state (watch::tests, and onedescriptor::hosttest). Which test fails changes from run to run, and every one of them passes when run alone. They are not GPU tests, so the CI runners can hit them too (#277 cites one such CI run). When main's CI turns green (#169, #241, #298), these will make the default (parallel) job red at random for PRs that don't touch this code.Where they came from
I ran every open PR that touches
victory-gpumerged ontomain(c9c932c), one after another, on an RX 6700 XT (Windows 11, Ryzen 5 9600X, 32 GB). The machine was busy during most of these runs, with a build or a second test run beside the suite. None of these failed in 5 full runs ofmain's GPU crate. So load makes them more likely, but this is not a GPU or driver matter: these tests don't use the GPU.Failures in PRs that do not touch this code (64 PR runs so far):
watch::tests::what_the_kernel_writes_through_is_not_guarded_for_another_viewwatch::tests::freed_memory_leaves_no_noteswatch::tests::other_memory_at_a_guarded_address_keeps_its_protectionwatch::tests::a_write_through_another_view_is_reported_at_the_guarded_onewatch::tests::a_write_opens_the_view_it_goes_throughwatch::tests::a_block_just_written_restswatch::tests::kernel_reads_into_guarded_blocks_after_openingwatch::tests::bits_go_at_every_viewhost::refresh_tests::unchanged_ranges_are_knowndescriptor::host::tests::views_off_their_elements_get_a_copy_of_their_bytesThe PRs named here were each rerun: the failing test passes 5/5 alone, and most full reruns are clean.
One hang:
what_the_title_puts_in_beside_a_guard_is_toldspins in its unboundedput_besideretry whenput_besidekeeps answeringCannot. That happened twice in early runs of #277 and never in 40 later ones. #315 makes that loop fail after 30 s with whatput_besidelooks at, instead of hanging the job.What I checked about the cause
#277 makes the case that a test's fresh memory can land on an address another test just gave back and inherit its notes. One mechanism of that kind is confirmed here:
put_besidesetsBESIDEfor every view of the page.guard()clears it withBESIDE.takewhen it next refreshes the block.title_memory_changed(behindtitle_memory_remappedandtitle_memory_unmapping) andtitle_memory_freedclear the block'sabsent/held/foreign/aliasednotes, but notBESIDE.drop_views, then the nexttwo_views(BLOCK). Windows handed back the same two addresses, andBESIDEwas still set on both.In the runtime that costs at most one spare refresh, because the remapped block is reported anyway. For the tests it is the kind of leftover #277 clears with
title_memory_made_anew. But #277 calls that fromtitle(),with_holes()andplaceholder(), not fromwatch::tests::two_views(), where most of the tests above get their memory.It doesn't explain everything, though. The new memory's first
guard()takes the stale bit, andwhat_the_kernel_writes_through…fails at its secondguard()(watch.rs:5051,left: Some([page]) right: Some([])). So something must mark the page between the two calls while another test is running. I haven't pinned down what.Options
two_views()(and to any other helper that makes memory for these tests), and clearBESIDEthere too. #277's helper already clears it.watch::testsandhost::refresh_tests) until the cross-test leaks are found.victory-gpu's lib tests with--test-threads=1in CI. The diagnostics job already does.If it helps, I can run any candidate fix through the same loop on this machine and report the counts.
AI-assisted: yes (Claude Code)
github-bot referenced this issue2026-11-26 18:09:47 +00:00
@felicerosella on GitHub · 2026-11-26 18:02 UTC · original
Results on NVIDIA for the open fixes, alone and together:
cargo test -p victory-gpu --lib, parallel (default threads), on an RTX 4070 SUPER, Ryzen 7 7800X3D (16 threads), 64 GB, Windows 11 26200,mainatc9c932c/2de9980(victory-gpuis the same in both).mainno_write_is_lost_with_port_72,unchanged_ranges_are_known1,other_memory_at_a_guarded_address_keeps_its_protection1,records_copied_as_bytes_are_made_at_the_next_sync1no_write_is_lost_with_port_75,unchanged_ranges_are_known1,freed_memory_leaves_no_notes1what_is_left_alone_is_no_known_hole1a_view_being_split_leaves_its_pages_unguarded_elsewhere1 (run 47)refreshed_ranges_hold_title_memory'sask_onceended other tests' standing asking. It accounts forno_write_is_lost_with_port_7, a new test that isn't in the list above and fails 20/20 when run with that one test, and forunchanged_ranges_are_known.foreign/PUBLISHEDnotes in fresh test memory. #328 covers the staleBESIDEbit found in this issue, and also clears it in the runtime.forget_viewsinwatch.rs. Whichever lands second needs a trivial rebase: keep both functions.Together the three take this machine from about 1 failing run in 4 to 1 in 50. The one failure left,
a_view_being_split_leaves_its_pages_unguarded_elsewhere, came once in 50 runs: too rare to bisect from here. I haven't tried them on AMD, or on the CI runners with WARP.AI-assisted: yes (Claude Code)
@kilolimaVI on GitHub · 2026-11-26 20:05 UTC · original · edited 2026-11-26 20:09 UTC
AMD data point (Radeon 780M iGPU, RDNA3, Ryzen 7 8845HS, Windows 11, toolchain 1.98.1): full
cargo test -p victory-gpu --lib --locked, default parallel threads, 20 runs per variant.Deterministic on this GPU, every run of every variant (so not part of the race):
descriptor::host::tests::views_are_made_beside_the_heap_and_copied_infails atdescriptor/host.rs:5434("copied as it was made"): the staged view's bytes differ from the slot's on this card. This test came in with02f36e4and may assume something about the 7900 XTX's descriptors.Intermittent failures besides that one:
watch::port7_tests::no_write_is_lost_with_port_74xkernel_reads_into_guarded_blocks_after_opening2x,views_off_their_elements_get_a_copy_of_their_bytes1x,a_view_being_split_leaves_its_pages_unguarded_elsewhere1x,what_is_put_in_beside_the_guards_is_told_at_every_view1xviews_off_their_elements_get_a_copy_of_their_bytes2x#347 conflicts with #342 in
host.rs, so #347 + #342 wasn't run. 20 runs is a small sample; happy to run more on any combination.@ending3729 on GitHub · 2026-11-26 22:03 UTC · original
Thanks for the AMD 780M data point @kilolimaVI!
Since your run I pushed two small follow-up fixes to
#347(8a86a45for the 1-in-75drop_views/g.changingrace @felicerosella caught on NVIDIA, and3345a6dfor a 1-in-100 ABA race inlook_at_holesthat showed up inno_mapping_is_lost_between_askers).On
3345a6d,cargo test -p victory-gpu --lib --locked -- --skip views_are_made_beside_the_heap_and_copied_injust passed 100/100 consecutive parallel runs on my RX 6600 XT / Ryzen 5 7500F (Windows 11). If you feel like doing a bigger batch on the 780M,3345a6dis the latest — no pressure either way.@kilolimaVI on GitHub · 2026-11-27 10:52 UTC · original
@ending3729 100-run batch on the latest head of #347,
14cdb13(so including3345a6dand the14cdb13follow-up): AMD Radeon 780M (RDNA3 iGPU), Ryzen 7 8845HS, Windows 11, toolchain 1.98.1.cargo test -p victory-gpu --lib --locked -- --skip views_are_made_beside_the_heap_and_copied_in, default parallel threads: 0/100 failures.For comparison, on main the same suite had
no_write_is_lost_with_port_7fail 4 times in 20 runs here. The skipped test is the one that fails deterministically on this card (descriptor/host.rs:5434), unrelated to the race.AI-assisted (Claude).