formats: bound thick 3D mip tail by depth #1493
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1494"
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 nino-exe on 2026-11-24T18:26:49Z.
Fixes VIC-BT-014 (P1) from #1242: the thick 3D mip-tail predicate checked width/height/remaining-mips but omitted mip_depth(i) <= fixed[2], so a base mip whose width/height fit the tail bounds was wrongly folded into the tail even when its depth exceeded fixed[2].
Adds the missing depth check to crates/victory-formats/src/texture.rs:408 and a unit test (thick_3d_mip_tail_respects_depth_bound) that fails on main.
Verified:
No game data used; synthetic numbers only.
Imported from Marvisak/VIctory. Originally posted by tdogghockey on 2026-11-24T18:52:56Z.
Review: COMMENTED
I independently verified this patch locally on aarch64 Linux (worktree at the PR head,
929e35b):cargo test -p victory-formats --locked thick_3d_mip_tail_respects_depth_bound— 1 passedcargo test -p victory-formats --locked— 24 passed, 0 failed, 4 ignoredcargo clippy -p victory-formats --all-targets --locked -- -D warnings— cleangit diff origin/main --check— cleanThe change is the correct one-line predicate from backlog item VIC-BT-014:
mip_depth(i) <= fixed[2]must be required for thick 3D tail mips. The regression test exercises the reported deep 3D case.One coordination note: PR #1450 fixes the same defect and adds a broader boundary matrix (exact/odd depth boundaries, absent tails, slab offsets, thin-layout regressions). I ran its texture tests too: 12 passed, 0 failed. Both patches are green here; maintainers may prefer #1450's coverage, but this PR is valid on its own.
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T19:25:05Z.
Review: COMMENTED
Correct fix, but it duplicates #1450: both add the
mip_depth(i) <= fixed[2]condition to the thick-tail test intexture.rs. #1450 covers the same change with four tests (first-tail selection matrix, exact slab offsets, thin-tail regression) vs. one here. The test passes on macOS (cargo test -p victory-formats --locked: 24 passed, 0 failed, +1) — I'd land #1450 and close this one, or rebase this onto it if you prefer the smaller diff.Imported from Marvisak/VIctory. Originally posted by ArnabSaga on 2026-11-24T19:11:18Z.
I independently verified the existing implementation against AMD addrlib v10.9 and documented the results on #1450.
PR #1549 also independently confirms the reference-layout mismatch introduced by the proposed depth predicate, with substantially broader differential testing.
I recommend reviewing both investigations before merging this change.
Imported from Marvisak/VIctory. Originally posted by tdogghockey on 2026-11-24T19:34:23Z.
Quick correction from me: when I reviewed this earlier, I only checked the code and local tests, and I called the depth-bound change correct. The addrlib v10.9 cross-check linked from #1450/#1549 contradicts that conclusion, so I no longer think the predicate change should be merged as-is.
My local verification still stands: the patch applies cleanly and its synthetic test passes here. But that test only proves the new predicate matches the new expectation; it doesn't prove the expectation matches addrlib. Sorry for the misleading earlier note.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:41:25Z.
Automated triage for the maintainers. Closing because by our reading the change is incorrect or would break something that works today.
Adds a depth test to the thick-3D mip-tail condition. The GFX10 address library the module follows tests only width, height and mips left (the depth test belongs to the older GFX9 code), and main's 3D layouts match the console library; this would move mip 0 of deep narrow volumes out of the tail and change their sizes.
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.
Pull request closed