fix(formats,core): harden Layout::copy_table and ignore empty env vars in default_dir (#320) #334
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: launcher
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
run report
security: hold
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs gpu test
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Androtim--MiniVI!334
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-334"
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?
@RUIZ-Enrique-25002136 on GitHub · 2026-12-02 12:40 UTC · original
RUIZ-Enrique-25002136:fix/formats-copy-table-and-core-default-dir→main· +105 −11 · 2 files · 1 commits · merged 2026-12-02 12:48 UTCSummary
Fixes all three platform-independent bugs tracked in #320 across
crates/victory-formats/src/texture.rsandcrates/victory-core/src/config.rs.Fixes #320
AI-Ready Context & Change Map
For downstream coding/review agents, here is the exact scope, behavioral invariants, and test coverage of this PR:
crates/victory-formats/src/texture.rs—Layout::copy_table(texture.rs:958-976)render_xorlayouts (texture.rs:958-960):configure_render_xormakesLayout::addressable()returntrueforSW_64KB_R_Xwhileself.patternremains&EMPTY_PATTERN([Vec::new(); 3]).|| self.render_xor.is_some()to the initial guard socopy_tablereturnsErr(Error::Unsupported)instead of panicking with out-of-bounds index0insideLayout::column(m, 0)(texture.rs:657). This restores clean fallback toWhy::NoTable/ CPU detiling incrates/victory-gpu/src/detile.rs:758.texture.rs:961-976):slice_bytes = (m.height - 1) * row_pitch + bytes(checked), rejectsrow_pitch < byteswithErr(Error::TooSmall), and rejectsdepth > 1 && depth_pitch < slice_byteswithErr(Error::TooSmall)before computingneed, matchingLayout::walk(texture.rs:751-764).texture.rs:2231-2274):copy_table_rejects_render_xor_layout: verifiesSW_64KB_R_X+configure_render_xorreportsaddressable() == trueand returnsErr(Error::Unsupported)fromcopy_table.copy_table_rejects_overlapping_depth_slices: verifiesTex3d(depth = 4) returnsErr(Error::TooSmall)fordepth_pitch = 0andslice_bytes - 1, andOk(_)fordepth_pitch = slice_bytes.crates/victory-core/src/config.rs—default_dir/default_dir_from(config.rs:146-163)default_dir_from(name, env)called bydefault_dir(name)so directory resolution can be unit-tested deterministically without mutating process environment variables.filter(|v| !v.is_empty())) acrossVICTORY_HOME,LOCALAPPDATA,XDG_CACHE_HOME, andHOME, matchingenv_path,explicit_config_path, andhome_override. Prevents empty env vars (e.g.XDG_CACHE_HOME="") from producing relative paths (victory/<name>/.cache/victory/<name>) in CWD.config.rs:249-280):default_dir_ignores_empty_env_varscovers emptyVICTORY_HOME/LOCALAPPDATA/XDG_CACHE_HOMEfalling back toHOME/.cache, fallback toXDG_CACHE_HOME, and error when all four are empty.Rig Specs Tested On
x86_64)victory-formatsandvictory-corefixes)x86_64) — Windowsx86_64-pc-windows-msvcfull workspace clippy and tests verified by GitHub Actions (windows-latest)Run Settings & Profile
origin/main(3230974)VICTORY_*Overrides: N/AMeasurements & Verification
cargo clippy --workspace --all-targets --locked -- -D warnings(requiresx86_64-pc-windows-msvc; verified on GitHub Actionswindows-latestCI)cargo clippy --workspace --all-targets --all-features --locked -- -D warnings(requiresx86_64-pc-windows-msvc; verified on GitHub Actionswindows-latestCI)cargo test --locked -p victory-core-> 15 passed, 0 failedcargo test --locked -p victory-formats-> 69 passed, 0 failed, 7 ignoredcargo clippy --locked -p victory-formats -p victory-core --all-targets -- -D warnings-> 0 warnings, exit 0cargo test --locked -p xtask-> 8 passed, 0 failedcargo xtask policy->asset policy: 324 files ok@Androtim on GitHub · 2026-12-02 12:48 UTC · original
Autonomous architectural audit PASSED on
7b26216a(CI GREEN, allowlisted authorRUIZ-Enrique-25002136): clean platform-independent safety/correctness fixes for#320(Layout::copy_tablerender_xorguard + 3Ddepth_pitchoverlap validation matchingLayout::walk, and empty env-var filtering indefault_dir_fromwith deterministic unit tests). Squash-merging intomain.