gpu: build again after 5668b8b (Layout::bytes_from from myokex/victory-amd) #64
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/64"
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 uiliannn/VItoriaBr. Originally posted by lcg007xd-c on 2026-11-25T21:30:08Z.
What this fixes
mainhas failed the Windows check job since5668b8b("port VICTORY_TEXTURE_HEAPS and VICTORY_STAGING_BLOCKS from myokex/victory-amd"):The ported callers, in
gpu/texture.rs:1766/1771andgpu/resource.rs:3012(placed_bytes_from), useLayout::bytes_from. That method lives invictory-formatsin myokex's commit and was not brought along.The change (from the same commit, myokex/victory-amd
c3723f3, GPL-3.0)Layout::bytes_from(first): the bytes mipfirstand the smaller mips take from the start of the texture, since smaller mips lie nearer the start. It returns the whole layout from mip 0, and whenever the chain repeats per slice: array slices, 3D, thick layouts, MSAA.detile/tile: now accept a tiled buffer ofbytes_from(mip)bytes instead of the whole layout. The new callers pass exactly that much, so without this their uploads of the smaller mips would getTooSmall. Every other case is unchanged, becausebytes_fromreturns the full size there.smaller_mips_need_only_the_start_of_the_texture: for every mip of a 1024² BC1 texture, reading from exactlybytes_from(mip)bytes gives the same pixels as reading from the whole texture, and one byte less isTooSmall. It passes on VItoriaBr's own layout code.gpu/texture.rs:1244:% HASH_EVERY == 0becomes.is_multiple_of(HASH_EVERY). That is the next clippy error (manual_is_multiple_of) once the crate compiles again.Tested (Linux, the pinned Rust 1.98.1, Windows code type-checked for
x86_64-pc-windows-msvc)cargo clippy --workspace --all-targets --locked -- -D warningsand the same with--all-features. Onmainboth fail.-D warningsandcargo test -p victory-formats, 38 passed.Not run here:
cargo test --workspaceon Windows, and the game.🤖 Generated with Claude Code
Imported from uiliannn/VItoriaBr. Originally posted by lmouz823-lang on 2026-11-28T09:07:09Z.
I can take native Windows validation at exact head
cce69f5c5050debe08472a4770297ffd0c1a7ff0. I will check the existing smaller-mip regression, audit short-buffer tile/detile and whole-layout fallback cases through public entry points, and verify the Windows GPU build that this PR restores. Any focused supplemental patch will include fixed expectations, a targeted negative control, freshly rebuilt restored-source acceptance, and explicit ignored tests and GPU/game limitations. AI-assisted with Codex.Imported from uiliannn/VItoriaBr. Originally posted by lmouz823-lang on 2026-11-28T09:19:44Z.
Windows validation and two focused regressions completed for head
cce69f5c5050debe08472a4770297ffd0c1a7ff0, based on5668b8bbdc9e18030735466fef23c4a699374ae9.Native build and final acceptance
Windows 11 build 26200, Rust 1.98.1
x86_64-pc-windows-msvc, locked dependencies, default test profile and an isolated target directory were used.VICTORY_STRICT_TESTS=1was enabled.I reconstructed the base tracked tree by restoring the two files changed by this PR and confirmed that
git diff <base> --name-onlywas empty. Nativecargo check --locked -p victory-gpu --all-targetsthen failed with three E0599 diagnostics for the missingLayout::bytes_from, at the resource and texture callers identified in this PR.After restoring the PR implementation and the added tests, a package-only clean removed the isolated formats outputs. A fresh compilation took 3.48 seconds. Final acceptance produced the following results.
smaller_mips_need_only_the_start_of_the_texture, exactcargo test --locked -p victory-formatsvictory-gpu --all-targetscheck, default features-D warningsEach exact selection actually ran one test. The three exacts were repeated after the package and static runs, with the same executable SHA256 before and after them.
Added coverage
The attached 84-line test-only patch covers the write direction and the whole-layout cases.
[15360, 7168, 3072, 1024]. Mip 1 starts at 3072 and writes 16 rows of 32 bytes, each 256 bytes apart. The expected tiled bytes are assembled from those fixed addresses, including padding and a 32-byte guard after the supplied prefix. A detile reads the result back. Both one-byte-short paths returnTooSmallbefore copying, checked with sentinels.thickandslicesfields, then checks the documented whole-layout result. The normal linear layout also checks out-of-range first mips. The MSAA case has one mip, and the thick case also satisfies the 3D condition, so these are configuration-level checks with overlapping guards.Negative controls and restoration
Two targeted temporary regressions each left the existing exact test passing and made the relevant added exact fail with Cargo exit 101.
TooSmallBoth mutations were removed before the clean rebuild. Removing the two added test blocks from the final source reproduces the pinned original file byte-for-byte. The GPU implementation file also matches its pinned head bytes.
Ignored cases and limits
The package's six existing ignored tests were kept visible.
bcpack::tests::bcpack_throughputtexture::tests::detile_throughputbcpack::tests::reference_chunkstexture::generate::patterns_are_generated_from_addrlibVICTORY_ADDRLIBxma::tests::matches_a_reference_decoderxma::tests::walks_saved_streamsThe selected exact tests contain no ignored or runtime-skipped cases. Their other 45 library tests were filtered out. The package run covers all 46 library tests with the six explicit omissions above. Native GPU-crate checks compile Windows code. GPU execution, game streaming/performance, other platforms and the full workspace test suite were outside this validation.
Checks and reproduction
The asset policy passed for 196 files. New-test Rustfmt,
git diff --check, forward apply-check against an isolated pinned-head index, and reverse apply-check against the worktree passed. Whole-file Rustfmt exits 1 on both pinned original and final source, with the same 15 existing hunks and identical ordered formatting changes, 80 added and 22 removed formatting lines.A preliminary local edit guard expected a different rustfmt table shape and stopped before writing its proposed edit. An initial formatter call on an isolated source copy could not resolve its child modules. The guard was corrected from the actual text, and the original/final whole-file comparison used
skip_children=trueconsistently. These preparation attempts are excluded from acceptance.AI assistance from Codex covered the audit, patch, local execution and this report.
Final source SHA256
054526420a83e0db6c902ac0fa61bd2a4b8e67c64ced89c85fe7d70c2a74fd4e. Patch SHA2561f29ff32c6e9307654f2e99b8ccc47b73e659e87bf29ecc8682ff46e09b4fc8f.Two synthetic streaming regressions against this head
Pull request closed