card_steps: the two "late" tests forget what an earlier one learned of their pages (order-dependent failure) #3668
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3668"
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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Trillazill on 2026-11-30T03:26:48Z.
Fixes: the
card_stepspart of #3659.What it changes
host::card_steps::tests::places_written_after_sending_are_learnedpasses alone but fails now and then in a run of the whole crate, even single-threaded (--test-threads=1), so it depends on what an earlier test leaves behind, not on tests running side by side.Cause.
late::PAGES, the pages the title was found writing late, belongs to the process, and nothing ever empties it. With a temporaryeprintln!inlate::learnprinting the test thread's name, only two tests learn any pages:fills_done_on_the_cpu_are_learned_toolearns the page atpage + 4096of avecof its own, then lets thevecgo.places_written_after_sending_are_learnedruns after it in a one-thread run, and often gets the same addresses back from the allocator. Itschangedplace is on that same page, so its first assertion,!late::written(changed, ..)("nothing learned yet"), fails.Whether it happens depends on what the allocator hands back, which is why it comes and goes.
Fix. A test-only
late::forget(from, to)drops what was learned of a range. Both tests call it on their own memory before they start. Production code is unchanged.How it was tested
cargo test --locked -p victory-gpu --lib -- --test-threads=1 host::: on41adb551, 2 of 5 runs failed acard_steps"late" test; with this change, 0 of 5.late::landed_cpuwith bytes that differ, then asserted learned), the test fails 3 of 3 withoutforgetand passes 3 of 3 with it.cargo test --locked -p victory-gpu --lib -- --test-threads=1: 921 passed, 1 failed (shader_cache::tests::every_switch_of_the_translator_is_in_the_key, a stale key entry that fails on main too; #3385 / #3530).cargo clippy -p victory-gpu --all-targets: nothing new incard_steps.rs.cargo xtask policy --staged: ok.cargo testpassed for the crates it touches: yes, apart from the failure above that main has too.Checked for overlap
victory-gputest failures (memory contention between GPU tests), which this doesn't address.🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by davemathews12 on 2026-11-30T05:26:16Z.
I checked this by reading it, and it looks right to me:
late::PAGESis never emptied, and both tests allocate the samevec![0u8; 4 * 4096]. So whenfills_done_on_the_cpu_are_learned_tooruns first, the allocator very likely hands its block straight back toplaces_written_after_sending_are_learned, and that block's second page is already marked. The firstassert!(!late::written(changed, …))then fails. In the other order nothing fails.forgetremoves keysfrom / PAGE .. to.div_ceil(PAGE). That is the same page-index formwrittenandlearnuse, so it really clears what was learned.This is also what keeps #3530 (the CI fix) red, where
places_written_after_sending_are_learnedfailed. Merging this first should let #3530 go green. It merges cleanly withmain.Edit: As wrq2007 notes on #3530, this PR comes from a fork, so its test workflow hasn't run yet (only the label check is green). Could a maintainer approve the workflow run here? Once it's green and merged, #3530 can be re-run, and main should finally be green.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T05:49:50Z.
Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch
janus-prs). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with--profile diag --features diagnostics, and the CPU tests of the touched crates pass. A run on an RTX 4090 is queued (Series S with ray tracing, DLSS Quality). Frame times will follow here.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Trillazill on 2026-12-01T06:20:40Z.
Closing: #2486 (merged) adds the same
late::forgetisolation toplaces_written_after_sending_are_learnedandfills_done_on_the_cpu_are_learned_too.Pull request closed