Repository navigation
Conversation
|
I tested the idle upload-buffer cap at
With the 1 MiB cap, the next small upload reused the same buffer. Idle capacity dropped to zero while it was checked out and returned to 1 MiB after its fence completed. All three runs passed byte-for-byte readback checks for both textures and the subsequent refresh, with zero skips. These measurements cover idle buffer capacity on WARP. I didn’t measure process memory, physical GPU performance, or loading in the retail game. I used OpenAI Codex with GPT-6.2 Sol to write and run the test. A separate GPT-6.2 Sol agent verified the artifact and logs. GPT-6.2 Astra drafted this comment. I reviewed and approved this comment before posting. |
|
Exact production d6d529c verified on RTX 4060 Laptop/Wine 11, with only a local test fixture added to texture_upload.rs.
A 64x64 R8 upload plus 1024x1024 RGBA8 burst allocate 1 MiB and4 MiB staging jobs, neither counted idle while checked out. Both jobs are returned only after real queue-fence completion:
All GPU texels remain correct after trimming. A second differently patterned small upload reuses the original smallest-fitting buffer when retained; with zero retention it still returns every correct byte. The large texture remains intact after this subsequent upload. Device remains healthy in all three fresh processes. No fake fence completion or shader dispatch. This verifies the actual allocated idle-pool cap and data correctness, not OS resident-RAM reduction, in-flight retirement under a stalled GPU, native Windows, title memory peaks, or improved frame times. Lowering the cap can increase allocation churn/stutter; no new default recommended without matched real loading measurements. The fixture's retained-capacity figures are not RSS. Linux6.17/i7-13620H/16 GiB RAM/8 GiB VRAM, NVIDIA590.48.1, masking disabled; diagnostic-relaxed-vtable vkd3d2576c0b4adfae4a+, not stock certification. All guards unchanged. GPUpeak238 MiB, availableRAM minimum9120.3 MiB. Evidence Next useful owner measurement: matched burst/reuse workload or loading trace with allocation count and frame-time tails at a smaller retention cap, separating idle capacity from pending uploads and actual resident memory. |
|
I checked the activity-line wording on RTX 5070 / NVIDIA 616.92 at head A queue fence held the upload until released. While its upload fence was incomplete, the line reported The focused test passed with no skips. The queued count therefore includes completed staging buffers awaiting reclamation; it is not an exact measure of bytes the GPU still has to read. Wording such as “submitted upload buffers awaiting reclamation” would distinguish that accounting from fence progress. This is an activity-reporting observation, not an upload corruption or process-memory measurement. AI use: OpenAI Codex with GPT-6.2 Astra built and ran the fixture; Codex reviewed and prepared this report. |
The line said its second number was what the GPU had not read yet, but the count includes buffers whose upload finished and that wait for the next reclaim (andrewDoing's fixture on xcl-dev#3050: unchanged after the fence until reclaim ran). It now says what it counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks to all three of you. @Gevroska and @pickles976: agreed, the default stays at 512 MiB until a loading run with a smaller cap measures allocation churn and frame-time tails. The run in the description only measured what's kept idle (378 MB at 277 s). @andrewDoing: right, the second number includes finished uploads that are waiting for the next reclaim. 94b7a07 now words it as "submitted and not taken back yet". The new head's suite and smoke are in the description. AI use: Claude Code (Claude Opus 5.5) wrote this reply; Prime posted it. |
Refresh the existing PR xcl-dev#3050 on nvidia-dev. Preserve its configurable idle cap and submitted-versus-idle diagnostics, and cover actual allocation, trimming and reuse in isolated WARP processes without submitting GPU work. Keep active buffers alive and document that this limits system-memory upload heaps, not live textures or total process commit. Original implementation: d6d529c and 94b7a07 (Prime / Claude Code). Refreshed and tested with Codex (GPT-6).
94b7a07 to
cbb909c
Compare
|
Tested Exact I ran
2 passed, 0 failed, 0 ignored, 0 runtime skips. Both native processes exited 0, with 1,808 tests filtered out each. Not tested Physical GPUs, cross-queue or queue-release behavior, pool reuse, process memory, timing, retail smoke, or the full suite. AI use T3 Code through the Codex harness ( |
|
Thanks, Prime. On my RTX 3080, lowering the cap from 512 to 128 MiB reduced peak sampled idle upload capacity from 504 to 124 MiB and increased staging-buffer allocations from 15 to 64 during loading. I’d keep the 512 MiB default. The allocation trade-off showed up clearly, but the two runs didn’t isolate the cap’s effect on frame times. I used the same instrumented build based on
All 59 evictions at 128 MiB occurred about 60–140 seconds after Confirm. Present intervals were already longer in that run during the first 45 seconds, before its first eviction. The p99 ordering also changed with the observation window: over the first 90 seconds, p99 was 657.1 ms at 128 MiB and 1,116.4 ms at 512 MiB. I wouldn’t attribute the higher full-window p99 to the smaller cap from this pair alone. An initial 512 MiB attempt hit I used OpenAI Codex with GPT-6.2 Sol to implement and calibrate the measurement and run the comparison. A separate GPT-6.2 Sol agent verified the saved evidence. GPT-6.2 Astra drafted this comment. I reviewed and approved this comment before posting. |
|
Current-main integration check for #3050 head I revised my earlier suggested adaptation after checking its lock behavior. Cloning queue handles under the registry lock fixes compilation, but blocking on each queue state can pause the shared activity/PSO-pressure sampler while upload reclamation waits on the GPU, for up to 10 seconds in that path. The uncommitted candidate below uses The new I have not run the full workspace suite or paired clean-commit title smoke for this uncommitted integration. The author should rebase, apply or adapt the diff, and run those gates on the clean new head. Current-main integration and nonblocking diagnostic diffdiff --git a/README.md b/README.md
index e5b02cfa..994e1530 100644
--- a/README.md
+++ b/README.md
@@ -337,7 +337,7 @@ Fill the reusable DXIL cache ahead of a run with the read-only package wrapper.
- `XCL_UPLOAD_KEEP_MB`: the most completed texture-upload buffers to keep for reuse, in MiB
(default 512, range 0–4096; `0` releases them all). This limits idle system-memory upload
heaps; buffers still in use and textures in video memory are unaffected. The activity log
- reports idle upload memory separately from uploads waiting for completion.
+ reports idle upload memory separately from submitted buffers awaiting reclamation.
- `XCL_SKIP_BINK`: skips the Bink 2 movies of a title that ships a `bink2*.dll` (its logos and
intros), by taking them straight to their last frame without decoding. Off when unset or `0`,
`off`, `false` or `no`; `all` also skips looping movies; any other value (`1`, `intro` …)
diff --git a/crates/xcl/src/hle/d3d12x/title_textures.rs b/crates/xcl/src/hle/d3d12x/title_textures.rs
index 6371a317..050fe24b 100644
--- a/crates/xcl/src/hle/d3d12x/title_textures.rs
+++ b/crates/xcl/src/hle/d3d12x/title_textures.rs
@@ -2584,8 +2584,13 @@ pub(super) fn forget_queue(id: super::present::QueueId) {
/// The memory line of the texture upload buffers (`XCL_ACTIVITY`): system memory the process holds
/// for them, idle, and submitted but not yet taken back (`reclaim`: done on the GPU or not).
pub fn upload_line() -> String {
- let in_flight: u64 = ON_QUEUE.lock().unwrap().values().map(|q| q.bytes).sum();
- format!("texture upload buffers: {} MB idle, {} MB submitted and not taken back yet", texture_upload::idle_bytes() >> 20, in_flight >> 20)
+ let queues: Vec<_> = ON_QUEUE.lock().unwrap().values().cloned().collect();
+ let in_flight: Option<u64> = queues.iter().map(|q| q.try_lock().ok().map(|s| s.as_ref().map_or(0, |u| u.bytes))).sum();
+ let idle = texture_upload::idle_bytes() >> 20;
+ match in_flight {
+ Some(bytes) => format!("texture upload buffers: {idle} MB idle, {} MB submitted and not taken back yet", bytes >> 20),
+ None => format!("texture upload buffers: {idle} MB idle, submitted amount unavailable"),
+ }
}
/// upload buffers the GPU has not read yet, before a submit waits for it: a moment past the first,
@@ -4229,6 +4234,22 @@ pub(super) unsafe fn prepare_texture_download(
pub(super) mod tests {
use super::*;
+ #[test]
+ fn upload_line_does_not_wait_for_a_busy_queue() {
+ let state = Arc::new(Mutex::new(None));
+ let key = Arc::as_ptr(&state) as usize;
+ ON_QUEUE.lock().unwrap().insert(key, Arc::clone(&state));
+ let held = state.lock().unwrap();
+ let (tx, rx) = std::sync::mpsc::channel();
+ let worker = std::thread::spawn(move || tx.send(upload_line()).unwrap());
+ let sampled = rx.recv_timeout(std::time::Duration::from_secs(2));
+ drop(held);
+ worker.join().unwrap();
+ ON_QUEUE.lock().unwrap().remove(&key);
+ let line = sampled.expect("the activity sampler must not wait for upload reclamation");
+ assert!(line.contains("submitted amount unavailable"), "{line}");
+ }
+
/// A 64x64 R8 texture's upload from memory full of `value`, with that memory.
fn r8_item(texture: &ID3D12Resource, value: u8) -> (texture_upload::Item, Vec<u8>) {
let tex = Arc::new(xg::Texture::new(&console_desc(3, 64, 64, 1, 1, 61, 1)).unwrap());AI use: Codex (GPT-6.2 Sol) reproduced the compile and lock-wait failures, wrote the candidate and regression, and ran the checks; Codex (GPT-6.2 Astra) reviewed the queue-state and sampling invariants. |
|
merge-check |
bmjask
left a comment
There was a problem hiding this comment.
Critical review of current head cbb909c0. Current-main build blocker despite a text-clean merge: upload_line sums q.bytes over ON_QUEUE, but main changed its values to per-queue Arc<Mutex<Option<QueueUploads>>>; the merged tree fails with E0609. See the current-main integration report. Please rebase and read queue upload state through its lock after releasing the outer map lock, then rerun all-targets check and the WARP upload test. The configurable idle limit is otherwise scoped correctly; it does not bound active allocations. No local Windows run.
|
Review (head cbb909c, diff read, not a merge-check; draft with
Fine: only buffers whose fences completed reach the pool, so trimming is safe; the default stays 512 MiB; parsing and the 4096 cap are right; the tests run in separate WARP processes and fail without the switch. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
Test report (not a merge-check: draft, AI-written and posted by Foniass without a human check of each point. |
XCL_UPLOAD_KEEP_MBbounds completed texture-upload buffers retained for reuse (0–4096 MiB, default 512). Active buffers remain owned until completion. The activity log separates idle upload memory from submitted buffers awaiting reclaim. This addresses retained system-memory upload heaps; it does not cap live textures, VRAM or total process commit.Part of #2688; related to #2912's in-flight upload reclamation. This refreshes the existing proposal on
nvidia-dev54225f5884a94cd23b7aab3f703a7c975070aa77rather than opening another PR. Currentmaine429936c10a5b8aa09470ff99dfc8c8d3d8c56fduses a different uploader and does not contain this idle-pool switch.What is in it
Tested
cbb909c08ca786b4ddfeaf95b686aa105bec43e4; Windows x64, debug Rust tests, software WARP device. Commands below use the actual arguments with only the private build-cache path abbreviated as<target>.cargo test --locked -p xcl --lib --target-dir <target> hle::d3d12x::texture_upload::tests::the_idle_upload_buffers_kept_follow_the_switch -- --exact --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored, 0 explicit skips.cargo test --locked -p xcl --lib --target-dir <target> hle::d3d12x::texture_upload::tests::idle_upload_limit_releases_buffers_and_keeps_reusable_ones -- --exact --nocapture --test-threads=1: 1 top-level test passed, 0 failed, 0 ignored, 0 explicit skips; two child cases each passed separately. Nested summaries are not added to the top-level count.Regression run
Pending for this head. Previous-head smoke blocks and whole-suite results are historical and do not establish validation of this revision. Keep this PR a draft.
Not tested
AI use
Original implementation by Claude Code (Claude Opus 5.5), as recorded in the previous revision. Codex (GPT-6) rebased it, added the functional fixture/documentation, reviewed current-main overlap, and ran the focused checks above. Earlier contributors' results are not presented as new runs.
Optional temporary contributor/testing coordination: https://discord.gg/6B4TykyC4W