GPU Tiling: enforce tail depth bounds and linear base_xor safety #1624
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!1624
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1624"
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?
@slopgobblercobbler on GitHub · 2026-11-24 18:23 UTC · original
slopgobblercobbler:fix/tiling-tail-depth-and-linear-safety→main· +164 −19 · 1 files · 1 commits · openSummary
Audits 3D thick texture mip-tail depth bounds, linear swizzle mode base XOR masking, and truncated buffer bounds in
crates/xcl/src/gpu/tiling.rs:tdinChain::new_3d(block_dforblk % 3 in (0, 1), andblock_d / 2forblk % 3 == 2).first_taillevel discovery to required <= tdin addition tow <= twandh <= th. Deep 3D textures (e.g. 8x8x64) now correctly keep levels wheredepth > tdin the main chain, preventing multi-slice collision in the single tail block.side.max(1)anddepth.max(1)inChain::newandChain::new_3d.Layout::offset_z, guardedpitch_blocks = w.max(1).div_ceil(self.block_w)preventing divide-by-zero and row-pitch collapse when width is 0.base_xorsafety:base_xor = 0whenswizzle_mode == 0inimage_layoutandimage_chain. Linear surfaces do not use GF(2) pipe/bank XOR swizzling; unaligned host base addresses no longer scramble element offsets.detile_level, clampedbase = if t.mode == 0 { 0 } else { t.base_xor & in_blk_mask }, matchingoffset_zand eliminating block-boundary overruns.if let (Some(...), Some(...))) intile_level,detile_volume, andtile_volumeto prevent out-of-bounds panics on truncated or partial buffers.npot_bcn_mip_chains_round_trip,thick_3d_tail_depth_bounds,linear_mode_ignores_unaligned_base_xor,offset_z_zero_width_preserves_row_pitch, andshort_buffer_bounds_safety.Changes
crates/xcl/src/gpu/tiling.rs:offset_z.Tested
cargo test -p xcl -- tiling: all passed, 0 failed.upstream/main, GPL-2.0-only compliant, zero retail game data or keys.Not Tested
AI Use
Co-Authored-By: Claude Code (Claude Opus 5.5) / Gemini Antigravity
@DavidM1911 on GitHub · 2026-11-24 20:46 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@frenziedcoder on GitHub · 2026-11-24 20:55 UTC · original
NVIDIA test report for
134fb5a: the full workspace and a smoke pair on the retail title, next to @DavidM1911's RTX 3060 Ti library run above. Full suite green, the PR's own test passing, and a clean smoke pair (1657 vs 1655 frames).Tested
stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head134fb5a26923446b60902c44c3653c1f98064990, no local changes.cargo build --workspace && cargo test --workspace -- --test-threads=4(debug): 781 passed, 0 failed, 41 ignored; all 19gpu::tilingtests pass. SKIPPED:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).Regression run (
scripts/smoke.ps1 -Seconds 60, release, the retail title of #505 at its start screen;XCL_PSO_PRELOAD=0for both builds, because this machine's preload list holds the program of #1307)base (
9e3831e, this PR's base):this PR:
Not tested: the title's 3-D (thick) textures with deep mip tails at the world load (its volume LUTs come later than the start screen); AMD.
AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report; I checked it.
@throny on GitHub · 2026-11-25 00:15 UTC · original
Two contributors checked independently and found that #1614 solves the same problem (for #1488) in a different way: #1607, group D50. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
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.
@JJAutoCompare on GitHub · 2026-11-25 05:00 UTC · original
XCL PR #1624 focused Windows verification
Verified head
134fb5a26923446b60902c44c3653c1f98064990in a clean, detached checkout on STOR-WINLAB. The PR changes onlycrates/xcl/src/gpu/tiling.rs.Windows 11 Enterprise Evaluation x64, build 26200. AMD Ryzen 7 3800X and Intel Arc A770 Graphics with driver 32.0.101.9175. DXC 1.9.2609.5.
rustc 1.100.0 (0ef1bc386 2026-11-09),x86_64-pc-windows-msvc.Tested
cargo build --workspacecompleted successfully in the dev profile.cargo test --workspace --no-runcompiled the workspace test executables successfully in the test profile.cargo test -p xcl --lib gpu::tiling::tests -- --nocapturewithXCL_ADAPTER=NONE_CPU_ONLYfinished in 22.05 s.pr1624-focused.logrecorded 19 passed, 0 failed, 0 ignored, 0SKIPPEDlines, and 734 filtered out. All commands ran outside the Arc mutex.The five added tests passed. They checked odd-sized BC1 and BC7 mip-chain round trips, exclusion of oversized-depth mips from a thick 3D tail and round trips across the volume levels, linear RGBA8 offsets from an unaligned base address, row pitch for a zero-width offset calculation, and short source buffers in
Layout::tileandChain::tile_level.Not tested
Coverage was limited to focused CPU tiling tests and full workspace compilation. The full workspace GPU suite, D3D12 execution, and retail-title smoke runs were omitted.
AI use
T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr1624-focused.logand published.github-bot referenced this pull request2026-11-26 06:18:30 +00:00
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.