Keep the first partial piece in parallel shadow compares #114

Manually merged
github merged 1 commit from github-bot/gh-114 into gh-pr/114/base 2026-11-27 02:43:08 +00:00 AGit
Owner

@⁠cxy0072019-sketch on GitHub · 2026-11-27 01:39 UTC · original
cxy0072019-sketch:codex/compare-first-shadow-piece → main · +30 −2 · 1 files · 1 commits · merged 2026-11-27 02:28 UTC

When a title buffer starts inside a 64 KiB piece, the first aligned cut in Shadow::differing can fall below the buffer. Unsigned subtraction wraps in release mode, so the first worker can skip its entire slice and miss bytes that the GPU wrote. Saturating the alignment calculation keeps that first piece in the comparison.

Adapted from victory-fork #1407, which credits the original finding to Kelvaroq.

On Windows release, the new 48 MiB regression missed the change at offset 0x0 on main. With the fix, all three focused comparison tests pass. The regression uses the existing unbacked Shadow test helper and synthetic bytes, so it runs without a D3D12 adapter or title data.

**@⁠cxy0072019-sketch** on GitHub · 2026-11-27 01:39 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/114) `cxy0072019-sketch:codex/compare-first-shadow-piece` → `main` · +30 −2 · 1 files · 1 commits · merged 2026-11-27 02:28 UTC When a title buffer starts inside a 64 KiB piece, the first aligned cut in `Shadow::differing` can fall below the buffer. Unsigned subtraction wraps in release mode, so the first worker can skip its entire slice and miss bytes that the GPU wrote. Saturating the alignment calculation keeps that first piece in the comparison. Adapted from [victory-fork #1407](https://github.com/fxceless/victory-fork/pull/1407), which credits the original finding to [Kelvaroq](https://github.com/stellarr-studio/kelvaroq). On Windows release, the new 48 MiB regression missed the change at offset `0x0` on main. With the fix, all three focused comparison tests pass. The regression uses the existing unbacked `Shadow` test helper and synthetic bytes, so it runs without a D3D12 adapter or title data.
Adapt the fix from fxceless/victory-fork#1407, which credits the original finding to stellarr-studio/kelvaroq. Use the existing unbacked Shadow test helper for a hardware-independent regression.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 02:11:12 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 01:40 UTC · original · reviewed

Thanks for carrying over the fix and keeping the test independent of a D3D12 adapter. I checked the split at 21ec8110. Clamping the first cut restores from, the interior workers still meet at 64 KiB title-address boundaries, and the last worker keeps the exact to. The 48 MiB case hits the parallel path and checks changes at both ends of the range. I saw your Windows release result in the PR description. Repository CI is still running.

**@⁠TaynanGT** on GitHub · 2026-11-27 01:40 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/114#pullrequestreview-6082351334) · **reviewed** Thanks for carrying over the fix and keeping the test independent of a D3D12 adapter. I checked the split at `21ec8110`. Clamping the first cut restores `from`, the interior workers still meet at 64 KiB title-address boundaries, and the last worker keeps the exact `to`. The 48 MiB case hits the parallel path and checks changes at both ends of the range. I saw your Windows release result in the PR description. [Repository CI](https://github.com/TaynanGT/Vice-Tay/actions/runs/45923771181) is still running.
github-bot changed target branch from main to gh-pr/114/base 2026-11-27 02:43:07 +00:00
github manually merged commit 21ec811066 into gh-pr/114/base 2026-11-27 02:43:08 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.