[pr-tests] refresh_tests::unchanged_ranges_are_known asks under the watch journal's test lock (a watch:: test failed in 28 of 60 runs beside it) #262
Loading…
Reference in a new issue
No description provided.
Delete branch "blazecoding2009/Darner:pr/test-unchanged-ranges-view-lock"
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?
Contributor role (optional)
What it changes
The problem on main:
watch::ask_holds::asking_kept_fast_path_guards_ask_ahead_and_donefails by chance when it runs besidehost::refresh_tests::unchanged_ranges_are_known, in 28 of 60 runs ofwatch::'s tests with that one test here:That one 20 of the 28 times,
assertion failed: !is_kept()7 times and "ask_ahead disturbed kept asking" once.The other way round,
unchanged_ranges_are_knownfailed once in 8 whole runs of the crate's tests (host.rs:23219, "view false: taken":left: false, right: true).unchanged_ranges_are_knownasks the write watch (ask_once,ask_once_end) withone_submission's lock alone. The tests ofwatch::that ask holdwatch::one_view_test's lock and not that one, and the asking is one for the process, so the two end each other's. It is the only test of the crate that asks withoutone_view_test's lock:submissiontakes it since6ecada3, and the six tests ofrefresh_teststhat ask themselves take both.It now asks under
one_view_test's lock instead ofone_submission's. Every test that holdsone_submission's holds that one too while it asks, so those are kept out as before. Holding one lock, the test takes no part in the order of the two, so this needs nothing of #224 and adds nothing to what #224 fixes. Test code only: one closure inmod refresh_testsofhost.rs.How it was tested
Tested revision:
4efa7c7(this one commit onmainf3840d7).Commands and results:
cargo test --locked -p darner-gpu --lib --no-runon each revision, then that test binary run by itself with the filtershost::refresh_tests::unchanged_ranges_are_known watch::(89 tests, 2 s a run), 60 times each.f3840d7)4efa7c7)watch::ask_holds::asking_kept_fast_path_guards_ask_ahead_and_donefailedwatch::tests::ask_once_by_res_splits_reservations_without_refusalsfailed (#150 is about it)watch::watch_pipe_epoch_tests::ask_once_delta_reask_direct_carves_refreshes_and_updates_page_epochsfailedwatch::tests::single_pass_ask_once_caches_mixed_clustered_lone_and_unwatched_rangesfailedwatch::tests::an_asking_begun_first_is_made_and_more_is_asked_forfailedAll of the crate's tests on
4efa7c7, 6 runs with a 150 s limit: 4 passed whole, 1 stood still (what #224 is about) and in 1 another test failed (host::refresh_tests::refresh_front_zero_arc_matches_and_runs_due).unchanged_ranges_are_knownandasking_kept_fast_path_guards_ask_ahead_and_donepassed in the five that ended.Changes a default: no.
Gates run on that revision (the three in AGENTS.md; there is no CI):
cargo clippy --workspace --all-targets --locked -- -D warnings: passed. The same with--all-features: passed.cargo xtask policy: 555 files ok.cargo test --workspace --locked: not run as one command on this revision. Of it, I randarner-gpu's tests as above. Onmainthat gate fails or stands still by chance in this crate (#224 has the counts), and indarner-shaderone test fails, which #227 is about.Gameplay: not run in the game. The change is in test code only.
Shader wave sizes tested, when relevant: not relevant.
Hardware dependence: likely general. How often the tests meet depends on timing and on the number of test threads: 16 here (Ryzen 7 8845HS, Windows 11 build 26300).
Coverage gaps: one PC. I did not see
unchanged_ranges_are_knownitself fail often enough to count it before and after (once in 8 whole runs onmain, none in the 60 runs of the table on either side): the count is of thewatch::test it disturbed. The tests of the table that still fail on B have other causes: #150 is about the first, and I did not look for those of the others here.Checklist
main.docs/asset-policy.md.Checked for overlap
unchanged_ranges_are_known,asking_kept_fast_pathandflakyfound no report of it. I searched the diff of every open pull request (100): none changes this test orone_submission's users but #224, which changessubmission, another function of the same module. #150 and #261 are about other tests of the crate that fail by chance.This change was made with AI assistance (Claude Code).
🤖 Generated with Claude Code
Independent Windows build, gate, and code-read review of
4efa7c7f0(based onmainf3840d73d). Test-only change; not run in-game.Environment
x86_64-pc-windows-msvc), MSVC 19.44.35230.Measured results
cargo clippy --workspace --all-targets --locked -- -D warnings): PASScargo clippy --workspace --all-targets --all-features --locked -- -D warnings): PASScargo xtask policy: PASS (asset policy: 555 files ok)cargo test --locked -p darner-gpu --lib host::refresh_tests::unchanged_ranges_are_known: 20/20 PASScargo test --locked -p darner-gpu --lib -- unchanged_ranges_are_known watch::(89 tests, 10 runs):unchanged_ranges_are_known: 10/10 PASSwatch::ask_holds::asking_kept_fast_path_guards_ask_ahead_and_done: 10/10 PASS (0/10failures)watch::testsflakes observed (matching the PR's table):ask_once_by_res_splits_reservations_without_refusals(#150, 5/10),single_pass_ask_once_caches_mixed_clustered_lone_and_unwatched_ranges(1/10),an_asking_begun_first_is_made_and_more_is_asked_for(1/10).Code-read audit
one_submission()withcrate::watch::one_view_test()(crates/darner-gpu/src/host.rs:23215) holds only a single lock, so it cannot form an AB-BA deadlock cycle withsubmission()or #224. Because everyone_submission()caller inhost.rsalso acquiresone_view_test()while asking, this still excludesone_submission()callers as well aswatch::tests.let _view = crate::watch::one_view_test();is inside thelookclosure,title(8 * PAGE, view)(host.rs:23199), the inter-lookwrites (23228, 23234), and the trailingcopy.nothing_new(region, 6 * PAGE)(23237) still run outsideone_view_test(), unlike the other 6refresh_testsandwatch::one_view_test()'s documented scope (watch.rs:3012-3016). Hoistinglet _view = crate::watch::one_view_test();to the top ofunchanged_ranges_are_known(still a single lock) would cover the whole test cleanly.Verdict: PASS.
AI-assisted: yes (Gemini 4 Neon).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.