GPU: keep persistent workers in texture::in_parallel so thread_local SCRATCH survives across submissions, and coalesce subresource spans #2784

Open
RVZO6 wants to merge 1 commit from upstream-pr/2786 into main
RVZO6 commented 2026-11-25 20:23:08 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by RVZO6 on 2026-11-25T20:23:08Z.


Claimed in #1633: https://github.com/Marvisak/VIctory/issues/1633#issuecomment-7172903504

Summary

Fixes a performance bug in crates/victory-gpu/src/texture.rs (+377/-24 including unit tests and benchmark) where in_parallel defeated 8f2a6f1's thread_local! SCRATCH cache:

  1. Persistent worker pool in texture::in_parallel:
    8f2a6f1 introduced thread_local! SCRATCH specifically to avoid allocating, zero-filling, and faulting a fresh texture read buffer on every refresh ("129,000 faults in a frame, run placed1"). However, in_parallel spawned ephemeral OS threads via std::thread::scope on every refresh_all and descriptor::make_read call, immediately destroying each worker thread and freeing its thread_local! SCRATCH when the scope exited.
    Replacing std::thread::scope with a persistent ParallelPool (up to 3 persistent workers + the calling thread = 4 max, matching the existing available_parallelism / 4 cap) keeps each thread's SCRATCH buffer warm across submissions and removes per-submission OS thread creation/teardown. Contended or nested calls run inline to guarantee deadlock freedom; a RAII wait guard guarantees worker completion before return/unwind and propagates panics cleanly.
  2. Coalesce touched subresource spans in Staging::refresh_now:
    merge_spans() sorts and merges overlapping or adjacent [a, b) touched subresource byte intervals before calling copy_mapped, so each covered byte is read once instead of issuing separate calls for adjacent or partially overlapping subresources.

Measured on 13f91ca (--release texture::tests::bench_in_parallel_scratch_reuse, median of 3×40 batches, 4 threads, 8× 2 MiB Scratch buffers)

Implementation Time / batch Speedup
std::thread::scope (13f91ca) 1.620 ms/batch baseline
Persistent ParallelPool 0.059 ms/batch 27.6× (-96.4%)

Not a duplicate of

  • Checked open PRs and #1633; no open PR or claim touches texture::in_parallel or merge_spans in crates/victory-gpu/src/texture.rs.

Verification

  • Verified on windows-latest MSVC + WARP SM 6.6 CI (both clippy -D warnings profiles, xtask policy 6/6, victory-gpu 198/198 including parallel_pool_reuses_worker_scratch_and_handles_reentrancy_and_panics and merge_spans_coalesces_overlapping_and_adjacent_intervals): https://github.com/RVZO6/VIctory/actions/runs/45693633259
  • Not run: the title; any hardware GPU.

AI-assisted: T3 Code (Antigravity, gemini-4-neon)

