perf(formats): add AVX2/SSE2 micro-tile texture detiler and DetilePool #191
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/191"
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 TaynanGT/Vice-Tay. Originally posted by Vladimir-Human on 2026-11-27T07:31:37Z.
Summary
crates/victory-formats/src/detile.rs: a thin tiled 256-byte micro-tile texture detiler/tiler with runtime-detected x86_64 AVX2/SSE2 kernels, portable fixed-width fallbacks, strict mutated-Layoutgeometry/bounds validation (including a 256-bit micro-tile disjointness proof), and a persistent worker pool (DetilePool,PARALLEL_MIN_BYTES = 2 MiB) with worker/caller panic and mutex-poison recovery.Layout::detile,Layout::tile, andTilingCache::tile(non-thick paths) incrates/victory-formats/src/texture.rsinto the micro-tile implementation while preserving all existing public APIs,Layout::bytes_from(detile) vsLayout::size(tile) buffer requirements, overlapping depth-pitch rejection, and cachedTilePlantiling for thick 3D textures.LINEAR,SW_256B_*,SW_4KB_*,SW_64KB_*), element size (1–16 B), block size (1,4), NPOT dimension, odd pitch, mip tail,bytes_fromprefix buffer,TilingCache::tile, 1D/array/3D subresource, and parallel (2–4 MiB) / concurrenttry_lockpath is tested bit-for-bit against the pure scalarLayout::offsetreference and pre-change chunkedwalkbaseline. No rendering, shader, or visual output changes.Benchmarks (x86_64 AVX2)
texture_layout_bench(Layout::new/Layout::offsetnon-regression)cargo run --release -p victory-formats --example texture_layout_bench:70ac49d)447dbb1)BC7 64KB_D317445823744(exact)BC1 64KB_S181077882496(exact)RGBA8 4KB_D680375511872(exact)R8 64KB_S316888273744(exact)RGBA8 volume 64KB_S2957008742464(exact)RGBA8 linear750198528576(exact)bench_detile_throughput(pre-change chunkedwalkvs AVX2/SSE2 +DetilePool)cargo test --release -p victory-formats --locked -- --ignored --nocapture bench_detile_throughput:4K BC7 SW_64KB_D (16 MiB)4K BC7 SW_64KB_S (16 MiB)4K BC1 SW_64KB_D (8 MiB)4K RGBA8 SW_64KB_D (64 MiB)2K BC7 SW_64KB_D (4 MiB)1K BC7 SW_64KB_D (1 MiB)256 BC7 SW_64KB_D (64 KiB, ST)4K BC7 MipChain (13 mips, 21.3 MiB)Verification
cargo clippy -p victory-formats --all-targets --locked -- -D warnings(default &--all-features): 0 warnings.cargo test -p victory-formats --release --locked -- --test-threads=1: 47 passed, 0 failed, 6 ignored.cargo test -p victory-formats --locked detile::pool_tests -- --test-threads=1: 2 passed, 0 failed.cargo test -p victory-formats --locked -- --test-threads=1: 47 passed, 0 failed, 6 ignored.cargo run --locked -p xtask -- policy:asset policy: 304 files ok(cargo test --locked -p xtask -- --test-threads=1: 11 passed, 0 failed).git diff --check origin/main..HEAD: clean.Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T07:52:26Z.
@Vladimir-Human The Windows release formats suite passed with this revision: 47 passed and six were ignored as configured. The scalar parity, concurrent paths and worker-pool recovery checks all passed. CI confirmed the same commit, and it’s on
main.