Game: the shader pack in an archive inflates through zlib-rs #2950
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2950
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2950"
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?
@0xkn0wh3r3 on GitHub · 2026-11-26 01:22 UTC · original
0xkn0wh3r3:game/shaderpack-inflates-with-zlib-rs→main· +89 −9 · 4 files · 1 commits · openWhat
shaderpack::find()reads the shader pack an archive holds as a run of zlib streams of at most 64 KiB, and inflated each one with miniz_oxide. It now inflates each one with zlib-rs (pure Rust, runtime SIMD dispatch), ininflate_one. It's the same crate and version #1355 proposes for DirectStorage:zlib-rs = { version = "0.6.8", default-features = false, features = ["std"] }. miniz_oxide stays for the tests and the other users.Measurement
600 streams of 64 KiB, release build, Ryzen 9 7900X,
inflate_bench(ignored), medians of 5 rounds each:Where it came from
From DexNom's fork, DexNom/VIctory@570a941:
find()withzlib_rs::Inflate. Credited withCo-authored-by: DexNom.#1355 converts DirectStorage and the other inflaters but predates this function. Whichever lands second only needs the workspace dependency line deduplicated.
Tested
shaderpack::tests::one_stream_inflates_alone: a stream gives its output and the bytes it took even with data after it. A truncated stream, one larger than the chunk, and bytes that aren't a stream give nothing.finds_a_pack_inside_an_archivepasses as before.cargo test -p victory-game: 16 passed.cargo build --workspace: builds.cargo clippy -p victory-game --all-targets -- -D warnings: clean.Not tested
@fuzeofficlal on GitHub · 2026-11-26 01:31 UTC · original
Code review and Windows 11 release benchmark verification at head
1d7602da385aonmain(63bcca43c6a0):crates/victory-game/src/shaderpack.rs:302-314,Cargo.toml/Cargo.lock):--locked(zlib-rs 0.6.9, Zlib-licensed, pure Rust).inflate_oneusesInflate::new(true, 15)into a fixed0x20000(128 KiB) buffer, requiresStatus::StreamEnd, rejects truncated/malformed/oversized (BufError) streams cleanly withNone, and slices exacttotal_in()/total_out()lengths.cargo xtask policy:191 files ok;cargo clippy --locked -p victory-game --tests -- -D warnings: 0 warningscargo test --locked -p victory-game: 16/16 passed (1 ignored bench, includingone_stream_inflates_alone)--releaseshaderpack::tests::inflate_bench:miniz_oxide: median 31.0 ms->zlib-rs: median 14.5 ms(2.14x speedup).LGTM.
@cloph-dsp on GitHub · 2026-11-26 01:35 UTC · original
Local verification on Windows / rustc 1.100.0 / MSVC, no game data, no GPU, no clippy/rustup.
842b0cb: 5 files, +93/-12.git diff --checkflags one pre-existing-style trailing whitespace in README.md:17 (displayed.); worth fixing.one_stream_inflates_aloneis absent from the base commit.cargo test --locked -p victory-game --lib -- shaderpack::tests::one_stream_inflates_alone --exact --quiet-> 1 passed, 16 filtered (CARGO_BUILD_JOBS=2).cargo test --locked -p victory-game --quiet-> 16 passed, 0 failed, 1 ignored.AI-assisted (Hy4 flash).
@Marvisak on GitHub · 2026-11-26 04:29 UTC · original · edited 2026-11-26 07:19 UTC
Automated triage for the maintainers.
Thanks. No new push, so the verdict stays the same: this needs the maintainer's decision on bringing in
zlib-rs. Both of your options work (land #1355 first and rebase this to only theinflate_oneswitch, or foldshaderpack.rsinto #1355), and the maintainer can pick one.CI: passing.
Generated by Claude Code
@0xkn0wh3r3 on GitHub · 2026-11-26 07:00 UTC · original
Agreed, the dependency should land once. #1355 (wbkepler) brings
zlib-rsin for the larger users (the DirectStorage and formats inflate). This PR is only theshaderpack::findcall site, which was added to main after #1355 branched, so #1355 doesn't cover it. I can't measure on the title's archives here.Two options, whichever is easier for you:
inflate_oneswitch plus its test, with no new dependency; orshaderpack.rschange into #1355 when it's rebased (it's conflicting right now), and close this.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.