<!-- greyfinch-sync:Marvisak/VIctory:issue:5498566280 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2786). Originally posted by [RVZO6](https://github.com/RVZO6) on 2026-11-25T20:23:08Z. --- Claimed in #1633: https://github.com/Marvisak/VIctory/issues/1633#issuecomment-7172903504 ### Summary Fixes a performance bug in `crates/victory-gpu/src/texture.rs` (`+377/-24` including unit tests and benchmark) where `in_parallel` defeated `8f2a6f1`'s `thread_local! SCRATCH` cache: 1. **Persistent worker pool in `texture::in_parallel`:** `8f2a6f1` introduced `thread_local! SCRATCH` specifically to avoid allocating, zero-filling, and faulting a fresh texture read buffer on every refresh ("129,000 faults in a frame, run placed1"). However, `in_parallel` spawned ephemeral OS threads via `std::thread::scope` on every `refresh_all` and `descriptor::make_read` call, immediately destroying each worker thread and freeing its `thread_local! SCRATCH` when the scope exited. Replacing `std::thread::scope` with a persistent `ParallelPool` (up to 3 persistent workers + the calling thread = 4 max, matching the existing `available_parallelism / 4` cap) keeps each thread's `SCRATCH` buffer warm across submissions and removes per-submission OS thread creation/teardown. Contended or nested calls run inline to guarantee deadlock freedom; a RAII wait guard guarantees worker completion before return/unwind and propagates panics cleanly. 2. **Coalesce touched subresource spans in `Staging::refresh_now`:** `merge_spans()` sorts and merges overlapping or adjacent `[a, b)` touched subresource byte intervals before calling `copy_mapped`, so each covered byte is read once instead of issuing separate calls for adjacent or partially overlapping subresources. ### Measured on `13f91ca` (`--release texture::tests::bench_in_parallel_scratch_reuse`, median of 3×40 batches, 4 threads, 8× 2 MiB `Scratch` buffers) | Implementation | Time / batch | Speedup | |---|---:|---:| | `std::thread::scope` (`13f91ca`) | `1.620 ms/batch` | baseline | | Persistent `ParallelPool` | `0.059 ms/batch` | **27.6× (-96.4%)** | ### Not a duplicate of - Checked open PRs and #1633; no open PR or claim touches `texture::in_parallel` or `merge_spans` in `crates/victory-gpu/src/texture.rs`. ### Verification - Verified on `windows-latest` MSVC + WARP SM 6.6 CI (both clippy `-D warnings` profiles, `xtask` policy 6/6, `victory-gpu` 198/198 including `parallel_pool_reuses_worker_scratch_and_handles_reentrancy_and_panics` and `merge_spans_coalesces_overlapping_and_adjacent_intervals`): https://github.com/RVZO6/VIctory/actions/runs/45693633259 - **Not run:** the title; any hardware GPU. AI-assisted: T3 Code (Antigravity, gemini-4-neon)
kotekompotek commented 2026-11-25 21:03:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T20:40:41Z.


Right diagnosis: thread_local Scratch died with the scoped threads each submission, so scratch was reallocated every frame - a persistent pool keeps it warm. The *const closure shim to workers is the standard non-'static handoff; the key invariant is run() never returns while a worker could still touch the closure, which the Drop join covers. merge_spans coalescing overlapping+adjacent intervals before the copy is a clean win. The panic/reentrancy test is the right coverage for a worker pool.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7174026331 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2786#issuecomment-7174026331). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T20:40:41Z. --- Right diagnosis: thread_local Scratch died with the scoped threads each submission, so scratch was reallocated every frame - a persistent pool keeps it warm. The *const closure shim to workers is the standard non-'static handoff; the key invariant is run() never returns while a worker could still touch the closure, which the Drop join covers. merge_spans coalescing overlapping+adjacent intervals before the copy is a clean win. The panic/reentrancy test is the right coverage for a worker pool.
oni-swr commented 2026-11-25 21:03:23 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-25T20:57:22Z.


Independent WARP/CPU verification of head d5f361504c40c3849c7d4ea941bcf1a6cd1f48a1 merged cleanly onto origin/main 13f91caee25f2fdf2c062be5f7a27f058e51cbca.

Environment: Windows 11 x64, WARP/CPU only (VICTORY_WARP=1, VICTORY_D3D12_WARP=1), no physical GPU, no game files; Windows SDK 10.0.26100.0 x64 dxil.dll 1.8.2502.11.

Tests (cargo test --no-fail-fast): victory-gpu: 197 passed, 0 failed, 2 ignored (baseline 195 passed, 1 ignored; +2 new tests, +1 ignored benchmark). The baseline's first run showed frame::tests::waits_end_on_ticks_and_count_frames failing once and passing on the rerun (known flaky, see TEST-FRAME-WAITS); the new pool test passed 5/5 repeated runs.

Negative control: changing a <= spans[write].1 to < in merge_spans makes merge_spans_coalesces_overlapping_and_adjacent_intervals fail; restored afterwards.

Clippy: cargo clippy -p <affected crates> --all-targets -- -D warnings clean (exit 0).
fmt: cargo fmt --check is not clean on origin/main itself (891 diff hunks across many files); this PR: 890 hunks (-1).

Review: I read the pool's claim/generation/remaining handshake, the WaitGuard drop ordering, the try_lock inline fallback for re-entrant/contended calls, and panic propagation; found no race or soundness problem. Merged spans only read each byte once, same bytes as before. The pool threads are never joined outside tests (static, process-lifetime), which seems acceptable. Diff contains no game files, dumps, shader names or retail hashes.

AI disclosure: this verification was done by Claude Code (Claude Sonnet 5.5).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7174415495 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2786#issuecomment-7174415495). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-25T20:57:22Z. --- Independent WARP/CPU verification of head `d5f361504c40c3849c7d4ea941bcf1a6cd1f48a1` merged cleanly onto `origin/main` `13f91caee25f2fdf2c062be5f7a27f058e51cbca`. **Environment:** Windows 11 x64, WARP/CPU only (`VICTORY_WARP=1`, `VICTORY_D3D12_WARP=1`), no physical GPU, no game files; Windows SDK 10.0.26100.0 x64 `dxil.dll` 1.8.2502.11. **Tests** (`cargo test --no-fail-fast`): victory-gpu: 197 passed, 0 failed, 2 ignored (baseline 195 passed, 1 ignored; +2 new tests, +1 ignored benchmark). The baseline's first run showed `frame::tests::waits_end_on_ticks_and_count_frames` failing once and passing on the rerun (known flaky, see TEST-FRAME-WAITS); the new pool test passed 5/5 repeated runs. **Negative control:** changing `a <= spans[write].1` to `<` in `merge_spans` makes `merge_spans_coalesces_overlapping_and_adjacent_intervals` fail; restored afterwards. **Clippy:** `cargo clippy -p <affected crates> --all-targets -- -D warnings` clean (exit 0). **fmt:** `cargo fmt --check` is not clean on `origin/main` itself (891 diff hunks across many files); this PR: 890 hunks (-1). **Review:** I read the pool's claim/generation/remaining handshake, the `WaitGuard` drop ordering, the try_lock inline fallback for re-entrant/contended calls, and panic propagation; found no race or soundness problem. Merged spans only read each byte once, same bytes as before. The pool threads are never joined outside tests (static, process-lifetime), which seems acceptable. Diff contains no game files, dumps, shader names or retail hashes. AI disclosure: this verification was done by Claude Code (Claude Sonnet 5.5).
fuzeofficlal commented 2026-11-25 22:04:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T21:13:18Z.


Reviewed and benchmarked d5f36150 on Windows 11 (RTX 5090 + WARP) against main (13f91ca).

Code review

  • Thread-pool lifetime, re-entrancy & panic safety look solid: try_lock() falls back cleanly to inline execution on concurrent/re-entrant calls (no deadlock); WaitGuard::drop blocks until st.remaining == 0 before returning or unwinding, ensuring the stack *const Job outlives all worker accesses; both worker and caller paths wrap work in catch_unwind, advance job.next = job.n on panic, and re-throw via resume_unwind after drop(guard) without poisoning the pool.
  • Memory bound & spans: with at most 3 persistent workers + caller (4 threads) and Scratch::drop's existing KEEP = 32 MiB cap, retained scratch stays bounded (~128 MiB max); merge_spans drops a >= b empties, sorts, and merges overlapping/adjacent [a, b) intervals cleanly.

Verification & same-machine --release benchmark (rustc 1.98.1 MSVC)

  • WARP (VICTORY_D3D12_WARP=1, --features diagnostics): 200 passed, 0 failed (texture::tests 4/4, including parallel_pool_reuses_worker_scratch_and_handles_reentrancy_and_panics and merge_spans_coalesces_overlapping_and_adjacent_intervals).
  • RTX 5090 (--features diagnostics): 195 passed, 2 failed (only the 2 pre-existing RTX 5090 >1M heap-cap baselines; texture:: & descriptor::host::tests::a_* 8/8 passed).
  • cargo clippy --locked -p victory-gpu --all-targets -- -D warnings (default & diagnostics): 0 warnings; cargo xtask policy: 184 files ok; clean 4-way git merge-tree with #2784, #2785, #2787.
  • texture::tests::bench_in_parallel_scratch_reuse (--release, 3-run median × 40 batches, 4 threads × 8 × 2 MiB): 0.524 ms/batch (13f91ca thread::scope) -> 0.009 ms/batch (58.2× / -98.3%).
<!-- greyfinch-sync:Marvisak/VIctory:comment:7174775724 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2786#issuecomment-7174775724). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-25T21:13:18Z. --- Reviewed and benchmarked `d5f36150` on Windows 11 (RTX 5090 + WARP) against `main` (`13f91ca`). ### Code review - **Thread-pool lifetime, re-entrancy & panic safety look solid**: `try_lock()` falls back cleanly to inline execution on concurrent/re-entrant calls (no deadlock); `WaitGuard::drop` blocks until `st.remaining == 0` before returning or unwinding, ensuring the stack `*const Job` outlives all worker accesses; both worker and caller paths wrap work in `catch_unwind`, advance `job.next = job.n` on panic, and re-throw via `resume_unwind` after `drop(guard)` without poisoning the pool. - **Memory bound & spans**: with at most 3 persistent workers + caller (4 threads) and `Scratch::drop`'s existing `KEEP = 32 MiB` cap, retained scratch stays bounded (~128 MiB max); `merge_spans` drops `a >= b` empties, sorts, and merges overlapping/adjacent `[a, b)` intervals cleanly. ### Verification & same-machine `--release` benchmark (`rustc 1.98.1` MSVC) - **WARP (`VICTORY_D3D12_WARP=1`, `--features diagnostics`)**: **200 passed, 0 failed** (`texture::tests` **4/4**, including `parallel_pool_reuses_worker_scratch_and_handles_reentrancy_and_panics` and `merge_spans_coalesces_overlapping_and_adjacent_intervals`). - **RTX 5090 (`--features diagnostics`)**: `195 passed, 2 failed` (only the 2 pre-existing RTX 5090 >1M heap-cap baselines; `texture::` & `descriptor::host::tests::a_*` **8/8 passed**). - `cargo clippy --locked -p victory-gpu --all-targets -- -D warnings` (default & `diagnostics`): **0 warnings**; `cargo xtask policy`: **184 files ok**; clean 4-way `git merge-tree` with `#2784`, `#2785`, `#2787`. - `texture::tests::bench_in_parallel_scratch_reuse` (`--release`, 3-run median × 40 batches, 4 threads × 8 × 2 MiB): `0.524 ms/batch` (`13f91ca` `thread::scope`) -> **`0.009 ms/batch`** (**58.2× / -98.3%**).
Marvisak commented 2026-11-26 00:03:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T23:25:02Z.


Automated triage for the maintainers.

The diagnosis checks out: texture::in_parallel on main spawns scoped threads on every call, so the thread_local! Scratch buffer that Staging::refresh_now relies on is dropped each time. This PR replaces the scoped threads with a persistent pool (ParallelPool, at most 3 workers plus the caller). A WaitGuard waits for the workers before the stack-held job goes out of scope, and panics are passed back to the caller. A new merge_spans copies overlapping or adjacent subresource spans once instead of skipping only exact duplicates. I read the generation/claimed/remaining handshake and found no race. Points for the maintainer: this adds about 200 lines of hand-written unsafe synchronisation; a second caller that arrives while the pool is busy now runs single-threaded, where main gave it its own threads; and the speedup is from a synthetic benchmark, not from frame times in the title. CI passes.

This is a recommendation for a maintainer to look, not an approval.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7177530867 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2786#issuecomment-7177530867). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T23:25:02Z. --- <!-- victory-triage v1 head=d5f361504c40c3849c7d4ea941bcf1a6cd1f48a1 verdict=merge-candidate at=2026-11-25T23:24:54Z --> Automated triage for the maintainers. The diagnosis checks out: `texture::in_parallel` on `main` spawns scoped threads on every call, so the `thread_local!` `Scratch` buffer that `Staging::refresh_now` relies on is dropped each time. This PR replaces the scoped threads with a persistent pool (`ParallelPool`, at most 3 workers plus the caller). A `WaitGuard` waits for the workers before the stack-held job goes out of scope, and panics are passed back to the caller. A new `merge_spans` copies overlapping or adjacent subresource spans once instead of skipping only exact duplicates. I read the generation/claimed/remaining handshake and found no race. Points for the maintainer: this adds about 200 lines of hand-written unsafe synchronisation; a second caller that arrives while the pool is busy now runs single-threaded, where `main` gave it its own threads; and the speedup is from a synthetic benchmark, not from frame times in the title. CI passes. This is a recommendation for a maintainer to look, not an approval. --- _Generated by [Claude Code](https://claude.ai/code)_
Dukestar69 commented 2026-11-26 03:11:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T03:11:38Z.

Review: APPROVED


Tested merged onto origin/main (63bcca4) on Windows 11 x64:

  • cargo test -p victory-gpu --lib texture::: 4 passed, 0 failed, 1 ignored (including new parallel_pool_reuses_worker_scratch_and_handles_reentrancy_and_panics).
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6068043552 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2786#pullrequestreview-6068043552). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-26T03:11:38Z. **Review:** APPROVED --- Tested merged onto `origin/main` (`63bcca4`) on Windows 11 x64: - `cargo test -p victory-gpu --lib texture::`: **4 passed, 0 failed, 1 ignored** (including new `parallel_pool_reuses_worker_scratch_and_handles_reentrancy_and_panics`). - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
fuzeofficlal commented 2026-11-26 11:47:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T11:47:59Z.

Review: APPROVED


Reviewed and verified d5f36150 on Windows 11 (Ryzen 9 9950X, RTX 5090, WARP, VICTORY_D3D12_DEBUG=1).

  • ParallelPool (crates/victory-gpu/src/texture.rs:490-715) is sound across lifetimes, re-entrancy, and panics:
    • run_lock.try_lock() falls back to inline execution on concurrent or nested calls, avoiding deadlocks.
    • Local drop order (_run -> job -> guard) ensures WaitGuard::drop waits until st.remaining == 0 before the stack Job or closure f can be dropped on either normal return or unwind.
    • run_job catches worker/caller panics, stops remaining work (job.next.store(job.n, Relaxed)), and re-throws via resume_unwind after drop(guard) without poisoning the pool.
    • Persistent worker count is bounded to max_parallel_threads() - 1 (at most 3 workers), and Scratch::drop's existing KEEP = 32 MiB limit bounds retained scratch memory across workers.
  • merge_spans (texture.rs:907-925) drops empty spans and merges only overlapping or adjacent (a <= spans[write].1) [a, b) intervals, covering the exact same bytes without bridging uncommitted gaps, while copy_mapped handles unmapped pages cleanly via its 64 KiB / 4 KiB fallback.

Verification:

  • cargo xtask policy (184 files ok) and cargo clippy -p victory-gpu --tests -- -D warnings (default and --all-features): clean.
  • RTX 5090 (default): texture::tests passed 5/5 repeated runs (4/4 each) and draw::tests 11/11 passed.
  • RTX 5090 + VICTORY_D3D12_DEBUG=1 and WARP + VICTORY_D3D12_DEBUG=1 (--features diagnostics): texture::tests 4/4 and draw::tests 11/11 passed on both adapters with zero Debug Layer errors.
  • Release benchmark (cargo test --release -p victory-gpu --lib texture::tests::bench_in_parallel_scratch_reuse -- --exact --ignored --nocapture): scoped=0.621 ms/batch vs pooled=0.014 ms/batch (43.08x speedup).
<!-- greyfinch-sync:Marvisak/VIctory:review:6073610996 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2786#pullrequestreview-6073610996). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T11:47:59Z. **Review:** APPROVED --- Reviewed and verified `d5f36150` on Windows 11 (Ryzen 9 9950X, RTX 5090, WARP, `VICTORY_D3D12_DEBUG=1`). - `ParallelPool` (`crates/victory-gpu/src/texture.rs:490-715`) is sound across lifetimes, re-entrancy, and panics: - `run_lock.try_lock()` falls back to inline execution on concurrent or nested calls, avoiding deadlocks. - Local drop order (`_run` -> `job` -> `guard`) ensures `WaitGuard::drop` waits until `st.remaining == 0` before the stack `Job` or closure `f` can be dropped on either normal return or unwind. - `run_job` catches worker/caller panics, stops remaining work (`job.next.store(job.n, Relaxed)`), and re-throws via `resume_unwind` after `drop(guard)` without poisoning the pool. - Persistent worker count is bounded to `max_parallel_threads() - 1` (at most 3 workers), and `Scratch::drop`'s existing `KEEP = 32 MiB` limit bounds retained scratch memory across workers. - `merge_spans` (`texture.rs:907-925`) drops empty spans and merges only overlapping or adjacent (`a <= spans[write].1`) `[a, b)` intervals, covering the exact same bytes without bridging uncommitted gaps, while `copy_mapped` handles unmapped pages cleanly via its 64 KiB / 4 KiB fallback. Verification: - `cargo xtask policy` (`184 files ok`) and `cargo clippy -p victory-gpu --tests -- -D warnings` (default and `--all-features`): clean. - RTX 5090 (default): `texture::tests` passed 5/5 repeated runs (4/4 each) and `draw::tests` 11/11 passed. - RTX 5090 + `VICTORY_D3D12_DEBUG=1` and WARP + `VICTORY_D3D12_DEBUG=1` (`--features diagnostics`): `texture::tests` 4/4 and `draw::tests` 11/11 passed on both adapters with zero Debug Layer errors. - Release benchmark (`cargo test --release -p victory-gpu --lib texture::tests::bench_in_parallel_scratch_reuse -- --exact --ignored --nocapture`): `scoped=0.621 ms/batch` vs `pooled=0.014 ms/batch` (**43.08x** speedup).
andrewpozdnakov7-jpg commented 2026-11-28 05:03:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T05:03:53Z.


I combined #3669 with the exact #2786 head in a60d366. The conflict was in in_parallel. Empty and single-item batches return before the CPU-affinity query, and larger batches still use this PR's persistent workers. The one-dirty-texture path writes the result directly into its existing output slot.

Both isolated runs passed on app-local WARP 1.0.22 and Agility 1.620.2, with the D3D12 debug switch off and on. The two texture tests checked single-texture re-upload counts and independent pixel readback from two textures in one submission. The pool test checked scratch reuse and reentrancy, and the span-coalescing test passed. Strict GPU Clippy and the asset policy passed.

RVZO6 or a maintainer can pick up the resolution if both changes land together.

Please retain the Git authors on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding this resolution into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7234432598 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2786#issuecomment-7234432598). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T05:03:53Z. --- I combined #3669 with the exact #2786 head in [a60d366](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/a60d36623892ece297589d003cd20a1de1ae3976). The conflict was in `in_parallel`. Empty and single-item batches return before the CPU-affinity query, and larger batches still use this PR's persistent workers. The one-dirty-texture path writes the result directly into its existing output slot. Both isolated runs passed on app-local WARP 1.0.22 and Agility 1.620.2, with the D3D12 debug switch off and on. The two texture tests checked single-texture re-upload counts and independent pixel readback from two textures in one submission. The pool test checked scratch reuse and reentrancy, and the span-coalescing test passed. Strict GPU Clippy and the asset policy passed. RVZO6 or a maintainer can pick up the resolution if both changes land together. Please retain the Git authors on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding this resolution into another commit. AI-assisted with OpenAI Codex.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2786:upstream-pr/2786'
git switch 'upstream-pr/2786'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2786'
git switch 'upstream-pr/2786'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2786'
git switch 'upstream-pr/2786'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2786'
git switch 'main'
git merge --squash 'upstream-pr/2786'
git switch 'main'
git merge --ff-only 'upstream-pr/2786'
git switch 'main'
git merge 'upstream-pr/2786'
git push origin 'main'
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
Marvisak/VIctory!2784
No description provided.