Repository navigation
Formats: keep deep 3D mips out of the thick mip tail (VIC-BT-014) - #1499
Closed
tdogghockey wants to merge 2 commits into
Closed
tdogghockey wants to merge 2 commits into
tdogghockey wants to merge 2 commits into
Conversation
RED: cargo test -p victory-formats --locked deep_3d_mips_do_not_enter_the_mip_tail
failed: mip 0 (16x16x64, Sw64KbS) wrongly has tail: Some(Tail { offset: 8192, ... })
and first_tail_mip == 0. Test exercises Layout::new's mip-tail predicate with
a deep 3D mip whose depth exceeds the block's depth.
GREEN: cargo test -p victory-formats --locked 24 passed, 0 failed, 4 ignored (focused reproducer: 1 passed). cargo clippy -p victory-formats --all-targets --locked -- -D warnings: clean. cargo xtask policy: 154 files ok. The tail predicate now also requires mip_depth(i) <= fixed[2] for thick 3D layouts, matching the block's depth limit.
Author
nazmi
added a commit
to nazmi/VIctory
that referenced
this pull request
Nov 24, 2026
64x64x256, 7 mips, SW_4KB_S: the tail must start at mip 5, not 3, because mips 3 and 4 are deeper than the 4 KiB thick block. The PR (Marvisak#1499) fixed the predicate but added no test; this pins it, and the numbers come from running both versions: 5,636,096 bytes before, 5,898,240 after. Verified non-vacuous: reverting the predicate makes it fail with first_tail_mip 3 != 5. Under-allocating here is the dangerous direction, so the fix can only make the layout larger.
nazmi
added a commit
to nazmi/VIctory
that referenced
this pull request
Nov 24, 2026
Review workers over ~45 more PRs against the merged upstream tree. Integrated: Marvisak#1394 (antisymmetric XUserCompare), Marvisak#1390 (A8_UNORM is not in the R8 typeless family), Marvisak#1499 (deep 3D mips stay out of the thick tail, plus a regression test the PR lacked), Marvisak#1366 (mesh stage I/O does not parse VS inputs), Marvisak#1594 (the title's exit status reaches the shell), Marvisak#1299 (docs: validator prerequisite), Marvisak#1515 (dialog commands before init), Marvisak#1424 (empty submissions skip the lock), Marvisak#1144 (shader differential skips are reported), Marvisak#1129 (64 MB pipeline-worker stacks), Marvisak#1564/Marvisak#1565/Marvisak#1566 (MakeResident, Evict and SetStablePowerState succeed as the console's do), Marvisak#1250 (a zero element count reads to the end of the buffer), Marvisak#1628 (texture-creation failure logs its states). Re-applied after the upstream merge dropped them: f32_to_half NaN and ties-to-even (Marvisak#843), unique-temp library writes (Marvisak#1660), VICTORY_PIPELINE_WORKERS (Marvisak#1728), VICTORY_MODE (Marvisak#1701). Removed: the orphaned depth-bounds test file, whose implementation (9a6d9e6) the merge dropped and which no module compiled. Refused: Marvisak#1099 (writing 0 for an unpaired p1 interpolation computes wrong values; two reviewers upstream and one here reached the same conclusion). Duplicates: Marvisak#1217, Marvisak#529, Marvisak#531, Marvisak#590, Marvisak#1102, Marvisak#398, Marvisak#1150, Marvisak#1220. Gate at efda2c5: fmt 0 differing, both Clippy gates 0 errors, policy 219 files, workspace 674 passed / 0 failed with the 10 documented pre-existing GPU skips.
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.
What
Fixes backlog item VIC-BT-014: thick 3D layouts' mip-tail predicate checked width and height, but not depth. A deep 3D mip (e.g. 16x16x64,
Sw64KbS) could therefore wrongly enter the one-block mip tail: its first mip hadtail: Some(...)andfirst_tail_mip == 0.The condition now also requires
mip_depth(i) <= fixed[2]for thick layouts, matching the block's depth limit. This is a one-line behavioral change; no game data, assets or generated data are added.TDD evidence
cargo test -p victory-formats --locked deep_3d_mips_do_not_enter_the_mip_tailfailed before the fix withmip 0 has 64 slices and cannot fit one tail block: Mip { ... tail: Some(Tail { offset: 8192, x: 16, y: 0 }) }.cargo test -p victory-formats --locked-> 24 passed, 0 failed, 4 ignored (4 pre-existing ignored benchmark/reference tests).cargo clippy -p victory-formats --all-targets --locked -- -D warningsclean.cargo xtask policy-> 154 files ok.git diff --checkclean.Duplicate check
Checked all open upstream PR titles and changed-file lists (820 open PRs at time of writing). No open PR contains this fix; among the newest PRs touching
victory-formats/src/texture.rs, only #1330 appears, and its diff has no mip-tail changes. This fix is also independent of the XMA/SGD5 and Linux-build patches posted on forks.Limitations
This machine is aarch64 Linux, and the full workspace does not compile here because of the pre-existing non-Windows
host_resourcecfg issue also covered by #1241;victory-pe'scurrent_exe()tests have the same known host assumption. I verified this crate locally; upstream CI onwindows-latestwill check the workspace. Windows MSVC cross-check was attempted but cannot run here becauseml64.exeis unavailable.AI use: Claude Code wrote the fix and tests and ran the checks at my request.