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

Merged
ghptc merged 1 commit from upstream-pr/2468 into main 2026-11-30 14:12:02 +00:00
ghptc commented 2026-11-29 13:20:30 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ghptc on 2026-11-29T13:20:30Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5551109860 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2468). Originally posted by [ghptc](https://github.com/ghptc) on 2026-11-29T13:20:30Z. --- 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.
Dukestar69 commented 2026-11-29 13:23:50 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-11-29T13:23:50Z.

Review: APPROVED


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).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review:6103061118 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2468#pullrequestreview-6103061118). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-29T13:23:50Z. **Review:** APPROVED --- 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).
Sign in to join this conversation.
No reviewers
No labels
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.

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