Repository navigation
[BUNDLE] Formats (XMA, BCPack, texture detiling): 12 PRs, #96 #172 #183 #351 #364 #603 #629 #658 #992 #993 #1016 #1205 - #1452
Closed
MamaLeVrai wants to merge 25 commits into
Closed
MamaLeVrai wants to merge 25 commits into
MamaLeVrai wants to merge 25 commits into
Conversation
… frames A frame that ends in a packet where no frame begins (the tail of a frame that crossed packets, then padding) left the next frame pointing into that padding, which ended the stream early. Now the next frame is found by following each packet's skip to the next packet with frames.
imdct_half worked out every pre- and post-rotation with sin_cos on each call (n of them per subframe) and ran its FFT on two fresh Vecs. The rotations, the bit-reversed order and the butterfly rotations now come from a table built once for 128, 256 and 512 samples; the work buffers live on the stack. Every value is computed with the same expression (the butterflies with the same running product), so the output is bit for bit what it was. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Decoder::decode took the caller's bit count as the end of the frame. Past the data the bit reader returns zeros, and a stereo tile header reading only zeros gives the subframe to no channel, so it never moves on; with a count beyond the data it never overreads either, and looped for good. Clamp the end to the bits the data holds. A frame from read_frame always holds its bits, so its decoding does not change. Add deterministic noise tests (xorshift64, fixed seeds, as BCPack's): buffers of noise packets, streams of noise frames with clean and damaged headers, frames in mono and stereo at each sample rate, bit counts past the data, and read_frame and packet at any offset. Every walk is bounded and every decode must give one frame of samples. The bit-count test hangs without the fix; the others pass on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each BC7 dictionary entry has two more bytes after the two index widths. They repeat the widths in all entries but the first. The parser read them as pixel 0 of set 0, so every index was off by one: pixel 0 was 4 in 253 of 255 entries, and set 0's last pixel landed in set 1, which no entry uses. Any BC7 block whose index reference points into the dictionary was built on the wrong indices. Skip the two bytes and read 16 indices for set 0 and 15 for set 1. The table size does not change. The new test checks the shipped table: a set with 0 bits holds no indices, and pixel 0 is a valid anchor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: GPT 6.2 Sol <noreply@openai.com>
`Bits::signed(0)` shifted by 32 (a panic in debug builds) and `Bits::signed(n)` / `Bits::read(n)` for n > 32 underflowed `32 - n`. Zero bits now read as 0; past 32 bits the low 32 are the value and all n bits are consumed, for both. Widths 1 to 32 read as before. No caller reaches these widths today (the decoder clamps to two channels, so the widest read is 16 bits and `signed` is only called with 6); this keeps a later caller or a damaged stream from panicking the decoder. The new test panics on the old code and passes now. Closes Marvisak#907.
Read complete payload bytes directly inside an XMA2 packet. Keep the bit reader for packet headers, interleaved stream skips and the final partial byte. Add coverage for all eight alignments at packet boundaries and EOF. On Windows x86-64, 36,720 synthetic reads matched the previous implementation, including returned bytes and the next frame position. A release microbenchmark of read_frame measured 1009 to 168 ns for 128-byte frames and 7977 to 1062 ns for 1 KiB frames (median of nine runs).
Merges Marvisak#96 Marvisak#172 Marvisak#183 Marvisak#351 Marvisak#364 Marvisak#603 Marvisak#629 Marvisak#658 Marvisak#992 Marvisak#993 Marvisak#1016 Marvisak#1205 onto main (ffe310e), each head unchanged, no conflicts, no changes of mine. cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features, is clean and cargo test --workspace --locked passes (365 passed, 8 ignored; main has 342 passed, 6 ignored). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Owner
|
Automated triage for the maintainers. Closing because this pull request re-packages other open pull requests. Each of those is reviewed on its own, so a bundle cannot be merged. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One PR in place of 12. Twelve PRs on
victory-formats: XMA decoding (frame boundaries, loops, tables, bit reads, VLC), BCPack (BC7 dictionary indices) and texture detiling. Every head is merged unchanged ontomain(ffe310e), and the result is built and tested together.What is inside
ba42db6434eb0898b3d4d18220493a24b7cde50375659705a2f634350f91c230ecaa8cb987f7cb89464b80c31003a6f2290d3867e689All of them merge with no conflict and no change of mine.
Left out, and why
bcpack.rs,texture.rs,xma.rs); they need a rebase after these land.Verification
Windows 11, RX 6950 XT, Rust 1.98.1 (the pinned toolchain):
cargo clippy --workspace --all-targets --locked -- -D warningscargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo test --workspace --lockedmain: 342 passed, 6 ignored)The title was not run, so this says nothing about in-game effect. No game data is used or committed.
Re-verify in one go
To confirm that no component PR moved since this was built, compare each
Headabove withgh pr view <n> --repo Marvisak/VIctory --json headRefOid. If one differs, the branch needs a rebuild: merge the new head in the same order.If this lands
The component heads are in the history unchanged, so each PR's commits and authorship are kept and GitHub should mark them merged. Merging them one by one instead works too, with the exceptions noted above.
AI-assisted (Claude Code); no game data.
🤖 Generated with Claude Code