texture tests: hold the title lock and skip the probe deadline in the hot-texture tests #308
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/308"
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 LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-27T10:51:41Z.
Refs #307
Two hot-texture tests in
native::texture_testssometimes failed their "at once" and "at the next submission" asserts:a_texture_rewritten_whole_is_read_whole_only_now_and_thena_texture_uploaded_blank_is_probed_at_each_submissionBoth had two causes, and both come from the
Titlethe texture tests share. Traces inprobe_roundandsync_applyshowed both. Details are in #307.a_hot_texture_is_probed_at_each_submission_among_hundredsstay hot forHOTsubmissions after it releasesAGING. Under load,PROBE_BUDGETcut a round short after 61 of about 215 hot textures, and the test's texture was one of the 154 not visited. The tests now sync withsync_dirty_without_probe_deadline, as the 200-texture test already does.with_titlecalls and uploaded the write the samples missed. The test's next sync then spent the follow-up whole read on it and found nothing new, so the texture went back to a whole read everyWHOLE_EVERYprobes. The next write then waited. The tests now hold the title lock from their first write to their last assert.The asserts are unchanged, and so is the production probe code. The deadline behaves as its doc comment says (a documented shortcut). Serialising the tests the way
c1f930bdid would not help: the textures stay hot afterAGINGis released, and the tests that submit in between don't take that lock. A note is added todocs/native-host.md.Overlap. #252 keeps the deadline and doesn't make the tests hold the title lock, so it doesn't fix this. #301 touches the same file, but not these tests.
Reproduction. Native arm64, victory-gpu lib test binary with
--test-threads=8, with a loopingcargo build -j6of other crates alongside:..._rewritten_whole_......_uploaded_blank_...c1b9587, 200 runsce2b786, 200 runsIn the 500-run loop,
native::textures::tests::a_known_partial_chunk_skips_the_whole_read_until_every_page_is_readablefailed once. It is a page-protection test that doesn't use the sharedTitleor anything changed here. It didn't fail in the 400 baseline runs. I haven't looked into it.Checks:
cargo test -p victory-hle -p victory -p victory-gpu -p xtask(native arm64),cargo clippy --workspace --all-targets --target x86_64-pc-windows-gnullvm -- -D warnings,cargo xtask policy.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T11:54:09Z.
Thank you for tracing this to the other tests' hot textures and for holding the title lock in the two tests.
I will wait for the loop result on the current head before this leaves draft. Please post the number of failures and runs for both tests when it finishes, with the same load as in #307. The deadline itself is no longer covered by these two tests; please say in the description which test still covers it.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T13:06:51Z.
Merged into main as of
d35ba927(bb1a6ddf), from the head before your latest commit92795938, so GitHub still shows this open with one commit left.Loop result on the merged head,
texture_testsmodule, 8 threads, 4 CPU burners alongside: 500 runs, 0 failures of the two tests this fixes. Main under the same load, 300 runs:rewritten_wholefailed 11 times anduploaded_blank2. A third test,a_texture_blank_for_thousands_of_submissions_is_still_probed, fails on both (5 of 500 here, 2 of 300 on main); it is an older flaky test this PR does not touch.If
92795938is still needed, rebase it on main and I will take it; otherwise please close this. Thank you.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-27T13:23:53Z.
Merged in
bb1a6ddf. The remaining commit only updates the measured figures in docs/native-host.md, so closing.Pull request closed