Tests: some_ranges in texture_upload wraps its generator instead of overflowing #2771
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2771
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2771"
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?
@inf1425 on GitHub · 2026-11-26 11:38 UTC · original
inf1425:tests/texture-upload-lcg-overflow→nvidia-dev· +1 −1 · 1 files · 1 commits · draftThe
some_rangeshelper intexture_upload's tests advances a linear congruential generator withn = n * 1103515245 + 12345, andngrows without bound. By the third loop pass it exceeds u64, and debug builds (cargo test) panic with "attempt to multiply with overflow". Both GPU tests that use the helper fail on a GPU. CI has no GPU, so they return before reaching it. The step now wraps, as such a generator should. Royalflamejlh reported this in #42 (comment) and proposed exactly this line. This PR applies it.What is in it
crates/xcl/src/hle/d3d12x/texture_upload.rs(inmod tests):n = n.wrapping_mul(1103515245).wrapping_add(12345). Test code only. The helper came in with73fc616f.Tested
cargo test -p xcl --lib texture_upload: 8 passed, 0 failed, in 3 runs. Without this PR,pieces_hold_the_texels_of_their_levelsandgpu_parts_of_a_texture_go_up_and_the_rest_staysfail.cargo test --workspace --no-fail-fast -- --test-threads=4at this PR's head: 1746 passed, 4 failed, 48 ignored. The failures are not touched here: the 2 late-release tests (#2770),d3d12_mesh_stream::console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly(#2632), and the flakyhle::kernelx::tests::memory_under_a_shown_page_is_told_to_sparse_before_it_goes, a race that #2772 fixes. That last test passed in 3 further lib runs and 10 runs on its own.XCL_HEAP_WINDOWS=1.Regression run
#[cfg(test)] mod testsand never reachesxcl.exe, butscripts/pr_check.pycounts any file undercrates/xcl/src/as runtime. Smoke blocks fromnvidia-devand from this head will be added once a title is available, unless a maintainer prefers thetest-onlylabel.main:
PR:
Not tested
AI use
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.