Memory: reject sparse and cross-window spans in texture::uma_bytes #1520
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1530"
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 OtavioTadeu on 2026-11-24T17:18:39Z.
Prevents
texture::uma_bytesfrom reading uncommittedWindowKind::SparseUMA reservations or cross-window spans, and returns an ownedVec<u8>instead of forging&'static [u8]over guest-mutable memory. Fixes #1393.What is in it
crates/xcl/src/gpu/uma.rs: addUma::contains_committed_spanand unit tests covering sparse windows, cross-window spans, zero-length, and overflowcrates/xcl/src/gpu/texture.rs: validate spans viacontains_committed_span, returnResult<Vec<u8>, String>viauma_bytes_in, and add unit testsTested
stable-x86_64-pc-windows-msvc), debug buildcargo test --workspace -- --test-threads=4: 778 passed, 0 failed, 41 ignored (SKIPPED GPU tests:gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask[no wave64],gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware[no wave64],heap_window_out_of_memory_falls_back_to_the_switch_form[no heap windows])cargo test -p xcl --lib uma: 12 passed, 0 failedcargo test -p xcl --lib texture: 31 passed, 0 failedRegression run
scripts/smoke.ps1 -Game retail_title -Seconds 60(mainbaseline vs PR head on NVIDIA GeForce GTX 1660 SUPER):Not tested
AI use
Imported from ivall/xcl. Originally posted by GonZiin on 2026-11-24T18:04:23Z.
Review: COMMENTED
Please reuse
Uma::in_committed_windowfor the new texture copy. The existing method checks the same committed-window condition, andchecked_spanalready checks the exclusive end for overflow before the texture code calls it. Keeping one predicate lets future UMA changes update the DirectStorage and texture paths together.Tested
3cf8012435545c359e5806910f48f210abb9d716.cargo test -p xcl --lib <filter> -- --test-threads=1withcontains_committed_span_rejects_sparse_and_cross_window_spansanduma_bytes_rejects_sparse_and_out_of_bounds_spans_and_copies_committed_data. Each reported 1 passed, 0 failed and 0 ignored on the clean head.in_committed_window. The same commands passed with the same counts, covering rejection of sparse, overflowing and cross-window spans and copying of committed bytes.Not tested
Full workspace, concurrent guest writes, and retail smoke.
AI use
Codex (
gpt-6.2-sol) compared the predicates, ran the targeted tests and drafted this review.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T19:05:49Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored.Thanks!
upstream-sync referenced this pull request2026-11-25 07:04:28 +00:00
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:00:30Z.
Triage (#1607) – head
3cf8012No open or merged PR makes the same change (#1393).
texture::uma_byteshas no callers on main, so the change has no runtime effect today; it removes a safe function that returned&'static [u8]over possibly uncommitted sparse windows and returns a copy instead. Thecontains_committed_spancheck rejects every sparse window, including committed reservations in them, which is fine for an unused helper but worth saying in the description.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by throny on 2026-12-02T08:58:52Z.
Two contributors checked independently and found that this PR makes the same change as #1400: #1607, group D222. They suggest keeping #1400. If you agree, closing this PR or joining the other one would save the maintainers a review. If the two differ in a way the checks missed, a note in #1607 helps.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Imported from ivall/xcl. Originally posted by throny on 2026-12-02T10:18:35Z.
Closing as a duplicate of #1400: #1607 group D222, checked by Foniass and Decodere, who both read the diffs and suggest keeping #1400. If something here is not in #1400, say so and reopen it, or ask and I will.
AI use: Claude Code (Claude Opus 5.5) ran the closing script.
Pull request closed