Keep the first partial piece in parallel shadow compares #114

Merged
cxy0072019-sketch merged 1 commit from upstream-pr/114 into main 2026-11-27 02:28:06 +00:00
cxy0072019-sketch commented 2026-11-27 01:39:04 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by cxy0072019-sketch on 2026-11-27T01:39:04Z.


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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5519683153 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/114). Originally posted by [cxy0072019-sketch](https://github.com/cxy0072019-sketch) on 2026-11-27T01:39:04Z. --- 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.
TaynanGT commented 2026-11-27 01:40:11 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T01:40:11Z.

Review: COMMENTED


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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:review:6082351334 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/114#pullrequestreview-6082351334). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T01:40:11Z. **Review:** COMMENTED --- 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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
TaynanGT/Vice-Tay!114
No description provided.