D3D12.X: report retained texture upload staging capacity #2862
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2862"
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 ivall/xcl. Originally posted by jeroenhaentjens on 2026-11-26T19:46:30Z.
Part of #2639 and #1833. The queue's reusable texture upload buffer is retained between batches, but its capacity was absent from the world-load memory timeline. This adds a measurement; upload behavior and limits do not change.
What is in it
Tested
3f0ed9b8b3: cargo build --workspace --locked succeeded.Regression run
Standard setup
Both clean release builds timed out before guest entry while precompiling the title's 26,503 shader records. The 150-second smoke command with a 120-second startup allowance expired after about 270 seconds on each build. XCL did not print the log path needed to produce a smoke block. These attempts predate the controlled AC retest.
Separate runtime diagnostic on AC
Both runs used the same retail title, Quadro RTX 3000, 150-second script,
XCL_NETWORK=0, input schedule (15:A,35:A,55:A,75:A), and separate initially empty XCL shader caches. In a separate game directory, the byte-identicalshaders.rpfwas supplied via XCL's runtime overlay. This gave the guest access to the archive while skipping the host's up-front shader preparation. Both builds were unmodified. Windows reported AC power before and after both runs.8b957bec6f82495aec940944c6bf47faa02db5900x03f0ed9b8b35dba7732bd5b3ba8ab7997b99670790x0The PR emitted 73 staging samples. The active and idle maxima were each 64 MiB at different samples, and the combined high-water mark was 64 MiB. The default setup still lacks a completed paired smoke test.
Not tested
AI use
Imported from ivall/xcl. Originally posted by jeroenhaentjens on 2026-11-27T21:30:49Z.
Completed the GTA VI 1.0.2.1 startup run on
3f0ed9b8b35dba7732bd5b3ba8ab7997b9967079(release build, NVIDIA Quadro RTX 3000). The earlier attempt timed out during shader preparation. This run let preparation finish before starting the 150-second title timer.PresentXcalls. The timer ended the run as configured. The report recorded exit code 0 and no crash.World visibility is unverified. We did not visually verify what those frames contained, so we do not know whether the game world was visible.
Imported from ivall/xcl. Originally posted by jeroenhaentjens on 2026-11-27T21:47:22Z.
Follow-up to the 477-frame startup run: we completed a standard base/head comparison with frame captures on GTA VI 1.0.2.1 and the Quadro RTX 3000. Both builds used the same game directory, an existing DXIL cache, a fresh title-data directory per run, networking off, a 150-second title timer, scripted A presses at 15/35/55/75 s, and a capture every 30 presents. There was also manual input. The earlier overlay runs and the earlier 477-frame head run are separate observations.
8b957bec3f0ed9b8Both timers ended as configured with exit code 0 and no recorded crash. We inspected 34 captures from base and 26 from head. The tester also observed responsive keyboard input at player selection. Neither set of captures confirms a playable world. The two runs spent different amounts of time at player selection and reached different points in the intro, so these frame counts and memory samples cannot establish a performance or memory regression.
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-27T22:34:33Z.
Tested
Clean detached
3f0ed9b8b35dba7732bd5b3ba8ab7997b9967079on Windows 11 build 26200, Ryzen 7 3800X, Intel Arc A770 (8086:56a0, driver 32.0.101.9175), and Rust 1.100.1 MSVC in the unoptimized test profile. I reran the pinned executable with--exact gpu::texture::tests::gpu_staging_capacity_lifecycle_arc --nocapture --test-threads=1. Its private source extraction adds a#[cfg(test)]fixture to the exact-head production source. I verified the fixture insertion against the source and binary pins.The fixture called production
upload_batchon one D3D12 queue, held completion with a queue fence, and used the stock readback helper. The baseline was zero across all three counters.All three uploads remained pending while gated and read back byte-exactly after completion. The smaller reuse batch kept the same 8 MiB backing as the growth batch. 1 passed, 0 failed, 0 ignored, 0 skips. The runtime identified the A770 with
XCL_ADAPTER=A770. The native test and GPU lock wrapper exited 0, and the executable SHA-256 held before, under, and after the lock.Not tested
Release of the last idle uploader, multiple queues, GPU failure paths, other adapters, retail smoke, and the full workspace suite.
AI use
T3 Code / Codex (
gpt-6.2-sol) prepared the fixture, independently reran the pinned test, and wrote this report.Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-28T02:41:53Z.
While reviewing the staging accounting on head
3f0ed9b8, I noticed a pre-existing post-submission ownership asymmetry inupload_batch. AfterExecuteCommandLists, aqueue.Signalerror returns through?and drops the uploader. If signaling succeeds but the subsequent fence wait fails, the code deliberately retains the uploader because completion is unknown.I compiled the exact post-submission block with mock queue/fence responses and an observing uploader drop counter:
All control assertions passed. On the signal-error path the new counter also decreases when the staging allocation drops, though the test does not show whether any native GPU work remains pending. This ownership behavior predates this PR; it may deserve a separate failure-path fix rather than being attributed to the telemetry change. No actual device removal or retail run was induced.
AI use: OpenAI Codex with GPT-6.2 Astra inspected the path and ran the mock; Codex reviewed and prepared this report.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:05:08Z.
Triage (#1607) – head
3f0ed9bNo open or merged PR adds the same staging-capacity metric (#3050 and #3194 change how many upload buffers are kept; they do not report them).
The accounting in gpu/texture.rs is consistent in the diff: growth, put_back, reuse, Drop on error paths, and the mem::forget path after a failed fence wait, which stays counted as active as the description says.
gpu/texture.rs has changed a lot on main since the base (upload_batch_with_zero_mips and more), so the PR conflicts and needs a rebase. It is still a draft.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.