replay: defer clamp scratch copy until split transition completes #9

Manually merged
github merged 1 commit from github-bot/gh-9 into main 2026-11-26 08:21:47 +00:00 AGit
Owner

@⁠battledogegames-design on GitHub · 2026-11-25 23:15 UTC · original
battledogegames-design:replay/defer-split-clamp-copy → main · +98 −29 · 2 files · 1 commits · merged 2026-11-26 08:17 UTC

The clamp-capture pass in --skip-clamps uses a transition to INDIRECT_ARGUMENT as the signal to copy scratch into the replay results buffer. A split barrier carries that destination state on both halves. The editor consequently inserted transitions and a CopyBuffer after BEGIN_ONLY, while D3D12 still prohibits access to the resource.

Capture after an ordinary transition or the completing END_ONLY. Insert the copy immediately after that barrier, before any remaining barriers in the same call can change the state again. If a list cannot capture every requested clamp, return an error before replay consumes the results. The caller change propagates that error.

The synthetic regression covers a begin-only prefix, an unrelated resource transition, a pipeline bind, completion, and a second scratch transition in the same barrier call. It checks the exact command order and one copy. Existing unsplit coverage passes.

Validation on Windows, Rust 1.98.1, base 0a43566

Commands below ran in an isolated Cargo harness compiling the pinned editor and wire modules, using separate clean directories for baseline and corrected builds.

  • cargo test --locked clamp_copy_waits_for_the_end — original editor failed on the unexpected copy. Corrected regression passed.
  • cargo test --locked — all 8 editor and wire tests passed.
  • cargo build --locked and cargo clippy --locked --all-targets -- -D warnings — passed.
  • cargo check --offline in a separate harness compiled the entire replay module, including the changed caller, against real Windows bindings and compile-only stand-ins for the external GPU/PNG services.
  • Rustfmt reported the same pre-existing differences before and after the patch. Neither changed file introduced a new formatting difference.
  • Target-workspace cargo test --locked -p victory-gpu --features diagnostics --lib replay:: stopped before compilation because the registry hostname could not resolve for locked zlib-rs 0.6.8.

Thanks to tatazildo for the NVIDIA validation in #3 that prompted this review. This change covers capture completed within a command list. Cross-list capture, actual frame replay and physical GPU behavior were not validated. The relationship to debug-layer messages 538, 1003 and 527 remains unproven. #5 separately addresses the replay fixture.

**@⁠battledogegames-design** on GitHub · 2026-11-25 23:15 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/9) `battledogegames-design:replay/defer-split-clamp-copy` → `main` · +98 −29 · 2 files · 1 commits · merged 2026-11-26 08:17 UTC The clamp-capture pass in `--skip-clamps` uses a transition to `INDIRECT_ARGUMENT` as the signal to copy scratch into the replay results buffer. A split barrier carries that destination state on both halves. The editor consequently inserted transitions and a `CopyBuffer` after `BEGIN_ONLY`, while D3D12 still prohibits access to the resource. Capture after an ordinary transition or the completing `END_ONLY`. Insert the copy immediately after that barrier, before any remaining barriers in the same call can change the state again. If a list cannot capture every requested clamp, return an error before replay consumes the results. The caller change propagates that error. The synthetic regression covers a begin-only prefix, an unrelated resource transition, a pipeline bind, completion, and a second scratch transition in the same barrier call. It checks the exact command order and one copy. Existing unsplit coverage passes. **Validation on Windows, Rust 1.98.1, base `0a43566`** Commands below ran in an isolated Cargo harness compiling the pinned editor and wire modules, using separate clean directories for baseline and corrected builds. - `cargo test --locked clamp_copy_waits_for_the_end` — original editor failed on the unexpected copy. Corrected regression passed. - `cargo test --locked` — all 8 editor and wire tests passed. - `cargo build --locked` and `cargo clippy --locked --all-targets -- -D warnings` — passed. - `cargo check --offline` in a separate harness compiled the entire replay module, including the changed caller, against real Windows bindings and compile-only stand-ins for the external GPU/PNG services. - Rustfmt reported the same pre-existing differences before and after the patch. Neither changed file introduced a new formatting difference. - Target-workspace `cargo test --locked -p victory-gpu --features diagnostics --lib replay::` stopped before compilation because the registry hostname could not resolve for locked `zlib-rs 0.6.8`. Thanks to tatazildo for the NVIDIA validation in #3 that prompted this review. This change covers capture completed within a command list. Cross-list capture, actual frame replay and physical GPU behavior were not validated. The relationship to debug-layer messages 538, 1003 and 527 remains unproven. #5 separately addresses the replay fixture.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:31:15 +00:00
Author
Owner

@⁠gomeaw on GitHub · 2026-11-25 23:23 UTC · original · reviewed

Independent validation of 3bb5980 in the target workspace on Windows x64, Rust 1.98.1.

  • All 25 replay unit tests passed with diagnostics enabled, including the split-transition regression.
  • I combined this change with #5 and changed the synthetic frame to record real BEGIN_ONLY and END_ONLY barriers for the clamp scratch buffer. An argument-buffer transition sits between them. With the PR applied, the WARP replay with --skip-clamps passed the byte-for-byte image and buffer checks.
  • Reverting only replay/edit.rs and replay/play.rs to 0a43566 made the same frame fail --skip-clamps with D3D12 IDs 534 and 535. The debug layer saw a full barrier while the split transition was pending.

This reproduces the split-barrier issue independently of the fixture errors fixed by #5. The existing --one-submit ID 527 still appears in its own experiment.

Windows comparison

AI-assisted with Codex. All inputs are synthetic.

**@⁠gomeaw** on GitHub · 2026-11-25 23:23 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/9#pullrequestreview-6066366078) · **reviewed** Independent validation of `3bb5980` in the target workspace on Windows x64, Rust 1.98.1. - All 25 replay unit tests passed with diagnostics enabled, including the split-transition regression. - I combined this change with #5 and changed the synthetic frame to record real `BEGIN_ONLY` and `END_ONLY` barriers for the clamp scratch buffer. An argument-buffer transition sits between them. With the PR applied, the WARP replay with `--skip-clamps` passed the byte-for-byte image and buffer checks. - Reverting only `replay/edit.rs` and `replay/play.rs` to `0a43566` made the same frame fail `--skip-clamps` with D3D12 IDs 534 and 535. The debug layer saw a full barrier while the split transition was pending. This reproduces the split-barrier issue independently of the fixture errors fixed by #5. The existing `--one-submit` ID 527 still appears in its own experiment. [Windows comparison](https://github.com/gomeaw/VIctory-7900XTX/actions/runs/45720214728/job/139576370914) AI-assisted with Codex. All inputs are synthetic.
Author
Owner

@⁠avatarmanz on GitHub · 2026-11-26 07:55 UTC · original

Merged into main in the next push (tests pass); thanks.

**@⁠avatarmanz** on GitHub · 2026-11-26 07:55 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/9#issuecomment-7185976207) Merged into main in the next push (tests pass); thanks.
github manually merged commit 0dc8c655fa into main 2026-11-26 08:21:47 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.