GPU: keep edge samples in odd-sized diagnostic PNGs #2680
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
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
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
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/Marvisak--VIctory!2680
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2680"
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?
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 18:02 UTC · original
andrewpozdnakov7-jpg:codex2/capture-odd-extents→main· +53 −1 · 1 files · 1 commits · openProblem
The diagnostic PNG encoder selects rows and columns 0, 2, 4, and so on, but sizes the output by rounding the source dimensions down. An odd source dimension therefore loses its final selected row or column.
Change
Round the half-size dimensions up so the PNG can hold the complete sample grid.
Verification
13f91caand a 2x3 PNG after the patch. The regression reads the actual IHDR and inflates IDAT to check all six RGB pixels, including the final row, column, and corner.Coordination claim
AI-assisted (Codex 2). Please retain the Git author on cherry-pick or rebase. If folding this change into another commit, please retain Co-authored-by: andrewpozdnakov7-jpg [email protected].
@oni-swr on GitHub · 2026-11-25 18:31 UTC · original
Independent verification (review, not a task claim) — covered by the existing claim on #1633.
b44ce1ff5d4716f794eba6246ca765da09096eba(OPEN, non-draft, merges cleanly; merge-base ==origin/main)origin/main:13f91caee25f2fdf2c062be5f7a27f058e51cbcaVICTORY_WARP=1,VICTORY_D3D12_WARP=1,dxil.dll1.8.2502.11 (Windows Kit 10.0.26100.0 x64), WARP only (physical GPU not used), no game files. Everyvictory-gpurun used--features diagnostics.Commands and results
cargo test --locked -p victory-gpu --features diagnostics --lib capture::→ 3 passed, 0 failed, 0 ignored.cargo test --locked -p victory-gpu --features diagnostics(full): one run had 198 passed, 1 failed, 1 ignored. The failure wasmemory::tests::a_submission_that_missed_leaves_the_copies_at_once, in code this PR does not touch. Four reruns of--libon the PR head all gave 199 passed, 0 failed, 1 ignored. On unmodifiedorigin/main, 6--libruns gave 198 passed in 4 runs, and 2 runs failed (memory::tests::a_submission_that_missed_leaves_the_copies_at_oncein both, plusdescriptor::host::tests::views_bound_while_another_slot_gets_its_texture_do_not_waitin one). Those are pre-existing flaky tests, not caused by this PR.cargo clippy --locked -p victory-gpu --features diagnostics --all-targets→ clean, no warnings.Negative control
(width / 2).max(1), (height / 2).max(1))capture::odd_capture_extents_keep_the_final_sampled_row_and_columnFAILED:left: [1, 2],right: [2, 3](2 passed, 1 failed). With the fix restored it passes.Review notes
ceil(n/2)is exactly the sample count. The remaining.max(1)only matters for a zero extent and is harmless.VICTORY_CAPTUREenvironment variable does not leak into parallel tests, and it checks the IHDR size and all six decoded RGB pixels, including the last row, column and corner. It assumes a single IDAT chunk right after IHDR (fixed offsets 37/41), which holds for this encoder.AI disclosure: independent verification by Claude Code (Claude Sonnet 5.5).
@kotekompotek on GitHub · 2026-11-25 18:37 UTC · original
Right fix: samples are taken at even coordinates, so an odd source dimension's last row/column is a real sample the floor-divided output could not hold. div_ceil matches the sample grid; the test reads the actual IHDR and inflates IDAT, including the corner pixel.
@fuzeofficlal on GitHub · 2026-11-25 18:59 UTC · original
Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP verification and review of
b44ce1ff(on13f91ca):Verification (
rustc 1.98.1MSVC)cargo clippy --locked -p victory-gpu --all-targets -- -D warningsand--features diagnostics: 0 warnings.cargo test --locked -p victory-gpu --features diagnostics --lib capture: 3 passed, 0 failed (includingodd_capture_extents_keep_the_final_sampled_row_and_column).VICTORY_D3D12_WARP=1):cargo test --locked -p victory-gpu --features diagnostics --lib -- --test-threads=1: 199 passed, 0 failed, 1 ignored.capture.rs: clean zero-conflict 3-waygit merge-treeagainst both #2701 (a86d36ef) and #2702 (b48e6c74).Review Notes
div_ceil(2).max(1)safely preserves the final sampled row/column for odd extents (2 * x <= width - 1,2 * y <= height - 1), handles1x1/1xN/Nx1without underflow, and cannot overflowu32. Clean and ready to merge.@Marvisak on GitHub · 2026-11-25 23:25 UTC · original
Automated triage for the maintainers.
In
save_as(crates/victory-gpu/src/capture.rs) the half-size PNG samples source rows and columns 0, 2, 4, …, but was sized withwidth / 2andheight / 2, so an odd extent lost its last sampled row or column;div_ceil(2)matches the sample grid, and the existing.min(width - 1)clamps keep indexing in bounds. The new test re-runs the test binary as a child to setVICTORY_CAPTURE(the same pattern other tests in the workspace use) and checks the IHDR size and all six decoded pixels of a 3x5 input, using theminiz_oxidedependency the crate already has. CI (check) passes.This is a recommendation for a maintainer to look, not an approval.
Generated by Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.