Formats: recover texel coordinates in configured XOR texture layouts #2468

Manually merged
github merged 1 commit from github-bot/gh-2468 into main 2026-11-30 14:17:21 +00:00 AGit
Owner

@⁠ghptc on GitHub · 2026-11-29 13:20 UTC · original
ghptc:fix/native-texture-layout → main · +81 −3 · 1 files · 1 commits · merged 2026-11-30 14:12 UTC

GetTexelCoordinate rejects valid byte offsets in standard mips of configured pipe/bank XOR textures on both Series S and Series X. The forward mapping added in #932 and the inverse API added in #1510 meet here. The inverse currently searches the non-XOR address tables, which are empty for these layouts.

This change recovers the unknown in-block coordinate bits from the same parity equations used by the forward path. The block and array/depth slice supply the known high bits. A final forward-address check rejects padding. All 120 current pattern/element-size combinations resolve in at most three passes over the equations.

Validation on 829188e9

  • The matched regression recovered 0 of 1,680 valid byte addresses before the fix and 1,680 of 1,680 after it. All 140 padding checks passed.
  • An independent test reconstructed two 256×256 RGBA texture layouts from the inverse API alone. The candidate matched both XCL reference hashes in the existing texture suite, across 524,288 bytes. Upstream failed to identify any of those bytes. A separate test checked standard mips, mip tails and padding in 3D and block-compressed array layouts.
  • All 36 texture tests passed on Arch Linux, Ryzen 7 9800X3D. The complete locked formats crate run reported 81 passed, 7 ignored and 3 failures in the separate BCPack oracle tests.

Reproduce the new regression with cargo test --release --locked -p victory-formats coordinates_invert_configured_xor_standard_blocks. All test inputs are generated.

The BCPack reference failures are also addressed separately by #2236 and #2419. Both correct the BC7 dictionary test oracle.

**@⁠ghptc** on GitHub · 2026-11-29 13:20 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2468) `ghptc:fix/native-texture-layout` → `main` · +81 −3 · 1 files · 1 commits · merged 2026-11-30 14:12 UTC GetTexelCoordinate rejects valid byte offsets in standard mips of configured pipe/bank XOR textures on both Series S and Series X. The forward mapping added in #932 and the inverse API added in #1510 meet here. The inverse currently searches the non-XOR address tables, which are empty for these layouts. This change recovers the unknown in-block coordinate bits from the same parity equations used by the forward path. The block and array/depth slice supply the known high bits. A final forward-address check rejects padding. All 120 current pattern/element-size combinations resolve in at most three passes over the equations. **Validation on 829188e9** - The matched regression recovered 0 of 1,680 valid byte addresses before the fix and 1,680 of 1,680 after it. All 140 padding checks passed. - An independent test reconstructed two 256×256 RGBA texture layouts from the inverse API alone. The candidate matched both XCL reference hashes in the existing texture suite, across 524,288 bytes. Upstream failed to identify any of those bytes. A separate test checked standard mips, mip tails and padding in 3D and block-compressed array layouts. - All 36 texture tests passed on Arch Linux, Ryzen 7 9800X3D. The complete locked formats crate run reported 81 passed, 7 ignored and 3 failures in the separate BCPack oracle tests. Reproduce the new regression with `cargo test --release --locked -p victory-formats coordinates_invert_configured_xor_standard_blocks`. All test inputs are generated. The BCPack reference failures are also addressed separately by #2236 and #2419. Both correct the BC7 dictionary test oracle.
GetTexelCoordinate consulted the empty separable pattern on XOR layouts and rejected every standard-mip byte. Use the known macroblock and slice coordinate bits to solve the swizzle parity equations. The final forward lookup continues to reject padding and covers offsets inside an element.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 13:22:53 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-29 13:23 UTC · original · approved these changes

Tested locally merged onto main (829188e9).

  • Merge: Clean merge in crates/victory-formats/src/texture.rs.
  • Tests: cargo test -p victory-formats --lib texture:: passed (36 passed; 0 failed, including coordinates_invert_configured_xor_standard_blocks and coordinates_invert_offsets).
  • Lint: cargo clippy -p victory-formats --lib -- -D warnings passed with 0 warnings.

Clean inverse texel-coordinate recovery for configured XOR texture layouts. LGTM.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-29 13:23 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2468#pullrequestreview-6103061118) · **approved these changes** Tested locally merged onto `main` (`829188e9`). - **Merge**: Clean merge in `crates/victory-formats/src/texture.rs`. - **Tests**: `cargo test -p victory-formats --lib texture::` passed (`36 passed; 0 failed`, including `coordinates_invert_configured_xor_standard_blocks` and `coordinates_invert_offsets`). - **Lint**: `cargo clippy -p victory-formats --lib -- -D warnings` passed with 0 warnings. Clean inverse texel-coordinate recovery for configured XOR texture layouts. LGTM. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
github manually merged commit 24c38e0d5d into main 2026-11-30 14:17:21 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!2468
No description provided.