HLE & Formats: replace miniz_oxide with SIMD-accelerated zlib-rs #1355
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1355"
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 Marvisak/VIctory. Originally posted by wbkepler on 2026-11-24T17:35:20Z.
Summary
Replaces scalar
miniz_oxideacross the workspace with pure-Rust, Zlib-licensedzlib-rs = "0.6.8"(default-features = false, features = ["std"], runtime AVX2/BMI2/SSE4.2 dispatch, zero C compiler/libc, zero newunsafe):victory-hle(dstorage.rs): Reuses a thread-localzlib_rs::Inflatestate per DirectStorage worker thread, handling empty destinations and preserving short-stream tolerance plusINVALID_DATArejection on oversized, truncated, or bad-checksum streams.victory-shader(native.rsXBCH) &victory-game(sgd5.rsraw deflate): Incremental streamingzlib_rs::Inflatecapped at declared unpacked size with exactStatus::StreamEndand length verification.victory-gpu(capture.rs): Switches diagnostic PNG IDAT compression tozlib_rs::compress_slice, removingminiz_oxidecompletely fromCargo.toml/Cargo.lock.dstorage,native, andsgd5.Verification
cargo clippy --workspace --all-targets&-p victory --features diagnostics --all-targets— passed (0 new warnings)cargo test --workspace— passedcargo xtask policy— passed (151 files ok)Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T17:42:46Z.
Review: COMMENTED
miniz_oxide -> zlib-rs swap. Cargo.lock is consistent (miniz_oxide+adler2 out, zlib-rs in). On macOS I could only verify victory-game: it compiles and its 3 tests pass, and sgd5.rs uses the streaming Inflate/Deflate API. victory-hle/victory-formats are not buildable on macOS, so the HLE side of the swap is unverified here — if those call sites use the same zlib_rs API style it should be fine, but please make sure the Windows CI leg covers victory-hle before merge. zlib-rs is a reasonable, memory-safe choice (SIMD inflate, used by Firefox). Local verification: macOS arm64, rustc 1.98.1, PR head merged into main
ffe310e,cargo test -p <crate> --locked. Shader execution tests (valu_tests/host/diff_tests) are#[cfg(all(test, windows))], so macOS covers lowering/decode/unit tests only. victory-game: 3 passed, 0 failed.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:23:48Z.
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting:crates/victory-game/src/sgd5.rs,crates/victory-shader/src/native.rs). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-25T01:48:37Z.
Offline measurement on a retail dump, and the shader tests on Ada
Result: no count change against
main.Offline. I merged head
2e60202ontomainffe310e(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 21,724 onmain, 21,724 with this PR.No program changes its failure reason either. That is the expected result for a fix whose instructions sit behind the earlier failures on
main. The count shows that the change rejects nothing. It does not show whether the output is right.Tests: with the same merge,
cargo test --locked -p victory-shader --libpassed 121, failed 0. The bitcode benchmark is ignored, as onmain, where 120 pass. The run was on an RTX 4070 SUPER (Ada, 32-lane waves, driver 32.0.16.1088), the default adapter, withVICTORY_WARPunset.No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by Headache3318 on 2026-11-25T01:50:39Z.
Tested on Linux (Arch, kernel 7.3.5, 3× RTX 4090 driver 620.73.04), Rust 1.98.1 (pinned). PR head
2e60202applied cleanly onto currentmainccfb029.cargo test -p victory-game --locked: 3 passed (the new zlib-rs streaming tests pass on Linux).cargo test -p victory-shader --locked: 57 passed (fewer than main because GPU tests are skipped without dxil.dll).cargo clippy -p victory-shader --all-targets -- -D warnings: 1 new unused-function error in test code (constant_color), but main has 4 pre-existing errors (unused imports, unused variable, dead field). The PR net-reduces clippy errors from 4 to 1.cargo clippy --workspace --all-targets -- -D warnings: fails on victory-gpu (E0425) on Linux — same as main. This PR does not fix the Linux build.Not tested: Windows MSVC build, the title itself. AI-assisted.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.