Benchmark a standalone Rust backend for BCPack DDS batch export #811
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#811
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@wish131400 on GitHub · 2026-11-23 06:55 UTC · original
Question
Would Xbox2Windows be interested in evaluating a standalone Rust backend for the batch exporter in #798? This follows up on the backend proposal in #458. The benchmark would exercise TTPF reading, BCPack decoding, DDS export, and manifest generation together.
Full-scale timing on the same PC
Those runs used different inputs, worker counts, and timing boundaries. The standalone Rust executable has a separate same-input benchmark below. Its full-pool timing and a direct comparison against #798 remain open.
Evidence so far
The integration fixture in #798 stores already reconstructed BC1 and BC7 blocks as codec 0. It checks that the pinned Leonida exporter produces DDS files with the expected pixels. To exercise entropy decoding too, we can add a generated BC1 stream and a generated mode-6 BC7 stream to a minimal RDS5 pool, with independently specified block and pixel references. The source-built vectors and reference checks in #769 are a useful starting point for the BC7 case.
On Windows with a Ryzen 7 7700 and eight workers, our AI-assisted standalone prototype converted 8,192 pre-indexed synthetic BC1/BC7 textures with three mips each. Across three runs, median time was 5.051 s for standalone Rust and 7.317 s for our local Python orchestration with a Rust DLL. That is 31.0% less wall time, with matching DDS SHA-256 hashes for all 8,192 outputs per trial. The executable keeps decoded lane data in Rust buffers through reconstruction and schedules work on threads, avoiding Python list conversion, DLL marshaling and process-pool setup in that comparison.
Prior measurements and context are available in the Leonida proposal and the original benchmark comment.
Completion condition
Required environment
Windows x64, Python for the reference backend, and a Rust release build. The comparison uses source-built inputs and CPU execution.
Checklist
@R0Y00 on GitHub · 2026-11-23 07:12 UTC · original
A standalone benchmark is welcome. Use #798 and its pinned Leonida revision as the reference. Please publish the generated BC1 and mode-6 BC7 stream inputs, expected block bytes and decoded pixels, and the corrupt-stream control. For the timing run, use the same input, output scope and worker count, with fresh output directories and pool-open through manifest-publication timing. Include each run's DDS count, byte total, manifest status and hashes. We can evaluate optional integration once that comparison is reproducible.
@wish131400 on GitHub · 2026-11-23 07:42 UTC · original
@R0Y00 I ran the generated-stream benchmark against #798 at
66669bbwith its pinned Leonida revisionb0befb4. Both backends took the same generated RDS5 pool with 1,024 single-mip BC1 and mode-6 BC7 textures, used eight workers in strict mode and wrote to fresh output directories on the same NTFS volume. The timer covers pool open through manifest publication, including DDS SHA-256 calculation.Each backend produced 1,024 strict successes and 4,345,856 DDS bytes in every trial. All 1,024 file hashes and all manifest fields matched. For the 4×4 controls, both backends matched the expected block bytes and independently decoded RGBA8 pixels. Both rejected the truncated BC7 stream and exported its valid BC1 sibling. The rejected row has no file or hash in either manifest. The Python wrapper reports the failure in the manifest and returns exit 0. The Rust adapter returns exit 1.
The reproduction bundle contains the generator, pinned commands, generated streams and pools, expected block bytes and pixels, Rust source, and the per-run manifests. This measures the strict single-tile BC1/BC7 workflow on generated inputs. Real-pool throughput and calibrated multi-mip coverage still need direct measurement.
Reproduction bundle and results
AI-assisted.
@R0Y00 on GitHub · 2026-11-23 09:24 UTC · original
The same-input benchmark in #811 is complete. The pinned #798 reference and standalone Rust produced matching 1,024 DDS hashes, byte counts and manifests, with independent BC1/BC7 pixel controls and a rejected truncated stream. The result supports an optional backend. #822 is the separate integration of the Rust kernels into the existing Python exporter. Keep its timings separate from the standalone comparison and from real-pool throughput.