Fix source offsets in upcopy readback #1530
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1530"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by Gauss999 on 2026-11-28T21:19:01Z.
Summary
src_atanddst_atoffsets in theUprecordsrc_atonly for source readback, anddst_atfor destination, base, and reportingTests
up_keeps_copy_offsets_independentunit test; CI awaits approval.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by babuakhil on 2026-11-28T22:14:38Z.
Built and ran this on Windows, since it hadn't been run yet: Windows 11, Rust 1.98.1 (pinned), applied on current
main(d4b5d51); cherry-picks cleanly.--all-features) reports nothing inupcopies.rs--features diagnostics:up_keeps_copy_offsets_independentpasses, and all 25replaytests passHeads-up for CI: like the rest of
replay, this is#[cfg(all(windows, feature = "diagnostics"))]. Without the feature the test doesn't exist (cargo test -p victory-gpu --lib -- upcopiesruns 0 tests), so CI'scargo test --workspace --lockedwon't run it.The fix reads right. On
main,upsdropssrc_atinto the.., and the readback then asks for the source at the destination's offset (asked.push((self.objects[&src].res.clone(), at, len))withat = dst_at). So for any copy withsrc_at != dst_at, the "comes" words are read from the wrong place. Here the source is read atsrc_at, and the destination, its base, the reported word offsets and the declared pieces all stay ondst_at, as before.One gap in the test: it checks that
Up::newputs each field in its place, but not the readback, which is where the bug was. It couldn't fail onmaineither, sinceUpdoesn't exist there. A test that pins the three ranges the readback asks for (destination and base atdst_at, source atsrc_at), for example by moving theaskedpushes into a small function, would catch this coming back. Not a blocker.Not checked: a replay run with a real capture, which this path needs (I have no capture to run).
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Gauss999 on 2026-11-28T22:50:20Z.
Applied the non-blocking feedback from @babuakhil. The new
Up::readbackhelper is used to extendasked, and the regression test now checks all three(resource, offset, length)entries with distinct offsets (src_at = 0x80,dst_at = 0x200): destination and base read atdst_at, while source reads atsrc_at. The original fix remains intact, includingdst_atfor reported word offsets and declared pieces.I have not run a local build/test or a real-capture replay; this update was made through the web editor.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by babuakhil on 2026-11-28T23:04:01Z.
Re-checked with
de61ce5ond4b5d51(Windows 11, Rust 1.98.1): builds, clippy (--all-features) reports nothing inupcopies.rs, and with--features diagnosticsup_keeps_copy_offsets_independentpasses with the newreadbackassertions (25/25replaytests). The test now pins the source atsrc_atand the destination and base atdst_at, which is what the fix is about. Looks good to me; still not run against a real capture.