[pr-docs][memory] resource: the first-upload allowance's doc says what its 80% ceiling is weighed against #416

Open
iBooM72 wants to merge 1 commit from iboom72/docs/first-upload-ceiling-doc into main AGit
Contributor

What it changes

  • The problem on main: read from the code, and one local log line (v2026.12.03.02, RTX 4070 Ti 12 GB, DARNER_TEXTURE_ROOM_PERCENT=80): "first host textures admitted just over the room line in the last 5 seconds: 13880 … 13880 allowed, 0 refused" while the room line said "no room, new textures wait" (9,084 MB weighed against 8,721 MB).

The doc of room_for_first_upload (crates/darner-gpu/src/resource.rs:3476) calls the allowance "small, hard-capped" and says "It never crosses 80% of the card's budget". first_upload_decision weighs that ceiling against the bytes in host copies of textures only; its comment at :3595 records why that was changed on purpose. So the card as a whole can pass the room line and 80% through first uploads, until the whole-card guard stops them. The doc now says that. Comment only.

A question this leaves for the maintainer, not answered here: with DARNER_TEXTURE_ROOM_PERCENT=80 the ceiling (line + 128 MB, at most 80%) equals the line, so DARNER_TEXTURE_FIRST_UPLOAD_MB changes nothing. Is that meant?

How it was tested

  • Tested revision: 6901f0e2
  • Commands and results:
    • cargo clippy -p darner-gpu --all-targets --locked -- -D warnings: clean.
    • cargo test -p darner-gpu --lib --locked first_upload: 10 passed, 0 failed.
  • Changes a default: no
  • A/B result: not applicable (comment only).
  • Gates run on that revision (the three in AGENTS.md; there is no CI): none of the three in full. Run instead: clippy for darner-gpu with all targets, and the unit tests named above. Not run: clippy over the whole workspace, clippy with --all-features, cargo test --workspace.
  • Gameplay, when relevant: not run in the game (comment only).
  • Hardware dependence: none.
  • Coverage gaps: the log figure is from one run on one PC.

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only).
    • A doc comment only.
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: #50, #220, #335 and #345 change resource.rs elsewhere (no hunk within 30 lines).
  • Replaces or overlaps: none found. No open PR's diff names first_upload or FIRST_UPLOAD. The forge's search for room_for_first_upload finds no PR and one open issue whose text does not contain the name; "first upload" as words returns many reports that quote the log line, none about the doc.

🤖 Generated with Claude Code

## What it changes - The problem on main: read from the code, and one local log line (v2026.12.03.02, RTX 4070 Ti 12 GB, `DARNER_TEXTURE_ROOM_PERCENT=80`): "first host textures admitted just over the room line in the last 5 seconds: 13880 … 13880 allowed, 0 refused" while the room line said "no room, new textures wait" (9,084 MB weighed against 8,721 MB). The doc of `room_for_first_upload` (`crates/darner-gpu/src/resource.rs:3476`) calls the allowance "small, hard-capped" and says "It never crosses 80% of the card's budget". `first_upload_decision` weighs that ceiling against the bytes in host copies of textures only; its comment at `:3595` records why that was changed on purpose. So the card as a whole can pass the room line and 80% through first uploads, until the whole-card guard stops them. The doc now says that. **Comment only.** A question this leaves for the maintainer, not answered here: with `DARNER_TEXTURE_ROOM_PERCENT=80` the ceiling (line + 128 MB, at most 80%) equals the line, so `DARNER_TEXTURE_FIRST_UPLOAD_MB` changes nothing. Is that meant? ## How it was tested - Tested revision: `6901f0e2` - Commands and results: - `cargo clippy -p darner-gpu --all-targets --locked -- -D warnings`: clean. - `cargo test -p darner-gpu --lib --locked first_upload`: 10 passed, 0 failed. - Changes a default: no - A/B result: not applicable (comment only). - Gates run on that revision (the three in AGENTS.md; there is no CI): none of the three in full. Run instead: clippy for `darner-gpu` with all targets, and the unit tests named above. Not run: clippy over the whole workspace, clippy with `--all-features`, `cargo test --workspace`. - Gameplay, when relevant: not run in the game (comment only). - Hardware dependence: none. - Coverage gaps: the log figure is from one run on one PC. ## Checklist - [x] I ran this change in the game, or say below why it can't be (docs, tests only). - A doc comment only. - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: #50, #220, #335 and #345 change `resource.rs` elsewhere (no hunk within 30 lines). - Replaces or overlaps: none found. No open PR's diff names `first_upload` or `FIRST_UPLOAD`. The forge's search for `room_for_first_upload` finds no PR and one open issue whose text does not contain the name; "first upload" as words returns many reports that quote the log line, none about the doc. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The doc of `room_for_first_upload` said the allowance "never crosses 80%
of the card's budget". `first_upload_decision` weighs that ceiling
against the bytes in host copies of textures only (its comment records
why), so the card as a whole can pass the room line and 80% through it.
The doc says so now. Comment only.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
First-time contributor

The distinction here is zero versus a positive allowance. When the effective room line is already at or above 80% of the budget, every positive allowance uses the same 80% ceiling. A value of zero still disables this fallback when the ordinary room check refuses the upload.

The two checks also count different bytes. Ordinary room can be exhausted by total card use, while the first upload can still fit below the ceiling on title texture copies. The separate whole-card check still applies. That explains how the quoted log can show first uploads allowed alongside an ordinary room refusal.

The distinction here is zero versus a positive allowance. When the effective room line is already at or above 80% of the budget, every positive allowance uses the same 80% ceiling. A value of zero still disables this fallback when the ordinary room check refuses the upload. The two checks also count different bytes. Ordinary room can be exhausted by total card use, while the first upload can still fit below the ceiling on title texture copies. The separate whole-card check still applies. That explains how the quoted log can show first uploads allowed alongside an ordinary room refusal.
Author
Contributor

Thanks, that is right, and my sentence was too wide. With DARNER_TEXTURE_ROOM_PERCENT=80 every positive value of DARNER_TEXTURE_FIRST_UPLOAD_MB gives the same ceiling, but 0 still turns the allowance off (first_upload_decision returns AllowanceOff). So the size stops mattering there and the on/off does not, which answers the question in the description. The doc comment in the diff does not make that claim and stays as it is.

🤖 Generated with Claude Code

Thanks, that is right, and my sentence was too wide. With `DARNER_TEXTURE_ROOM_PERCENT=80` every positive value of `DARNER_TEXTURE_FIRST_UPLOAD_MB` gives the same ceiling, but `0` still turns the allowance off (`first_upload_decision` returns `AllowanceOff`). So the size stops mattering there and the on/off does not, which answers the question in the description. The doc comment in the diff does not make that claim and stays as it is. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/416/head:iboom72/docs/first-upload-ceiling-doc'
git switch 'iboom72/docs/first-upload-ceiling-doc'

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 'iboom72/docs/first-upload-ceiling-doc'
git switch 'iboom72/docs/first-upload-ceiling-doc'
git rebase 'main'
git switch 'main'
git merge --ff-only 'iboom72/docs/first-upload-ceiling-doc'
git switch 'iboom72/docs/first-upload-ceiling-doc'
git rebase 'main'
git switch 'main'
git merge --no-ff 'iboom72/docs/first-upload-ceiling-doc'
git switch 'main'
git merge --squash 'iboom72/docs/first-upload-ceiling-doc'
git switch 'main'
git merge --ff-only 'iboom72/docs/first-upload-ceiling-doc'
git switch 'main'
git merge 'iboom72/docs/first-upload-ceiling-doc'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!416
No description provided.