Tests: some_ranges in texture_upload wraps its generator instead of overflowing #2761
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from ivall/xcl. Originally posted by inf1425 on 2026-11-26T11:38:29Z.
The
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
Imported from ivall/xcl. Originally posted by MarcosMDev on 2026-11-26T12:25:35Z.
Test report:
6b2691eagainst its baseaf2ceccon a desktop RTX 4060 (Windows): the 2texture_uploadtests fail 10 of 10 on the base and pass 10 of 10 here; full suite, no new failure. No title was run.Debug, each tree in its own worktree and target folder,
cargo build --workspace --lockedfirst.cargo test -p xcl --lib hle::d3d12x::texture_upload::tests, 10 times in a row: base 6 passed, 2 failed every time (attempt to multiply with overflowattexture_upload.rs:1002); head 8 passed, 0 failed every time.cargo test --workspace --locked --no-fail-fast -- --test-threads=4: base 1745 passed, 6 failed, 48 ignored; head 1747 passed, 4 failed, 48 ignored. The 4 left are the 2 late-release tests (counted 3 times; #2770) andconsole_ms_in_as_slot_and_ms_with_as_are_refused_cleanly. Thekernelxrace you mention did not fail here. The same 30 SKIPPED lines on both.The change is inside
#[cfg(test)] mod tests, and in a release buildn * …already wraps, so the generator's values are the same there as before.RTX 4060 8 GB (driver 621.01), Ryzen 7 5700X, 24 GB, Windows 11 26200, rustc 1.100.0, DXC 1.9.2609.5.
Not tested: a release build, AMD, any title, so no smoke blocks from me.
AI use: Claude Code (Claude Opus 5.5) ran the tests and drafted this; I read it before posting.
Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-26T13:19:13Z.
Review: COMMENTED
Current-base follow-up: the two overflow fixtures pass with this one-line fix; fresh CI is still required.
PR head
6b2691e18b02fd5f5efcca5c8e27db93e3ce727awas applied unchanged to NVIDIA baseba9d1f9473ebeb73fd5216c13a367d968f0a1c07in an isolated worktree. The resulting tree is4774827509d8959140f3ddb5401c2aa8006c1752; its only difference from that base is the wrapping LCG arithmetic in the existing test helper.texture_upload.rs:1002, in the two tests below.hle::d3d12x::texture_upload::tests::pieces_hold_the_texels_of_their_levelschecks CPU layout/fill using D3D12 resource layouts.hle::d3d12x::texture_upload::tests::gpu_parts_of_a_texture_go_up_and_the_rest_stayschecks bounded texture uploads/readbacks.Commands (private target directories replaced by placeholders):
Windows build 26200 x64, Intel Core i5-10400, RTX 3060 Ti (driver 32.0.16.1714), Rust 1.100.0 MSVC, debug profile with debug symbols disabled. The baseline runtime logs identify that adapter. The two focused fixtures do not log their selected adapter and can fall back to WARP, so their result is functional evidence, not independently confirmed NVIDIA execution.
The old CI attempt tested a merge into
af2cecc4and aborted on Microsoft Basic Render Driver after a 3 GiB sparse reservation. The currently advertised PR merge ref also predates merged #2837, which fixes that test helper's software-adapter classification. A fresh current-base CI event is needed; retrying the old run retains its old checkout. The planned close/reopen refresh preserves this draft and the contributor's history, followed by renewed review of thetest-onlylabel under CONTRIBUTING. No test filter or assertion is being weakened.Not yet established: the full patched workspace suite, fresh required CI, AMD, gameplay, or general driver compatibility. This update is not a merge approval.
AI use: Codex (GPT-6) inspected the source, coordinated the local checks and audited their logs. Optional temporary Discord for coordinating contributor work, testing and comparing results.
upstream-sync referenced this pull request2026-11-26 14:02:15 +00:00
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-26T17:51:07Z.
Linux (Wine) dual-lane run at head
6b2691e1Suite:
cargo test --release --locked -p xcl --lib --target x86_64-pc-windows-gnu -- --test-threads=2 --skip gpu::, compared to today'snvidia-devbaseaf2cecc4runs on the same machines.Results: rig 869/6 = base exactly; boxb 865/10 = base exactly; red sets byte-identical on both lanes. The
some_rangesgenerator fix changes no observable outcome on either Wine lane — no overflow was ever hit here, consistent with a latent wrap that Windows's larger default ranges or timing would surface first.One thing to flag from our lane: the NVIDIA box keeps
texture_upload::tests::gpu_parts_of_a_texture_go_up_and_the_rest_staysred on Pascal (it is in our standing 10-red set on this branch, red before and after this PR). That test lives in the same file this PR's helper change touches, so if you are auditingtexture_uploadtest health, that one is a vendor-dependent red nobody has root-caused yet; it is not caused or fixed by this PR.Not tested: behavior at the wrap boundary itself (we could not trigger it under Wine either way).
AI use: Hermes agent (local Qwen-class) ran the tests and drafted this; I checked it before posting.
Imported from ivall/xcl. Originally posted by efsebayern on 2026-11-26T18:54:44Z.
Independent Windows/NVIDIA check on the newer
nvidia-devsnapshoteae015021c639866ab061cdff2e9daf8ba9daac5. I compared the clean snapshot against a separate worktree at the same commit containing only the one-linetexture_upload.rschange from6b2691e18b02fd5f5efcca5c8e27db93e3ce727a.Windows 11 Pro build 26200, i7-13700K, RTX 4080 SUPER (driver 610.88), 32 GB RAM, Rust 1.98.1 MSVC, debug. With
XCL_ADAPTER=NVIDIA, I ran these two tests in a single process with--test-threads=1 --nocapture:hle::d3d12x::texture_upload::tests::gpu_parts_of_a_texture_go_up_and_the_rest_stayshle::d3d12x::texture_upload::tests::pieces_hold_the_texels_of_their_levelsClean snapshot: 0 passed, 2 failed, 0 ignored. Both hit “attempt to multiply with overflow” at
texture_upload.rs:1002. With the PR change: 2 passed, 0 failed, 0 ignored, with no skip notices. I did not run the workspace suite or a title for this report.AI use: Codex (exact model variant unknown) prepared the worktrees, ran the checks and wrote the report.
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-27T17:33:06Z.
merge-check
base:
d1be810364(nvidia-dev)head:
6b2691e18bmerge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1824 passed, 8 failed, 48 ignored (the harness lines summed; two of the failing tests re-run themselves in a child process and count twice). Failing, 6 distinct, all also failing on the base with the same names: lib
gpu::recomp::link_tests::gpu_linked_memory_accessors,gpu::recomp::link_tests::linked_programs_keep_their_declarations;d3d12_mesh_stream:console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly(#2788's);gpu_compute_e2e:async_compute_pso_registers_real_pso_and_not_standin,split_compute_prefers_the_offline_whole_pipeline;gpu_two_pass_cache_e2e:two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs. The base (1822 / 10 / 48) also failshle::d3d12x::texture_upload::tests::gpu_parts_of_a_texture_go_up_and_the_rest_staysandpieces_hold_the_texels_of_their_levels("attempt to multiply with overflow" insome_ranges); both pass with this PR.review: none. Test-only, one line: the
some_rangesLCG step wraps. In a release build the old line already wrapped, so the ranges the tests use are the same values as before; only the debug build's overflow panic goes. Read the whole diff.performance: none, test-only.
verdict: safe to merge. With #2837, #2788 and #2773 it makes
nvidia-dev'sBuild and test (Windows, no GPU)pass (fork run of the four: https://github.com/Kalmarv/xcl/actions/runs/46032822388).hardware / tool and model: NVIDIA GeForce RTX 5070 Ti, driver 610.74, Ryzen 9 9950X, Windows 11 Pro 26200, rustc 1.99.0; the build and tests were run in one queue job by a teammate agent (strange: Claude Code, Claude Opus 5.5) with the same commands, and Claude Code (Claude Opus 5.5) read the logs and the diff and wrote this check.
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-27T20:24:23Z.
@inf1425 this PR is one of four test-only fixes that together make
nvidia-dev'sBuild and test (Windows, no GPU)pass (#2837, #2771, #2788, #2773; fork run with all four ond1be8103: https://github.com/Kalmarv/xcl/actions/runs/46032822388), and #3041's queue holds everynvidia-devPR until that job is green. It has a merge check above ("safe to merge"). #3041 does not list drafts, so if you consider it done, marking it ready for review would let it be merged; #2837 is now ready.AI use: Claude Code (Claude Opus 5.5) wrote this comment.
Imported from ivall/xcl. Originally posted by throny on 2026-11-27T21:28:16Z.
merge-check claim
head:
6b2691e18bImported from ivall/xcl. Originally posted by throny on 2026-11-27T21:49:01Z.
merge-check
base:
d1be8103(nvidia-dev)head:
6b2691e18bmerge: clean (alone, and together with the other three)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1826 passed, 6 failed, 48 ignored: the two texture_upload tests that fail on the base (overflow panic in the test's generator in a debug build) pass with it; the rest are the base's failures. base (nvidia-dev
d1be8103) alone on this GPU: 1824 passed, 8 failed, 48 ignored; failing there: async_compute_pso_registers_real_pso_and_not_standin, split_compute_prefers_the_offline_whole_pipeline, two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs, console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly, and two texture_upload tests. All four test fixes together (#2837 + #2771 + #2788 + #2773): 1827 passed, 5 failed, 48 ignored; only the first three names remain, and they fail on the base too.review: none. One line in a test helper: the generator's multiply and add wrap instead of overflowing.
performance: none (test only).
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code (Claude Fable 5.2): merge, build, suite and the review of this small diff; nothing run on the GPU beyond the suite.