D3D12.X: guard mip shift overflow and zero dimensions in tiling::Chain and image_chain #1509
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!1509
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1509"
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?
@b3IKK on GitHub · 2026-11-24 17:09 UTC · original
b3IKK:gpu/tiling-mip-shift-and-zero-dims→main· +53 −3 · 1 files · 1 commits · opentiling::Chainshifted the mip dimensions and the depth by the level index unconditionally: a chain with more than 32 levels (mips > 32) hit a shift overflow (a panic in debug, a wrong value in release), andChain::new_3dwith a zero width or height producedlevels[0]of 0, soslice_bytesno longer matched the level it describes.image_chaindid not reject a zero width/height or amax_mipof 32 or more at all; it computed a chain for them.This clamps every dimension to at least 1, uses checked shifts (a shift past 32 gives 1), and makes
image_chainreturnNonefor a zero dimension ormax_mip >= 32.What is in it
crates/xcl/src/gpu/tiling.rs: themax(1)clamps andchecked_shrinChain::new/new_3d; theimage_chainguard; testchain_and_image_chain_handle_large_mips_and_zero_dimensions(33 levels of a 16×16 image, a zero-size 3D chain, andimage_chainwithmax_mip = u32::MAX,32, a zero width and a zero height).Since the last push: rebased onto
main06c9f55(the commit was then re-created with the same tree so GitHub refreshed the PR's head); the only conflict was a test module wheremainhad addedlayout_cache_shares_tables_and_isolates_base_xorat the same place, and both are kept.Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 1266 passed, 0 failed, 46 ignored (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses,no heap windows, andcannot disable the driver cache (Windows Developer Mode is required))cargo test -p xcl --lib -- gpu::tiling: all pass, including the new testimage_chainguard removed: 0 passed, 1 failed — a shift-overflow panic attiling.rs:497Regression run
main (
426a5a7, clean tree, no local changes):PR (
a0178fc, clean tree, no local changes):(The main block is
426a5a7, an ancestor of the currentmain06c9f55, from the same machine and data folder.)Not tested
AI use
06c9f55, kept both tests at the conflict, re-verified that the new test fails without the guard, ran the suite and thescripts/smoke.ps1pair.github-bot referenced this pull request2026-11-26 04:59:09 +00:00
@DavidM1911 on GitHub · 2026-11-24 18:53 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@Belox17 on GitHub · 2026-11-24 20:02 UTC · original
Test report for
175ed9c6on NVIDIA (RTX 3060 Ti): passes, and the test fails without the fixTested
175ed9c6as is (baseb7aa9f3), clean tree.chain_and_image_chain_handle_large_mips_and_zero_dimensions) withcargo test -p xcl --lib <name>: 1 passed.cargo test --workspace -- --test-threads=4on the head: 771 passed, 0 failed, 41 ignored; its baseb7aa9f3on the same machine: 770 passed, 0 failed, 41 ignored. SKIPPED on both:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64).mainc160d86e(clean merge): 859 passed, 0 failed, 42 ignored;mainalone: 858 passed, 0 failed, 42 ignored, the same three SKIPPED as above.gpu/tiling.rsreverted (test kept), the test panics withattempt to shift right with overflowattiling.rs:282.Not tested
AI use: Claude Code (Claude Opus 5.5) ran the commands on this machine and wrote this report from those runs.
@JJAutoCompare on GitHub · 2026-11-25 05:20 UTC · original
Empirical test report (175ed9c6)
PR #1509 was tested at commit
175ed9c6060b4424a25f856a423808844ee030cdfrom a clean checkout.Hardware / environment
rustc 1.100.0 (0ef1bc386 2026-11-09), hostx86_64-pc-windows-msvc.dxc.exe --versionreporteddxcompiler.dll: 1.9(5512-01b62ad4)(1.9.2609.5) - 1.9.2609.5 (01b62ad47).XCL_ADAPTER=NONE_CPU_ONLYandRUST_TEST_NOCAPTURE=1. Both commands ran outsideInvoke-ArcTest.ps1without acquiring the Arc GPU mutex.Commands and results
cargo test --workspace --no-runexited 0 and built the workspace test binaries. The build emitted a Rust deprecation warning forAtomicU32::fetch_updatein XGameRuntime.cargo test -p xcl --lib gpu::tiling::tests::chain_and_image_chain_handle_large_mips_and_zero_dimensions -- --exact --nocaptureexited 0. The log recorded 1 passed, 0 failed, 0 ignored, 0 skipped, and 743 filtered out.Observed behavior
image_chainreturnedNoneformax_mipvalues of 32 andu32::MAX, and for descriptors with zero width or zero height.Not tested
The full GPU workspace suite and game smoke runs were omitted.
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against
pr1509-focused.logand published.@b3IKK on GitHub · 2026-11-25 16:04 UTC · original
Rebased onto
main06c9f55; the only conflict waslayout_cache_shares_tables_and_isolates_base_xor, whichmainhad added at the same place, and both tests are kept. The commit was then re-created with the same tree to refresh the PR head (GitHub kept the previous head after the first force-push). Current heada0178fc: suite 1266 passed, 0 failed, 46 ignored; the new test fails with theimage_chainguard removed (shift-overflow panic attiling.rs:497); smoke 1641 frames, 0 crashes, 0 removals. The JJAutoCompare report above is for the old175ed9c; the smoke pair in the description now names this head.AI use: OpenCode, Claude Fable 5.2 rebased it, re-created the commit, ran the suite and the smoke run and wrote this.
@DavidM1911 on GitHub · 2026-11-26 05:40 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
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.