formats: bound thick 3D mip tail by depth #1494

Closed
github-bot wants to merge 1 commit from gh-pr/1494/head into gh-pr/1494/base
Owner

@⁠nino-exe on GitHub · 2026-11-24 18:26 UTC · original
nino-exe:fix/thick-3d-mip-tail-depth-bound → main · +24 −1 · 1 files · 1 commits · closed without merging

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:

  • cargo test --workspace --locked — all green
  • cargo clippy --workspace --all-targets --locked -- -D warnings — clean
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings — clean
  • cargo xtask policy — passes

No game data used; synthetic numbers only.

**@⁠nino-exe** on GitHub · 2026-11-24 18:26 UTC · [original](https://github.com/Marvisak/VIctory/pull/1494) `nino-exe:fix/thick-3d-mip-tail-depth-bound` → `main` · +24 −1 · 1 files · 1 commits · closed without merging 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: - cargo test --workspace --locked — all green - cargo clippy --workspace --all-targets --locked -- -D warnings — clean - cargo clippy --workspace --all-targets --all-features --locked -- -D warnings — clean - cargo xtask policy — passes No game data used; synthetic numbers only.
The tail predicate checked width, height and remaining mip count but
omitted mip_depth(i) <= fixed[2], so a thick 3D 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 and a unit
test that fails on main.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:33:57 +00:00
github-bot closed this pull request 2026-11-26 04:33:57 +00:00
Author
Owner

@⁠ArnabSaga on GitHub · 2026-11-24 19:11 UTC · original

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.

**@⁠ArnabSaga** on GitHub · 2026-11-24 19:11 UTC · [original](https://github.com/Marvisak/VIctory/pull/1494#issuecomment-7141727805) 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.
Author
Owner

@⁠tdogghockey on GitHub · 2026-11-24 19:34 UTC · original

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.

**@⁠tdogghockey** on GitHub · 2026-11-24 19:34 UTC · [original](https://github.com/Marvisak/VIctory/pull/1494#issuecomment-7142289996) 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.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:41 UTC · original

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.

**@⁠Marvisak** on GitHub · 2026-11-25 00:41 UTC · [original](https://github.com/Marvisak/VIctory/pull/1494#issuecomment-7148774475) 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

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/Marvisak--VIctory!1494
No description provided.