Sends: a submission's memory past what is kept is made at its own size (a 4 GiB upload buffer refused at world load) #3729

Closed
HQasper wants to merge 1 commit from upstream-pr/3729 into main
HQasper commented 2026-11-30 05:18:08 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by HQasper on 2026-11-30T05:18:08Z.


Related to #3024 and #2945 (the same refused 4 GiB upload buffer).

What it changes

A submission's own memory for what it sends up (VICTORY_SEND_OWN, host/send.rs) was made at the next power of two of what it sends, so that the next submission of about that size finds it as a spare.

At world load one submission sends from 1 GB to just past 2 GiB. The double of that is 4 GiB, and one upload buffer of 4096 MiB or more is refused on an RTX 5090 with 0x8007000E, with memory to spare (4095 MiB is made). The refusal then:

  • lets all spare buffers go for a second try (make_or_free_and_retry with free_all_spares), which also fails;
  • logs no upload buffer ... size=4294967296;
  • leaves the submission to send from the CPU sides, as with VICTORY_SEND_OWN=0.

Memory past what is kept as spares (kept(), 768 MiB on a large host) is never kept: give_back drops it at once. So it is now made at its own size, in 64 KiB steps. Below that it doubles as before.

What is in it: host/send.rs (made_size, used by memory), and two tests in the same file.

How it was found

Benchmark runs of the opening from one save (RTX 5090, ray tracing on, DLSS Quality) logged no upload buffer error=... (0x8007000E) size=4294967296 about 40 s into the run in 13 of 27 runs. The process had 30 GB committed of the PC's 70 GiB, and 7 of 46 GB of the card's shared memory in use.

A local probe (a backtrace for every CPU-visible buffer of 1 GiB or more) named the caller: send::take → Host::upload_buffer_maybe_wb → Host::upload_buffer_own. In two runs it asked for 1, 2 and 1 GiB, and for 4, 1 and 1 GiB; the 4 GiB one was refused.

How it was tested

  • New test a_send_past_what_is_kept_is_made_at_its_own_size: sizes below and above what is kept, a small host's limit, and that a send just past 2 GiB is made under 4 GiB.
  • New ignored test upload_sizes_this_card_makes (cargo test -p victory-gpu --release --lib -- --ignored upload_sizes_this_card_makes --nocapture), on the RTX 5090 with nothing else running: 1024, 2048, 3072, 4032 and 4095 MiB are made; 4096, 4097 and 5120 MiB are refused with 0x8007000E.
  • host::send tests: 4 passed, 2 ignored.
  • In game (the opening from one save, RTX 5090, 240 s runs, 2026-11-30; our play branch on 41adb551 with this commit against the same on f72cec77 without it, interleaved):
    • With it: no no upload buffer in 20 runs (0 of 8 with ray tracing).
    • Without it: 6 of 20 runs (6 of 8 with ray tracing), each size=4294967296.
    • The same branch on 41adb551 without this commit asked for 4 GiB and was refused in one of two probed runs, so the other changes between those bases do not avoid it.
    • Steady frame rate is the same on both branches within the runs' spread (they differ in more than this commit).

Checked for overlap

  • I searched the open pull requests for send.rs, VICTORY_SEND_OWN and no upload buffer (2026-11-30): #3395, #3411, #3381, #2587, #2811 and #1403 change send.rs, none of them this rounding. The issues #3024 (RTX 5090) and #2945 (RTX 5080) report the same refusal.

Written with Claude Code (Claude Opus 5.5); measured on my PC; reviewed by me.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5559470583 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3729). Originally posted by [HQasper](https://github.com/HQasper) on 2026-11-30T05:18:08Z. --- Related to #3024 and #2945 (the same refused 4 GiB upload buffer). ## What it changes A submission's own memory for what it sends up (`VICTORY_SEND_OWN`, `host/send.rs`) was made at the next power of two of what it sends, so that the next submission of about that size finds it as a spare. At world load one submission sends from 1 GB to just past 2 GiB. The double of that is 4 GiB, and one upload buffer of 4096 MiB or more is refused on an RTX 5090 with `0x8007000E`, with memory to spare (4095 MiB is made). The refusal then: - lets all spare buffers go for a second try (`make_or_free_and_retry` with `free_all_spares`), which also fails; - logs `no upload buffer ... size=4294967296`; - leaves the submission to send from the CPU sides, as with `VICTORY_SEND_OWN=0`. Memory past what is kept as spares (`kept()`, 768 MiB on a large host) is never kept: `give_back` drops it at once. So it is now made at its own size, in 64 KiB steps. Below that it doubles as before. **What is in it:** `host/send.rs` (`made_size`, used by `memory`), and two tests in the same file. ## How it was found Benchmark runs of the opening from one save (RTX 5090, ray tracing on, DLSS Quality) logged `no upload buffer error=... (0x8007000E) size=4294967296` about 40 s into the run in 13 of 27 runs. The process had 30 GB committed of the PC's 70 GiB, and 7 of 46 GB of the card's shared memory in use. A local probe (a backtrace for every CPU-visible buffer of 1 GiB or more) named the caller: `send::take` → `Host::upload_buffer_maybe_wb` → `Host::upload_buffer_own`. In two runs it asked for 1, 2 and 1 GiB, and for 4, 1 and 1 GiB; the 4 GiB one was refused. ## How it was tested - **New test** `a_send_past_what_is_kept_is_made_at_its_own_size`: sizes below and above what is kept, a small host's limit, and that a send just past 2 GiB is made under 4 GiB. - **New ignored test** `upload_sizes_this_card_makes` (`cargo test -p victory-gpu --release --lib -- --ignored upload_sizes_this_card_makes --nocapture`), on the RTX 5090 with nothing else running: 1024, 2048, 3072, 4032 and 4095 MiB are made; 4096, 4097 and 5120 MiB are refused with `0x8007000E`. - **`host::send` tests:** 4 passed, 2 ignored. - **In game** (the opening from one save, RTX 5090, 240 s runs, 2026-11-30; our play branch on 41adb551 with this commit against the same on f72cec77 without it, interleaved): - With it: **no `no upload buffer` in 20 runs** (0 of 8 with ray tracing). - Without it: 6 of 20 runs (6 of 8 with ray tracing), each `size=4294967296`. - The same branch on 41adb551 without this commit asked for 4 GiB and was refused in one of two probed runs, so the other changes between those bases do not avoid it. - Steady frame rate is the same on both branches within the runs' spread (they differ in more than this commit). ## Checked for overlap - [x] I searched the open pull requests for `send.rs`, `VICTORY_SEND_OWN` and `no upload buffer` (2026-11-30): #3395, #3411, #3381, #2587, #2811 and #1403 change `send.rs`, none of them this rounding. The issues #3024 (RTX 5090) and #2945 (RTX 5080) report the same refusal. --- Written with Claude Code (Claude Opus 5.5); measured on my PC; reviewed by me. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
dyshay commented 2026-11-30 05:49:52 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-30T05:49:52Z.


Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch janus-prs). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with --profile diag --features diagnostics, and the CPU tests of the touched crates pass. A run on an RTX 4090 is queued (Series S with ray tracing, DLSS Quality). Frame times will follow here.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7270045994 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3729#issuecomment-7270045994). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-30T05:49:52Z. --- Merged into our fork's integration branch for testing ([dyshay/VIctory-NVIDIA](https://github.com/dyshay/VIctory-NVIDIA/tree/janus-prs), branch `janus-prs`). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with `--profile diag --features diagnostics`, and the CPU tests of the touched crates pass. A run on an RTX 4090 is queued (Series S with ray tracing, DLSS Quality). Frame times will follow here.
Dukestar69 commented 2026-11-30 06:14:16 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-11-30T06:14:16Z.

Review: APPROVED


Tested locally merged onto main (41adb551).

  • Merge: Clean merge in crates/victory-gpu/src/host/send.rs.
  • Tests (RTX 5090):
    • cargo test -p victory-gpu --lib host::send:: passed.
    • cargo test -p victory-gpu --lib host::upq:: passed (4 passed; 0 failed; 1 ignored).
  • 0 new warnings.

Clean fix sizing unretained submission upload allocations to their exact requested size instead of rounding past 4 GiB. LGTM.

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

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review:6107641929 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3729#pullrequestreview-6107641929). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-30T06:14:16Z. **Review:** APPROVED --- Tested locally merged onto `main` (`41adb551`). - **Merge**: Clean merge in `crates/victory-gpu/src/host/send.rs`. - **Tests (RTX 5090)**: - `cargo test -p victory-gpu --lib host::send::` passed. - `cargo test -p victory-gpu --lib host::upq::` passed (`4 passed; 0 failed; 1 ignored`). - 0 new warnings. Clean fix sizing unretained submission upload allocations to their exact requested size instead of rounding past 4 GiB. LGTM. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

Pull request closed

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
trustno1-coder/VIctory-NVIDIA!3729
No description provided.